Skip to content

Commit 280be43

Browse files
Merge branch 'main' into feature/v6
2 parents d281008 + 0269491 commit 280be43

26 files changed

Lines changed: 2487 additions & 584 deletions

File tree

.githooks/pre-commit

100755100644
File mode changed.

.vscode/launch.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
2-
"version": "0.2.0",
3-
"configurations": [
4-
{
5-
"type": "bun",
6-
"request": "attach",
7-
"name": "Attach to Bun (TUI debug)",
8-
"url": "ws://localhost:8888/2dc3gzl5xot",
9-
"stopOnEntry": false,
10-
"internalConsoleOptions": "neverOpen"
11-
}
12-
]
13-
}
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"type": "bun",
6+
"request": "attach",
7+
"name": "Attach to Claude Code",
8+
"url": "ws://localhost:8888/2dc3gzl5xot",
9+
"preLaunchTask": "Start Claude Code TUI",
10+
"stopOnEntry": false,
11+
"internalConsoleOptions": "neverOpen"
12+
}
13+
]
14+
}

.vscode/tasks.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "Start Claude Code TUI",
6+
"type": "shell",
7+
"command": "bun run dev:inspect",
8+
"isBackground": true,
9+
"presentation": {
10+
"reveal": "always",
11+
"focus": true,
12+
"panel": "dedicated",
13+
"clear": true
14+
},
15+
"problemMatcher": {
16+
"pattern": {
17+
"regexp": "^$"
18+
},
19+
"background": {
20+
"activeOnStart": true,
21+
"beginsPattern": ".*Bun Inspector.*",
22+
"endsPattern": ".*Listening:.*"
23+
}
24+
}
25+
}
26+
]
27+
}

CLAUDE.md

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ bun run docs:dev
5151
### Runtime & Build
5252

5353
- **Runtime**: Bun (not Node.js). All imports, builds, and execution use Bun APIs.
54-
- **Build**: `build.ts` 执行 `Bun.build()` with `splitting: true`,入口 `src/entrypoints/cli.tsx`,输出 `dist/cli.js` + chunk files。默认启用 `AGENT_TRIGGERS_REMOTE` feature。构建后自动替换 `import.meta.require` 为 Node.js 兼容版本(产物 bun/node 都可运行)。
55-
- **Dev mode**: `scripts/dev.ts` 通过 Bun `-d` flag 注入 `MACRO.*` defines,运行 `src/entrypoints/cli.tsx`。默认启用 `BUDDY``TRANSCRIPT_CLASSIFIER``BRIDGE_MODE``AGENT_TRIGGERS_REMOTE` 四个 feature。
54+
- **Build**: `build.ts` 执行 `Bun.build()` with `splitting: true`,入口 `src/entrypoints/cli.tsx`,输出 `dist/cli.js` + chunk files。默认启用 `AGENT_TRIGGERS_REMOTE``CHICAGO_MCP``VOICE_MODE` feature。构建后自动替换 `import.meta.require` 为 Node.js 兼容版本(产物 bun/node 都可运行)。
55+
- **Dev mode**: `scripts/dev.ts` 通过 Bun `-d` flag 注入 `MACRO.*` defines,运行 `src/entrypoints/cli.tsx`。默认启用 `BUDDY``TRANSCRIPT_CLASSIFIER``BRIDGE_MODE``AGENT_TRIGGERS_REMOTE``CHICAGO_MCP``VOICE_MODE` 六个 feature。
5656
- **Module system**: ESM (`"type": "module"`), TSX with `react-jsx` transform.
5757
- **Monorepo**: Bun workspaces — internal packages live in `packages/` resolved via `workspace:*`.
5858
- **Lint/Format**: Biome (`biome.json`)。`bun run lint` / `bun run lint:fix` / `bun run format`
@@ -132,8 +132,8 @@ Feature flags control which functionality is enabled at runtime:
132132

