mcp-probe-kit 3.0.16 → 3.0.17
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 +601 -399
- package/build/index.js +13 -1
- package/build/lib/__tests__/memory-client.unit.test.d.ts +1 -0
- package/build/lib/__tests__/memory-client.unit.test.js +83 -0
- package/build/lib/__tests__/memory-config.unit.test.d.ts +1 -0
- package/build/lib/__tests__/memory-config.unit.test.js +33 -0
- package/build/lib/cursor-history-client.d.ts +54 -0
- package/build/lib/cursor-history-client.js +240 -0
- package/build/lib/gitnexus-bridge.js +6 -8
- package/build/lib/memory-client.d.ts +61 -0
- package/build/lib/memory-client.js +293 -0
- package/build/lib/memory-config.d.ts +14 -0
- package/build/lib/memory-config.js +31 -0
- package/build/lib/memory-orchestration.d.ts +26 -0
- package/build/lib/memory-orchestration.js +65 -0
- package/build/lib/project-detector.js +6 -4
- package/build/lib/workspace-root.d.ts +12 -0
- package/build/lib/workspace-root.js +153 -0
- package/build/resources/ui-ux-data/metadata.json +1 -1
- package/build/schemas/code-analysis-tools.d.ts +1 -1
- package/build/schemas/code-analysis-tools.js +1 -1
- package/build/schemas/index.d.ts +198 -4
- package/build/schemas/index.js +2 -0
- package/build/schemas/memory-tools.d.ts +191 -0
- package/build/schemas/memory-tools.js +106 -0
- package/build/schemas/orchestration-tools.d.ts +3 -3
- package/build/schemas/orchestration-tools.js +3 -3
- package/build/schemas/ui-ux-schemas.d.ts +8 -0
- package/build/schemas/ui-ux-schemas.js +4 -0
- package/build/tools/__tests__/cursor-history.unit.test.d.ts +1 -0
- package/build/tools/__tests__/cursor-history.unit.test.js +87 -0
- package/build/tools/__tests__/memorize_asset.unit.test.d.ts +1 -0
- package/build/tools/__tests__/memorize_asset.unit.test.js +68 -0
- package/build/tools/code_insight.d.ts +20 -0
- package/build/tools/code_insight.js +15 -0
- package/build/tools/cursor_list_conversations.d.ts +7 -0
- package/build/tools/cursor_list_conversations.js +35 -0
- package/build/tools/cursor_read_conversation.d.ts +7 -0
- package/build/tools/cursor_read_conversation.js +36 -0
- package/build/tools/cursor_search_conversations.d.ts +7 -0
- package/build/tools/cursor_search_conversations.js +36 -0
- package/build/tools/index.d.ts +6 -0
- package/build/tools/index.js +7 -0
- package/build/tools/init_project_context.d.ts +20 -1
- package/build/tools/init_project_context.js +114 -99
- package/build/tools/memorize_asset.d.ts +7 -0
- package/build/tools/memorize_asset.js +66 -0
- package/build/tools/read_memory_asset.d.ts +7 -0
- package/build/tools/read_memory_asset.js +26 -0
- package/build/tools/scan_and_extract_patterns.d.ts +27 -0
- package/build/tools/scan_and_extract_patterns.js +346 -0
- package/build/tools/start_bugfix.d.ts +20 -0
- package/build/tools/start_bugfix.js +97 -69
- package/build/tools/start_feature.d.ts +20 -0
- package/build/tools/start_feature.js +61 -31
- package/build/tools/start_onboard.d.ts +20 -0
- package/build/tools/start_onboard.js +15 -0
- package/build/tools/start_ui.d.ts +20 -0
- package/build/tools/start_ui.js +66 -32
- package/docs/data/tools.js +472 -373
- package/docs/i18n/all-tools/en.json +38 -5
- package/docs/i18n/all-tools/ja.json +14 -4
- package/docs/i18n/all-tools/ko.json +13 -3
- package/docs/i18n/all-tools/zh-CN.json +38 -5
- package/docs/i18n/en.json +48 -10
- package/docs/i18n/ja.json +47 -9
- package/docs/i18n/ko.json +47 -9
- package/docs/i18n/zh-CN.json +48 -10
- package/docs/pages/all-tools.html +515 -515
- package/docs/pages/examples.html +661 -661
- package/docs/pages/getting-started.html +673 -582
- package/docs/pages/migration.html +291 -291
- package/package.json +83 -82
- package/docs/debug-i18n.html +0 -163
package/build/tools/start_ui.js
CHANGED
|
@@ -14,7 +14,9 @@ import { renderOrchestrationHeader } from "../lib/orchestration-guidance.js";
|
|
|
14
14
|
import { buildSkillBridgePlanStep, buildSkillHeaderNote, detectSkillBridge, renderSkillBridgeSection, } from "../lib/skill-bridge.js";
|
|
15
15
|
import { UIReportSchema, RequirementsLoopSchema } from "../schemas/structured-output.js";
|
|
16
16
|
import { detectProjectType } from "../lib/project-detector.js";
|
|
17
|
+
import { resolveWorkspaceRoot, isLikelyProjectNamedRelativePath, buildProjectRootRetryHint } from "../lib/workspace-root.js";
|
|
17
18
|
import { reportToolProgress, throwIfAborted, } from "../lib/tool-execution-context.js";
|
|
19
|
+
import { buildMemoryPlanStep, loadMemoryInjectionContext, renderMemoryGuideSection, } from "../lib/memory-orchestration.js";
|
|
18
20
|
function inferProductType(description) {
|
|
19
21
|
const text = (description || '').toLowerCase();
|
|
20
22
|
if (/电商|e-?commerce|shop|商城|购物/.test(text))
|
|
@@ -428,7 +430,49 @@ export async function startUi(args, context) {
|
|
|
428
430
|
try {
|
|
429
431
|
throwIfAborted(context?.signal, "start_ui 已取消");
|
|
430
432
|
await reportToolProgress(context, 10, "start_ui: 解析参数与检测项目框架");
|
|
431
|
-
|
|
433
|
+
// 智能参数解析
|
|
434
|
+
const parsedArgs = parseArgs(args, {
|
|
435
|
+
defaultValues: {
|
|
436
|
+
description: "",
|
|
437
|
+
framework: "html",
|
|
438
|
+
template: "",
|
|
439
|
+
mode: "manual",
|
|
440
|
+
template_profile: "auto",
|
|
441
|
+
requirements_mode: "steady",
|
|
442
|
+
loop_max_rounds: 2,
|
|
443
|
+
loop_question_budget: 5,
|
|
444
|
+
loop_assumption_cap: 3,
|
|
445
|
+
},
|
|
446
|
+
primaryField: "description",
|
|
447
|
+
fieldAliases: {
|
|
448
|
+
description: ["desc", "ui", "page", "需求", "描述"],
|
|
449
|
+
framework: ["stack", "lib", "框架"],
|
|
450
|
+
template: ["name", "模板名"],
|
|
451
|
+
project_root: ["projectRoot", "project_path", "projectPath", "root", "project_root", "path", "dir", "directory", "项目路径", "项目根目录"],
|
|
452
|
+
mode: ["模式"],
|
|
453
|
+
template_profile: ["profile", "template_profile", "模板档位", "模板模式"],
|
|
454
|
+
requirements_mode: ["requirements_mode", "loop", "需求模式"],
|
|
455
|
+
loop_max_rounds: ["max_rounds", "rounds", "最大轮次"],
|
|
456
|
+
loop_question_budget: ["question_budget", "问题数量", "问题预算"],
|
|
457
|
+
loop_assumption_cap: ["assumption_cap", "假设上限"],
|
|
458
|
+
},
|
|
459
|
+
});
|
|
460
|
+
const explicitProjectRoot = getString(parsedArgs.project_root);
|
|
461
|
+
if (isLikelyProjectNamedRelativePath(explicitProjectRoot)) {
|
|
462
|
+
return {
|
|
463
|
+
content: [{
|
|
464
|
+
type: "text",
|
|
465
|
+
text: `拒绝执行 UI 编排:project_root 不能传带项目名的半相对路径,例如 ${explicitProjectRoot}。请改为传项目根目录绝对路径。`,
|
|
466
|
+
}],
|
|
467
|
+
isError: true,
|
|
468
|
+
structuredContent: {
|
|
469
|
+
error_code: "INVALID_PROJECT_ROOT",
|
|
470
|
+
rejected_project_root: explicitProjectRoot,
|
|
471
|
+
retry_hint: buildProjectRootRetryHint(explicitProjectRoot),
|
|
472
|
+
},
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
const projectRoot = resolveWorkspaceRoot(explicitProjectRoot);
|
|
432
476
|
// 优先从 project-context.md 读取框架信息
|
|
433
477
|
let detectedFramework = 'html'; // 默认值
|
|
434
478
|
const contextFramework = getFrameworkFromContext(projectRoot);
|
|
@@ -461,32 +505,6 @@ export async function startUi(args, context) {
|
|
|
461
505
|
}
|
|
462
506
|
}
|
|
463
507
|
}
|
|
464
|
-
// 智能参数解析
|
|
465
|
-
const parsedArgs = parseArgs(args, {
|
|
466
|
-
defaultValues: {
|
|
467
|
-
description: "",
|
|
468
|
-
framework: detectedFramework, // 使用检测到的框架
|
|
469
|
-
template: "",
|
|
470
|
-
mode: "manual",
|
|
471
|
-
template_profile: "auto",
|
|
472
|
-
requirements_mode: "steady",
|
|
473
|
-
loop_max_rounds: 2,
|
|
474
|
-
loop_question_budget: 5,
|
|
475
|
-
loop_assumption_cap: 3,
|
|
476
|
-
},
|
|
477
|
-
primaryField: "description",
|
|
478
|
-
fieldAliases: {
|
|
479
|
-
description: ["desc", "ui", "page", "需求", "描述"],
|
|
480
|
-
framework: ["stack", "lib", "框架"],
|
|
481
|
-
template: ["name", "模板名"],
|
|
482
|
-
mode: ["模式"],
|
|
483
|
-
template_profile: ["profile", "template_profile", "模板档位", "模板模式"],
|
|
484
|
-
requirements_mode: ["requirements_mode", "loop", "需求模式"],
|
|
485
|
-
loop_max_rounds: ["max_rounds", "rounds", "最大轮次"],
|
|
486
|
-
loop_question_budget: ["question_budget", "问题数量", "问题预算"],
|
|
487
|
-
loop_assumption_cap: ["assumption_cap", "假设上限"],
|
|
488
|
-
},
|
|
489
|
-
});
|
|
490
508
|
const description = getString(parsedArgs.description);
|
|
491
509
|
const productType = inferProductType(description);
|
|
492
510
|
const framework = getString(parsedArgs.framework) || detectedFramework;
|
|
@@ -524,6 +542,8 @@ export async function startUi(args, context) {
|
|
|
524
542
|
const skillBridgeStep = buildSkillBridgePlanStep(skillBridge);
|
|
525
543
|
const skillBridgeSection = renderSkillBridgeSection(skillBridge);
|
|
526
544
|
headerNotes.push(buildSkillHeaderNote(skillBridge));
|
|
545
|
+
const memoryContext = await loadMemoryInjectionContext(description || templateName);
|
|
546
|
+
const memoryGuideSection = renderMemoryGuideSection(memoryContext);
|
|
527
547
|
// 验证 mode 参数
|
|
528
548
|
const validModes = ["auto", "manual"];
|
|
529
549
|
if (mode && !validModes.includes(mode)) {
|
|
@@ -658,6 +678,7 @@ start_ui <描述> --requirements_mode=loop
|
|
|
658
678
|
action: 'update_project_context',
|
|
659
679
|
outputs: ['docs/project-context.md'],
|
|
660
680
|
},
|
|
681
|
+
...(memoryContext.enabled ? [buildMemoryPlanStep()] : []),
|
|
661
682
|
],
|
|
662
683
|
};
|
|
663
684
|
const header = renderOrchestrationHeader({
|
|
@@ -667,7 +688,10 @@ start_ui <描述> --requirements_mode=loop
|
|
|
667
688
|
'按 Requirements Loop 规则提问并更新结构化输出',
|
|
668
689
|
'满足结束条件后按 delegated plan 执行 UI 计划',
|
|
669
690
|
],
|
|
670
|
-
notes:
|
|
691
|
+
notes: [
|
|
692
|
+
...headerNotes,
|
|
693
|
+
...(memoryContext.enabled ? ['记忆系统: 已启用,先复用历史 UI 资产,再决定是否沉淀本次结果'] : []),
|
|
694
|
+
],
|
|
671
695
|
});
|
|
672
696
|
const loopTemplate = profileDecision.resolved === 'strict'
|
|
673
697
|
? LOOP_PROMPT_TEMPLATE_STRICT
|
|
@@ -675,7 +699,8 @@ start_ui <描述> --requirements_mode=loop
|
|
|
675
699
|
const guide = header + skillBridgeSection + loopTemplate
|
|
676
700
|
.replace(/{description}/g, description)
|
|
677
701
|
.replace(/{question_budget}/g, String(questionBudget))
|
|
678
|
-
.replace(/{assumption_cap}/g, String(assumptionCap))
|
|
702
|
+
.replace(/{assumption_cap}/g, String(assumptionCap))
|
|
703
|
+
+ memoryGuideSection;
|
|
679
704
|
const loopReport = {
|
|
680
705
|
mode: 'loop',
|
|
681
706
|
round: 1,
|
|
@@ -869,6 +894,7 @@ ${recommendation.reasoning}
|
|
|
869
894
|
action: 'update_project_context',
|
|
870
895
|
outputs: ['docs/project-context.md'],
|
|
871
896
|
},
|
|
897
|
+
...(memoryContext.enabled ? [buildMemoryPlanStep()] : []),
|
|
872
898
|
],
|
|
873
899
|
};
|
|
874
900
|
const header = renderOrchestrationHeader({
|
|
@@ -878,9 +904,12 @@ ${recommendation.reasoning}
|
|
|
878
904
|
'按 delegated plan 顺序调用工具',
|
|
879
905
|
'生成设计系统、模板并渲染 UI 代码',
|
|
880
906
|
],
|
|
881
|
-
notes:
|
|
907
|
+
notes: [
|
|
908
|
+
...headerNotes,
|
|
909
|
+
...(memoryContext.enabled ? ['记忆系统: 已启用,必要时先读取相似历史 UI 资产'] : []),
|
|
910
|
+
],
|
|
882
911
|
});
|
|
883
|
-
const smartPlan = header + skillBridgeSection + (profileDecision.resolved === 'strict' ? smartPlanStrict : smartPlanGuided);
|
|
912
|
+
const smartPlan = header + skillBridgeSection + (profileDecision.resolved === 'strict' ? smartPlanStrict : smartPlanGuided) + memoryGuideSection;
|
|
884
913
|
// Create structured UI report for auto mode
|
|
885
914
|
const uiReport = {
|
|
886
915
|
summary: `智能 UI 开发:${description}`,
|
|
@@ -1006,7 +1035,10 @@ start_ui "设置页面" --framework=react
|
|
|
1006
1035
|
'按 delegated plan 顺序调用工具',
|
|
1007
1036
|
'生成设计系统、模板并渲染 UI 代码',
|
|
1008
1037
|
],
|
|
1009
|
-
notes:
|
|
1038
|
+
notes: [
|
|
1039
|
+
...headerNotes,
|
|
1040
|
+
...(memoryContext.enabled ? ['记忆系统: 已启用,必要时先读取相似历史 UI 资产'] : []),
|
|
1041
|
+
],
|
|
1010
1042
|
});
|
|
1011
1043
|
const baseTemplate = profileDecision.resolved === 'strict'
|
|
1012
1044
|
? PROMPT_TEMPLATE_STRICT
|
|
@@ -1016,6 +1048,7 @@ start_ui "设置页面" --framework=react
|
|
|
1016
1048
|
guide = safeReplace(guide, '{productType}', productType);
|
|
1017
1049
|
guide = safeReplace(guide, '{framework}', framework);
|
|
1018
1050
|
guide = safeReplace(guide, '{templateName}', templateName);
|
|
1051
|
+
guide += memoryGuideSection;
|
|
1019
1052
|
const plan = {
|
|
1020
1053
|
mode: 'delegated',
|
|
1021
1054
|
steps: [
|
|
@@ -1072,6 +1105,7 @@ start_ui "设置页面" --framework=react
|
|
|
1072
1105
|
action: 'update_project_context',
|
|
1073
1106
|
outputs: ['docs/project-context.md'],
|
|
1074
1107
|
},
|
|
1108
|
+
...(memoryContext.enabled ? [buildMemoryPlanStep()] : []),
|
|
1075
1109
|
],
|
|
1076
1110
|
};
|
|
1077
1111
|
// Create structured UI report for manual mode
|