Skip to content

Commit 80fc636

Browse files
author
unraid
committed
fix: unblock PR by aligning with upstream main
Resolve the PR merge conflict against upstream/main while preserving the ACP auth hardening on the feature branch. The only manual conflict was in the RCS store: keep the upstream removal of ACP machineName record reuse so reconnects do not inherit stale agent/channel-group state, while retaining the branch's node:crypto UUID generation path. Constraint: PR #361 was merge-conflicting against claude-code-best/claude-code main, not failing CI. Constraint: Do not merge into upstream main; update only the fork PR branch for review. Rejected: Restore ACP machineName reuse | upstream removed it and it can retain stale ACP state. Rejected: Suppress warnings or tests | local lint, audit, focused tests, full test suite, and builds pass without suppression. Confidence: high Scope-risk: moderate Directive: Do not reintroduce query-string bearer tokens, UUID-only ACP access, open /web/* CORS, or ACP machineName environment reuse without new threat-model evidence. Tested: bunx tsc --noEmit --pretty false; packages/remote-control-server bun run typecheck; packages/acp-link bun run build; bun run lint; bun audit; focused ACP/RCS tests 165 pass; bun run test:all 3672 pass; bun run build; bun run build:vite; git diff --check
2 parents 6a4ed62 + fc438bd commit 80fc636

32 files changed

Lines changed: 564 additions & 133 deletions

File tree

CLAUDE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ bun run docs:dev
7676
### Runtime & Build
7777

7878
- **Runtime**: Bun (not Node.js). All imports, builds, and execution use Bun APIs.
79-
- **Build**: `build.ts` 执行 `Bun.build()` with `splitting: true`,入口 `src/entrypoints/cli.tsx`,输出 `dist/cli.js` + chunk files。Build 默认启用 19 个 feature(见下方 Feature Flag 段)。构建后自动替换 `import.meta.require` 为 Node.js 兼容版本(产物 bun/node 都可运行)。
79+
- **Build**: `build.ts` 执行 `Bun.build()` with `splitting: true`,入口 `src/entrypoints/cli.tsx`,输出 `dist/cli.js` + chunk files。Build 默认启用 19 个 feature(见下方 Feature Flag 段)。构建后自动替换 `import.meta.require` 为 Node.js 兼容版本(产物 bun/node 都可运行)。构建时会将 `vendor/audio-capture/``src/utils/vendor/ripgrep/` 复制到 `dist/vendor/` 下。
80+
- **Build (Vite)**: `vite.config.ts` + `scripts/post-build.ts`,chunk 输出到 `dist/chunks/`。post-build 同样复制 vendor 文件到 `dist/vendor/`
81+
- **Vendor 路径解析**: 构建后 chunk 文件位于 `dist/``dist/chunks/` 下,vendor 二进制在 `dist/vendor/``src/utils/ripgrep.ts``packages/audio-capture-napi/src/index.ts` 均通过 `import.meta.url` 路径中 `lastIndexOf('dist')` 定位 dist 根目录,再拼接 `vendor/` 子路径,确保不同构建产物层级下路径一致。
8082
- **Dev mode**: `scripts/dev.ts` 通过 Bun `-d` flag 注入 `MACRO.*` defines,运行 `src/entrypoints/cli.tsx`。默认启用全部 feature。
8183
- **Module system**: ESM (`"type": "module"`), TSX with `react-jsx` transform.
8284
- **Monorepo**: Bun workspaces — 15 个 workspace packages + 若干辅助目录 in `packages/` resolved via `workspace:*`

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919

