dsh-cntokenworld-kb 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +86 -7
  2. package/README.zh.md +64 -8
  3. package/dist/asr.js +487 -0
  4. package/dist/bridge.js +1171 -68
  5. package/dist/client.js +936 -40
  6. package/dist/config.js +100 -0
  7. package/dist/faq.js +274 -0
  8. package/dist/index.js +40 -18
  9. package/dist/kb-settings.js +540 -0
  10. package/dist/meeting-period-report.js +142 -0
  11. package/dist/meeting-report.js +112 -0
  12. package/dist/meeting-routes.js +270 -0
  13. package/dist/meeting.js +480 -0
  14. package/dist/schema.js +40 -0
  15. package/dist/scope.js +12 -5
  16. package/dist/tools.js +23 -0
  17. package/dist/web.js +13122 -2594
  18. package/docs/DETAIL.md +32 -1
  19. package/docs/DETAIL.zh.md +20 -1
  20. package/docs/PUBLISHING.md +2 -2
  21. package/docs/VOICE-MEETING.zh.md +455 -0
  22. package/docs/awesome-dsh-plugin-entry.yml +1 -1
  23. package/docs/interface-design-spec.md +890 -0
  24. package/docs/ui-redesign/01-PRD.md +75 -0
  25. package/docs/ui-redesign/02-design-tokens.md +145 -0
  26. package/docs/ui-redesign/03-design-review.md +122 -0
  27. package/docs/ui-redesign/04-wireframes.md +260 -0
  28. package/docs/ui-redesign/05-before-after.html +210 -0
  29. package/docs/ui-redesign/06-kb-settings.md +117 -0
  30. package/docs/ui-redesign/faq-panel.md +159 -0
  31. package/docs/ui-redesign/shots/after-docs-dark.png +0 -0
  32. package/docs/ui-redesign/shots/after-docs.png +0 -0
  33. package/docs/ui-redesign/shots/after-grid-dark.png +0 -0
  34. package/docs/ui-redesign/shots/after-grid.png +0 -0
  35. package/docs/ui-redesign/shots/after-scope.png +0 -0
  36. package/docs/ui-redesign/shots/before-docs.png +0 -0
  37. package/docs/ui-redesign/shots/before-grid.png +0 -0
  38. package/docs/ui-redesign/shots/before-scope.png +0 -0
  39. package/docs/ui-redesign/shots/kb-settings-dark.png +0 -0
  40. package/docs/ui-redesign/shots/kb-settings-light.png +0 -0
  41. package/docs/ui-redesign/shots/kb-settings-unbound.png +0 -0
  42. package/locale/en.json +1 -1
  43. package/locale/zh.json +1 -1
  44. package/package.json +7 -3
  45. package/scripts/build-client.mjs +16 -1
  46. package/scripts/funasr-local.sh +57 -0
  47. package/scripts/test-asr-live.mjs +160 -0
  48. package/scripts/test-asr.mjs +160 -0
  49. package/scripts/test-chunks.mjs +289 -0
  50. package/scripts/test-faq.mjs +593 -0
  51. package/scripts/test-host-bridge.mjs +362 -0
  52. package/scripts/test-kb-settings-bridge.mjs +187 -0
  53. package/scripts/test-kb-settings.mjs +226 -0
  54. package/scripts/test-meeting-report.mjs +102 -0
  55. package/scripts/test-meeting-routes.mjs +267 -0
  56. package/scripts/test-meeting.mjs +340 -0
  57. package/scripts/test-scope.mjs +176 -0
  58. package/scripts/test-task-progress.mjs +234 -0
  59. package/scripts/test-task-routes.mjs +177 -0
  60. package/src/client/00-shared.js +1111 -36
  61. package/src/client/01-styles.js +1133 -221
  62. package/src/client/02-design.js +997 -0
  63. package/src/client/05-icons.js +350 -0
  64. package/src/client/15-docs.js +910 -110
  65. package/src/client/16-chunks.js +696 -0
  66. package/src/client/16-task-progress.js +309 -0
  67. package/src/client/20-panel.js +707 -137
  68. package/src/client/25-kb.js +250 -29
  69. package/src/client/26-faq.js +1650 -0
  70. package/src/client/30-settings.js +445 -74
  71. package/src/client/35-kb-settings.js +883 -0
  72. package/src/client/40-scope.js +350 -113
  73. package/src/client/45-meeting.js +1271 -0
  74. package/src/client/90-entry.js +11 -0
  75. package/src/client/vendor/markdown.js +156 -0
