Commit Graph

38 Commits

Author SHA1 Message Date
James Feng
957076c5bd feat: 恢复 Chrome MCP 浏览器自动化支持
- 添加 scripts/setup-chrome-mcp.mjs(从上游恢复)
- 添加 docs/features/chrome-use-mcp.md 使用文档
- 恢复 postinstall 中的 Chrome MCP 设置步骤
- CI 中加 CLAUDE_CODE_SKIP_CHROME_MCP_SETUP=1 避免无 Chrome 环境失败
2026-06-04 17:27:58 +08:00
James Feng
e806327608 feat: npm 离线打包脚本 — scripts/pack-npm.sh
一键构建 + 打包为 ccp-<version>.tgz:
  bash scripts/pack-npm.sh

目标机器安装(需要 Bun):
  npm install -g ./ccp-2.6.5.tgz
  ccp --version

产物 5.5MB,包含 dist-nosplit/cli.js + bin wrapper
2026-06-04 16:13:29 +08:00
claude-code-best
2074f6463f fix: 修复 linux 端的安装问题 2026-06-04 14:51:33 +08:00
claude-code-best
e1e2378795 feat: fork-agent-redesign — 新增 AgentTool fork 参数与 spec 设计文档
为 AgentTool 引入 fork 布尔参数,支持子代理从父对话上下文中 fork 出独立分支,
继承完整历史、系统提示和模型配置。重构 inputSchema 条件逻辑以适配 fork 模式。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-04 13:01:20 +08:00
claude-code-best
db84f971b4 perf: 优化内存与遥测管理,启用 Vite minify
- 禁用 HISTORY_SNIP feature flag 并新增 proactiveTruncate 防止无 compact_boundary 时内存无限增长
- 跳过未启用 telemetry 时的 OTel 初始化,防止长会话 PerformanceMeasure 堆积
- OTel 导出遇 401/403 自动关闭 reader,防止 handle 泄漏
- Vite 构建启用 minify

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-04 11:03:27 +08:00
claude-code-best
241aca1e0f feat: 添加 GitHub 集成命令(issue、share、autofix-pr)
- /issue: 通过 gh CLI 创建 GitHub issue,支持标签/指派
- /share: 会话日志分享到 GitHub Gist,支持密钥脱敏
- /autofix-pr: 自动修复 CI 失败的 PR,进度追踪
- launchCommand: 共享命令启动器

Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-06-04 09:56:20 +08:00
James Feng
64ca325020 feat: add local analytics sink for self-analysis
- localSink.ts: writes every logEvent to ~/.claude/local_analytics.jsonl
- Modified index.ts: logEvent() now writes locally in parallel with upstream sinks
- analyze_analytics.py: Python analysis script — event stats, tool rankings,
  time distribution, security events, RL preference signals

No upstream data flow is affected. Local writes are non-blocking append.
Testing: one -p 'hello' captured 32 events across 19 event types.
2026-06-04 01:15:36 +08:00
James Feng
cdd62520eb feat(upstream): sync b1c4f40f ACP fix + WorkflowTool top-level require()
Codex cherry-pick:
- b1c4f40f: fix ACP extended thinking + tool_use 连续 user 消息导致 400
  → src/utils/messages.ts: ensureToolResultPairing 检查连续 user 消息
  → src/utils/tests/messages.test.ts: 新增测试(冲突手动解决)

James 兜底:
- tools.ts: WorkflowTool lazy getter → top-level require (MonitorTool 模式)
  移除 initBundledWorkflows() 调用(经确认是 no-op)
  原因: lazy getter 在 splitting:true 下运行时触发 chunk load 死锁

审核结论:
- 上游 a91653a0/6dd378bf/efc218d8 已存在(之前已合入)
- 上游 9d17597e autofix-pr 回流跳过(大规模改动,stub 无基础)
- WORKFLOW_SCRIPTS 仍禁用: top-level require 在 splitting:true 下
  触发 WorkflowTool chunk 循环死锁(非加载模式问题,是 chunk 依赖图过深)

当前 splitting:true 启用状态:
  MONITOR_TOOL  | WORKFLOW_SCRIPTS  | 其他 features 