2020
| 特性 | 说明 | 文档 |
2121
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
22-
| **Claude 群控技术** | Pipe IPC 多实例协作:同机 main/sub 自动编排 + LAN 跨机器零配置发现与通讯,`/pipes` 选择面板 + `Shift+↓` 交互 + 消息广播路由 | [Pipe IPC](https://ccb.agent-aura.top/docs/features/pipes-and-lan) / [LAN](https://ccb.agent-aura.top/docs/features/lan-pipes) |
22+
| **Claude 群控技术** | Pipe IPC 多实例协作:同机 main/sub 自动编排 + LAN 跨机器零配置发现与通讯,`/pipes` 选择面板 + `Shift+↓` 交互 + 消息广播路由 | [Pipe IPC](https://ccb.agent-aura.top/docs/features/uds-inbox) / [LAN](https://ccb.agent-aura.top/docs/features/lan-pipes) |
2323
| **ACP 协议一等一支持** | 支持接入 Zed、Cursor 等 IDE,支持会话恢复、Skills、权限桥接 | [文档](https://ccb.agent-aura.top/docs/features/acp-zed) |
2424
| **Remote Control 私有部署** | Docker 自托管远程界面, 可以手机上看 CC | [文档](https://ccb.agent-aura.top/docs/features/remote-control-self-hosting) |
2525
| **Langfuse 监控** | 企业级 Agent 监控, 可以清晰看到每次 agent loop 细节, 可以一键转化为数据集 | [文档](https://ccb.agent-aura.top/docs/features/langfuse-monitoring) |
2626
| **Web Search** | 内置网页搜索工具, 支持 bing 和 brave 搜索 | [文档](https://ccb.agent-aura.top/docs/features/web-browser-tool) |
2727
| **Poor Mode** | 穷鬼模式,关闭记忆提取和键入建议,大幅度减少并发请求 | /poor 可以开关 |
2828
| **Channels 频道通知** | MCP 服务器推送外部消息到会话(飞书/Slack/Discord/微信等),`--channels plugin:name@marketplace` 启用 | [文档](https://ccb.agent-aura.top/docs/features/channels) |
29-
| **自定义模型供应商** | OpenAI/Anthropic/Gemini/Grok 兼容 | [文档](https://ccb.agent-aura.top/docs/features/custom-platform-login) |
29+
| **自定义模型供应商** | OpenAI/Anthropic/Gemini/Grok 兼容 (`/login`) | [文档](https://ccb.agent-aura.top/docs/features/all-features-guide) |
3030
| Voice Mode | 语音输入,支持豆包语言输入(`/voice doubao`| [文档](https://ccb.agent-aura.top/docs/features/voice-mode) |
3131
| Computer Use | 屏幕截图、键鼠控制 | [文档](https://ccb.agent-aura.top/docs/features/computer-use) |
3232
| Chrome Use | 浏览器自动化、表单填写、数据抓取 | [自托管](https://ccb.agent-aura.top/docs/features/chrome-use-mcp) [原生版](https://ccb.agent-aura.top/docs/features/claude-in-chrome-mcp) |

README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ The TUI (REPL) mode requires a real terminal and cannot be launched directly via
188188
## Documentation & Links
189189

190190
- **Online docs (Mintlify)**: [ccb.agent-aura.top](https://ccb.agent-aura.top/) — source in [`docs/`](docs/), PR contributions welcome
191-
- **DeepWiki**: <https://deepwiki.com/claude-code-best/claude-code>
191+
- **DeepWiki**: https://deepwiki.com/claude-code-best/claude-code
192192

193193
## Contributors
194194

build.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,14 @@ console.log(
7575
`Bundled ${result.outputs.length} files to ${outdir}/ (patched ${patched} for import.meta.require, ${bunPatched} for Bun destructure)`,
7676
)
7777

78-
// Step 4: Copy native .node addon files (audio-capture)
79-
const vendorDir = join(outdir, 'vendor', 'audio-capture')
80-
await cp('vendor/audio-capture', vendorDir, { recursive: true })
81-
console.log(`Copied vendor/audio-capture/ → ${vendorDir}/`)
78+
// Step 4: Copy native .node addon files (audio-capture) and vendored binaries (ripgrep)
79+
const audioCaptureDir = join(outdir, 'vendor', 'audio-capture')
80+
await cp('vendor/audio-capture', audioCaptureDir, { recursive: true })
81+
console.log(`Copied vendor/audio-capture/ → ${audioCaptureDir}/`)
82+
83+
const ripgrepDir = join(outdir, 'vendor', 'ripgrep')
84+
await cp('src/utils/vendor/ripgrep', ripgrepDir, { recursive: true })
85+
console.log(`Copied src/utils/vendor/ripgrep/ → ${ripgrepDir}/`)
8286

8387
// Step 5: Generate cli-bun and cli-node executable entry points
8488
const cliBun = join(outdir, 'cli-bun.js')

docs/features/pipes-and-lan.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ M 键(或 ← / →)用于在两种路由模式之间切换,**无需展开
145145

146146
```
147147
/pipes — 显示所有实例 + 切换选择面板
148-
/pipes select <name> — 选中某实例(消息会广播到它)
149-
/pipes deselect <name> — 取消选中
148+
/pipes select &lt;name&gt; — 选中某实例(消息会广播到它)
149+
/pipes deselect &lt;name&gt; — 取消选中
150150
/pipes all — 全选
151151
/pipes none — 全部取消
152152
```
@@ -169,7 +169,7 @@ LAN Peers:
169169
Selected: cli-da029538
170170
```
171171

172-
### /attach <name>
172+
### /attach &lt;name&gt;
173173

174174
手动 attach 到一个实例,使其成为你的 slave。
175175

@@ -179,15 +179,15 @@ Selected: cli-da029538
179179

180180
attach 后,对方变为 slave,你变为 master。可以向它发送 prompt。通常不需要手动 attach——heartbeat 会自动发现并连接。
181181

182-
### /detach <name>
182+
### /detach &lt;name&gt;
183183

184184
断开与某个 slave 的连接。
185185

186186
```
187187
/detach cli-04d67950
188188
```
189189

190-
### /send <name> <message>
190+
### /send &lt;name&gt; &lt;message&gt;
191191

192192
向指定 pipe 发送消息(不依赖选择状态,直接指定目标)。
193193

docs/lsp-integration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@ LSP 服务器通过插件提供。插件的 `manifest.json` 中可以声明 LSP
200200
|------|------|------|------|
201201
| `command` | string || LSP 服务器可执行命令(不含空格) |
202202
| `args` | string[] || 命令行参数 |
203-
| `extensionToLanguage` | Record<string, string> || 文件扩展名到语言 ID 的映射(至少一个) |
203+
| `extensionToLanguage` | `Record<string, string>` || 文件扩展名到语言 ID 的映射(至少一个) |
204204
| `transport` | `"stdio"` \| `"socket"` || 通信方式,默认 `stdio` |
205-
| `env` | Record<string, string> || 启动服务器时设置的环境变量 |
205+
| `env` | `Record<string, string>` || 启动服务器时设置的环境变量 |
206206
| `initializationOptions` | unknown || 传给服务器的初始化选项 |
207207
| `settings` | unknown || 通过 `workspace/didChangeConfiguration` 传递的设置 |
208208
| `workspaceFolder` | string || 工作区目录路径 |

learn/phase-2-qa.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ F. getCompletedResults() → 空
175175

176176
---
177177

178-
#### #8 stream_event (input_json_delta: '{"file_path":')
178+
#### #8 stream_event (input_json_delta: `'{"file_path":'`)
179179

180180
```
181181
D. yield message ✅ → REPL 追加工具输入 JSON 碎片

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "claude-code-best",
3-
"version": "1.9.5",
3+
"version": "1.10.2",
44
"description": "Reverse-engineered Anthropic Claude Code CLI — interactive AI coding assistant in the terminal",
55
"type": "module",
66
"author": "claude-code-best <claude-code-best@proton.me>",

packages/audio-capture-napi/src/index.ts

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,33 @@
11
import { createRequire } from 'node:module'
2-
2+
import { dirname, resolve, sep } from 'node:path'
3+
import { fileURLToPath } from 'node:url'
34
// createRequire works in both Bun and Node.js ESM contexts.
45
// Needed because this package is "type": "module" but uses require() for
56
// loading native .node addons — bare require is not available in Node.js ESM.
67
const nodeRequire = createRequire(import.meta.url)
78

9+
/**
10+
* Resolve the "vendor root" directory where native .node binaries live.
11+
*
12+
* - Dev mode: import.meta.url → packages/audio-capture-napi/src/index.ts
13+
* → vendor root = <project>/vendor/
14+
* - Bun build: import.meta.url → dist/chunk-xxx.js
15+
* → vendor root = <project>/dist/vendor/
16+
* - Vite build: import.meta.url → dist/chunks/chunk-xxx.js
17+
* → vendor root = <project>/dist/vendor/
18+
*/
19+
function getVendorRoot(): string {
20+
const filePath = fileURLToPath(import.meta.url)
21+
const dir = dirname(filePath)
22+
const parts = dir.split(sep)
23+
const distIdx = parts.lastIndexOf('dist')
24+
if (distIdx !== -1) {
25+
return parts.slice(0, distIdx + 1).join(sep) + sep + 'vendor'
26+
}
27+
// Dev mode — go up from packages/audio-capture-napi/src/ to project root
28+
return resolve(dir, '..', '..', '..', 'vendor')
29+
}
30+
831
type AudioCaptureNapi = {
932
startRecording(
1033
onData: (data: Buffer) => void,
@@ -56,15 +79,18 @@ function loadModule(): AudioCaptureNapi | null {
5679
}
5780
}
5881

59-
// Candidates 2-4: npm-install, dev/source, and workspace layouts.
60-
// In bundled output, require() resolves relative to cli.js at the package root.
61-
// In dev, it resolves relative to this file. When loaded from a workspace
62-
// package (packages/audio-capture-napi/src/), we need an absolute path fallback.
82+
// Candidates 2-5: resolved vendor path + relative fallbacks.
83+
// The primary candidate uses getVendorRoot() to find the correct dist root
84+
// regardless of chunk nesting depth. Relative fallbacks cover edge cases.
6385
const platformDir = `${process.arch}-${platform}`
86+
const binaryRel = `audio-capture/${platformDir}/audio-capture.node`
87+
const vendorRoot = getVendorRoot()
6488
const fallbacks = [
65-
`./vendor/audio-capture/${platformDir}/audio-capture.node`,
66-
`../audio-capture/${platformDir}/audio-capture.node`,
67-
`${process.cwd()}/vendor/audio-capture/${platformDir}/audio-capture.node`,
89+
resolve(vendorRoot, binaryRel),
90+
`./vendor/${binaryRel}`,
91+
`../vendor/${binaryRel}`,
92+
`../../vendor/${binaryRel}`,
93+
`${process.cwd()}/vendor/${binaryRel}`,
6894
]
6995
for (const p of fallbacks) {
7096
try {

packages/builtin-tools/src/tools/PowerShellTool/PowerShellTool.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ export const PowerShellTool = buildTool({
421421
isSearch: boolean
422422
isRead: boolean
423423
} {
424-
if (!input.command) {
424+
if (!input?.command) {
425425
return { isSearch: false, isRead: false }
426426
}
427427
return isSearchOrReadPowerShellCommand(input.command)

0 commit comments

Comments
 (0)