Skip to content

Commit 83caa91

Browse files
committed
Merge branch 'master' into opensource
2 parents 981a357 + c73e0d6 commit 83caa91

504 files changed

Lines changed: 79380 additions & 5761 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ packages/*/src/**/*.js
3838
packages/*/src/**/*.d.ts
3939
packages/*/src/**/*.js.map
4040

41+
# TypeScript编译产物(包根目录下的配置文件编译产物)
42+
packages/*/vitest.setup.js
43+
packages/*/vitest.setup.d.ts
44+
packages/*/vitest.setup.js.map
45+
packages/*/vitest.config.js
46+
packages/*/vitest.config.d.ts
47+
packages/*/vitest.config.js.map
48+
packages/*/webview/vitest.config.js
49+
4150
# 构建缓存文件
4251
.build-cache.json
4352
**/.build-cache.json
@@ -71,3 +80,7 @@ remote-client/build
7180
*.tgz
7281

7382
packages/cli/clipboard/
83+
84+
# Debug exports (local diagnostics)
85+
debug_export_*.md
86+
probe-output.jsonl

.llm-wiki/index.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# LLM Wiki Index
2+
3+
> Auto-maintained by DeepV Code. Do not edit manually.
4+
5+
## Sources
6+
7+
| # | File | Summary Page | Description | Generated |
8+
|---|------|-------------|-------------|-----------|
9+
| 01 | [raw/01-architecture.md](raw/01-architecture.md) | [source-01-architecture](wiki/source-01-architecture.md) | Project architecture, monorepo structure, dependencies, design patterns | 2026-04-09 |
10+
| 02 | [raw/02-core-module.md](raw/02-core-module.md) | [source-02-core-module](wiki/source-02-core-module.md) | Core module directory layout, key classes, exports | 2026-04-09 |
11+
| 03 | [raw/03-cli-module.md](raw/03-cli-module.md) | [source-03-cli-module](wiki/source-03-cli-module.md) | CLI module structure, entry point, components, two modes | 2026-04-09 |
12+
| 04 | [raw/04-tools-system.md](raw/04-tools-system.md) | [source-04-tools-system](wiki/source-04-tools-system.md) | Complete tool list (27 built-in), tool patterns, execution state machine | 2026-04-09 |
13+
| 05 | [raw/05-hooks-system.md](raw/05-hooks-system.md) | [source-05-hooks-system](wiki/source-05-hooks-system.md) | Hooks 5-layer architecture, 11 event types, configuration, I/O protocol | 2026-04-09 |
14+
| 06 | [raw/06-build-and-scripts.md](raw/06-build-and-scripts.md) | [source-06-build-system](wiki/source-06-build-system.md) | Build pipelines, esbuild config, CI/CD, npm publishing, TypeScript/ESLint config | 2026-04-09 |
15+
| 07 | [raw/07-mcp-system.md](raw/07-mcp-system.md) | [source-07-mcp-system](wiki/source-07-mcp-system.md) | MCP architecture, transport types, OAuth, two-phase loading, status display | 2026-04-09 |
16+
17+
## Entities
18+
19+
### Modules / Systems
20+
21+
| Page | Type | Description |
22+
|------|------|-------------|
23+
| [workflow-system](wiki/workflow-system.md) | entity | Dynamic Workflow — JS orchestration, multi-agent, token budget backlog |
24+
| [core-module](wiki/core-module.md) | entity | Backend engine — API, tools, sessions, auth |
25+
| [cli-module](wiki/cli-module.md) | entity | Terminal frontend — Ink/React UI, slash commands |
26+
| [tools-system](wiki/tools-system.md) | entity | Extensible tool framework — 31 built-in tools |
27+
| [hooks-system](wiki/hooks-system.md) | entity | 5-layer lifecycle hook pipeline — 11 event types |
28+
| [mcp-system](wiki/mcp-system.md) | entity | MCP protocol integration — external tool discovery |
29+
| [build-system](wiki/build-system.md) | entity | Two-pipeline build: tsc + esbuild |
30+
| [skills-system](wiki/skills-system.md) | entity | Pluggable skill modules / marketplace |
31+
| [background-tasks](wiki/background-tasks.md) | entity | Background Task system - process control & execution |
32+
| [feishu-integration](wiki/feishu-integration.md) | entity | Feishu / Lark Bot Integration - WebSocket long-polling gateway |
33+
34+
### Classes / Components
35+
36+
| Page | Type | Pattern | Location |
37+
|------|------|---------|----------|
38+
| [GeminiClient](wiki/GeminiClient.md) | entity | Facade | `core/src/core/client.ts` |
39+
| [ContentGenerator](wiki/ContentGenerator.md) | entity | Strategy/Adapter | `core/src/core/contentGenerator.ts` |
40+
| [DeepVServerAdapter](wiki/DeepVServerAdapter.md) | entity | Adapter | `core/src/core/` |
41+
| [SceneManager](wiki/SceneManager.md) | entity | Strategy | `core/src/core/sceneManager.ts` |
42+
| [Turn](wiki/Turn.md) | entity | State Machine | `core/src/core/turn.ts` |
43+
| [SubAgent](wiki/SubAgent.md) | entity | Agent | `core/src/core/subAgent.ts` |
44+
| [ToolRegistry](wiki/ToolRegistry.md) | entity | Registry | `core/src/tools/tool-registry.ts` |
45+
| [BaseTool](wiki/BaseTool.md) | entity | Abstract Base | `core/src/tools/tools.ts` |
46+
| [ToolExecutionEngine](wiki/ToolExecutionEngine.md) | entity | State Machine | `core/src/core/toolExecutionEngine.ts` |
47+
| [DiscoveredMCPTool](wiki/DiscoveredMCPTool.md) | entity | Adapter | `core/src/tools/mcp-tool.ts` |
48+
| [mcp-client](wiki/mcp-client.md) | entity | Module | `core/src/tools/mcp-client.ts` |
49+
| [HookSystem](wiki/HookSystem.md) | entity | Coordinator | `core/src/hooks/hookSystem.ts` |
50+
| [HookRegistry](wiki/HookRegistry.md) | entity | Registry | `core/src/hooks/hookRegistry.ts` |
51+
| [ProxyAuthManager](wiki/ProxyAuthManager.md) | entity | Singleton | `core/src/auth/` |
52+
| [SessionManager](wiki/SessionManager.md) | entity | Repository | `core/src/services/sessionManager.ts` |
53+
| [SkillLoader](wiki/SkillLoader.md) | entity | Plugin | `core/src/skills/skill-loader.ts` |
54+
| [MarketplaceManager](wiki/MarketplaceManager.md) | entity | Plugin | `core/src/skills/marketplace-manager.ts` |
55+
| [lark-cli-tool](wiki/lark-cli-tool.md) | entity | Tool | `core/src/tools/lark-cli.ts` |
56+
| [audio-reader](packages/core/src/tools/audio-reader.ts) | entity | Tool | `core/src/tools/audio-reader.ts` |
57+
58+
## Overview
59+
60+
| Page | Description |
61+
|------|-------------|
62+
| [overview](wiki/overview.md) | Project-level overview from README.md and package.json |
63+
64+
## Features & Enhancements
65+
66+
| Page | Description |
67+
|------|-------------|
68+
| [debate-i18n-enhancement](wiki/debate-i18n-enhancement.md) | Debate mode i18n & language selection — multilingual UI and prompts |
69+
| [goal-driven-mode](wiki/goal-driven-mode.md) | Goal-Driven state machine, watchdog control, contract boundaries, and goal_achieved triggers |
70+
| [context-compression](wiki/context-compression.md) | Token-aware MicroCompactService, post-compact restoration, and prefill crash guards |
71+
| [adaptive-thinking](wiki/adaptive-thinking.md) | Adaptive thinking effort mappings (Claude/OpenAI/Gemini), UI brain outlines, and sanitization |
72+
73+
## Guides & Checklists
74+
75+
| Page | Description |
76+
|------|-------------|
77+
| [adding-builtin-tool-checklist](wiki/adding-builtin-tool-checklist.md) | Checklist & pitfalls when adding a built-in tool to `core/src/tools/` (derived from `local_time` debugging) |
78+
| [release-process](wiki/release-process.md) | Standardized release process guide for deepv-code client, including strict tag and commit rules |
79+
80+
## Synthesis
81+
<!-- Cross-cutting analysis pages will be listed here -->

