@go-hare/claude-code 2.7.0 → 2.7.2
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.
- package/README.md +109 -275
- package/package.json +16 -11
package/README.md
CHANGED
|
@@ -1,150 +1,55 @@
|
|
|
1
|
-
# Claude Code
|
|
1
|
+
# Claude Code(go-hare)
|
|
2
2
|
|
|
3
|
-
[
|
|
4
|
-
[](https://github.com/claude-code/claude-code/graphs/contributors)
|
|
5
|
-
[](https://github.com/claude-code/claude-code/issues)
|
|
6
|
-
[](https://github.com/claude-code/claude-code/blob/main/LICENSE)
|
|
7
|
-
[](https://github.com/claude-code/claude-code/commits/main)
|
|
8
|
-
[](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
|
-
|
|
44
|
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
5
|
+
[](https://github.com/go-hare/claude-code-1/stargazers)
|
|
6
|
+
[](https://github.com/go-hare/claude-code-1/issues)
|
|
7
|
+
[](https://github.com/go-hare/claude-code-1/commits/main)
|
|
8
|
+
[](https://bun.sh/)
|
|
9
|
+
[](https://www.npmjs.com/package/@go-hare/claude-code)
|
|
48
10
|
|
|
49
|
-
|
|
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
|
-
|
|
|
56
|
-
|
|
|
57
|
-
|
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
|
|
|
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-bottom、alt-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
|
-
|
|
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
|
-
##
|
|
34
|
+
## 项目定位
|
|
77
35
|
|
|
78
|
-
|
|
36
|
+
这是 **CLI-first** 的 Claude Code 兼容运行时:
|
|
79
37
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
-
|
|
44
|
+
仓库里**没有**独立的 `src/core` / `src/hosts` / `src/runtime` 包级 Agent Core 分层;旧文档里的 `createAgent from 'claude/core'`、`./core` 子路径描述已过时,请勿依赖。
|
|
94
45
|
|
|
95
|
-
|
|
46
|
+
近期主线在对齐 **densable 2.1.211** 的 agent / 会话 / 队列 / inbox / daemon 行为(git tag `v2.8.5` 合入前、`v2.8.6` 合入后)。**npm 包版本以 `package.json` / npm 为准**(当前发布线 **2.7.2**),与 git tag 可能不同步。
|
|
96
47
|
|
|
97
|
-
|
|
48
|
+
---
|
|
98
49
|
|
|
99
|
-
|
|
100
|
-
import { createAgent } from 'claude/core'
|
|
101
|
-
```
|
|
50
|
+
## 安装(npm)
|
|
102
51
|
|
|
103
|
-
|
|
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
|
|
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://
|
|
162
|
-
CLAUDE_BRIDGE_OAUTH_TOKEN=
|
|
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
|
-
|
|
167
|
-
|
|
168
|
-
> 旧文档里的全局包名 `claude-code` 已不再对应本仓库发布流;请使用 `@go-hare/claude-code`。
|
|
71
|
+
安装失败时:`npm rm -g @go-hare/claude-code` 后再装 `@latest`(可钉版本 `@2.7.2`)。
|
|
72
|
+
旧文档里的全局包名 `claude-code` **不再**对应本仓库发布流。
|
|
169
73
|
|
|
170
|
-
|
|
74
|
+
---
|
|
171
75
|
|
|
172
|
-
|
|
76
|
+
## 源码开发
|
|
173
77
|
|
|
174
|
-
|
|
78
|
+
### 环境
|
|
175
79
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
**安装 Bun:**
|
|
80
|
+
需要较新的 [Bun](https://bun.sh/)(建议 ≥ 1.3.11):
|
|
179
81
|
|
|
180
82
|
```bash
|
|
181
|
-
#
|
|
182
|
-
|
|
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
|
-
|
|
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
|
-
|
|
244
|
-
bun run
|
|
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
|
-
|
|
108
|
+
> 平台包内的 `claude` 二进制由 build 生成,**不应**长期提交进 git。
|
|
251
109
|
|
|
252
|
-
|
|
110
|
+
### `/login` 配置模型
|
|
253
111
|
|
|
254
|
-
|
|
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
|
-
|
|
114
|
+
| 字段 | 说明 | 示例 |
|
|
115
|
+
| ---- | ---- | ---- |
|
|
116
|
+
| Base URL | API 地址 | `https://api.example.com/v1` |
|
|
117
|
+
| API Key | 密钥 | `sk-xxx` |
|
|
118
|
+
| Haiku / Sonnet / Opus | 模型 ID 映射 | 按你的上游填写 |
|
|
261
119
|
|
|
262
|
-
|
|
120
|
+
Tab / Shift+Tab 切字段,Enter 确认。
|
|
121
|
+
|
|
122
|
+
### Feature Flags
|
|
263
123
|
|
|
264
124
|
```bash
|
|
265
|
-
bun run
|
|
125
|
+
FEATURE_BUDDY=1 bun run dev
|
|
266
126
|
```
|
|
267
127
|
|
|
268
|
-
|
|
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
|
-
|
|
130
|
+
### VS Code 调试
|
|
287
131
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
所有功能开关通过 `FEATURE_<FLAG_NAME>=1` 环境变量启用,例如:
|
|
132
|
+
TUI 需真实终端,用 attach:
|
|
291
133
|
|
|
292
134
|
```bash
|
|
293
|
-
|
|
135
|
+
bun run dev:inspect # 输出 ws://localhost:…
|
|
294
136
|
```
|
|
295
137
|
|
|
296
|
-
|
|
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
|
-
|
|
312
|
-
- F5 → 选择 **"Attach to Bun (TUI debug)"**
|
|
140
|
+
### Teach Me
|
|
313
141
|
|
|
314
|
-
|
|
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
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
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
|
-
|
|
169
|
+
---
|
|
336
170
|
|
|
337
171
|
## Contributors
|
|
338
172
|
|
|
339
|
-
<a href="https://github.com/
|
|
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=
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
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
|
|
189
|
+
- [doubaoime-asr](https://github.com/starccy/doubaoime-asr) — 豆包 ASR,Voice Mode 可选路径
|
|
356
190
|
|
|
357
191
|
## 许可证
|
|
358
192
|
|
|
359
|
-
|
|
193
|
+
仅供学习研究。Claude Code 相关权利归 Anthropic。请遵守上游与依赖的许可条款。
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@go-hare/claude-code",
|
|
3
|
-
"version": "2.7.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.7.2",
|
|
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.7.
|
|
43
|
-
"@go-hare/claude-code-darwin-x64": ">=2.7.
|
|
44
|
-
"@go-hare/claude-code-linux-x64": ">=2.7.
|
|
45
|
-
"@go-hare/claude-code-linux-arm64": ">=2.7.
|
|
46
|
-
"@go-hare/claude-code-linux-x64-musl": ">=2.7.
|
|
47
|
-
"@go-hare/claude-code-linux-arm64-musl": ">=2.7.
|
|
48
|
-
"@go-hare/claude-code-win32-x64": ">=2.7.
|
|
49
|
-
"@go-hare/claude-code-win32-arm64": ">=2.7.
|
|
47
|
+
"@go-hare/claude-code-darwin-arm64": ">=2.7.2",
|
|
48
|
+
"@go-hare/claude-code-darwin-x64": ">=2.7.2",
|
|
49
|
+
"@go-hare/claude-code-linux-x64": ">=2.7.2",
|
|
50
|
+
"@go-hare/claude-code-linux-arm64": ">=2.7.2",
|
|
51
|
+
"@go-hare/claude-code-linux-x64-musl": ">=2.7.2",
|
|
52
|
+
"@go-hare/claude-code-linux-arm64-musl": ">=2.7.2",
|
|
53
|
+
"@go-hare/claude-code-win32-x64": ">=2.7.2",
|
|
54
|
+
"@go-hare/claude-code-win32-arm64": ">=2.7.2",
|
|
50
55
|
"doubaoime-asr": "^0.1.0"
|
|
51
56
|
},
|
|
52
57
|
"scripts": {
|