验证: --version / -p / --print / 源码模式 全部通过
2026-06-02 14:45:21 +08:00
James Feng
21f126b76a feat(build): splitting:true + MONITOR_TOOL 恢复 + WorkflowTool lazy getter
Codex 完成:
- build.ts: splitting: false → true (562 files code-split 构建)
- defines.ts: MONITOR_TOOL 重新启用(require() 迁移后无死锁)
- 验证 splitting:true 产物 -p/--print 全部正常

James 兜底:
- tools.ts: WorkflowTool IIFE → lazy getter (getWorkflowTool)
  避免模块初始化时的 chunk 加载死锁,但 WORKFLOW_SCRIPTS 仍因
  更深的 chunk 依赖图问题 hang,暂时保持禁用
- getAllBaseTools() 中 WorkflowTool 引用改为 lazy getter

状态:
| splitting:true | 562 files  |
| MONITOR_TOOL   | enabled    |
| WORKFLOW_SCRIPTS | disabled (lazy getter 不足) |

验证: --version / -p / --print / 源码模式 全部通过
2026-06-02 14:22:42 +08:00
James Feng
98bb25636b refactor(tools): static import → require() 迁移 + 兜底修复
Codex 完成:
- tools.ts: 7 个 static import (指向空壳 stub) → require("@claude-code-best/builtin-tools/...")
  涉及: SleepTool, CronTools, RemoteTriggerTool, MonitorTool, SendUserFileTool,
  PushNotificationTool, TeamCreateTool, TeamDeleteTool, SendMessageTool, WorkflowTool
- PermissionRequest.tsx: MonitorTool require() 指向 builtin-tools
- TeamCreateTool/DeleteTool/SendMessageTool 用 lazy require() 打破循环依赖

兜底修复:
- defines.ts: 保持 MONITOR_TOOL + WORKFLOW_SCRIPTS 禁用
  原因: builtin-tools 里的真工具 import "src/..." 产生跨包循环引用
  在 splitting:true 下触发 chunk 间死锁,在 splitting:false 下触发 ESM 初始化死锁
  这是逆向工程的结构性限制,非简单修复能解决

验证: --version / -p / --print / 源码模式 全部通过
2026-06-02 13:41:47 +08:00
James Feng
0e9d6955f0 fix(build): 修复构建产物 hang 死 + 空 tool name (4 stub NAME="")
Root cause: Bun code splitting + MONITOR_TOOL/WORKFLOW_SCRIPTS stub 触发循环 ESM 死锁;
4 个 prompt.ts stub 的 NAME 常量为空字符串导致 API 400 error.

Fix:
- build.ts: splitting: false
- defines.ts: 禁用 MONITOR_TOOL, WORKFLOW_SCRIPTS
- 4 个 prompt.ts: 补全正确 tool name

验证: --version / -p / --print 三种模式全部通过
2026-06-02 12:55:30 +08:00
James Feng
e26d4e61a3 feat: enable PROACTIVE feature flag in default build
Add 'PROACTIVE' to DEFAULT_BUILD_FEATURES in scripts/defines.ts.
The proactive state machine (src/proactive/index.ts) and SleepTool
were already fully recovered; only the glue function
notifyAutomationStateChanged was missing — restored in d1d74d4a.