.llm-wiki/log.md

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
# LLM Wiki Log
2+
3+
> Chronological record of wiki operations.
4+
5+
## [2026-06-03] update | workflow-system.md — 魔法词门控机制文档
6+
7+
更新 `.llm-wiki/wiki/workflow-system.md`,新增「触发方式与魔法词门控」章节:
8+
- 三层防御机制说明(工具描述、system prompt、per-request 硬过滤)
9+
- `filterToolsByMessage()` 实现原理与代码位置
10+
- 如何为其他工具添加魔法词门控的操作指南(含代码模板)
11+
12+
## [2026-06-02] feat | workflow-system.md — Dynamic Workflow 完整文档
13+
14+
新增 `.llm-wiki/wiki/workflow-system.md`,内容包括:
15+
- 架构概览(调用链、核心文件、脚本 API)
16+
- 超时保护链路(4层)、Agent 状态可视化、result.data 规范
17+
- 今日修复的所有 bug 记录(上下文爆炸、脚本 JS 错误、Thinking 卡死、模型 fallback)
18+
- Backlog:P1 Token 预算(含 Anthropic task_budget 调研结论和我们的工程实现方案)、P2 Micro Compact(详细设计)、P3 自定义 Agent 定义文件夹
19+
20+
21+
22+
### Pages Added
23+
- `wiki/background-tasks.md` — Core background process management, CRC32 IDs, cross-platform tree termination, and shell integrations.
24+
- `wiki/feishu-integration.md` — Secure Feishu WebSocket (WSClient) gateway, GCM credential encryption, media downloads, and SendFeishuFileTool sandboxing.
25+
- `wiki/lark-cli-tool.md` — The `lark_cli` tool architecture, live output streams, Device-flow OAuth interception, and argument overflow guards.
26+
- `wiki/goal-driven-mode.md` — Comprehensive guide to the `/goal` driven mode contract, idle watchdog loop, and auto-clear constraints.
27+
- `wiki/context-compression.md` — Context compression pipeline (`CompressionService` and `MicroCompactService` triggers), role prefill safeguards, and state restorations.
28+
- `wiki/adaptive-thinking.md` — Standardized reasoning effort mapping across OpenAI, Gemini, and Claude; Haiku exclusions, and webview BrainIcon indicators.
29+
30+
### Pages Updated
31+
- `wiki/tools-system.md` — Promoted the built-in tool count from 27 to 31, introducing LarkCliTool, LocalTimeTool, GoalAchievedTool, and ImageReaderTool under the new "Workspace & Utilities" category.
32+
- `index.md` — Registered background-tasks, feishu-integration, lark-cli-tool, goal-driven-mode, context-compression, and adaptive-thinking.
33+
34+
---
35+
36+
## [2026-05-30] fix | Corrected oral error in Release Process Guide
37+
38+
### Pages Updated
39+
- `wiki/release-process.md` — 将步骤 5 中的口音错误字样“砸板”修改为规范词“发版”。
40+
41+
---
42+
43+
## [2026-05-29] feat | Release Process Guide
44+
45+
### Pages Added
46+
- `wiki/release-process.md` — 详细记录了 DeepV Code 项目的规范化发布流程和核心校验规则。
47+
- 核心限制:已推送的提交禁止 Amend 机制。
48+
- 核心红线:`package.json` 中的版本号必须严格低于 release tag 里的版本号,否则 CI/CD 编译发布必将失败。
49+
- 检索最新 Tag:使用 `git tag -l "cli-release-v*" --sort=-v:refname` 查询最新 tag 并以此计算递增下一个版本号。
50+
- 标准发版步骤:修改 -> 本地验证(单元测试+构建) -> Git Commit -> 检索计算新 tag -> 推送 ls-dev 分支 -> 打 tag 并推送触发 CI/CD 流程。
51+
52+
### Index Updated
53+
- 在 "Guides & Checklists" 区域追加了 `release-process` 的索引,指向 `wiki/release-process.md`
54+
55+
---
56+
57+
## [2026-05-22] feat | Built-in Tool Checklist (from local_time debugging)
58+
59+
### Pages Added
60+
- `wiki/adding-builtin-tool-checklist.md` — Checklist & pitfalls for adding
61+
a new built-in tool to `packages/core/src/tools/`. Captures lessons from
62+
the `local_time` bug where the tool registered correctly but Anthropic/
63+
proxy parsed `functionCalls=0` from a `FUNCTION_CALL` finishReason because
64+
of schema/description format drift from canonical tools.
65+
66+
### Key Lessons Captured
67+
- Description strings must not start with `\n` or contain em-dashes / smart
68+
quotes / embedded ISO-format quotes
69+
- Constructor should not over-specify the 4 boolean flags; rely on
70+
[[BaseTool]] defaults like `web-search.ts` does
71+
- `validateToolParams` must call `SchemaValidator.validate` first
72+
- `displayName` should be a single PascalCase word
73+
- Avoid emoji in `returnDisplay` for cross-context safety
74+
- Always `summary` field for UI history collapse
75+
- Bundle must be rebuilt for source changes to take effect
76+
- Reference tools by complexity: `web-search.ts`, `read-lints.ts`,
77+
`local-time.ts`, `ask-user-question.ts`
78+
79+
### Index Updated
80+
- Added "Guides & Checklists" section with link to the new page
81+
82+
---
83+
84+
## [2026-01-23] feat | Debate UI Enhancement Documentation
85+
86+
### Pages Added
87+
- `wiki/debate-i18n-enhancement.md` — Comprehensive documentation of multilingual debate mode
88+
- I18n support for Chinese/English UI
89+
- Language selection workflow
90+
- Dual-language prompt phrases
91+
- Settings integration with `preferredLanguage`
92+
- Implementation details for all 9 modified files
93+
94+
### Index Updated
95+
- Added "Features & Enhancements" section to `index.md`
96+
- Listed new `debate-i18n-enhancement` page
97+
98+
---
99+
100+
## [2026-04-10] lint | Health Check
101+
102+
### Scan Results (32 pages)
103+
- **Dead links:** 0 — all wikilink targets resolve to existing pages
104+
- **Orphan pages:** 0 — all wiki files listed in index.md
105+
- **Incomplete frontmatter:** 1 — `overview.md` used `source:` (string) instead of `sources:` (array)
106+
- **Contradictions:** 0 — tool counts, architecture descriptions consistent across pages
107+
- **Stale content:** 0 — all pages dated 2026-04-09, no outdated references found
108+
109+
### Fixes Applied
110+
1. `wiki/overview.md` — Standardized frontmatter: `source: README.md, package.json``sources: [README.md, package.json]` to match convention used by all other pages
111+
112+
### Recommendations (not auto-fixed)
113+
- **Missing entity pages:** Several components mentioned across multiple pages lack dedicated pages:
114+
- `CompressionService` — referenced in GeminiClient, source-02
115+
- `LoopDetectionService` — referenced in GeminiClient, source-02
116+
- `HookPlanner`, `HookRunner`, `HookAggregator`, `HookEventHandler` — 4 of 5 hook layers have no pages
117+
- `HookTranslator` — version isolation layer mentioned in source-05
118+
- **Thin content pages:** `SkillLoader.md`, `MarketplaceManager.md`, `ProxyAuthManager.md`, `SessionManager.md` have minimal detail (~5-8 lines each)
119+
120+
## [2026-04-09] init | Wiki Initialized
121+
- Created wiki directory structure
122+
- Ready for source ingestion
123+
124+
## [2026-04-09] ingest | Bulk Source Generation from Codebase Analysis
125+
- Analyzed project architecture via docs/architecture.md, package.json, README.md
126+
- Analyzed packages/core/src/ directory structure and key classes
127+
- Analyzed packages/cli/src/ directory structure and entry point
128+
- Analyzed tools system: 27 built-in tools, tool patterns, execution engine
129+
- Analyzed hooks system: 5-layer architecture, 11 event types
130+
- Analyzed build system: esbuild, CI/CD pipelines, npm publishing
131+
- Analyzed MCP system: transports, OAuth, two-phase loading
132+
- Generated 7 raw source documents:
133+
- raw/01-architecture.md
134+
- raw/02-core-module.md
135+
- raw/03-cli-module.md
136+
- raw/04-tools-system.md
137+
- raw/05-hooks-system.md
138+
- raw/06-build-and-scripts.md
139+
- raw/07-mcp-system.md
140+
- Updated index.md with source listing
141+
142+
## [2026-04-09] lint | Health Check
143+
144+
### Scan Results (32 pages)
145+
- **Dead links:** 0 — all 31 unique wikilink targets resolve correctly
146+
- **Orphan pages (filesystem):** 0 — all wiki files listed in index.md
147+
- **Orphan pages (graph):** 1 — `overview.md` had no incoming `[[overview]]` links
148+
- **Incomplete frontmatter:** 1 — `overview.md` missing `type` field
149+
- **Missing cross-references:** 2 — `overview.md` (0 outgoing wikilinks), `build-system.md` (1 outgoing, missing module links)
150+
- **Thin content:** 4 pages — `SkillLoader.md`, `MarketplaceManager.md`, `ProxyAuthManager.md`, `SessionManager.md`
151+
- **Contradictions:** 0
152+
- **Stale content:** Not applicable (all pages dated 2026-04-09, same-day generation)
153+
154+
### Fixes Applied
155+
1. `wiki/overview.md` — Added missing `type: overview` field to frontmatter
156+
2. `wiki/overview.md` — Added "Related Pages" section with 7 wikilinks to all major system modules; added inline wikilinks in Core Capabilities list
157+
3. `wiki/build-system.md` — Added `[[core-module]]` and `[[cli-module]]` wikilinks in Pipelines section
158+
159+
### Remaining Recommendations (manual)
160+
- Enrich thin entity pages: `SkillLoader.md`, `MarketplaceManager.md`, `ProxyAuthManager.md`, `SessionManager.md`
161+
- Standardize or document `source` (string) vs `sources` (array) convention across page types
162+
- Add `[[overview]]` link from at least one other page to eliminate graph orphan status
163+
- Update individual page dates when content is modified in future edits
164+
165+
## [2026-04-09] ingest | Full Ingestion of All 7 Raw Sources
166+
- Processed all 7 raw source documents into wiki pages
167+
- Created 7 source summary pages:
168+
- wiki/source-01-architecture.md — Architecture, monorepo, design patterns, dependencies
169+
- wiki/source-02-core-module.md — Core module structure, 16 directories, key classes
170+
- wiki/source-03-cli-module.md — CLI module, Ink/React UI, bootstrap sequence, two modes
171+
- wiki/source-04-tools-system.md — 27 built-in tools, execution state machine, confirmation types
172+
- wiki/source-05-hooks-system.md — 5-layer pipeline, 11 event types, I/O protocol
173+
- wiki/source-06-build-system.md — Two build pipelines, CI/CD, TypeScript/ESLint config
174+
- wiki/source-07-mcp-system.md — MCP transports, two-phase loading, OAuth, tool discovery
175+
- Created 7 system/module entity pages:
176+
- wiki/core-module.md, wiki/cli-module.md, wiki/tools-system.md
177+
- wiki/hooks-system.md, wiki/mcp-system.md, wiki/build-system.md, wiki/skills-system.md
178+
- Created 10 class/component entity pages:
179+
- wiki/GeminiClient.md, wiki/ContentGenerator.md, wiki/DeepVServerAdapter.md
180+
- wiki/SceneManager.md, wiki/Turn.md, wiki/SubAgent.md
181+
- wiki/ToolRegistry.md, wiki/BaseTool.md, wiki/ToolExecutionEngine.md
182+
- wiki/DiscoveredMCPTool.md, wiki/mcp-client.md
183+
- wiki/HookSystem.md, wiki/HookRegistry.md
184+
- wiki/ProxyAuthManager.md, wiki/SessionManager.md
185+
- wiki/SkillLoader.md, wiki/MarketplaceManager.md
186+
- All pages include YAML frontmatter (type, date, tags) and [[wikilink]] cross-references
187+
- Updated index.md with full source summaries, entities, and classes
188+
- No contradictions detected between sources

0 commit comments

Comments
 (0)