package/README.md CHANGED
@@ -18,11 +18,15 @@
18
18
  - 📚 **Knowledge base workbench** — the *Knowledge base* entry in the left sidebar opens a full panel: the first screen lists the knowledge bases as folders, and a click opens one of them.
19
19
  - 📄 **Original file preview** — documents carry an icon for their extension and open in their own format: images directly, PDFs in the built-in reader, Word documents rendered into laid-out text, plain text as text, and the remaining formats fall back to the content parsed by the service.
20
20
  - ⬆️ **Four ways to add documents** — upload files, upload a whole folder, import a web page, or edit Markdown online; the bytes travel through the host bridge, so the API key never reaches the browser.
21
+ - 🧠 **The models are picked when a base is created** — the service needs an embedding model to chunk and vectorise a document, so the create dialog offers the models the service registers (`GET /models`) and writes them to the base; a base without one says so on its card and offers a one-click repair that adds the model and rebuilds the index.
22
+ - 🩺 **A failed parse explains itself** — the list shows the reason the service gave and offers to parse the documents again once the model is fixed.
21
23
  - 🔍 **Hybrid retrieval** — vector and keyword search inside one knowledge base, with the score, the match type and the passage itself.
24
+ - 🧩 **Chunk-level corrections** — the document detail has a *Chunks* tab that lists the passages a document was split into; a chunk can be rewritten, switched out of retrieval or deleted, its earlier versions can be restored, and its preset questions can be added, edited, dropped or regenerated. Every write carries the revision it was read at, so a chunk somebody else changed in the meantime is refused instead of overwritten.
22
25
  - 📚 **Wiki editing** — browse the generated articles, search them, and write them too: new pages, edits guarded by a version check, the version history with a restore, the link check and the auto fix.
23
26
  - 🕸️ **Link graph** — the wiki link graph drawn with a d3-force simulation: the nodes settle, can be dragged, zoomed and panned, and a node opens its article.
24
27
  - 🎨 **Gallery** — the image assets of a knowledge base, with a keyword filter and a lightbox.
25
28
  - 🧭 **Knowledge base picker under the composer** — every conversation picks the bases it may read: all of them, a single one, or several of them.
29
+ - 📊 **Storage quota at the bottom of the panel** — the workspace's used space against its allowance, read from the service itself.
26
30
  - ⚙️ **Its own section in the settings window** — *Knowledge base settings* sits next to the general and model settings, and holds the service address, the API key and the tool switches.
27
31
  - 🌗 **Follows the host theme** — every colour comes from the host design system's semantic tokens, so the panel and the settings section follow the light and dark theme.
28
32
 
@@ -79,6 +83,68 @@ shows the same form.
79
83
  | Answer timeout | The timeout of the streaming answer, in milliseconds. | `300000` |
80
84
  | Resource links | `handle` keeps the private handles, `public` asks for public links. | `handle` |
81
85
 
