@sparkelf/dsh-knowledge-base 0.4.2 → 0.5.0
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.
- package/README.md +19 -0
- package/cordis.patch.yml +15 -0
- package/lib/client.js +833 -657
- package/lib/client.js.map +1 -1
- package/lib/index.js +9725 -7879
- package/lib/types/client/graph/KnowledgeGraphView.d.ts +7 -0
- package/lib/types/ftsIndex.d.ts +32 -0
- package/lib/types/graphCanvas.d.ts +1 -1
- package/lib/types/graphTools.d.ts +378 -1
- package/lib/types/graphTypes.d.ts +35 -0
- package/lib/types/index.d.ts +69 -1
- package/lib/types/knowledgeTools.d.ts +33 -1
- package/lib/types/views.d.ts +25 -0
- package/package.json +1 -1
- package/skills/knowledge-graph/SKILL.md +104 -9
package/README.md
CHANGED
|
@@ -74,6 +74,25 @@ index tooling over a mounted directory. Runs standalone or against a DataOps bac
|
|
|
74
74
|
路径校验、上传、提取、搜索、预览这些核心链路两种形态共用同一份实现——区别只是权限判据
|
|
75
75
|
从「问后端」变成「查本地边界」。
|
|
76
76
|
|
|
77
|
+
## 写入即入库(0.4.3)
|
|
78
|
+
|
|
79
|
+
写入不是「字节落盘」就结束。`kb_file_write` 和 create/edit/upload/approve 路由在写成功后都走
|
|
80
|
+
`afterDocumentWrite`:
|
|
81
|
+
|
|
82
|
+
- PDF/DOCX/XLSX/PPTX 等可提取格式:进入 extractionQueue,worker 写出 `<source>.md` 后再 chunk +
|
|
83
|
+
index;工具结果返回 `extraction` 任务句柄,用 `extract.status` 查终态。overwrite 会先删掉旧
|
|
84
|
+
的派生 `.md`,避免文档继续按旧正文被检索。
|
|
85
|
+
- Markdown/TXT/CSV 等文本格式:直接增量 index,结果返回 `index: {status, docId, chunks, indexedAt}`。
|
|
86
|
+
- `kb_file_write` 支持 `encoding:"base64"`,因此 AI 可以写真正的 PDF/DOCX/XLSX 字节,而不是把
|
|
87
|
+
二进制当文本写坏。
|
|
88
|
+
- 只有两种结果:`indexed`(可检索,带行号)或 `pending-extraction`/`indexing`(异步进行中)。
|
|
89
|
+
写成功但索引失败只作为状态返回,不回滚文件。
|
|
90
|
+
|
|
91
|
+
`kb_sync`/`views.sync` 不再把 view 里的「未注册文件」直接删掉:带写权限的文件先
|
|
92
|
+
`adoptViewFile` 导入 `actualRoot`(copy + hardlink 回 view),再补 extract/index;无写权限或与
|
|
93
|
+
authoritative 同名冲突才按原逻辑 unlink。这修的是「AI 用 shell cp 把 PDF 放进 view,extract 报
|
|
94
|
+
no such document,下一次 sync 把文件清掉」的原因。
|
|
95
|
+
|
|
77
96
|
## 工具按权限披露
|
|
78
97
|
|
|
79
98
|
模型看到的工具清单由 `src/toolDisclosure.ts` 的协调器决定,不在每个 `execute()` 里重复查
|
package/cordis.patch.yml
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Knowledge-base bundle patch: mount the Host half. The Client half is declared
|
|
2
2
|
# by package.json's `dsh.client` and loaded by the Web shell.
|
|
3
|
+
#
|
|
4
|
+
# `inject` is repeated here on purpose. A bundled ESM plugin's named `inject`
|
|
5
|
+
# export is resolved by the loader, but making the dependency list explicit on
|
|
6
|
+
# the entry keeps activation deterministic when the host boots several plugin
|
|
7
|
+
# rows concurrently: the fiber waits for `agentLoop` instead of reading it
|
|
8
|
+
# before the service is committed.
|
|
3
9
|
- insert:
|
|
4
10
|
- id: knowledge-base
|
|
5
11
|
name: '@sparkelf/dsh-knowledge-base'
|
|
12
|
+
inject:
|
|
13
|
+
- credentials
|
|
14
|
+
- webServer
|
|
15
|
+
- tools
|
|
16
|
+
- systemPrompt
|
|
17
|
+
- agentLoop
|
|
18
|
+
- agents
|
|
19
|
+
- sessionTitle
|
|
20
|
+
- agentDefaultModel
|