@mcpc-tech/core 0.3.20 → 0.3.22

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.
Files changed (3) hide show
  1. package/index.cjs +94 -87
  2. package/index.mjs +94 -87
  3. package/package.json +1 -1
package/index.cjs CHANGED
@@ -17784,7 +17784,7 @@ You must follow the <manual/>, obey the <rules/>, and use the <format/>.
17784
17784
 
17785
17785
  <parameters>
17786
17786
  \`tool\` - Which tool to execute: "man" to get schemas, or a tool name to execute
17787
- \`args\` - For "man": array of tool names. For other tools: object with parameters.
17787
+ \`args\` - For "man": ["tool1", "tool2"]. For other tools: tool parameters that strictly adhere to the tool's JSON schema.
17788
17788
  </parameters>
17789
17789
 
17790
17790
  <rules>
@@ -17866,9 +17866,7 @@ Next: Execute \`{nextAction}\` by calling \`{toolName}\` again.`,
17866
17866
  /**
17867
17867
  * Error response templates
17868
17868
  */
17869
- ERROR_RESPONSE: `Validation failed: {errorMessage}
17870
-
17871
- Adjust parameters and retry.`,
17869
+ ERROR_RESPONSE: `Validation failed: {errorMessage}`,
17872
17870
  /**
17873
17871
  * Completion message
17874
17872
  */
@@ -17898,6 +17896,93 @@ var CompiledPrompts = {
17898
17896
  completionMessage: () => ResponseTemplates.COMPLETION_MESSAGE
17899
17897
  };
17900
17898
 
17899
+ // __mcpc__core_latest/node_modules/@mcpc/core/src/factories/args-def-factory.js
17900
+ function createArgsDefFactory(_name, _allToolNames, _depGroups, _predefinedSteps, _ensureStepActions) {
17901
+ return {
17902
+ forSampling: function() {
17903
+ return {
17904
+ type: "object",
17905
+ description: "Provide prompt for autonomous tool execution",
17906
+ properties: {
17907
+ prompt: {
17908
+ type: "string",
17909
+ description: "The task to be completed autonomously by the agentic system using available tools"
17910
+ },
17911
+ context: {
17912
+ type: "object",
17913
+ description: "Execution context, e.g., { cwd: '/path/to/dir' }. Any relevant fields allowed.",
17914
+ additionalProperties: true
17915
+ }
17916
+ },
17917
+ required: [
17918
+ "prompt",
17919
+ "context"
17920
+ ],
17921
+ errorMessage: {
17922
+ required: {
17923
+ prompt: "Missing required field 'prompt'. Please provide a clear task description.",
17924
+ context: "Missing required field 'context'. Please provide relevant context (e.g., { cwd: '...' })."
17925
+ }
17926
+ }
17927
+ };
17928
+ },
17929
+ /**
17930
+ * Agentic schema - simplified Unix-style interface
17931
+ *
17932
+ * Only two fields:
17933
+ * - `tool`: which tool to execute (enum includes "man" + all tool names)
17934
+ * - `args`: For "man": ["tool1", "tool2"] or { tools: [...] }. For others: tool parameters.
17935
+ */
17936
+ forAgentic: function(allToolNames) {
17937
+ const toolEnum = [
17938
+ "man",
17939
+ ...allToolNames
17940
+ ];
17941
+ return {
17942
+ type: "object",
17943
+ properties: {
17944
+ tool: {
17945
+ type: "string",
17946
+ enum: toolEnum,
17947
+ description: 'Which tool to execute. Use "man" to get tool schemas, or a tool name to execute.',
17948
+ errorMessage: {
17949
+ enum: `Invalid tool. Available: ${toolEnum.join(", ")}`
17950
+ }
17951
+ },
17952
+ args: {
17953
+ type: "object",
17954
+ description: `For "man": ["tool1", "tool2"]. For other tools: tool parameters that strictly adhere to the tool's JSON schema.`
17955
+ }
17956
+ },
17957
+ required: [
17958
+ "tool"
17959
+ ],
17960
+ additionalProperties: false
17961
+ };
17962
+ },
17963
+ /**
17964
+ * Schema for "man" command args validation (array format)
17965
+ * Expected format: ["tool1", "tool2"]
17966
+ */
17967
+ forMan: function(allToolNames) {
17968
+ return {
17969
+ type: "array",
17970
+ items: {
17971
+ type: "string",
17972
+ enum: allToolNames,
17973
+ errorMessage: {
17974
+ enum: `Invalid tool name. Available: ${allToolNames.join(", ")}`
17975
+ }
17976
+ },
17977
+ minItems: 1,
17978
+ errorMessage: {
17979
+ minItems: "At least one tool name is required"
17980
+ }
17981
+ };
17982
+ }
17983
+ };
17984
+ }
17985
+
17901
17986
  // __mcpc__core_latest/node_modules/@mcpc/core/src/utils/schema-validator.js