86
+ ### Meeting recording (experimental)
87
+
88
+ A **microphone button** appears under the composer: pressing it only opens a panel
89
+ (it never starts recording on the click itself); the panel has its own **Start
90
+ recording** button, and a recording survives closing the panel. The panel has two
91
+ tabs: **Transcript** (the transcribed text, with Start / Stop / Resume / Re-record
92
+ at the bottom) and **Meeting report** (Markdown-rendered, written with the
93
+ session's selected model, with Generate report / Save to knowledge base at the
94
+ bottom). The **Copy** button copies the report (or the transcript when no report
95
+ exists yet). Recognition runs on the server, no model is downloaded locally. (The
96
+ self-test buttons live in the plugin settings' "Speech recognition" and
97
+ "Meeting recognition" cards.)
98
+
99
+ #### Two recording versions
100
+
101
+ The panel switches between two versions, each against its own service:
102
+
103
+ - **Personal recording**: words appear while you talk, against the FunASR
104
+ streaming runtime (2pass: a live hypothesis plus a corrected final sentence);
105
+ - **Meeting recording**: live subtitles while you talk (reusing the personal
106
+ streaming service), then one final transcription against a **speaker-separation
107
+ service** (Python FunASR with spk models) that attributes every sentence to
108
+ "Speaker 1 / Speaker 2 / …"; the transcript tab is grouped by speaker, and
109
+ the report carries the attribution too.
110
+
111
+ Speaker separation is a separate deployment (the streaming runtime cannot do it).
112
+ Its address and self-test live in the settings' "Meeting recognition (speaker
113
+ separation)" card, apart from the "Speech recognition" card. See
114
+ [deploy/README-asr.md](deploy/README-asr.md) for deployment: one nginx gateway
115
+ splits a single port (`/personal` → the streaming service, `/meeting` → the spk
116
+ service).
117
+
118
+ | Setting | Meaning | Default |
119
+ | --- | --- | --- |
120
+ | Enable speech recognition | The microphone button stays hidden while this is off. | off |
121
+ | Service address | `wss://gw.example.com/personal`; `http`/`https` become `ws`/`wss`. | none |
122
+ | Access token | Authenticates against your gateway; write-only. | none |
123
+ | Recognition mode | `2pass` (live plus final), `online` or `offline`. | `2pass` |
124
+ | Hot words | One `word weight` per line, sent per connection. | none |
125
+ | Recognition language | Sent with the first frame. | `zh` |
126
+ | Enable meeting recognition | The meeting recording version is not offered while this is off. | off |
127
+ | Meeting recognition service address | `wss://gw.example.com/meeting`. | none |
128
+ | Meeting recognition access token | Authenticates against your gateway; write-only. | none |
129
+ | Meeting recognition hot words / language | Sent to the meeting service. | none |
130
+
131
+ The address and the token live in the host process; the browser never sees
132
+ them. FunASR itself has no authentication, so keep it on the intranet or behind
133
+ a gateway. The design and the deployment notes are in
134
+ [docs/VOICE-MEETING.zh.md](docs/VOICE-MEETING.zh.md).
135
+
136
+ **You can try it locally**, without a server: `npm run funasr -- start` runs a
137
+ FunASR runtime in Docker on `ws://127.0.0.1:10096`, and `npm run test:live`
138
+ drives the real service:
139
+
140
+ ```bash
141
+ npm run funasr -- start # start a local FunASR (the first run pulls about 2 GB of models)
142
+ npm run test:live # the real service, then the whole meeting path
143
+ ```
144
+
145
+ A real run ends with `[offline] 今天我们讨论语音输入的接入方案,会议纪要要关联到项目。`
146
+
147
+
82
148
  ### The knowledge base scope of a conversation
83
149
 
84
150
  The picker under the composer decides which bases a conversation may read:
@@ -115,12 +181,17 @@ scope, never widen it.
115
181
 
116
182
  - The tools are read-only: `list_knowledge_bases`, `search`, `read_document`
117
183
  and `ask` never upload, change or delete a document. Writing only happens in
118
- the *Add document* menu of the panel.
184
+ the panel: the *Add document* menu and the *Chunks* tab.
119
185
  - The API key needs the `retrieve` capability on the service side, `ask`
120
- additionally needs `chat`, and uploading needs `ingest`.
186
+ additionally needs `chat`, and uploading and the chunk corrections need
187
+ `ingest`.
121
188
  - The credential is read from the configuration, it is not an interactive
122
189
  login.
123
190
  - Importing a web page is limited by the service's SSRF allow list.
191
+ - The models behind a knowledge base are owned by the service: the plugin
192
+ writes the embedding and the summary model of the create dialog onto the
193
+ base, but the models themselves are registered by the administrator of the
194
+ service.
124
195
 
125
196
  ## Directory
126
197
 
@@ -134,15 +205,23 @@ dsh-cntokenworld-kb/
134
205
  │ ├── client.js # the host-side HTTP client
135
206
  │ ├── bridge.js # the host-side bridge routes (the browser panel reads through them)
136
207
  │ ├── scope.js # the host-side scope store (the picker and the tools share it)
208
+ │ ├── asr.js # the host-side FunASR streaming client (WebSocket)
209
+ │ ├── meeting.js # the host-side meeting session hub
210
+ │ ├── meeting-routes.js# the host-side meeting bridge routes
137
211
  │ ├── tools.js # the four tool definitions
138
212
  │ ├── render.js # the tool output
