mta-mcp 3.8.0 → 3.9.0

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/index.js CHANGED
@@ -5890,13 +5890,496 @@ async function sequentialThinking(args) {
5890
5890
  };
5891
5891
  }
5892
5892
 
5893
+ // src/core/skillRegistry.ts
5894
+ var SkillRegistry = class {
5895
+ constructor() {
5896
+ this.skills = /* @__PURE__ */ new Map();
5897
+ }
5898
+ /**
5899
+ * 注册一个 skill
5900
+ */
5901
+ register(skill) {
5902
+ if (this.skills.has(skill.name)) {
5903
+ throw new Error(`Skill "${skill.name}" \u5DF2\u6CE8\u518C\uFF0C\u4E0D\u5141\u8BB8\u91CD\u590D\u6CE8\u518C`);
5904
+ }
5905
+ this.skills.set(skill.name, skill);
5906
+ }
5907
+ /**
5908
+ * 批量注册
5909
+ */
5910
+ registerAll(skills) {
5911
+ for (const skill of skills) {
5912
+ this.register(skill);
5913
+ }
5914
+ }
5915
+ /**
5916
+ * 获取指定 skill
5917
+ */
5918
+ get(name) {
5919
+ return this.skills.get(name);
5920
+ }
5921
+ /**
5922
+ * 获取所有 skill 名称(枚举值列表)
5923
+ */
5924
+ getSkillNames() {
5925
+ return Array.from(this.skills.keys());
5926
+ }
5927
+ /**
5928
+ * 按分类获取 skill 列表
5929
+ */
5930
+ getByCategory(category) {
5931
+ return Array.from(this.skills.values()).filter((s) => s.category === category);
5932
+ }
5933
+ /**
5934
+ * 获取全部 skill 定义
5935
+ */
5936
+ getAll() {
5937
+ return Array.from(this.skills.values());
5938
+ }
5939
+ /**
5940
+ * 生成 mta 统一工具的 description 文本
5941
+ *
5942
+ * 按分类输出所有 skill 的名称和说明,供 AI 阅读后选择。
5943
+ * 格式紧凑,控制 token 消耗。
5944
+ */
5945
+ generateToolDescription() {
5946
+ const categories = {
5947
+ standards: "\u89C4\u8303\u83B7\u53D6",
5948
+ project: "\u9879\u76EE\u5206\u6790\u4E0E\u914D\u7F6E",
5949
+ templates: "\u6A21\u677F\u7CFB\u7EDF",
5950
+ clone: "\u9879\u76EE\u514B\u9686",
5951
+ troubleshoot: "\u95EE\u9898\u8BCA\u65AD",
5952
+ agents: "Agent \u7BA1\u7406"
5953
+ };
5954
+ const lines = [
5955
+ "MTA \u667A\u80FD\u7F16\u7801\u52A9\u624B - \u7EDF\u4E00\u6280\u80FD\u5165\u53E3\u3002",
5956
+ "\u901A\u8FC7 skill \u53C2\u6570\u9009\u62E9\u8981\u6267\u884C\u7684\u6280\u80FD\uFF0Cparams \u4F20\u5165\u8BE5\u6280\u80FD\u6240\u9700\u53C2\u6570\u3002",
5957
+ "",
5958
+ "\u53EF\u7528\u6280\u80FD\uFF1A"
5959
+ ];
5960
+ for (const [cat, label] of Object.entries(categories)) {
5961
+ const skills = this.getByCategory(cat);
5962
+ if (skills.length === 0) continue;
5963
+ lines.push(`
5964
+ [${label}]`);
5965
+ for (const skill of skills) {
5966
+ const paramStr = skill.paramHints.length > 0 ? " | \u53C2\u6570: " + skill.paramHints.map((p) => p.required ? `${p.name}(\u5FC5\u586B)` : p.name).join(", ") : "";
5967
+ lines.push(` ${skill.name} - ${skill.description}${paramStr}`);
5968
+ }
5969
+ }
5970
+ return lines.join("\n");
5971
+ }
5972
+ /**
5973
+ * 生成 mta 统一工具的 JSON Schema(inputSchema)
5974
+ */
5975
+ generateInputSchema() {
5976
+ return {
5977
+ type: "object",
5978
+ properties: {
5979
+ skill: {
5980
+ type: "string",
5981
+ enum: this.getSkillNames(),
5982
+ description: "\u8981\u6267\u884C\u7684\u6280\u80FD\u540D\u79F0"
5983
+ },
5984
+ params: {
5985
+ type: "object",
5986
+ description: "\u8BE5\u6280\u80FD\u6240\u9700\u7684\u53C2\u6570\uFF08\u53C2\u89C1\u5DE5\u5177\u63CF\u8FF0\u4E2D\u5404\u6280\u80FD\u7684\u53C2\u6570\u8BF4\u660E\uFF09",
5987
+ additionalProperties: true
5988
+ }
5989
+ },
5990
+ required: ["skill"]
5991
+ };
5992
+ }
5993
+ /**
5994
+ * 执行一个 skill
5995
+ */
5996
+ async execute(skillName, params) {
5997
+ const skill = this.skills.get(skillName);
5998
+ if (!skill) {
5999
+ const available = this.getSkillNames().join(", ");
6000
+ return {
6001
+ content: [{
6002
+ type: "text",
6003
+ text: JSON.stringify({
6004
+ error: `\u672A\u77E5\u6280\u80FD: ${skillName}`,
6005
+ availableSkills: available,
6006
+ hint: "\u8BF7\u4ECE\u53EF\u7528\u6280\u80FD\u5217\u8868\u4E2D\u9009\u62E9\u4E00\u4E2A\u6709\u6548\u7684 skill \u540D\u79F0"
6007
+ }, null, 2)
6008
+ }]
6009
+ };
6010
+ }
6011
+ return skill.handler(params);
6012
+ }
6013
+ /**
6014
+ * 获取注册统计
6015
+ */
6016
+ getStats() {
6017
+ const byCategory = {};
6018
+ for (const skill of this.skills.values()) {
6019
+ byCategory[skill.category] = (byCategory[skill.category] || 0) + 1;
6020
+ }
6021
+ return { total: this.skills.size, byCategory };
6022
+ }
6023
+ };
6024
+ var globalRegistry = null;
6025
+ function getSkillRegistry() {
6026
+ if (!globalRegistry) {
6027
+ globalRegistry = new SkillRegistry();
6028
+ }
6029
+ return globalRegistry;
6030
+ }
6031
+
6032
+ // src/tools/skillDefinitions.ts
6033
+ function wrapAsContent(data) {
6034
+ return {
6035
+ content: [{
6036
+ type: "text",
6037
+ text: JSON.stringify(data, null, 2)
6038
+ }]
6039
+ };
6040
+ }
6041
+ var skillDefinitions = [
6042
+ // ==================== 规范获取类 ====================
6043
+ {
6044
+ name: "get_standards",
6045
+ category: "standards",
6046
+ description: "\u667A\u80FD\u83B7\u53D6\u7F16\u7801\u89C4\u8303\u3002\u652F\u6301\u6309\u9879\u76EE\u8DEF\u5F84\u81EA\u52A8\u5206\u6790\u3001\u6309 ID \u7CBE\u786E\u83B7\u53D6\u3001\u6309\u9884\u8BBE\u573A\u666F\u83B7\u53D6\u4E09\u79CD\u6A21\u5F0F",
6047
+ paramHints: [
6048
+ { name: "id", type: "string", description: "\u89C4\u8303 ID\uFF08\u5982 vue3-composition, flutter\uFF09- \u6309 ID \u83B7\u53D6\u65F6\u4F7F\u7528" },
6049
+ { name: "ids", type: "string[]", description: "\u6279\u91CF\u89C4\u8303 ID \u5217\u8868" },
6050
+ { name: "preset", type: "string", description: "\u9884\u8BBE\u573A\u666F\uFF08\u5982 vue3-component, api-call\uFF09- \u6309\u573A\u666F\u83B7\u53D6\u65F6\u4F7F\u7528" },
6051
+ { name: "currentFile", type: "string", description: "\u5F53\u524D\u6587\u4EF6\u8DEF\u5F84 - \u667A\u80FD\u6A21\u5F0F\u81EA\u52A8\u5206\u6790" },
6052
+ { name: "fileContent", type: "string", description: "\u6587\u4EF6\u5185\u5BB9 - \u667A\u80FD\u6A21\u5F0F\u81EA\u52A8\u5206\u6790" },
6053
+ { name: "projectPath", type: "string", description: "\u9879\u76EE\u6839\u8DEF\u5F84 - \u667A\u80FD\u6A21\u5F0F\u81EA\u52A8\u5206\u6790\u9879\u76EE\u6280\u672F\u6808" },
6054
+ { name: "scenario", type: "string", description: "\u5F00\u53D1\u573A\u666F" },
6055
+ { name: "customImports", type: "string[]", description: "\u9884\u8BBE\u6A21\u5F0F\u4E0B\u7684\u989D\u5916\u5BFC\u5165" },
6056
+ { name: "mode", type: "string", description: "\u8FD4\u56DE\u6A21\u5F0F: summary/key-rules(\u9ED8\u8BA4)/full" }
6057
+ ],
6058
+ handler: async (params) => {
6059
+ if (params.preset) {
6060
+ return usePreset({
6061
+ preset: params.preset,
6062
+ customImports: params.customImports
6063
+ });
6064
+ }
6065
+ if (params.id || params.ids) {
6066
+ return getStandardById({
6067
+ id: params.id,
6068
+ ids: params.ids,
6069
+ mode: params.mode
6070
+ });
6071
+ }
6072
+ return getCompactStandards({
6073
+ currentFile: params.currentFile,
6074
+ fileContent: params.fileContent,
6075
+ scenario: params.scenario,
6076
+ projectPath: params.projectPath,
6077
+ mode: params.mode
6078
+ });
6079
+ }
6080
+ },
6081
+ {
6082
+ name: "list_standards",
6083
+ category: "standards",
6084
+ description: "\u5217\u51FA\u53EF\u7528\u7684\u89C4\u8303\u4FE1\u606F\u3002\u652F\u6301\u5217\u51FA\u9884\u8BBE\u573A\u666F\u3001\u573A\u666F\u5217\u8868\u3001\u573A\u666F-\u89C4\u8303\u6620\u5C04\u5173\u7CFB",
6085
+ paramHints: [
6086
+ { name: "what", type: "string", description: "\u67E5\u8BE2\u7C7B\u578B: presets(\u9884\u8BBE\u5217\u8868) / scenarios(\u573A\u666F\u5217\u8868) / mappings(\u6620\u5C04\u5173\u7CFB)", required: true },
6087
+ { name: "scenario", type: "string", description: "\u6620\u5C04\u67E5\u8BE2\uFF1A\u6309\u573A\u666F\u540D\u79F0" },
6088
+ { name: "fileType", type: "string", description: "\u6620\u5C04\u67E5\u8BE2\uFF1A\u6309\u6587\u4EF6\u7C7B\u578B" },
6089
+ { name: "imports", type: "string[]", description: "\u6620\u5C04\u67E5\u8BE2\uFF1A\u6309\u5BFC\u5165\u5305" },
6090
+ { name: "listAll", type: "boolean", description: "\u6620\u5C04\u67E5\u8BE2\uFF1A\u5217\u51FA\u6240\u6709\u6620\u5C04" }
6091
+ ],
6092
+ handler: async (params) => {
6093
+ const what = params.what || "presets";
6094
+ switch (what) {
6095
+ case "presets":
6096
+ return listPresets();
6097
+ case "scenarios":
6098
+ return listScenarios();
6099
+ case "mappings":
6100
+ return queryMappings({
6101
+ scenario: params.scenario,
6102
+ fileType: params.fileType,
6103
+ imports: params.imports,
6104
+ listAll: params.listAll
6105
+ });
6106
+ default:
6107
+ return listPresets();
6108
+ }
6109
+ }
6110
+ },
6111
+ // ==================== 项目分析与配置类 ====================
6112
+ {
6113
+ name: "analyze_project",
6114
+ category: "project",
6115
+ description: "\u5206\u6790\u9879\u76EE\u6280\u672F\u6808\u3001\u6846\u67B6\u3001\u5DE5\u5177\u548C\u7279\u5F81",
6116
+ paramHints: [
6117
+ { name: "projectPath", type: "string", description: "\u9879\u76EE\u7EDD\u5BF9\u8DEF\u5F84\uFF08\u53EF\u9009\uFF0C\u9ED8\u8BA4\u5F53\u524D\u76EE\u5F55\uFF09" }
6118
+ ],
6119
+ handler: async (params) => {
6120
+ return analyzeProject({ projectPath: params.projectPath });
6121
+ }
6122
+ },
6123
+ {
6124
+ name: "setup_project",
6125
+ category: "project",
6126
+ description: "\u9879\u76EE\u914D\u7F6E\u7BA1\u7406\u3002\u652F\u6301\u81EA\u52A8\u68C0\u6D4B\u5E76\u751F\u6210\u914D\u7F6E\u3001\u5FEB\u901F\u521D\u59CB\u5316\u3001\u751F\u6210 copilot-instructions.md",
6127
+ paramHints: [
6128
+ { name: "action", type: "string", description: "\u64CD\u4F5C\u7C7B\u578B: auto_setup(\u81EA\u52A8\u914D\u7F6E) / init(\u5FEB\u901F\u521D\u59CB\u5316) / generate(\u751F\u6210\u914D\u7F6E)", required: true },
6129
+ { name: "projectPath", type: "string", description: "\u9879\u76EE\u7EDD\u5BF9\u8DEF\u5F84" },
6130
+ { name: "workspacePath", type: "string", description: "\u5DE5\u4F5C\u533A\u8DEF\u5F84\uFF08auto_setup \u65F6\u4F7F\u7528\uFF09" },
6131
+ { name: "generateInstructions", type: "boolean", description: "\u662F\u5426\u751F\u6210 copilot-instructions.md" },
6132
+ { name: "agentIds", type: "string[]", description: "\u6307\u5B9A Agent ID \u5217\u8868\uFF08generate \u65F6\u4F7F\u7528\uFF09" },
6133
+ { name: "autoMatch", type: "boolean", description: "\u81EA\u52A8\u5339\u914D Agents\uFF08generate \u65F6\u4F7F\u7528\uFF09" },
6134
+ { name: "updateMode", type: "string", description: "merge(\u4FDD\u7559\u81EA\u5B9A\u4E49) / overwrite(\u8986\u76D6)" },
6135
+ { name: "configId", type: "string", description: "\u914D\u7F6E\u65B9\u6848 ID" }
6136
+ ],
6137
+ handler: async (params) => {
6138
+ const action = params.action || "auto_setup";
6139
+ switch (action) {
6140
+ case "init":
6141
+ return initProject({ projectPath: params.projectPath });
6142
+ case "generate": {
6143
+ const projectPath = params.projectPath;
6144
+ if (!projectPath) {
6145
+ throw new Error("generate \u64CD\u4F5C\u9700\u8981 projectPath \u53C2\u6570");
6146
+ }
6147
+ return generateConfig({
6148
+ projectPath,
6149
+ agentIds: params.agentIds,
6150
+ autoMatch: params.autoMatch,
6151
+ updateMode: params.updateMode,
6152
+ configId: params.configId
6153
+ });
6154
+ }
6155
+ case "auto_setup":
6156
+ default:
6157
+ return autoSetup({
6158
+ workspacePath: params.workspacePath || params.projectPath,
6159
+ generateInstructions: params.generateInstructions
6160
+ });
6161
+ }
6162
+ }
6163
+ },
6164
+ {
6165
+ name: "health_check",
6166
+ category: "project",
6167
+ description: "\u68C0\u67E5 MCP \u670D\u52A1\u5668\u72B6\u6001\u548C\u914D\u7F6E\u95EE\u9898\uFF0C\u8FD4\u56DE\u8BCA\u65AD\u62A5\u544A\u548C\u4FEE\u590D\u5EFA\u8BAE",
6168
+ paramHints: [
6169
+ { name: "workspacePath", type: "string", description: "\u5DE5\u4F5C\u533A\u8DEF\u5F84" },
6170
+ { name: "verbose", type: "boolean", description: "\u663E\u793A\u8BE6\u7EC6\u4FE1\u606F" }
6171
+ ],
6172
+ handler: async (params) => {
6173
+ return healthCheck({
6174
+ workspacePath: params.workspacePath,
6175
+ verbose: params.verbose
6176
+ });
6177
+ }
6178
+ },
6179
+ // ==================== Agent 管理类 ====================
6180
+ {
6181
+ name: "manage_agents",
6182
+ category: "agents",
6183
+ description: "\u7BA1\u7406 Copilot Agents\u3002\u652F\u6301\u5217\u51FA\u6240\u6709\u53EF\u7528 Agent \u6216\u6309\u9879\u76EE\u7279\u5F81\u5339\u914D\u63A8\u8350",
6184
+ paramHints: [
6185
+ { name: "action", type: "string", description: "\u64CD\u4F5C: list(\u5217\u51FA\u5168\u90E8) / match(\u6309\u7279\u5F81\u5339\u914D)", required: true },
6186
+ { name: "projectFeatures", type: "object", description: "\u9879\u76EE\u7279\u5F81\uFF08match \u65F6\u4F7F\u7528\uFF0C\u542B frameworks/languages/tools/keywords/projectType\uFF09" },
6187
+ { name: "limit", type: "number", description: "\u6700\u5927\u8FD4\u56DE\u6570\u91CF\uFF08match \u65F6\u4F7F\u7528\uFF09" }
6188
+ ],
6189
+ handler: async (params) => {
6190
+ const action = params.action || "list";
6191
+ if (action === "match" && params.projectFeatures) {
6192
+ return matchAgents({
6193
+ projectFeatures: params.projectFeatures,
6194
+ limit: params.limit
6195
+ });
6196
+ }
6197
+ return wrapAsContent(listAvailableAgents());
6198
+ }
6199
+ },
6200
+ // ==================== 模板系统类 ====================
6201
+ {
6202
+ name: "get_template",
6203
+ category: "templates",
6204
+ description: "\u83B7\u53D6\u4EE3\u7801\u6A21\u677F\u3002\u652F\u6301\u5217\u51FA\u6A21\u677F\u5217\u8868\u6216\u83B7\u53D6\u6307\u5B9A\u6A21\u677F\u8BE6\u60C5\u548C\u6587\u4EF6\u5185\u5BB9",
6205
+ paramHints: [
6206
+ { name: "action", type: "string", description: "\u64CD\u4F5C: list(\u5217\u51FA\u6A21\u677F) / get(\u83B7\u53D6\u6A21\u677F\u8BE6\u60C5)", required: true },
6207
+ { name: "id", type: "string", description: "\u6A21\u677F ID\uFF08get \u65F6\u5FC5\u586B\uFF09" },
6208
+ { name: "includeFiles", type: "boolean", description: "\u662F\u5426\u5305\u542B\u6587\u4EF6\u5185\u5BB9" },
6209
+ { name: "files", type: "string[]", description: "\u6307\u5B9A\u8981\u83B7\u53D6\u7684\u6587\u4EF6\u5217\u8868" },
6210
+ { name: "type", type: "string", description: "\u6309\u7C7B\u578B\u7B5B\u9009\uFF08list \u65F6\u4F7F\u7528\uFF09" },
6211
+ { name: "framework", type: "string", description: "\u6309\u6846\u67B6\u7B5B\u9009\uFF08list \u65F6\u4F7F\u7528\uFF09" },
6212
+ { name: "search", type: "string", description: "\u641C\u7D22\u5173\u952E\u8BCD\uFF08list \u65F6\u4F7F\u7528\uFF09" }
6213
+ ],
6214
+ handler: async (params) => {
6215
+ const action = params.action || "list";
6216
+ if (action === "get") {
6217
+ const id = params.id;
6218
+ if (!id) {
6219
+ throw new Error("get \u64CD\u4F5C\u9700\u8981 id \u53C2\u6570");
6220
+ }
6221
+ return getTemplate({
6222
+ id,
6223
+ includeFiles: params.includeFiles,
6224
+ files: params.files
6225
+ });
6226
+ }
6227
+ return listTemplates({
6228
+ type: params.type,
6229
+ framework: params.framework
6230
+ });
6231
+ }
6232
+ },
6233
+ // ==================== 项目克隆类 ====================
6234
+ {
6235
+ name: "clone_analyze",
6236
+ category: "clone",
6237
+ description: "\u6DF1\u5EA6\u5206\u6790\u53C2\u8003\u9879\u76EE\u7684\u6280\u672F\u6808\u548C\u67B6\u6784\uFF0C\u7528\u4E8E\u521B\u5EFA\u98CE\u683C\u4E00\u81F4\u7684\u65B0\u9879\u76EE",
6238
+ paramHints: [
6239
+ { name: "projectPath", type: "string", required: true, description: "\u53C2\u8003\u9879\u76EE\u7684\u7EDD\u5BF9\u8DEF\u5F84" },
6240
+ { name: "generateDocs", type: "boolean", description: "\u662F\u5426\u751F\u6210\u5206\u6790\u6587\u6863" },
6241
+ { name: "newProjectName", type: "string", description: "\u65B0\u9879\u76EE\u540D\u79F0" },
6242
+ { name: "newProjectPath", type: "string", description: "\u65B0\u9879\u76EE\u8DEF\u5F84" }
6243
+ ],
6244
+ handler: async (params) => {
6245
+ const projectPath = params.projectPath;
6246
+ if (!projectPath) {
6247
+ throw new Error("clone_analyze \u9700\u8981 projectPath \u53C2\u6570");
6248
+ }
6249
+ return analyzeReferenceProject({
6250
+ projectPath,
6251
+ generateDocs: params.generateDocs,
6252
+ newProjectName: params.newProjectName,
6253
+ newProjectPath: params.newProjectPath
6254
+ });
6255
+ }
6256
+ },
6257
+ {
6258
+ name: "clone_generate",
6259
+ category: "clone",
6260
+ description: "\u57FA\u4E8E\u53C2\u8003\u9879\u76EE\u5206\u6790\u7ED3\u679C\u751F\u6210\u65B0\u9879\u76EE\u9AA8\u67B6\uFF0C\u5305\u542B\u5206\u6790\u6587\u6863\u3001\u5F00\u53D1\u8BA1\u5212\u548C\u9AA8\u67B6\u6E05\u5355",
6261
+ paramHints: [
6262
+ { name: "referenceProjectPath", type: "string", required: true, description: "\u53C2\u8003\u9879\u76EE\u7EDD\u5BF9\u8DEF\u5F84" },
6263
+ { name: "newProjectPath", type: "string", required: true, description: "\u65B0\u9879\u76EE\u7EDD\u5BF9\u8DEF\u5F84" },
6264
+ { name: "newProjectName", type: "string", required: true, description: "\u65B0\u9879\u76EE\u540D\u79F0" },
6265
+ { name: "generateDocs", type: "boolean", description: "\u662F\u5426\u751F\u6210\u5206\u6790\u6587\u6863" },
6266
+ { name: "includeLayers", type: "string[]", description: "\u8981\u5305\u542B\u7684\u5C42\u7EA7" },
6267
+ { name: "excludePatterns", type: "string[]", description: "\u8981\u6392\u9664\u7684\u6587\u4EF6\u6A21\u5F0F" }
6268
+ ],
6269
+ handler: async (params) => {
6270
+ const refPath = params.referenceProjectPath;
6271
+ const newPath = params.newProjectPath;
6272
+ const newName = params.newProjectName;
6273
+ if (!refPath || !newPath || !newName) {
6274
+ throw new Error("clone_generate \u9700\u8981 referenceProjectPath, newProjectPath, newProjectName \u53C2\u6570");
6275
+ }
6276
+ return generateProjectSkeleton({
6277
+ referenceProjectPath: refPath,
6278
+ newProjectPath: newPath,
6279
+ newProjectName: newName,
6280
+ generateDocs: params.generateDocs,
6281
+ includeLayers: params.includeLayers,
6282
+ excludePatterns: params.excludePatterns
6283
+ });
6284
+ }
6285
+ },
6286
+ // ==================== 问题诊断类 ====================
6287
+ {
6288
+ name: "troubleshoot",
6289
+ category: "troubleshoot",
6290
+ description: "\u95EE\u9898\u8BCA\u65AD\u5165\u53E3\u3002\u76F4\u63A5\u4F20\u5165\u95EE\u9898\u63CF\u8FF0\uFF0C\u81EA\u52A8\u8BC6\u522B\u6846\u67B6\u3001\u63D0\u53D6\u5173\u952E\u8BCD\u3001\u5339\u914D\u89E3\u51B3\u65B9\u6848",
6291
+ paramHints: [
6292
+ { name: "problem", type: "string", required: true, description: "\u95EE\u9898\u63CF\u8FF0\uFF08\u7528\u6237\u8BF4\u7684\u8BDD\u6216\u9519\u8BEF\u4FE1\u606F\uFF09" },
6293
+ { name: "framework", type: "string", description: "\u6846\u67B6\u7C7B\u578B: flutter/vue3/react\uFF08\u53EF\u9009\uFF0C\u4F1A\u81EA\u52A8\u68C0\u6D4B\uFF09" },
6294
+ { name: "codeSnippet", type: "string", description: "\u76F8\u5173\u4EE3\u7801\u7247\u6BB5" }
6295
+ ],
6296
+ handler: async (params) => {
6297
+ const problemText = params.problem || "";
6298
+ let detectedFramework = params.framework;
6299
+ if (!detectedFramework) {
6300
+ if (problemText.toLowerCase().includes("flutter") || problemText.includes("Widget") || problemText.includes("BoxShadow") || problemText.includes("Dart")) {
6301
+ detectedFramework = "flutter";
6302
+ } else if (problemText.toLowerCase().includes("vue") || problemText.includes("Element") || problemText.includes("el-")) {
6303
+ detectedFramework = "vue3";
6304
+ } else if (problemText.toLowerCase().includes("react")) {
6305
+ detectedFramework = "react";
6306
+ }
6307
+ }
6308
+ const extractedKeywords = [];
6309
+ const keywordPatterns = [
6310
+ /\b(shadow|阴影|透出|transparency|clip|裁剪|layout|布局|animation|动画|color|颜色|border|边框|svg|icon|图标|input|输入|button|按钮|table|表格|form|表单|style|样式)\b/gi
6311
+ ];
6312
+ for (const pattern of keywordPatterns) {
6313
+ const matches = problemText.match(pattern);
6314
+ if (matches) {
6315
+ extractedKeywords.push(...matches.map((m) => m.toLowerCase()));
6316
+ }
6317
+ }
6318
+ const uniqueKeywords = [...new Set(extractedKeywords)];
6319
+ return wrapAsContent(await queryTroubleshootingCases({
6320
+ framework: detectedFramework,
6321
+ keywords: uniqueKeywords.length > 0 ? uniqueKeywords : void 0,
6322
+ errorMessage: problemText,
6323
+ limit: 5
6324
+ }));
6325
+ }
6326
+ },
6327
+ {
6328
+ name: "query_cases",
6329
+ category: "troubleshoot",
6330
+ description: "\u67E5\u8BE2\u6545\u969C\u6392\u9664\u6848\u4F8B\u3002\u652F\u6301\u6309\u6846\u67B6/\u5173\u952E\u8BCD\u7CBE\u786E\u67E5\u8BE2\u3001\u83B7\u53D6\u5355\u4E2A\u6848\u4F8B\u5B8C\u6574\u5185\u5BB9\u3001\u5217\u51FA\u6240\u6709\u6848\u4F8B",
6331
+ paramHints: [
6332
+ { name: "action", type: "string", description: "\u64CD\u4F5C: query(\u67E5\u8BE2) / get(\u83B7\u53D6\u5355\u4E2A) / list(\u5217\u51FA\u5168\u90E8)", required: true },
6333
+ { name: "framework", type: "string", description: "\u6846\u67B6\u7C7B\u578B: flutter/vue3/react/common" },
6334
+ { name: "caseId", type: "string", description: "\u6848\u4F8B ID\uFF08get \u65F6\u5FC5\u586B\uFF09" },
6335
+ { name: "keywords", type: "string[]", description: "\u641C\u7D22\u5173\u952E\u8BCD\uFF08query \u65F6\u4F7F\u7528\uFF09" },
6336
+ { name: "errorMessage", type: "string", description: "\u9519\u8BEF\u4FE1\u606F\uFF08query \u65F6\u4F7F\u7528\uFF09" },
6337
+ { name: "limit", type: "number", description: "\u6700\u5927\u8FD4\u56DE\u6570\u91CF" }
6338
+ ],
6339
+ handler: async (params) => {
6340
+ const action = params.action || "list";
6341
+ switch (action) {
6342
+ case "get": {
6343
+ const framework = params.framework;
6344
+ const caseId = params.caseId;
6345
+ if (!framework || !caseId) {
6346
+ throw new Error("get \u64CD\u4F5C\u9700\u8981 framework \u548C caseId \u53C2\u6570");
6347
+ }
6348
+ return wrapAsContent(await getTroubleshootingCaseContent({ framework, caseId }));
6349
+ }
6350
+ case "query":
6351
+ return wrapAsContent(await queryTroubleshootingCases({
6352
+ framework: params.framework,
6353
+ keywords: params.keywords,
6354
+ errorMessage: params.errorMessage,
6355
+ limit: params.limit
6356
+ }));
6357
+ case "list":
6358
+ default:
6359
+ return wrapAsContent(await listTroubleshootingCases(params.framework));
6360
+ }
6361
+ }
6362
+ }
6363
+ ];
6364
+
5893
6365
  // src/index.ts
5894
- var SERVER_VERSION = "3.2.0";
6366
+ var SERVER_VERSION = "3.9.0";
6367
+ var TOOL_MODE = process.env.MTA_TOOL_MODE || "unified";
5895
6368
  var logger3 = createLogger("Server");
6369
+ function wrapAsContent2(data) {
6370
+ return {
6371
+ content: [{
6372
+ type: "text",
6373
+ text: JSON.stringify(data, null, 2)
6374
+ }]
6375
+ };
6376
+ }
5896
6377
  var CopilotPromptsMCPServer = class {
5897
6378
  constructor() {
6379
+ this.skillRegistry = getSkillRegistry();
5898
6380
  this.standardsManager = new StandardsManager();
5899
6381
  this.codeValidator = new CodeValidator();
6382
+ this.skillRegistry.registerAll(skillDefinitions);
5900
6383
  this.server = new Server(
5901
6384
  {
5902
6385
  name: "mta",
@@ -5940,49 +6423,323 @@ var CopilotPromptsMCPServer = class {
5940
6423
  });
5941
6424
  }
5942
6425
  setupToolHandlers() {
5943
- this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
5944
- tools: [
5945
- {
5946
- name: "analyze_project",
5947
- description: "\u5206\u6790\u9879\u76EE\u6280\u672F\u6808\u3001\u6846\u67B6\u3001\u5DE5\u5177\u548C\u7279\u5F81",
5948
- inputSchema: {
5949
- type: "object",
5950
- properties: {
5951
- projectPath: {
5952
- type: "string",
5953
- description: "\u9879\u76EE\u7EDD\u5BF9\u8DEF\u5F84\uFF08\u53EF\u9009\uFF09"
6426
+ const memoryAndThinkingTools = [
6427
+ // ================== 知识图谱记忆工具 ==================
6428
+ {
6429
+ name: "create_entities",
6430
+ description: "\u5728\u77E5\u8BC6\u56FE\u8C31\u4E2D\u521B\u5EFA\u591A\u4E2A\u65B0\u5B9E\u4F53",
6431
+ inputSchema: {
6432
+ type: "object",
6433
+ properties: {
6434
+ entities: {
6435
+ type: "array",
6436
+ description: "\u5B9E\u4F53\u6570\u7EC4",
6437
+ items: {
6438
+ type: "object",
6439
+ properties: {
6440
+ name: { type: "string", description: "\u5B9E\u4F53\u540D\u79F0\uFF08\u552F\u4E00\u6807\u8BC6\uFF09" },
6441
+ entityType: { type: "string", description: "\u5B9E\u4F53\u7C7B\u578B\uFF08\u5982 person\u3001project\u3001concept\uFF09" },
6442
+ observations: { type: "array", items: { type: "string" }, description: "\u5173\u4E8E\u8BE5\u5B9E\u4F53\u7684\u89C2\u5BDF/\u4E8B\u5B9E" }
6443
+ },
6444
+ required: ["name", "entityType", "observations"]
6445
+ }
6446
+ }
6447
+ },
6448
+ required: ["entities"]
6449
+ }
6450
+ },
6451
+ {
6452
+ name: "create_relations",
6453
+ description: "\u5728\u77E5\u8BC6\u56FE\u8C31\u4E2D\u521B\u5EFA\u5B9E\u4F53\u4E4B\u95F4\u7684\u5173\u7CFB\uFF08\u4F7F\u7528\u4E3B\u52A8\u8BED\u6001\uFF09",
6454
+ inputSchema: {
6455
+ type: "object",
6456
+ properties: {
6457
+ relations: {
6458
+ type: "array",
6459
+ description: "\u5173\u7CFB\u6570\u7EC4",
6460
+ items: {
6461
+ type: "object",
6462
+ properties: {
6463
+ from: { type: "string", description: "\u8D77\u59CB\u5B9E\u4F53\u540D\u79F0" },
6464
+ to: { type: "string", description: "\u76EE\u6807\u5B9E\u4F53\u540D\u79F0" },
6465
+ relationType: { type: "string", description: "\u5173\u7CFB\u7C7B\u578B\uFF08\u4E3B\u52A8\u8BED\u6001\uFF0C\u5982 works_at\u3001uses\u3001depends_on\uFF09" }
6466
+ },
6467
+ required: ["from", "to", "relationType"]
6468
+ }
6469
+ }
6470
+ },
6471
+ required: ["relations"]
6472
+ }
6473
+ },
6474
+ {
6475
+ name: "add_observations",
6476
+ description: "\u5411\u73B0\u6709\u5B9E\u4F53\u6DFB\u52A0\u65B0\u7684\u89C2\u5BDF/\u4E8B\u5B9E",
6477
+ inputSchema: {
6478
+ type: "object",
6479
+ properties: {
6480
+ observations: {
6481
+ type: "array",
6482
+ description: "\u89C2\u5BDF\u6570\u7EC4",
6483
+ items: {
6484
+ type: "object",
6485
+ properties: {
6486
+ entityName: { type: "string", description: "\u5B9E\u4F53\u540D\u79F0" },
6487
+ contents: { type: "array", items: { type: "string" }, description: "\u8981\u6DFB\u52A0\u7684\u89C2\u5BDF\u5185\u5BB9" }
6488
+ },
6489
+ required: ["entityName", "contents"]
6490
+ }
6491
+ }
6492
+ },
6493
+ required: ["observations"]
6494
+ }
6495
+ },
6496
+ {
6497
+ name: "delete_entities",
6498
+ description: "\u5220\u9664\u5B9E\u4F53\u53CA\u5176\u5173\u8054\u7684\u5173\u7CFB",
6499
+ inputSchema: {
6500
+ type: "object",
6501
+ properties: {
6502
+ entityNames: {
6503
+ type: "array",
6504
+ items: { type: "string" },
6505
+ description: "\u8981\u5220\u9664\u7684\u5B9E\u4F53\u540D\u79F0\u5217\u8868"
6506
+ }
6507
+ },
6508
+ required: ["entityNames"]
6509
+ }
6510
+ },
6511
+ {
6512
+ name: "delete_observations",
6513
+ description: "\u4ECE\u5B9E\u4F53\u4E2D\u5220\u9664\u7279\u5B9A\u7684\u89C2\u5BDF",
6514
+ inputSchema: {
6515
+ type: "object",
6516
+ properties: {
6517
+ deletions: {
6518
+ type: "array",
6519
+ items: {
6520
+ type: "object",
6521
+ properties: {
6522
+ entityName: { type: "string", description: "\u5B9E\u4F53\u540D\u79F0" },
6523
+ observations: { type: "array", items: { type: "string" }, description: "\u8981\u5220\u9664\u7684\u89C2\u5BDF" }
6524
+ },
6525
+ required: ["entityName", "observations"]
6526
+ }
6527
+ }
6528
+ },
6529
+ required: ["deletions"]
6530
+ }
6531
+ },
6532
+ {
6533
+ name: "delete_relations",
6534
+ description: "\u4ECE\u77E5\u8BC6\u56FE\u8C31\u4E2D\u5220\u9664\u5173\u7CFB",
6535
+ inputSchema: {
6536
+ type: "object",
6537
+ properties: {
6538
+ relations: {
6539
+ type: "array",
6540
+ items: {
6541
+ type: "object",
6542
+ properties: {
6543
+ from: { type: "string", description: "\u8D77\u59CB\u5B9E\u4F53\u540D\u79F0" },
6544
+ to: { type: "string", description: "\u76EE\u6807\u5B9E\u4F53\u540D\u79F0" },
6545
+ relationType: { type: "string", description: "\u5173\u7CFB\u7C7B\u578B" }
6546
+ },
6547
+ required: ["from", "to", "relationType"]
5954
6548
  }
5955
6549
  }
6550
+ },
6551
+ required: ["relations"]
6552
+ }
6553
+ },
6554
+ {
6555
+ name: "read_graph",
6556
+ description: "\u8BFB\u53D6\u6574\u4E2A\u77E5\u8BC6\u56FE\u8C31",
6557
+ inputSchema: {
6558
+ type: "object",
6559
+ properties: {}
6560
+ }
6561
+ },
6562
+ {
6563
+ name: "search_nodes",
6564
+ description: "\u5728\u77E5\u8BC6\u56FE\u8C31\u4E2D\u641C\u7D22\u8282\u70B9\uFF08\u6309\u540D\u79F0\u3001\u7C7B\u578B\u6216\u89C2\u5BDF\u5185\u5BB9\u5339\u914D\uFF09",
6565
+ inputSchema: {
6566
+ type: "object",
6567
+ properties: {
6568
+ query: {
6569
+ type: "string",
6570
+ description: "\u641C\u7D22\u5173\u952E\u8BCD"
6571
+ }
6572
+ },
6573
+ required: ["query"]
6574
+ }
6575
+ },
6576
+ {
6577
+ name: "open_nodes",
6578
+ description: "\u6309\u540D\u79F0\u6253\u5F00\u7279\u5B9A\u8282\u70B9",
6579
+ inputSchema: {
6580
+ type: "object",
6581
+ properties: {
6582
+ names: {
6583
+ type: "array",
6584
+ items: { type: "string" },
6585
+ description: "\u8981\u68C0\u7D22\u7684\u5B9E\u4F53\u540D\u79F0\u5217\u8868"
6586
+ }
6587
+ },
6588
+ required: ["names"]
6589
+ }
6590
+ },
6591
+ // ================== 顺序思考工具 ==================
6592
+ {
6593
+ name: "sequentialthinking",
6594
+ description: `A detailed tool for dynamic and reflective problem-solving through thoughts.
6595
+ This tool helps analyze problems through a flexible thinking process that can adapt and evolve.
6596
+ Each thought can build on, question, or revise previous insights as understanding deepens.
6597
+
6598
+ When to use this tool:
6599
+ - Breaking down complex problems into steps
6600
+ - Planning and design with room for revision
6601
+ - Analysis that might need course correction
6602
+ - Problems where the full scope might not be clear initially
6603
+ - Problems that require a multi-step solution
6604
+ - Tasks that need to maintain context over multiple steps
6605
+ - Situations where irrelevant information needs to be filtered out
6606
+
6607
+ Key features:
6608
+ - You can adjust total_thoughts up or down as you progress
6609
+ - You can question or revise previous thoughts
6610
+ - You can add more thoughts even after reaching what seemed like the end
6611
+ - You can express uncertainty and explore alternative approaches
6612
+ - Not every thought needs to build linearly - you can branch or backtrack
6613
+ - Generates a solution hypothesis
6614
+ - Verifies the hypothesis based on the Chain of Thought steps
6615
+ - Repeats the process until satisfied
6616
+ - Provides a correct answer
6617
+
6618
+ Parameters explained:
6619
+ - thought: Your current thinking step, which can include:
6620
+ * Regular analytical steps
6621
+ * Revisions of previous thoughts
6622
+ * Questions about previous decisions
6623
+ * Realizations about needing more analysis
6624
+ * Changes in approach
6625
+ * Hypothesis generation
6626
+ * Hypothesis verification
6627
+ - nextThoughtNeeded: True if you need more thinking, even if at what seemed like the end
6628
+ - thoughtNumber: Current number in sequence (can go beyond initial total if needed)
6629
+ - totalThoughts: Current estimate of thoughts needed (can be adjusted up/down)
6630
+ - isRevision: A boolean indicating if this thought revises previous thinking
6631
+ - revisesThought: If is_revision is true, which thought number is being reconsidered
6632
+ - branchFromThought: If branching, which thought number is the branching point
6633
+ - branchId: Identifier for the current branch (if any)
6634
+ - needsMoreThoughts: If reaching end but realizing more thoughts needed
6635
+
6636
+ You should:
6637
+ 1. Start with an initial estimate of needed thoughts, but be ready to adjust
6638
+ 2. Feel free to question or revise previous thoughts
6639
+ 3. Don't hesitate to add more thoughts if needed, even at the "end"
6640
+ 4. Express uncertainty when present
6641
+ 5. Mark thoughts that revise previous thinking or branch into new paths
6642
+ 6. Ignore information that is irrelevant to the current step
6643
+ 7. Generate a solution hypothesis when appropriate
6644
+ 8. Verify the hypothesis based on the Chain of Thought steps
6645
+ 9. Repeat the process until satisfied with the solution
6646
+ 10. Provide a single, ideally correct answer as the final output
6647
+ 11. Only set nextThoughtNeeded to false when truly done and a satisfactory answer is reached`,
6648
+ inputSchema: {
6649
+ type: "object",
6650
+ properties: {
6651
+ thought: {
6652
+ type: "string",
6653
+ description: "Your current thinking step"
6654
+ },
6655
+ nextThoughtNeeded: {
6656
+ type: "boolean",
6657
+ description: "Whether another thought step is needed"
6658
+ },
6659
+ thoughtNumber: {
6660
+ type: "integer",
6661
+ description: "Current thought number (numeric value, e.g., 1, 2, 3)",
6662
+ minimum: 1
6663
+ },
6664
+ totalThoughts: {
6665
+ type: "integer",
6666
+ description: "Estimated total thoughts needed (numeric value, e.g., 5, 10)",
6667
+ minimum: 1
6668
+ },
6669
+ isRevision: {
6670
+ type: "boolean",
6671
+ description: "Whether this revises previous thinking"
6672
+ },
6673
+ revisesThought: {
6674
+ type: "integer",
6675
+ description: "Which thought is being reconsidered",
6676
+ minimum: 1
6677
+ },
6678
+ branchFromThought: {
6679
+ type: "integer",
6680
+ description: "Branching point thought number",
6681
+ minimum: 1
6682
+ },
6683
+ branchId: {
6684
+ type: "string",
6685
+ description: "Branch identifier"
6686
+ },
6687
+ needsMoreThoughts: {
6688
+ type: "boolean",
6689
+ description: "If more thoughts are needed"
6690
+ }
6691
+ },
6692
+ required: ["thought", "nextThoughtNeeded", "thoughtNumber", "totalThoughts"]
6693
+ }
6694
+ }
6695
+ ];
6696
+ const mtaUnifiedTool = {
6697
+ name: "mta",
6698
+ description: this.skillRegistry.generateToolDescription(),
6699
+ inputSchema: this.skillRegistry.generateInputSchema()
6700
+ };
6701
+ const legacyBusinessTools = [
6702
+ {
6703
+ name: "analyze_project",
6704
+ description: "\u5206\u6790\u9879\u76EE\u6280\u672F\u6808\u3001\u6846\u67B6\u3001\u5DE5\u5177\u548C\u7279\u5F81",
6705
+ inputSchema: {
6706
+ type: "object",
6707
+ properties: {
6708
+ projectPath: {
6709
+ type: "string",
6710
+ description: "\u9879\u76EE\u7EDD\u5BF9\u8DEF\u5F84\uFF08\u53EF\u9009\uFF09"
6711
+ }
5956
6712
  }
5957
- },
5958
- {
5959
- name: "auto_setup",
5960
- description: `\u3010\u751F\u6210\u9879\u76EE\u914D\u7F6E\u3011\u4E3A\u9879\u76EE\u751F\u6210 copilot-instructions.md \u914D\u7F6E\u6587\u4EF6\u3002
6713
+ }
6714
+ },
6715
+ {
6716
+ name: "auto_setup",
6717
+ description: `\u3010\u751F\u6210\u9879\u76EE\u914D\u7F6E\u3011\u4E3A\u9879\u76EE\u751F\u6210 copilot-instructions.md \u914D\u7F6E\u6587\u4EF6\u3002
5961
6718
  \u529F\u80FD\uFF1A
5962
6719
  1. \u68C0\u6D4B\u9879\u76EE\u4E2D\u662F\u5426\u5B58\u5728 .github/copilot-instructions.md
5963
6720
  2. \u5982\u679C\u4E0D\u5B58\u5728\uFF0C\u5219\u81EA\u52A8\u5206\u6790\u9879\u76EE\u6280\u672F\u6808\u5E76\u751F\u6210\u914D\u7F6E\u6587\u4EF6
5964
6721
  3. \u4F7F\u7528 SmartAgentMatcher \u5339\u914D\u6700\u5408\u9002\u7684 Agents
5965
6722
 
5966
6723
  \u6CE8\u610F\uFF1AMCP \u670D\u52A1\u5668\u7531 VS Code \u63D2\u4EF6\u901A\u8FC7 npm \u5305\u81EA\u52A8\u914D\u7F6E\uFF0C\u6B64\u5DE5\u5177\u53EA\u8D1F\u8D23\u751F\u6210 copilot-instructions.md`,
5967
- inputSchema: {
5968
- type: "object",
5969
- properties: {
5970
- workspacePath: {
5971
- type: "string",
5972
- description: "\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\uFF08\u5FC5\u987B\u63D0\u4F9B\uFF09"
5973
- },
5974
- generateInstructions: {
5975
- type: "boolean",
5976
- description: "\u662F\u5426\u751F\u6210 copilot-instructions.md\uFF08\u9ED8\u8BA4 true\uFF0C\u4EC5\u5F53\u4E0D\u5B58\u5728\u65F6\u751F\u6210\uFF09",
5977
- default: true
5978
- }
6724
+ inputSchema: {
6725
+ type: "object",
6726
+ properties: {
6727
+ workspacePath: {
6728
+ type: "string",
6729
+ description: "\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\uFF08\u5FC5\u987B\u63D0\u4F9B\uFF09"
5979
6730
  },
5980
- required: ["workspacePath"]
5981
- }
5982
- },
5983
- {
5984
- name: "init_project",
5985
- description: `\u3010\u521D\u59CB\u5316\u9879\u76EE\u3011\u5FEB\u901F\u521D\u59CB\u5316\u9879\u76EE\u7684 MTA \u914D\u7F6E\u3002
6731
+ generateInstructions: {
6732
+ type: "boolean",
6733
+ description: "\u662F\u5426\u751F\u6210 copilot-instructions.md\uFF08\u9ED8\u8BA4 true\uFF0C\u4EC5\u5F53\u4E0D\u5B58\u5728\u65F6\u751F\u6210\uFF09",
6734
+ default: true
6735
+ }
6736
+ },
6737
+ required: ["workspacePath"]
6738
+ }
6739
+ },
6740
+ {
6741
+ name: "init_project",
6742
+ description: `\u3010\u521D\u59CB\u5316\u9879\u76EE\u3011\u5FEB\u901F\u521D\u59CB\u5316\u9879\u76EE\u7684 MTA \u914D\u7F6E\u3002
5986
6743
  \u7528\u6CD5\uFF1A@mta \u521D\u59CB\u5316\u9879\u76EE
5987
6744
 
5988
6745
  \u529F\u80FD\uFF1A
@@ -5991,285 +6748,285 @@ var CopilotPromptsMCPServer = class {
5991
6748
  3. \u5982\u679C\u5DF2\u5B58\u5728\u914D\u7F6E\uFF0C\u4F1A\u8BFB\u53D6\u7528\u6237\u5DF2\u914D\u7F6E\u7684 Agents \u5E76\u8865\u5145\u7F3A\u5931\u7684\u89C4\u8303
5992
6749
 
5993
6750
  \u63D0\u793A\uFF1A\u786E\u4FDD\u5728 Chat \u4E2D\u5DF2\u6DFB\u52A0\u9879\u76EE\u6587\u4EF6\u5939`,
5994
- inputSchema: {
5995
- type: "object",
5996
- properties: {
5997
- projectPath: {
5998
- type: "string",
5999
- description: "\u9879\u76EE\u8DEF\u5F84\uFF08\u53EF\u9009\uFF0C\u5982\u679C\u4E0D\u63D0\u4F9B\u4F1A\u5C1D\u8BD5\u4ECE\u4E0A\u4E0B\u6587\u63A8\u65AD\uFF09"
6000
- }
6751
+ inputSchema: {
6752
+ type: "object",
6753
+ properties: {
6754
+ projectPath: {
6755
+ type: "string",
6756
+ description: "\u9879\u76EE\u8DEF\u5F84\uFF08\u53EF\u9009\uFF0C\u5982\u679C\u4E0D\u63D0\u4F9B\u4F1A\u5C1D\u8BD5\u4ECE\u4E0A\u4E0B\u6587\u63A8\u65AD\uFF09"
6001
6757
  }
6002
6758
  }
6003
- },
6004
- {
6005
- name: "list_available_agents",
6006
- description: "\u5217\u51FA\u6240\u6709\u53EF\u7528\u7684 Agents\uFF08\u7528\u4E8E VSCode \u63D2\u4EF6\u7B49\u573A\u666F\uFF09\uFF0C\u8FD4\u56DE Agent \u5143\u6570\u636E\u5217\u8868",
6007
- inputSchema: {
6008
- type: "object",
6009
- properties: {}
6010
- }
6011
- },
6012
- {
6013
- name: "health_check",
6014
- description: "\u68C0\u67E5 MCP \u670D\u52A1\u5668\u72B6\u6001\u548C\u914D\u7F6E\u95EE\u9898\uFF0C\u8FD4\u56DE\u8BCA\u65AD\u62A5\u544A\u548C\u4FEE\u590D\u5EFA\u8BAE",
6015
- inputSchema: {
6016
- type: "object",
6017
- properties: {
6018
- workspacePath: {
6019
- type: "string",
6020
- description: "\u5DE5\u4F5C\u533A\u8DEF\u5F84\uFF08\u53EF\u9009\uFF09"
6021
- },
6022
- verbose: {
6023
- type: "boolean",
6024
- description: "\u663E\u793A\u8BE6\u7EC6\u4FE1\u606F"
6025
- }
6759
+ }
6760
+ },
6761
+ {
6762
+ name: "list_available_agents",
6763
+ description: "\u5217\u51FA\u6240\u6709\u53EF\u7528\u7684 Agents\uFF08\u7528\u4E8E VSCode \u63D2\u4EF6\u7B49\u573A\u666F\uFF09\uFF0C\u8FD4\u56DE Agent \u5143\u6570\u636E\u5217\u8868",
6764
+ inputSchema: {
6765
+ type: "object",
6766
+ properties: {}
6767
+ }
6768
+ },
6769
+ {
6770
+ name: "health_check",
6771
+ description: "\u68C0\u67E5 MCP \u670D\u52A1\u5668\u72B6\u6001\u548C\u914D\u7F6E\u95EE\u9898\uFF0C\u8FD4\u56DE\u8BCA\u65AD\u62A5\u544A\u548C\u4FEE\u590D\u5EFA\u8BAE",
6772
+ inputSchema: {
6773
+ type: "object",
6774
+ properties: {
6775
+ workspacePath: {
6776
+ type: "string",
6777
+ description: "\u5DE5\u4F5C\u533A\u8DEF\u5F84\uFF08\u53EF\u9009\uFF09"
6778
+ },
6779
+ verbose: {
6780
+ type: "boolean",
6781
+ description: "\u663E\u793A\u8BE6\u7EC6\u4FE1\u606F"
6026
6782
  }
6027
6783
  }
6028
- },
6029
- {
6030
- name: "use_preset",
6031
- description: "\u6309\u9884\u8BBE\u573A\u666F\u83B7\u53D6\u89C4\u8303\uFF08vue3-component\u3001api-call\u3001pinia-store \u7B49\uFF09",
6032
- inputSchema: {
6033
- type: "object",
6034
- properties: {
6035
- preset: {
6036
- type: "string",
6037
- enum: ["vue3-component", "vue3-form", "vue3-table", "pinia-store", "api-call", "typescript-strict", "i18n", "composable"],
6038
- description: "\u9884\u8BBE\u573A\u666F ID"
6039
- },
6040
- customImports: {
6041
- type: "array",
6042
- items: { type: "string" },
6043
- description: "\u989D\u5916\u5BFC\u5165\uFF08\u53EF\u9009\uFF09"
6044
- }
6784
+ }
6785
+ },
6786
+ {
6787
+ name: "use_preset",
6788
+ description: "\u6309\u9884\u8BBE\u573A\u666F\u83B7\u53D6\u89C4\u8303\uFF08vue3-component\u3001api-call\u3001pinia-store \u7B49\uFF09",
6789
+ inputSchema: {
6790
+ type: "object",
6791
+ properties: {
6792
+ preset: {
6793
+ type: "string",
6794
+ enum: ["vue3-component", "vue3-form", "vue3-table", "pinia-store", "api-call", "typescript-strict", "i18n", "composable"],
6795
+ description: "\u9884\u8BBE\u573A\u666F ID"
6045
6796
  },
6046
- required: ["preset"]
6047
- }
6048
- },
6049
- {
6050
- name: "list_presets",
6051
- description: "\u5217\u51FA\u6240\u6709\u9884\u8BBE\u573A\u666F",
6052
- inputSchema: {
6053
- type: "object",
6054
- properties: {}
6055
- }
6056
- },
6057
- {
6058
- name: "match_agents",
6059
- description: "\u6839\u636E\u9879\u76EE\u7279\u5F81\u5339\u914D Copilot Agents",
6060
- inputSchema: {
6061
- type: "object",
6062
- properties: {
6063
- projectFeatures: {
6064
- type: "object",
6065
- description: "\u9879\u76EE\u7279\u5F81\uFF08\u4ECE analyze_project \u83B7\u53D6\uFF09",
6066
- properties: {
6067
- frameworks: { type: "array", items: { type: "string" } },
6068
- languages: { type: "array", items: { type: "string" } },
6069
- tools: { type: "array", items: { type: "string" } },
6070
- keywords: { type: "array", items: { type: "string" } },
6071
- projectType: { type: "string" }
6072
- },
6073
- required: ["frameworks", "languages", "tools", "keywords", "projectType"]
6797
+ customImports: {
6798
+ type: "array",
6799
+ items: { type: "string" },
6800
+ description: "\u989D\u5916\u5BFC\u5165\uFF08\u53EF\u9009\uFF09"
6801
+ }
6802
+ },
6803
+ required: ["preset"]
6804
+ }
6805
+ },
6806
+ {
6807
+ name: "list_presets",
6808
+ description: "\u5217\u51FA\u6240\u6709\u9884\u8BBE\u573A\u666F",
6809
+ inputSchema: {
6810
+ type: "object",
6811
+ properties: {}
6812
+ }
6813
+ },
6814
+ {
6815
+ name: "match_agents",
6816
+ description: "\u6839\u636E\u9879\u76EE\u7279\u5F81\u5339\u914D Copilot Agents",
6817
+ inputSchema: {
6818
+ type: "object",
6819
+ properties: {
6820
+ projectFeatures: {
6821
+ type: "object",
6822
+ description: "\u9879\u76EE\u7279\u5F81\uFF08\u4ECE analyze_project \u83B7\u53D6\uFF09",
6823
+ properties: {
6824
+ frameworks: { type: "array", items: { type: "string" } },
6825
+ languages: { type: "array", items: { type: "string" } },
6826
+ tools: { type: "array", items: { type: "string" } },
6827
+ keywords: { type: "array", items: { type: "string" } },
6828
+ projectType: { type: "string" }
6074
6829
  },
6075
- limit: {
6076
- type: "number",
6077
- description: "\u6700\u5927\u8FD4\u56DE\u6570\u91CF",
6078
- default: 10
6079
- }
6830
+ required: ["frameworks", "languages", "tools", "keywords", "projectType"]
6080
6831
  },
6081
- required: ["projectFeatures"]
6082
- }
6083
- },
6084
- {
6085
- name: "list_available_agents",
6086
- description: "\u5217\u51FA\u6240\u6709\u53EF\u7528\u7684 Copilot Agents",
6087
- inputSchema: {
6088
- type: "object",
6089
- properties: {}
6090
- }
6091
- },
6092
- {
6093
- name: "generate_config",
6094
- description: "\u4E3A\u9879\u76EE\u751F\u6210 copilot-instructions.md \u914D\u7F6E\u6587\u4EF6",
6095
- inputSchema: {
6096
- type: "object",
6097
- properties: {
6098
- projectPath: {
6099
- type: "string",
6100
- description: "\u9879\u76EE\u7EDD\u5BF9\u8DEF\u5F84"
6101
- },
6102
- agentIds: {
6103
- type: "array",
6104
- items: { type: "string" },
6105
- description: "\u6307\u5B9A Agent ID \u5217\u8868\uFF08\u53EF\u9009\uFF09"
6106
- },
6107
- autoMatch: {
6108
- type: "boolean",
6109
- description: "\u81EA\u52A8\u5339\u914D Agents",
6110
- default: true
6111
- },
6112
- updateMode: {
6113
- type: "string",
6114
- enum: ["merge", "overwrite"],
6115
- description: "merge \u4FDD\u7559\u81EA\u5B9A\u4E49\u5185\u5BB9\uFF0Coverwrite \u8986\u76D6",
6116
- default: "merge"
6117
- },
6118
- configId: {
6119
- type: "string",
6120
- description: "\u914D\u7F6E\u65B9\u6848 ID"
6121
- }
6832
+ limit: {
6833
+ type: "number",
6834
+ description: "\u6700\u5927\u8FD4\u56DE\u6570\u91CF",
6835
+ default: 10
6836
+ }
6837
+ },
6838
+ required: ["projectFeatures"]
6839
+ }
6840
+ },
6841
+ {
6842
+ name: "list_available_agents",
6843
+ description: "\u5217\u51FA\u6240\u6709\u53EF\u7528\u7684 Copilot Agents",
6844
+ inputSchema: {
6845
+ type: "object",
6846
+ properties: {}
6847
+ }
6848
+ },
6849
+ {
6850
+ name: "generate_config",
6851
+ description: "\u4E3A\u9879\u76EE\u751F\u6210 copilot-instructions.md \u914D\u7F6E\u6587\u4EF6",
6852
+ inputSchema: {
6853
+ type: "object",
6854
+ properties: {
6855
+ projectPath: {
6856
+ type: "string",
6857
+ description: "\u9879\u76EE\u7EDD\u5BF9\u8DEF\u5F84"
6122
6858
  },
6123
- required: ["projectPath"]
6124
- }
6125
- },
6126
- {
6127
- name: "get_compact_standards",
6128
- description: `\u83B7\u53D6\u7F16\u7801\u89C4\u8303\uFF08\u667A\u80FD\u6A21\u5F0F\uFF09
6859
+ agentIds: {
6860
+ type: "array",
6861
+ items: { type: "string" },
6862
+ description: "\u6307\u5B9A Agent ID \u5217\u8868\uFF08\u53EF\u9009\uFF09"
6863
+ },
6864
+ autoMatch: {
6865
+ type: "boolean",
6866
+ description: "\u81EA\u52A8\u5339\u914D Agents",
6867
+ default: true
6868
+ },
6869
+ updateMode: {
6870
+ type: "string",
6871
+ enum: ["merge", "overwrite"],
6872
+ description: "merge \u4FDD\u7559\u81EA\u5B9A\u4E49\u5185\u5BB9\uFF0Coverwrite \u8986\u76D6",
6873
+ default: "merge"
6874
+ },
6875
+ configId: {
6876
+ type: "string",
6877
+ description: "\u914D\u7F6E\u65B9\u6848 ID"
6878
+ }
6879
+ },
6880
+ required: ["projectPath"]
6881
+ }
6882
+ },
6883
+ {
6884
+ name: "get_compact_standards",
6885
+ description: `\u83B7\u53D6\u7F16\u7801\u89C4\u8303\uFF08\u667A\u80FD\u6A21\u5F0F\uFF09
6129
6886
  \u529F\u80FD\uFF1A
6130
6887
  1. \u81EA\u52A8\u5206\u6790\u9879\u76EE\u6280\u672F\u6808\uFF08\u901A\u8FC7 projectPath\uFF09
6131
6888
  2. \u5982\u679C\u5B58\u5728 copilot-instructions.md\uFF0C\u4F18\u5148\u4F7F\u7528\u7528\u6237\u914D\u7F6E\u7684 Agents
6132
6889
  3. \u667A\u80FD\u8865\u5145\u7528\u6237\u672A\u914D\u7F6E\u7684\u89C4\u8303
6133
6890
  4. \u652F\u6301 summary/key-rules/full \u4E09\u79CD\u8FD4\u56DE\u6A21\u5F0F
6134
6891
 
6135
- \u4F7F\u7528\u573A\u666F\uFF1A
6136
- - @mta \u8C03\u7528\u65F6\uFF0C\u4F20\u5165 projectPath \u83B7\u53D6\u5B8C\u6574\u9879\u76EE\u89C4\u8303
6137
- - \u7F16\u5199\u4EE3\u7801\u65F6\uFF0C\u4F20\u5165 fileContent \u83B7\u53D6\u6587\u4EF6\u76F8\u5173\u89C4\u8303`,
6138
- inputSchema: {
6139
- type: "object",
6140
- properties: {
6141
- currentFile: {
6142
- type: "string",
6143
- description: "\u5F53\u524D\u6587\u4EF6\u8DEF\u5F84\uFF08\u53EF\u9009\uFF09"
6144
- },
6145
- fileContent: {
6146
- type: "string",
6147
- description: "\u6587\u4EF6\u5185\u5BB9\uFF08\u53EF\u9009\uFF09"
6148
- },
6149
- projectPath: {
6150
- type: "string",
6151
- description: "\u9879\u76EE\u6839\u8DEF\u5F84\uFF08\u63A8\u8350\uFF09- \u4F1A\u81EA\u52A8\u5206\u6790\u9879\u76EE\u6280\u672F\u6808\u5E76\u8BFB\u53D6\u7528\u6237\u914D\u7F6E"
6152
- },
6153
- scenario: {
6154
- type: "string",
6155
- description: "\u5F00\u53D1\u573A\u666F\uFF08\u53EF\u9009\uFF09"
6156
- },
6157
- mode: {
6158
- type: "string",
6159
- enum: ["summary", "key-rules", "full"],
6160
- description: "\u8FD4\u56DE\u6A21\u5F0F\uFF1Asummary(\u6458\u8981)/key-rules(\u5173\u952E\u89C4\u5219,\u9ED8\u8BA4)/full(\u5B8C\u6574\u5185\u5BB9)",
6161
- default: "key-rules"
6162
- }
6892
+ \u4F7F\u7528\u573A\u666F\uFF1A
6893
+ - @mta \u8C03\u7528\u65F6\uFF0C\u4F20\u5165 projectPath \u83B7\u53D6\u5B8C\u6574\u9879\u76EE\u89C4\u8303
6894
+ - \u7F16\u5199\u4EE3\u7801\u65F6\uFF0C\u4F20\u5165 fileContent \u83B7\u53D6\u6587\u4EF6\u76F8\u5173\u89C4\u8303`,
6895
+ inputSchema: {
6896
+ type: "object",
6897
+ properties: {
6898
+ currentFile: {
6899
+ type: "string",
6900
+ description: "\u5F53\u524D\u6587\u4EF6\u8DEF\u5F84\uFF08\u53EF\u9009\uFF09"
6901
+ },
6902
+ fileContent: {
6903
+ type: "string",
6904
+ description: "\u6587\u4EF6\u5185\u5BB9\uFF08\u53EF\u9009\uFF09"
6905
+ },
6906
+ projectPath: {
6907
+ type: "string",
6908
+ description: "\u9879\u76EE\u6839\u8DEF\u5F84\uFF08\u63A8\u8350\uFF09- \u4F1A\u81EA\u52A8\u5206\u6790\u9879\u76EE\u6280\u672F\u6808\u5E76\u8BFB\u53D6\u7528\u6237\u914D\u7F6E"
6909
+ },
6910
+ scenario: {
6911
+ type: "string",
6912
+ description: "\u5F00\u53D1\u573A\u666F\uFF08\u53EF\u9009\uFF09"
6913
+ },
6914
+ mode: {
6915
+ type: "string",
6916
+ enum: ["summary", "key-rules", "full"],
6917
+ description: "\u8FD4\u56DE\u6A21\u5F0F\uFF1Asummary(\u6458\u8981)/key-rules(\u5173\u952E\u89C4\u5219,\u9ED8\u8BA4)/full(\u5B8C\u6574\u5185\u5BB9)",
6918
+ default: "key-rules"
6163
6919
  }
6164
6920
  }
6165
- },
6166
- {
6167
- name: "get_standard_by_id",
6168
- description: "\u6309 ID \u76F4\u63A5\u83B7\u53D6\u89C4\u8303",
6169
- inputSchema: {
6170
- type: "object",
6171
- properties: {
6172
- id: {
6173
- type: "string",
6174
- description: "\u89C4\u8303 ID\uFF08\u5982 vue3-composition, element-plus\uFF09"
6175
- },
6176
- ids: {
6177
- type: "array",
6178
- items: { type: "string" },
6179
- description: "\u6279\u91CF\u83B7\u53D6\u591A\u4E2A\u89C4\u8303 ID"
6180
- },
6181
- mode: {
6182
- type: "string",
6183
- enum: ["summary", "key-rules", "full"],
6184
- description: "\u8FD4\u56DE\u6A21\u5F0F",
6185
- default: "key-rules"
6186
- }
6921
+ }
6922
+ },
6923
+ {
6924
+ name: "get_standard_by_id",
6925
+ description: "\u6309 ID \u76F4\u63A5\u83B7\u53D6\u89C4\u8303",
6926
+ inputSchema: {
6927
+ type: "object",
6928
+ properties: {
6929
+ id: {
6930
+ type: "string",
6931
+ description: "\u89C4\u8303 ID\uFF08\u5982 vue3-composition, element-plus\uFF09"
6932
+ },
6933
+ ids: {
6934
+ type: "array",
6935
+ items: { type: "string" },
6936
+ description: "\u6279\u91CF\u83B7\u53D6\u591A\u4E2A\u89C4\u8303 ID"
6937
+ },
6938
+ mode: {
6939
+ type: "string",
6940
+ enum: ["summary", "key-rules", "full"],
6941
+ description: "\u8FD4\u56DE\u6A21\u5F0F",
6942
+ default: "key-rules"
6187
6943
  }
6188
6944
  }
6189
- },
6190
- {
6191
- name: "query_mappings",
6192
- description: "\u67E5\u8BE2\u573A\u666F-\u89C4\u8303\u6620\u5C04\u5173\u7CFB",
6193
- inputSchema: {
6194
- type: "object",
6195
- properties: {
6196
- scenario: {
6197
- type: "string",
6198
- description: "\u573A\u666F\u540D\u79F0"
6199
- },
6200
- fileType: {
6201
- type: "string",
6202
- description: "\u6587\u4EF6\u7C7B\u578B"
6203
- },
6204
- imports: {
6205
- type: "array",
6206
- items: { type: "string" },
6207
- description: "\u5BFC\u5165\u7684\u5305"
6208
- },
6209
- listAll: {
6210
- type: "boolean",
6211
- description: "\u5217\u51FA\u6240\u6709\u6620\u5C04"
6212
- }
6945
+ }
6946
+ },
6947
+ {
6948
+ name: "query_mappings",
6949
+ description: "\u67E5\u8BE2\u573A\u666F-\u89C4\u8303\u6620\u5C04\u5173\u7CFB",
6950
+ inputSchema: {
6951
+ type: "object",
6952
+ properties: {
6953
+ scenario: {
6954
+ type: "string",
6955
+ description: "\u573A\u666F\u540D\u79F0"
6956
+ },
6957
+ fileType: {
6958
+ type: "string",
6959
+ description: "\u6587\u4EF6\u7C7B\u578B"
6960
+ },
6961
+ imports: {
6962
+ type: "array",
6963
+ items: { type: "string" },
6964
+ description: "\u5BFC\u5165\u7684\u5305"
6965
+ },
6966
+ listAll: {
6967
+ type: "boolean",
6968
+ description: "\u5217\u51FA\u6240\u6709\u6620\u5C04"
6213
6969
  }
6214
6970
  }
6215
- },
6216
- {
6217
- name: "list_scenarios",
6218
- description: "\u5217\u51FA\u6240\u6709\u53EF\u7528\u573A\u666F",
6219
- inputSchema: {
6220
- type: "object",
6221
- properties: {}
6222
- }
6223
- },
6224
- {
6225
- name: "list_templates",
6226
- description: "\u5217\u51FA\u53EF\u7528\u4EE3\u7801\u6A21\u677F",
6227
- inputSchema: {
6228
- type: "object",
6229
- properties: {
6230
- type: {
6231
- type: "string",
6232
- enum: ["api-layer", "component", "store", "composable", "config", "types", "other"],
6233
- description: "\u6309\u7C7B\u578B\u7B5B\u9009"
6234
- },
6235
- framework: {
6236
- type: "string",
6237
- description: "\u6309\u6846\u67B6\u7B5B\u9009"
6238
- },
6239
- search: {
6240
- type: "string",
6241
- description: "\u641C\u7D22\u5173\u952E\u8BCD"
6242
- }
6971
+ }
6972
+ },
6973
+ {
6974
+ name: "list_scenarios",
6975
+ description: "\u5217\u51FA\u6240\u6709\u53EF\u7528\u573A\u666F",
6976
+ inputSchema: {
6977
+ type: "object",
6978
+ properties: {}
6979
+ }
6980
+ },
6981
+ {
6982
+ name: "list_templates",
6983
+ description: "\u5217\u51FA\u53EF\u7528\u4EE3\u7801\u6A21\u677F",
6984
+ inputSchema: {
6985
+ type: "object",
6986
+ properties: {
6987
+ type: {
6988
+ type: "string",
6989
+ enum: ["api-layer", "component", "store", "composable", "config", "types", "other"],
6990
+ description: "\u6309\u7C7B\u578B\u7B5B\u9009"
6991
+ },
6992
+ framework: {
6993
+ type: "string",
6994
+ description: "\u6309\u6846\u67B6\u7B5B\u9009"
6995
+ },
6996
+ search: {
6997
+ type: "string",
6998
+ description: "\u641C\u7D22\u5173\u952E\u8BCD"
6243
6999
  }
6244
7000
  }
6245
- },
6246
- {
6247
- name: "get_template",
6248
- description: "\u83B7\u53D6\u6A21\u677F\u8BE6\u60C5\u548C\u6587\u4EF6\u5185\u5BB9",
6249
- inputSchema: {
6250
- type: "object",
6251
- properties: {
6252
- id: {
6253
- type: "string",
6254
- description: "\u6A21\u677F ID"
6255
- },
6256
- includeFiles: {
6257
- type: "boolean",
6258
- description: "\u5305\u542B\u6587\u4EF6\u5185\u5BB9",
6259
- default: false
6260
- },
6261
- files: {
6262
- type: "array",
6263
- items: { type: "string" },
6264
- description: "\u6307\u5B9A\u6587\u4EF6\u5217\u8868"
6265
- }
7001
+ }
7002
+ },
7003
+ {
7004
+ name: "get_template",
7005
+ description: "\u83B7\u53D6\u6A21\u677F\u8BE6\u60C5\u548C\u6587\u4EF6\u5185\u5BB9",
7006
+ inputSchema: {
7007
+ type: "object",
7008
+ properties: {
7009
+ id: {
7010
+ type: "string",
7011
+ description: "\u6A21\u677F ID"
6266
7012
  },
6267
- required: ["id"]
6268
- }
6269
- },
6270
- {
6271
- name: "analyze_reference_project",
6272
- description: `\u3010\u9879\u76EE\u514B\u9686\u3011\u6DF1\u5EA6\u5206\u6790\u53C2\u8003\u9879\u76EE\uFF0C\u7528\u4E8E\u521B\u5EFA\u98CE\u683C\u4E00\u81F4\u7684\u65B0\u9879\u76EE\u3002
7013
+ includeFiles: {
7014
+ type: "boolean",
7015
+ description: "\u5305\u542B\u6587\u4EF6\u5185\u5BB9",
7016
+ default: false
7017
+ },
7018
+ files: {
7019
+ type: "array",
7020
+ items: { type: "string" },
7021
+ description: "\u6307\u5B9A\u6587\u4EF6\u5217\u8868"
7022
+ }
7023
+ },
7024
+ required: ["id"]
7025
+ }
7026
+ },
7027
+ {
7028
+ name: "analyze_reference_project",
7029
+ description: `\u3010\u9879\u76EE\u514B\u9686\u3011\u6DF1\u5EA6\u5206\u6790\u53C2\u8003\u9879\u76EE\uFF0C\u7528\u4E8E\u521B\u5EFA\u98CE\u683C\u4E00\u81F4\u7684\u65B0\u9879\u76EE\u3002
6273
7030
 
6274
7031
  \u89E6\u53D1\u8BCD\uFF1A
6275
7032
  - "\u53C2\u8003 xx \u9879\u76EE\u521B\u5EFA\u65B0\u9879\u76EE"
@@ -6283,33 +7040,33 @@ var CopilotPromptsMCPServer = class {
6283
7040
  3. \u5206\u6790\u6838\u5FC3\u9875\u9762\u7ED3\u6784\uFF08\u767B\u5F55\u3001\u5E03\u5C40\u3001\u5BFC\u822A\u7B49\uFF09
6284
7041
  4. \u751F\u6210\u9879\u76EE\u8D28\u91CF\u8BC4\u4F30\u548C MCP \u6A21\u677F\u5EFA\u8BAE
6285
7042
  5. \u53EF\u9009\u62E9\u751F\u6210\u5206\u6790\u6587\u6863\u548C\u5F00\u53D1\u8BA1\u5212`,
6286
- inputSchema: {
6287
- type: "object",
6288
- properties: {
6289
- projectPath: {
6290
- type: "string",
6291
- description: "\u53C2\u8003\u9879\u76EE\u7684\u7EDD\u5BF9\u8DEF\u5F84"
6292
- },
6293
- generateDocs: {
6294
- type: "boolean",
6295
- description: "\u662F\u5426\u751F\u6210\u5206\u6790\u6587\u6863\u5230\u76EE\u6807\u9879\u76EE",
6296
- default: false
6297
- },
6298
- newProjectName: {
6299
- type: "string",
6300
- description: "\u65B0\u9879\u76EE\u540D\u79F0\uFF08\u7528\u4E8E\u751F\u6210\u5F00\u53D1\u8BA1\u5212\uFF09"
6301
- },
6302
- newProjectPath: {
6303
- type: "string",
6304
- description: "\u65B0\u9879\u76EE\u8DEF\u5F84\uFF08\u7528\u4E8E\u751F\u6210\u6587\u6863\uFF09"
6305
- }
7043
+ inputSchema: {
7044
+ type: "object",
7045
+ properties: {
7046
+ projectPath: {
7047
+ type: "string",
7048
+ description: "\u53C2\u8003\u9879\u76EE\u7684\u7EDD\u5BF9\u8DEF\u5F84"
6306
7049
  },
6307
- required: ["projectPath"]
6308
- }
6309
- },
6310
- {
6311
- name: "generate_project_skeleton",
6312
- description: `\u3010\u9879\u76EE\u514B\u9686\u3011\u57FA\u4E8E\u5206\u6790\u7ED3\u679C\u751F\u6210\u9879\u76EE\u9AA8\u67B6\u3002
7050
+ generateDocs: {
7051
+ type: "boolean",
7052
+ description: "\u662F\u5426\u751F\u6210\u5206\u6790\u6587\u6863\u5230\u76EE\u6807\u9879\u76EE",
7053
+ default: false
7054
+ },
7055
+ newProjectName: {
7056
+ type: "string",
7057
+ description: "\u65B0\u9879\u76EE\u540D\u79F0\uFF08\u7528\u4E8E\u751F\u6210\u5F00\u53D1\u8BA1\u5212\uFF09"
7058
+ },
7059
+ newProjectPath: {
7060
+ type: "string",
7061
+ description: "\u65B0\u9879\u76EE\u8DEF\u5F84\uFF08\u7528\u4E8E\u751F\u6210\u6587\u6863\uFF09"
7062
+ }
7063
+ },
7064
+ required: ["projectPath"]
7065
+ }
7066
+ },
7067
+ {
7068
+ name: "generate_project_skeleton",
7069
+ description: `\u3010\u9879\u76EE\u514B\u9686\u3011\u57FA\u4E8E\u5206\u6790\u7ED3\u679C\u751F\u6210\u9879\u76EE\u9AA8\u67B6\u3002
6313
7070
 
6314
7071
  \u529F\u80FD\uFF1A
6315
7072
  1. \u5206\u6790\u53C2\u8003\u9879\u76EE\u7684\u67B6\u6784
@@ -6321,43 +7078,43 @@ var CopilotPromptsMCPServer = class {
6321
7078
  - docs/PROJECT_ANALYSIS.md - \u9879\u76EE\u5206\u6790\u62A5\u544A
6322
7079
  - docs/DEVELOPMENT_PLAN.md - \u5F00\u53D1\u8BA1\u5212
6323
7080
  - docs/SKELETON_CHECKLIST.md - \u9AA8\u67B6\u6E05\u5355`,
6324
- inputSchema: {
6325
- type: "object",
6326
- properties: {
6327
- referenceProjectPath: {
6328
- type: "string",
6329
- description: "\u53C2\u8003\u9879\u76EE\u7684\u7EDD\u5BF9\u8DEF\u5F84"
6330
- },
6331
- newProjectPath: {
6332
- type: "string",
6333
- description: "\u65B0\u9879\u76EE\u7684\u7EDD\u5BF9\u8DEF\u5F84"
6334
- },
6335
- newProjectName: {
6336
- type: "string",
6337
- description: "\u65B0\u9879\u76EE\u540D\u79F0"
6338
- },
6339
- generateDocs: {
6340
- type: "boolean",
6341
- description: "\u662F\u5426\u751F\u6210\u5206\u6790\u6587\u6863",
6342
- default: true
6343
- },
6344
- includeLayers: {
6345
- type: "array",
6346
- items: { type: "string" },
6347
- description: "\u8981\u5305\u542B\u7684\u5C42\u7EA7\uFF08\u53EF\u9009\uFF09"
6348
- },
6349
- excludePatterns: {
6350
- type: "array",
6351
- items: { type: "string" },
6352
- description: "\u8981\u6392\u9664\u7684\u6587\u4EF6\u6A21\u5F0F"
6353
- }
7081
+ inputSchema: {
7082
+ type: "object",
7083
+ properties: {
7084
+ referenceProjectPath: {
7085
+ type: "string",
7086
+ description: "\u53C2\u8003\u9879\u76EE\u7684\u7EDD\u5BF9\u8DEF\u5F84"
6354
7087
  },
6355
- required: ["referenceProjectPath", "newProjectPath", "newProjectName"]
6356
- }
6357
- },
6358
- {
6359
- name: "troubleshoot",
6360
- description: `\u3010\u95EE\u9898\u8BCA\u65AD\u3011\u9047\u5230\u95EE\u9898\u65F6\u4F18\u5148\u8C03\u7528\uFF01\u57FA\u4E8E\u771F\u5B9E\u9879\u76EE\u7ECF\u9A8C\u7684\u6545\u969C\u6392\u9664\u5E93\u3002
7088
+ newProjectPath: {
7089
+ type: "string",
7090
+ description: "\u65B0\u9879\u76EE\u7684\u7EDD\u5BF9\u8DEF\u5F84"
7091
+ },
7092
+ newProjectName: {
7093
+ type: "string",
7094
+ description: "\u65B0\u9879\u76EE\u540D\u79F0"
7095
+ },
7096
+ generateDocs: {
7097
+ type: "boolean",
7098
+ description: "\u662F\u5426\u751F\u6210\u5206\u6790\u6587\u6863",
7099
+ default: true
7100
+ },
7101
+ includeLayers: {
7102
+ type: "array",
7103
+ items: { type: "string" },
7104
+ description: "\u8981\u5305\u542B\u7684\u5C42\u7EA7\uFF08\u53EF\u9009\uFF09"
7105
+ },
7106
+ excludePatterns: {
7107
+ type: "array",
7108
+ items: { type: "string" },
7109
+ description: "\u8981\u6392\u9664\u7684\u6587\u4EF6\u6A21\u5F0F"
7110
+ }
7111
+ },
7112
+ required: ["referenceProjectPath", "newProjectPath", "newProjectName"]
7113
+ }
7114
+ },
7115
+ {
7116
+ name: "troubleshoot",
7117
+ description: `\u3010\u95EE\u9898\u8BCA\u65AD\u3011\u9047\u5230\u95EE\u9898\u65F6\u4F18\u5148\u8C03\u7528\uFF01\u57FA\u4E8E\u771F\u5B9E\u9879\u76EE\u7ECF\u9A8C\u7684\u6545\u969C\u6392\u9664\u5E93\u3002
6361
7118
 
6362
7119
  \u26A0\uFE0F **\u4F55\u65F6\u4F7F\u7528**\uFF08AI \u8BF7\u6CE8\u610F\uFF09\uFF1A
6363
7120
  - \u7528\u6237\u63CF\u8FF0\u4E86\u4EFB\u4F55\u6280\u672F\u95EE\u9898\u6216\u9519\u8BEF
@@ -6375,360 +7132,110 @@ var CopilotPromptsMCPServer = class {
6375
7132
  - Flutter: \u9634\u5F71\u900F\u51FA\u3001\u5E03\u5C40\u504F\u79FB\u3001\u52A8\u753B\u540C\u6B65\u3001SVG\u95EE\u9898\u3001Sketch\u8FD8\u539F
6376
7133
  - Vue3: Element Plus\u8868\u683C\u8FB9\u6846\u3001\u6837\u5F0F\u51B2\u7A81
6377
7134
  - \u6301\u7EED\u66F4\u65B0\u4E2D...`,
6378
- inputSchema: {
6379
- type: "object",
6380
- properties: {
6381
- problem: {
6382
- type: "string",
6383
- description: "\u95EE\u9898\u63CF\u8FF0\uFF08\u7528\u6237\u8BF4\u7684\u8BDD\u6216\u9519\u8BEF\u4FE1\u606F\uFF09\uFF0C\u76F4\u63A5\u4F20\u5165\u5373\u53EF"
6384
- },
6385
- framework: {
6386
- type: "string",
6387
- enum: ["flutter", "vue3", "react"],
6388
- description: "\u6846\u67B6\u7C7B\u578B\uFF08\u53EF\u9009\uFF0C\u4F1A\u81EA\u52A8\u68C0\u6D4B\uFF09"
6389
- },
6390
- codeSnippet: {
6391
- type: "string",
6392
- description: "\u76F8\u5173\u4EE3\u7801\u7247\u6BB5\uFF08\u53EF\u9009\uFF09"
6393
- }
6394
- }
6395
- }
6396
- },
6397
- {
6398
- name: "query_troubleshooting_cases",
6399
- description: "\u3010\u9AD8\u7EA7\u3011\u7CBE\u786E\u67E5\u8BE2\u6545\u969C\u6392\u9664\u6848\u4F8B\uFF08\u666E\u901A\u95EE\u9898\u8BF7\u7528 troubleshoot\uFF09",
6400
- inputSchema: {
6401
- type: "object",
6402
- properties: {
6403
- framework: {
6404
- type: "string",
6405
- enum: ["flutter", "vue3", "react", "common"],
6406
- description: "\u6846\u67B6\u7C7B\u578B"
6407
- },
6408
- keywords: {
6409
- type: "array",
6410
- items: { type: "string" },
6411
- description: "\u95EE\u9898\u5173\u952E\u8BCD"
6412
- },
6413
- errorMessage: {
6414
- type: "string",
6415
- description: "\u9519\u8BEF\u4FE1\u606F"
6416
- },
6417
- limit: {
6418
- type: "number",
6419
- default: 5
6420
- }
6421
- }
6422
- }
6423
- },
6424
- {
6425
- name: "get_troubleshooting_case",
6426
- description: "\u83B7\u53D6\u6307\u5B9A\u6545\u969C\u6392\u9664\u6848\u4F8B\u7684\u5B8C\u6574\u5185\u5BB9",
6427
- inputSchema: {
6428
- type: "object",
6429
- properties: {
6430
- framework: {
6431
- type: "string",
6432
- description: "\u6846\u67B6\u7C7B\u578B"
6433
- },
6434
- caseId: {
6435
- type: "string",
6436
- description: "\u6848\u4F8B ID"
6437
- }
6438
- },
6439
- required: ["framework", "caseId"]
6440
- }
6441
- },
6442
- {
6443
- name: "list_troubleshooting_cases",
6444
- description: "\u5217\u51FA\u6240\u6709\u53EF\u7528\u7684\u6545\u969C\u6392\u9664\u6848\u4F8B",
6445
- inputSchema: {
6446
- type: "object",
6447
- properties: {
6448
- framework: {
6449
- type: "string",
6450
- description: "\u6309\u6846\u67B6\u7B5B\u9009\uFF08\u53EF\u9009\uFF09"
6451
- }
6452
- }
6453
- }
6454
- },
6455
- // ================== 知识图谱记忆工具 ==================
6456
- {
6457
- name: "create_entities",
6458
- description: "\u5728\u77E5\u8BC6\u56FE\u8C31\u4E2D\u521B\u5EFA\u591A\u4E2A\u65B0\u5B9E\u4F53",
6459
- inputSchema: {
6460
- type: "object",
6461
- properties: {
6462
- entities: {
6463
- type: "array",
6464
- description: "\u5B9E\u4F53\u6570\u7EC4",
6465
- items: {
6466
- type: "object",
6467
- properties: {
6468
- name: { type: "string", description: "\u5B9E\u4F53\u540D\u79F0\uFF08\u552F\u4E00\u6807\u8BC6\uFF09" },
6469
- entityType: { type: "string", description: "\u5B9E\u4F53\u7C7B\u578B\uFF08\u5982 person\u3001project\u3001concept\uFF09" },
6470
- observations: { type: "array", items: { type: "string" }, description: "\u5173\u4E8E\u8BE5\u5B9E\u4F53\u7684\u89C2\u5BDF/\u4E8B\u5B9E" }
6471
- },
6472
- required: ["name", "entityType", "observations"]
6473
- }
6474
- }
6475
- },
6476
- required: ["entities"]
6477
- }
6478
- },
6479
- {
6480
- name: "create_relations",
6481
- description: "\u5728\u77E5\u8BC6\u56FE\u8C31\u4E2D\u521B\u5EFA\u5B9E\u4F53\u4E4B\u95F4\u7684\u5173\u7CFB\uFF08\u4F7F\u7528\u4E3B\u52A8\u8BED\u6001\uFF09",
6482
- inputSchema: {
6483
- type: "object",
6484
- properties: {
6485
- relations: {
6486
- type: "array",
6487
- description: "\u5173\u7CFB\u6570\u7EC4",
6488
- items: {
6489
- type: "object",
6490
- properties: {
6491
- from: { type: "string", description: "\u8D77\u59CB\u5B9E\u4F53\u540D\u79F0" },
6492
- to: { type: "string", description: "\u76EE\u6807\u5B9E\u4F53\u540D\u79F0" },
6493
- relationType: { type: "string", description: "\u5173\u7CFB\u7C7B\u578B\uFF08\u4E3B\u52A8\u8BED\u6001\uFF0C\u5982 works_at\u3001uses\u3001depends_on\uFF09" }
6494
- },
6495
- required: ["from", "to", "relationType"]
6496
- }
6497
- }
6498
- },
6499
- required: ["relations"]
6500
- }
6501
- },
6502
- {
6503
- name: "add_observations",
6504
- description: "\u5411\u73B0\u6709\u5B9E\u4F53\u6DFB\u52A0\u65B0\u7684\u89C2\u5BDF/\u4E8B\u5B9E",
6505
- inputSchema: {
6506
- type: "object",
6507
- properties: {
6508
- observations: {
6509
- type: "array",
6510
- description: "\u89C2\u5BDF\u6570\u7EC4",
6511
- items: {
6512
- type: "object",
6513
- properties: {
6514
- entityName: { type: "string", description: "\u5B9E\u4F53\u540D\u79F0" },
6515
- contents: { type: "array", items: { type: "string" }, description: "\u8981\u6DFB\u52A0\u7684\u89C2\u5BDF\u5185\u5BB9" }
6516
- },
6517
- required: ["entityName", "contents"]
6518
- }
6519
- }
6520
- },
6521
- required: ["observations"]
6522
- }
6523
- },
6524
- {
6525
- name: "delete_entities",
6526
- description: "\u5220\u9664\u5B9E\u4F53\u53CA\u5176\u5173\u8054\u7684\u5173\u7CFB",
6527
- inputSchema: {
6528
- type: "object",
6529
- properties: {
6530
- entityNames: {
6531
- type: "array",
6532
- items: { type: "string" },
6533
- description: "\u8981\u5220\u9664\u7684\u5B9E\u4F53\u540D\u79F0\u5217\u8868"
6534
- }
7135
+ inputSchema: {
7136
+ type: "object",
7137
+ properties: {
7138
+ problem: {
7139
+ type: "string",
7140
+ description: "\u95EE\u9898\u63CF\u8FF0\uFF08\u7528\u6237\u8BF4\u7684\u8BDD\u6216\u9519\u8BEF\u4FE1\u606F\uFF09\uFF0C\u76F4\u63A5\u4F20\u5165\u5373\u53EF"
6535
7141
  },
6536
- required: ["entityNames"]
6537
- }
6538
- },
6539
- {
6540
- name: "delete_observations",
6541
- description: "\u4ECE\u5B9E\u4F53\u4E2D\u5220\u9664\u7279\u5B9A\u7684\u89C2\u5BDF",
6542
- inputSchema: {
6543
- type: "object",
6544
- properties: {
6545
- deletions: {
6546
- type: "array",
6547
- items: {
6548
- type: "object",
6549
- properties: {
6550
- entityName: { type: "string", description: "\u5B9E\u4F53\u540D\u79F0" },
6551
- observations: { type: "array", items: { type: "string" }, description: "\u8981\u5220\u9664\u7684\u89C2\u5BDF" }
6552
- },
6553
- required: ["entityName", "observations"]
6554
- }
6555
- }
7142
+ framework: {
7143
+ type: "string",
7144
+ enum: ["flutter", "vue3", "react"],
7145
+ description: "\u6846\u67B6\u7C7B\u578B\uFF08\u53EF\u9009\uFF0C\u4F1A\u81EA\u52A8\u68C0\u6D4B\uFF09"
6556
7146
  },
6557
- required: ["deletions"]
7147
+ codeSnippet: {
7148
+ type: "string",
7149
+ description: "\u76F8\u5173\u4EE3\u7801\u7247\u6BB5\uFF08\u53EF\u9009\uFF09"
7150
+ }
6558
7151
  }
6559
- },
6560
- {
6561
- name: "delete_relations",
6562
- description: "\u4ECE\u77E5\u8BC6\u56FE\u8C31\u4E2D\u5220\u9664\u5173\u7CFB",
6563
- inputSchema: {
6564
- type: "object",
6565
- properties: {
6566
- relations: {
6567
- type: "array",
6568
- items: {
6569
- type: "object",
6570
- properties: {
6571
- from: { type: "string", description: "\u8D77\u59CB\u5B9E\u4F53\u540D\u79F0" },
6572
- to: { type: "string", description: "\u76EE\u6807\u5B9E\u4F53\u540D\u79F0" },
6573
- relationType: { type: "string", description: "\u5173\u7CFB\u7C7B\u578B" }
6574
- },
6575
- required: ["from", "to", "relationType"]
6576
- }
6577
- }
7152
+ }
7153
+ },
7154
+ {
7155
+ name: "query_troubleshooting_cases",
7156
+ description: "\u3010\u9AD8\u7EA7\u3011\u7CBE\u786E\u67E5\u8BE2\u6545\u969C\u6392\u9664\u6848\u4F8B\uFF08\u666E\u901A\u95EE\u9898\u8BF7\u7528 troubleshoot\uFF09",
7157
+ inputSchema: {
7158
+ type: "object",
7159
+ properties: {
7160
+ framework: {
7161
+ type: "string",
7162
+ enum: ["flutter", "vue3", "react", "common"],
7163
+ description: "\u6846\u67B6\u7C7B\u578B"
6578
7164
  },
6579
- required: ["relations"]
6580
- }
6581
- },
6582
- {
6583
- name: "read_graph",
6584
- description: "\u8BFB\u53D6\u6574\u4E2A\u77E5\u8BC6\u56FE\u8C31",
6585
- inputSchema: {
6586
- type: "object",
6587
- properties: {}
6588
- }
6589
- },
6590
- {
6591
- name: "search_nodes",
6592
- description: "\u5728\u77E5\u8BC6\u56FE\u8C31\u4E2D\u641C\u7D22\u8282\u70B9\uFF08\u6309\u540D\u79F0\u3001\u7C7B\u578B\u6216\u89C2\u5BDF\u5185\u5BB9\u5339\u914D\uFF09",
6593
- inputSchema: {
6594
- type: "object",
6595
- properties: {
6596
- query: {
6597
- type: "string",
6598
- description: "\u641C\u7D22\u5173\u952E\u8BCD"
6599
- }
7165
+ keywords: {
7166
+ type: "array",
7167
+ items: { type: "string" },
7168
+ description: "\u95EE\u9898\u5173\u952E\u8BCD"
6600
7169
  },
6601
- required: ["query"]
6602
- }
6603
- },
6604
- {
6605
- name: "open_nodes",
6606
- description: "\u6309\u540D\u79F0\u6253\u5F00\u7279\u5B9A\u8282\u70B9",
6607
- inputSchema: {
6608
- type: "object",
6609
- properties: {
6610
- names: {
6611
- type: "array",
6612
- items: { type: "string" },
6613
- description: "\u8981\u68C0\u7D22\u7684\u5B9E\u4F53\u540D\u79F0\u5217\u8868"
6614
- }
7170
+ errorMessage: {
7171
+ type: "string",
7172
+ description: "\u9519\u8BEF\u4FE1\u606F"
6615
7173
  },
6616
- required: ["names"]
7174
+ limit: {
7175
+ type: "number",
7176
+ default: 5
7177
+ }
6617
7178
  }
6618
- },
6619
- // ================== 顺序思考工具 ==================
6620
- {
6621
- name: "sequentialthinking",
6622
- description: `A detailed tool for dynamic and reflective problem-solving through thoughts.
6623
- This tool helps analyze problems through a flexible thinking process that can adapt and evolve.
6624
- Each thought can build on, question, or revise previous insights as understanding deepens.
6625
-
6626
- When to use this tool:
6627
- - Breaking down complex problems into steps
6628
- - Planning and design with room for revision
6629
- - Analysis that might need course correction
6630
- - Problems where the full scope might not be clear initially
6631
- - Problems that require a multi-step solution
6632
- - Tasks that need to maintain context over multiple steps
6633
- - Situations where irrelevant information needs to be filtered out
6634
-
6635
- Key features:
6636
- - You can adjust total_thoughts up or down as you progress
6637
- - You can question or revise previous thoughts
6638
- - You can add more thoughts even after reaching what seemed like the end
6639
- - You can express uncertainty and explore alternative approaches
6640
- - Not every thought needs to build linearly - you can branch or backtrack
6641
- - Generates a solution hypothesis
6642
- - Verifies the hypothesis based on the Chain of Thought steps
6643
- - Repeats the process until satisfied
6644
- - Provides a correct answer
6645
-
6646
- Parameters explained:
6647
- - thought: Your current thinking step, which can include:
6648
- * Regular analytical steps
6649
- * Revisions of previous thoughts
6650
- * Questions about previous decisions
6651
- * Realizations about needing more analysis
6652
- * Changes in approach
6653
- * Hypothesis generation
6654
- * Hypothesis verification
6655
- - nextThoughtNeeded: True if you need more thinking, even if at what seemed like the end
6656
- - thoughtNumber: Current number in sequence (can go beyond initial total if needed)
6657
- - totalThoughts: Current estimate of thoughts needed (can be adjusted up/down)
6658
- - isRevision: A boolean indicating if this thought revises previous thinking
6659
- - revisesThought: If is_revision is true, which thought number is being reconsidered
6660
- - branchFromThought: If branching, which thought number is the branching point
6661
- - branchId: Identifier for the current branch (if any)
6662
- - needsMoreThoughts: If reaching end but realizing more thoughts needed
6663
-
6664
- You should:
6665
- 1. Start with an initial estimate of needed thoughts, but be ready to adjust
6666
- 2. Feel free to question or revise previous thoughts
6667
- 3. Don't hesitate to add more thoughts if needed, even at the "end"
6668
- 4. Express uncertainty when present
6669
- 5. Mark thoughts that revise previous thinking or branch into new paths
6670
- 6. Ignore information that is irrelevant to the current step
6671
- 7. Generate a solution hypothesis when appropriate
6672
- 8. Verify the hypothesis based on the Chain of Thought steps
6673
- 9. Repeat the process until satisfied with the solution
6674
- 10. Provide a single, ideally correct answer as the final output
6675
- 11. Only set nextThoughtNeeded to false when truly done and a satisfactory answer is reached`,
6676
- inputSchema: {
6677
- type: "object",
6678
- properties: {
6679
- thought: {
6680
- type: "string",
6681
- description: "Your current thinking step"
6682
- },
6683
- nextThoughtNeeded: {
6684
- type: "boolean",
6685
- description: "Whether another thought step is needed"
6686
- },
6687
- thoughtNumber: {
6688
- type: "integer",
6689
- description: "Current thought number (numeric value, e.g., 1, 2, 3)",
6690
- minimum: 1
6691
- },
6692
- totalThoughts: {
6693
- type: "integer",
6694
- description: "Estimated total thoughts needed (numeric value, e.g., 5, 10)",
6695
- minimum: 1
6696
- },
6697
- isRevision: {
6698
- type: "boolean",
6699
- description: "Whether this revises previous thinking"
6700
- },
6701
- revisesThought: {
6702
- type: "integer",
6703
- description: "Which thought is being reconsidered",
6704
- minimum: 1
6705
- },
6706
- branchFromThought: {
6707
- type: "integer",
6708
- description: "Branching point thought number",
6709
- minimum: 1
6710
- },
6711
- branchId: {
6712
- type: "string",
6713
- description: "Branch identifier"
6714
- },
6715
- needsMoreThoughts: {
6716
- type: "boolean",
6717
- description: "If more thoughts are needed"
6718
- }
7179
+ }
7180
+ },
7181
+ {
7182
+ name: "get_troubleshooting_case",
7183
+ description: "\u83B7\u53D6\u6307\u5B9A\u6545\u969C\u6392\u9664\u6848\u4F8B\u7684\u5B8C\u6574\u5185\u5BB9",
7184
+ inputSchema: {
7185
+ type: "object",
7186
+ properties: {
7187
+ framework: {
7188
+ type: "string",
7189
+ description: "\u6846\u67B6\u7C7B\u578B"
6719
7190
  },
6720
- required: ["thought", "nextThoughtNeeded", "thoughtNumber", "totalThoughts"]
7191
+ caseId: {
7192
+ type: "string",
7193
+ description: "\u6848\u4F8B ID"
7194
+ }
7195
+ },
7196
+ required: ["framework", "caseId"]
7197
+ }
7198
+ },
7199
+ {
7200
+ name: "list_troubleshooting_cases",
7201
+ description: "\u5217\u51FA\u6240\u6709\u53EF\u7528\u7684\u6545\u969C\u6392\u9664\u6848\u4F8B",
7202
+ inputSchema: {
7203
+ type: "object",
7204
+ properties: {
7205
+ framework: {
7206
+ type: "string",
7207
+ description: "\u6309\u6846\u67B6\u7B5B\u9009\uFF08\u53EF\u9009\uFF09"
7208
+ }
6721
7209
  }
6722
7210
  }
6723
- ]
6724
- }));
7211
+ }
7212
+ ];
7213
+ this.server.setRequestHandler(ListToolsRequestSchema, async () => {
7214
+ let tools = [];
7215
+ switch (TOOL_MODE) {
7216
+ case "unified":
7217
+ tools = [mtaUnifiedTool, ...memoryAndThinkingTools];
7218
+ break;
7219
+ case "legacy":
7220
+ tools = [...legacyBusinessTools, ...memoryAndThinkingTools];
7221
+ break;
7222
+ case "hybrid":
7223
+ tools = [mtaUnifiedTool, ...legacyBusinessTools, ...memoryAndThinkingTools];
7224
+ break;
7225
+ default:
7226
+ tools = [mtaUnifiedTool, ...memoryAndThinkingTools];
7227
+ }
7228
+ return { tools };
7229
+ });
6725
7230
  this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
6726
7231
  var _a, _b;
6727
7232
  try {
6728
7233
  const { name, arguments: args } = request.params;
6729
7234
  logger3.debug(`\u8C03\u7528\u5DE5\u5177: ${name}`);
6730
7235
  logger3.debug(`\u53C2\u6570:`, args);
6731
- const workspacePath = (args == null ? void 0 : args.workspacePath) || (args == null ? void 0 : args.projectPath);
7236
+ const typedArgs = args;
7237
+ const mtaParams = (typedArgs == null ? void 0 : typedArgs.params) || {};
7238
+ const workspacePath = (typedArgs == null ? void 0 : typedArgs.workspacePath) || (typedArgs == null ? void 0 : typedArgs.projectPath) || (mtaParams == null ? void 0 : mtaParams.workspacePath) || (mtaParams == null ? void 0 : mtaParams.projectPath);
6732
7239
  let autoConfigMessage = null;
6733
7240
  if (workspacePath) {
6734
7241
  const configResult = ensureWorkspaceConfig(workspacePath);
@@ -6739,6 +7246,31 @@ You should:
6739
7246
  }
6740
7247
  let result;
6741
7248
  switch (name) {
7249
+ // ================== MTA 统一技能入口 ==================
7250
+ case "mta":
7251
+ {
7252
+ const unifiedArgs = args;
7253
+ if (!(unifiedArgs == null ? void 0 : unifiedArgs.skill)) {
7254
+ result = {
7255
+ content: [{
7256
+ type: "text",
7257
+ text: JSON.stringify({
7258
+ message: "\u8BF7\u6307\u5B9A skill \u53C2\u6570\u6765\u9009\u62E9\u8981\u6267\u884C\u7684\u6280\u80FD",
7259
+ availableSkills: this.skillRegistry.getAll().map((s) => ({
7260
+ name: s.name,
7261
+ category: s.category,
7262
+ description: s.description
7263
+ }))
7264
+ }, null, 2)
7265
+ }]
7266
+ };
7267
+ } else {
7268
+ const params = unifiedArgs.params || {};
7269
+ result = await this.skillRegistry.execute(unifiedArgs.skill, params);
7270
+ }
7271
+ }
7272
+ break;
7273
+ // ================== Legacy 业务工具 ==================
6742
7274
  case "analyze_project":
6743
7275
  result = await analyzeProject(args);
6744
7276
  break;
@@ -6761,10 +7293,22 @@ You should:
6761
7293
  result = await matchAgents(args);
6762
7294
  break;
6763
7295
  case "list_available_agents":
6764
- result = listAvailableAgents();
7296
+ result = wrapAsContent2(listAvailableAgents());
6765
7297
  break;
6766
7298
  case "generate_config":
6767
- result = await generateConfig(args);
7299
+ {
7300
+ const typedArgs2 = args;
7301
+ if (!(typedArgs2 == null ? void 0 : typedArgs2.projectPath)) {
7302
+ throw new Error("\u7F3A\u5C11\u5FC5\u586B\u53C2\u6570: projectPath");
7303
+ }
7304
+ result = await generateConfig({
7305
+ projectPath: typedArgs2.projectPath,
7306
+ agentIds: typedArgs2.agentIds,
7307
+ autoMatch: typedArgs2.autoMatch,
7308
+ updateMode: typedArgs2.updateMode,
7309
+ configId: typedArgs2.configId
7310
+ });
7311
+ }
6768
7312
  break;
6769
7313
  case "get_compact_standards":
6770
7314
  result = await getCompactStandards(args);
@@ -6782,16 +7326,50 @@ You should:
6782
7326
  result = await listTemplates(args);
6783
7327
  break;
6784
7328
  case "get_template":
6785
- result = await getTemplate(args);
7329
+ {
7330
+ const typedArgs2 = args;
7331
+ if (!(typedArgs2 == null ? void 0 : typedArgs2.id)) {
7332
+ throw new Error("\u7F3A\u5C11\u5FC5\u586B\u53C2\u6570: id");
7333
+ }
7334
+ result = await getTemplate({
7335
+ id: typedArgs2.id,
7336
+ includeFiles: typedArgs2.includeFiles,
7337
+ files: typedArgs2.files
7338
+ });
7339
+ }
6786
7340
  break;
6787
7341
  case "analyze_reference_project":
6788
- result = await analyzeReferenceProject(args);
7342
+ {
7343
+ const typedArgs2 = args;
7344
+ if (!(typedArgs2 == null ? void 0 : typedArgs2.projectPath)) {
7345
+ throw new Error("\u7F3A\u5C11\u5FC5\u586B\u53C2\u6570: projectPath");
7346
+ }
7347
+ result = await analyzeReferenceProject({
7348
+ projectPath: typedArgs2.projectPath,
7349
+ generateDocs: typedArgs2.generateDocs,
7350
+ newProjectName: typedArgs2.newProjectName,
7351
+ newProjectPath: typedArgs2.newProjectPath
7352
+ });
7353
+ }
6789
7354
  break;
6790
7355
  case "generate_project_skeleton":
6791
- result = await generateProjectSkeleton(args);
7356
+ {
7357
+ const typedArgs2 = args;
7358
+ if (!(typedArgs2 == null ? void 0 : typedArgs2.referenceProjectPath) || !(typedArgs2 == null ? void 0 : typedArgs2.newProjectPath) || !(typedArgs2 == null ? void 0 : typedArgs2.newProjectName)) {
7359
+ throw new Error("\u7F3A\u5C11\u5FC5\u586B\u53C2\u6570: referenceProjectPath, newProjectPath, newProjectName");
7360
+ }
7361
+ result = await generateProjectSkeleton({
7362
+ referenceProjectPath: typedArgs2.referenceProjectPath,
7363
+ newProjectPath: typedArgs2.newProjectPath,
7364
+ newProjectName: typedArgs2.newProjectName,
7365
+ generateDocs: typedArgs2.generateDocs,
7366
+ includeLayers: typedArgs2.includeLayers,
7367
+ excludePatterns: typedArgs2.excludePatterns
7368
+ });
7369
+ }
6792
7370
  break;
6793
7371
  case "query_troubleshooting_cases":
6794
- result = await queryTroubleshootingCases(args);
7372
+ result = wrapAsContent2(await queryTroubleshootingCases(args));
6795
7373
  break;
6796
7374
  case "troubleshoot":
6797
7375
  const troubleshootArgs = args;
@@ -6818,50 +7396,122 @@ You should:
6818
7396
  }
6819
7397
  }
6820
7398
  const uniqueKeywords = [...new Set(extractedKeywords)];
6821
- result = await queryTroubleshootingCases({
7399
+ result = wrapAsContent2(await queryTroubleshootingCases({
6822
7400
  framework: detectedFramework,
6823
7401
  keywords: uniqueKeywords.length > 0 ? uniqueKeywords : void 0,
6824
7402
  errorMessage: problemText,
6825
7403
  limit: 5
6826
- });
7404
+ }));
6827
7405
  break;
6828
7406
  case "get_troubleshooting_case":
6829
- result = await getTroubleshootingCaseContent(args);
7407
+ result = wrapAsContent2(await getTroubleshootingCaseContent({
7408
+ framework: (args == null ? void 0 : args.framework) || "",
7409
+ caseId: (args == null ? void 0 : args.caseId) || ""
7410
+ }));
6830
7411
  break;
6831
7412
  case "list_troubleshooting_cases":
6832
- result = await listTroubleshootingCases(args == null ? void 0 : args.framework);
7413
+ result = wrapAsContent2(await listTroubleshootingCases(args == null ? void 0 : args.framework));
6833
7414
  break;
6834
7415
  // ================== 知识图谱记忆工具 ==================
6835
7416
  case "create_entities":
6836
- result = await createEntities(args);
7417
+ {
7418
+ const typedArgs2 = args;
7419
+ if (!(typedArgs2 == null ? void 0 : typedArgs2.entities) || !Array.isArray(typedArgs2.entities)) {
7420
+ throw new Error("\u7F3A\u5C11\u5FC5\u586B\u53C2\u6570: entities");
7421
+ }
7422
+ const normalizedEntities = typedArgs2.entities.map((e) => ({
7423
+ name: e.name,
7424
+ entityType: e.entityType,
7425
+ observations: e.observations || []
7426
+ }));
7427
+ result = await createEntities({ entities: normalizedEntities });
7428
+ }
6837
7429
  break;
6838
7430
  case "create_relations":
6839
- result = await createRelations(args);
7431
+ {
7432
+ const typedArgs2 = args;
7433
+ if (!(typedArgs2 == null ? void 0 : typedArgs2.relations) || !Array.isArray(typedArgs2.relations)) {
7434
+ throw new Error("\u7F3A\u5C11\u5FC5\u586B\u53C2\u6570: relations");
7435
+ }
7436
+ result = await createRelations({ relations: typedArgs2.relations });
7437
+ }
6840
7438
  break;
6841
7439
  case "add_observations":
6842
- result = await addObservations(args);
7440
+ {
7441
+ const typedArgs2 = args;
7442
+ if (!(typedArgs2 == null ? void 0 : typedArgs2.observations) || !Array.isArray(typedArgs2.observations)) {
7443
+ throw new Error("\u7F3A\u5C11\u5FC5\u586B\u53C2\u6570: observations");
7444
+ }
7445
+ result = await addObservations({ observations: typedArgs2.observations });
7446
+ }
6843
7447
  break;
6844
7448
  case "delete_entities":
6845
- result = await deleteEntities(args);
7449
+ {
7450
+ const typedArgs2 = args;
7451
+ if (!(typedArgs2 == null ? void 0 : typedArgs2.entityNames) || !Array.isArray(typedArgs2.entityNames)) {
7452
+ throw new Error("\u7F3A\u5C11\u5FC5\u586B\u53C2\u6570: entityNames");
7453
+ }
7454
+ result = await deleteEntities({ entityNames: typedArgs2.entityNames });
7455
+ }
6846
7456
  break;
6847
7457
  case "delete_observations":
6848
- result = await deleteObservations(args);
7458
+ {
7459
+ const typedArgs2 = args;
7460
+ if (!(typedArgs2 == null ? void 0 : typedArgs2.deletions) || !Array.isArray(typedArgs2.deletions)) {
7461
+ throw new Error("\u7F3A\u5C11\u5FC5\u586B\u53C2\u6570: deletions");
7462
+ }
7463
+ result = await deleteObservations({ deletions: typedArgs2.deletions });
7464
+ }
6849
7465
  break;
6850
7466
  case "delete_relations":
6851
- result = await deleteRelations(args);
7467
+ {
7468
+ const typedArgs2 = args;
7469
+ if (!(typedArgs2 == null ? void 0 : typedArgs2.relations) || !Array.isArray(typedArgs2.relations)) {
7470
+ throw new Error("\u7F3A\u5C11\u5FC5\u586B\u53C2\u6570: relations");
7471
+ }
7472
+ result = await deleteRelations({ relations: typedArgs2.relations });
7473
+ }
6852
7474
  break;
6853
7475
  case "read_graph":
6854
7476
  result = await readGraph();
6855
7477
  break;
6856
7478
  case "search_nodes":
6857
- result = await searchNodes(args);
7479
+ {
7480
+ const typedArgs2 = args;
7481
+ if (!(typedArgs2 == null ? void 0 : typedArgs2.query)) {
7482
+ throw new Error("\u7F3A\u5C11\u5FC5\u586B\u53C2\u6570: query");
7483
+ }
7484
+ result = await searchNodes({ query: typedArgs2.query });
7485
+ }
6858
7486
  break;
6859
7487
  case "open_nodes":
6860
- result = await openNodes(args);
7488
+ {
7489
+ const typedArgs2 = args;
7490
+ if (!(typedArgs2 == null ? void 0 : typedArgs2.names) || !Array.isArray(typedArgs2.names)) {
7491
+ throw new Error("\u7F3A\u5C11\u5FC5\u586B\u53C2\u6570: names");
7492
+ }
7493
+ result = await openNodes({ names: typedArgs2.names });
7494
+ }
6861
7495
  break;
6862
7496
  // ================== 顺序思考工具 ==================
6863
7497
  case "sequentialthinking":
6864
- result = await sequentialThinking(args);
7498
+ {
7499
+ const typedArgs2 = args;
7500
+ if (!(typedArgs2 == null ? void 0 : typedArgs2.thought)) {
7501
+ throw new Error("\u7F3A\u5C11\u5FC5\u586B\u53C2\u6570: thought");
7502
+ }
7503
+ result = await sequentialThinking({
7504
+ thought: typedArgs2.thought,
7505
+ nextThoughtNeeded: typedArgs2.nextThoughtNeeded ?? true,
7506
+ thoughtNumber: typedArgs2.thoughtNumber ?? 1,
7507
+ totalThoughts: typedArgs2.totalThoughts ?? 5,
7508
+ isRevision: typedArgs2.isRevision,
7509
+ revisesThought: typedArgs2.revisesThought,
7510
+ branchFromThought: typedArgs2.branchFromThought,
7511
+ branchId: typedArgs2.branchId,
7512
+ needsMoreThoughts: typedArgs2.needsMoreThoughts
7513
+ });
7514
+ }
6865
7515
  break;
6866
7516
  default:
6867
7517
  throw new Error(`\u672A\u77E5\u5DE5\u5177: ${name}`);
@@ -6923,44 +7573,42 @@ You should:
6923
7573
  const { getResourceLoader: getResourceLoader2 } = await Promise.resolve().then(() => (init_resourceLoader(), resourceLoader_exports));
6924
7574
  const resourceLoader = getResourceLoader2();
6925
7575
  const stats = resourceLoader.getResourceStats();
7576
+ const isWindows = process.platform === "win32";
7577
+ const emoji = {
7578
+ rocket: isWindows ? "[*]" : "\u{1F680}",
7579
+ folder: isWindows ? "[D]" : "\u{1F4C2}",
7580
+ tool: isWindows ? "[T]" : "\u{1F527}",
7581
+ clock: isWindows ? "[!]" : "\u23F1\uFE0F",
7582
+ package: isWindows ? "[P]" : "\u{1F4E6}",
7583
+ list: isWindows ? "[L]" : "\u{1F4CB}",
7584
+ brain: isWindows ? "[M]" : "\u{1F9E0}",
7585
+ think: isWindows ? "[?]" : "\u{1F914}",
7586
+ bulb: isWindows ? "[i]" : "\u{1F4A1}",
7587
+ line: isWindows ? "=" : "\u2501"
7588
+ };
7589
+ const separator = emoji.line.repeat(43);
6926
7590
  const startupInfo = [
6927
- `\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501`,
6928
- `\u{1F680} MTA MCP Server v${SERVER_VERSION} \u5DF2\u542F\u52A8`,
6929
- `\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501`,
6930
- `\u{1F4C2} \u5DE5\u4F5C\u76EE\u5F55: ${process.cwd()}`,
6931
- `\u{1F527} Node \u7248\u672C: ${process.version}`,
6932
- `\u23F1\uFE0F \u542F\u52A8\u65F6\u95F4: ${(/* @__PURE__ */ new Date()).toLocaleString("zh-CN")}`,
6933
- ``,
6934
- `\u{1F4E6} \u5185\u7F6E\u8D44\u6E90:`,
6935
- ` \u2022 Agents: ${stats.agents} \u4E2A`,
6936
- ` \u2022 Standards: ${stats.standards} \u4E2A`,
6937
- ` \u2022 Templates: ${stats.templates} \u4E2A`,
6938
- ``,
6939
- `\u{1F4CB} \u53EF\u7528\u5DE5\u5177:`,
6940
- ` \u2022 analyze_project - \u5206\u6790\u9879\u76EE\u6280\u672F\u6808`,
6941
- ` \u2022 auto_setup - \u751F\u6210\u9879\u76EE\u914D\u7F6E`,
6942
- ` \u2022 health_check - \u5065\u5EB7\u68C0\u67E5\u8BCA\u65AD`,
6943
- ` \u2022 get_compact_standards - \u83B7\u53D6\u7F16\u7801\u89C4\u8303`,
6944
- ` \u2022 use_preset - \u4F7F\u7528\u9884\u8BBE\u573A\u666F`,
6945
- ` \u2022 match_agents - \u5339\u914D\u63A8\u8350 Agent`,
6946
- ` \u2022 analyze_reference_project - \u6DF1\u5EA6\u5206\u6790\u53C2\u8003\u9879\u76EE`,
6947
- ` \u2022 generate_project_skeleton - \u751F\u6210\u9879\u76EE\u9AA8\u67B6`,
7591
+ separator,
7592
+ `${emoji.rocket} MTA MCP Server v${SERVER_VERSION} Started`,
7593
+ separator,
7594
+ `${emoji.folder} CWD: ${process.cwd()}`,
7595
+ `${emoji.tool} Node: ${process.version}`,
7596
+ `${emoji.clock} Time: ${(/* @__PURE__ */ new Date()).toLocaleString()}`,
6948
7597
  ``,
6949
- `\u{1F9E0} \u77E5\u8BC6\u56FE\u8C31\u8BB0\u5FC6:`,
6950
- ` \u2022 create_entities - \u521B\u5EFA\u5B9E\u4F53`,
6951
- ` \u2022 create_relations - \u521B\u5EFA\u5173\u7CFB`,
6952
- ` \u2022 add_observations - \u6DFB\u52A0\u89C2\u5BDF`,
6953
- ` \u2022 read_graph - \u8BFB\u53D6\u56FE\u8C31`,
6954
- ` \u2022 search_nodes - \u641C\u7D22\u8282\u70B9`,
7598
+ `${emoji.package} Resources:`,
7599
+ ` - Agents: ${stats.agents}`,
7600
+ ` - Standards: ${stats.standards}`,
7601
+ ` - Templates: ${stats.templates}`,
6955
7602
  ``,
6956
- `\u{1F914} \u987A\u5E8F\u601D\u8003:`,
6957
- ` \u2022 sequentialthinking - \u52A8\u6001\u53CD\u601D\u6027\u95EE\u9898\u89E3\u51B3`,
7603
+ `${emoji.list} Mode: ${TOOL_MODE} | Skills: ${this.skillRegistry.getStats().total}`,
7604
+ `${emoji.brain} Memory: create_entities, create_relations, read_graph, search_nodes...`,
7605
+ `${emoji.think} Thinking: sequentialthinking`,
6958
7606
  ``,
6959
- `\u{1F4A1} \u63D0\u793A: \u5728 Copilot Chat \u4E2D\u4F7F\u7528 @mta \u8C03\u7528\u670D\u52A1`,
6960
- `\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501`
7607
+ `${emoji.bulb} Tip: Use @mta in Copilot Chat`,
7608
+ separator
6961
7609
  ];
6962
7610
  startupInfo.forEach((line) => console.error(line));
6963
- logger3.info(`MCP Server \u5C31\u7EEA\uFF0C\u7B49\u5F85 Copilot Chat \u8FDE\u63A5...`);
7611
+ logger3.info(`MCP Server ready, waiting for Copilot Chat connection...`);
6964
7612
  }
6965
7613
  };
6966
7614
  var isTestMode = process.env.MTA_TEST_MODE === "true" || process.argv.includes("--test");