@mcpc-tech/core 0.3.30 → 0.3.32
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 +18 -57
- package/index.mjs +18 -57
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -2193,7 +2193,7 @@ var Doc = class {
|
|
|
2193
2193
|
var version = {
|
|
2194
2194
|
major: 4,
|
|
2195
2195
|
minor: 3,
|
|
2196
|
-
patch:
|
|
2196
|
+
patch: 6
|
|
2197
2197
|
};
|
|
2198
2198
|
|
|
2199
2199
|
// __mcpc__core_latest/node_modules/zod/v4/core/schemas.js
|
|
@@ -3484,7 +3484,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
3484
3484
|
if (keyResult instanceof Promise) {
|
|
3485
3485
|
throw new Error("Async schemas not supported in object keys currently");
|
|
3486
3486
|
}
|
|
3487
|
-
const checkNumericKey = typeof key === "string" && number.test(key) && keyResult.issues.length
|
|
3487
|
+
const checkNumericKey = typeof key === "string" && number.test(key) && keyResult.issues.length;
|
|
3488
3488
|
if (checkNumericKey) {
|
|
3489
3489
|
const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);
|
|
3490
3490
|
if (retryResult instanceof Promise) {
|
|
@@ -5370,7 +5370,7 @@ function finalize(ctx, schema) {
|
|
|
5370
5370
|
}
|
|
5371
5371
|
}
|
|
5372
5372
|
}
|
|
5373
|
-
if (refSchema.$ref) {
|
|
5373
|
+
if (refSchema.$ref && refSeen.def) {
|
|
5374
5374
|
for (const key in schema2) {
|
|
5375
5375
|
if (key === "$ref" || key === "allOf")
|
|
5376
5376
|
continue;
|
|
@@ -17778,9 +17778,7 @@ var SystemPrompts = {
|
|
|
17778
17778
|
* - `man` command for fetching tool schemas (like Unix manual)
|
|
17779
17779
|
* - No `hasDefinitions` - trusts model's context memory
|
|
17780
17780
|
*/
|
|
17781
|
-
AUTONOMOUS_EXECUTION: `Agentic tool \`{toolName}\` that executes
|
|
17782
|
-
|
|
17783
|
-
You must follow the <manual/>, obey the <rules/>, and use the <format/>.
|
|
17781
|
+
AUTONOMOUS_EXECUTION: `Agentic tool \`{toolName}\` that executes tasks by calling its tools, following the <manual/>, obeying the <rules/>, and using the <format/>.
|
|
17784
17782
|
|
|
17785
17783
|
<manual>
|
|
17786
17784
|
{description}
|
|
@@ -17794,26 +17792,11 @@ You must follow the <manual/>, obey the <rules/>, and use the <format/>.
|
|
|
17794
17792
|
<rules>
|
|
17795
17793
|
1. **First call**: Use \`man\` to get tool schemas you need
|
|
17796
17794
|
2. **Execute tools**: Use tool name in \`tool\` and parameters in \`args\`
|
|
17797
|
-
3. **Parallel calls**: If your client supports it, call \`man\` and execute tools simultaneously
|
|
17798
|
-
4. Note: You are an agent exposed as an MCP tool
|
|
17799
17795
|
</rules>
|
|
17800
17796
|
|
|
17801
17797
|
<format>
|
|
17802
|
-
Get tool schemas:
|
|
17803
|
-
|
|
17804
|
-
{
|
|
17805
|
-
"tool": "man",
|
|
17806
|
-
"args": { "tools": ["tool1", "tool2"] }
|
|
17807
|
-
}
|
|
17808
|
-
\`\`\`
|
|
17809
|
-
|
|
17810
|
-
Execute a tool:
|
|
17811
|
-
\`\`\`json
|
|
17812
|
-
{
|
|
17813
|
-
"tool": "tool_name",
|
|
17814
|
-
"args": { /* tool parameters */ }
|
|
17815
|
-
}
|
|
17816
|
-
\`\`\`
|
|
17798
|
+
Get tool schemas: \`{ "tool": "man", "args": { "tools": ["tool1", "tool2"] } }\`
|
|
17799
|
+
Execute a tool: \`{ "tool": "tool_name", "args": { /* parameters */ } }\`
|
|
17817
17800
|
</format>`,
|
|
17818
17801
|
/**
|
|
17819
17802
|
* Compact system prompt for autonomous MCP execution (when manual is provided)
|
|
@@ -17822,14 +17805,17 @@ Execute a tool:
|
|
|
17822
17805
|
* - Short description shown by default
|
|
17823
17806
|
* - Use `man` command with args `{ manual: true }` to get full manual
|
|
17824
17807
|
*/
|
|
17825
|
-
AUTONOMOUS_EXECUTION_COMPACT: `Agentic tool \`{toolName}
|
|
17808
|
+
AUTONOMOUS_EXECUTION_COMPACT: `Agentic tool \`{toolName}\` that executes tasks by calling its tools, following the <rules/> and using the <format/>.
|
|
17826
17809
|
|
|
17827
|
-
|
|
17810
|
+
{description}
|
|
17811
|
+
|
|
17812
|
+
<rules>
|
|
17813
|
+
1. **First call**: Use \`man\` to get tool schemas and full manual
|
|
17814
|
+
2. **Execute tools**: Use tool name in \`tool\` and parameters in \`args\`
|
|
17815
|
+
</rules>
|
|
17828
17816
|
|
|
17829
17817
|
<format>
|
|
17830
|
-
Get
|
|
17831
|
-
Get tool schemas: \`{ "tool": "man", "args": { "tools": ["tool1", "tool2"] } }\`
|
|
17832
|
-
Get both: \`{ "tool": "man", "args": { "tools": ["tool1"], "manual": true } }\`
|
|
17818
|
+
Get manual + schemas: \`{ "tool": "man", "args": { "tools": ["tool1"], "manual": true } }\`
|
|
17833
17819
|
Execute a tool: \`{ "tool": "tool_name", "args": { /* parameters */ } }\`
|
|
17834
17820
|
</format>`,
|
|
17835
17821
|
/**
|
|
@@ -17870,30 +17856,12 @@ You must follow the <manual/>, obey the <rules/>, and use the <format/>.
|
|
|
17870
17856
|
</rules>{context}`
|
|
17871
17857
|
};
|
|
17872
17858
|
var ResponseTemplates = {
|
|
17873
|
-
/**
|
|
17874
|
-
* Success response for action execution
|
|
17875
|
-
*/
|
|
17876
|
-
ACTION_SUCCESS: `Action \`{currentAction}\` completed.
|
|
17877
|
-
|
|
17878
|
-
Next: Execute \`{nextAction}\` by calling \`{toolName}\` again.`,
|
|
17879
|
-
/**
|
|
17880
|
-
* Planning prompt when no next action is specified
|
|
17881
|
-
*/
|
|
17882
|
-
PLANNING_PROMPT: `Action \`{currentAction}\` completed. Determine next step:
|
|
17883
|
-
|
|
17884
|
-
1. Analyze results from \`{currentAction}\`
|
|
17885
|
-
2. Decide: Continue with another action or Complete?
|
|
17886
|
-
3. Call \`{toolName}\` with chosen action or \`decision: "complete"\``,
|
|
17887
17859
|
/**
|
|
17888
17860
|
* Error response templates
|
|
17889
17861
|
*/
|
|
17890
17862
|
ERROR_RESPONSE: `Validation failed: {errorMessage}
|
|
17891
17863
|
|
|
17892
17864
|
Adjust parameters and retry.`,
|
|
17893
|
-
/**
|
|
17894
|
-
* Completion message
|
|
17895
|
-
*/
|
|
17896
|
-
COMPLETION_MESSAGE: `Task completed.`,
|
|
17897
17865
|
/**
|
|
17898
17866
|
* Security validation messages
|
|
17899
17867
|
*/
|
|
@@ -17911,13 +17879,10 @@ var CompiledPrompts = {
|
|
|
17911
17879
|
autonomousExecutionCompact: p(SystemPrompts.AUTONOMOUS_EXECUTION_COMPACT),
|
|
17912
17880
|
samplingToolDescription: p(SystemPrompts.SAMPLING_TOOL_DESCRIPTION),
|
|
17913
17881
|
aiLoopSystem: p(SystemPrompts.AI_LOOP_SYSTEM),
|
|
17914
|
-
actionSuccess: p(ResponseTemplates.ACTION_SUCCESS),
|
|
17915
|
-
planningPrompt: p(ResponseTemplates.PLANNING_PROMPT),
|
|
17916
17882
|
errorResponse: p(ResponseTemplates.ERROR_RESPONSE),
|
|
17917
17883
|
securityPassed: p(ResponseTemplates.SECURITY_VALIDATION.PASSED),
|
|
17918
17884
|
securityFailed: p(ResponseTemplates.SECURITY_VALIDATION.FAILED),
|
|
17919
|
-
auditLog: p(ResponseTemplates.AUDIT_LOG)
|
|
17920
|
-
completionMessage: () => ResponseTemplates.COMPLETION_MESSAGE
|
|
17885
|
+
auditLog: p(ResponseTemplates.AUDIT_LOG)
|
|
17921
17886
|
};
|
|
17922
17887
|
|
|
17923
17888
|
// __mcpc__core_latest/node_modules/@mcpc/core/src/factories/args-def-factory.js
|
|
@@ -19750,6 +19715,7 @@ var PluginManager = class {
|
|
|
19750
19715
|
/**
|
|
19751
19716
|
* Trigger registerAgentTool hook - allows plugins to register the main agent tool
|
|
19752
19717
|
* Returns true if any plugin handled the registration
|
|
19718
|
+
* Throws the original error if plugin fails (instead of swallowing it)
|
|
19753
19719
|
*/
|
|
19754
19720
|
async triggerRegisterAgentTool(context2) {
|
|
19755
19721
|
const registerPlugins = this.plugins.filter((p2) => p2.registerAgentTool && shouldApplyPlugin(p2, context2.mode));
|
|
@@ -19759,13 +19725,8 @@ var PluginManager = class {
|
|
|
19759
19725
|
const sortedPlugins = sortPluginsByOrder(registerPlugins).reverse();
|
|
19760
19726
|
for (const plugin of sortedPlugins) {
|
|
19761
19727
|
if (plugin.registerAgentTool) {
|
|
19762
|
-
|
|
19763
|
-
|
|
19764
|
-
return true;
|
|
19765
|
-
} catch (error2) {
|
|
19766
|
-
const errorMsg = error2 instanceof Error ? error2.message : String(error2);
|
|
19767
|
-
await this.logger.error(`Plugin "${plugin.name}" registerAgentTool failed: ${errorMsg}`);
|
|
19768
|
-
}
|
|
19728
|
+
await plugin.registerAgentTool(context2);
|
|
19729
|
+
return true;
|
|
19769
19730
|
}
|
|
19770
19731
|
}
|
|
19771
19732
|
return false;
|
package/index.mjs
CHANGED
|
@@ -2179,7 +2179,7 @@ var Doc = class {
|
|
|
2179
2179
|
var version = {
|
|
2180
2180
|
major: 4,
|
|
2181
2181
|
minor: 3,
|
|
2182
|
-
patch:
|
|
2182
|
+
patch: 6
|
|
2183
2183
|
};
|
|
2184
2184
|
|
|
2185
2185
|
// __mcpc__core_latest/node_modules/zod/v4/core/schemas.js
|
|
@@ -3470,7 +3470,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
3470
3470
|
if (keyResult instanceof Promise) {
|
|
3471
3471
|
throw new Error("Async schemas not supported in object keys currently");
|
|
3472
3472
|
}
|
|
3473
|
-
const checkNumericKey = typeof key === "string" && number.test(key) && keyResult.issues.length
|
|
3473
|
+
const checkNumericKey = typeof key === "string" && number.test(key) && keyResult.issues.length;
|
|
3474
3474
|
if (checkNumericKey) {
|
|
3475
3475
|
const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);
|
|
3476
3476
|
if (retryResult instanceof Promise) {
|
|
@@ -5356,7 +5356,7 @@ function finalize(ctx, schema) {
|
|
|
5356
5356
|
}
|
|
5357
5357
|
}
|
|
5358
5358
|
}
|
|
5359
|
-
if (refSchema.$ref) {
|
|
5359
|
+
if (refSchema.$ref && refSeen.def) {
|
|
5360
5360
|
for (const key in schema2) {
|
|
5361
5361
|
if (key === "$ref" || key === "allOf")
|
|
5362
5362
|
continue;
|
|
@@ -17764,9 +17764,7 @@ var SystemPrompts = {
|
|
|
17764
17764
|
* - `man` command for fetching tool schemas (like Unix manual)
|
|
17765
17765
|
* - No `hasDefinitions` - trusts model's context memory
|
|
17766
17766
|
*/
|
|
17767
|
-
AUTONOMOUS_EXECUTION: `Agentic tool \`{toolName}\` that executes
|
|
17768
|
-
|
|
17769
|
-
You must follow the <manual/>, obey the <rules/>, and use the <format/>.
|
|
17767
|
+
AUTONOMOUS_EXECUTION: `Agentic tool \`{toolName}\` that executes tasks by calling its tools, following the <manual/>, obeying the <rules/>, and using the <format/>.
|
|
17770
17768
|
|
|
17771
17769
|
<manual>
|
|
17772
17770
|
{description}
|
|
@@ -17780,26 +17778,11 @@ You must follow the <manual/>, obey the <rules/>, and use the <format/>.
|
|
|
17780
17778
|
<rules>
|
|
17781
17779
|
1. **First call**: Use \`man\` to get tool schemas you need
|
|
17782
17780
|
2. **Execute tools**: Use tool name in \`tool\` and parameters in \`args\`
|
|
17783
|
-
3. **Parallel calls**: If your client supports it, call \`man\` and execute tools simultaneously
|
|
17784
|
-
4. Note: You are an agent exposed as an MCP tool
|
|
17785
17781
|
</rules>
|
|
17786
17782
|
|
|
17787
17783
|
<format>
|
|
17788
|
-
Get tool schemas:
|
|
17789
|
-
|
|
17790
|
-
{
|
|
17791
|
-
"tool": "man",
|
|
17792
|
-
"args": { "tools": ["tool1", "tool2"] }
|
|
17793
|
-
}
|
|
17794
|
-
\`\`\`
|
|
17795
|
-
|
|
17796
|
-
Execute a tool:
|
|
17797
|
-
\`\`\`json
|
|
17798
|
-
{
|
|
17799
|
-
"tool": "tool_name",
|
|
17800
|
-
"args": { /* tool parameters */ }
|
|
17801
|
-
}
|
|
17802
|
-
\`\`\`
|
|
17784
|
+
Get tool schemas: \`{ "tool": "man", "args": { "tools": ["tool1", "tool2"] } }\`
|
|
17785
|
+
Execute a tool: \`{ "tool": "tool_name", "args": { /* parameters */ } }\`
|
|
17803
17786
|
</format>`,
|
|
17804
17787
|
/**
|
|
17805
17788
|
* Compact system prompt for autonomous MCP execution (when manual is provided)
|
|
@@ -17808,14 +17791,17 @@ Execute a tool:
|
|
|
17808
17791
|
* - Short description shown by default
|
|
17809
17792
|
* - Use `man` command with args `{ manual: true }` to get full manual
|
|
17810
17793
|
*/
|
|
17811
|
-
AUTONOMOUS_EXECUTION_COMPACT: `Agentic tool \`{toolName}
|
|
17794
|
+
AUTONOMOUS_EXECUTION_COMPACT: `Agentic tool \`{toolName}\` that executes tasks by calling its tools, following the <rules/> and using the <format/>.
|
|
17812
17795
|
|
|
17813
|
-
|
|
17796
|
+
{description}
|
|
17797
|
+
|
|
17798
|
+
<rules>
|
|
17799
|
+
1. **First call**: Use \`man\` to get tool schemas and full manual
|
|
17800
|
+
2. **Execute tools**: Use tool name in \`tool\` and parameters in \`args\`
|
|
17801
|
+
</rules>
|
|
17814
17802
|
|
|
17815
17803
|
<format>
|
|
17816
|
-
Get
|
|
17817
|
-
Get tool schemas: \`{ "tool": "man", "args": { "tools": ["tool1", "tool2"] } }\`
|
|
17818
|
-
Get both: \`{ "tool": "man", "args": { "tools": ["tool1"], "manual": true } }\`
|
|
17804
|
+
Get manual + schemas: \`{ "tool": "man", "args": { "tools": ["tool1"], "manual": true } }\`
|
|
17819
17805
|
Execute a tool: \`{ "tool": "tool_name", "args": { /* parameters */ } }\`
|
|
17820
17806
|
</format>`,
|
|
17821
17807
|
/**
|
|
@@ -17856,30 +17842,12 @@ You must follow the <manual/>, obey the <rules/>, and use the <format/>.
|
|
|
17856
17842
|
</rules>{context}`
|
|
17857
17843
|
};
|
|
17858
17844
|
var ResponseTemplates = {
|
|
17859
|
-
/**
|
|
17860
|
-
* Success response for action execution
|
|
17861
|
-
*/
|
|
17862
|
-
ACTION_SUCCESS: `Action \`{currentAction}\` completed.
|
|
17863
|
-
|
|
17864
|
-
Next: Execute \`{nextAction}\` by calling \`{toolName}\` again.`,
|
|
17865
|
-
/**
|
|
17866
|
-
* Planning prompt when no next action is specified
|
|
17867
|
-
*/
|
|
17868
|
-
PLANNING_PROMPT: `Action \`{currentAction}\` completed. Determine next step:
|
|
17869
|
-
|
|
17870
|
-
1. Analyze results from \`{currentAction}\`
|
|
17871
|
-
2. Decide: Continue with another action or Complete?
|
|
17872
|
-
3. Call \`{toolName}\` with chosen action or \`decision: "complete"\``,
|
|
17873
17845
|
/**
|
|
17874
17846
|
* Error response templates
|
|
17875
17847
|
*/
|
|
17876
17848
|
ERROR_RESPONSE: `Validation failed: {errorMessage}
|
|
17877
17849
|
|
|
17878
17850
|
Adjust parameters and retry.`,
|
|
17879
|
-
/**
|
|
17880
|
-
* Completion message
|
|
17881
|
-
*/
|
|
17882
|
-
COMPLETION_MESSAGE: `Task completed.`,
|
|
17883
17851
|
/**
|
|
17884
17852
|
* Security validation messages
|
|
17885
17853
|
*/
|
|
@@ -17897,13 +17865,10 @@ var CompiledPrompts = {
|
|
|
17897
17865
|
autonomousExecutionCompact: p(SystemPrompts.AUTONOMOUS_EXECUTION_COMPACT),
|
|
17898
17866
|
samplingToolDescription: p(SystemPrompts.SAMPLING_TOOL_DESCRIPTION),
|
|
17899
17867
|
aiLoopSystem: p(SystemPrompts.AI_LOOP_SYSTEM),
|
|
17900
|
-
actionSuccess: p(ResponseTemplates.ACTION_SUCCESS),
|
|
17901
|
-
planningPrompt: p(ResponseTemplates.PLANNING_PROMPT),
|
|
17902
17868
|
errorResponse: p(ResponseTemplates.ERROR_RESPONSE),
|
|
17903
17869
|
securityPassed: p(ResponseTemplates.SECURITY_VALIDATION.PASSED),
|
|
17904
17870
|
securityFailed: p(ResponseTemplates.SECURITY_VALIDATION.FAILED),
|
|
17905
|
-
auditLog: p(ResponseTemplates.AUDIT_LOG)
|
|
17906
|
-
completionMessage: () => ResponseTemplates.COMPLETION_MESSAGE
|
|
17871
|
+
auditLog: p(ResponseTemplates.AUDIT_LOG)
|
|
17907
17872
|
};
|
|
17908
17873
|
|
|
17909
17874
|
// __mcpc__core_latest/node_modules/@mcpc/core/src/factories/args-def-factory.js
|
|
@@ -19735,6 +19700,7 @@ var PluginManager = class {
|
|
|
19735
19700
|
/**
|
|
19736
19701
|
* Trigger registerAgentTool hook - allows plugins to register the main agent tool
|
|
19737
19702
|
* Returns true if any plugin handled the registration
|
|
19703
|
+
* Throws the original error if plugin fails (instead of swallowing it)
|
|
19738
19704
|
*/
|
|
19739
19705
|
async triggerRegisterAgentTool(context2) {
|
|
19740
19706
|
const registerPlugins = this.plugins.filter((p2) => p2.registerAgentTool && shouldApplyPlugin(p2, context2.mode));
|
|
@@ -19744,13 +19710,8 @@ var PluginManager = class {
|
|
|
19744
19710
|
const sortedPlugins = sortPluginsByOrder(registerPlugins).reverse();
|
|
19745
19711
|
for (const plugin of sortedPlugins) {
|
|
19746
19712
|
if (plugin.registerAgentTool) {
|
|
19747
|
-
|
|
19748
|
-
|
|
19749
|
-
return true;
|
|
19750
|
-
} catch (error2) {
|
|
19751
|
-
const errorMsg = error2 instanceof Error ? error2.message : String(error2);
|
|
19752
|
-
await this.logger.error(`Plugin "${plugin.name}" registerAgentTool failed: ${errorMsg}`);
|
|
19753
|
-
}
|
|
19713
|
+
await plugin.registerAgentTool(context2);
|
|
19714
|
+
return true;
|
|
19754
19715
|
}
|
|
19755
19716
|
}
|
|
19756
19717
|
return false;
|