Commit Graph

521 Commits

Author SHA1 Message Date
James Feng
83abbbc2fe chore: restore local telemetry infrastructure 2026-06-07 02:32:06 +08:00
claude-code-best
af7af8cc9d docs: effort 级别描述去掉模型名限制 2026-06-07 01:53:10 +08:00
claude-code-best
9ae258f917 feat: sideQuery 支持第三方 provider 路由 (OpenAI/Grok/Gemini)
- 新增 getProviderPrimaryModel() 从环境变量解析 provider 主模型
- getDefaultOpus/Sonnet/HaikuModel 在第三方 provider 下回退到用户配置的主模型
- sideQuery 根据 provider 类型分发到对应的 API 适配器
- 新增 sideQueryViaOpenAICompatible (OpenAI + Grok) 和 sideQueryViaGemini 适配函数
- 避免 sideQuery 后台任务在配置第三方端点时仍请求 Anthropic API
2026-06-07 01:52:34 +08:00
claude-code-best
b9fcd991cc fix: 防止 MCP 工具调用失败后的 SearchExtraTools/ExecuteExtraTool 死循环 2026-06-07 01:49:38 +08:00
claude-code-best
8f01d5cc59 fix: 明确告知 agent SearchExtraTools/ExecuteExtraTool 是核心工具,已在工具列表中
- prompts.ts: 核心工具列表显式加入 SearchExtraTools, ExecuteExtraTool
- claude.ts: 非 delta 路径提示强调这两个工具可直接调用
- messages.ts: delta 路径渲染强调这两个工具已在工具列表中
- SearchExtraToolsTool/prompt.ts: 加入完整两步工作流示例
- ExecuteTool/prompt.ts: 加入完整两步工作流示例
2026-06-07 01:48:54 +08:00
claude-code-best
6ee204417e fix: 将 ExecuteExtraTool 加入 ASYNC_AGENT_ALLOWED_TOOLS 允许子代理执行延迟工具 2026-06-07 01:48:14 +08:00
claude-code-best
620e3f133d fix: 修复 BriefTool 循环依赖导致 isBriefEnabled 未定义
将模块顶层 require() 改为懒加载函数 getBriefToolModule(),
延迟到实际调用时才加载模块,避免循环依赖时模块尚未完成初始化。
2026-06-07 01:47:44 +08:00
claude-code-best
fd80bb2887 fix: prevent crash when DiscoverSkills receives undefined query via ExecuteExtraTool
searchSkills() called .trim() on query without null-guard. When
DiscoverSkills is invoked through ExecuteExtraTool with missing
description, query is undefined, causing 'Cannot read properties of
undefined (reading trim)'.

Fixed with optional chaining: !query.trim() → !query?.trim()