133133
- **在代码中使用**: 统一通过 `import { feature } from 'bun:bundle'` 导入,调用 `feature('FLAG_NAME')` 返回 `boolean`**不要**`cli.tsx` 或其他文件里自己定义 `feature` 函数或覆盖这个 import。
134134
- **启用方式**: 通过环境变量 `FEATURE_<FLAG_NAME>=1`。例如 `FEATURE_BUDDY=1 bun run dev` 启用 BUDDY 功能。
135-
- **Dev 默认 features**: `BUDDY``TRANSCRIPT_CLASSIFIER``BRIDGE_MODE``AGENT_TRIGGERS_REMOTE`(见 `scripts/dev.ts`)。
136-
- **Build 默认 features**: `AGENT_TRIGGERS_REMOTE`(见 `build.ts`)。
135+
- **Dev 默认 features**: `BUDDY``TRANSCRIPT_CLASSIFIER``BRIDGE_MODE``AGENT_TRIGGERS_REMOTE``CHICAGO_MCP``VOICE_MODE`(见 `scripts/dev.ts`)。
136+
- **Build 默认 features**: `AGENT_TRIGGERS_REMOTE``CHICAGO_MCP``VOICE_MODE`(见 `build.ts`)。
137137
- **常见 flag**: `BUDDY`, `DAEMON`, `BRIDGE_MODE`, `BG_SESSIONS`, `PROACTIVE`, `KAIROS`, `VOICE_MODE`, `FORK_SUBAGENT`, `SSH_REMOTE`, `DIRECT_CONNECT`, `TEMPLATES`, `CHICAGO_MCP`, `BYOC_ENVIRONMENT_RUNNER`, `SELF_HOSTED_RUNNER`, `COORDINATOR_MODE`, `UDS_INBOX`, `LODESTONE`, `ABLATION_BASELINE` 等。
138138
- **类型声明**: `src/types/internal-modules.d.ts` 中声明了 `bun:bundle` 模块的 `feature` 函数签名。
139139

@@ -143,13 +143,45 @@ Feature flags control which functionality is enabled at runtime:
143143

144144
| Module | Status |
145145
|--------|--------|
146-
| Computer Use (`@ant/*`) | Stub packages in `packages/@ant/` |
147-
| `*-napi` packages (audio, image, url, modifiers) | Stubs in `packages/` (except `color-diff-napi` which is fully implemented) |
146+
| Computer Use (`@ant/*`) | Restored — `computer-use-swift`, `computer-use-input`, `computer-use-mcp`, `claude-for-chrome-mcp` 均有完整实现,macOS + Windows 可用,Linux 后端待完成 |
147+
| `*-napi` packages | `audio-capture-napi``image-processor-napi` 已恢复实现;`color-diff-napi` 完整实现;`url-handler-napi``modifiers-napi` 仍为 stub |
148+
| Voice Mode | Restored — `src/voice/``src/hooks/useVoiceIntegration.tsx``src/services/voiceStreamSTT.ts` 等,Push-to-Talk 语音输入(需 Anthropic OAuth) |
149+
| OpenAI 兼容层 | Restored — `src/services/api/openai/`,支持 Ollama/DeepSeek/vLLM 等任意 OpenAI 协议端点,通过 `CLAUDE_CODE_USE_OPENAI=1` 启用 |
148150
| Analytics / GrowthBook / Sentry | Empty implementations |
149-
| Magic Docs / Voice Mode / LSP Server | Removed |
151+
| Magic Docs / LSP Server | Removed |
150152
| Plugins / Marketplace | Removed |
151153
| MCP OAuth | Simplified |
152154

