claude-code-best
e4ce08fe39
Fixture/langfuse record auto mode data error ( #308 )
...
* fix: 修复状态栏 context 计数器在 loading 时闪现为 0 的问题
第三方 API(如智谱)在 message_start 中可能不返回完整 usage 数据,
导致 getCurrentUsage 返回全零 usage 对象,使 ctx 显示为 0%。
双重保护:
- getCurrentUsage: 跳过全零 usage,继续往前找有真实数据的 message
- calculateContextPercentages: totalInputTokens 为 0 时返回 null
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
* fix: 外部化 ESM 包使用 createRequire 替代裸 require
color-diff-napi、image-processor-napi、audio-capture-napi 声明
"type": "module" 但使用裸 require(),Node.js ESM 中 require
不可用。改用 createRequire(import.meta.url) 或顶层 import。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
* fix: getDefaultSonnetModel 优先使用用户配置的模型,修复第三方 provider 模型不存在错误
当用户通过 ANTHROPIC_MODEL 或 settings 配置了自定义 provider 支持的模型时,
getDefaultSonnetModel/Haiku/Opus 现在会优先使用该配置,而非硬编码 Anthropic 官方模型 ID。
同时改进 Langfuse 可观测性:sideQuery 失败时记录错误信息到 span,
optional 模式下标记 WARNING 而非 ERROR。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
* fix: 将 auto_mode classifier 的 side-query span 绑定到父 trace
classifyYoloAction 及 classifyYoloActionXml 接收 parentSpan 参数,
透传给 sideQuery 调用,使 auto_mode 的 side-query span 嵌套在主 agent trace 下。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
* fix: 穷鬼模式下跳过 memdir_relevance side-query
Poor mode 启用时不执行 findRelevantMemories 的预取调用,
避免额外的 API token 消耗。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
* chore: 添加 test:all 脚本用于完成任务后的全量检查
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
* fix: Vite 构建补齐缺失的 feature flags,修复 auto mode 不可见
Vite 构建插件的 DEFAULT_BUILD_FEATURES 缺少 BUDDY、TRANSCRIPT_CLASSIFIER、
BRIDGE_MODE、ACP、BG_SESSIONS、TEMPLATES,导致 feature('TRANSCRIPT_CLASSIFIER')
被替换为 false,auto mode 从 Shift+Tab 循环中消失。与 build.ts 对齐。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
* fix: 统一 feature flags 到 defines.ts,修复 Vite 构建缺失 auto mode
将 DEFAULT_BUILD_FEATURES 列表从 build.ts、dev.ts、vite-plugin-feature-flags.ts
三处内联定义统一到 scripts/defines.ts 单一导出。之前的 Vite 插件缺少
TRANSCRIPT_CLASSIFIER 等 feature flag,导致 auto mode 在 Vite 构建中不可见。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com >
2026-04-20 13:30:05 +08:00
claude-code-best
bddd146f25
feat: 重构供应商层次 ( #286 )
...
* refactor: 创建 @anthropic-ai/model-provider 包骨架与类型定义
- 新建 workspace 包 packages/@anthropic-ai/model-provider
- 定义 ModelProviderHooks 接口(依赖注入:分析、成本、日志等)
- 定义 ClientFactories 接口(Anthropic/OpenAI/Gemini/Grok 客户端工厂)
- 搬入核心类型:Message 体系、NonNullableUsage、EMPTY_USAGE、SystemPrompt、错误常量
- 主项目 src/types/message.ts 等改为 re-export,保持向后兼容
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
* refactor: 提升 OpenAI 转换器和模型映射到 model-provider 包
- 搬入 OpenAI 消息转换(convertMessages)、工具转换(convertTools)、流适配(streamAdapter)
- 搬入 OpenAI 和 Grok 模型映射(resolveOpenAIModel、resolveGrokModel)
- 主项目文件改为 thin re-export proxy
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
* refactor: 搬入 Gemini 兼容层到 model-provider 包
- 搬入 Gemini 类型定义、消息转换、工具转换、流适配、模型映射
- 主项目 gemini/ 目录下文件改为 thin re-export proxy
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
* refactor: 搬入 errorUtils 并迁移消费者导入到 model-provider
- 搬入 formatAPIError、extractConnectionErrorDetails 等 errorUtils
- 迁移 10 个消费者文件直接从 @anthropic-ai/model-provider 导入
- 更新 emptyUsage、sdkUtilityTypes、systemPromptType 为 re-export proxy
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
* feat: compact 模型降级为 -1 模式(Opus→Sonnet, Sonnet→Haiku)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
* docs: 添加 agent-loop 绘图
* Revert "feat: compact 模型降级为 -1 模式(Opus→Sonnet, Sonnet→Haiku)"
This reverts commit e458d6391d .
* docs: 添加简化版 agent loop
* fix: 修复 n 快捷键导致关闭的问题
* fix: 修复 node 下 ws 没打包问题
* docs: 修复链接
* test: 添加测试支持
* fix: 修复类型问题(#267 ) (#271 )
* fix: 修复 Bun 的 polyfill 问题
* fix: 类型修复完成
* feat: 统一所有包的类型文件
* fix: 修复构建问题
* test: 修复类型校验 (#279 )
* fix: 修复 Bun 的 polyfill 问题
* fix: 类型修复完成
* feat: 统一所有包的类型文件
* fix: 修复构建问题
* fix(remote-control): harden self-hosted session flows (#278 )
Co-authored-by: chengzifeng <chengzifeng@meituan.com >
* docs: update contributors
* build: 新增 vite 构建流程
* feat: 添加环境变量支持以覆盖 max_tokens 设置
* feat(langfuse): LLM generation 记录工具定义
将 Anthropic 格式的工具定义转换为 Langfuse 兼容的 OpenAI 格式,
并在 generation 的 input 中以 { messages, tools } 结构传入,
以便在 Langfuse UI 中查看完整的工具定义信息。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
* feat: 添加对 ACP 协议的支持 (#284 )
* feat: 适配 zed acp 协议
* docs: 完善 acp 文档
* chore: 1.4.0
* conflict: 解决冲突
* feat: 添加测试覆盖率上报
* style: 改名加移动文件夹位置
* refactor: 移动测试用例及实现
* test: 修复测试用例完成
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com >
Co-authored-by: Cheng Zi Feng <1154238323@qq.com >
Co-authored-by: chengzifeng <chengzifeng@meituan.com >
Co-authored-by: claude-code-best <272536312+claude-code-best@users.noreply.github.com >
2026-04-17 09:33:14 +08:00
claude-code-best
c8d08d235b
Feat/integrate lint preview ( #285 )
...
* 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 >
2026-04-16 20:59:29 +08:00
claude-code-best
1a4e9702c2
fix: 修复类型问题( #267 ) ( #271 )
...
* fix: 修复 Bun 的 polyfill 问题
* fix: 类型修复完成
* feat: 统一所有包的类型文件
* fix: 修复构建问题
2026-04-15 10:54:00 +08:00
claude-code-best
7e15974be9
feat: 实现 4 个 NAPI 包 — modifiers/image-processor/audio-capture/url-handler
...
- modifiers-napi: 使用 Bun FFI 调用 macOS CGEventSourceFlagsState 检测修饰键
- image-processor-napi: 集成 sharp 库,macOS 剪贴板图像读取 (osascript)
- audio-capture-napi: 基于 SoX/arecord 的跨平台音频录制
- url-handler-napi: 完善函数签名(保持 null fallback)
- 修复 image-processor 类型兼容性问题
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-04-01 01:07:42 +08:00
claude-code-best
3d4cb096d1
feat: monorepo 构建完成
2026-03-31 21:21:46 +08:00