17902
17987
  var import_ajv2 = require("ajv");
17903
17988
  var import_ajv_formats2 = __toESM(require("ajv-formats"), 1);
@@ -18069,22 +18154,10 @@ var AgenticExecutor = class {
18069
18154
  }
18070
18155
  const tool2 = args.tool;
18071
18156
  if (tool2 === "man") {
18072
- const manSchema = {
18073
- type: "array",
18074
- items: {
18075
- type: "string",
18076
- enum: this.allToolNames,
18077
- errorMessage: {
18078
- enum: `Invalid tool name. Available: ${this.allToolNames.join(", ")}`
18079
- }
18080
- },
18081
- minItems: 1,
18082
- errorMessage: {
18083
- type: 'Expected an array of tool names, e.g. ["tool1", "tool2"]',
18084
- minItems: "At least one tool name is required"
18085
- }
18086
- };
18087
- const manValidation = validateSchema(args.args ?? [], manSchema);
18157
+ const toolsArray = Array.isArray(args.args) ? args.args : args.args?.tools;
18158
+ const createArgsDef = createArgsDefFactory(this.name, this.allToolNames, {});
18159
+ const manSchema = createArgsDef.forMan(this.allToolNames);
18160
+ const manValidation = validateSchema(toolsArray ?? [], manSchema);
18088
18161
  if (!manValidation.valid) {
18089
18162
  return {
18090
18163
  content: [
@@ -18096,7 +18169,7 @@ var AgenticExecutor = class {
18096
18169
  isError: true
18097
18170
  };
18098
18171
  }
18099
- return this.handleManCommand(args.args, executeSpan);
18172
+ return this.handleManCommand(toolsArray, executeSpan);
18100
18173
  }
18101
18174
  const toolArgs = args.args || {};
18102
18175
  return await this.executeTool(tool2, toolArgs, executeSpan);
@@ -18273,72 +18346,6 @@ ${JSON.stringify(cleanedSchema, null, 2)}
18273
18346
  }
18274
18347
  };
18275
18348
 
18276
- // __mcpc__core_latest/node_modules/@mcpc/core/src/factories/args-def-factory.js
18277
- function createArgsDefFactory(_name, _allToolNames, _depGroups, _predefinedSteps, _ensureStepActions) {
18278
- return {
18279
- forSampling: function() {
18280
- return {
18281
- type: "object",
18282
- description: "Provide prompt for autonomous tool execution",
18283
- properties: {
18284
- prompt: {
18285
- type: "string",
18286
- description: "The task to be completed autonomously by the agentic system using available tools"
18287
- },
18288
- context: {
18289
- type: "object",
18290
- description: "Execution context, e.g., { cwd: '/path/to/dir' }. Any relevant fields allowed.",
18291
- additionalProperties: true
18292
- }
18293
- },
18294
- required: [
18295
- "prompt",
18296
- "context"
18297
- ],
18298
- errorMessage: {
18299
- required: {
18300
- prompt: "Missing required field 'prompt'. Please provide a clear task description.",
18301
- context: "Missing required field 'context'. Please provide relevant context (e.g., { cwd: '...' })."
18302
- }
18303
- }
18304
- };
18305
- },
18306
- /**
18307
- * Agentic schema - simplified Unix-style interface
18308
- *
18309
- * Only two fields:
18310
- * - `tool`: which tool to execute (enum includes "man" + all tool names)
18311
- * - `args`: parameters for the tool (array for "man", object for others)
18312
- */
18313
- forAgentic: function(allToolNames) {
18314
- const toolEnum = [
18315
- "man",
18316
- ...allToolNames
18317
- ];
18318
- return {
18319
- type: "object",
18320
- properties: {
18321
- tool: {
18322
- type: "string",
18323
- enum: toolEnum,
18324
- description: 'Which tool to execute. Use "man" to get tool schemas, or a tool name to execute.',
18325
- errorMessage: {
18326
- enum: `Invalid tool. Available: ${toolEnum.join(", ")}`
18327
- }
18328
- },
18329
- args: {
18330
- description: 'For "man": array of tool names ["tool1", "tool2"]. For other tools: object with parameters.'
18331
- }
18332
- },
18333
- required: [
18334
- "tool"
18335
- ],
18336
- additionalProperties: false
18337
- };
18338
- }
18339
- };
18340
- }
18341
-
18342
18349
  // __mcpc__core_latest/node_modules/@mcpc/core/src/executors/agentic/agentic-tool-registrar.js
