@ppdocs/mcp 2.6.2 → 2.6.4
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/dist/tools/index.js +12 -5
- package/package.json +1 -1
package/dist/tools/index.js
CHANGED
|
@@ -11,7 +11,8 @@ export function registerTools(server, projectId, _user) {
|
|
|
11
11
|
dependencies: z.array(z.object({
|
|
12
12
|
name: z.string().describe('目标节点的signature'),
|
|
13
13
|
description: z.string().describe('依赖说明')
|
|
14
|
-
})).optional().describe('依赖列表(自动生成连线)')
|
|
14
|
+
})).optional().describe('依赖列表(自动生成连线)'),
|
|
15
|
+
relatedFiles: z.array(z.string()).optional().describe('关联的源文件路径数组,如 ["src/auth.ts"]')
|
|
15
16
|
}, async (args) => {
|
|
16
17
|
const node = await storage.createNode(projectId, {
|
|
17
18
|
title: args.title,
|
|
@@ -23,7 +24,8 @@ export function registerTools(server, projectId, _user) {
|
|
|
23
24
|
locked: false,
|
|
24
25
|
signature: args.signature || args.title,
|
|
25
26
|
categories: args.tags || [],
|
|
26
|
-
dependencies: args.dependencies || []
|
|
27
|
+
dependencies: args.dependencies || [],
|
|
28
|
+
relatedFiles: args.relatedFiles || []
|
|
27
29
|
});
|
|
28
30
|
return { content: [{ type: 'text', text: JSON.stringify(node, null, 2) }] };
|
|
29
31
|
});
|
|
@@ -43,11 +45,16 @@ export function registerTools(server, projectId, _user) {
|
|
|
43
45
|
dependencies: z.array(z.object({
|
|
44
46
|
name: z.string(),
|
|
45
47
|
description: z.string()
|
|
46
|
-
})).optional().describe('依赖列表')
|
|
48
|
+
})).optional().describe('依赖列表'),
|
|
49
|
+
relatedFiles: z.array(z.string()).optional().describe('关联的源文件路径数组')
|
|
47
50
|
}, async (args) => {
|
|
48
|
-
const { nodeId, tags, ...rest } = args;
|
|
51
|
+
const { nodeId, tags, relatedFiles, ...rest } = args;
|
|
49
52
|
// API 参数 tags 转换为内部字段 categories
|
|
50
|
-
|
|
53
|
+
let updates = { ...rest };
|
|
54
|
+
if (tags !== undefined)
|
|
55
|
+
updates.categories = tags;
|
|
56
|
+
if (relatedFiles !== undefined)
|
|
57
|
+
updates.relatedFiles = relatedFiles;
|
|
51
58
|
const node = await storage.updateNode(projectId, nodeId, updates);
|
|
52
59
|
return { content: [{ type: 'text', text: node ? JSON.stringify(node, null, 2) : '更新失败(节点不存在或已锁定)' }] };
|
|
53
60
|
});
|