* feat: 适配 zed acp 协议
* docs: 完善 acp 文档
* feat: integrate feature branches + daemon/job 命令层级化 + 跨平台后台引擎
Cherry-picked from origin/lint/preview (637c908), excluding lint-only changes.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: correct detectMimeFromBase64 to decode raw bytes from base64
Cherry-picked from origin/lint/preview (ee36954).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: daemon 子进程 spawn 跨平台修复 + CliLaunchSpec 集中化重构
Cherry-picked from origin/lint/preview (c5f52cd), excluding lint-only formatting changes.
- 新建 src/utils/cliLaunch.ts: 集中化 CLI 子进程启动层
- 修复 --daemon-worker=kind 等号格式解析
- 修复 daemon/bg fast path 缺少 setShellIfWindows()
- 修复 checkPathExists 用 existsSync 替代 execSync('dir')
- 7 个 spawn 站点迁移到 CliLaunchSpec
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: merge tsconfig.base.json into tsconfig.json with full compiler options
The cherry-pick from 637c908 dropped jsx/strict/etc settings when removing
tsconfig.base.json. This commit restores them in a single tsconfig.json.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: merge tsconfig.base.json into tsconfig.json with full compiler options
The cherry-pick from 637c908 dropped jsx/strict/etc settings when removing
tsconfig.base.json. This commit restores them in a single tsconfig.json.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
- Fix stop_reason always null in assembled AssistantMessage by applying
the value captured from message_delta event
- Reset partialMessage to null after message_stop to prevent duplicate
AssistantMessage emission causing doubled content in next API request
- Forward computed maxTokens into buildOpenAIRequestBody as max_tokens
so OpenAI-compatible endpoints receive the intended output cap
- Extract assembleFinalAssistantOutputs helper to deduplicate message
assembly logic between message_stop handler and post-loop fallback
- Fix test helper to use events parameter instead of hidden global
- Add regression test for max_tokens request forwarding
Signed-off-by: guunergooner <tongchao0923@gmail.com>
Eliminate unsafe `as any` casts across 21 non-test source files,
replacing them with specific type annotations:
- Bridge transport: use StdoutMessage type for write/writeBatch calls
- print.ts: type msg.request as Record<string, unknown> for unknown
SDK control subtypes; use StdoutMessage for output.enqueue()
- API providers (openai/grok/gemini): import ChatCompletion types,
type streams as AsyncIterable<ChatCompletionChunk>, type request
bodies as ChatCompletionCreateParamsStreaming
- Computer use executor: use Partial<ResolvePrepareCaptureResult>
for cross-platform screenshot result
- Components: replace Ink color string casts with proper typing
- Win32 bridge: type stdin as Writable after null check
All 2453 tests pass with 0 failures.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Apply proper TypeScript type corrections without any unsafe casts:
- Fix unknown/never/{} types from decompilation
- Correct function signatures and parameter types
- Add missing type declarations and interfaces
- Fix Ink component prop types
- Update API client/provider type annotations
Test files with mock data casts are included as-is (acceptable pattern).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: Add DeepSeek thinking mode support for OpenAI compatibility layer
- Add DeepSeek reasoning models support (deepseek-reasoner and DeepSeek-V3.2)
- Automatic thinking mode detection based on model name
- Inject thinking parameters in request body (both official API and vLLM formats)
- Preserve reasoning_content in message conversion for tool call iterations
- Extract buildOpenAIRequestBody() for testability
- Treat multimodal inputs (e.g. images) as new turn boundaries
- Fix env var cleanup in tests to prevent state leak
Signed-off-by: guunergooner <tongchao0923@gmail.com>
* docs: update contributors
---------
Signed-off-by: guunergooner <tongchao0923@gmail.com>
Co-authored-by: guunergooner <18660867+guunergooner@users.noreply.github.com>
Fixes#168
OpenAI requires that an assistant message with tool_calls be immediately
followed by tool messages. Previously, convertInternalUserMessage
output user content before tool results, causing 400 errors.
Now tool messages are pushed first.
Add xAI Grok as a new API provider. Reuses OpenAI-compatible message/tool
converters and stream adapter with Grok-specific client and model mapping.
Default model mapping:
opus → grok-4.20-reasoning
sonnet → grok-3-mini-fast
haiku → grok-3-mini-fast
Users can customize mapping via:
- GROK_MODEL env var (override all)
- GROK_MODEL_MAP env var (JSON family map, e.g. {"opus":"grok-4"})
- GROK_DEFAULT_{FAMILY}_MODEL env vars
Activation: CLAUDE_CODE_USE_GROK=1 or modelType: "grok" in settings.json
Also integrates with /provider command for runtime switching.
Two fixes for OpenAI-compatible provider compatibility:
1. Sanitize JSON Schema `const` → `enum` in tool parameters.
Many OpenAI-compatible endpoints (Ollama, DeepSeek, vLLM, etc.)
do not support the `const` keyword in JSON Schema. Recursively
convert `const: value` to `enum: [value]` which is semantically
equivalent.
2. Force stop_reason to `tool_use` when tool_calls are present.
Some backends incorrectly return finish_reason "stop" even when
the response contains tool_calls. Without this fix, the query
loop treats the response as a normal end_turn and never executes
the requested tools.