139
- │ └── web.js # the browser half: the sidebar panel, the settings section, the picker (built by scripts/build-client.mjs)
140
- ├── src/client/ # the browser sources (00-shared / 01-styles / 15-docs / 20-panel / 25-kb / 30-wiki / 30-settings / 40-scope / 90-entry)
141
- │ └── vendor/ # bundled dependencies: d3-force.js (the force simulation), docx-preview.js (the Word renderer)
213
+ │ └── web.js # the browser half: the sidebar panel, the settings section, the picker, the recorder (built by scripts/build-client.mjs)
214
+ ├── src/client/ # the browser sources (00-shared / 01-styles / 15-docs / 20-panel / 25-kb / 30-wiki / 30-settings / 40-scope / 45-meeting / 90-entry)
215
+ │ └── vendor/ # bundled dependencies: d3-force.js (the force simulation), docx-preview.js (the Word renderer), markdown.js (meeting report renderer)
142
216
  ├── scripts/
143
- │ └── build-client.mjs # concatenates src/client/*.js into dist/web.js
217
+ │ ├── build-client.mjs # concatenates src/client/*.js into dist/web.js
218
+ │ ├── funasr-local.sh # a local FunASR container (start/stop/status/logs)
219
+ │ ├── test-asr.mjs # the recognition protocol test
220
+ │ ├── test-meeting.mjs # the end-to-end test of the meeting recorder
221
+ │ ├── test-asr-live.mjs # the live test: a real FunASR
222
+ │ └── test-meeting-routes.mjs # the live test: the bridge routes and the whole meeting path
144
223
  ├── locale/ # en.json / zh.json
145
- ├── docs/ # DETAIL.md / DETAIL.zh.md / PUBLISHING.md / preview.svg
224
+ ├── docs/ # DETAIL.md / DETAIL.zh.md / PUBLISHING.md / VOICE-MEETING.zh.md / preview.svg
146
225
  ├── assets/ # the icon and the screenshots
147
226
  ├── screenshots.json # the screenshots the marketplace shows
148
227
  └── icon.svg
package/README.zh.md CHANGED
@@ -55,6 +55,46 @@ dsh plugin --profile desktop add dsh-cntokenworld-kb
55
55
 
56
56
  保存后配置立即生效,插件会重新注册工具,无需重启 DSH。
57
57
 
58
+ ## 会议录音(实验)
59
+
60
+ 工作台里可以开一场会:对话输入区下方多了一个**麦克风按钮**,点它只打开面板(**不会一点击就录音**),面板里有独立的「开始录音」按钮;录音跨关窗保留,回到面板即可继续。面板分两个 Tab:**「录音原文」**(转写文本,底部可 开始录音 / 停止录音 / 继续录制 / 重新录制)与 **「会议报告」**(用当前会话选中模型生成,Markdown 渲染,底部可 生成会议报告 / 存入知识库);右上角「复制」复制的是报告正文(未生成报告时复制原文)。识别服务在服务器上跑,本地不下载任何模型。(排查用的「自检识别服务」按钮在插件设置的「语音识别」卡片里。)
61
+
62
+ ### 两个录音版本
63
+
64
+ 面板里可以切换**录音版本**,两个版本各走各的服务:
65
+
66
+ - **个人录音**:边说边出字,走 FunASR 实时流式服务(2pass:实时假设 + 句尾纠错定稿);
67
+ - **会议录音**:边说边出实时字幕(复用个人实时服务),录音结束后统一转写,走**说话人分离服务**(Python FunASR + spk 模型),把每句话归属到「说话人 1 / 说话人 2 / …」,原文 Tab 按说话人分段显示;会议报告也会带上说话人归属。
68
+
69
+ 会议录音版的「说话人分离」是另一套部署(在线服务没有说话人分离能力),配置与自检在设置页的「会议识别(说话人分离)」卡片里,与「语音识别」卡片分开。**部署见 [deploy/README-asr.md](deploy/README-asr.md)**:一个 nginx 网关单端口分流(`/personal` → 实时服务、`/meeting` → spk 服务)。
70
+
71
+ | 配置项 | 说明 | 默认值 |
72
+ | --- | --- | --- |
73
+ | 启用语音识别 | 关掉时麦克风按钮不出现 | 关 |
74
+ | 服务地址 | `wss://gw.example.com/personal`;`http`/`https` 会自动换成 `ws`/`wss` | 无 |
75
+ | 访问令牌 | 网关鉴权用,只写不读 | 无 |
76
+ | 识别模式 | `2pass`(实时+定稿)/ `online` / `offline` | `2pass` |
77
+ | 热词 | 每行「词 权重」,作为会话级热词下发给服务端 | 无 |
78
+ | 识别语言 | 随首帧下发 | `zh` |
79
+ | 启用会议识别 | 关掉时录音版本里不能选「会议录音」 | 关 |
80
+ | 会议识别服务地址 | `wss://gw.example.com/meeting` | 无 |
81
+ | 会议识别访问令牌 | 网关鉴权用,只写不读 | 无 |
82
+ | 会议识别热词 / 语言 | 同上,随会议服务下发 | 无 |
83
+
84
+ 地址与令牌只存在宿主进程里,浏览器拿不到;FunASR 本身没有鉴权,请务必放在内网或公司网关后面。设计与部署细节见 [docs/VOICE-MEETING.zh.md](docs/VOICE-MEETING.zh.md)。
85
+
86
+ **本地就能联调**(不用先上服务器):`npm run funasr -- start` 用 Docker 起一个 FunASR(`ws://127.0.0.1:10096`),`npm run test:live` 跑一遍真机测试:
87
+
88
+ ```bash
89
+ npm run funasr -- start # 起本地 FunASR(首次会下载约 2 GB 模型)
90
+ say -v Tingting -r 180 -o /tmp/funasr-voice.aiff "今天我们讨论语音输入的接入方案,会议纪要要关联到项目。"
91
+ afconvert -f WAVE -d LEI16@16000 -c 1 /tmp/funasr-voice.aiff /tmp/funasr-voice.wav
92
+ npm run test:live # 真服务转写 + 整条会议链路
93
+ ```
94
+
95
+ 真机实测输出:`[offline] 今天我们讨论语音输入的接入方案,会议纪要要关联到项目。`
96
+
97
+
58
98
  ## 对话知识库范围
