docs: 按源码全面校正(插件数/内置 timer/RPC 数/工具数/失效行号)

逐条对着源码核过,修掉 5 类与实现不符的陈述(中英四份文档同步):

1. **内置插件数 20 → 17**
   `internal/plugins/all.go` 的空白导入实际是 17 个。旧文档还列了 `timer`
   (已外置)与 `data`/`kbtree`(根本不是内置插件,前者只有 skills 目录,
   后者未进 all.go)。清单按 all.go 重写。
   涉及:README、README_EN(含「许可」章节的 AGPL 覆盖范围)、OVERVIEW 中英、
   ARCHITECTURE 中英的加载方式表。

2. **删除所有把 timer 当内置插件的表述**
   ARCHITECTURE 中英目录树里的 `internal/plugins/timer/` 行、
   PLUGIN_DEV 内置插件示例表的 Timer 行(该行还与同页下方「timer 已移出内置插件」
   的说明自相矛盾)。示例表改用 healthcheck(真实存在、30m 定时自检)。

3. **子进程 RPC 方法数 55 → 82**
   权威清单是 `internal/plugin/proc/protocol.go` 的 Method 常量,
   实际 82 个(settings 16 / plugin 9 / io 8 / secrets 7 …)。
   v1.1.1「51 → 55」作为历史叙述保留,但补注说明 82 才是当前值,
   避免读者把 55 当现值。

4. **qq 示例工具数 20 → 24**
   按 `example/qq/plugin.go` 的 `Name: tp + "..."` 实数。

5. **修掉整张失效的「文件:行号」引用表**
   原文写 `context.go:155` / `document.go:206` / `indexer.go:96+111`,
   但 memory 重组后 `context.go` 已迁到 `agent/core/`,行号全部错位。
   改为**函数名锚点**(`RelevanceContext.Prune`、`Store.Query`、
   `Indexer.vectorSearchEntities`),并改正 `distill.go` 的算法描述:
   文档写 Bigram Jaccard,源码是**加权** Jaccard(`scene_emerge.go` 有明确注释),
   阈值 `sim > 0.75` 在 `distill.go`。

同时补 Provider 接口漏项:实际有 4 个方法(Name / Chat / ChatStream /
MaxContextTokens),文档只写了前 3 个。

验证:`go build ./...` 通过;文档内相对链接 0 坏链;
引用的 22 个 .go 路径逐个 stat 存在(`internal/memory/media/` 两处是
「已删除机制」的历史叙述,指向不存在路径是正确语义,保持不变)。
This commit is contained in:
root
2026-10-19 20:49:43 +08:00
parent 852d6a2891
commit 515cf2deb1
8 changed files with 39 additions and 25 deletions

View File

@ -216,7 +216,7 @@ internal/
├── memory/ Three-layer memory: Graph(SQLite) / Document(JSON+TF-IDF) / Text(JSONL) + StaticEmbedder(pretrained word embedding/TF-IDF fallback) + CleanTemplateText(de-template)
├── knowledge/ Knowledge base (filesystem + TF-IDF)
├── plugin/ Plugin registry + subprocess loader (stdio RPC + shared memory segment + event ring)
├── plugins/ 20 built-in plugins (webui/cli/timer/cmd/mcp/files/cfgmgr/agentcli/healthcheck/pluginmgr/clawhubadapter/multimodal/remotedevice/ai_image/localuse/skillmgr/data/seq/kbtree, ...)
├── plugins/ 17 built-in plugins (webui/cli/cmd/mcp/files/cfgmgr/agentcli/healthcheck/pluginmgr/clawhubadapter/multimodal/remotedevice/ai_image/localuse/skillmgr/seemedia/seq)
├── sdk/ PluginSDK (Tool/Stage/Event three channels)
├── config/ SQLite config center
├── events/ Event bus
@ -416,7 +416,7 @@ private included), with no same-license obligation and no §13 network clause. T
vitality of the third-party plugin ecosystem rest on this.
The boundary is clean: **AGPL covers the kernel and the bundled plugins** (`homed`, `internal/`,
the 20 built-in plugins under `internal/plugins/`); **MIT covers the public SDK** (`sdk/`, whose
the 17 built-in plugins under `internal/plugins/`); **MIT covers the public SDK** (`sdk/`, whose
`go.mod` has zero external dependencies and imports only the Go standard library — it never
references any kernel code). Process isolation is beside the point here — what decides the
license is the linked SDK code itself, and that code is MIT.