Co-Authored-By: deepseek-v4-pro <deepseek-ai@claude-code-best.win>
2026-06-07 01:47:44 +08:00
18243133
5232696017 Fix/plan paste fixes (#1238)
* fix: 降低 paste 检测阈值,修复非 bracketed-paste 终端粘贴文本损坏

非 bracketed-paste 终端下,短粘贴(<800 chars)的 stdin chunk 作为独立
keystroke 走 useTextInput.onInput 路径,闭包中 cursor 未刷新导致多次插入
竞态。现将 ≥3 字符的非特殊键输入纳入 paste 累积模式,绕过逐 chunk 处理。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* @
fix: Plan模式三处缺陷修复 — ExploreAgent可用性 + 弹窗一致性 + 方案文件保护

1. areExplorePlanAgentsEnabled()移除GrowthBook A/B实验依赖(tengu_amber_stoat),
   始终返回true,确保Explore/Plan agent在BUILTIN_EXPLORE_PLAN_AGENTS开启时始终可用

2. ExitPlanMode clear-context路径补setNeedsPlanModeExitAttachment(true),
   确保清除上下文退出Plan模式后生成plan_mode_exit附件

3. Plan mode full/sparse指令强化Plan文件读取要求:
   "can read" -> "MUST use FileRead to read first before any changes",
   新增"do NOT overwrite"禁止覆盖,Phase 1指令强化并行Explore Agent引导

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@

---------

Co-authored-by: psj88520 <qq18243133@gmail.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-07 01:47:21 +08:00
claude-code-best
22424f39f2 fix: normalizeMessagesForAPI 不再跨 tool_result 边界合并同 ID assistant 消息 (CC-1215)
ACP 模式下 extended thinking + tool_use 同一 turn 时,StreamingToolExecutor
在两个同 message.id 的 AssistantMessage 之间插入 tool_result,导致向后遍历
合并跨越边界,产生重复 tool_use ID → 孤立 tool_result → 连续 user 消息 → 400。

修改向后遍历停止条件:遇到非 assistant 消息(含 tool_result)即停止,不再跳过。
2026-06-07 01:46:55 +08:00
James F
8a301dcf74 security: close telemetry leak in preconnectAnthropicApi startup path (#1253)
🔒 Security Discovery: Un-gated outbound connection bypasses privacy controls

Summary
-------
preconnectAnthropicApi() unconditionally sends a TCP+TLS handshake to
api.anthropic.com on every ccb startup — even when the user has explicitly
disabled all non-essential traffic via CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
or DISABLE_TELEMETRY=1.

This is the LAST un-gated outbound connection in the entire startup path.
Every other telemetry sink (Sentry, Langfuse, OpenTelemetry, GrowthBook,
1P Event Logger, Datadog, BigQuery, etc.) already respects the
privacyLevel module's isEssentialTrafficOnly() gate. This one did not.

Impact
------
While the preconnect is a HEAD request with no payload, the connection
itself leaks the client's IP address and session timing to Anthropic's
infrastructure. For privacy-conscious users and enterprise deployments
that have disabled telemetry, this constitutes an unexpected data leak.

Fix
---
Add isEssentialTrafficOnly() check at the function entry, consistent
with every other privacy-gated code path in the codebase. The
privacyLevel module is already imported by init.ts and 12+ other
modules — no new dependencies.

Verification
------------
Reproduced and verified via strace on Linux (aarch64):

  # Before fix
  $ strace -f -e connect ccb -p <<< 'hello'
  connect(16, sin_addr=inet_addr("160.79.104.10"), sin_port=htons(443)) = 0
  # ↑ connector to api.anthropic.com despite CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1

  # After fix
  $ strace -f -e connect ccb -p <<< 'hello'
  # ↑ zero remote TCP connections — all traffic to localhost only

Changes: 1 file, +5 lines (import + gate)
2026-06-07 01:46:17 +08:00
James Feng
b21ed0506b chore: sync providers.ts (Grok), Config.tsx, poorMode.ts from upstream 2026-06-07 01:19:47 +08:00
claude-code-best
1201d88c37 docs: 添加 ToolSearch 设计指南 + 禁用 turn-zero 工具推荐弹窗
- 新增 docs/design/tool-search-design-guide.md,涵盖架构、搜索算法、执行管道、演进历史
- 禁用 getTurnZeroSearchExtraToolsPrefetch,消除用户输入时的频繁弹窗
- inter-turn 发现机制保持不变

Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-06-07 00:56:16 +08:00
James Feng
75fa212759 chore: remove skillLearning subsystem — unused, incompatible with CCP telemetry approach 2026-06-06 22:27:08 +08:00
James Feng
d04846f5b8 chore: checkpoint — restore 40+ upstream files, fix 21 syntax errors, build passes 2026-06-06 22:17:14 +08:00
James Feng
be722795da chore: merge fcbc8822 — remove 113 unused imports and dead code
- 95 files modified (307 deletions, 92 insertions)
- Removed unused React imports from ~55 components
- Cleaned ~50 unused imports/variables/parameters
- 10 files skipped (version drift, CCP structure differences)

Source: upstream CCB fcbc8822
Note: --no-verify — pre-existing TS1005 errors in 130 remaining stubs
2026-06-06 21:18:36 +08:00
James Feng
3013db2d3e chore: merge upstream cleanup — 536 stubs + 17 dead files + 4 as any fixes
c07ad4c7: delete 536 unreferenced auto-generated type stubs + yoga-layout
d0915fc8: delete 17 dead files/dirs + fix 4 as any → precise types
  - warningHandler.ts: remove unused resetWarningHandler()
  - dxt/helpers.ts: errs as any → as string[] | undefined
  - mcpInstructionsDelta.ts: msg.attachment! as any → precise
  - sessionTitle.ts: 2× as any → precise (origin, content)

Source: upstream CCB c07ad4c7, d0915fc8
2026-06-06 21:12:01 +08:00
James Feng
2020a84ba9 feat: port mode system with 6 AI personality presets from CCB upstream (9947ae75)
- /mode command to switch between 6 interaction modes
- Default (), Gentle (🌸), Dr. Sharp (🔍), Workhorse (🐴), Token Saver (💰), Super AI (🧠)
- Each mode: distinct system prompt, UI theme, permission defaults, response verbosity
- Custom modes via YAML in ~/.claude/modes/
- Source: upstream 9947ae75 (YYMa, PR #1255)
2026-06-06 21:05:00 +08:00
James Feng
5dd3cc30e6 fix: copy ripgrep vendor binary to both dist/ and dist-nosplit/
Previously only vendor/audio-capture was copied. Ripgrep was left to a
postinstall download script, but no-split builds have no postinstall step.
Now both builds get the ripgrep binary directly.
2026-06-06 08:30:30 +08:00
James Feng
15150dfe0b fix: copy vendor binaries (ripgrep, audio-capture) to dist-nosplit output
The no-split build omitted vendor/ripgrep/ and vendor/audio-capture/,
causing Glob/Grep/Bash tools to fail with ENOENT when CCP runs from
dist-nosplit/. The split build (dist/) already did this copy in step 4;
now the no-split build (dist-nosplit/) does it too.
2026-06-06 08:28:23 +08:00
James Feng
9c5df5d1a6 test: add regression test for settings path collision guard
Verify that when CWD equals the Claude config home directory
(/home/spark), projectSettings and localSettings do not override
userSettings. This prevents settings.local.json from silently
clobbering the user's explicit configuration.

4 tests:
- Guard active: local does NOT override user when CWD=/home/spark
- Guard inactive: local DOES override user when CWD≠/home/spark
- Edge: no settings files → empty result
- Edge: empty settings.local.json → no errors

Uses existing tests/mocks/state.ts mock infrastructure.
2026-06-06 01:26:19 +08:00
James Feng
95f0c99584 fix(settings): prevent ~/.claude/ localSettings from overriding userSettings
When CWD is the home directory, projectSettings and localSettings
resolve to files inside ~/.claude/ (e.g. settings.local.json). These
are not legitimate project-level files — they are user config files
that should not take priority over explicit userSettings.

Added a guard in loadSettingsFromDisk() that skips projectSettings
and localSettings when their resolved path is under the user's
claude config home directory.

Fixes: CCP --settings flag and default settings loading not working
when ~/.claude/settings.local.json contains model overrides.
2026-06-06 01:07:53 +08:00
James Feng
18f5f99e7d fix: resolve all 14 test failures to 0
- Remove duplicate notifyAutomationStateChanged that shadowed real impl (sessionState 3→0)
- Fix messages.ts stub: re-export instead of type-only (ExecuteTool/VaultHttpFetch mock leaks)
- Fix CWD-dependent paths in queryModelOpenAI and VaultHttpFetch tests (use import.meta.url)
- Add missing logger.ts stub for remote-control-server
- CI: add --isolate flag, baseline 14→0
- Tests: 3643 pass,14 fail → 3857 pass,0 fail (--isolate)
2026-06-05 01:17:04 +08:00
James Feng
2c27fd8075 fix: update CI test baseline from 7 to 14 (pre-existing upstream merge failures) 2026-06-05 00:49:05 +08:00
James Feng
88684f156b fix: 重新生成 bun.lock 以包含 React Web UI 新依赖
CI 使用 --frozen-lockfile,package.json 加了 @radix-ui/*、@ai-sdk/react、
ai、jsqr、qrcode 等依赖后 bun.lock 未同步导致 Instal dependencies 失败
2026-06-05 00:35:30 +08:00
James F
be915f0542
Merge pull request #3 from GhostDragon124/acp
docs: v2.3.0 版本表,统计 52→59,SSH/BRIDGE 描述更新
2026-06-05 00:24:11 +08:00
GhostDragon124
289974dc57 docs: update contributors 2026-06-05 00:17:49 +08:00
James Feng
c52943b61e docs: v2.3.0 版本表,统计 52→59,SSH/BRIDGE 描述更新 2026-06-05 00:07:21 +08:00
James Feng
d952cf155a docs: v2.3.0 版本表,统计 52→59,SSH/BRIDGE 描述更新 2026-06-05 00:06:33 +08:00
GhostDragon124
f3414e7507 docs: update contributors 2026-06-04 16:04:09 +00:00
James Feng
5922051b91 Merge branch 'acp' 2026-06-05 00:03:47 +08:00
James Feng
d356625952 docs: VOICE_MODE + KAIROS_BRIEF 标注为休眠,同步上游合并统计
- VOICE_MODE: 🟡 需 Anthropic OAuth 凭证,CCP API Key 模式无可用
- KAIROS_BRIEF: 🟡 依赖 KAIROS,KAIROS 本身不可用
- 统计: 52→59 merged,新增 RCS/Web + SSH Remote 计数
2026-06-05 00:02:24 +08:00
unraid
1b6ae3d378 feat: 实现 SSH Remote — 本地 REPL + 远端工具执行
Commit: 03811f97
10 files changed, 2010 insertions(+), 15 deletions(-)
SSHSessionManager, SSHAuthProxy, SSHProbe, SSHDeploy + 17 tests + docs
defines.ts kept CCP's curated feature flag list (SSH_REMOTE already present)
2026-06-04 23:53:33 +08:00
claude-code-best
2d05da1096 feat: remote control 支持 auto bind 功能 (#300)
* feat: acp-link 支持 --group 参数指定 channel group

- 添加 --group CLI flag,校验格式 [a-zA-Z0-9_-]+
- 支持 ACP_RCS_GROUP 环境变量 fallback
- 传递 channelGroupId 到 RcsUpstreamClient
- 更新 README 文档说明 --group 和相关环境变量

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: RCS 后端 session 复用与 group 绑定

- storeFindEnvironmentByMachineName 匹配 offline 状态,防止重连创建重复 session
- registerEnvironment 复用已有 session 而非每次新建
- EnvironmentResponse 返回 channel_group_id 字段
- 注册时将 session 绑定到 group ID,支持 web UI 按 group 查询
- apiKeyAuth 不再设置 uuid,由 uuidAuth 统一处理

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: Web UI Token Manager — 多 token 切换与 session 隔离

- 新增 useTokens hook 管理 localStorage token CRUD
- 新增 TokenManagerDialog 弹窗组件(添加/编辑/删除/切换 token)
- api client 支持Bearer token 认证,UUID 跟随 token 变化
- Navbar 添加 token 切换按钮
- 切换 token 时自动 reload,实现 session 数据隔离

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: 修复 useTokens useState 初始化函数签名错误

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-04 23:53:13 +08:00
claude-code-best
c112237e5c fix: 替换 web 端 crypto.randomUUID 为 uuid 库以支持 HTTP 环境
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-04 23:53:13 +08:00
claude-code-best
d719508733 feat: ACP 协议版本 remote control (#293)
Commit: 2e9aaf49
54 files changed — ACP protocol + RCS bridge enhancements
CCP-specific files (CLAUDE.md, mint.json, package.json, prompts.ts) kept ours
2026-06-04 23:53:06 +08:00
James Feng
056231d02b feat: 支持 acp-link 包进行 acp 通用的 remote-control (#292)
Commit: 34154ee
142 files changed — React Web UI 迁移 + acp-link 完善
2026-06-04 23:52:35 +08:00
James Feng
7f4dcfbabf feat(remote-control): 优化 Web 展示、状态同步与桥接控制流程 (#288)
Commit: 72a2093c
64 files changed, 4139 insertions(+), 313 deletions(-)
2026-06-04 23:51:54 +08:00
Cheng Zi Feng
d1176325a4 fix(remote-control): harden self-hosted session flows (#278)
Co-authored-by: chengzifeng <chengzifeng@meituan.com>
2026-06-04 23:50:24 +08:00
James Feng
f4a2fc542e docs: fix SSH_REMOTE (stub) and BRIDGE_MODE (RCS verified working) 2026-06-04 23:30:59 +08:00
James Feng
faf3327868 docs: fix Sentry status — not removed, dormant like Langfuse (set SENTRY_DSN to activate) 2026-06-04 23:00:56 +08:00
James Feng
11dde90c4a docs: update README — full capability audit (Chrome/Computer Use, /dream, Langfuse dormant, GrowthBook local fallback) 2026-06-04 22:58:18 +08:00
GhostDragon124
aefbc7072f docs: update contributors 2026-06-04 14:40:18 +00:00
James Feng
a92144c344 docs: update README — main absorbs acp, factual numbers (52 MERGE, 586 files, ACP ) 2026-06-04 22:39:06 +08:00
James Feng
580bcfa56a merge: bring main (ccp-core baseline) into acp 2026-06-04 22:34:34 +08:00
claude-code-best
0397506694 chore: merge 4 upstream commits — Grok adapter, OpenAI image, CodeRabbit fix, tsc fix 2026-06-04 21:30:40 +08:00
James Feng
c7961967da docs: sync 光明和阴影面 doc + update README numbers to 3699
- Copy doc from user manual to docs/
- Quality table: 3383 → 3699 (+692)
- Local dev section: 3383 tests → 3699 tests
- Version table: add v2.2.1, v2.2.2 entries
2026-06-04 21:04:06 +08:00
James Feng
7eb5530b2c docs: sync 光明和阴影面 doc + update README numbers to 3699
- Copy doc from user manual to docs/
- Quality table: 3383 → 3699 (+692)
- Local dev section: 3383 tests → 3699 tests
- Version table: add v2.2.1, v2.2.2 entries
2026-06-04 21:03:57 +08:00
James Feng
0ced3044eb docs: update test badge to 3699 2026-06-04 21:02:58 +08:00
James Feng
f2df2d7d85 docs: update test badge to 3699 2026-06-04 21:02:38 +08:00