59
99
 
60
100
  对话输入框下方有一个 **知识库选择器**(书本图标),它决定这一次对话能检索哪些知识库:
@@ -71,7 +111,9 @@ dsh plugin --profile desktop add dsh-cntokenworld-kb
71
111
 
72
112
  插件在 DSH 左侧边栏注册了一个 **「知识库」** 入口。点击后右侧展开完整面板,与 WeKnora 的知识库工作台一致。
73
113
 
74
- **第一屏是知识库文件夹列表**:每个知识库一张卡片(名称、描述、文档数、已开启的能力徽标),点击卡片才进入该知识库;进入后标题栏变为知识库名称,左侧有「‹ 知识库列表」返回按钮,标题栏下拉框可快速切换知识库。工具栏的「+ 新建知识库」可以创建知识库;卡片右上角的「⋯」打开管理弹窗,可改名与改描述、复制设置、重建索引、重新生成画像、删除知识库(删除需二次确认,服务端会连带删除库内全部文档)。
114
+ **第一屏是知识库文件夹列表**:每个知识库一张卡片(名称、描述、文档数、已开启的能力徽标),点击卡片才进入该知识库;进入后标题栏变为知识库名称,左侧有「‹ 知识库列表」返回按钮,标题栏下拉框可快速切换知识库。工具栏的「+ 新建知识库」可以创建知识库;卡片右上角的「⋯」打开管理弹窗,可改名与改描述、**切换嵌入模型与摘要模型**、复制设置、重建索引、重新生成画像、删除知识库(删除需二次确认,服务端会连带删除库内全部文档)。
115
+
116
+ **模型是必选项**:服务端要靠嵌入模型把文档切块并向量化,**知识库没有嵌入模型,文档一律解析失败**(服务端报 `failed to get embedding model: model ID cannot be empty`)。所以「新建知识库」弹窗里有两个下拉框 —— **嵌入模型**(必填,来自 `GET /models` 里 `type=Embedding` 的模型)与 **摘要模型**(可选,`type=KnowledgeQA` 的模型,用于生成文档摘要);建库时把它们一起写进 `embedding_model_id` / `summary_model_id`。老知识库如果没有模型,卡片上会标出「未配置嵌入模型,文档无法解析」,打开它时面板顶部给一条提示,点「一键补上模型并重建索引」即可补齐(取服务端第一个嵌入模型写入,然后 `POST /knowledge-bases/:id/rebuild-index` 重新索引,之前失败的文档会重新解析)。模型本身由服务端管理员在 WeKnora 的模型管理里维护,插件只负责把选中的模型写到知识库上。
75
117
 
