@go-hare/claude-code 2.6.37 → 2.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +109 -275
  2. package/package.json +16 -11
package/README.md CHANGED
@@ -1,150 +1,55 @@
1
- # Claude Code
1
+ # Claude Code(go-hare)
2
2
 
3
- [![GitHub Stars](https://img.shields.io/github/stars/claude-code/claude-code?style=flat-square&logo=github&color=yellow)](https://github.com/claude-code/claude-code/stargazers)
4
- [![GitHub Contributors](https://img.shields.io/github/contributors/claude-code/claude-code?style=flat-square&color=green)](https://github.com/claude-code/claude-code/graphs/contributors)
5
- [![GitHub Issues](https://img.shields.io/github/issues/claude-code/claude-code?style=flat-square&color=orange)](https://github.com/claude-code/claude-code/issues)
6
- [![GitHub License](https://img.shields.io/github/license/claude-code/claude-code?style=flat-square)](https://github.com/claude-code/claude-code/blob/main/LICENSE)
7
- [![Last Commit](https://img.shields.io/github/last-commit/claude-code/claude-code?style=flat-square&color=blue)](https://github.com/claude-code/claude-code/commits/main)
8
- [![Bun](https://img.shields.io/badge/runtime-Bun-black?style=flat-square&logo=bun)](https://bun.sh/)
9
-
10
- > Which Claude do you like? The open source one is the best.
11
-
12
- 本项目是基于官方 Claude Code CLI 工具进行源码还原、工程化重建与能力增强的开源项目。目标是在保留 Claude Code 交互体验的基础上,补齐多模型接入、远程控制、ACP、群控、MCP、插件、KAIROS 常驻助手、Buddy agent 宠物、可观测性与本地自动化等能力。
13
-
14
- | 特性 | 说明 |
15
- | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
16
- | **Claude 群控技术** | Pipe IPC 多实例协作:同机 main/sub 自动编排 + LAN 跨机器零配置发现与通讯,`/pipes` 选择面板 + `Shift+↓` 交互 + 消息广播路由 |
17
- | **ACP 协议一等一支持** | 支持接入 Zed、Cursor 等 IDE,支持会话恢复、Skills、权限桥接 |
18
- | **Remote Control 私有部署** | Docker 自托管远程界面, 可以手机上看 CC |
19
- | **Agents / BG 后台会话** | `claude agents` 全屏 dashboard、daemon job dispatch、`/exit` 后台移交(resume/fork)、WMI 自启与 Windows 终端稳固 |
20
- | **Fullscreen densable** | 对齐官方 2.1.210:fullscreen 默认开、滚轮/Jump-to-bottom、spinner 可见性恢复、alt-screen 退出序列防闪窗 |
21
- | **Langfuse 监控** | 企业级 Agent 监控, 可以清晰看到每次 agent loop 细节, 可以一键转化为数据集 |
22
- | **Web Search** | 内置网页搜索工具, 支持 bing 和 brave 搜索 |
23
- | **Poor Mode** | 穷鬼模式,关闭记忆提取和键入建议,大幅度减少并发请求,`/poor` 可以开关 |
24
- | **KAIROS 常驻助手** | 持久化 AI 助手模式,支持 brief 输出、后台等待、频道消息、每日记忆日志、PR 订阅与推送通知等主动 Agent 能力 |
25
- | **Buddy Agent 宠物** | 终端里的 AI 伙伴/宠物系统,支持 `/buddy` 唤出、陪伴展示、互动摸摸、上下文反应与提示输入联动 |
26
- | **Channels 频道通知** | MCP 服务器推送外部消息到会话(飞书/Slack/Discord/微信等),`--channels plugin:name@marketplace` 启用 |
27
- | **自定义模型供应商** | OpenAI/Anthropic/Gemini/Grok 兼容(`/login`);含 Sonnet 5 / Org default 映射 |
28
- | **Gateway / IdP 会话** | 过期 session 优先 tryRestore、secure-storage 负缓存、refreshable 会话恢复,避免静默回落 Bedrock |
29
- | Voice Mode | 语音输入,支持豆包语言输入(`/voice doubao`) |
30
- | Computer Use | 屏幕截图、键鼠控制 |
31
- | Chrome Use | 浏览器自动化、表单填写、数据抓取 |
32
- | Artifacts | HTML/Markdown 上传托管、代码高亮与 mermaid |
33
- | Sentry | 企业级错误追踪 |
34
- | GrowthBook | 企业级特性开关 |
35
- | /dream 记忆整理 | 自动整理和优化记忆文件 |
36
-
37
- ## 项目定位
38
-
39
- 当前主线已融合 `core-clean` 的 Agent Core / runtime 分层。这个项目不再只是一个反编译 CLI 的功能堆叠,而是面向终端交互、headless 嵌入、direct-connect、server、bridge、daemon、ACP 和远程控制场景的 AI coding runtime。
40
-
41
- 当前目标不是继续围绕单一 CLI 入口做大规模堆叠,而是:
3
+ [English README](./README_EN.md)
42
4
 
43
- - 保持 CLI / REPL 作为官方交互宿主
44
- - 将可复用执行能力下沉到 `src/core` / `AgentSession`
45
- - 让外部宿主通过 Agent Core 事件和 host adapter 接入
46
- - 保留本项目已有的多模型、群控、KAIROS、Buddy、Remote Control、ACP、MCP、插件与可观测性能力
47
- - 在不破坏主链行为的前提下持续收口 runtime 能力
5
+ [![GitHub Stars](https://img.shields.io/github/stars/go-hare/claude-code-1?style=flat-square&logo=github&color=yellow)](https://github.com/go-hare/claude-code-1/stargazers)
6
+ [![GitHub Issues](https://img.shields.io/github/issues/go-hare/claude-code-1?style=flat-square&color=orange)](https://github.com/go-hare/claude-code-1/issues)
7
+ [![Last Commit](https://img.shields.io/github/last-commit/go-hare/claude-code-1?style=flat-square&color=blue)](https://github.com/go-hare/claude-code-1/commits/main)
8
+ [![Bun](https://img.shields.io/badge/runtime-Bun-black?style=flat-square&logo=bun)](https://bun.sh/)
9
+ [![npm](https://img.shields.io/npm/v/@go-hare/claude-code?style=flat-square&logo=npm)](https://www.npmjs.com/package/@go-hare/claude-code)
48
10
 
49
- ## Core-Clean 增强对比
11
+ 基于官方 Claude Code CLI 的**源码还原 / 工程化重建**项目。目标是在保留 Claude Code 终端交互体验的同时,补齐多模型接入、自托管 Remote Control、ACP、daemon / 后台会话、MCP、插件与本地自动化等能力。
50
12
 
51
- 相比旧结构,这次融合后增强点主要是:
13
+ > 本仓库**不是** Anthropic 官方产品。商标与官方 Claude Code 权利归 [Anthropic](https://www.anthropic.com/) 所有;本项目仅供学习与研究。
52
14
 
53
- | 方向 | 旧结构 | 当前结构 |
54
- | ---- | ------ | -------- |
55
- | 执行主链 | CLI / REPL / server 各自直接接入 query lifecycle | `src/core` 提供 `AgentSession.stream()` 与 `AgentEvent` 主链 |
56
- | 宿主接入 | headless、ACP、bridge、server 各自维护适配逻辑 | `src/hosts/*` 统一承接 CLI、headless、REPL、server、remote-control、daemon、terminal |
57
- | runtime 能力 | 分散在入口、server、bridge、工具注册与状态模块中 | `src/runtime/capabilities/*` 收口 execution、server、bridge、daemon、mcp、persistence、tools、commands |
58
- | 外部嵌入 | 主要依赖 CLI 或 REPL 行为 | `./core` 包级入口为 headless embedding / direct-connect / server host 打基础 |
59
- | 事件协议 | SDKMessagestream-json、UI state、server packet 混在各宿主里 | `AgentEvent` 作为 core event contract,宿主再投影为 stdout、Ink、ACP、WebSocket/SSE |
60
- | 工具体系 | 工具列表直接面向当前入口装配 | runtime tool catalog 保留现有工具,同时提供统一描述、策略与过滤入口 |
15
+ | 能力 | 说明 |
16
+ | ---- | ---- |
17
+ | **多模型** | `/login` 配置 Anthropic / OpenAI / Gemini / Grok 兼容端点 |
18
+ | **Remote Control** | 自托管 RCS + Web UI;`claude remote-control` / bridge |
19
+ | **ACP** | Agent Client Protocol,可对接 IDE / 代理宿主 |
20
+ | **Agents / Daemon** | `claude agents` dashboard、daemon job、后台会话 resume / fork |
21
+ | **Fullscreen** | 对齐 densable 滚轮、Jump-to-bottomalt-screen 等交互 |
22
+ | **Poor Mode** | `/poor` 穷鬼模式:跳过记忆提取 / 建议等,降 token |
23
+ | **KAIROS / Buddy** | 常驻助手与终端 buddy(feature 可开关) |
24
+ | **Computer Use / Chrome** | 截图键鼠、Chrome MCP(平台完整度不一) |
25
+ | **Artifacts** | HTML 上传托管(独立 Cloudflare Worker 包) |
26
+ | **Voice** | 语音输入(含豆包 ASR 路径) |
27
+ | **Web Search** | 内置搜索工具 |
28
+ | **Langfuse** | Agent loop 可观测(可选) |
61
29
 
62
- ## 当前能力
30
+ 部分能力由 **feature flag** 控制(见下方);Analytics / GrowthBook / Sentry 等为占位实现,**不要当成可用企业集成**。
63
31
 
64
- - 交互式 CLI / REPL(fullscreen 默认开,对齐官方 2.1.210 滚轮 / sticky / Jump-to-bottom)
65
- - headless runtime session
66
- - direct-connect / server
67
- - ACP agent 模式
68
- - bridge / remote-control / daemon host(含 Windows WMI 自启与 exit 后台移交)
69
- - `claude agents` 后台会话 dashboard(分组 / PR 列 / needs-input nudge / token footer)
70
- - MCP、channels、plugins
71
- - OpenAI / Anthropic / Gemini / Grok 兼容模型接入(含 Sonnet 5 / Org default)
72
- - Buddy agent 宠物、KAIROS 常驻助手、Coordinator、task、subagent、team 主链
73
- - computer-use / chrome bridge / remote-control / artifacts 相关能力
74
- - Langfuse、Sentry、GrowthBook 等可观测性与企业集成能力
32
+ ---
75
33
 
76
- ## 近期更新(2.6.x)
34
+ ## 项目定位
77
35
 
78
- 对照近期 git 主线,已合入并发布到 npm 的方向包括:
36
+ 这是 **CLI-first** Claude Code 兼容运行时:
79
37
 
80
- | 版本区间 | 要点 |
81
- | -------- | ---- |
82
- | **2.6.37** | Windows taskkill 用 System32 绝对路径对齐 densable;Ctrl+C 退出前抢先关鼠标与 cleanup 避 move 残字(LOCAL) |
83
- | **2.6.36** | Windows taskkill/shell 探测 windowsHide,避免 Bash 中断与 /exit 闪窗(LOCAL) |
84
- | **2.6.35** | Windows 打包 rg.exe 主路径 spawn+windowsHide,避免 Grep/Glob 闪 conhost |
85
- | **2.6.34** | Jump-to-bottom 后立即恢复 spinner;agents 左箭头/daemon skew;CSI u 全角冒号等 |
86
- | **2.6.32–2.6.30** | alt-screen 双次 EXIT 防 Windows Terminal 多层闪窗;fullscreen / 滚轮 densable 对齐官方 2.1.210 |
87
- | **2.6.29** | modal 双线、滚轮残片与折叠空白修复;残差端口对齐 |
88
- | **2.6.x agents** | agents view 分组顺序 / review 列表 / done fold / PR 列 / fleet token / fleet needs-input / token footer |
89
- | **Gateway** | 过期 session tryRestore、IdP transient 重读、secure-storage 负缓存、显式 Gateway env 与 refreshable 恢复 |
90
- | **Daemon / exit** | `/exit` 走 daemon `submitDispatch(resume/fork)`;`cliLaunch` 优先稳定 user-bin;Windows WMI `Win32_Process.Create` densable |
91
- | **2.6.27 及前** | vendor 可执行权限 postinstall、Windows Bash/ripgrep、swarm banner 宽度、macOS 粘贴图片等 |
38
+ - 主交互宿主:`src/screens/REPL.tsx` + `src/main.tsx` / `src/entrypoints/cli.tsx`
39
+ - 查询主链:`src/query.ts` / `src/QueryEngine.ts`
40
+ - 工具:`packages/builtin-tools`(经 `@claude-code/builtin-tools` 导出)
41
+ - 远程 / 守护:`src/bridge/`、`src/daemon/`、`packages/remote-control-server/`
42
+ - ACP:`src/services/acp/`、`packages/acp-link/`
92
43
 
93
- 当前发布包版本见 `package.json`(`@go-hare/claude-code`)。
44
+ 仓库里**没有**独立的 `src/core` / `src/hosts` / `src/runtime` 包级 Agent Core 分层;旧文档里的 `createAgent from 'claude/core'`、`./core` 子路径描述已过时,请勿依赖。
94
45
 
95
- ## 使用 Agent Core
46
+ 近期主线在对齐 **densable 2.1.211** 的 agent / 会话 / 队列 / inbox / daemon 行为(git tag `v2.8.5` 合入前、`v2.8.6` 合入后)。**npm 包版本以 `package.json` / npm 为准**(当前发布线 **2.7.1**),与 git tag 可能不同步。
96
47
 
97
- 当前包级 core 入口已经通过 `package.json` 的 `./core` 子路径暴露:
48
+ ---
98
49
 
99
- ```ts
100
- import { createAgent } from 'claude/core'
101
- ```
50
+ ## 安装(npm)
102
51
 
103
- 仓库内部的 headless、ACP、direct-connect、server、bridge、daemon 等场景正在向 `src/core`、`src/hosts` 与 `src/runtime` 收口。外部接入不建议直接建立在 `src/screens/REPL.tsx` 上,优先选择下面这些方向:
104
-
105
- - headless embedding
106
- - direct-connect client
107
- - server host
108
- - bridge / remote-control host
109
- - daemon worker
110
- - ACP / IDE agent host
111
-
112
- ## 项目结构
113
-
114
- - [`src/entrypoints/cli.tsx`](src/entrypoints/cli.tsx)
115
- - CLI 入口与快速路径分发
116
- - [`src/entrypoints/core.ts`](src/entrypoints/core.ts)
117
- - 包级 Agent Core 入口
118
- - [`src/core`](src/core)
119
- - Agent Core session / turn / event 主链
120
- - [`src/runtime/capabilities/execution/SessionRuntime.ts`](src/runtime/capabilities/execution/SessionRuntime.ts)
121
- - 现有 query lifecycle 的 runtime execution asset
122
- - [`src/runtime`](src/runtime)
123
- - 内部 runtime capability 层
124
- - [`src/hosts`](src/hosts)
125
- - CLI、headless、REPL、server、remote-control、daemon、terminal 等宿主适配层
126
- - [`src/main.tsx`](src/main.tsx)
127
- - CLI 启动装配与模式分发
128
- - [`src/screens/REPL.tsx`](src/screens/REPL.tsx)
129
- - 官方终端交互宿主
130
- - [`src/query.ts`](src/query.ts)
131
- - turn loop 与 query orchestration
132
-
133
- ## 开发原则
134
-
135
- - CLI 主链优先稳定
136
- - REPL 只做交互宿主,不把执行中枢继续当成重构主战场
137
- - 新宿主优先通过 `src/core` / `AgentSession` / `src/hosts` / `src/runtime` 接入
138
- - 共享行为变更优先补测试
139
- - 不为“结构更优雅”发起高风险重排
140
-
141
- - 🚀 [想要启动项目](#-快速开始源码版)
142
- - 🐛 [想要调试项目](#vs-code-调试)
143
- - 📖 [想要学习项目](#teach-me-学习项目)
144
-
145
- ## ⚡ 快速开始(安装版)
146
-
147
- 不用克隆仓库, 从 NPM 下载后, 直接使用。本仓库发布的 scoped 包名为 **`@go-hare/claude-code`**(平台二进制在 `@go-hare/claude-code-<os>-<arch>` optionalDependencies)。
52
+ 发布包名:**`@go-hare/claude-code`**(平台二进制在 `@go-hare/claude-code-<os>-<arch>` optionalDependencies)。
148
53
 
149
54
  ```sh
150
55
  npm i -g @go-hare/claude-code
@@ -152,208 +57,137 @@ npm i -g @go-hare/claude-code
152
57
  # Windows 若 claude.exe 被占用导致 EBUSY,先结束占用进程再装
153
58
  # taskkill /F /IM claude.exe
154
59
 
155
- claude # 启动(postinstall 会把对应平台 native 二进制落到 bin/)
60
+ claude # 启动(postinstall 落到 bin/)
156
61
  claude --version
157
62
  claude agents # 后台会话 dashboard(需 daemon)
158
- claude update # 更新到最新版本
63
+ claude update # 更新
159
64
 
160
- # 自托管 Remote Control 示例
161
- CLAUDE_BRIDGE_BASE_URL=https://remote-control.claude-code.win/ \
162
- CLAUDE_BRIDGE_OAUTH_TOKEN=test-my-key \
65
+ # 自托管 Remote Control 示例(按你的 RCS 改 URL / token)
66
+ CLAUDE_BRIDGE_BASE_URL=https://your-rcs.example/ \
67
+ CLAUDE_BRIDGE_OAUTH_TOKEN=your-token \
163
68
  claude --remote-control
164
69
  ```
165
70
 
166
- > **安装/更新失败?** 先 `npm rm -g @go-hare/claude-code` 清理旧版本,再 `npm i -g @go-hare/claude-code@latest`。仍失败可钉版本:`npm i -g @go-hare/claude-code@2.6.37`。
167
- >
168
- > 旧文档里的全局包名 `claude-code` 已不再对应本仓库发布流;请使用 `@go-hare/claude-code`。
71
+ 安装失败时:`npm rm -g @go-hare/claude-code` 后再装 `@latest`(可钉版本 `@2.7.1`)。
72
+ 旧文档里的全局包名 `claude-code` **不再**对应本仓库发布流。
169
73
 
170
- ## ⚡ 快速开始(源码版)
74
+ ---
171
75
 
172
- ### ⚙️ 环境要求
76
+ ## 源码开发
173
77
 
174
- 一定要最新版本的 bun 啊, 不然一堆奇奇怪怪的 BUG!!! bun upgrade!!!
78
+ ### 环境
175
79
 
176
- - 📦 [Bun](https://bun.sh/) >= 1.3.11
177
-
178
- **安装 Bun:**
80
+ 需要较新的 [Bun](https://bun.sh/)(建议 1.3.11):
179
81
 
180
82
  ```bash
181
- # Linux macOS
182
- curl -fsSL https://bun.sh/install | bash
183
-
184
- # Windows (PowerShell)
185
- powershell -c "irm bun.sh/install.ps1 | iex"
83
+ curl -fsSL https://bun.sh/install | bash # macOS / Linux
84
+ # Windows: powershell -c "irm bun.sh/install.ps1 | iex"
85
+ bun upgrade
186
86
  ```
187
87
 
188
- **安装后的操作:**
189
-
190
- 1. **让当前终端识别 `bun` 命令**
191
-
192
- 安装脚本会把 `~/.bun/bin` 写入对应的 shell 配置文件。macOS 默认 zsh 环境通常会看到:
193
-
194
- ```text
195
- Added "~/.bun/bin" to $PATH in "~/.zshrc"
196
- ```
197
-
198
- 可以按安装脚本提示重启当前 shell:
199
-
200
- ```bash
201
- exec /bin/zsh
202
- ```
203
-
204
- 如果你使用 bash,重新加载 bash 配置:
205
-
206
- ```bash
207
- source ~/.bashrc
208
- ```
209
-
210
- Windows PowerShell 用户关闭并重新打开 PowerShell 即可。
211
-
212
- 2. **验证 Bun 是否可用**
213
-
214
- ```bash
215
- bun --help
216
- bun --version
217
- ```
218
-
219
- 3. **如果已经安装过 Bun,更新到最新版本**
220
-
221
- ```bash
222
- bun upgrade
223
- ```
88
+ ### 安装与运行
224
89
 
225
- - ⚙️ 常规的配置 CC 的方式, 各大提供商都有自己的配置方式
226
-
227
- ### 📍 命令执行位置
228
-
229
- - 安装或检查 Bun 的命令可以在任意目录执行:
230
- `curl -fsSL https://bun.sh/install | bash`、`bun --help`、`bun --version`、`bun upgrade`
231
- - 安装本项目依赖、启动开发模式、构建项目时,必须先进入本仓库根目录,也就是包含 `package.json` 的目录。
232
-
233
- ### 📥 安装
90
+ 在**仓库根目录**(含本 `package.json` 的目录):
234
91
 
235
92
  ```bash
236
- cd /path/to/claude-code
237
93
  bun install
94
+ bun run dev # 开发模式(MACRO.* 由 scripts/dev.ts 注入)
95
+ bun run build # 代码分割产物 → dist/cli.js + chunks
96
+ bun run precheck # typecheck + biome fix + 全量测试(改完请跑)
238
97
  ```
239
98
 
240
- ### ▶️ 运行
99
+ 跨平台二进制与发布:
241
100
 
242
101
  ```bash
243
- # 开发模式, 看到版本号 888 说明就是对了
244
- bun run dev
245
-
246
- # 构建
247
- bun run build
102
+ bun run build:compile # 仅编译当前/指定平台二进制
103
+ bun run scripts/publish.ts --build-only # 同上(publish 脚本路径)
104
+ bun run scripts/publish.ts --dry-run # 构建 + npm publish --dry-run
105
+ bun run scripts/publish.ts --with-main # 含主包 @go-hare/claude-code
248
106
  ```
249
107
 
250
- 构建采用 code splitting 多文件打包(`build.ts`),产物输出到 `dist/` 目录(入口 `dist/cli.js` + 多 chunk)。
108
+ > 平台包内的 `claude` 二进制由 build 生成,**不应**长期提交进 git。
251
109
 
252
- 跨平台原生包与主包发布:
110
+ ### `/login` 配置模型
253
111
 
254
- ```bash
255
- bun run build:compile # 仅编译各平台二进制到 packages/@go-hare/*
256
- bun run scripts/publish.ts # 构建并 publish 平台包
257
- bun run scripts/publish.ts --with-main # 同时 publish 主包 @go-hare/claude-code
258
- ```
112
+ REPL 中 `/login` 可选 Anthropic Compatible / OpenAI / Gemini 等:
259
113
 
260
- 构建出的版本 bun node 都可以启动;若你 fork 后 publish 到私有源,可直接按上面的全局安装方式使用。
114
+ | 字段 | 说明 | 示例 |
115
+ | ---- | ---- | ---- |
116
+ | Base URL | API 地址 | `https://api.example.com/v1` |
117
+ | API Key | 密钥 | `sk-xxx` |
118
+ | Haiku / Sonnet / Opus | 模型 ID 映射 | 按你的上游填写 |
261
119
 
262
- 如果遇到 bug 请直接提 issues, 我们优先解决。提交前建议:
120
+ Tab / Shift+Tab 切字段,Enter 确认。
121
+
122
+ ### Feature Flags
263
123
 
264
124
  ```bash
265
- bun run precheck # typecheck + biome fix + test
125
+ FEATURE_BUDDY=1 bun run dev
266
126
  ```
267
127
 
268
- ### 👤 新人配置 /login
269
-
270
- 首次运行后,在 REPL 中输入 `/login` 命令进入登录配置界面,选择 **Anthropic Compatible** 即可对接第三方 API 兼容服务(无需 Anthropic 官方账号)。
271
- 选择 OpenAI 和 Gemini 对应的栏目都是支持相应协议的
272
-
273
- 需要填写的字段:
274
-
275
-
276
- | 📌 字段 | 📝 说明 | 💡 示例 |
277
- | ------------ | ------------- | ---------------------------- |
278
- | Base URL | API 服务地址 | `https://api.example.com/v1` |
279
- | API Key | 认证密钥 | `sk-xxx` |
280
- | Haiku Model | 快速模型 ID | `claude-haiku-4-5-20251001` |
281
- | Sonnet Model | 均衡模型 ID | `claude-sonnet-4-6` |
282
- | Opus Model | 高性能模型 ID | `claude-opus-4-6` |
283
-
284
- - ⌨️ **Tab / Shift+Tab** 切换字段,**Enter** 确认并跳到下一个,最后一个字段按 Enter 保存
128
+ 构建默认会打开一批 flag(见 `build.ts` / `scripts/defines.ts`);**默认关闭**的包括 `LAN_PIPES`、`UDS_INBOX`、`FORK_SUBAGENT` 等。群控 / Pipe 相关能力需对应 flag,不要默认当成全开。
285
129
 
286
- > ℹ️ 支持所有 Anthropic API 兼容服务(如 OpenRouter、AWS Bedrock 代理等),只要接口兼容 Messages API 即可。
130
+ ### VS Code 调试
287
131
 
288
- ## Feature Flags
289
-
290
- 所有功能开关通过 `FEATURE_<FLAG_NAME>=1` 环境变量启用,例如:
132
+ TUI 需真实终端,用 attach:
291
133
 
292
134
  ```bash
293
- FEATURE_BUDDY=1 FEATURE_FORK_SUBAGENT=1 bun run dev
135
+ bun run dev:inspect # 输出 ws://localhost:…
294
136
  ```
295
137
 
296
- ## VS Code 调试
297
-
298
- TUI (REPL) 模式需要真实终端,无法直接通过 VS Code launch 启动调试。使用 **attach 模式**:
299
-
300
- ### 步骤
301
-
302
- 1. **终端启动 inspect 服务**:
303
-
304
- ```bash
305
- bun run dev:inspect
306
- ```
307
-
308
- 会输出类似 `ws://localhost:8888/xxxxxxxx` 的地址。
309
- 2. **VS Code 附着调试器**:
138
+ VS Code F5 → **Attach to Bun (TUI debug)**。
310
139
 
311
- - `src/` 文件中打断点
312
- - F5 → 选择 **"Attach to Bun (TUI debug)"**
140
+ ### Teach Me
313
141
 
314
- ## Teach Me 学习项目
315
-
316
- 我们新加了一个 teach-me skills, 通过问答式引导帮你理解这个项目的任何模块。(调整 [sigma skill 而来](https://github.com/sanyuan0704/sanyuan-skills))
317
-
318
- ```bash
319
- # 在 REPL 中直接输入
142
+ ```text
320
143
  /teach-me Claude Code 架构
321
144
  /teach-me React Ink 终端渲染 --level beginner
322
- /teach-me Tool 系统 --resume
323
145
  ```
324
146
 
325
- ### 它能做什么
147
+ 进度在 `.claude/skills/teach-me/`(若已安装该 skill)。
148
+
149
+ ---
150
+
151
+ ## 仓库结构(精简)
326
152
 
327
- - **诊断水平** 自动评估你对相关概念的掌握程度,跳过已知的、聚焦薄弱的
328
- - **构建学习路径** 将主题拆解为 5-15 个原子概念,按依赖排序逐步推进
329
- - **苏格拉底式提问** 用选项引导思考,而非直接给答案
330
- - **错误概念追踪** 发现并纠正深层误解
331
- - **断点续学** `--resume` 从上次进度继续
153
+ | 路径 | 作用 |
154
+ | ---- | ---- |
155
+ | `src/entrypoints/cli.tsx` | 真入口与快速路径 |
156
+ | `src/main.tsx` | Commander CLI 与启动装配 |
157
+ | `src/screens/REPL.tsx` | 交互 REPL |
158
+ | `src/query.ts` / `QueryEngine.ts` | API 查询与 turn 编排 |
159
+ | `packages/builtin-tools/` | 内置工具 |
160
+ | `packages/@ant/ink/` | 终端 Ink 框架 |
161
+ | `src/bridge/` / `packages/remote-control-server/` | Remote Control |
162
+ | `src/daemon/` | 长驻 daemon |
163
+ | `src/services/acp/` / `packages/acp-link/` | ACP |
164
+ | `scripts/publish.ts` | 平台二进制编译与 npm 发布 |
165
+ | `CLAUDE.md` | 给 agent / 贡献者的详细工程说明 |
332
166
 
333
- ### 学习记录
167
+ 更完整的架构与测试约定见 [`CLAUDE.md`](./CLAUDE.md)。
334
168
 
335
- 学习进度保存在 `.claude/skills/teach-me/` 目录下,支持跨主题学习者档案。
169
+ ---
336
170
 
337
171
  ## Contributors
338
172
 
339
- <a href="https://github.com/claude-code/claude-code/graphs/contributors">
173
+ <a href="https://github.com/go-hare/claude-code-1/graphs/contributors">
340
174
  <img src="contributors.svg" alt="Contributors" />
341
175
  </a>
342
176
 
343
177
  ## Star History
344
178
 
345
- <a href="https://www.star-history.com/?repos=claude-code%2Fclaude-code&type=date&legend=top-left">
346
- <picture>
347
- <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/image?repos=claude-code/claude-code&type=date&theme=dark&legend=top-left" />
348
- <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/image?repos=claude-code/claude-code&type=date&legend=top-left" />
349
- <img alt="Star History Chart" src="https://api.star-history.com/image?repos=claude-code/claude-code&type=date&legend=top-left" />
350
- </picture>
179
+ <a href="https://www.star-history.com/?repos=go-hare%2Fclaude-code-1&type=date&legend=top-left">
180
+ <picture>
181
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/image?repos=go-hare/claude-code-1&type=date&theme=dark&legend=top-left" />
182
+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/image?repos=go-hare/claude-code-1&type=date&legend=top-left" />
183
+ <img alt="Star History Chart" src="https://api.star-history.com/image?repos=go-hare/claude-code-1&type=date&legend=top-left" />
184
+ </picture>
351
185
  </a>
352
186
 
353
187
  ## 致谢
354
188
 
355
- - [doubaoime-asr](https://github.com/starccy/doubaoime-asr) — 豆包 ASR 语音识别 SDK,为 Voice Mode 提供无需 Anthropic OAuth 的语音输入方案
189
+ - [doubaoime-asr](https://github.com/starccy/doubaoime-asr) — 豆包 ASRVoice Mode 可选路径
356
190
 
357
191
  ## 许可证
358
192
 
359
- 本项目仅供学习研究用途。Claude Code 的所有权利归 [Anthropic](https://www.anthropic.com/) 所有。
193
+ 仅供学习研究。Claude Code 相关权利归 Anthropic。请遵守上游与依赖的许可条款。
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@go-hare/claude-code",
3
- "version": "2.6.37",
4
- "description": "Reverse-engineered Anthropic Claude Code CLI — interactive AI coding assistant in the terminal",
3
+ "version": "2.7.1",
4
+ "description": "Source restoration / engineering rebuild of Anthropic Claude Code CLI — multi-provider models, self-hosted Remote Control, ACP, daemon sessions, MCP, plugins, and terminal automation",
5
5
  "type": "module",
6
6
  "author": "DeQiang",
7
7
  "repository": {
@@ -19,7 +19,12 @@
19
19
  "ai",
20
20
  "coding-assistant",
21
21
  "terminal",
22
- "repl"
22
+ "repl",
23
+ "mcp",
24
+ "acp",
25
+ "remote-control",
26
+ "daemon",
27
+ "multi-provider"
23
28
  ],
24
29
  "engines": {
25
30
  "node": ">=18.0.0"
@@ -39,14 +44,14 @@
39
44
  "cli-wrapper.cjs"
40
45
  ],
41
46
  "optionalDependencies": {
42
- "@go-hare/claude-code-darwin-arm64": ">=2.6.37",
43
- "@go-hare/claude-code-darwin-x64": ">=2.6.37",
44
- "@go-hare/claude-code-linux-x64": ">=2.6.37",
45
- "@go-hare/claude-code-linux-arm64": ">=2.6.37",
46
- "@go-hare/claude-code-linux-x64-musl": ">=2.6.37",
47
- "@go-hare/claude-code-linux-arm64-musl": ">=2.6.37",
48
- "@go-hare/claude-code-win32-x64": ">=2.6.37",
49
- "@go-hare/claude-code-win32-arm64": ">=2.6.37",
47
+ "@go-hare/claude-code-darwin-arm64": ">=2.7.1",
48
+ "@go-hare/claude-code-darwin-x64": ">=2.7.1",
49
+ "@go-hare/claude-code-linux-x64": ">=2.7.1",
50
+ "@go-hare/claude-code-linux-arm64": ">=2.7.1",
51
+ "@go-hare/claude-code-linux-x64-musl": ">=2.7.1",
52
+ "@go-hare/claude-code-linux-arm64-musl": ">=2.7.1",
53
+ "@go-hare/claude-code-win32-x64": ">=2.7.1",
54
+ "@go-hare/claude-code-win32-arm64": ">=2.7.1",
50
55
  "doubaoime-asr": "^0.1.0"
51
56
  },
52
57
  "scripts": {