Skip to content

docs(bridge): describe word_count vs char_count on search/outline/read/list - #9

Merged
GitPusher99 merged 1 commit into
mainfrom
feat/100-document-char-count
Sep 15, 2026
Merged

GitPusher99 merged 1 commit into
mainfrom
feat/100-document-char-count

Conversation

@GitPusher99

@GitPusher99 GitPusher99 commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Refs LinklyAI/linkly-ai-workspace#100

⚠️ 合并顺序:需先合并并发版 LinklyAI/linkly-ai-desktop-v3#318,本 PR 才能上线——描述里承诺的 char_count 由新版 Desktop 返回,旧版 Desktop 不带该字段。

背景

Desktop 在 #318 给本地文档新增 char_count(提取正文的 Unicode 字符数),与 word_count(词数,中文下比字符数低 15~40%)并列,并在四个工具描述里写明两种口径。stdio bridge 在 src/bridge/handler.rs 里独立重写了全部工具的描述,不同步的话 bridge 用户看到结果里的 char_count 却没有解释。

方案

只改 search / outline / read / list 四个 #[tool(description = …)] 的文本,不动 schema、路由或工具集合。口径说明限定为「Desktop 本地文档」:cloud:// 条目不带 char_count,旧版 Desktop 也不带。

变动

  • src/bridge/handler.rs
    • search / outline / read:末尾追加 size-fields 段;read 另注明 Characters 覆盖整份可用正文
    • list:字段清单加 char_count,末尾追加同一段说明

验证

  • cargo test:190 passed,0 failed
  • cargo clippy --all-targets:0 警告
  • 纯描述文本改动,无行为变化

Windows 手工验证:不适用——本 PR 仅改 CLI bridge 的工具描述文本,未触及路径 / 进程 / 系统集成,桌面端不随之改。

关联 PR:LinklyAI/linkly-ai-api#47(同一需求的另一份描述同步)。

…d/list (#100)

The stdio bridge re-declares every tool description; mirror the
size-field contract Desktop added for local documents (`char_count` =
Unicode characters of the extracted body; null = not yet computed or an
older Desktop; cloud:// items do not carry it).
@GitPusher99
GitPusher99 marked this pull request as ready for review September 15, 2026 14:41
@GitPusher99
GitPusher99 merged commit d08138c into main Sep 15, 2026
1 check passed
@GitPusher99
GitPusher99 deleted the feat/100-document-char-count branch September 17, 2026 13:58
@blueeon blueeon added this to the v0.8.2 milestone Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants