mcp-probe-kit 3.3.0 → 3.6.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/README.md +781 -765
- package/build/index.js +198 -191
- package/build/lib/__tests__/agents-md-template.unit.test.js +1 -0
- package/build/lib/__tests__/dev-workflow.unit.test.d.ts +1 -0
- package/build/lib/__tests__/dev-workflow.unit.test.js +22 -0
- package/build/lib/__tests__/handles.unit.test.d.ts +1 -0
- package/build/lib/__tests__/handles.unit.test.js +19 -0
- package/build/lib/__tests__/mcp-apps.unit.test.d.ts +1 -0
- package/build/lib/__tests__/mcp-apps.unit.test.js +52 -0
- package/build/lib/__tests__/mcp-tool-skill-registry.unit.test.d.ts +1 -0
- package/build/lib/__tests__/mcp-tool-skill-registry.unit.test.js +18 -0
- package/build/lib/__tests__/memory-client.unit.test.js +105 -0
- package/build/lib/__tests__/spec-gate.unit.test.d.ts +1 -0
- package/build/lib/__tests__/spec-gate.unit.test.js +54 -0
- package/build/lib/__tests__/task-defaults.unit.test.d.ts +1 -0
- package/build/lib/__tests__/task-defaults.unit.test.js +27 -0
- package/build/lib/__tests__/workflow-skill-installer.unit.test.d.ts +1 -0
- package/build/lib/__tests__/workflow-skill-installer.unit.test.js +110 -0
- package/build/lib/__tests__/workspace-root.unit.test.d.ts +1 -0
- package/build/lib/__tests__/workspace-root.unit.test.js +31 -0
- package/build/lib/agents-md-template.js +10 -2
- package/build/lib/dev-workflow.d.ts +36 -0
- package/build/lib/dev-workflow.js +497 -0
- package/build/lib/handles.d.ts +31 -0
- package/build/lib/handles.js +36 -0
- package/build/lib/mcp-apps.d.ts +14 -0
- package/build/lib/mcp-apps.js +234 -0
- package/build/lib/mcp-tool-skill-registry.d.ts +46 -0
- package/build/lib/mcp-tool-skill-registry.js +256 -0
- package/build/lib/memory-client.d.ts +19 -0
- package/build/lib/memory-client.js +69 -0
- package/build/lib/memory-orchestration.d.ts +5 -0
- package/build/lib/memory-orchestration.js +20 -0
- package/build/lib/merge-agents-md.d.ts +2 -2
- package/build/lib/merge-agents-md.js +7 -4
- package/build/lib/output-schema-registry.d.ts +11 -0
- package/build/lib/output-schema-registry.js +80 -0
- package/build/lib/spec-gate.d.ts +32 -0
- package/build/lib/spec-gate.js +83 -0
- package/build/lib/task-defaults.d.ts +6 -0
- package/build/lib/task-defaults.js +20 -0
- package/build/lib/tool-annotations.js +3 -0
- package/build/lib/toolset-manager.js +2 -0
- package/build/lib/workflow-skill-installer.d.ts +40 -0
- package/build/lib/workflow-skill-installer.js +172 -0
- package/build/lib/workflow-skill-template.d.ts +9 -0
- package/build/lib/workflow-skill-template.js +85 -0
- package/build/lib/workflow-skill-version.d.ts +15 -0
- package/build/lib/workflow-skill-version.js +68 -0
- package/build/lib/workspace-root.d.ts +4 -0
- package/build/lib/workspace-root.js +33 -0
- package/build/schemas/basic-tools.d.ts +4 -0
- package/build/schemas/basic-tools.js +4 -0
- package/build/schemas/index.d.ts +114 -0
- package/build/schemas/index.js +1 -0
- package/build/schemas/memory-tools.d.ts +83 -0
- package/build/schemas/memory-tools.js +43 -0
- package/build/schemas/orchestration-tools.d.ts +8 -0
- package/build/schemas/orchestration-tools.js +8 -0
- package/build/schemas/output/code-insight-tools.d.ts +65 -0
- package/build/schemas/output/code-insight-tools.js +42 -0
- package/build/schemas/output/memory-tools.d.ts +576 -0
- package/build/schemas/output/memory-tools.js +148 -0
- package/build/schemas/project-tools.d.ts +19 -0
- package/build/schemas/project-tools.js +20 -0
- package/build/tools/__tests__/delete_memory_asset.unit.test.d.ts +1 -0
- package/build/tools/__tests__/delete_memory_asset.unit.test.js +87 -0
- package/build/tools/__tests__/search_memory.unit.test.js +1 -0
- package/build/tools/__tests__/start_bugfix.unit.test.js +34 -1
- package/build/tools/__tests__/update_memory_asset.unit.test.d.ts +1 -0
- package/build/tools/__tests__/update_memory_asset.unit.test.js +82 -0
- package/build/tools/__tests__/workflow.unit.test.d.ts +1 -0
- package/build/tools/__tests__/workflow.unit.test.js +24 -0
- package/build/tools/code_insight.js +5 -1
- package/build/tools/delete_memory_asset.d.ts +7 -0
- package/build/tools/delete_memory_asset.js +57 -0
- package/build/tools/index.d.ts +3 -0
- package/build/tools/index.js +3 -0
- package/build/tools/init_project.js +170 -158
- package/build/tools/search_memory.js +5 -2
- package/build/tools/start_bugfix.js +37 -4
- package/build/tools/start_feature.js +4 -3
- package/build/tools/start_ui.js +5 -4
- package/build/tools/update_memory_asset.d.ts +7 -0
- package/build/tools/update_memory_asset.js +98 -0
- package/build/tools/workflow.d.ts +13 -0
- package/build/tools/workflow.js +69 -0
- package/package.json +5 -3
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { parseArgs, getString, getNumber } from '../utils/parseArgs.js';
|
|
2
|
+
import { okStructured } from '../lib/response.js';
|
|
3
|
+
import { createMemoryClient } from '../lib/memory-client.js';
|
|
4
|
+
import { handleToolError } from '../utils/error-handler.js';
|
|
5
|
+
import { attachHandles, buildMemoryAssetHandles } from '../lib/handles.js';
|
|
6
|
+
function fieldProvided(args, ...keys) {
|
|
7
|
+
const record = args?.input && typeof args.input === 'object' && !Array.isArray(args.input)
|
|
8
|
+
? { ...args, ...args.input }
|
|
9
|
+
: args;
|
|
10
|
+
if (!record || typeof record !== 'object' || Array.isArray(record)) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
return keys.some((key) => key in record && record[key] !== undefined && record[key] !== null);
|
|
14
|
+
}
|
|
15
|
+
export async function updateMemoryAsset(args) {
|
|
16
|
+
try {
|
|
17
|
+
const parsed = parseArgs(args, {
|
|
18
|
+
fieldAliases: {
|
|
19
|
+
code_snippet: ['code', 'snippet'],
|
|
20
|
+
file_path: ['path'],
|
|
21
|
+
source_project: ['project'],
|
|
22
|
+
source_path: ['source'],
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
const assetId = getString(parsed.asset_id);
|
|
26
|
+
if (!assetId) {
|
|
27
|
+
throw new Error('缺少必填参数: asset_id');
|
|
28
|
+
}
|
|
29
|
+
const patch = {};
|
|
30
|
+
if (fieldProvided(args, 'name')) {
|
|
31
|
+
patch.name = getString(parsed.name);
|
|
32
|
+
}
|
|
33
|
+
if (fieldProvided(args, 'type')) {
|
|
34
|
+
patch.type = getString(parsed.type);
|
|
35
|
+
}
|
|
36
|
+
if (fieldProvided(args, 'description')) {
|
|
37
|
+
patch.description = getString(parsed.description);
|
|
38
|
+
}
|
|
39
|
+
if (fieldProvided(args, 'summary')) {
|
|
40
|
+
patch.summary = getString(parsed.summary);
|
|
41
|
+
}
|
|
42
|
+
if (fieldProvided(args, 'content', 'code_snippet', 'code', 'snippet')) {
|
|
43
|
+
patch.content = getString(parsed.content) || getString(parsed.code_snippet);
|
|
44
|
+
}
|
|
45
|
+
if (fieldProvided(args, 'tags')) {
|
|
46
|
+
patch.tags = Array.isArray(parsed.tags)
|
|
47
|
+
? parsed.tags.filter((item) => typeof item === 'string')
|
|
48
|
+
: [];
|
|
49
|
+
}
|
|
50
|
+
if (fieldProvided(args, 'confidence')) {
|
|
51
|
+
patch.confidence = getNumber(parsed.confidence, 0.7);
|
|
52
|
+
}
|
|
53
|
+
if (fieldProvided(args, 'usage')) {
|
|
54
|
+
patch.usage = getString(parsed.usage);
|
|
55
|
+
}
|
|
56
|
+
if (fieldProvided(args, 'source_project', 'project')) {
|
|
57
|
+
patch.sourceProject = getString(parsed.source_project);
|
|
58
|
+
}
|
|
59
|
+
if (fieldProvided(args, 'source_path', 'source', 'file_path', 'path')) {
|
|
60
|
+
patch.sourcePath = getString(parsed.source_path) || getString(parsed.file_path);
|
|
61
|
+
}
|
|
62
|
+
if (Object.keys(patch).length === 0) {
|
|
63
|
+
throw new Error('至少提供一个待更新字段: name, type, description, summary, content, tags, confidence, usage 等');
|
|
64
|
+
}
|
|
65
|
+
const client = createMemoryClient();
|
|
66
|
+
if (!client.isEnabled()) {
|
|
67
|
+
return okStructured('记忆服务未开启,已跳过更新。', { enabled: false, updated: false, asset: null });
|
|
68
|
+
}
|
|
69
|
+
const warnings = [];
|
|
70
|
+
const nextType = patch.type;
|
|
71
|
+
const nextContent = patch.content;
|
|
72
|
+
if (nextType === 'bugfix' && nextContent) {
|
|
73
|
+
const requiredSections = ['【现象】', '【根因】', '【修复】'];
|
|
74
|
+
const missing = requiredSections.filter((section) => !nextContent.includes(section));
|
|
75
|
+
if (missing.length > 0) {
|
|
76
|
+
warnings.push(`建议 content 包含 ${missing.join('、')},便于跨仓库检索与复用`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (patch.sourceProject || patch.sourcePath) {
|
|
80
|
+
warnings.push('跨仓库共享记忆时请勿依赖 source_project/source_path;路径请写入 content 正文(可选)');
|
|
81
|
+
}
|
|
82
|
+
const { updated, asset } = await client.updateAsset(assetId, patch);
|
|
83
|
+
if (!updated || !asset) {
|
|
84
|
+
return okStructured(`未找到记忆资产: ${assetId}`, { enabled: true, updated: false, asset: null });
|
|
85
|
+
}
|
|
86
|
+
return okStructured(`已更新记忆资产: ${asset.name}`, attachHandles({
|
|
87
|
+
enabled: true,
|
|
88
|
+
updated: true,
|
|
89
|
+
asset,
|
|
90
|
+
warnings: warnings.length > 0 ? warnings : undefined,
|
|
91
|
+
}, {
|
|
92
|
+
memory_assets: buildMemoryAssetHandles([{ id: asset.id, name: asset.name, type: asset.type, summary: asset.summary }], 'update_memory_asset'),
|
|
93
|
+
}));
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
return handleToolError(error, 'update_memory_asset');
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* workflow — 开发工作流路由(只读指南)
|
|
3
|
+
*
|
|
4
|
+
* 根据用户意图生成「何时调哪个 MCP 工具」的分阶段计划,
|
|
5
|
+
* 用于约束 Agent 先走 start_* / code_insight / check_spec,而不是直接写代码。
|
|
6
|
+
*/
|
|
7
|
+
export declare function workflow(args: unknown): Promise<import("../lib/response.js").ToolResponse | {
|
|
8
|
+
content: Array<{
|
|
9
|
+
type: string;
|
|
10
|
+
text: string;
|
|
11
|
+
}>;
|
|
12
|
+
isError: true;
|
|
13
|
+
}>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { parseArgs, getString } from '../utils/parseArgs.js';
|
|
2
|
+
import { okStructured } from '../lib/response.js';
|
|
3
|
+
import { handleToolError } from '../utils/error-handler.js';
|
|
4
|
+
import { buildDevWorkflow, renderWorkflowMarkdown } from '../lib/dev-workflow.js';
|
|
5
|
+
import { ensureMcpProbeKitBootstrap } from '../lib/workflow-skill-installer.js';
|
|
6
|
+
import { resolveWorkspaceRoot } from '../lib/workspace-root.js';
|
|
7
|
+
/**
|
|
8
|
+
* workflow — 开发工作流路由(只读指南)
|
|
9
|
+
*
|
|
10
|
+
* 根据用户意图生成「何时调哪个 MCP 工具」的分阶段计划,
|
|
11
|
+
* 用于约束 Agent 先走 start_* / code_insight / check_spec,而不是直接写代码。
|
|
12
|
+
*/
|
|
13
|
+
export async function workflow(args) {
|
|
14
|
+
try {
|
|
15
|
+
const parsed = parseArgs(args, {
|
|
16
|
+
defaultValues: {
|
|
17
|
+
intent: '',
|
|
18
|
+
input: '',
|
|
19
|
+
scenario: 'auto',
|
|
20
|
+
description: '',
|
|
21
|
+
},
|
|
22
|
+
primaryField: 'intent',
|
|
23
|
+
fieldAliases: {
|
|
24
|
+
intent: ['input', 'description', 'goal', 'task', '需求', '目标', '描述'],
|
|
25
|
+
scenario: ['mode', 'type', '场景', '类型'],
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
const intent = getString(parsed.intent) ||
|
|
29
|
+
getString(parsed.input) ||
|
|
30
|
+
getString(parsed.description);
|
|
31
|
+
const scenario = getString(parsed.scenario) || 'auto';
|
|
32
|
+
const plan = buildDevWorkflow(intent, { scenario });
|
|
33
|
+
const text = renderWorkflowMarkdown(plan, intent);
|
|
34
|
+
const projectRoot = resolveWorkspaceRoot('');
|
|
35
|
+
const bootstrap = ensureMcpProbeKitBootstrap(projectRoot);
|
|
36
|
+
return okStructured(text, {
|
|
37
|
+
scenario: plan.scenario,
|
|
38
|
+
scenarioLabel: plan.scenarioLabel,
|
|
39
|
+
confidence: plan.confidence,
|
|
40
|
+
summary: plan.summary,
|
|
41
|
+
firstTool: plan.firstTool,
|
|
42
|
+
firstToolArgsHint: plan.firstToolArgsHint ?? null,
|
|
43
|
+
phases: plan.phases,
|
|
44
|
+
avoid: plan.avoid,
|
|
45
|
+
memoryNotes: plan.memoryNotes,
|
|
46
|
+
projectSkill: {
|
|
47
|
+
relPath: bootstrap.skill.skillRelPath,
|
|
48
|
+
existed: bootstrap.skill.existed,
|
|
49
|
+
created: bootstrap.skill.created,
|
|
50
|
+
updated: bootstrap.skill.updated,
|
|
51
|
+
version: bootstrap.skill.version,
|
|
52
|
+
previousVersion: bootstrap.skill.previousVersion,
|
|
53
|
+
},
|
|
54
|
+
agentsMd: {
|
|
55
|
+
path: bootstrap.agentsMd.path,
|
|
56
|
+
existed: bootstrap.agentsMd.existed,
|
|
57
|
+
created: bootstrap.agentsMd.created,
|
|
58
|
+
updated: bootstrap.agentsMd.updated,
|
|
59
|
+
},
|
|
60
|
+
handles: {
|
|
61
|
+
next_tool: plan.firstTool,
|
|
62
|
+
next_args: plan.firstToolArgsHint ?? {},
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
return handleToolError(error, 'workflow');
|
|
68
|
+
}
|
|
69
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-probe-kit",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "AI-Powered Development Toolkit - MCP Server with
|
|
3
|
+
"version": "3.6.1",
|
|
4
|
+
"description": "AI-Powered Development Toolkit - MCP Server with 30 tools covering code quality, development efficiency, project management, and UI/UX design. Features: Structured Output, Workflow Orchestration, MCP Skill auto-sync, UI/UX Pro Max, and Requirements Interview.",
|
|
5
5
|
"mcpName": "io.github.mybolide/mcp-probe-kit",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
@@ -21,7 +21,9 @@
|
|
|
21
21
|
"prepublishOnly": "npm run build",
|
|
22
22
|
"sync-ui-data": "tsx scripts/sync-ui-data.ts",
|
|
23
23
|
"sync-version": "node scripts/sync-version.mjs",
|
|
24
|
-
"
|
|
24
|
+
"verify-workflow-skill": "tsx scripts/verify-workflow-skill.ts",
|
|
25
|
+
"sync-workflow-skill": "tsx scripts/sync-workflow-skill.ts",
|
|
26
|
+
"prebuild": "npm run sync-version && npm run sync-ui-data && npm run verify-workflow-skill && npm run sync-workflow-skill",
|
|
25
27
|
"docs:serve": "npx http-server docs -p 8080 -o"
|
|
26
28
|
},
|
|
27
29
|
"keywords": [
|