155+
### Computer Use
156+
157+
Feature flag `CHICAGO_MCP`,dev/build 默认启用。实现跨平台屏幕操控(macOS + Windows 可用,Linux 待完成)。
158+
159+
- **`packages/@ant/computer-use-mcp/`** — MCP server,注册截图/键鼠/剪贴板/应用管理工具
160+
- **`packages/@ant/computer-use-input/`** — 键鼠模拟,dispatcher + per-platform backend(`backends/darwin.ts``win32.ts``linux.ts`
161+
- **`packages/@ant/computer-use-swift/`** — 截图 + 应用管理,同样 dispatcher + per-platform backend
162+
- **`packages/@ant/claude-for-chrome-mcp/`** — Chrome 浏览器控制(独立于 Computer Use,通过 `--chrome` CLI 参数启用)
163+
164+
详见 `docs/features/computer-use.md`
165+
166+
### Voice Mode
167+
168+
Feature flag `VOICE_MODE`,dev/build 默认启用。Push-to-Talk 语音输入,音频通过 WebSocket 流式传输到 Anthropic STT(Nova 3)。需要 Anthropic OAuth(非 API key)。
169+
170+
- **`src/voice/voiceModeEnabled.ts`** — 三层门控(feature flag + GrowthBook + OAuth auth)
171+
- **`src/hooks/useVoice.ts`** — React hook 管理录音状态和 WebSocket 连接
172+
- **`src/services/voiceStreamSTT.ts`** — STT WebSocket 流式传输
173+
174+
详见 `docs/features/voice-mode.md`
175+
176+
### OpenAI 兼容层
177+
178+
通过 `CLAUDE_CODE_USE_OPENAI=1` 环境变量启用,支持任意 OpenAI Chat Completions 协议端点(Ollama、DeepSeek、vLLM 等)。流适配器模式:在 `queryModel()` 中将 Anthropic 格式请求转为 OpenAI 格式,再将 SSE 流转换回 `BetaRawMessageStreamEvent`,下游代码完全不改。
179+
180+
- **`src/services/api/openai/`** — client、消息/工具转换、流适配、模型映射
181+
- **`src/utils/model/providers.ts`** — 添加 `'openai'` provider 类型(最高优先级)
182+
183+
关键环境变量:`CLAUDE_CODE_USE_OPENAI``OPENAI_API_KEY``OPENAI_BASE_URL``OPENAI_MODEL``OPENAI_MODEL_MAP`。详见 `docs/plans/openai-compatibility.md`
184+
153185
### Key Type Files
154186

155187
- **`src/types/global.d.ts`** — Declares `MACRO`, `BUILD_TARGET`, `BUILD_ENV` and internal Anthropic-only identifiers.

DEV-LOG.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,42 @@
11
# DEV-LOG
22

3+
## /dream 手动触发 + DreamTask 类型补全 (2026-04-04)
4+
5+
`/dream` 命令从 KAIROS feature gate 中解耦,作为 bundled skill 无条件注册;补全 DreamTask 类型存根。
6+
7+
**新增文件:**
8+
9+
| 文件 | 说明 |
10+
|------|------|
11+
| `src/skills/bundled/dream.ts` | `/dream` skill 注册,调用 `buildConsolidationPrompt()` 生成整理提示词 |
12+
13+
**修改文件:**
14+
15+
| 文件 | 变更 |
16+
|------|------|
17+
| `src/skills/bundled/index.ts` | 导入并注册 `registerDreamSkill()` |
18+
| `src/components/tasks/src/tasks/DreamTask/DreamTask.ts` | `any` 存根 → 从 `src/tasks/DreamTask/DreamTask.js` 重新导出完整类型 |
19+
20+
**新增文档:**
21+
22+
| 文件 | 说明 |
23+
|------|------|
24+
| `docs/features/auto-dream.md` | Auto Dream 原理、触发机制、使用场景完整说明 |
25+
26+
---
27+
28+
## Computer Use macOS 适配修复 (2026-04-04)
29+
30+
**分支**: `feature/computer-use/mac-support`
31+
32+
- **darwin.ts** — 应用枚举改用 Spotlight `mdfind` + `mdls`,获取真实 bundleId(旧方案合成 `com.app.xxx`),覆盖 `/Applications` + `/System/Applications` + CoreServices
33+
- **index.ts** — 新增 `hotkey` backend fallback,非原生模块不崩溃
34+
- **toolCalls.ts**`resolveRequestedApps()` 新增子串模糊匹配(`"Chrome"``"Google Chrome"`
35+
- **hostAdapter.ts**`ensureOsPermissions()` 检查 `cu.tcc` 存在性,跨平台 JS backend 安全降级
36+
- **测试**: 17 个 MCP 工具中 10 个完全通过,6 个在 full tier 应用上通过(IDE click tier 受限为预期行为),`screenshot` 未返回图片(疑似屏幕录制权限问题)
37+
38+
---
39+
340
## Computer Use Windows 增强:窗口绑定截图 + UI Automation + OCR (2026-04-03)
441

542
在三平台基础实现之上,利用 Windows 原生 API 增强 Computer Use 的 Windows 专属能力。
@@ -413,3 +450,4 @@ GrowthBook 功能开关系统原为 Anthropic 内部构建设计,硬编码 SDK
413450
```
414451

415452
非空字段才写入,保存后立即生效(`onDone()` 触发 `onChangeAPIKey()` 刷新 API 客户端)。
453+

README.md

Lines changed: 29 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -16,41 +16,28 @@
1616

1717
[Discord 群组](https://discord.gg/qZU6zS7Q)
1818

19-
赞助商占位符
20-
21-
- [x] v1 会完成跑通及基本的类型检查通过;
22-
- [x] V2 会完整实现工程化配套设施;
23-
- [ ] Biome 格式化可能不会先实施, 避免代码冲突
24-
- [x] 构建流水线完成, 产物 Node/Bun 都可以运行
25-
- [x] V3 会写大量文档, 完善文档站点
26-
- [x] V4 会完成大量的测试文件, 以提高稳定性
27-
- [x] Buddy 小宠物回来啦 [文档](https://ccb.agent-aura.top/docs/features/buddy)
28-
- [x] Auto Mode 回归 [文档](https://ccb.agent-aura.top/docs/safety/auto-mode)
29-
- [x] 所有 Feature 现在可以通过环境变量配置, 而不是垃圾的 bun --feature
30-
- [x] V5 支持企业级的监控上报功能, 补全缺失的工具, 解除限制
31-
- [x] 移除牢 A 的反蒸馏代码!!!
32-
- [x] 补全 web search 能力(用的 Bing 搜索)!!! [文档](https://ccb.agent-aura.top/docs/features/web-browser-tool)
33-
- [x] 支持 Debug [文档](https://ccb.agent-aura.top/docs/features/debug-mode)
34-
- [x] 关闭自动更新;
35-
- [x] 添加自定义 sentry 错误上报支持 [文档](https://ccb.agent-aura.top/docs/internals/sentry-setup)
36-
- [x] 添加自定义 GrowthBook 支持 (GB 也是开源的, 现在你可以配置一个自定义的遥控平台) [文档](https://ccb.agent-aura.top/docs/internals/growthbook-adapter)
37-
- [x] 自定义 login 模式, 大家可以用这个配置 Claude 的模型!
38-
- [x] 修复搜索工具的 rg 缺失问题(需要重新 bun i)
39-
- [x] OpenAI 接口兼容! /login 然后配置 OpenAI 平台即可!
40-
- [x] Chrome use 支持(暂时浏览器插件要订阅权限,万恶的牢 A) 感谢 @amDosion
41-
- [x] Computer use 支持 感谢 @amDosion
42-
- [x] /voice 支持 @amDosion
43-
- [ ] V6 大规模重构石山代码, 全面模块分包
44-
- [ ] V6 将会为全新分支, 届时 main 分支将会封存为历史版本
45-
46-
> 我不知道这个项目还会存在多久, Star + Fork + git clone + .zip 包最稳健; 说白了就是扛旗项目, 看看能走多远
47-
>
48-
> 这个项目更新很快, 后台有 Opus 持续优化, 几乎几个小时就有新变化;
49-
>
50-
> Claude 已经烧了 1000$ 以上, 没钱了, 换成 GLM 继续玩; @zai-org GLM 5.1 非常可以;
51-
>
52-
53-
## 快速开始
19+
- [x] V4 — 测试补全、[Buddy](https://ccb.agent-aura.top/docs/features/buddy)[Auto Mode](https://ccb.agent-aura.top/docs/safety/auto-mode)、环境变量 Feature 开关
20+
- [x] V5 — [Sentry](https://ccb.agent-aura.top/docs/internals/sentry-setup) / [GrowthBook](https://ccb.agent-aura.top/docs/internals/growthbook-adapter) 企业监控、[自定义 Login](https://ccb.agent-aura.top/docs/features/custom-platform-login)[OpenAI 兼容](https://ccb.agent-aura.top/docs/plans/openai-compatibility)[Web Search](https://ccb.agent-aura.top/docs/features/web-browser-tool)[Computer Use](https://ccb.agent-aura.top/docs/features/computer-use) / [Chrome Use](https://ccb.agent-aura.top/docs/features/claude-in-chrome-mcp)[Voice Mode](https://ccb.agent-aura.top/docs/features/voice-mode)[Bridge Mode](https://ccb.agent-aura.top/docs/features/bridge-mode)[/dream 记忆整理](https://ccb.agent-aura.top/docs/features/auto-dream)
21+
- [ ] V6 — 大规模重构石山代码,全面模块分包(全新分支,main 封存为历史版本)
22+
23+
24+
## 快速开始(安装版)
25+
26+
不用克隆仓库, 从 NPM 下载后, 直接使用
27+
28+
```sh
29+
bun i -g claude-code-best
30+
bun pm -g trust claude-code-best
31+
ccb # 直接打开 claude code
32+
```
33+
34+
国内对 github 网络较差的, 需要先设置这个环境变量
35+
36+
```bash
37+
DEFAULT_RELEASE_BASE=https://ghproxy.net/https://github.com/microsoft/ripgrep-prebuilt/releases/download/v15.0.1
38+
```
39+
40+
## 快速开始(源码版)
5441

5542
### 环境要求
5643

@@ -65,6 +52,12 @@
6552
bun install
6653
```
6754

55+
国内对 github 网络较差的,可以使用这个环境变量
56+
57+
```bash
58+
DEFAULT_RELEASE_BASE=https://ghproxy.net/https://github.com/microsoft/ripgrep-prebuilt/releases/download/v15.0.1
59+
```
60+
6861
### 运行
6962

7063
```bash
@@ -96,22 +89,7 @@ bun run build
9689
| Opus Model | 高性能模型 ID | `claude-opus-4-6` |
9790

9891
- **Tab / Shift+Tab** 切换字段,**Enter** 确认并跳到下一个,最后一个字段按 Enter 保存
99-
- 模型字段会自动读取当前环境变量预填
100-
- 配置保存到 `~/.claude/settings.json``env` 字段,保存后立即生效
101-
102-
也可以直接编辑 `~/.claude/settings.json`
103-
104-
```json
105-
{
106-
"env": {
107-
"ANTHROPIC_BASE_URL": "https://api.example.com/v1",
108-
"ANTHROPIC_AUTH_TOKEN": "sk-xxx",
109-
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5-20251001",
110-
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-6",
111-
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-6"
112-
}
113-
}
114-
```
92+
11593

11694
> 支持所有 Anthropic API 兼容服务(如 OpenRouter、AWS Bedrock 代理等),只要接口兼容 Messages API 即可。
11795

TODO.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)