dsh-plugin-aipp 0.1.0 → 0.1.1
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/CHANGELOG.md +8 -0
- package/README.md +4 -0
- package/cordis.patch.yml +9 -13
- package/launcher.mjs +21 -0
- package/package.json +1 -1
- package/presets/aipp-dsh-inventoryagent.patch.yml +2 -9
- package/server/index.js +23 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.1 - 2026-12-02
|
|
4
|
+
|
|
5
|
+
- 修复插件包层:MCP 服务器注册改为 server/index.js 官方自注册(ctx.mcpManager.register,路径由 import.meta.url 自身定位,零机器绝对路径);cordis.patch.yml 与 preset 不再直接/重复 insert dsh-mcp-client(重名会抛错、双进程)。
|
|
6
|
+
- 修复 Publisher KB 链路 4 处:kb_search 返回 dataclass 序列化(asdict);kb_ingest 先 commit 再解析(原恒 pending);kb.py 按 id 精确认领(原键名错恒不成立);kb_pipeline 无嵌入模型时按 KB_EMBEDDING_ENABLED=false 显式降级为无向量入库;kb_search 过滤零分候选。
|
|
7
|
+
- launcher.mjs:空库自检(data/m10agent.db 缺失或 0 表时 stderr 中文引导,不阻断宿主)。
|
|
8
|
+
- 兼容性:patch 与 preset 必须同时去 m10 声明(本次已同步);出参只增字段不删改。
|
|
9
|
+
|
|
3
10
|
## 0.1.0 - 2026-11-30
|
|
11
|
+
- 2026-11-30
|
|
4
12
|
|
|
5
13
|
- 首版发布。
|
|
6
14
|
- MCP stdio 挂载 M10 Publisher 14 工具(发布组 5 + 数据知识组 9),stdio 由 `launcher.mjs` 拉起。
|
package/README.md
CHANGED
package/cordis.patch.yml
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
# dsh-aipp patch
|
|
1
|
+
# dsh-aipp patch 层:把本包作为插件载入宿主,由 server/index.js 的 apply()
|
|
2
|
+
# 通过 ctx.mcpManager.register('m10', ...) 自注册 MCP stdio 服务器。
|
|
2
3
|
#
|
|
3
4
|
# 前置:本插件是 M10 Publisher(AI 工作发布台)的伴侣包——MCP 工具实际由
|
|
4
5
|
# Publisher 提供,需先完成 Publisher 前置安装(见 README「前置安装」,
|
|
5
6
|
# 或环境变量 M10_PUBLISHER_HOME 指向 Publisher 安装目录)。
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
7
|
+
# 设计:服务器注册路径由 server/index.js 以 import.meta.url 自身定位
|
|
8
|
+
# (join(pkgRoot, 'launcher.mjs')),仓库内不含任何机器绝对路径;
|
|
9
|
+
# 找不到 Publisher 时 launcher 输出中文引导并优雅退出,不拖垮宿主。
|
|
9
10
|
# 红线:patch env 只放非敏感项;数据源口令永不出 M10 侧 DPAPI(项目红线)。
|
|
10
|
-
#
|
|
11
|
+
# 注意:本文件不得再直接 insert @deepseek-ai/dsh-mcp-client(会与
|
|
12
|
+
# apply() 里的 register('m10') 重名抛错);presets 内层亦不得重复声明。
|
|
11
13
|
|
|
12
14
|
- insert:
|
|
13
|
-
- id: aipp
|
|
14
|
-
name: '
|
|
15
|
-
config:
|
|
16
|
-
serverName: m10
|
|
17
|
-
transport: stdio
|
|
18
|
-
command: 'node'
|
|
19
|
-
args: ['launcher.mjs']
|
|
20
|
-
toolCallTimeoutMs: 300000
|
|
15
|
+
- id: aipp
|
|
16
|
+
name: 'dsh-plugin-aipp'
|
package/launcher.mjs
CHANGED
|
@@ -79,6 +79,27 @@ const home = path.resolve(found.dir);
|
|
|
79
79
|
const pyExe = pythonExe(home);
|
|
80
80
|
const backendDir = path.join(home, 'backend');
|
|
81
81
|
|
|
82
|
+
// A4 空库自检:data/m10agent.db 缺失或 0 张表 → stderr 中文引导(不阻断宿主)
|
|
83
|
+
const dbFile = path.join(home, 'data', 'm10agent.db');
|
|
84
|
+
if (!existsSync(dbFile)) {
|
|
85
|
+
console.error(TAG + ' ⚠ Publisher 数据库尚未初始化(data/m10agent.db 不存在):');
|
|
86
|
+
console.error(TAG + ' 请先运行 ' + home + '\\scripts\\init_db.py(或重跑 install.ps1)。工具调用在初始化前将报错。');
|
|
87
|
+
} else {
|
|
88
|
+
const probe = spawn(pyExe, ['-c', "import sqlite3;print(len(sqlite3.connect(r'" + dbFile + "').execute('select name from sqlite_master').fetchall()))"], {
|
|
89
|
+
cwd: backendDir,
|
|
90
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
91
|
+
timeout: 5000,
|
|
92
|
+
});
|
|
93
|
+
probe.on('error', () => { /* probe failure is ignored */ });
|
|
94
|
+
probe.stdout.on('data', (chunk) => {
|
|
95
|
+
const tables = parseInt(String(chunk).trim(), 10);
|
|
96
|
+
if (!Number.isNaN(tables) && tables === 0) {
|
|
97
|
+
console.error(TAG + ' ⚠ Publisher 数据库尚未初始化(0 张表):');
|
|
98
|
+
console.error(TAG + ' 请先运行 scripts\\init_db.py。工具调用在初始化前将报错。');
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
82
103
|
console.error(TAG + ' M10 Publisher:' + home);
|
|
83
104
|
console.error(TAG + ' 拉起 MCP stdio 服务器(14 工具)…');
|
|
84
105
|
|
package/package.json
CHANGED
|
@@ -4,12 +4,5 @@
|
|
|
4
4
|
config:
|
|
5
5
|
id: aipp-dsh-inventoryagent
|
|
6
6
|
order: 100
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
name: '@deepseek-ai/dsh-mcp-client'
|
|
10
|
-
config:
|
|
11
|
-
serverName: m10
|
|
12
|
-
transport: stdio
|
|
13
|
-
command: 'node'
|
|
14
|
-
args: ['launcher.mjs']
|
|
15
|
-
toolCallTimeoutMs: 300000
|
|
7
|
+
# 注意:此 preset 不再内层声明 m10 MCP 服务器(全局唯一实例由
|
|
8
|
+
# server/index.js apply() 注册);preset 下的 agent 直接使用全局 m10 工具。
|
package/server/index.js
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export const
|
|
1
|
+
import { dirname, join } from 'node:path'
|
|
2
|
+
import { fileURLToPath } from 'node:url'
|
|
3
|
+
|
|
4
|
+
const pkgRoot = dirname(dirname(fileURLToPath(import.meta.url)))
|
|
5
|
+
|
|
6
|
+
export const name = 'dsh-plugin-aipp'
|
|
7
|
+
export const version = '0.1.1'
|
|
8
|
+
export const kind = 'mcp-stdio-mount'
|
|
9
|
+
export const inject = ['mcpManager']
|
|
10
|
+
|
|
11
|
+
export function apply(ctx) {
|
|
12
|
+
ctx.mcpManager.register('m10', {
|
|
13
|
+
transport: 'stdio',
|
|
14
|
+
command: 'node',
|
|
15
|
+
args: [join(pkgRoot, 'launcher.mjs')],
|
|
16
|
+
cwd: pkgRoot,
|
|
17
|
+
toolCallTimeoutMs: 300000,
|
|
18
|
+
})
|
|
19
|
+
}
|
|
20
|
+
|
|
7
21
|
export function describe() {
|
|
8
|
-
return {
|
|
9
|
-
name,
|
|
10
|
-
version,
|
|
11
|
-
kind,
|
|
12
|
-
launcher: "./launcher.mjs",
|
|
13
|
-
tools: 14,
|
|
14
|
-
requires: "M10 Publisher (set M10_PUBLISHER_HOME or run install.ps1)",
|
|
15
|
-
};
|
|
22
|
+
return { name, version, kind, launcher: './launcher.mjs', tools: 14 }
|
|
16
23
|
}
|
|
17
|
-
|
|
24
|
+
|
|
25
|
+
export default { name, version, kind, apply, describe }
|