76
118
  | 标签页 | 内容 |
77
119
  | --- | --- |
@@ -83,12 +125,18 @@ dsh plugin --profile desktop add dsh-cntokenworld-kb
83
125
 
84
126
  **文档管理**:文档行的「⋯」菜单支持重命名、移动到目录、打标签、重新解析、取消解析、重新生成摘要与删除;勾选多篇文档后出现批量条,可批量重新解析、移动、打标签、**批量下载**(服务端打包成 ZIP)与删除;标签面板里可以新建标签并立刻给选中文档打上(服务端语义是全量替换,取消勾选即移除)。目录来自 `GET /knowledge-bases/:id/knowledge/folders`,标签来自 `GET /knowledge-bases/:id/tags`;过滤条上的「📁」按钮可以整体移动目录子树(`PUT /knowledge-bases/:id/knowledge/folders`,body 为 `{from, to}`,目标存在则合并)。
85
127
 
128
+ **分块纠错**:文档详情页多了一个「分块」标签页,列出这篇文档被切开的每一块(编号、类型、版本号、正文预览,可按类型筛选)。点开一块就能改它的正文、切换它是否参与检索、删除它;「历史版本」标签页列出这块改之前的每一次版本并可一键回滚,「预置问题」标签页管这块的其它问法(新增、编辑、删除,也可以让服务端按正文重新生成一批)。检索命中不对时,改这一块比整篇重解析细得多。所有写入都带版本号乐观锁:别人先改了同一块时服务端返回 409,面板提示「这个分块刚被改过」,不会覆盖对方的改动。对应的服务端接口是 `GET /chunks/:knowledge_id`、`GET /chunks/by-id/:id`、`PUT /chunks/:knowledge_id/:id`、`DELETE /chunks/:knowledge_id/:id`、`GET /chunks/:knowledge_id/:id/revisions`、`POST /chunks/:knowledge_id/:id/revert`、`PUT /chunks/by-id/:id/questions`、`DELETE /chunks/by-id/:id/questions`、`POST /chunks/by-id/:id/questions/regenerate`。
129
+
86
130
  **Wiki 写入**:面板可以直接维护知识库的 Wiki —— 新建页面(slug 需为小写字母、数字或连字符)、编辑已有页面(带版本号做乐观锁,服务端返回 409 时提示“页面已被他人修改”并给出当前版本)、版本历史与一键还原、链接检查(`GET /wiki/lint` 报告问题并给出健康分,≥80 绿、≥50 黄、其余红)与自动修复(`POST /wiki/auto-fix`)、删除页面。
87
131
 
88
132
  **添加文档**:文档标签页右上角的「+ 添加文档」菜单支持四种写入方式 —— 上传文档(可多选,排队上传,单文件上限 50 MB)、上传文件夹(保留目录层级)、导入网页(服务端抓取正文,受其 SSRF 白名单限制)、在线编辑 Markdown(可暂存草稿或发布入库)。上传成功后列表自动刷新,失败的文件会逐条列出原因。文件字节由浏览器交给宿主桥接(`/api/dsh-cntokenworld-kb/upload-file`),宿主用已保存的凭据转发给服务端,密钥不会下发到前端。
89
133
 
134
+ **解析失败会说明原因**:文档列表里解析失败的条目直接显示服务端的错误(例如嵌入模型报错 `does not support Matryoshka embeddings; dimensions must be unset`),列表顶部还有一条汇总提示和「重新解析」按钮(`POST /knowledge/:id/reparse` 与 `POST /knowledge/batch-reparse`,body 为 `{kb_id, ids}`),改好服务端模型后点一下即可重跑。
135
+
90
136
  面板顶部可以搜索并刷新;在文件夹列表里搜索框过滤的是知识库名称。
91
137
 
138
+ **面板底部是空间额度**:一条常驻底栏,显示当前工作区(`GET /auth/me` 的 `tenant`)已占用的存储与配额(`storage_used` / `storage_quota`),带一条用量进度条;额度读不到时只提示“暂时读不到额度”,不显示旧数字。
139
+
92
140
  面板本身在浏览器里运行,但它不持有 API Key:浏览器只向宿主发请求(`/api/dsh-cntokenworld-kb/*`),由宿主用已保存的凭据去读知识库,密钥不会下发到前端。