18343
18350
  function registerAgenticTool(server, { description, name, allToolNames, depGroups, toolNameToDetailList }) {
18344
18351
  const createArgsDef = createArgsDefFactory(name, allToolNames, depGroups, void 0, void 0);
package/index.mjs CHANGED
@@ -17772,7 +17772,7 @@ You must follow the <manual/>, obey the <rules/>, and use the <format/>.
17772
17772
 
17773
17773
  <parameters>
17774
17774
  \`tool\` - Which tool to execute: "man" to get schemas, or a tool name to execute
17775
- \`args\` - For "man": array of tool names. For other tools: object with parameters.
17775
+ \`args\` - For "man": ["tool1", "tool2"]. For other tools: tool parameters that strictly adhere to the tool's JSON schema.
17776
17776
  </parameters>
17777
17777
 
17778
17778
  <rules>
@@ -17854,9 +17854,7 @@ Next: Execute \`{nextAction}\` by calling \`{toolName}\` again.`,
17854
17854
  /**
17855
17855
  * Error response templates
17856
17856
  */
17857
- ERROR_RESPONSE: `Validation failed: {errorMessage}
17858
-
17859
- Adjust parameters and retry.`,
17857
+ ERROR_RESPONSE: `Validation failed: {errorMessage}`,
17860
17858
  /**
17861
17859
  * Completion message
17862
17860
  */
@@ -17886,6 +17884,93 @@ var CompiledPrompts = {
17886
17884
  completionMessage: () => ResponseTemplates.COMPLETION_MESSAGE
17887
17885
  };
17888
17886
 
17887
+ // __mcpc__core_latest/node_modules/@mcpc/core/src/factories/args-def-factory.js
17888
+ function createArgsDefFactory(_name, _allToolNames, _depGroups, _predefinedSteps, _ensureStepActions) {
17889
+ return {
17890
+ forSampling: function() {
17891
+ return {
17892
+ type: "object",
17893
+ description: "Provide prompt for autonomous tool execution",
17894
+ properties: {
17895
+ prompt: {
17896
+ type: "string",
17897
+ description: "The task to be completed autonomously by the agentic system using available tools"
17898
+ },
17899
+ context: {
17900
+ type: "object",
17901
+ description: "Execution context, e.g., { cwd: '/path/to/dir' }. Any relevant fields allowed.",
17902
+ additionalProperties: true
17903
+ }
17904
+ },
17905
+ required: [
17906
+ "prompt",
17907
+ "context"
17908
+ ],
17909
+ errorMessage: {
17910
+ required: {
17911
+ prompt: "Missing required field 'prompt'. Please provide a clear task description.",
17912
+ context: "Missing required field 'context'. Please provide relevant context (e.g., { cwd: '...' })."
17913
+ }
17914
+ }
17915
+ };
17916
+ },
17917
+ /**
17918
+ * Agentic schema - simplified Unix-style interface
17919
+ *
17920
+ * Only two fields:
17921
+ * - `tool`: which tool to execute (enum includes "man" + all tool names)
17922
+ * - `args`: For "man": ["tool1", "tool2"] or { tools: [...] }. For others: tool parameters.
17923
+ */
17924
+ forAgentic: function(allToolNames) {
17925
+ const toolEnum = [
17926
+ "man",
17927
+ ...allToolNames
17928
+ ];
17929
+ return {
17930
+ type: "object",
17931
+ properties: {
17932
+ tool: {
17933
+ type: "string",
17934
+ enum: toolEnum,
17935
+ description: 'Which tool to execute. Use "man" to get tool schemas, or a tool name to execute.',
17936
+ errorMessage: {
17937
+ enum: `Invalid tool. Available: ${toolEnum.join(", ")}`
17938
+ }
17939
+ },
17940
+ args: {
17941
+ type: "object",
17942
+ description: `For "man": ["tool1", "tool2"]. For other tools: tool parameters that strictly adhere to the tool's JSON schema.`
17943
+ }
17944
+ },
17945
+ required: [
17946
+ "tool"
17947
+ ],
17948
+ additionalProperties: false
17949
+ };
17950
+ },
17951
+ /**
17952
+ * Schema for "man" command args validation (array format)
17953
+ * Expected format: ["tool1", "tool2"]
17954
+ */
17955
+ forMan: function(allToolNames) {
17956
+ return {
17957
+ type: "array",
17958
+ items: {
17959
+ type: "string",
17960
+ enum: allToolNames,
17961
+ errorMessage: {
17962
+ enum: `Invalid tool name. Available: ${allToolNames.join(", ")}`
17963
+ }
17964
+ },
17965
+ minItems: 1,
17966
+ errorMessage: {
17967
+ minItems: "At least one tool name is required"
17968
+ }
17969
+ };
17970
+ }
17971
+ };
17972
+ }
17973
+
17889
17974
  // __mcpc__core_latest/node_modules/@mcpc/core/src/utils/schema-validator.js
17890
17975
  import { Ajv as Ajv2 } from "ajv";
17891
17976
  import addFormats from "ajv-formats";
@@ -18057,22 +18142,10 @@ var AgenticExecutor = class {
18057
18142
  }
18058
18143
  const tool2 = args.tool;
18059
18144
  if (tool2 === "man") {
18060
- const manSchema = {
18061
- type: "array",
18062
- items: {
18063
- type: "string",
18064
- enum: this.allToolNames,
18065
- errorMessage: {
18066
- enum: `Invalid tool name. Available: ${this.allToolNames.join(", ")}`
18067
- }
18068
- },
18069
- minItems: 1,
18070
- errorMessage: {
18071
- type: 'Expected an array of tool names, e.g. ["tool1", "tool2"]',
18072
- minItems: "At least one tool name is required"
18073
- }
18074
- };
18075
- const manValidation = validateSchema(args.args ?? [], manSchema);
18145
+ const toolsArray = Array.isArray(args.args) ? args.args : args.args?.tools;
18146
+ const createArgsDef = createArgsDefFactory(this.name, this.allToolNames, {});
18147
+ const manSchema = createArgsDef.forMan(this.allToolNames);
18148
+ const manValidation = validateSchema(toolsArray ?? [], manSchema);
18076
18149
  if (!manValidation.valid) {
18077
18150
  return {
18078
18151
  content: [
@@ -18084,7 +18157,7 @@ var AgenticExecutor = class {
18084
18157
  isError: true
18085
18158
  };
18086
18159
  }
18087
- return this.handleManCommand(args.args, executeSpan);
18160
+ return this.handleManCommand(toolsArray, executeSpan);
18088
18161
  }
18089
18162
  const toolArgs = args.args || {};
18090
18163
  return await this.executeTool(tool2, toolArgs, executeSpan);
@@ -18261,72 +18334,6 @@ ${JSON.stringify(cleanedSchema, null, 2)}
18261
18334
  }
18262
18335
  };
18263
18336
 
18264
- // __mcpc__core_latest/node_modules/@mcpc/core/src/factories/args-def-factory.js
18265
- function createArgsDefFactory(_name, _allToolNames, _depGroups, _predefinedSteps, _ensureStepActions) {
18266
- return {
18267
- forSampling: function() {
18268
- return {
18269
- type: "object",
18270
- description: "Provide prompt for autonomous tool execution",
18271
- properties: {
18272
- prompt: {
18273
- type: "string",
18274
- description: "The task to be completed autonomously by the agentic system using available tools"
18275
- },
18276
- context: {
18277
- type: "object",
18278
- description: "Execution context, e.g., { cwd: '/path/to/dir' }. Any relevant fields allowed.",
18279
- additionalProperties: true
18280
- }
18281
- },
18282
- required: [
18283
- "prompt",
18284
- "context"
18285
- ],
18286
- errorMessage: {
18287
- required: {
18288
- prompt: "Missing required field 'prompt'. Please provide a clear task description.",
18289
- context: "Missing required field 'context'. Please provide relevant context (e.g., { cwd: '...' })."
18290
- }
18291
- }
18292
- };
18293
- },
18294
- /**
18295
- * Agentic schema - simplified Unix-style interface
18296
- *
18297
- * Only two fields:
18298
- * - `tool`: which tool to execute (enum includes "man" + all tool names)
18299
- * - `args`: parameters for the tool (array for "man", object for others)
18300
- */
18301
- forAgentic: function(allToolNames) {
18302
- const toolEnum = [
18303
- "man",
18304
- ...allToolNames
18305
- ];
18306
- return {
18307
- type: "object",
18308
- properties: {
18309
- tool: {
18310
- type: "string",
18311
- enum: toolEnum,
18312
- description: 'Which tool to execute. Use "man" to get tool schemas, or a tool name to execute.',
18313
- errorMessage: {
18314
- enum: `Invalid tool. Available: ${toolEnum.join(", ")}`
18315
- }
18316
- },
18317
- args: {
18318
- description: 'For "man": array of tool names ["tool1", "tool2"]. For other tools: object with parameters.'
18319
- }
18320
- },
18321
- required: [
18322
- "tool"
18323
- ],
18324
- additionalProperties: false
18325
- };
18326
- }
18327
- };
18328
- }
18329
-
18330
18337
  // __mcpc__core_latest/node_modules/@mcpc/core/src/executors/agentic/agentic-tool-registrar.js
18331
18338
  function registerAgenticTool(server, { description, name, allToolNames, depGroups, toolNameToDetailList }) {
18332
18339
  const createArgsDef = createArgsDefFactory(name, allToolNames, depGroups, void 0, void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcpc-tech/core",
3
- "version": "0.3.20",
3
+ "version": "0.3.22",
4
4
  "homepage": "https://jsr.io/@mcpc/core",
5
5
  "dependencies": {
6
6
  "@ai-sdk/provider": "^2.0.0",