dsh-plugin-dev-kb 1.0.2 → 1.0.3
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/kb/meta/topics.md +2 -2
- package/lib/index.js +9 -1
- package/package.json +1 -1
- package/skills/dsh-plugin-dev-kb.md +1 -1
package/kb/meta/topics.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 主题导航(Topics)
|
|
2
2
|
|
|
3
|
-
> 用途:按**任务场景**快速定位要读的文档。路径相对于知识库根 `kb
|
|
3
|
+
> 用途:按**任务场景**快速定位要读的文档。路径相对于知识库根 `kb/`(知识库绝对路径见技能正文注入的 `{{KB_ROOT}}`,不在此写死机器路径)。
|
|
4
4
|
> 中文优先读 `site/` 下的文件;英文原文在 `site/en/` 对应路径(如 `site/en/develop/basic/index.md`)。
|
|
5
5
|
> 每个主题:**核心** = 先读这些;**扩展** = 需要细节时再读。
|
|
6
6
|
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
- 核心:`site/reference/cookbook/adding-a-package.md`、`site/reference/cookbook/adding-a-settings-card.md`、`site/reference/cookbook/adding-a-conversation-node.md`
|
|
45
45
|
|
|
46
46
|
## 11. 子系统能力速查(按需)
|
|
47
|
-
- 总览:`site/reference/subsystems/index.md
|
|
47
|
+
- 总览:`site/reference/subsystems/index.md`
|
|
48
48
|
- 内核与作用域:`core.md`、`scope.md`、`invariants.md`(运行时不变式)
|
|
49
49
|
- 会话与持久化:`session.md`、`session-query.md`、`session-reference.md`、`session-title.md`、`session-projection.md`、`persistence.md`、`spill.md`、`session-telemetry.md`
|
|
50
50
|
- 模型与上下文:`llm-streaming.md`、`token-meter.md`、`system-prompt.md`、`compaction.md`(上下文压缩)
|
package/lib/index.js
CHANGED
|
@@ -24,6 +24,7 @@ export const inject = ['skills']
|
|
|
24
24
|
|
|
25
25
|
const PKG_DIR = dirname(fileURLToPath(import.meta.url))
|
|
26
26
|
const SKILLS_DIR = join(PKG_DIR, '..', 'skills')
|
|
27
|
+
const KB_DIR = join(PKG_DIR, '..', 'kb')
|
|
27
28
|
|
|
28
29
|
/** 极简 frontmatter 解析(name/description/whenToUse)。 */
|
|
29
30
|
function parseFrontmatter(md) {
|
|
@@ -78,6 +79,12 @@ export function apply(ctx, config) {
|
|
|
78
79
|
|
|
79
80
|
// 契约(dsh-skill validateDefinition):定义必须含 name/description/
|
|
80
81
|
// source/content 四个字符串;provider 缺省为 'runtime'。
|
|
82
|
+
//
|
|
83
|
+
// 路径注入:技能正文中的 {{KB_ROOT}} 占位符在此替换为插件实际的 kb/
|
|
84
|
+
// 绝对路径(正斜杠,Windows 反斜杠会破坏 Markdown 转义),并声明
|
|
85
|
+
// resourceBase 让 skill 工具渲染相对资源引导——知识库位置随插件安装
|
|
86
|
+
// 位置动态解析,不依赖任何写死的机器路径。
|
|
87
|
+
const kbRoot = KB_DIR.replaceAll('\\', '/')
|
|
81
88
|
for (const skill of loadSkills()) {
|
|
82
89
|
try {
|
|
83
90
|
disposers.push(ctx.skills.register({
|
|
@@ -85,7 +92,8 @@ export function apply(ctx, config) {
|
|
|
85
92
|
description: skill.description,
|
|
86
93
|
...(skill.whenToUse ? { whenToUse: skill.whenToUse } : {}),
|
|
87
94
|
source: 'runtime',
|
|
88
|
-
content: skill.body
|
|
95
|
+
content: skill.body.replaceAll('{{KB_ROOT}}', kbRoot),
|
|
96
|
+
resourceBase: { kind: 'directory', path: KB_DIR }
|
|
89
97
|
}))
|
|
90
98
|
state.skills.push(skill.name)
|
|
91
99
|
console.log(`[dsh-plugin-dev-kb] 技能已注册:${skill.name}`)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-dev-kb",
|
|
3
3
|
"description": "DeepSeek Harness (dsh) 插件开发知识库:官方文档站点的完整 Markdown 镜像(中英双语 168 页)+ 仓库补充文档(52 篇)+ 主题导航与搜索索引,以 dsh-plugin-dev-kb 技能形式让 agent 在插件开发任务中自动加载定位文档。纯数据插件,无运行时依赖。",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -9,7 +9,7 @@ whenToUse: 开发 dsh 插件、查询 dsh 能力与 API、写 Tool、配置 cord
|
|
|
9
9
|
|
|
10
10
|
## 0. 知识库位置
|
|
11
11
|
|
|
12
|
-
- **知识库根**:`
|
|
12
|
+
- **知识库根**:`{{KB_ROOT}}`(插件挂载时由 lib/index.js 自动替换为插件内 kb/ 目录的实际绝对路径,可直接 read/glob/grep;正斜杠路径,跨机器/安装位置始终有效)
|
|
13
13
|
- 数据来源:官方文档站点(VitePress)的仓库原始 Markdown,链接已按站点路由重写,与线上站点逐字一致(见 `kb/meta/source.json` 的 commit)
|
|
14
14
|
|
|
15
15
|
## 1. 目录结构
|