chore: rename VersperClaw to Codev, update org to chenbhao
Browse filesRename all references across the codebase: VersperClaw → Codev,
Versper Claw → Codev, versperclaw → codev, VERSPER_CLAW → CODEV,
versperai → chenbhao (GitHub username change).
Co-Authored-By: Claude Big Pickle <noreply@anthropic.com>
This view is limited to 50 files because it contains too many changes. See raw diff
- .gitignore +1 -1
- Codev +1 -0
- README.md +10 -8
- docs/README.md +2 -2
- docs/architecture/agent-loop.md +1 -1
- docs/architecture/cross-cutting.md +1 -1
- docs/architecture/data-flow.md +2 -2
- docs/architecture/design-philosophy.md +7 -7
- docs/architecture/overview.md +1 -1
- docs/architecture/provider-auth.md +6 -6
- docs/architecture/safety-and-permissions.md +1 -1
- docs/cli/build-system.md +7 -7
- docs/cli/debug-system.md +8 -8
- docs/cli/overview.md +4 -4
- docs/coordinator/multi-agent.md +2 -2
- docs/friend/architecture.md +3 -3
- docs/friend/overview.md +4 -4
- docs/friend/voice-vad.md +1 -1
- docs/ink-ui/overview.md +2 -2
- docs/interview-prep.md +16 -16
- docs/memory-context/context.md +1 -1
- docs/memory-context/memory.md +1 -1
- docs/server/overview.md +1 -1
- docs/services/compact-deep-dive.md +4 -4
- docs/services/feishu.md +2 -2
- docs/services/overview.md +1 -1
- docs/tools/overview.md +13 -13
- docs/tools/tool-reference.md +2 -2
- docs/voice/overview.md +1 -1
- install.sh +12 -12
- scripts/build.ts +2 -2
- scripts/dev.ts +1 -1
- src/commands/feishu/feishu.tsx +1 -1
- src/commands/insights.ts +29 -29
- src/commands/telegram/telegram.tsx +1 -1
- src/components/AutoModeOptInDialog.tsx +2 -2
- src/components/FeedbackSurvey/FeedbackSurveyView.tsx +1 -1
- src/components/HelpV2/General.tsx +1 -1
- src/components/HelpV2/HelpV2.tsx +2 -2
- src/components/LogoV2/CondensedLogo.tsx +2 -2
- src/components/LogoV2/GuestPassesUpsell.tsx +1 -1
- src/components/LogoV2/LogoV2.tsx +2 -2
- src/components/LogoV2/WelcomeV2.tsx +1 -1
- src/components/LogoV2/feedConfigs.tsx +2 -2
- src/components/Onboarding.tsx +3 -3
- src/components/friend/frontend/api.ts +1 -1
- src/components/friend/frontend/src-tauri/Cargo.lock +1 -1
- src/components/friend/frontend/src-tauri/Cargo.toml +4 -4
- src/components/friend/frontend/src-tauri/capabilities/default.json +1 -1
- src/components/friend/frontend/src-tauri/src/main.rs +1 -1
.gitignore
CHANGED
|
@@ -2,7 +2,7 @@ node_modules/
|
|
| 2 |
packages/
|
| 3 |
dist/
|
| 4 |
.codex
|
| 5 |
-
|
| 6 |
|
| 7 |
# Prebuilt native binaries (tracked in claude-code/ reference)
|
| 8 |
vendor/
|
|
|
|
| 2 |
packages/
|
| 3 |
dist/
|
| 4 |
.codex
|
| 5 |
+
codev
|
| 6 |
|
| 7 |
# Prebuilt native binaries (tracked in claude-code/ reference)
|
| 8 |
vendor/
|
Codev
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
dist/Codev
|
README.md
CHANGED
|
@@ -37,7 +37,7 @@
|
|
| 37 |
- **2026-05-06** 🚀 Added OpenCode as a free provider — includes GPT-5 Nano and Big Pickle 🥒 models, `/model` list with life-free model display, and auto-refresh. Introduced ctx_line context tracking with online persistence. Better collapsing fetch results and auto-compact documentation polish. Merged PR #6 for Tavily search backend migration.
|
| 38 |
- **2026-04-30** 🔍 Added Tavily as optional search backend in WebSearchTool via PR #6.
|
| 39 |
- **2026-04-24** 🧹 Cleaned up empty contributor docs.
|
| 40 |
-
- **2026-04-21** 🛡️ Fixed auto-compact env in settings.json;
|
| 41 |
- **2026-04-20** 📝 Documented ToolSearch behavior and <tr> table formatting.
|
| 42 |
- **2026-04-19** 📖 Described auto-dream and subagent features in README; punctuation and layout polish. Tagged **v2.0.1** 🏷️.
|
| 43 |
- **2026-04-18** 💭 Snapshot auto-dream feature; ToolSearch now uses WebSearch under the hood.
|
|
@@ -48,7 +48,7 @@
|
|
| 48 |
- **2026-04-08** 🌐 Full WebSearch toolchain — SearXNG integration, Jina AI websearch & fetch, WebFetch UI notes, build fix. Four search approaches landed in one day.
|
| 49 |
- **2026-04-07** 🔍 Zero-search prototype; Python env removed; TLS-enabled web search working end-to-end.
|
| 50 |
- **2026-04-06** 🛠️ Open ripgrep via USE_BUILTIN_RIPGREP=0; WebFetch UI notes; skill message renamed; WebSearch API error fixed.
|
| 51 |
-
- **2026-04-05** 🤖 AutoMode — autonomous decision-making execution mode. `/sandbox` with sandbox-runtime @0.0.44. Project renamed to
|
| 52 |
- **2026-04-04** 📱 Telegram backend — `/telegram` command, interactive commands, message receiving in TUI, chatId overflow fixed. `/buddy` companion mode; recent activity in individual directories.
|
| 53 |
- **2026-04-03** 🔄 Reborn as verspercode **v0.1.0** — complete `/login` system (OpenRouter + local models), `/model` search & UI, free OpenRouter model auto-load, onboarding flow. Local model filesystem-based provider.
|
| 54 |
|
|
@@ -63,7 +63,7 @@
|
|
| 63 |
- **2026-03-27** 🔬 Research workflow — `/paper` and `/code` commands, 4-step research + autoresearch, ANN vector index, hybrid retrieval with semantic cache, external memory, token-budgeted evidence pipeline, IncompleteRead retry, long-term index cache. Workflows engine, `/resume` session toggle, CLI UI refresh.
|
| 64 |
- **2026-03-26** 🏗️ Configuration overhaul — YAML → JSON + .env + TOML. Clean config dir.
|
| 65 |
- **2026-03-24** 🌐 Browser control — Chrome DevTools MCP integration, WeChat gateway, Telegram gateway. Setup wizard, README with demo GIF, version menu.
|
| 66 |
-
- **2026-03-22** 🎉 Initial commit —
|
| 67 |
|
| 68 |
</details>
|
| 69 |
|
|
@@ -71,14 +71,16 @@
|
|
| 71 |
|
| 72 |
```bash
|
| 73 |
# script install
|
| 74 |
-
curl -fsSL https://raw.githubusercontent.com/
|
| 75 |
|
| 76 |
# source install
|
| 77 |
-
git clone https://github.com/
|
| 78 |
|
| 79 |
# if want global use bin file
|
| 80 |
-
cp
|
| 81 |
-
|
|
|
|
|
|
|
| 82 |
```
|
| 83 |
|
| 84 |
## 🚀 Quick Start
|
|
@@ -139,7 +141,7 @@ sudo usermod -aG docker $USER
|
|
| 139 |
sudo systemctl enable --now docker
|
| 140 |
|
| 141 |
# 2. docker-compose pull
|
| 142 |
-
# use VersperSearch a pre-build docker config in https://github.com/
|
| 143 |
# or install searxng in docker-compose by yourself
|
| 144 |
curl -fsSL \
|
| 145 |
-O https://raw.githubusercontent.com/searxng/searxng/master/container/docker-compose.yml \
|
|
|
|
| 37 |
- **2026-05-06** 🚀 Added OpenCode as a free provider — includes GPT-5 Nano and Big Pickle 🥒 models, `/model` list with life-free model display, and auto-refresh. Introduced ctx_line context tracking with online persistence. Better collapsing fetch results and auto-compact documentation polish. Merged PR #6 for Tavily search backend migration.
|
| 38 |
- **2026-04-30** 🔍 Added Tavily as optional search backend in WebSearchTool via PR #6.
|
| 39 |
- **2026-04-24** 🧹 Cleaned up empty contributor docs.
|
| 40 |
+
- **2026-04-21** 🛡️ Fixed auto-compact env in settings.json; Codev now handles Ctrl+C resume gracefully.
|
| 41 |
- **2026-04-20** 📝 Documented ToolSearch behavior and <tr> table formatting.
|
| 42 |
- **2026-04-19** 📖 Described auto-dream and subagent features in README; punctuation and layout polish. Tagged **v2.0.1** 🏷️.
|
| 43 |
- **2026-04-18** 💭 Snapshot auto-dream feature; ToolSearch now uses WebSearch under the hood.
|
|
|
|
| 48 |
- **2026-04-08** 🌐 Full WebSearch toolchain — SearXNG integration, Jina AI websearch & fetch, WebFetch UI notes, build fix. Four search approaches landed in one day.
|
| 49 |
- **2026-04-07** 🔍 Zero-search prototype; Python env removed; TLS-enabled web search working end-to-end.
|
| 50 |
- **2026-04-06** 🛠️ Open ripgrep via USE_BUILTIN_RIPGREP=0; WebFetch UI notes; skill message renamed; WebSearch API error fixed.
|
| 51 |
+
- **2026-04-05** 🤖 AutoMode — autonomous decision-making execution mode. `/sandbox` with sandbox-runtime @0.0.44. Project renamed to codev. OpenRouter ↔ Local model switching, auto-refresh TUI, Telegram `/login` local model transition.
|
| 52 |
- **2026-04-04** 📱 Telegram backend — `/telegram` command, interactive commands, message receiving in TUI, chatId overflow fixed. `/buddy` companion mode; recent activity in individual directories.
|
| 53 |
- **2026-04-03** 🔄 Reborn as verspercode **v0.1.0** — complete `/login` system (OpenRouter + local models), `/model` search & UI, free OpenRouter model auto-load, onboarding flow. Local model filesystem-based provider.
|
| 54 |
|
|
|
|
| 63 |
- **2026-03-27** 🔬 Research workflow — `/paper` and `/code` commands, 4-step research + autoresearch, ANN vector index, hybrid retrieval with semantic cache, external memory, token-budgeted evidence pipeline, IncompleteRead retry, long-term index cache. Workflows engine, `/resume` session toggle, CLI UI refresh.
|
| 64 |
- **2026-03-26** 🏗️ Configuration overhaul — YAML → JSON + .env + TOML. Clean config dir.
|
| 65 |
- **2026-03-24** 🌐 Browser control — Chrome DevTools MCP integration, WeChat gateway, Telegram gateway. Setup wizard, README with demo GIF, version menu.
|
| 66 |
+
- **2026-03-22** 🎉 Initial commit — codev **v0.1.0** born.
|
| 67 |
|
| 68 |
</details>
|
| 69 |
|
|
|
|
| 71 |
|
| 72 |
```bash
|
| 73 |
# script install
|
| 74 |
+
curl -fsSL https://raw.githubusercontent.com/chenbhao/Codev/main/install.sh | bash
|
| 75 |
|
| 76 |
# source install
|
| 77 |
+
git clone https://github.com/chenbhao/Codev.git && cd Codev && bun install && bun run build && bun run friend:build && ./Codev
|
| 78 |
|
| 79 |
# if want global use bin file
|
| 80 |
+
# cp dist/codev ~/.local/bin
|
| 81 |
+
ln -sf dist/codev ~/.local/bin/codev
|
| 82 |
+
|
| 83 |
+
# then can use Codev in everywhere after `/login`
|
| 84 |
```
|
| 85 |
|
| 86 |
## 🚀 Quick Start
|
|
|
|
| 141 |
sudo systemctl enable --now docker
|
| 142 |
|
| 143 |
# 2. docker-compose pull
|
| 144 |
+
# use VersperSearch a pre-build docker config in https://github.com/chenbhao/VersperSearch
|
| 145 |
# or install searxng in docker-compose by yourself
|
| 146 |
curl -fsSL \
|
| 147 |
-O https://raw.githubusercontent.com/searxng/searxng/master/container/docker-compose.yml \
|
docs/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
-
#
|
| 2 |
|
| 3 |
-
>
|
| 4 |
|
| 5 |
## 目录
|
| 6 |
|
|
|
|
| 1 |
+
# Codev 文档
|
| 2 |
|
| 3 |
+
> Codev — 基于 Anthropic Claude Code 的增强型 AI CLI 代理,集成 VRM 桌面伴侣、多 Provider、语音对话和自动化模式。
|
| 4 |
|
| 5 |
## 目录
|
| 6 |
|
docs/architecture/agent-loop.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
# Agent 循环与查询引擎深度分析
|
| 2 |
|
| 3 |
> 本文基于 `src/query.ts`、`src/QueryEngine.ts`、`src/query/*`、`src/services/tools/*` 等核心模块,
|
| 4 |
-
> 详细阐述
|
| 5 |
> 文中列出具体文件路径、函数名称与行号,供开发者快速定位代码。
|
| 6 |
|
| 7 |
---
|
|
|
|
| 1 |
# Agent 循环与查询引擎深度分析
|
| 2 |
|
| 3 |
> 本文基于 `src/query.ts`、`src/QueryEngine.ts`、`src/query/*`、`src/services/tools/*` 等核心模块,
|
| 4 |
+
> 详细阐述 Codev (Claude Code) 的 Agent 循环架构、模型调用管道、工具调度机制、恢复策略与继续决策逻辑。
|
| 5 |
> 文中列出具体文件路径、函数名称与行号,供开发者快速定位代码。
|
| 6 |
|
| 7 |
---
|
docs/architecture/cross-cutting.md
CHANGED
|
@@ -260,7 +260,7 @@ VAD(Voice Activity Detection)服务 (`src/friend/voice/vad-service.ts`) 使
|
|
| 260 |
4. **外部模块排除**: `@ant/*`、`audio-capture-napi`、`image-processor-napi`、`modifiers-napi`、`url-handler-napi` 通过 `--external` 排除捆绑,减小二进制体积并允许运行时加载原生模块。
|
| 261 |
5. **环境变量定义**: `process.env.USER_TYPE='external'`、`process.env.CLAUDE_CODE_FORCE_FULL_LOGO='true'`、`process.env.CCR_FORCE_BUNDLE='true'` 等定义确保构建产物运行于正确模式。
|
| 262 |
6. **完整特性集**: 使用 `--feature-set=dev-full` 启用全部实验特性(50+ feature flags),默认仅启用 `VOICE_MODE`。
|
| 263 |
-
7. **输出产物**: 开发版本输出到 `./
|
| 264 |
|
| 265 |
---
|
| 266 |
|
|
|
|
| 260 |
4. **外部模块排除**: `@ant/*`、`audio-capture-napi`、`image-processor-napi`、`modifiers-napi`、`url-handler-napi` 通过 `--external` 排除捆绑,减小二进制体积并允许运行时加载原生模块。
|
| 261 |
5. **环境变量定义**: `process.env.USER_TYPE='external'`、`process.env.CLAUDE_CODE_FORCE_FULL_LOGO='true'`、`process.env.CCR_FORCE_BUNDLE='true'` 等定义确保构建产物运行于正确模式。
|
| 262 |
6. **完整特性集**: 使用 `--feature-set=dev-full` 启用全部实验特性(50+ feature flags),默认仅启用 `VOICE_MODE`。
|
| 263 |
+
7. **输出产物**: 开发版本输出到 `./Codev`,发布版本输出到 `./dist/cli`。
|
| 264 |
|
| 265 |
---
|
| 266 |
|
docs/architecture/data-flow.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
# 核心数据流
|
| 2 |
|
| 3 |
-
本文档详细描述
|
| 4 |
|
| 5 |
---
|
| 6 |
|
|
@@ -90,7 +90,7 @@ query() 函数
|
|
| 90 |
|
| 91 |
### 语音捕获架构
|
| 92 |
|
| 93 |
-
|
| 94 |
|
| 95 |
```
|
| 96 |
麦克风 (硬件)
|
|
|
|
| 1 |
# 核心数据流
|
| 2 |
|
| 3 |
+
本文档详细描述 Codev 的六大核心数据流,包含 ASCII 序列图和关键代码路径。
|
| 4 |
|
| 5 |
---
|
| 6 |
|
|
|
|
| 90 |
|
| 91 |
### 语音捕获架构
|
| 92 |
|
| 93 |
+
Codev 使用进程内音频捕获(cpal Rust 库,通过 `native-modules/audio-capture-napi`),而不是传统的 arecord/parecord 子进程。
|
| 94 |
|
| 95 |
```
|
| 96 |
麦克风 (硬件)
|
docs/architecture/design-philosophy.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
# 设计哲学与架构原则
|
| 2 |
|
| 3 |
-
> 本文档综合自 Dive into Claude Code (arXiv:2604.14228v1) 的架构分析以及
|
| 4 |
> 源代码的实际实现模式,旨在为面试准备和系统设计讨论提供参考。
|
| 5 |
>
|
| 6 |
> Claude Code 的设计哲学源于五个核心人类价值,通过十三条设计原则转化为具体的架构决策。
|
| 7 |
-
>
|
| 8 |
|
| 9 |
---
|
| 10 |
|
|
@@ -171,13 +171,13 @@ Claude Code 的原则组合的独特之处在于:最小决策脚手架 + 分
|
|
| 171 |
|
| 172 |
---
|
| 173 |
|
| 174 |
-
## 4.
|
| 175 |
|
| 176 |
-
|
| 177 |
|
| 178 |
### 4.1 多 Provider 支持
|
| 179 |
|
| 180 |
-
- Claude Code 内置仅支持 Anthropic API,而
|
| 181 |
支持 OpenAI、Groq、DeepSeek 以及所有兼容 OpenAI 的 API。
|
| 182 |
- **实现模式**:`src/server/proxy/handler.ts` 实现双路由决策——
|
| 183 |
- 1P Anthropic 路径:直接调用 Anthropic SDK
|
|
@@ -314,7 +314,7 @@ Budget Reduction (工具结果大小限制)
|
|
| 314 |
- **Dive into Claude Code** (arXiv:2604.14228v1): 对本文档所基于的原始架构分析论文
|
| 315 |
- **Anthropic Safe Agents Framework**: 安全代理设计的原则文档
|
| 316 |
- **Claude Code 官方文档**: [https://code.claude.com/docs/](https://code.claude.com/docs/)
|
| 317 |
-
- **
|
| 318 |
- 核心循环: `src/query.ts`
|
| 319 |
- 权限系统: `src/utils/permissions/`
|
| 320 |
- 压缩管道: `src/services/compact/`
|
|
@@ -326,4 +326,4 @@ Budget Reduction (工具结果大小限制)
|
|
| 326 |
---
|
| 327 |
|
| 328 |
> **文档版本**: v1.0 — 2026-06-22
|
| 329 |
-
> **作者**: 基于 Claude Code 设计哲学论文和
|
|
|
|
| 1 |
# 设计哲学与架构原则
|
| 2 |
|
| 3 |
+
> 本文档综合自 Dive into Claude Code (arXiv:2604.14228v1) 的架构分析以及 Codev
|
| 4 |
> 源代码的实际实现模式,旨在为面试准备和系统设计讨论提供参考。
|
| 5 |
>
|
| 6 |
> Claude Code 的设计哲学源于五个核心人类价值,通过十三条设计原则转化为具体的架构决策。
|
| 7 |
+
> Codev 在此基础上进行了多 Provider 和 Friend VRM 等扩展。
|
| 8 |
|
| 9 |
---
|
| 10 |
|
|
|
|
| 171 |
|
| 172 |
---
|
| 173 |
|
| 174 |
+
## 4. Codev 与 Claude Code 的差异
|
| 175 |
|
| 176 |
+
Codev 以 Claude Code 为上游基础,进行了以下主要变更和扩展:
|
| 177 |
|
| 178 |
### 4.1 多 Provider 支持
|
| 179 |
|
| 180 |
+
- Claude Code 内置仅支持 Anthropic API,而 Codev 通过 Provider 代理架构
|
| 181 |
支持 OpenAI、Groq、DeepSeek 以及所有兼容 OpenAI 的 API。
|
| 182 |
- **实现模式**:`src/server/proxy/handler.ts` 实现双路由决策——
|
| 183 |
- 1P Anthropic 路径:直接调用 Anthropic SDK
|
|
|
|
| 314 |
- **Dive into Claude Code** (arXiv:2604.14228v1): 对本文档所基于的原始架构分析论文
|
| 315 |
- **Anthropic Safe Agents Framework**: 安全代理设计的原则文档
|
| 316 |
- **Claude Code 官方文档**: [https://code.claude.com/docs/](https://code.claude.com/docs/)
|
| 317 |
+
- **Codev 源代码**: `/home/yuki/Code/Agent/Codev/src/`
|
| 318 |
- 核心循环: `src/query.ts`
|
| 319 |
- 权限系统: `src/utils/permissions/`
|
| 320 |
- 压缩管道: `src/services/compact/`
|
|
|
|
| 326 |
---
|
| 327 |
|
| 328 |
> **文档版本**: v1.0 — 2026-06-22
|
| 329 |
+
> **作者**: 基于 Claude Code 设计哲学论文和 Codev 源代码综合分析
|
docs/architecture/overview.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
|
| 3 |
## 项目定位
|
| 4 |
|
| 5 |
-
|
| 6 |
|
| 7 |
- **VRM 桌面伴侣**(Friend):在同一进程中运行 HTTP/SSE 服务,驱动 3D VRM 角色的表情、语音和文本气泡
|
| 8 |
- **多模型提供者**:通过反向代理层将 Anthropic Messages API 协议翻译为 OpenAI Chat/Responses API 协议,支持数十种第三方模型
|
|
|
|
| 2 |
|
| 3 |
## 项目定位
|
| 4 |
|
| 5 |
+
Codev 是一个 AI CLI 智能代理,基于 Anthropic Claude Code 源代码构建,增强了对以下场景的支持:
|
| 6 |
|
| 7 |
- **VRM 桌面伴侣**(Friend):在同一进程中运行 HTTP/SSE 服务,驱动 3D VRM 角色的表情、语音和文本气泡
|
| 8 |
- **多模型提供者**:通过反向代理层将 Anthropic Messages API 协议翻译为 OpenAI Chat/Responses API 协议,支持数十种第三方模型
|
docs/architecture/provider-auth.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
| 1 |
# 多 Provider 认证与协议转换架构
|
| 2 |
|
| 3 |
-
> 本文档描述
|
| 4 |
-
> 代码库:`/home/yuki/Code/Agent/
|
| 5 |
|
| 6 |
---
|
| 7 |
|
| 8 |
## 1. 支持的认证提供者
|
| 9 |
|
| 10 |
-
|
| 11 |
|
| 12 |
| Provider | 认证方式 | 协议格式 | 实现位置 |
|
| 13 |
|---|---|---|---|
|
|
@@ -28,7 +28,7 @@ VersperClaw 支持以下 Provider,按认证方式与协议类型分类:
|
|
| 28 |
|
| 29 |
### 2.1 两级架构总览
|
| 30 |
|
| 31 |
-
|
| 32 |
|
| 33 |
```
|
| 34 |
Tier 1: TUI 内置 Provider (原始 Claude Code)
|
|
@@ -36,7 +36,7 @@ Tier 1: TUI 内置 Provider (原始 Claude Code)
|
|
| 36 |
存储: ~/.claude.json (单字段 authProvider)
|
| 37 |
实现: src/services/api/client.ts + src/utils/model/providers.ts
|
| 38 |
|
| 39 |
-
Tier 2: cc-haha Provider 预设系统 (
|
| 40 |
用途: 桌面端多 Provider 管理、预设配置、Proxy 转换
|
| 41 |
存储: ~/.claude/cc-haha/providers.json (结构化索引)
|
| 42 |
实现: src/server/services/providerService.ts
|
|
@@ -240,7 +240,7 @@ OpenAI → Anthropic (非流式):
|
|
| 240 |
|
| 241 |
### 3.5 服务端 Proxy 模式
|
| 242 |
|
| 243 |
-
除了客户端的 Fetch Override 模式,
|
| 244 |
|
| 245 |
设计目标:将协议转换逻辑从客户端分离到独立 HTTP 服务,支持更灵活的 Provider 管理。
|
| 246 |
|
|
|
|
| 1 |
# 多 Provider 认证与协议转换架构
|
| 2 |
|
| 3 |
+
> 本文档描述 Codev (cc-haha) 的多 Provider 认证架构、OAuth 2.0 流程、API 协议转换机制以及 Provider 配置管理体系。
|
| 4 |
+
> 代码库:`/home/yuki/Code/Agent/Codev`
|
| 5 |
|
| 6 |
---
|
| 7 |
|
| 8 |
## 1. 支持的认证提供者
|
| 9 |
|
| 10 |
+
Codev 支持以下 Provider,按认证方式与协议类型分类:
|
| 11 |
|
| 12 |
| Provider | 认证方式 | 协议格式 | 实现位置 |
|
| 13 |
|---|---|---|---|
|
|
|
|
| 28 |
|
| 29 |
### 2.1 两级架构总览
|
| 30 |
|
| 31 |
+
Codev 拥有两套独立的 Provider 系统,设计目标不同:
|
| 32 |
|
| 33 |
```
|
| 34 |
Tier 1: TUI 内置 Provider (原始 Claude Code)
|
|
|
|
| 36 |
存储: ~/.claude.json (单字段 authProvider)
|
| 37 |
实现: src/services/api/client.ts + src/utils/model/providers.ts
|
| 38 |
|
| 39 |
+
Tier 2: cc-haha Provider 预设系统 (Codev 扩展)
|
| 40 |
用途: 桌面端多 Provider 管理、预设配置、Proxy 转换
|
| 41 |
存储: ~/.claude/cc-haha/providers.json (结构化索引)
|
| 42 |
实现: src/server/services/providerService.ts
|
|
|
|
| 240 |
|
| 241 |
### 3.5 服务端 Proxy 模式
|
| 242 |
|
| 243 |
+
除了客户端的 Fetch Override 模式,Codev 还实现了一套**服务端 Proxy**,位于 `src/server/proxy/handler.ts`。
|
| 244 |
|
| 245 |
设计目标:将协议转换逻辑从客户端分离到独立 HTTP 服务,支持更灵活的 Provider 管理。
|
| 246 |
|
docs/architecture/safety-and-permissions.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
# 安全与权限系统深度分析
|
| 2 |
|
| 3 |
-
> 本文基于
|
| 4 |
> 版本参考:commit `835ff5a` / `cdb3bdd`
|
| 5 |
|
| 6 |
---
|
|
|
|
| 1 |
# 安全与权限系统深度分析
|
| 2 |
|
| 3 |
+
> 本文基于 Codev (Claude Code) 源代码,深入分析其安全架构与权限子系统。
|
| 4 |
> 版本参考:commit `835ff5a` / `cdb3bdd`
|
| 5 |
|
| 6 |
---
|
docs/cli/build-system.md
CHANGED
|
@@ -9,8 +9,8 @@
|
|
| 9 |
| 命令 | 对应脚本参数 | 输出格式 | 说明 |
|
| 10 |
| --- | --- | --- | --- |
|
| 11 |
| `bun run build` | 无 | 源码产物 (`./cli`) | 默认构建,不编译为二进制 |
|
| 12 |
-
| `bun run build:dev` | `--dev` | 源码产物 (`./
|
| 13 |
-
| `bun run build:dev:full` | `--dev --feature-set=dev-full` | 源码产物 (`./
|
| 14 |
| `bun run compile` | `--compile` | 二进制可执行文件 (`./dist/cli`) | 生产构建,编译为 Bun 原生二进制 |
|
| 15 |
| `bun run dev` | — | 直接运行 | 通过 `bun run ./src/entrypoints/cli.tsx` 直接执行,跳过构建步骤 |
|
| 16 |
|
|
@@ -534,7 +534,7 @@ export function filterToolsByDenyRules<T extends { name: string; mcpInfo?: ... }
|
|
| 534 |
dist/
|
| 535 |
├── cli # 生产二进制(`--compile` 模式,~192MB)
|
| 536 |
├── cli.js # 生产源码产物(非编译模式,~20MB)
|
| 537 |
-
├──
|
| 538 |
└── vendor/ # 原生二进制库(仅非编译模式)
|
| 539 |
├── audio-capture/ # 音频捕获原生模块
|
| 540 |
├── audio-capture-src/ # 音频捕获源码
|
|
@@ -546,9 +546,9 @@ dist/
|
|
| 546 |
| 构建模式 | 入口文件 | 产物路径 | 大小 | 类型 |
|
| 547 |
| --- | --- | --- | --- | --- |
|
| 548 |
| `build`(默认) | `scripts/build.ts` | `./cli` | ~0(源码引用) | 源码(Bun bundle) |
|
| 549 |
-
| `build:dev` | `scripts/build.ts --dev` | `./
|
| 550 |
| `compile` | `scripts/build.ts --compile` | `./dist/cli` | ~192MB | Bun 编译二进制 |
|
| 551 |
-
| `compile + dev` | `scripts/build.ts --compile --dev` | `./dist/
|
| 552 |
|
| 553 |
### 5.3 预加载脚本
|
| 554 |
|
|
@@ -591,11 +591,11 @@ bun run dev
|
|
| 591 |
|
| 592 |
# 开发构建 + 运行
|
| 593 |
bun run build:dev
|
| 594 |
-
./
|
| 595 |
|
| 596 |
# 开发构建(全部实验特性)+ 运行
|
| 597 |
bun run build:dev:full
|
| 598 |
-
./
|
| 599 |
```
|
| 600 |
|
| 601 |
### 6.2 生产构建
|
|
|
|
| 9 |
| 命令 | 对应脚本参数 | 输出格式 | 说明 |
|
| 10 |
| --- | --- | --- | --- |
|
| 11 |
| `bun run build` | 无 | 源码产物 (`./cli`) | 默认构建,不编译为二进制 |
|
| 12 |
+
| `bun run build:dev` | `--dev` | 源码产物 (`./Codev`) | 开发版本,自动附加 git SHA 和构建时间作为开发版本号 |
|
| 13 |
+
| `bun run build:dev:full` | `--dev --feature-set=dev-full` | 源码产物 (`./Codev`) | 开发版本,启用全部实验性功能标记 |
|
| 14 |
| `bun run compile` | `--compile` | 二进制可执行文件 (`./dist/cli`) | 生产构建,编译为 Bun 原生二进制 |
|
| 15 |
| `bun run dev` | — | 直接运行 | 通过 `bun run ./src/entrypoints/cli.tsx` 直接执行,跳过构建步骤 |
|
| 16 |
|
|
|
|
| 534 |
dist/
|
| 535 |
├── cli # 生产二进制(`--compile` 模式,~192MB)
|
| 536 |
├── cli.js # 生产源码产物(非编译模式,~20MB)
|
| 537 |
+
├── Codev # 开发二进制(`--dev --compile` 模式,~202MB)
|
| 538 |
└── vendor/ # 原生二进制库(仅非编译模式)
|
| 539 |
├── audio-capture/ # 音频捕获原生模块
|
| 540 |
├── audio-capture-src/ # 音频捕获源码
|
|
|
|
| 546 |
| 构建模式 | 入口文件 | 产物路径 | 大小 | 类型 |
|
| 547 |
| --- | --- | --- | --- | --- |
|
| 548 |
| `build`(默认) | `scripts/build.ts` | `./cli` | ~0(源码引用) | 源码(Bun bundle) |
|
| 549 |
+
| `build:dev` | `scripts/build.ts --dev` | `./Codev` | ~0(源码引用) | 源码 |
|
| 550 |
| `compile` | `scripts/build.ts --compile` | `./dist/cli` | ~192MB | Bun 编译二进制 |
|
| 551 |
+
| `compile + dev` | `scripts/build.ts --compile --dev` | `./dist/Codev` | ~202MB | Bun 编译二进制(调试) |
|
| 552 |
|
| 553 |
### 5.3 预加载脚本
|
| 554 |
|
|
|
|
| 591 |
|
| 592 |
# 开发构建 + 运行
|
| 593 |
bun run build:dev
|
| 594 |
+
./Codev
|
| 595 |
|
| 596 |
# 开发构建(全部实验特性)+ 运行
|
| 597 |
bun run build:dev:full
|
| 598 |
+
./Codev
|
| 599 |
```
|
| 600 |
|
| 601 |
### 6.2 生产构建
|
docs/cli/debug-system.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
|
| 3 |
## 概述
|
| 4 |
|
| 5 |
-
|
| 6 |
|
| 7 |
1. **会话级调试日志** — 基于 `logForDebugging()` 的持久化日志系统,用于内部诊断
|
| 8 |
2. **`/debug` 交互式调试** — 基于 DEBUG PROBE 的主动式调试工作流(v2.0)
|
|
@@ -66,7 +66,7 @@ debug.ts (bundled skill)
|
|
| 66 |
模型自动执行:分析 → 插探针 → 复现 → 分析日志 → 修复 → 验证 → 清理
|
| 67 |
│
|
| 68 |
▼
|
| 69 |
-
DebugSessionTool — 管理 .
|
| 70 |
```
|
| 71 |
|
| 72 |
### 与 v1 的区别
|
|
@@ -74,7 +74,7 @@ DebugSessionTool — 管理 .versperclaw-debug/ 目录
|
|
| 74 |
| 方面 | v1(旧) | v2.0(当前) |
|
| 75 |
|------|---------|-------------|
|
| 76 |
| 方式 | 被动读取调试日志 | 主动插入探针 |
|
| 77 |
-
| 数据源 | `~/.claude/debug/*.txt` | `.
|
| 78 |
| 模型角色 | 分析已有日志 | 插桩 → 复现 → 分析 → 修复 |
|
| 79 |
| 工作流 | 无结构化步骤 | 8 步 CHECKPOINT |
|
| 80 |
|
|
@@ -84,7 +84,7 @@ DebugSessionTool — 管理 .versperclaw-debug/ 目录
|
|
| 84 |
|------|------|
|
| 85 |
| **Step 0: Triage** | 确认 bug 报告完整(预期/实际/复现步骤/一致性/错误) |
|
| 86 |
| **Step 1: Plan Probes** | 阅读代码,形成 2-3 个假设,输出探针插入计划表 |
|
| 87 |
-
| **Step 2: Init Session** | 调用 `DebugSession({ action: "init" })` 创建 `.
|
| 88 |
| **Step 3: Insert Probes** | 用 Edit 插入 `DEBUG PROBE [N]` / `DEBUG PROBE END [N]` 代码块 |
|
| 89 |
| **Step 4: Reproduce & Log** | 调用 `DebugSession begin_run`,运行复现命令,通过 `read_log` 收集 |
|
| 90 |
| **Step 5: Analyze** | 引用日志行,定位根因 |
|
|
@@ -97,7 +97,7 @@ DebugSessionTool — 管理 .versperclaw-debug/ 目录
|
|
| 97 |
```typescript
|
| 98 |
// DEBUG PROBE [1] <label>
|
| 99 |
try {
|
| 100 |
-
require('fs').appendFileSync('.
|
| 101 |
`[${new Date().toISOString()}] [js] file.ts:42 | label | value=${JSON.stringify(value)}\n`)
|
| 102 |
} catch {}
|
| 103 |
// DEBUG PROBE END [1]
|
|
@@ -118,16 +118,16 @@ try {
|
|
| 118 |
|
| 119 |
| 动作 | 说明 |
|
| 120 |
|------|------|
|
| 121 |
-
| `init` | 创建 `.
|
| 122 |
| `begin_run` | 追加 `RUN #N` 分隔符,递增运行计数器 |
|
| 123 |
| `begin_verify` | 追加 `VERIFY` 分隔符 |
|
| 124 |
| `read_log` | 读取 `debug.log` 尾部内容 |
|
| 125 |
-
| `cleanup` | 删除 `.
|
| 126 |
|
| 127 |
### 目录结构
|
| 128 |
|
| 129 |
```
|
| 130 |
-
.
|
| 131 |
debug.log -- 探针写入 + RUN/VERIFY 分隔符
|
| 132 |
state -- JSON: { "runCount": 3 }
|
| 133 |
```
|
|
|
|
| 2 |
|
| 3 |
## 概述
|
| 4 |
|
| 5 |
+
Codev 提供两层调试能力:
|
| 6 |
|
| 7 |
1. **会话级调试日志** — 基于 `logForDebugging()` 的持久化日志系统,用于内部诊断
|
| 8 |
2. **`/debug` 交互式调试** — 基于 DEBUG PROBE 的主动式调试工作流(v2.0)
|
|
|
|
| 66 |
模型自动执行:分析 → 插探针 → 复现 → 分析日志 → 修复 → 验证 → 清理
|
| 67 |
│
|
| 68 |
▼
|
| 69 |
+
DebugSessionTool — 管理 .codev-debug/ 目录
|
| 70 |
```
|
| 71 |
|
| 72 |
### 与 v1 的区别
|
|
|
|
| 74 |
| 方面 | v1(旧) | v2.0(当前) |
|
| 75 |
|------|---------|-------------|
|
| 76 |
| 方式 | 被动读取调试日志 | 主动插入探针 |
|
| 77 |
+
| 数据源 | `~/.claude/debug/*.txt` | `.codev-debug/debug.log` |
|
| 78 |
| 模型角色 | 分析已有日志 | 插桩 → 复现 → 分析 → 修复 |
|
| 79 |
| 工作流 | 无结构化步骤 | 8 步 CHECKPOINT |
|
| 80 |
|
|
|
|
| 84 |
|------|------|
|
| 85 |
| **Step 0: Triage** | 确认 bug 报告完整(预期/实际/复现步骤/一致性/错误) |
|
| 86 |
| **Step 1: Plan Probes** | 阅读代码,形成 2-3 个假设,输出探针插入计划表 |
|
| 87 |
+
| **Step 2: Init Session** | 调用 `DebugSession({ action: "init" })` 创建 `.codev-debug/` |
|
| 88 |
| **Step 3: Insert Probes** | 用 Edit 插入 `DEBUG PROBE [N]` / `DEBUG PROBE END [N]` 代码块 |
|
| 89 |
| **Step 4: Reproduce & Log** | 调用 `DebugSession begin_run`,运行复现命令,通过 `read_log` 收集 |
|
| 90 |
| **Step 5: Analyze** | 引用日志行,定位根因 |
|
|
|
|
| 97 |
```typescript
|
| 98 |
// DEBUG PROBE [1] <label>
|
| 99 |
try {
|
| 100 |
+
require('fs').appendFileSync('.codev-debug/debug.log',
|
| 101 |
`[${new Date().toISOString()}] [js] file.ts:42 | label | value=${JSON.stringify(value)}\n`)
|
| 102 |
} catch {}
|
| 103 |
// DEBUG PROBE END [1]
|
|
|
|
| 118 |
|
| 119 |
| 动作 | 说明 |
|
| 120 |
|------|------|
|
| 121 |
+
| `init` | 创建 `.codev-debug/` 目录、`debug.log`、`state` 文件 |
|
| 122 |
| `begin_run` | 追加 `RUN #N` 分隔符,递增运行计数器 |
|
| 123 |
| `begin_verify` | 追加 `VERIFY` 分隔符 |
|
| 124 |
| `read_log` | 读取 `debug.log` 尾部内容 |
|
| 125 |
+
| `cleanup` | 删除 `.codev-debug/` 目录 |
|
| 126 |
|
| 127 |
### 目录结构
|
| 128 |
|
| 129 |
```
|
| 130 |
+
.codev-debug/
|
| 131 |
debug.log -- 探针写入 + RUN/VERIFY 分隔符
|
| 132 |
state -- JSON: { "runCount": 3 }
|
| 133 |
```
|
docs/cli/overview.md
CHANGED
|
@@ -260,7 +260,7 @@ CLI 入口由 **Commander.js** 解析命令行参数,随后启动 **REPL**(
|
|
| 260 |
支持的配置项包括 theme、model、permissions(权限模式)、音效、通知等。
|
| 261 |
|
| 262 |
相关文件:
|
| 263 |
-
- `/home/yuki/Code/Agent/
|
| 264 |
-
- `/home/yuki/Code/Agent/
|
| 265 |
-
- `/home/yuki/Code/Agent/
|
| 266 |
-
- `/home/yuki/Code/Agent/
|
|
|
|
| 260 |
支持的配置项包括 theme、model、permissions(权限模式)、音效、通知等。
|
| 261 |
|
| 262 |
相关文件:
|
| 263 |
+
- `/home/yuki/Code/Agent/Codev/src/commands.ts` — 命令注册与过滤核心
|
| 264 |
+
- `/home/yuki/Code/Agent/Codev/src/types/command.ts` — Command 类型定义
|
| 265 |
+
- `/home/yuki/Code/Agent/Codev/src/skills/loadSkillsDir.ts` — 技能目录加载
|
| 266 |
+
- `/home/yuki/Code/Agent/Codev/src/tools/WorkflowTool/` — 工作流工具实现
|
docs/coordinator/multi-agent.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
|
| 3 |
## 概述
|
| 4 |
|
| 5 |
-
Coordinator 模式是
|
| 6 |
|
| 7 |
### 激活方式
|
| 8 |
|
|
@@ -210,7 +210,7 @@ AgentTool({ prompt: "Based on your findings, implement the fix" }) // 错误:
|
|
| 210 |
|
| 211 |
### 概述
|
| 212 |
|
| 213 |
-
Agent Teams(Swarm 模式)是
|
| 214 |
|
| 215 |
### 激活方式
|
| 216 |
|
|
|
|
| 2 |
|
| 3 |
## 概述
|
| 4 |
|
| 5 |
+
Coordinator 模式是 Codev 的一种高级执行模式,允许一个协调者(Coordinator)LLM 通过 `AgentTool` 派生子代理(Worker)并行执行任务。通过 `CLAUDE_CODE_COORDINATOR_MODE` 环境变量激活。
|
| 6 |
|
| 7 |
### 激活方式
|
| 8 |
|
|
|
|
| 210 |
|
| 211 |
### 概述
|
| 212 |
|
| 213 |
+
Agent Teams(Swarm 模式)是 Codev 的多 Agent 拓扑模型,通过 `feature('AGENT_SWARMS')` 编译期标记门控。与 Coordinator/Worker 模式不同,Teams 采用**文件系统邮箱通信**,每个 Agent 在独立进程中运行(tmux split-pane / in-process)。
|
| 214 |
|
| 215 |
### 激活方式
|
| 216 |
|
docs/friend/architecture.md
CHANGED
|
@@ -195,7 +195,7 @@ broadcastToVrm(payload: VrmBroadcastPayload)
|
|
| 195 |
|
| 196 |
`freePort()` 方法在启动时尝试释放被占用的端口:
|
| 197 |
1. 使用 `ss -tlnp` 查找端口占用进程
|
| 198 |
-
2. 验证进程是否为 `bun`/`
|
| 199 |
3. 发送 SIGTERM,等待 3s,失败则 SIGKILL
|
| 200 |
|
| 201 |
### 3.3 路由
|
|
@@ -365,7 +365,7 @@ interface FriendPrefs {
|
|
| 365 |
}
|
| 366 |
```
|
| 367 |
|
| 368 |
-
持久化路径: `~/.config/
|
| 369 |
|
| 370 |
---
|
| 371 |
|
|
@@ -378,7 +378,7 @@ interface FriendPrefs {
|
|
| 378 |
- 管道 stdout/stderr 到主进程日志
|
| 379 |
- 退出时自动清理
|
| 380 |
|
| 381 |
-
启动路径: `src/components/friend/frontend/src-tauri/target/{release|debug}/
|
| 382 |
|
| 383 |
---
|
| 384 |
|
|
|
|
| 195 |
|
| 196 |
`freePort()` 方法在启动时尝试释放被占用的端口:
|
| 197 |
1. 使用 `ss -tlnp` 查找端口占用进程
|
| 198 |
+
2. 验证进程是否为 `bun`/`Codev`/`claude-*`/`node`
|
| 199 |
3. 发送 SIGTERM,等待 3s,失败则 SIGKILL
|
| 200 |
|
| 201 |
### 3.3 路由
|
|
|
|
| 365 |
}
|
| 366 |
```
|
| 367 |
|
| 368 |
+
持久化路径: `~/.config/Codev/friend.json`
|
| 369 |
|
| 370 |
---
|
| 371 |
|
|
|
|
| 378 |
- 管道 stdout/stderr 到主进程日志
|
| 379 |
- 退出时自动清理
|
| 380 |
|
| 381 |
+
启动路径: `src/components/friend/frontend/src-tauri/target/{release|debug}/codev-friend`
|
| 382 |
|
| 383 |
---
|
| 384 |
|
docs/friend/overview.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
|
| 3 |
## 定位
|
| 4 |
|
| 5 |
-
Friend 是
|
| 6 |
|
| 7 |
核心设计理念:**同进程集成** — FriendService 作为单例运行在 CLI 主进程中,消息通过 `messageQueueManager.enqueue()` 直接注入到对话流程中,AI 回复通过 SSE 实时广播到前端显示。
|
| 8 |
|
|
@@ -19,7 +19,7 @@ Friend 是 VersperClaw 的 VRM 3D 桌面伙伴系统,与 CLI 共享同一进
|
|
| 19 |
| **TTS 服务** | `src/friend/tts.ts` | Edge TTS + Qwen DashScope TTS,音频文件注册表 |
|
| 20 |
| **STT 服务** | `src/friend/stt-service.ts` | 基于文件的语音转录(REST 端点) |
|
| 21 |
| **VAD 服务** | `src/friend/voice/vad-service.ts` | Silero VAD ONNX 模型,onnxruntime-web WASM 后端 |
|
| 22 |
-
| **偏好设置** | `src/friend/prefs.ts` | 持久化到 `~/.config/
|
| 23 |
| **Tauri 启动器** | `src/friend/tauri-launcher.ts` | 启动 Tauri 桌面窗口 |
|
| 24 |
| **前端应用** | `src/components/friend/frontend/` | React + Three.js + @pixiv/three-vrm |
|
| 25 |
|
|
@@ -81,7 +81,7 @@ Friend 支持 13 种情绪,映射到 VRM blend shapes 和骨骼动画:
|
|
| 81 |
|
| 82 |
```
|
| 83 |
┌─────────────────────────────────────────────────────────────────┐
|
| 84 |
-
│
|
| 85 |
│ │
|
| 86 |
│ ┌──────────────┐ ┌──────────────────┐ ┌───────────────┐ │
|
| 87 |
│ │ CLI TUI │ │ LLM Provider │ │ Bridge API │ │
|
|
@@ -135,4 +135,4 @@ Friend 支持 13 种情绪,映射到 VRM blend shapes 和骨骼动画:
|
|
| 135 |
- API 路由: `src/server/api/friend.ts` — 所有 HTTP 端点
|
| 136 |
- LLM 工具: `src/tools/FriendEmotionTool.ts`, `src/tools/FriendScreenObserveTool.ts`
|
| 137 |
- 技能注入: `src/skills/bundled/friendPrompt.ts`
|
| 138 |
-
- 配置: `~/.config/
|
|
|
|
| 2 |
|
| 3 |
## 定位
|
| 4 |
|
| 5 |
+
Friend 是 Codev 的 VRM 3D 桌面伙伴系统,与 CLI 共享同一进程运行。它通过 SSE + HTTP 与 Tauri 前端通信,无需独立的子进程或外部服务。用户可以与 VRM 角色进行文字聊天、语音对话,角色会通过 3D 表情、肢体动作和语音进行反馈。
|
| 6 |
|
| 7 |
核心设计理念:**同进程集成** — FriendService 作为单例运行在 CLI 主进程中,消息通过 `messageQueueManager.enqueue()` 直接注入到对话流程中,AI 回复通过 SSE 实时广播到前端显示。
|
| 8 |
|
|
|
|
| 19 |
| **TTS 服务** | `src/friend/tts.ts` | Edge TTS + Qwen DashScope TTS,音频文件注册表 |
|
| 20 |
| **STT 服务** | `src/friend/stt-service.ts` | 基于文件的语音转录(REST 端点) |
|
| 21 |
| **VAD 服务** | `src/friend/voice/vad-service.ts` | Silero VAD ONNX 模型,onnxruntime-web WASM 后端 |
|
| 22 |
+
| **偏好设置** | `src/friend/prefs.ts` | 持久化到 `~/.config/Codev/friend.json` |
|
| 23 |
| **Tauri 启动器** | `src/friend/tauri-launcher.ts` | 启动 Tauri 桌面窗口 |
|
| 24 |
| **前端应用** | `src/components/friend/frontend/` | React + Three.js + @pixiv/three-vrm |
|
| 25 |
|
|
|
|
| 81 |
|
| 82 |
```
|
| 83 |
┌─────────────────────────────────────────────────────────────────┐
|
| 84 |
+
│ Codev 主进程 (Bun) │
|
| 85 |
│ │
|
| 86 |
│ ┌──────────────┐ ┌──────────────────┐ ┌───────────────┐ │
|
| 87 |
│ │ CLI TUI │ │ LLM Provider │ │ Bridge API │ │
|
|
|
|
| 135 |
- API 路由: `src/server/api/friend.ts` — 所有 HTTP 端点
|
| 136 |
- LLM 工具: `src/tools/FriendEmotionTool.ts`, `src/tools/FriendScreenObserveTool.ts`
|
| 137 |
- 技能注入: `src/skills/bundled/friendPrompt.ts`
|
| 138 |
+
- 配置: `~/.config/Codev/friend.json`
|
docs/friend/voice-vad.md
CHANGED
|
@@ -146,7 +146,7 @@ startSttConnectionWithTimeout(provider, language)
|
|
| 146 |
startSttConnection(provider, language)
|
| 147 |
│
|
| 148 |
├── anthropic: connectVoiceStream(callbacks, { language, keyterms })
|
| 149 |
-
│ keyterms: ['code', '
|
| 150 |
│
|
| 151 |
├── local: preloadWhisperModel + connectLocalWhisperStream
|
| 152 |
│ 需预加载模型(首次加载较慢)
|
|
|
|
| 146 |
startSttConnection(provider, language)
|
| 147 |
│
|
| 148 |
├── anthropic: connectVoiceStream(callbacks, { language, keyterms })
|
| 149 |
+
│ keyterms: ['code', 'codev'] 提高相关词汇识别率
|
| 150 |
│
|
| 151 |
├── local: preloadWhisperModel + connectLocalWhisperStream
|
| 152 |
│ 需预加载模型(首次加载较慢)
|
docs/ink-ui/overview.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
| 2 |
|
| 3 |
## 概述
|
| 4 |
|
| 5 |
-
|
| 6 |
|
| 7 |
-
> 与上游相比,
|
| 8 |
|
| 9 |
---
|
| 10 |
|
|
|
|
| 2 |
|
| 3 |
## 概述
|
| 4 |
|
| 5 |
+
Codev 的 Ink 是基于 [vadimdemedes/ink](https://github.com/vadimdemedes/ink) v6 的深度定制分叉(fork)。Ink 使用 React 组件模型渲染终端用户界面。它将 React 的虚拟 DOM 映射到终端字符网格,支持 Yoga Flexbox 布局、样式继承、事件处理、文本选择、搜索高亮等丰富的交互能力。
|
| 6 |
|
| 7 |
+
> 与上游相比,Codev 的 Ink 新增/修改了以下核心能力:自定义 DOM 节点树、压缩屏幕缓冲区(Int32Array)、基于 Yoga WASM 的布局引擎、Kitty 键盘协议支持、SGR 鼠标跟踪、文本选择模式、搜索高亮、双向文本处理、scrollable 容器、声明式光标位置等。
|
| 8 |
|
| 9 |
---
|
| 10 |
|
docs/interview-prep.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
# 面试准备指南 —
|
| 2 |
|
| 3 |
> 适用场景: 系统设计面试、技术深挖面试、架构师/高级工程师面试
|
| 4 |
> 目标: 覆盖 AI CLI 代理的核心设计决策、权衡、以及可以引申到通用分布式系统的知识点
|
|
@@ -7,9 +7,9 @@
|
|
| 7 |
|
| 8 |
## 1. 项目概述 (30-second pitch)
|
| 9 |
|
| 10 |
-
**
|
| 11 |
|
| 12 |
-
|
| 13 |
|
| 14 |
**三个核心差异化:**
|
| 15 |
|
|
@@ -157,7 +157,7 @@ Transparency (丢失细节, LLM 可能遗忘关键上下文)
|
|
| 157 |
|
| 158 |
### Q: 多 Provider 架构如何实现?
|
| 159 |
|
| 160 |
-
|
| 161 |
|
| 162 |
**Tier 1: Anthropic 原生通道**
|
| 163 |
|
|
@@ -199,7 +199,7 @@ VersperClaw 支持多种 LLM Provider, 架构分为两层:
|
|
| 199 |
|
| 200 |
### Q: Friend VRM 系统为什么设计为同进程 + SSE?
|
| 201 |
|
| 202 |
-
Friend 是
|
| 203 |
|
| 204 |
**架构选择:**
|
| 205 |
|
|
@@ -250,7 +250,7 @@ vs 微服务 (Microservices)
|
|
| 250 |
|
| 251 |
### Q: Feature Flag 系统如何实现死代码消除?
|
| 252 |
|
| 253 |
-
|
| 254 |
|
| 255 |
**实现位置:** `src/feature/feature.ts` / `feature()` 函数
|
| 256 |
|
|
@@ -342,7 +342,7 @@ if (feature("VOICE_MODE")) {
|
|
| 342 |
- 不同用户有不同的风险和信任水平
|
| 343 |
- 需要有审计和回溯能力
|
| 344 |
|
| 345 |
-
**方案设计 (参考
|
| 346 |
|
| 347 |
```
|
| 348 |
权限光谱: default → acceptEdits → plan → auto → bypassPermissions → dontAsk → bubble
|
|
@@ -392,7 +392,7 @@ if (feature("VOICE_MODE")) {
|
|
| 392 |
**架构选择: 同进程 vs 微服务**
|
| 393 |
|
| 394 |
```
|
| 395 |
-
方案 A: 同进程 (
|
| 396 |
┌─────────────────────────────┐
|
| 397 |
│ Agent Process │
|
| 398 |
│ ┌──────┐ ┌──────────────┐ │
|
|
@@ -451,7 +451,7 @@ if (feature("VOICE_MODE")) {
|
|
| 451 |
**方案对比:**
|
| 452 |
|
| 453 |
```
|
| 454 |
-
方案 A: Fetch Override (
|
| 455 |
优点:
|
| 456 |
- 无侵入: 不修改 SDK, 不修改 Agent 核心逻辑
|
| 457 |
- 统一接口: 所有代码只认识 Anthropic Messages 格式
|
|
@@ -519,7 +519,7 @@ OpenAI → Anthropic 逆映射同理
|
|
| 519 |
```
|
| 520 |
|
| 521 |
- **37signals 二分法**: 权限提示是摩擦, 但也是安全护栏
|
| 522 |
-
- **
|
| 523 |
- **面试价值**: 展示对安全架构和 UX 权衡的深度理解
|
| 524 |
|
| 525 |
---
|
|
@@ -537,7 +537,7 @@ OpenAI → Anthropic 逆映射同理
|
|
| 537 |
但可能丢失关键信息 但 token 成本更高
|
| 538 |
```
|
| 539 |
|
| 540 |
-
- **
|
| 541 |
- **关键洞察**: 压缩丢弃的是"发送给 LLM 的内容", 不是"系统记录的内容"
|
| 542 |
- **面试价值**: 展示对 LLM 上下文窗口限制的实际工程理解
|
| 543 |
|
|
@@ -578,7 +578,7 @@ Agent Loop 简单 (~88 行) 扩展机制丰富
|
|
| 578 |
开发效率高 但调试困难
|
| 579 |
```
|
| 580 |
|
| 581 |
-
- **
|
| 582 |
- **何时应该选微服务?** 多用户 Web 服务、需要独立扩缩容、团队分工明确
|
| 583 |
- **面试价值**: 展示架构选型不是技术炫耀, 而是根据实际场景做合理决策
|
| 584 |
|
|
@@ -687,15 +687,15 @@ Friend VRM 的场景是 Agent → Avatar 的单向广播, SSE 是最优解。如
|
|
| 687 |
|
| 688 |
```
|
| 689 |
30 秒: "一个带 3D 桌宠的 AI 编程助手 CLI"
|
| 690 |
-
2 分钟: "
|
| 691 |
核心增强是多 Provider 支持和 VRM 桌面伴侣,
|
| 692 |
采用同进程 + SSE 架构实现低延迟语音对话"
|
| 693 |
10 分钟: 深入 Agent Loop、权限系统、压缩管道、Friend 架构
|
| 694 |
```
|
| 695 |
|
| 696 |
-
### 把
|
| 697 |
|
| 698 |
-
|
|
| 699 |
|------------------|-------------------|
|
| 700 |
| Agent Loop | Event-driven orchestration |
|
| 701 |
| 4 层防御纵深 | Defense in depth |
|
|
@@ -711,4 +711,4 @@ Friend VRM 的场景是 Agent → Avatar 的单向广播, SSE 是最优解。如
|
|
| 711 |
---
|
| 712 |
|
| 713 |
> 最后更新: 2026-06-22
|
| 714 |
-
> 基于
|
|
|
|
| 1 |
+
# 面试准备指南 — Codev / Claude Code 架构知识体系
|
| 2 |
|
| 3 |
> 适用场景: 系统设计面试、技术深挖面试、架构师/高级工程师面试
|
| 4 |
> 目标: 覆盖 AI CLI 代理的核心设计决策、权衡、以及可以引申到通用分布式系统的知识点
|
|
|
|
| 7 |
|
| 8 |
## 1. 项目概述 (30-second pitch)
|
| 9 |
|
| 10 |
+
**Codev 是什么?**
|
| 11 |
|
| 12 |
+
Codev 是从 Anthropic Claude Code fork 出来的 AI CLI 代理 (Agentic Coding Assistant),运行在终端中,核心能力是理解自然语言开发指令并自动执行多步骤编码任务。
|
| 13 |
|
| 14 |
**三个核心差异化:**
|
| 15 |
|
|
|
|
| 157 |
|
| 158 |
### Q: 多 Provider 架构如何实现?
|
| 159 |
|
| 160 |
+
Codev 支持多种 LLM Provider, 架构分为两层:
|
| 161 |
|
| 162 |
**Tier 1: Anthropic 原生通道**
|
| 163 |
|
|
|
|
| 199 |
|
| 200 |
### Q: Friend VRM 系统为什么设计为同进程 + SSE?
|
| 201 |
|
| 202 |
+
Friend 是 Codev 的 3D 桌面伴侣系统, 使用 VRM 模型 (3D 虚拟角色), 具备表情、动作、语音对话能力。
|
| 203 |
|
| 204 |
**架构选择:**
|
| 205 |
|
|
|
|
| 250 |
|
| 251 |
### Q: Feature Flag 系统如何实现死代码消除?
|
| 252 |
|
| 253 |
+
Codev 使用编译时 Feature Flag 系统, 实现 `#ifdef` 风格的死代码消除。
|
| 254 |
|
| 255 |
**实现位置:** `src/feature/feature.ts` / `feature()` 函数
|
| 256 |
|
|
|
|
| 342 |
- 不同用户有不同的风险和信任水平
|
| 343 |
- 需要有审计和回溯能力
|
| 344 |
|
| 345 |
+
**方案设计 (参考 Codev):**
|
| 346 |
|
| 347 |
```
|
| 348 |
权限光谱: default → acceptEdits → plan → auto → bypassPermissions → dontAsk → bubble
|
|
|
|
| 392 |
**架构选择: 同进程 vs 微服务**
|
| 393 |
|
| 394 |
```
|
| 395 |
+
方案 A: 同进程 (Codev 的选择)
|
| 396 |
┌─────────────────────────────┐
|
| 397 |
│ Agent Process │
|
| 398 |
│ ┌──────┐ ┌──────────────┐ │
|
|
|
|
| 451 |
**方案对比:**
|
| 452 |
|
| 453 |
```
|
| 454 |
+
方案 A: Fetch Override (Codev 选型)
|
| 455 |
优点:
|
| 456 |
- 无侵入: 不修改 SDK, 不修改 Agent 核心逻辑
|
| 457 |
- 统一接口: 所有代码只认识 Anthropic Messages 格式
|
|
|
|
| 519 |
```
|
| 520 |
|
| 521 |
- **37signals 二分法**: 权限提示是摩擦, 但也是安全护栏
|
| 522 |
+
- **Codev 的答案**: 渐进信任 + 4 层防御 + ML 辅助
|
| 523 |
- **面试价值**: 展示对安全架构和 UX 权衡的深度理解
|
| 524 |
|
| 525 |
---
|
|
|
|
| 537 |
但可能丢失关键信息 但 token 成本更高
|
| 538 |
```
|
| 539 |
|
| 540 |
+
- **Codev 的答案**: 5 层压缩管道 + JSONL 持久化 + Append-only 日志
|
| 541 |
- **关键洞察**: 压缩丢弃的是"发送给 LLM 的内容", 不是"系统记录的内容"
|
| 542 |
- **面试价值**: 展示对 LLM 上下文窗口限制的实际工程理解
|
| 543 |
|
|
|
|
| 578 |
开发效率高 但调试困难
|
| 579 |
```
|
| 580 |
|
| 581 |
+
- **Codev 的答案**: 同进程, 因为这是一个单用户终端工具, 不是分布式系统
|
| 582 |
- **何时应该选微服务?** 多用户 Web 服务、需要独立扩缩容、团队分工明确
|
| 583 |
- **面试价值**: 展示架构选型不是技术炫耀, 而是根据实际场景做合理决策
|
| 584 |
|
|
|
|
| 687 |
|
| 688 |
```
|
| 689 |
30 秒: "一个带 3D 桌宠的 AI 编程助手 CLI"
|
| 690 |
+
2 分钟: "Codev 是从 Claude Code fork 的 AI CLI 代理,
|
| 691 |
核心增强是多 Provider 支持和 VRM 桌面伴侣,
|
| 692 |
采用同进程 + SSE 架构实现低延迟语音对话"
|
| 693 |
10 分钟: 深入 Agent Loop、权限系统、压缩管道、Friend 架构
|
| 694 |
```
|
| 695 |
|
| 696 |
+
### 把 Codev 经验映射到通用系统设计
|
| 697 |
|
| 698 |
+
| Codev 概念 | 通用系统设计概念 |
|
| 699 |
|------------------|-------------------|
|
| 700 |
| Agent Loop | Event-driven orchestration |
|
| 701 |
| 4 层防御纵深 | Defense in depth |
|
|
|
|
| 711 |
---
|
| 712 |
|
| 713 |
> 最后更新: 2026-06-22
|
| 714 |
+
> 基于 Codev main branch (commit 835ff5a)
|
docs/memory-context/context.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
|
| 3 |
## 概述
|
| 4 |
|
| 5 |
-
|
| 6 |
|
| 7 |
---
|
| 8 |
|
|
|
|
| 2 |
|
| 3 |
## 概述
|
| 4 |
|
| 5 |
+
Codev 的上下文管理系统负责构建模型会话的输入上下文,包含系统级信息和用户级信息,并在上下文超过限制时自动压缩。
|
| 6 |
|
| 7 |
---
|
| 8 |
|
docs/memory-context/memory.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
|
| 3 |
## 概述
|
| 4 |
|
| 5 |
-
|
| 6 |
|
| 7 |
---
|
| 8 |
|
|
|
|
| 2 |
|
| 3 |
## 概述
|
| 4 |
|
| 5 |
+
Codev 拥有一个基于文件的持久化记忆存储系统(Memdir),允许 Agent 在不同会话间记住用户信息、偏好、项目上下文等。记忆存储在项目对应的 `~/.claude/projects/<slug>/memory/` 目录中。
|
| 6 |
|
| 7 |
---
|
| 8 |
|
docs/server/overview.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
|
| 3 |
## 概述
|
| 4 |
|
| 5 |
-
|
| 6 |
|
| 7 |
- **入口文件**: `src/server/server.ts`
|
| 8 |
- **运行时**: Bun (JavaScript/TypeScript 运行时)
|
|
|
|
| 2 |
|
| 3 |
## 概述
|
| 4 |
|
| 5 |
+
Codev 桌面服务器是一个同进程 HTTP + WebSocket 服务器,基于 **Bun.serve()** 运行,为 Tauri 桌面应用提供全套 API 接口。服务器与 CLI 子进程通过 SDK WebSocket Bridge 通信,桌面 UI 通过客户端 WebSocket 与服务器交互。
|
| 6 |
|
| 7 |
- **入口文件**: `src/server/server.ts`
|
| 8 |
- **运行时**: Bun (JavaScript/TypeScript 运行时)
|
docs/services/compact-deep-dive.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
# 上下文压缩管道 (Compaction Pipeline) 深度分析
|
| 2 |
|
| 3 |
-
> 本文档基于
|
| 4 |
> 以及 `/src/query.ts` 中压缩管道编排逻辑。
|
| 5 |
|
| 6 |
---
|
|
@@ -784,11 +784,11 @@ clearSessionMessagesCache() // 清理消息缓存
|
|
| 784 |
|
| 785 |
---
|
| 786 |
|
| 787 |
-
## 7.
|
| 788 |
|
| 789 |
### 7.1 与官方 Claude Code 的差异
|
| 790 |
|
| 791 |
-
|
| 792 |
|
| 793 |
#### 保留的核心能力
|
| 794 |
|
|
@@ -902,5 +902,5 @@ VersperClaw 的压缩实现相比于 Anthropic 官方 Claude Code 有以下主
|
|
| 902 |
|
| 903 |
---
|
| 904 |
|
| 905 |
-
> 文档版本: 基于
|
| 906 |
> 最后更新: 2026-06-22
|
|
|
|
| 1 |
# 上下文压缩管道 (Compaction Pipeline) 深度分析
|
| 2 |
|
| 3 |
+
> 本文档基于 Codev 源代码分析,涵盖 `/src/services/compact/` 目录下的全部压缩机制,
|
| 4 |
> 以及 `/src/query.ts` 中压缩管道编排逻辑。
|
| 5 |
|
| 6 |
---
|
|
|
|
| 784 |
|
| 785 |
---
|
| 786 |
|
| 787 |
+
## 7. Codev 中的具体实现
|
| 788 |
|
| 789 |
### 7.1 与官方 Claude Code 的差异
|
| 790 |
|
| 791 |
+
Codev 的压缩实现相比于 Anthropic 官方 Claude Code 有以下主要差异和保留:
|
| 792 |
|
| 793 |
#### 保留的核心能力
|
| 794 |
|
|
|
|
| 902 |
|
| 903 |
---
|
| 904 |
|
| 905 |
+
> 文档版本: 基于 Codev `cdb3bdd` 提交分析
|
| 906 |
> 最后更新: 2026-06-22
|
docs/services/feishu.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
|
| 3 |
## 概述
|
| 4 |
|
| 5 |
-
|
| 6 |
|
| 7 |
---
|
| 8 |
|
|
@@ -172,7 +172,7 @@ Feishu WS → NormalizedMessage → PendingQueue → Access Control → Slash Ro
|
|
| 172 |
|
| 173 |
支持一键创建飞书应用,无需手动在开发者后台操作:
|
| 174 |
|
| 175 |
-
1. 调用 `@larksuite/channel` 的 `registerApp({ source: '
|
| 176 |
2. 返回 QR 码 URL,终端用 ASCII 渲染
|
| 177 |
3. 用户使用飞书手机端扫码授权
|
| 178 |
4. `client_id` 和 `client_secret` 自动保存到配置
|
|
|
|
| 2 |
|
| 3 |
## 概述
|
| 4 |
|
| 5 |
+
Codev 内置飞书(国内版)和 Lark(国际版)机器人集成,允许用户在即时通讯中与 AI CLI 进行对话。机器人通过 `@larksuite/channel` SDK 建立长连接 WebSocket,支持私聊、群聊、语音回复、引用回复等功能。
|
| 6 |
|
| 7 |
---
|
| 8 |
|
|
|
|
| 172 |
|
| 173 |
支持一键创建飞书应用,无需手动在开发者后台操作:
|
| 174 |
|
| 175 |
+
1. 调用 `@larksuite/channel` 的 `registerApp({ source: 'codev' })`
|
| 176 |
2. 返回 QR 码 URL,终端用 ASCII 渲染
|
| 177 |
3. 用户使用飞书手机端扫码授权
|
| 178 |
4. `client_id` 和 `client_secret` 自动保存到配置
|
docs/services/overview.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
# 后端服务
|
| 2 |
|
| 3 |
-
|
| 4 |
|
| 5 |
---
|
| 6 |
|
|
|
|
| 1 |
# 后端服务
|
| 2 |
|
| 3 |
+
Codev 提供一系列后台服务,涵盖 MCP 集成、上下文压缩、自主记忆整合、即时通讯集成、OAuth 认证、分析监控及工具执行引擎。
|
| 4 |
|
| 5 |
---
|
| 6 |
|
docs/tools/overview.md
CHANGED
|
@@ -52,7 +52,7 @@ Tool<Input, Output, Progress>
|
|
| 52 |
| `toAutoClassifierInput()` | `''`(跳过分类器) |
|
| 53 |
| `userFacingName()` | `name` |
|
| 54 |
|
| 55 |
-
相关文件:`/home/yuki/Code/Agent/
|
| 56 |
|
| 57 |
---
|
| 58 |
|
|
@@ -87,7 +87,7 @@ getTools(permissionContext) → Tool[]
|
|
| 87 |
|
| 88 |
单纯合并内置工具与 MCP 工具(不去重、不排序),用于工具搜索阈值计算等场景。
|
| 89 |
|
| 90 |
-
相关文件:`/home/yuki/Code/Agent/
|
| 91 |
|
| 92 |
---
|
| 93 |
|
|
@@ -207,10 +207,10 @@ LLM 请求工具调用
|
|
| 207 |
| `HookProgress` | 钩子执行进度 | Hooks |
|
| 208 |
|
| 209 |
相关文件:
|
| 210 |
-
- `/home/yuki/Code/Agent/
|
| 211 |
-
- `/home/yuki/Code/Agent/
|
| 212 |
-
- `/home/yuki/Code/Agent/
|
| 213 |
-
- `/home/yuki/Code/Agent/
|
| 214 |
|
| 215 |
---
|
| 216 |
|
|
@@ -264,10 +264,10 @@ WebSearchTool 支持两个搜索后端:
|
|
| 264 |
- `JINA_API_KEY` — 可选的 Jina AI API 密钥,用于增强型内容提取
|
| 265 |
|
| 266 |
相关文件:
|
| 267 |
-
- `/home/yuki/Code/Agent/
|
| 268 |
-
- `/home/yuki/Code/Agent/
|
| 269 |
-
- `/home/yuki/Code/Agent/
|
| 270 |
-
- `/home/yuki/Code/Agent/
|
| 271 |
|
| 272 |
---
|
| 273 |
|
|
@@ -299,9 +299,9 @@ WebSearchTool 支持两个搜索后端:
|
|
| 299 |
**输入参数:** `action` (必填), `location` (必填), `destination`, `query`, `radius` (默认 5000m), `mode` (driving/walking/transit/bicycling), `waypoints`, `type` (Amap POI 类型过滤), `region` (强制指定), `language`
|
| 300 |
|
| 301 |
相关文件:
|
| 302 |
-
- `/home/yuki/Code/Agent/
|
| 303 |
-
- `/home/yuki/Code/Agent/
|
| 304 |
-
- `/home/yuki/Code/Agent/
|
| 305 |
|
| 306 |
#### API Key 申请指南
|
| 307 |
|
|
|
|
| 52 |
| `toAutoClassifierInput()` | `''`(跳过分类器) |
|
| 53 |
| `userFacingName()` | `name` |
|
| 54 |
|
| 55 |
+
相关文件:`/home/yuki/Code/Agent/Codev/src/Tool.ts`
|
| 56 |
|
| 57 |
---
|
| 58 |
|
|
|
|
| 87 |
|
| 88 |
单纯合并内置工具与 MCP 工具(不去重、不排序),用于工具搜索阈值计算等场景。
|
| 89 |
|
| 90 |
+
相关文件:`/home/yuki/Code/Agent/Codev/src/tools.ts`
|
| 91 |
|
| 92 |
---
|
| 93 |
|
|
|
|
| 207 |
| `HookProgress` | 钩子执行进度 | Hooks |
|
| 208 |
|
| 209 |
相关文件:
|
| 210 |
+
- `/home/yuki/Code/Agent/Codev/src/services/tools/toolExecution.ts` — 执行引擎
|
| 211 |
+
- `/home/yuki/Code/Agent/Codev/src/types/tools.ts` — 进度类型定义
|
| 212 |
+
- `/home/yuki/Code/Agent/Codev/src/hooks/toolPermission/` — 权限钩子
|
| 213 |
+
- `/home/yuki/Code/Agent/Codev/src/utils/permissions/` — 权限工具函数
|
| 214 |
|
| 215 |
---
|
| 216 |
|
|
|
|
| 264 |
- `JINA_API_KEY` — 可选的 Jina AI API 密钥,用于增强型内容提取
|
| 265 |
|
| 266 |
相关文件:
|
| 267 |
+
- `/home/yuki/Code/Agent/Codev/src/Tool.ts` — Tool 类型与 buildTool 框架
|
| 268 |
+
- `/home/yuki/Code/Agent/Codev/src/tools.ts` — 工具注册与过滤
|
| 269 |
+
- `/home/yuki/Code/Agent/Codev/src/services/tools/toolExecution.ts` — 执行引擎
|
| 270 |
+
- `/home/yuki/Code/Agent/Codev/src/services/tools/toolHooks.ts` — 工具钩子
|
| 271 |
|
| 272 |
---
|
| 273 |
|
|
|
|
| 299 |
**输入参数:** `action` (必填), `location` (必填), `destination`, `query`, `radius` (默认 5000m), `mode` (driving/walking/transit/bicycling), `waypoints`, `type` (Amap POI 类型过滤), `region` (强制指定), `language`
|
| 300 |
|
| 301 |
相关文件:
|
| 302 |
+
- `/home/yuki/Code/Agent/Codev/src/tools/LocationTool/LocationTool.ts` — 主工具逻辑
|
| 303 |
+
- `/home/yuki/Code/Agent/Codev/src/tools/LocationTool/prompt.ts` — 提示词
|
| 304 |
+
- `/home/yuki/Code/Agent/Codev/src/tools/LocationTool/UI.tsx` — 渲染组件
|
| 305 |
|
| 306 |
#### API Key 申请指南
|
| 307 |
|
docs/tools/tool-reference.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
# 工具参考大全
|
| 2 |
|
| 3 |
-
> 完整收录
|
| 4 |
|
| 5 |
---
|
| 6 |
|
|
@@ -184,4 +184,4 @@
|
|
| 184 |
|
| 185 |
---
|
| 186 |
|
| 187 |
-
> 注: 本参考基于 `/home/yuki/Code/Agent/
|
|
|
|
| 1 |
# 工具参考大全
|
| 2 |
|
| 3 |
+
> 完整收录 Codev 中所有 AI 可调用的工具(约 60+),按功能分类。
|
| 4 |
|
| 5 |
---
|
| 6 |
|
|
|
|
| 184 |
|
| 185 |
---
|
| 186 |
|
| 187 |
+
> 注: 本参考基于 `/home/yuki/Code/Agent/Codev/src/tools.ts` 的 `getAllBaseTools()` 函数。MCP 工具的完整列表取决于用户配置的 MCP 服务器,未在此表中逐一列出。
|
docs/voice/overview.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
|
| 3 |
## 概述
|
| 4 |
|
| 5 |
-
|
| 6 |
|
| 7 |
> 注意:部分功能受构建特性门控(feature gate)限制,仅在 ant-internal 构建中可用。
|
| 8 |
|
|
|
|
| 2 |
|
| 3 |
## 概述
|
| 4 |
|
| 5 |
+
Codev 的语音系统支持**语音转文字(STT, Speech-to-Text)** 和 **文字转语音(TTS, Text-to-Speech)** 功能。语音录制使用底层音频捕获库(cpal),含有 SoX 和 arecord 回退方案。语音识别支持多个提供商,包括云端 API 和本地模型;语音合成同样支持多个引擎,涵盖 Edge TTS 和 DashScope TTS。
|
| 6 |
|
| 7 |
> 注意:部分功能受构建特性门控(feature gate)限制,仅在 ant-internal 构建中可用。
|
| 8 |
|
install.sh
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
#!/usr/bin/env bash
|
| 2 |
set -euo pipefail
|
| 3 |
|
| 4 |
-
#
|
| 5 |
# Usage: curl -fsSL https://raw.githubusercontent.com/paoloanzn/free-code/main/install.sh | bash
|
| 6 |
|
| 7 |
RED='\033[0;31m'
|
|
@@ -12,8 +12,8 @@ BOLD='\033[1m'
|
|
| 12 |
DIM='\033[2m'
|
| 13 |
RESET='\033[0m'
|
| 14 |
|
| 15 |
-
REPO="https://github.com/
|
| 16 |
-
INSTALL_DIR="$HOME/
|
| 17 |
BUN_MIN_VERSION="1.3.11"
|
| 18 |
|
| 19 |
info() { printf "${CYAN}[*]${RESET} %s\n" "$*"; }
|
|
@@ -125,18 +125,18 @@ install_deps() {
|
|
| 125 |
}
|
| 126 |
|
| 127 |
build_binary() {
|
| 128 |
-
info "Building
|
| 129 |
cd "$INSTALL_DIR"
|
| 130 |
bun run build:dev:full
|
| 131 |
-
ok "Binary built: $INSTALL_DIR/
|
| 132 |
}
|
| 133 |
|
| 134 |
link_binary() {
|
| 135 |
local link_dir="$HOME/.local/bin"
|
| 136 |
mkdir -p "$link_dir"
|
| 137 |
|
| 138 |
-
ln -sf "$INSTALL_DIR/
|
| 139 |
-
ok "Symlinked: $link_dir/
|
| 140 |
|
| 141 |
if ! echo "$PATH" | tr ':' '\n' | grep -qx "$link_dir"; then
|
| 142 |
warn "$link_dir is not on your PATH"
|
|
@@ -169,16 +169,16 @@ echo ""
|
|
| 169 |
printf "${GREEN}${BOLD} Installation complete!${RESET}\n"
|
| 170 |
echo ""
|
| 171 |
printf " ${BOLD}Run it:${RESET}\n"
|
| 172 |
-
printf " ${CYAN}
|
| 173 |
-
printf " ${CYAN}
|
| 174 |
echo ""
|
| 175 |
printf " ${BOLD}Set your API key:${RESET}\n"
|
| 176 |
printf " ${CYAN}export ANTHROPIC_API_KEY=\"sk-ant-...\"${RESET}\n"
|
| 177 |
echo ""
|
| 178 |
printf " ${BOLD}Or log in with Claude.ai:${RESET}\n"
|
| 179 |
-
printf " ${CYAN}
|
| 180 |
echo ""
|
| 181 |
printf " ${DIM}Source: $INSTALL_DIR${RESET}\n"
|
| 182 |
-
printf " ${DIM}Binary: $INSTALL_DIR/
|
| 183 |
-
printf " ${DIM}Link: ~/.local/bin/
|
| 184 |
echo ""
|
|
|
|
| 1 |
#!/usr/bin/env bash
|
| 2 |
set -euo pipefail
|
| 3 |
|
| 4 |
+
# codev installer
|
| 5 |
# Usage: curl -fsSL https://raw.githubusercontent.com/paoloanzn/free-code/main/install.sh | bash
|
| 6 |
|
| 7 |
RED='\033[0;31m'
|
|
|
|
| 12 |
DIM='\033[2m'
|
| 13 |
RESET='\033[0m'
|
| 14 |
|
| 15 |
+
REPO="https://github.com/chenbhao/Codev.git"
|
| 16 |
+
INSTALL_DIR="$HOME/codev"
|
| 17 |
BUN_MIN_VERSION="1.3.11"
|
| 18 |
|
| 19 |
info() { printf "${CYAN}[*]${RESET} %s\n" "$*"; }
|
|
|
|
| 125 |
}
|
| 126 |
|
| 127 |
build_binary() {
|
| 128 |
+
info "Building Codev (all experimental features enabled)..."
|
| 129 |
cd "$INSTALL_DIR"
|
| 130 |
bun run build:dev:full
|
| 131 |
+
ok "Binary built: $INSTALL_DIR/Codev"
|
| 132 |
}
|
| 133 |
|
| 134 |
link_binary() {
|
| 135 |
local link_dir="$HOME/.local/bin"
|
| 136 |
mkdir -p "$link_dir"
|
| 137 |
|
| 138 |
+
ln -sf "$INSTALL_DIR/Codev" "$link_dir/codev"
|
| 139 |
+
ok "Symlinked: $link_dir/codev"
|
| 140 |
|
| 141 |
if ! echo "$PATH" | tr ':' '\n' | grep -qx "$link_dir"; then
|
| 142 |
warn "$link_dir is not on your PATH"
|
|
|
|
| 169 |
printf "${GREEN}${BOLD} Installation complete!${RESET}\n"
|
| 170 |
echo ""
|
| 171 |
printf " ${BOLD}Run it:${RESET}\n"
|
| 172 |
+
printf " ${CYAN}codev${RESET} # interactive REPL\n"
|
| 173 |
+
printf " ${CYAN}codev -p \"your prompt\"${RESET} # one-shot mode\n"
|
| 174 |
echo ""
|
| 175 |
printf " ${BOLD}Set your API key:${RESET}\n"
|
| 176 |
printf " ${CYAN}export ANTHROPIC_API_KEY=\"sk-ant-...\"${RESET}\n"
|
| 177 |
echo ""
|
| 178 |
printf " ${BOLD}Or log in with Claude.ai:${RESET}\n"
|
| 179 |
+
printf " ${CYAN}codev /login${RESET}\n"
|
| 180 |
echo ""
|
| 181 |
printf " ${DIM}Source: $INSTALL_DIR${RESET}\n"
|
| 182 |
+
printf " ${DIM}Binary: $INSTALL_DIR/Codev${RESET}\n"
|
| 183 |
+
printf " ${DIM}Link: ~/.local/bin/codev${RESET}\n"
|
| 184 |
echo ""
|
scripts/build.ts
CHANGED
|
@@ -49,7 +49,7 @@ for (let i = 0; i < args.length; i += 1) {
|
|
| 49 |
}
|
| 50 |
const features = [...featureSet]
|
| 51 |
|
| 52 |
-
const outfile = join('dist', '
|
| 53 |
|
| 54 |
// ── Pre-step: build Friend VRM frontend ──────────────────────────────────
|
| 55 |
function buildFriendFrontend(): boolean {
|
|
@@ -164,7 +164,7 @@ if (!existsSync(vendorDir)) {
|
|
| 164 |
}
|
| 165 |
|
| 166 |
// Create symlink at project root for convenient access
|
| 167 |
-
const symlink = join(process.cwd(), '
|
| 168 |
const symlinkTarget = relative(process.cwd(), outfile)
|
| 169 |
try { unlinkSync(symlink) } catch { /* ignore */ }
|
| 170 |
try { symlinkSync(symlinkTarget, symlink) } catch { /* ignore */ }
|
|
|
|
| 49 |
}
|
| 50 |
const features = [...featureSet]
|
| 51 |
|
| 52 |
+
const outfile = join('dist', 'codev')
|
| 53 |
|
| 54 |
// ── Pre-step: build Friend VRM frontend ──────────────────────────────────
|
| 55 |
function buildFriendFrontend(): boolean {
|
|
|
|
| 164 |
}
|
| 165 |
|
| 166 |
// Create symlink at project root for convenient access
|
| 167 |
+
const symlink = join(process.cwd(), 'codev')
|
| 168 |
const symlinkTarget = relative(process.cwd(), outfile)
|
| 169 |
try { unlinkSync(symlink) } catch { /* ignore */ }
|
| 170 |
try { symlinkSync(symlinkTarget, symlink) } catch { /* ignore */ }
|
scripts/dev.ts
CHANGED
|
@@ -15,7 +15,7 @@ const featureArgs = FULL_EXPERIMENTAL_FEATURES.flatMap(f => ['--feature', f])
|
|
| 15 |
const defineArgs = [
|
| 16 |
'--define', `MACRO.VERSION:${JSON.stringify(version)}`,
|
| 17 |
'--define', `MACRO.BUILD_TIME:${JSON.stringify(buildTime)}`,
|
| 18 |
-
'--define', `MACRO.PACKAGE_URL:${JSON.stringify('
|
| 19 |
'--define', `MACRO.NATIVE_PACKAGE_URL:undefined`,
|
| 20 |
'--define', `MACRO.FEEDBACK_CHANNEL:${JSON.stringify('github')}`,
|
| 21 |
'--define', `MACRO.ISSUES_EXPLAINER:${JSON.stringify('')}`,
|
|
|
|
| 15 |
const defineArgs = [
|
| 16 |
'--define', `MACRO.VERSION:${JSON.stringify(version)}`,
|
| 17 |
'--define', `MACRO.BUILD_TIME:${JSON.stringify(buildTime)}`,
|
| 18 |
+
'--define', `MACRO.PACKAGE_URL:${JSON.stringify('codev-dev')}`,
|
| 19 |
'--define', `MACRO.NATIVE_PACKAGE_URL:undefined`,
|
| 20 |
'--define', `MACRO.FEEDBACK_CHANNEL:${JSON.stringify('github')}`,
|
| 21 |
'--define', `MACRO.ISSUES_EXPLAINER:${JSON.stringify('')}`,
|
src/commands/feishu/feishu.tsx
CHANGED
|
@@ -883,7 +883,7 @@ function ScanningDialog({
|
|
| 883 |
const { registerApp } = await import('@larksuite/channel')
|
| 884 |
|
| 885 |
const result = await registerApp({
|
| 886 |
-
source: '
|
| 887 |
onQRCodeReady: (info) => {
|
| 888 |
if (cancelled) return
|
| 889 |
setQrUrl(info.url)
|
|
|
|
| 883 |
const { registerApp } = await import('@larksuite/channel')
|
| 884 |
|
| 885 |
const result = await registerApp({
|
| 886 |
+
source: 'codev',
|
| 887 |
onQRCodeReady: (info) => {
|
| 888 |
if (cancelled) return
|
| 889 |
setQrUrl(info.url)
|
src/commands/insights.ts
CHANGED
|
@@ -427,7 +427,7 @@ function getSessionMetaDir(): string {
|
|
| 427 |
return join(getDataDir(), 'session-meta')
|
| 428 |
}
|
| 429 |
|
| 430 |
-
const FACET_EXTRACTION_PROMPT = `Analyze this
|
| 431 |
|
| 432 |
CRITICAL GUIDELINES:
|
| 433 |
|
|
@@ -867,7 +867,7 @@ function formatTranscriptForFacets(log: LogOption): string {
|
|
| 867 |
return lines.join('\n')
|
| 868 |
}
|
| 869 |
|
| 870 |
-
const SUMMARIZE_CHUNK_PROMPT = `Summarize this portion of a
|
| 871 |
1. What the user asked for
|
| 872 |
2. What Claude did (tools used, files modified)
|
| 873 |
3. Any friction or issues
|
|
@@ -1336,12 +1336,12 @@ type InsightSection = {
|
|
| 1336 |
const INSIGHT_SECTIONS: InsightSection[] = [
|
| 1337 |
{
|
| 1338 |
name: 'project_areas',
|
| 1339 |
-
prompt: `Analyze this
|
| 1340 |
|
| 1341 |
RESPOND WITH ONLY A VALID JSON OBJECT:
|
| 1342 |
{
|
| 1343 |
"areas": [
|
| 1344 |
-
{"name": "Area name", "session_count": N, "description": "2-3 sentences about what was worked on and how
|
| 1345 |
]
|
| 1346 |
}
|
| 1347 |
|
|
@@ -1350,18 +1350,18 @@ Include 4-5 areas. Skip internal CC operations.`,
|
|
| 1350 |
},
|
| 1351 |
{
|
| 1352 |
name: 'interaction_style',
|
| 1353 |
-
prompt: `Analyze this
|
| 1354 |
|
| 1355 |
RESPOND WITH ONLY A VALID JSON OBJECT:
|
| 1356 |
{
|
| 1357 |
-
"narrative": "2-3 paragraphs analyzing HOW the user interacts with
|
| 1358 |
"key_pattern": "One sentence summary of most distinctive interaction style"
|
| 1359 |
}`,
|
| 1360 |
maxTokens: 8192,
|
| 1361 |
},
|
| 1362 |
{
|
| 1363 |
name: 'what_works',
|
| 1364 |
-
prompt: `Analyze this
|
| 1365 |
|
| 1366 |
RESPOND WITH ONLY A VALID JSON OBJECT:
|
| 1367 |
{
|
|
@@ -1376,7 +1376,7 @@ Include 3 impressive workflows.`,
|
|
| 1376 |
},
|
| 1377 |
{
|
| 1378 |
name: 'friction_analysis',
|
| 1379 |
-
prompt: `Analyze this
|
| 1380 |
|
| 1381 |
RESPOND WITH ONLY A VALID JSON OBJECT:
|
| 1382 |
{
|
|
@@ -1391,7 +1391,7 @@ Include 3 friction categories with 2 examples each.`,
|
|
| 1391 |
},
|
| 1392 |
{
|
| 1393 |
name: 'suggestions',
|
| 1394 |
-
prompt: `Analyze this
|
| 1395 |
|
| 1396 |
## CC FEATURES REFERENCE (pick from these for features_to_try):
|
| 1397 |
1. **MCP Servers**: Connect Claude to external tools, databases, and APIs via Model Context Protocol.
|
|
@@ -1434,7 +1434,7 @@ IMPORTANT for features_to_try: Pick 2-3 from the CC FEATURES REFERENCE above. In
|
|
| 1434 |
},
|
| 1435 |
{
|
| 1436 |
name: 'on_the_horizon',
|
| 1437 |
-
prompt: `Analyze this
|
| 1438 |
|
| 1439 |
RESPOND WITH ONLY A VALID JSON OBJECT:
|
| 1440 |
{
|
|
@@ -1451,7 +1451,7 @@ Include 3 opportunities. Think BIG - autonomous workflows, parallel agents, iter
|
|
| 1451 |
? [
|
| 1452 |
{
|
| 1453 |
name: 'cc_team_improvements',
|
| 1454 |
-
prompt: `Analyze this
|
| 1455 |
|
| 1456 |
RESPOND WITH ONLY A VALID JSON OBJECT:
|
| 1457 |
{
|
|
@@ -1465,7 +1465,7 @@ Include 2-3 improvements based on friction patterns observed.`,
|
|
| 1465 |
},
|
| 1466 |
{
|
| 1467 |
name: 'model_behavior_improvements',
|
| 1468 |
-
prompt: `Analyze this
|
| 1469 |
|
| 1470 |
RESPOND WITH ONLY A VALID JSON OBJECT:
|
| 1471 |
{
|
|
@@ -1481,7 +1481,7 @@ Include 2-3 improvements based on friction patterns observed.`,
|
|
| 1481 |
: []),
|
| 1482 |
{
|
| 1483 |
name: 'fun_ending',
|
| 1484 |
-
prompt: `Analyze this
|
| 1485 |
|
| 1486 |
RESPOND WITH ONLY A VALID JSON OBJECT:
|
| 1487 |
{
|
|
@@ -1735,7 +1735,7 @@ async function generateParallelInsights(
|
|
| 1735 |
.join('\n') || ''
|
| 1736 |
|
| 1737 |
// Now generate "At a Glance" with access to other sections' outputs
|
| 1738 |
-
const atAGlancePrompt = `You're writing an "At a Glance" summary for a
|
| 1739 |
|
| 1740 |
Use this 4-part structure:
|
| 1741 |
|
|
@@ -1743,7 +1743,7 @@ Use this 4-part structure:
|
|
| 1743 |
|
| 1744 |
2. **What's hindering you** - Split into (a) Claude's fault (misunderstandings, wrong approaches, bugs) and (b) user-side friction (not providing enough context, environment issues -- ideally more general than just one project). Be honest but constructive.
|
| 1745 |
|
| 1746 |
-
3. **Quick wins to try** - Specific
|
| 1747 |
|
| 1748 |
4. **Ambitious workflows for better models** - As we move to much more capable models over the next 3-6 months, what should they prepare for? What workflows that seem impossible now will become possible? Draw from the appropriate section below.
|
| 1749 |
|
|
@@ -2006,7 +2006,7 @@ function generateHtmlReport(
|
|
| 2006 |
const interactionStyle = insights.interaction_style
|
| 2007 |
const interactionHtml = interactionStyle?.narrative
|
| 2008 |
? `
|
| 2009 |
-
<h2 id="section-usage">How You Use
|
| 2010 |
<div class="narrative">
|
| 2011 |
${markdownToHtml(interactionStyle.narrative)}
|
| 2012 |
${interactionStyle.key_pattern ? `<div class="key-insight"><strong>Key pattern:</strong> ${escapeHtml(interactionStyle.key_pattern)}</div>` : ''}
|
|
@@ -2070,7 +2070,7 @@ function generateHtmlReport(
|
|
| 2070 |
<h2 id="section-features">Existing CC Features to Try</h2>
|
| 2071 |
<div class="claude-md-section">
|
| 2072 |
<h3>Suggested CLAUDE.md Additions</h3>
|
| 2073 |
-
<p style="font-size: 12px; color: #64748b; margin-bottom: 12px;">Just copy this into
|
| 2074 |
<div class="claude-md-actions">
|
| 2075 |
<button class="copy-all-btn" onclick="copyAllCheckedClaudeMd()">Copy All Checked</button>
|
| 2076 |
</div>
|
|
@@ -2095,7 +2095,7 @@ function generateHtmlReport(
|
|
| 2095 |
${
|
| 2096 |
suggestions.features_to_try && suggestions.features_to_try.length > 0
|
| 2097 |
? `
|
| 2098 |
-
<p style="font-size: 13px; color: #64748b; margin-bottom: 12px;">Just copy this into
|
| 2099 |
<div class="features-section">
|
| 2100 |
${suggestions.features_to_try
|
| 2101 |
.map(
|
|
@@ -2129,8 +2129,8 @@ function generateHtmlReport(
|
|
| 2129 |
${
|
| 2130 |
suggestions.usage_patterns && suggestions.usage_patterns.length > 0
|
| 2131 |
? `
|
| 2132 |
-
<h2 id="section-patterns">New Ways to Use
|
| 2133 |
-
<p style="font-size: 13px; color: #64748b; margin-bottom: 12px;">Just copy this into
|
| 2134 |
<div class="patterns-section">
|
| 2135 |
${suggestions.usage_patterns
|
| 2136 |
.map(
|
|
@@ -2143,7 +2143,7 @@ function generateHtmlReport(
|
|
| 2143 |
pat.copyable_prompt
|
| 2144 |
? `
|
| 2145 |
<div class="copyable-prompt-section">
|
| 2146 |
-
<div class="prompt-label">Paste into
|
| 2147 |
<div class="copyable-prompt-row">
|
| 2148 |
<code class="copyable-prompt">${escapeHtml(pat.copyable_prompt)}</code>
|
| 2149 |
<button class="copy-btn" onclick="copyText(this)">Copy</button>
|
|
@@ -2178,7 +2178,7 @@ function generateHtmlReport(
|
|
| 2178 |
<div class="horizon-title">${escapeHtml(opp.title || '')}</div>
|
| 2179 |
<div class="horizon-possible">${escapeHtml(opp.whats_possible || '')}</div>
|
| 2180 |
${opp.how_to_try ? `<div class="horizon-tip"><strong>Getting started:</strong> ${escapeHtml(opp.how_to_try)}</div>` : ''}
|
| 2181 |
-
${opp.copyable_prompt ? `<div class="pattern-prompt"><div class="prompt-label">Paste into
|
| 2182 |
</div>
|
| 2183 |
`,
|
| 2184 |
)
|
|
@@ -2485,13 +2485,13 @@ function generateHtmlReport(
|
|
| 2485 |
<html>
|
| 2486 |
<head>
|
| 2487 |
<meta charset="utf-8">
|
| 2488 |
-
<title>
|
| 2489 |
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
| 2490 |
<style>${css}</style>
|
| 2491 |
</head>
|
| 2492 |
<body>
|
| 2493 |
<div class="container">
|
| 2494 |
-
<h1>
|
| 2495 |
<p class="subtitle">${data.total_messages.toLocaleString()} messages across ${data.total_sessions} sessions${data.total_sessions_scanned && data.total_sessions_scanned > data.total_sessions ? ` (${data.total_sessions_scanned.toLocaleString()} total)` : ''} | ${data.date_range.start} to ${data.date_range.end}</p>
|
| 2496 |
|
| 2497 |
${atAGlanceHtml}
|
|
@@ -2557,7 +2557,7 @@ function generateHtmlReport(
|
|
| 2557 |
data.multi_clauding.overlap_events === 0
|
| 2558 |
? `
|
| 2559 |
<p style="font-size: 14px; color: #64748b; padding: 8px 0;">
|
| 2560 |
-
No parallel session usage detected. You typically work with one
|
| 2561 |
</p>
|
| 2562 |
`
|
| 2563 |
: `
|
|
@@ -2576,7 +2576,7 @@ function generateHtmlReport(
|
|
| 2576 |
</div>
|
| 2577 |
</div>
|
| 2578 |
<p style="font-size: 13px; color: #475569; margin-top: 12px;">
|
| 2579 |
-
You run multiple
|
| 2580 |
overlap in time, suggesting parallel workflows.
|
| 2581 |
</p>
|
| 2582 |
`
|
|
@@ -3039,7 +3039,7 @@ function safeKeys(obj: Record<string, unknown> | undefined | null): string[] {
|
|
| 3039 |
const usageReport: Command = {
|
| 3040 |
type: 'prompt',
|
| 3041 |
name: 'insights',
|
| 3042 |
-
description: 'Generate a report analyzing your
|
| 3043 |
contentLength: 0, // Dynamic content
|
| 3044 |
progressMessage: 'analyzing your sessions',
|
| 3045 |
source: 'builtin',
|
|
@@ -3141,7 +3141,7 @@ ${atAGlance.quick_wins ? `**Quick wins to try:** ${atAGlance.quick_wins} See _Fe
|
|
| 3141 |
${atAGlance.ambitious_workflows ? `**Ambitious workflows:** ${atAGlance.ambitious_workflows} See _On the Horizon_.` : ''}`
|
| 3142 |
: '_No insights generated_'
|
| 3143 |
|
| 3144 |
-
const header = `#
|
| 3145 |
|
| 3146 |
${stats}
|
| 3147 |
${data.date_range.start} to ${data.date_range.end}
|
|
@@ -3156,7 +3156,7 @@ Your full shareable insights report is ready: ${reportUrl}${uploadHint}`
|
|
| 3156 |
return [
|
| 3157 |
{
|
| 3158 |
type: 'text',
|
| 3159 |
-
text: `The user just ran /insights to generate a usage report analyzing their
|
| 3160 |
|
| 3161 |
Here is the full insights data:
|
| 3162 |
${jsonStringify(insights, null, 2)}
|
|
|
|
| 427 |
return join(getDataDir(), 'session-meta')
|
| 428 |
}
|
| 429 |
|
| 430 |
+
const FACET_EXTRACTION_PROMPT = `Analyze this Codev session and extract structured facets.
|
| 431 |
|
| 432 |
CRITICAL GUIDELINES:
|
| 433 |
|
|
|
|
| 867 |
return lines.join('\n')
|
| 868 |
}
|
| 869 |
|
| 870 |
+
const SUMMARIZE_CHUNK_PROMPT = `Summarize this portion of a Codev session transcript. Focus on:
|
| 871 |
1. What the user asked for
|
| 872 |
2. What Claude did (tools used, files modified)
|
| 873 |
3. Any friction or issues
|
|
|
|
| 1336 |
const INSIGHT_SECTIONS: InsightSection[] = [
|
| 1337 |
{
|
| 1338 |
name: 'project_areas',
|
| 1339 |
+
prompt: `Analyze this Codev usage data and identify project areas.
|
| 1340 |
|
| 1341 |
RESPOND WITH ONLY A VALID JSON OBJECT:
|
| 1342 |
{
|
| 1343 |
"areas": [
|
| 1344 |
+
{"name": "Area name", "session_count": N, "description": "2-3 sentences about what was worked on and how Codev was used."}
|
| 1345 |
]
|
| 1346 |
}
|
| 1347 |
|
|
|
|
| 1350 |
},
|
| 1351 |
{
|
| 1352 |
name: 'interaction_style',
|
| 1353 |
+
prompt: `Analyze this Codev usage data and describe the user's interaction style.
|
| 1354 |
|
| 1355 |
RESPOND WITH ONLY A VALID JSON OBJECT:
|
| 1356 |
{
|
| 1357 |
+
"narrative": "2-3 paragraphs analyzing HOW the user interacts with Codev. Use second person 'you'. Describe patterns: iterate quickly vs detailed upfront specs? Interrupt often or let Claude run? Include specific examples. Use **bold** for key insights.",
|
| 1358 |
"key_pattern": "One sentence summary of most distinctive interaction style"
|
| 1359 |
}`,
|
| 1360 |
maxTokens: 8192,
|
| 1361 |
},
|
| 1362 |
{
|
| 1363 |
name: 'what_works',
|
| 1364 |
+
prompt: `Analyze this Codev usage data and identify what's working well for this user. Use second person ("you").
|
| 1365 |
|
| 1366 |
RESPOND WITH ONLY A VALID JSON OBJECT:
|
| 1367 |
{
|
|
|
|
| 1376 |
},
|
| 1377 |
{
|
| 1378 |
name: 'friction_analysis',
|
| 1379 |
+
prompt: `Analyze this Codev usage data and identify friction points for this user. Use second person ("you").
|
| 1380 |
|
| 1381 |
RESPOND WITH ONLY A VALID JSON OBJECT:
|
| 1382 |
{
|
|
|
|
| 1391 |
},
|
| 1392 |
{
|
| 1393 |
name: 'suggestions',
|
| 1394 |
+
prompt: `Analyze this Codev usage data and suggest improvements.
|
| 1395 |
|
| 1396 |
## CC FEATURES REFERENCE (pick from these for features_to_try):
|
| 1397 |
1. **MCP Servers**: Connect Claude to external tools, databases, and APIs via Model Context Protocol.
|
|
|
|
| 1434 |
},
|
| 1435 |
{
|
| 1436 |
name: 'on_the_horizon',
|
| 1437 |
+
prompt: `Analyze this Codev usage data and identify future opportunities.
|
| 1438 |
|
| 1439 |
RESPOND WITH ONLY A VALID JSON OBJECT:
|
| 1440 |
{
|
|
|
|
| 1451 |
? [
|
| 1452 |
{
|
| 1453 |
name: 'cc_team_improvements',
|
| 1454 |
+
prompt: `Analyze this Codev usage data and suggest product improvements for the CC team.
|
| 1455 |
|
| 1456 |
RESPOND WITH ONLY A VALID JSON OBJECT:
|
| 1457 |
{
|
|
|
|
| 1465 |
},
|
| 1466 |
{
|
| 1467 |
name: 'model_behavior_improvements',
|
| 1468 |
+
prompt: `Analyze this Codev usage data and suggest model behavior improvements.
|
| 1469 |
|
| 1470 |
RESPOND WITH ONLY A VALID JSON OBJECT:
|
| 1471 |
{
|
|
|
|
| 1481 |
: []),
|
| 1482 |
{
|
| 1483 |
name: 'fun_ending',
|
| 1484 |
+
prompt: `Analyze this Codev usage data and find a memorable moment.
|
| 1485 |
|
| 1486 |
RESPOND WITH ONLY A VALID JSON OBJECT:
|
| 1487 |
{
|
|
|
|
| 1735 |
.join('\n') || ''
|
| 1736 |
|
| 1737 |
// Now generate "At a Glance" with access to other sections' outputs
|
| 1738 |
+
const atAGlancePrompt = `You're writing an "At a Glance" summary for a Codev usage insights report for Codev users. The goal is to help them understand their usage and improve how they can use Claude better, especially as models improve.
|
| 1739 |
|
| 1740 |
Use this 4-part structure:
|
| 1741 |
|
|
|
|
| 1743 |
|
| 1744 |
2. **What's hindering you** - Split into (a) Claude's fault (misunderstandings, wrong approaches, bugs) and (b) user-side friction (not providing enough context, environment issues -- ideally more general than just one project). Be honest but constructive.
|
| 1745 |
|
| 1746 |
+
3. **Quick wins to try** - Specific Codev features they could try from the examples below, or a workflow technique if you think it's really compelling. (Avoid stuff like "Ask Claude to confirm before taking actions" or "Type out more context up front" which are less compelling.)
|
| 1747 |
|
| 1748 |
4. **Ambitious workflows for better models** - As we move to much more capable models over the next 3-6 months, what should they prepare for? What workflows that seem impossible now will become possible? Draw from the appropriate section below.
|
| 1749 |
|
|
|
|
| 2006 |
const interactionStyle = insights.interaction_style
|
| 2007 |
const interactionHtml = interactionStyle?.narrative
|
| 2008 |
? `
|
| 2009 |
+
<h2 id="section-usage">How You Use Codev</h2>
|
| 2010 |
<div class="narrative">
|
| 2011 |
${markdownToHtml(interactionStyle.narrative)}
|
| 2012 |
${interactionStyle.key_pattern ? `<div class="key-insight"><strong>Key pattern:</strong> ${escapeHtml(interactionStyle.key_pattern)}</div>` : ''}
|
|
|
|
| 2070 |
<h2 id="section-features">Existing CC Features to Try</h2>
|
| 2071 |
<div class="claude-md-section">
|
| 2072 |
<h3>Suggested CLAUDE.md Additions</h3>
|
| 2073 |
+
<p style="font-size: 12px; color: #64748b; margin-bottom: 12px;">Just copy this into Codev to add it to your CLAUDE.md.</p>
|
| 2074 |
<div class="claude-md-actions">
|
| 2075 |
<button class="copy-all-btn" onclick="copyAllCheckedClaudeMd()">Copy All Checked</button>
|
| 2076 |
</div>
|
|
|
|
| 2095 |
${
|
| 2096 |
suggestions.features_to_try && suggestions.features_to_try.length > 0
|
| 2097 |
? `
|
| 2098 |
+
<p style="font-size: 13px; color: #64748b; margin-bottom: 12px;">Just copy this into Codev and it'll set it up for you.</p>
|
| 2099 |
<div class="features-section">
|
| 2100 |
${suggestions.features_to_try
|
| 2101 |
.map(
|
|
|
|
| 2129 |
${
|
| 2130 |
suggestions.usage_patterns && suggestions.usage_patterns.length > 0
|
| 2131 |
? `
|
| 2132 |
+
<h2 id="section-patterns">New Ways to Use Codev</h2>
|
| 2133 |
+
<p style="font-size: 13px; color: #64748b; margin-bottom: 12px;">Just copy this into Codev and it'll walk you through it.</p>
|
| 2134 |
<div class="patterns-section">
|
| 2135 |
${suggestions.usage_patterns
|
| 2136 |
.map(
|
|
|
|
| 2143 |
pat.copyable_prompt
|
| 2144 |
? `
|
| 2145 |
<div class="copyable-prompt-section">
|
| 2146 |
+
<div class="prompt-label">Paste into Codev:</div>
|
| 2147 |
<div class="copyable-prompt-row">
|
| 2148 |
<code class="copyable-prompt">${escapeHtml(pat.copyable_prompt)}</code>
|
| 2149 |
<button class="copy-btn" onclick="copyText(this)">Copy</button>
|
|
|
|
| 2178 |
<div class="horizon-title">${escapeHtml(opp.title || '')}</div>
|
| 2179 |
<div class="horizon-possible">${escapeHtml(opp.whats_possible || '')}</div>
|
| 2180 |
${opp.how_to_try ? `<div class="horizon-tip"><strong>Getting started:</strong> ${escapeHtml(opp.how_to_try)}</div>` : ''}
|
| 2181 |
+
${opp.copyable_prompt ? `<div class="pattern-prompt"><div class="prompt-label">Paste into Codev:</div><code>${escapeHtml(opp.copyable_prompt)}</code><button class="copy-btn" onclick="copyText(this)">Copy</button></div>` : ''}
|
| 2182 |
</div>
|
| 2183 |
`,
|
| 2184 |
)
|
|
|
|
| 2485 |
<html>
|
| 2486 |
<head>
|
| 2487 |
<meta charset="utf-8">
|
| 2488 |
+
<title>Codev Insights</title>
|
| 2489 |
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
| 2490 |
<style>${css}</style>
|
| 2491 |
</head>
|
| 2492 |
<body>
|
| 2493 |
<div class="container">
|
| 2494 |
+
<h1>Codev Insights</h1>
|
| 2495 |
<p class="subtitle">${data.total_messages.toLocaleString()} messages across ${data.total_sessions} sessions${data.total_sessions_scanned && data.total_sessions_scanned > data.total_sessions ? ` (${data.total_sessions_scanned.toLocaleString()} total)` : ''} | ${data.date_range.start} to ${data.date_range.end}</p>
|
| 2496 |
|
| 2497 |
${atAGlanceHtml}
|
|
|
|
| 2557 |
data.multi_clauding.overlap_events === 0
|
| 2558 |
? `
|
| 2559 |
<p style="font-size: 14px; color: #64748b; padding: 8px 0;">
|
| 2560 |
+
No parallel session usage detected. You typically work with one Codev session at a time.
|
| 2561 |
</p>
|
| 2562 |
`
|
| 2563 |
: `
|
|
|
|
| 2576 |
</div>
|
| 2577 |
</div>
|
| 2578 |
<p style="font-size: 13px; color: #475569; margin-top: 12px;">
|
| 2579 |
+
You run multiple Codev sessions simultaneously. Multi-clauding is detected when sessions
|
| 2580 |
overlap in time, suggesting parallel workflows.
|
| 2581 |
</p>
|
| 2582 |
`
|
|
|
|
| 3039 |
const usageReport: Command = {
|
| 3040 |
type: 'prompt',
|
| 3041 |
name: 'insights',
|
| 3042 |
+
description: 'Generate a report analyzing your Codev sessions',
|
| 3043 |
contentLength: 0, // Dynamic content
|
| 3044 |
progressMessage: 'analyzing your sessions',
|
| 3045 |
source: 'builtin',
|
|
|
|
| 3141 |
${atAGlance.ambitious_workflows ? `**Ambitious workflows:** ${atAGlance.ambitious_workflows} See _On the Horizon_.` : ''}`
|
| 3142 |
: '_No insights generated_'
|
| 3143 |
|
| 3144 |
+
const header = `# Codev Insights
|
| 3145 |
|
| 3146 |
${stats}
|
| 3147 |
${data.date_range.start} to ${data.date_range.end}
|
|
|
|
| 3156 |
return [
|
| 3157 |
{
|
| 3158 |
type: 'text',
|
| 3159 |
+
text: `The user just ran /insights to generate a usage report analyzing their Codev sessions.
|
| 3160 |
|
| 3161 |
Here is the full insights data:
|
| 3162 |
${jsonStringify(insights, null, 2)}
|
src/commands/telegram/telegram.tsx
CHANGED
|
@@ -369,7 +369,7 @@ function TelegramDialog({
|
|
| 369 |
<Dialog title="Telegram" onCancel={() => onDone(undefined, { display: 'skip' })}>
|
| 370 |
<Box flexDirection="column" gap={1}>
|
| 371 |
<Text dimColor>
|
| 372 |
-
在当前
|
| 373 |
</Text>
|
| 374 |
<Text>
|
| 375 |
状态:
|
|
|
|
| 369 |
<Dialog title="Telegram" onCancel={() => onDone(undefined, { display: 'skip' })}>
|
| 370 |
<Box flexDirection="column" gap={1}>
|
| 371 |
<Text dimColor>
|
| 372 |
+
在当前 Codev 进程内启动 Telegram 长轮询,并把私聊消息接入当前会话。
|
| 373 |
</Text>
|
| 374 |
<Text>
|
| 375 |
状态:
|
src/components/AutoModeOptInDialog.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import { Select } from './CustomSelect/index.js';
|
|
| 7 |
import { Dialog } from './design-system/Dialog.js';
|
| 8 |
|
| 9 |
// NOTE: This copy is legally reviewed — do not modify without Legal team approval.
|
| 10 |
-
export const AUTO_MODE_DESCRIPTION = "Auto mode lets
|
| 11 |
type Props = {
|
| 12 |
onAccept(): void;
|
| 13 |
onDecline(): void;
|
|
@@ -70,7 +70,7 @@ export function AutoModeOptInDialog(t0) {
|
|
| 70 |
const onChange = t2;
|
| 71 |
let t3;
|
| 72 |
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
| 73 |
-
t3 = <Box flexDirection="column" gap={1}><Text>{AUTO_MODE_DESCRIPTION}</Text><Link url="https://github.com/
|
| 74 |
$[4] = t3;
|
| 75 |
} else {
|
| 76 |
t3 = $[4];
|
|
|
|
| 7 |
import { Dialog } from './design-system/Dialog.js';
|
| 8 |
|
| 9 |
// NOTE: This copy is legally reviewed — do not modify without Legal team approval.
|
| 10 |
+
export const AUTO_MODE_DESCRIPTION = "Auto mode lets Codev handle permission prompts automatically — Codev checks each tool call for risky actions and prompt injection before executing. Actions Codev identifies as safe are executed, while actions Claude identifies as risky are blocked and Claude may try a different approach. Ideal for long-running tasks. Sessions are slightly more expensive. Codev can make mistakes that allow harmful commands to run, it's recommended to only use in isolated environments. Shift+Tab to change mode.";
|
| 11 |
type Props = {
|
| 12 |
onAccept(): void;
|
| 13 |
onDecline(): void;
|
|
|
|
| 70 |
const onChange = t2;
|
| 71 |
let t3;
|
| 72 |
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
| 73 |
+
t3 = <Box flexDirection="column" gap={1}><Text>{AUTO_MODE_DESCRIPTION}</Text><Link url="https://github.com/chenbhao/Codev" /></Box>;
|
| 74 |
$[4] = t3;
|
| 75 |
} else {
|
| 76 |
t3 = $[4];
|
src/components/FeedbackSurvey/FeedbackSurveyView.tsx
CHANGED
|
@@ -18,7 +18,7 @@ const inputToResponse: Record<ResponseInput, FeedbackSurveyResponse> = {
|
|
| 18 |
'3': 'good'
|
| 19 |
} as const;
|
| 20 |
export const isValidResponseInput = (input: string): input is ResponseInput => (RESPONSE_INPUTS as readonly string[]).includes(input);
|
| 21 |
-
const DEFAULT_MESSAGE = 'How is
|
| 22 |
export function FeedbackSurveyView(t0) {
|
| 23 |
const $ = _c(15);
|
| 24 |
const {
|
|
|
|
| 18 |
'3': 'good'
|
| 19 |
} as const;
|
| 20 |
export const isValidResponseInput = (input: string): input is ResponseInput => (RESPONSE_INPUTS as readonly string[]).includes(input);
|
| 21 |
+
const DEFAULT_MESSAGE = 'How is Codev doing this session? (optional)';
|
| 22 |
export function FeedbackSurveyView(t0) {
|
| 23 |
const $ = _c(15);
|
| 24 |
const {
|
src/components/HelpV2/General.tsx
CHANGED
|
@@ -6,7 +6,7 @@ export function General() {
|
|
| 6 |
const $ = _c(2);
|
| 7 |
let t0;
|
| 8 |
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
| 9 |
-
t0 = <Box><Text>
|
| 10 |
$[0] = t0;
|
| 11 |
} else {
|
| 12 |
t0 = $[0];
|
|
|
|
| 6 |
const $ = _c(2);
|
| 7 |
let t0;
|
| 8 |
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
| 9 |
+
t0 = <Box><Text>Codev understands your codebase, makes edits with your permission, and executes commands — right from your terminal.</Text></Box>;
|
| 10 |
$[0] = t0;
|
| 11 |
} else {
|
| 12 |
t0 = $[0];
|
src/components/HelpV2/HelpV2.tsx
CHANGED
|
@@ -138,7 +138,7 @@ export function HelpV2(t0) {
|
|
| 138 |
const t5 = insideModal ? undefined : maxHeight;
|
| 139 |
let t6;
|
| 140 |
if ($[31] !== tabs) {
|
| 141 |
-
t6 = <Tabs title={false ? "/help" : `
|
| 142 |
$[31] = tabs;
|
| 143 |
$[32] = t6;
|
| 144 |
} else {
|
|
@@ -146,7 +146,7 @@ export function HelpV2(t0) {
|
|
| 146 |
}
|
| 147 |
let t7;
|
| 148 |
if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
|
| 149 |
-
t7 = <Box marginTop={1}><Text>For more help:{" "}<Link url="https://github.com/
|
| 150 |
$[33] = t7;
|
| 151 |
} else {
|
| 152 |
t7 = $[33];
|
|
|
|
| 138 |
const t5 = insideModal ? undefined : maxHeight;
|
| 139 |
let t6;
|
| 140 |
if ($[31] !== tabs) {
|
| 141 |
+
t6 = <Tabs title={false ? "/help" : `Codev v${MACRO.VERSION}`} color="professionalBlue" defaultTab="general">{tabs}</Tabs>;
|
| 142 |
$[31] = tabs;
|
| 143 |
$[32] = t6;
|
| 144 |
} else {
|
|
|
|
| 146 |
}
|
| 147 |
let t7;
|
| 148 |
if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
|
| 149 |
+
t7 = <Box marginTop={1}><Text>For more help:{" "}<Link url="https://github.com/chenbhao/Codev" /></Text></Box>;
|
| 150 |
$[33] = t7;
|
| 151 |
} else {
|
| 152 |
t7 = $[33];
|
src/components/LogoV2/CondensedLogo.tsx
CHANGED
|
@@ -58,7 +58,7 @@ export function CondensedLogo(): ReactNode {
|
|
| 58 |
const textWidth = Math.max(columns - 15, 20)
|
| 59 |
|
| 60 |
// Truncate version to fit within available width, accounting for "Claude Code v" prefix
|
| 61 |
-
const versionPrefix = '
|
| 62 |
const truncatedVersion = truncate(
|
| 63 |
version,
|
| 64 |
Math.max(textWidth - versionPrefix.length, 6),
|
|
@@ -92,7 +92,7 @@ export function CondensedLogo(): ReactNode {
|
|
| 92 |
{/* Info */}
|
| 93 |
<Box flexDirection="column">
|
| 94 |
<Text>
|
| 95 |
-
<Text bold color="clawd_body">
|
| 96 |
<Text dimColor>v{truncatedVersion}</Text>
|
| 97 |
</Text>
|
| 98 |
{shouldSplit ? (
|
|
|
|
| 58 |
const textWidth = Math.max(columns - 15, 20)
|
| 59 |
|
| 60 |
// Truncate version to fit within available width, accounting for "Claude Code v" prefix
|
| 61 |
+
const versionPrefix = 'Codev v'
|
| 62 |
const truncatedVersion = truncate(
|
| 63 |
version,
|
| 64 |
Math.max(textWidth - versionPrefix.length, 6),
|
|
|
|
| 92 |
{/* Info */}
|
| 93 |
<Box flexDirection="column">
|
| 94 |
<Text>
|
| 95 |
+
<Text bold color="clawd_body">Codev</Text>{' '}
|
| 96 |
<Text dimColor>v{truncatedVersion}</Text>
|
| 97 |
</Text>
|
| 98 |
{shouldSplit ? (
|
src/components/LogoV2/GuestPassesUpsell.tsx
CHANGED
|
@@ -66,7 +66,7 @@ export function GuestPassesUpsell(): React.ReactNode {
|
|
| 66 |
<Text color="clawd_body">[✻]</Text> <Text color="clawd_body">[✻]</Text>{' '}
|
| 67 |
<Text color="clawd_body">[✻]</Text> ·{' '}
|
| 68 |
{reward
|
| 69 |
-
? `Share
|
| 70 |
: '3 guest passes at /passes'}
|
| 71 |
</Text>
|
| 72 |
)
|
|
|
|
| 66 |
<Text color="clawd_body">[✻]</Text> <Text color="clawd_body">[✻]</Text>{' '}
|
| 67 |
<Text color="clawd_body">[✻]</Text> ·{' '}
|
| 68 |
{reward
|
| 69 |
+
? `Share Codev and earn ${formatCreditAmount(reward)} of extra usage · /passes`
|
| 70 |
: '3 guest passes at /passes'}
|
| 71 |
</Text>
|
| 72 |
)
|
src/components/LogoV2/LogoV2.tsx
CHANGED
|
@@ -250,8 +250,8 @@ export function LogoV2(): React.ReactNode {
|
|
| 250 |
const layoutMode = getLayoutMode(columns)
|
| 251 |
|
| 252 |
const userTheme = resolveThemeSetting(getGlobalConfig().theme)
|
| 253 |
-
const borderTitle = ` ${color('clawd_body', userTheme)('
|
| 254 |
-
const compactBorderTitle = color('clawd_body', userTheme)('
|
| 255 |
|
| 256 |
// Early return for compact mode
|
| 257 |
if (layoutMode === 'compact') {
|
|
|
|
| 250 |
const layoutMode = getLayoutMode(columns)
|
| 251 |
|
| 252 |
const userTheme = resolveThemeSetting(getGlobalConfig().theme)
|
| 253 |
+
const borderTitle = ` ${color('clawd_body', userTheme)('Codev')} ${color('inactive', userTheme)(`v${version}`)} `
|
| 254 |
+
const compactBorderTitle = color('clawd_body', userTheme)(' Codev ')
|
| 255 |
|
| 256 |
// Early return for compact mode
|
| 257 |
if (layoutMode === 'compact') {
|
src/components/LogoV2/WelcomeV2.tsx
CHANGED
|
@@ -6,7 +6,7 @@ const WELCOME_V2_WIDTH = 58
|
|
| 6 |
|
| 7 |
export function WelcomeV2(): React.ReactNode {
|
| 8 |
const [theme] = useTheme()
|
| 9 |
-
const welcomeMessage = 'Welcome to
|
| 10 |
|
| 11 |
if (env.terminal === 'Apple_Terminal') {
|
| 12 |
return (
|
|
|
|
| 6 |
|
| 7 |
export function WelcomeV2(): React.ReactNode {
|
| 8 |
const [theme] = useTheme()
|
| 9 |
+
const welcomeMessage = 'Welcome to Codev'
|
| 10 |
|
| 11 |
if (env.terminal === 'Apple_Terminal') {
|
| 12 |
return (
|
src/components/LogoV2/feedConfigs.tsx
CHANGED
|
@@ -39,7 +39,7 @@ export function createWhatsNewFeed(releaseNotes: string[]): FeedConfig {
|
|
| 39 |
text: note
|
| 40 |
};
|
| 41 |
});
|
| 42 |
-
const emptyMessage = "external" === 'ant' ? 'Unable to fetch latest claude-cli-internal commits' : 'Check the
|
| 43 |
return {
|
| 44 |
title: "external" === 'ant' ? "What's new [ANT-ONLY: Latest CC commits]" : "What's new",
|
| 45 |
lines,
|
|
@@ -73,7 +73,7 @@ export function createProjectOnboardingFeed(steps: Step[]): FeedConfig {
|
|
| 73 |
}
|
| 74 |
export function createGuestPassesFeed(): FeedConfig {
|
| 75 |
const reward = getCachedReferrerReward();
|
| 76 |
-
const subtitle = reward ? `Share
|
| 77 |
return {
|
| 78 |
title: '3 guest passes',
|
| 79 |
lines: [],
|
|
|
|
| 39 |
text: note
|
| 40 |
};
|
| 41 |
});
|
| 42 |
+
const emptyMessage = "external" === 'ant' ? 'Unable to fetch latest claude-cli-internal commits' : 'Check the Codev changelog for updates';
|
| 43 |
return {
|
| 44 |
title: "external" === 'ant' ? "What's new [ANT-ONLY: Latest CC commits]" : "What's new",
|
| 45 |
lines,
|
|
|
|
| 73 |
}
|
| 74 |
export function createGuestPassesFeed(): FeedConfig {
|
| 75 |
const reward = getCachedReferrerReward();
|
| 76 |
+
const subtitle = reward ? `Share Codev and earn ${formatCreditAmount(reward)} of extra usage` : 'Share Codev with friends';
|
| 77 |
return {
|
| 78 |
title: '3 guest passes',
|
| 79 |
lines: [],
|
src/components/Onboarding.tsx
CHANGED
|
@@ -72,9 +72,9 @@ export function Onboarding({
|
|
| 72 |
*/}
|
| 73 |
<OrderedList>
|
| 74 |
<OrderedList.Item>
|
| 75 |
-
<Text>
|
| 76 |
<Text dimColor wrap="wrap">
|
| 77 |
-
You should always review
|
| 78 |
<Newline />
|
| 79 |
running code.
|
| 80 |
<Newline />
|
|
@@ -87,7 +87,7 @@ export function Onboarding({
|
|
| 87 |
<Text dimColor wrap="wrap">
|
| 88 |
For more details see:
|
| 89 |
<Newline />
|
| 90 |
-
<Link url="https://github.com/
|
| 91 |
</Text>
|
| 92 |
</OrderedList.Item>
|
| 93 |
</OrderedList>
|
|
|
|
| 72 |
*/}
|
| 73 |
<OrderedList>
|
| 74 |
<OrderedList.Item>
|
| 75 |
+
<Text>Codev can make mistakes</Text>
|
| 76 |
<Text dimColor wrap="wrap">
|
| 77 |
+
You should always review Codev's responses, especially when
|
| 78 |
<Newline />
|
| 79 |
running code.
|
| 80 |
<Newline />
|
|
|
|
| 87 |
<Text dimColor wrap="wrap">
|
| 88 |
For more details see:
|
| 89 |
<Newline />
|
| 90 |
+
<Link url="https://github.com/chenbhao/Codev" />
|
| 91 |
</Text>
|
| 92 |
</OrderedList.Item>
|
| 93 |
</OrderedList>
|
src/components/friend/frontend/api.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import type { VRMSceneHandle } from './components/VRMScene'
|
| 2 |
|
| 3 |
-
/**
|
| 4 |
export const SERVER_URL = 'http://127.0.0.1:3456'
|
| 5 |
|
| 6 |
/** Base path for the Friend VRM plugin API */
|
|
|
|
| 1 |
import type { VRMSceneHandle } from './components/VRMScene'
|
| 2 |
|
| 3 |
+
/** Codev server base URL */
|
| 4 |
export const SERVER_URL = 'http://127.0.0.1:3456'
|
| 5 |
|
| 6 |
/** Base path for the Friend VRM plugin API */
|
src/components/friend/frontend/src-tauri/Cargo.lock
CHANGED
|
@@ -4022,7 +4022,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
| 4022 |
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
| 4023 |
|
| 4024 |
[[package]]
|
| 4025 |
-
name = "
|
| 4026 |
version = "0.1.0"
|
| 4027 |
dependencies = [
|
| 4028 |
"serde",
|
|
|
|
| 4022 |
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
| 4023 |
|
| 4024 |
[[package]]
|
| 4025 |
+
name = "codev-friend"
|
| 4026 |
version = "0.1.0"
|
| 4027 |
dependencies = [
|
| 4028 |
"serde",
|
src/components/friend/frontend/src-tauri/Cargo.toml
CHANGED
|
@@ -1,12 +1,12 @@
|
|
| 1 |
[package]
|
| 2 |
-
name = "
|
| 3 |
version = "0.1.0"
|
| 4 |
-
description = "
|
| 5 |
-
authors = ["
|
| 6 |
edition = "2021"
|
| 7 |
|
| 8 |
[lib]
|
| 9 |
-
name = "
|
| 10 |
crate-type = ["lib", "cdylib", "staticlib"]
|
| 11 |
|
| 12 |
[build-dependencies]
|
|
|
|
| 1 |
[package]
|
| 2 |
+
name = "codev-friend"
|
| 3 |
version = "0.1.0"
|
| 4 |
+
description = "Codev VRM desktop pet"
|
| 5 |
+
authors = ["Codev"]
|
| 6 |
edition = "2021"
|
| 7 |
|
| 8 |
[lib]
|
| 9 |
+
name = "codev_friend_lib"
|
| 10 |
crate-type = ["lib", "cdylib", "staticlib"]
|
| 11 |
|
| 12 |
[build-dependencies]
|
src/components/friend/frontend/src-tauri/capabilities/default.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"identifier": "default",
|
| 3 |
-
"description": "Default capabilities for
|
| 4 |
"windows": ["main"],
|
| 5 |
"permissions": [
|
| 6 |
"core:default",
|
|
|
|
| 1 |
{
|
| 2 |
"identifier": "default",
|
| 3 |
+
"description": "Default capabilities for Codev Friend",
|
| 4 |
"windows": ["main"],
|
| 5 |
"permissions": [
|
| 6 |
"core:default",
|
src/components/friend/frontend/src-tauri/src/main.rs
CHANGED
|
@@ -2,5 +2,5 @@
|
|
| 2 |
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
| 3 |
|
| 4 |
fn main() {
|
| 5 |
-
|
| 6 |
}
|
|
|
|
| 2 |
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
| 3 |
|
| 4 |
fn main() {
|
| 5 |
+
codev_friend_lib::run()
|
| 6 |
}
|