With PROACTIVE enabled, the autonomous agent can use SleepTool to
pause/resume its own tick cycle, saving tokens during idle periods.
2026-06-02 01:45:42 +08:00
James Feng
39ba9a56fd feat: pull in Vite build system + complete packages/builtin-tools/
- Add Vite as alternative build (vite.config.ts, scripts/vite-plugin-*)
- Add dab04af7 RSS fix (distRoot, ripgrep path, post-build)
- Pull in packages/builtin-tools/ (+354 files)
- Pull in packages/agent-tools/, mcp-client/, acp-link/, weixin/
- Copy defines.ts from upstream for Vite compatibility
- Update package.json with Vite scripts and deps
2026-06-01 18:18:03 +08:00
claude-code-best
2da6514095
feat: 支持自托管的 remote-control-server (#214)
* feat: 支持自托管的 remote-control-server (#214)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-04-09 17:40:50 +08:00
Dosion
0c53796d15
feat: restore daemon supervisor and remoteControlServer command (#170)
Reverse-engineer the missing daemon + remoteControlServer implementation
by tracing the call chain from existing code:

- src/daemon/main.ts: restore from stub to full supervisor (spawn/monitor
  workers, exponential backoff restart, graceful shutdown)
- src/daemon/workerRegistry.ts: restore from stub to worker dispatcher
  (remoteControl kind → runBridgeHeadless())
- src/commands/remoteControlServer/: new slash command /remote-control-server
  (alias /rcs) for managing the daemon from REPL
- build.ts + scripts/dev.ts: enable DAEMON feature flag

Both official CLI 2.1.92 and our codebase had the command registered in
commands.ts but the directory and daemon implementation were missing.
The bottom layer (runBridgeHeadless in bridgeMain.ts) was already complete.

Co-authored-by: unraid <local@unraid.local>
2026-04-07 15:36:29 +08:00
Dosion
33949ce5a2
Merge pull request #156 from amDosion/feat/ultraplan-enablement
feat: enable /ultraplan and harden GrowthBook fallback chain
2026-04-06 22:09:28 +08:00
unraid
1b47333d72 feat: enable GrowthBook local gate defaults for P0/P1 features
Add LOCAL_GATE_DEFAULTS mapping in growthbook.ts with 27 feature gate
defaults (25 boolean + 2 object config). Insert local defaults into the
fallback chain of all getter functions so they work regardless of whether
GrowthBook is enabled or disabled:

  env overrides → config overrides → in-memory cache → disk cache
  → LOCAL_GATE_DEFAULTS → caller defaultValue

P0 (local): keybindings, streaming tool exec, cron, JSON tools,
ultrathink, explore/plan agents, deep link, immediate model switch
P1 (API): session memory, auto memory, prompt suggestions, brief mode,
verification agent, away summary, auto dream, idle return prompt
Kill switches: 10 gates kept true to prevent remote disable

New compile flags: AGENT_TRIGGERS, ULTRATHINK, BUILTIN_EXPLORE_PLAN_AGENTS,
LODESTONE, EXTRACT_MEMORIES, VERIFICATION_AGENT, KAIROS_BRIEF, AWAY_SUMMARY

Bypass all local defaults: CLAUDE_CODE_DISABLE_LOCAL_GATES=1
2026-04-06 17:00:30 +08:00
claude-code-best
dee2ffd638 feat: 支持简化版本的 rg 下载 2026-04-06 10:31:15 +08:00
claude-code-best
27825293bb
Merge pull request #140 from amDosion/feat/enable-safe-feature-flags
feat: enable SHOT_STATS, PROMPT_CACHE_BREAK_DETECTION, TOKEN_BUDGET
2026-04-05 21:10:50 +08:00
unraid
96f6d2c7d5 feat: enable SHOT_STATS, PROMPT_CACHE_BREAK_DETECTION, TOKEN_BUDGET feature flags
Enable 3 verified compile-only feature flags in build.ts and dev.ts defaults:

- SHOT_STATS: local shot distribution statistics in /stats panel
- PROMPT_CACHE_BREAK_DETECTION: internal cache key change diagnostics
- TOKEN_BUDGET: support +500k syntax for minimum output token targets

All 3 flags verified by 6 parallel sub-agents + independent Codex CLI review.
Build passes (475 files), zero new test failures.

Also adds:
- docs/features/feature-flags-codex-review.md: Codex review findings
- Marks all enabled flags in feature-flags-audit-complete.md
- Adds openai dependency (needed for OpenAI compat layer)
2026-04-05 21:07:38 +08:00
xuzhongpeng
714ef13e68 fix: resolve absolute path in dev.ts for cross-directory execution
The dev script previously used a relative path "src/entrypoints/cli.tsx" which would fail when executed from outside the project root directory.

Changes:
- Add path resolution using import.meta.url to locate project root
- Use absolute path for cli.tsx entry point
- Set cwd option in Bun.spawnSync to ensure correct working directory

This allows running "bun run /path/to/scripts/dev.ts" from any directory.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 18:04:12 +08:00
claude-code-best
c99021d5a3 fix: 尝试修复 windows 下面没有 unzip 的问题 2026-04-04 17:02:39 +08:00
arc
6a3fd223fc fix issues/114: bun install报错download-ripgrep MODULE_NOT_FOUND 2026-04-04 14:49:04 +08:00
claude-code-best
86d2c8f9e8 Merge remote-tracking branch 'amDosion/feat/computer-use-windows' 2026-04-04 00:12:52 +08:00
unraid
e3264a1691 feat: enable Computer Use with macOS + Windows + Linux support
Phase 1: Replace @ant/computer-use-mcp stub (12 files, 6517 lines).

Phase 2: Remove 8 macOS-only guards in src/:
- main.tsx: remove getPlatform()==='macos' check
- swiftLoader.ts: remove darwin-only throw
- executor.ts: extend platform guard, clipboard dispatch, paste key
- drainRunLoop.ts: skip CFRunLoop pump on non-darwin
- escHotkey.ts: non-darwin returns false (Ctrl+C fallback)
- hostAdapter.ts: non-darwin permissions granted
- common.ts: dynamic platform + screenshotFiltering
- gates.ts: enabled:true, subscription check removed

Phase 3: Add Linux backends (xdotool/scrot/xrandr/wmctrl):
- computer-use-input/backends/linux.ts (173 lines)
- computer-use-swift/backends/linux.ts (278 lines)

Verified on Windows x64: mouse, screenshot, displays, foreground app.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 23:17:14 +08:00
unraid
7ae94327fb feat: enable /voice mode with native audio binaries
Restore voice input by:
- Copying official cpal-based audio-capture.node binaries (6 platforms)
- Replacing SoX subprocess stub with native .node loader
- Adding VOICE_MODE to default build features

All voice source files in src/ already match the official CLI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 21:14:44 +08:00
Dosion
eb86e34094
Merge pull request #88 from amDosion/feat/enable-schedule-remote-agents
feat: enable /schedule by adding AGENT_TRIGGERS_REMOTE to default features
2026-04-03 20:07:21 +08:00
claude-code-best
a6bef45113 fix: 修复 rg 文件的传入 2026-04-03 19:45:43 +08:00
claude-code-best
cf44cc32e4 Merge branch 'pr/amDosion/60' 2026-04-03 17:21:09 +08:00
claude-code-best
c9c14c816f feat: 简化 debug 方式 2026-04-03 16:47:24 +08:00
unraid
74e51e7e73 feat: enable Remote Control (BRIDGE_MODE) with stub completions
- Add BRIDGE_MODE to DEFAULT_FEATURES in dev.ts
- Implement peerSessions.ts: cross-session messaging via bridge API
- Implement webhookSanitizer.ts: redact secrets from webhook payloads
- Replace any stubs in controlTypes.ts with Zod schema-inferred types
- Fix tengu_bridge_system_init default to true for app "active" status

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 03:50:36 +08:00
claude-code-best
919cf55591 feat: 添加开发者默认开启的 feature 2026-04-02 21:48:50 +08:00
claude-code-best
be82b71c3e feat: 补全 auto mode 分类器 prompt 模板,支持 FEATURE_* 环境变量注入
- 重建 yolo-classifier-prompts/ 三个缺失的 prompt 文件
- dev.ts/build.ts 扫描 FEATURE_* 环境变量注入 Bun --feature
- AUTO_MODE_ENABLED_DEFAULT 由 feature flag 决定,开 feature 即开 auto mode
- 补充 docs/safety/auto-mode.mdx prompt 模板章节

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 21:18:39 +08:00
claude-code-best
88b45e0e6c chore: 删除垃圾脚本 2026-04-02 21:00:41 +08:00
claude-code-best
28e40ddc67 refactor: 用 Bun 原生 define 替换 cli.tsx 中的 globalThis 注入
- 删除 cli.tsx 顶部的 globalThis.MACRO / BUILD_* / feature polyfill
- 新增 scripts/defines.ts 作为 MACRO define 映射的单一来源
- 新增 scripts/dev.ts,通过 bun run -d 在转译时注入 MACRO 常量
- build.ts 引用 getMacroDefines() 实现构建时内联
- 清理 global.d.ts (移除 BUILD_*, MACRO 函数声明)
- 55 个 MACRO 消费文件零改动

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 09:51:48 +08:00
claude-code-best
173d18bea8 feat: 添加代码健康度检查脚本
scripts/health-check.ts 汇总项目各维度指标:
代码规模、lint 问题、测试结果、冗余代码、构建状态和产物大小。
新增 health script 一键运行。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-01 07:17:09 +08:00
claude-code-best
d7a729ca68 feat: 完成第二版类型清理 2026-03-31 23:03:47 +08:00
claude-code-best
bd756cc369 feat: 完成stub 2026-03-31 20:40:16 +08:00