@mcpc-tech/core 0.3.22 → 0.3.23
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/index.cjs +33 -18
- package/index.mjs +33 -18
- 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": ["tool1", "tool2"]. For other tools: tool parameters that strictly adhere to the tool's JSON schema.
|
|
17787
|
+
\`args\` - For "man": { tools: ["tool1", "tool2"] }. For other tools: tool parameters that strictly adhere to the tool's JSON schema.
|
|
17788
17788
|
</parameters>
|
|
17789
17789
|
|
|
17790
17790
|
<rules>
|
|
@@ -17799,7 +17799,7 @@ Get tool schemas:
|
|
|
17799
17799
|
\`\`\`json
|
|
17800
17800
|
{
|
|
17801
17801
|
"tool": "man",
|
|
17802
|
-
"args": ["tool1", "tool2"]
|
|
17802
|
+
"args": { "tools": ["tool1", "tool2"] }
|
|
17803
17803
|
}
|
|
17804
17804
|
\`\`\`
|
|
17805
17805
|
|
|
@@ -17866,7 +17866,9 @@ Next: Execute \`{nextAction}\` by calling \`{toolName}\` again.`,
|
|
|
17866
17866
|
/**
|
|
17867
17867
|
* Error response templates
|
|
17868
17868
|
*/
|
|
17869
|
-
ERROR_RESPONSE: `Validation failed: {errorMessage}
|
|
17869
|
+
ERROR_RESPONSE: `Validation failed: {errorMessage}
|
|
17870
|
+
|
|
17871
|
+
Adjust parameters and retry.`,
|
|
17870
17872
|
/**
|
|
17871
17873
|
* Completion message
|
|
17872
17874
|
*/
|
|
@@ -17931,7 +17933,7 @@ function createArgsDefFactory(_name, _allToolNames, _depGroups, _predefinedSteps
|
|
|
17931
17933
|
*
|
|
17932
17934
|
* Only two fields:
|
|
17933
17935
|
* - `tool`: which tool to execute (enum includes "man" + all tool names)
|
|
17934
|
-
* - `args`: For "man": ["
|
|
17936
|
+
* - `args`: object with parameters. For "man": { tools: ["a", "b"] }. For others: tool parameters.
|
|
17935
17937
|
*/
|
|
17936
17938
|
forAgentic: function(allToolNames) {
|
|
17937
17939
|
const toolEnum = [
|
|
@@ -17951,7 +17953,7 @@ function createArgsDefFactory(_name, _allToolNames, _depGroups, _predefinedSteps
|
|
|
17951
17953
|
},
|
|
17952
17954
|
args: {
|
|
17953
17955
|
type: "object",
|
|
17954
|
-
description: `For "man": ["tool1", "tool2"]. For other tools: tool parameters that strictly adhere to the tool's JSON schema.`
|
|
17956
|
+
description: `For "man": { tools: ["tool1", "tool2"] }. For other tools: tool parameters that strictly adhere to the tool's JSON schema.`
|
|
17955
17957
|
}
|
|
17956
17958
|
},
|
|
17957
17959
|
required: [
|
|
@@ -17961,22 +17963,35 @@ function createArgsDefFactory(_name, _allToolNames, _depGroups, _predefinedSteps
|
|
|
17961
17963
|
};
|
|
17962
17964
|
},
|
|
17963
17965
|
/**
|
|
17964
|
-
* Schema for "man" command args validation
|
|
17965
|
-
* Expected format: ["tool1", "tool2"]
|
|
17966
|
+
* Schema for "man" command args validation
|
|
17967
|
+
* Expected format: { tools: ["tool1", "tool2"] }
|
|
17966
17968
|
*/
|
|
17967
17969
|
forMan: function(allToolNames) {
|
|
17968
17970
|
return {
|
|
17969
|
-
type: "
|
|
17970
|
-
|
|
17971
|
-
|
|
17972
|
-
|
|
17973
|
-
|
|
17974
|
-
|
|
17971
|
+
type: "object",
|
|
17972
|
+
properties: {
|
|
17973
|
+
tools: {
|
|
17974
|
+
type: "array",
|
|
17975
|
+
items: {
|
|
17976
|
+
type: "string",
|
|
17977
|
+
enum: allToolNames,
|
|
17978
|
+
errorMessage: {
|
|
17979
|
+
enum: `Invalid tool name. Available: ${allToolNames.join(", ")}`
|
|
17980
|
+
}
|
|
17981
|
+
},
|
|
17982
|
+
minItems: 1,
|
|
17983
|
+
errorMessage: {
|
|
17984
|
+
minItems: "At least one tool name is required"
|
|
17985
|
+
}
|
|
17975
17986
|
}
|
|
17976
17987
|
},
|
|
17977
|
-
|
|
17988
|
+
required: [
|
|
17989
|
+
"tools"
|
|
17990
|
+
],
|
|
17978
17991
|
errorMessage: {
|
|
17979
|
-
|
|
17992
|
+
required: {
|
|
17993
|
+
tools: 'Missing "tools" field. Expected: { tools: ["tool1", "tool2"] }'
|
|
17994
|
+
}
|
|
17980
17995
|
}
|
|
17981
17996
|
};
|
|
17982
17997
|
}
|
|
@@ -18154,10 +18169,9 @@ var AgenticExecutor = class {
|
|
|
18154
18169
|
}
|
|
18155
18170
|
const tool2 = args.tool;
|
|
18156
18171
|
if (tool2 === "man") {
|
|
18157
|
-
const toolsArray = Array.isArray(args.args) ? args.args : args.args?.tools;
|
|
18158
18172
|
const createArgsDef = createArgsDefFactory(this.name, this.allToolNames, {});
|
|
18159
18173
|
const manSchema = createArgsDef.forMan(this.allToolNames);
|
|
18160
|
-
const manValidation = validateSchema(
|
|
18174
|
+
const manValidation = validateSchema(args.args ?? {}, manSchema);
|
|
18161
18175
|
if (!manValidation.valid) {
|
|
18162
18176
|
return {
|
|
18163
18177
|
content: [
|
|
@@ -18169,7 +18183,8 @@ var AgenticExecutor = class {
|
|
|
18169
18183
|
isError: true
|
|
18170
18184
|
};
|
|
18171
18185
|
}
|
|
18172
|
-
|
|
18186
|
+
const argsObj = args.args;
|
|
18187
|
+
return this.handleManCommand(argsObj.tools, executeSpan);
|
|
18173
18188
|
}
|
|
18174
18189
|
const toolArgs = args.args || {};
|
|
18175
18190
|
return await this.executeTool(tool2, toolArgs, executeSpan);
|
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": ["tool1", "tool2"]. For other tools: tool parameters that strictly adhere to the tool's JSON schema.
|
|
17775
|
+
\`args\` - For "man": { tools: ["tool1", "tool2"] }. For other tools: tool parameters that strictly adhere to the tool's JSON schema.
|
|
17776
17776
|
</parameters>
|
|
17777
17777
|
|
|
17778
17778
|
<rules>
|
|
@@ -17787,7 +17787,7 @@ Get tool schemas:
|
|
|
17787
17787
|
\`\`\`json
|
|
17788
17788
|
{
|
|
17789
17789
|
"tool": "man",
|
|
17790
|
-
"args": ["tool1", "tool2"]
|
|
17790
|
+
"args": { "tools": ["tool1", "tool2"] }
|
|
17791
17791
|
}
|
|
17792
17792
|
\`\`\`
|
|
17793
17793
|
|
|
@@ -17854,7 +17854,9 @@ Next: Execute \`{nextAction}\` by calling \`{toolName}\` again.`,
|
|
|
17854
17854
|
/**
|
|
17855
17855
|
* Error response templates
|
|
17856
17856
|
*/
|
|
17857
|
-
ERROR_RESPONSE: `Validation failed: {errorMessage}
|
|
17857
|
+
ERROR_RESPONSE: `Validation failed: {errorMessage}
|
|
17858
|
+
|
|
17859
|
+
Adjust parameters and retry.`,
|
|
17858
17860
|
/**
|
|
17859
17861
|
* Completion message
|
|
17860
17862
|
*/
|
|
@@ -17919,7 +17921,7 @@ function createArgsDefFactory(_name, _allToolNames, _depGroups, _predefinedSteps
|
|
|
17919
17921
|
*
|
|
17920
17922
|
* Only two fields:
|
|
17921
17923
|
* - `tool`: which tool to execute (enum includes "man" + all tool names)
|
|
17922
|
-
* - `args`: For "man": ["
|
|
17924
|
+
* - `args`: object with parameters. For "man": { tools: ["a", "b"] }. For others: tool parameters.
|
|
17923
17925
|
*/
|
|
17924
17926
|
forAgentic: function(allToolNames) {
|
|
17925
17927
|
const toolEnum = [
|
|
@@ -17939,7 +17941,7 @@ function createArgsDefFactory(_name, _allToolNames, _depGroups, _predefinedSteps
|
|
|
17939
17941
|
},
|
|
17940
17942
|
args: {
|
|
17941
17943
|
type: "object",
|
|
17942
|
-
description: `For "man": ["tool1", "tool2"]. For other tools: tool parameters that strictly adhere to the tool's JSON schema.`
|
|
17944
|
+
description: `For "man": { tools: ["tool1", "tool2"] }. For other tools: tool parameters that strictly adhere to the tool's JSON schema.`
|
|
17943
17945
|
}
|
|
17944
17946
|
},
|
|
17945
17947
|
required: [
|
|
@@ -17949,22 +17951,35 @@ function createArgsDefFactory(_name, _allToolNames, _depGroups, _predefinedSteps
|
|
|
17949
17951
|
};
|
|
17950
17952
|
},
|
|
17951
17953
|
/**
|
|
17952
|
-
* Schema for "man" command args validation
|
|
17953
|
-
* Expected format: ["tool1", "tool2"]
|
|
17954
|
+
* Schema for "man" command args validation
|
|
17955
|
+
* Expected format: { tools: ["tool1", "tool2"] }
|
|
17954
17956
|
*/
|
|
17955
17957
|
forMan: function(allToolNames) {
|
|
17956
17958
|
return {
|
|
17957
|
-
type: "
|
|
17958
|
-
|
|
17959
|
-
|
|
17960
|
-
|
|
17961
|
-
|
|
17962
|
-
|
|
17959
|
+
type: "object",
|
|
17960
|
+
properties: {
|
|
17961
|
+
tools: {
|
|
17962
|
+
type: "array",
|
|
17963
|
+
items: {
|
|
17964
|
+
type: "string",
|
|
17965
|
+
enum: allToolNames,
|
|
17966
|
+
errorMessage: {
|
|
17967
|
+
enum: `Invalid tool name. Available: ${allToolNames.join(", ")}`
|
|
17968
|
+
}
|
|
17969
|
+
},
|
|
17970
|
+
minItems: 1,
|
|
17971
|
+
errorMessage: {
|
|
17972
|
+
minItems: "At least one tool name is required"
|
|
17973
|
+
}
|
|
17963
17974
|
}
|
|
17964
17975
|
},
|
|
17965
|
-
|
|
17976
|
+
required: [
|
|
17977
|
+
"tools"
|
|
17978
|
+
],
|
|
17966
17979
|
errorMessage: {
|
|
17967
|
-
|
|
17980
|
+
required: {
|
|
17981
|
+
tools: 'Missing "tools" field. Expected: { tools: ["tool1", "tool2"] }'
|
|
17982
|
+
}
|
|
17968
17983
|
}
|
|
17969
17984
|
};
|
|
17970
17985
|
}
|
|
@@ -18142,10 +18157,9 @@ var AgenticExecutor = class {
|
|
|
18142
18157
|
}
|
|
18143
18158
|
const tool2 = args.tool;
|
|
18144
18159
|
if (tool2 === "man") {
|
|
18145
|
-
const toolsArray = Array.isArray(args.args) ? args.args : args.args?.tools;
|
|
18146
18160
|
const createArgsDef = createArgsDefFactory(this.name, this.allToolNames, {});
|
|
18147
18161
|
const manSchema = createArgsDef.forMan(this.allToolNames);
|
|
18148
|
-
const manValidation = validateSchema(
|
|
18162
|
+
const manValidation = validateSchema(args.args ?? {}, manSchema);
|
|
18149
18163
|
if (!manValidation.valid) {
|
|
18150
18164
|
return {
|
|
18151
18165
|
content: [
|
|
@@ -18157,7 +18171,8 @@ var AgenticExecutor = class {
|
|
|
18157
18171
|
isError: true
|
|
18158
18172
|
};
|
|
18159
18173
|
}
|
|
18160
|
-
|
|
18174
|
+
const argsObj = args.args;
|
|
18175
|
+
return this.handleManCommand(argsObj.tools, executeSpan);
|
|
18161
18176
|
}
|
|
18162
18177
|
const toolArgs = args.args || {};
|
|
18163
18178
|
return await this.executeTool(tool2, toolArgs, executeSpan);
|