feat: 增加对 Windows CLI 工具的支持,允许使用 cmd 作为首选 shell,并改进错误处理

This commit is contained in:
catlog22
2026-02-20 11:14:22 +08:00
parent 113d0bd234
commit d6bf941113
10 changed files with 174 additions and 28 deletions

View File

@@ -152,7 +152,9 @@ async function fetchApi<T>(
if (contentType && contentType.includes('application/json')) {
try {
const body = await response.json();
// Check both 'message' and 'error' fields for error message
if (body.message) error.message = body.message;
else if (body.error) error.message = body.error;
if (body.code) error.code = body.code;
} catch (parseError) {
// Silently ignore JSON parse errors for non-JSON responses
@@ -6344,7 +6346,8 @@ export interface CreateCliSessionInput {
workingDir?: string;
cols?: number;
rows?: number;
preferredShell?: 'bash' | 'pwsh';
/** Shell to use for spawning CLI tools on Windows. */
preferredShell?: 'bash' | 'pwsh' | 'cmd';
tool?: string;
model?: string;
resumeKey?: string;