93
141
 
94
142
  渲染与动画依赖全部内置在 `src/client/vendor/`(`d3-force.js` = d3-force/quadtree/dispatch/timer;`docx-preview.js` = jszip + docx-preview),不依赖 CDN。
@@ -108,8 +156,8 @@ dsh plugin --profile desktop add dsh-cntokenworld-kb
108
156
 
109
157
  ## 限制
110
158
 
111
- - 工具是只读的:`list_knowledge_bases` / `search` / `read_document` / `ask` 不会上传、修改或删除任何文档;写入只发生在面板的「添加文档」入口里。
112
- - API Key 需要服务端具备 `retrieve` 权限;`ask` 还需要 `chat` 权限;上传文档需要服务端的 ingest 权限。
159
+ - 工具是只读的:`list_knowledge_bases` / `search` / `read_document` / `ask` 不会上传、修改或删除任何文档;写入只发生在面板里 —— 「添加文档」入口与「分块」标签页。
160
+ - API Key 需要服务端具备 `retrieve` 权限;`ask` 还需要 `chat` 权限;上传文档与分块纠错需要服务端的 ingest 权限。
113
161
  - 凭据从配置读取,不是交互式登录。
114
162
  - 导入网页受服务端 SSRF 白名单限制:解析不了或不允许的域名会被服务端拒绝。
115
163
 
@@ -125,15 +173,23 @@ dsh-cntokenworld-kb/
125
173
  │ ├── client.js # 宿主侧 HTTP 客户端
126
174
  │ ├── bridge.js # 宿主侧桥接路由(给浏览器面板取数)
127
175
  │ ├── scope.js # 宿主侧的会话范围存储(对话选择器与工具共用)
176
+ │ ├── asr.js # 宿主侧的 FunASR 流式识别客户端(WebSocket)
177
+ │ ├── meeting.js # 宿主侧的会议会话中心
178
+ │ ├── meeting-routes.js# 宿主侧的会议桥接路由
128
179
  │ ├── tools.js # 四个工具定义
129
180
  │ ├── render.js # 工具输出渲染
130
- │ └── web.js # 浏览器侧:侧边栏面板 + 设置分区 + 对话范围选择器(由 scripts/build-client.mjs 生成)
131
- ├── src/client/ # 浏览器侧源码(00-shared / 01-styles / 15-docs / 20-panel / 25-kb / 30-wiki / 30-settings / 40-scope / 90-entry)
132
- │ └── vendor/ # 内置依赖:d3-force.js(力导向模拟)、docx-preview.js(Word 渲染)
181
+ │ └── web.js # 浏览器侧:侧边栏面板 + 设置分区 + 对话范围选择器 + 录音(由 scripts/build-client.mjs 生成)
182
+ ├── src/client/ # 浏览器侧源码(00-shared / 01-styles / 15-docs / 20-panel / 25-kb / 30-wiki / 30-settings / 40-scope / 45-meeting / 90-entry)
183
+ │ └── vendor/ # 内置依赖:d3-force.js(力导向模拟)、docx-preview.js(Word 渲染)、markdown.js(会议报告 Markdown 渲染)
133
184
  ├── scripts/
134
- │ └── build-client.mjs # 把 src/client/*.js 拼成 dist/web.js
185
+ │ ├── build-client.mjs # 把 src/client/*.js 拼成 dist/web.js
186
+ │ ├── funasr-local.sh # 本地 FunASR 容器(start/stop/status/logs)
187
+ │ ├── test-asr.mjs # 识别协议测试
188
+ │ ├── test-meeting.mjs # 会议录音端到端测试
189
+ │ ├── test-asr-live.mjs # 真机测试:连真实 FunASR
190
+ │ └── test-meeting-routes.mjs # 真机测试:桥接路由 + 整条会议链路
135
191
  ├── locale/ # en.json / zh.json
136
- ├── docs/ # DETAIL.md / DETAIL.zh.md / PUBLISHING.md / preview.svg
192
+ ├── docs/ # DETAIL.md / DETAIL.zh.md / PUBLISHING.md / VOICE-MEETING.zh.md / preview.svg
137
193
  ├── assets/ # 图标与截图
138
194
  ├── screenshots.json # 市场展示用的截图清单
139
195
  └── icon.svg