@livx.cc/agentx 0.99.129 → 0.99.130
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/cli.js +12 -2
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/dist/{mcp-DZhcLur2.d.ts → mcp-BZJXDo5Q.d.ts} +0 -1
- package/dist/mcp.client.d.ts +1 -1
- package/dist/mcp.client.js +12 -2
- package/dist/mcp.client.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -13043,6 +13043,15 @@ async function runMcpCall(name, call, ctx, timeoutMs) {
|
|
|
13043
13043
|
const soft = jobs.options.foregroundMs.mcp ?? 0;
|
|
13044
13044
|
return `[still running] MCP call ${name} is still working after ${soft >= 1e3 ? `${Math.round(soft / 1e3)}s` : `${soft}ms`}, so it was handed to background job ${r.id} \u2014 NOT cancelled, the server keeps going. Its result will be delivered to you when it finishes, so continue with other work; to block on it use JobWait({id:"${r.id}"}) instead of sleeping. JobStatus/JobOutput show its progress; JobKill({id:"${r.id}"}) cancels it. Do NOT re-issue the same call \u2014 that would run it twice.`;
|
|
13045
13045
|
}
|
|
13046
|
+
var objArgs = (v) => {
|
|
13047
|
+
if (typeof v !== "string") return v;
|
|
13048
|
+
try {
|
|
13049
|
+
const j = JSON.parse(v);
|
|
13050
|
+
return j && typeof j === "object" && !Array.isArray(j) ? j : v;
|
|
13051
|
+
} catch {
|
|
13052
|
+
return v;
|
|
13053
|
+
}
|
|
13054
|
+
};
|
|
13046
13055
|
function mcpToolToAgentTool(spec, callTool, prefix = "mcp__", timeoutMs = MCP_CALL_TIMEOUT_MS) {
|
|
13047
13056
|
return {
|
|
13048
13057
|
name: `${prefix}${spec.name}`,
|
|
@@ -13050,7 +13059,7 @@ function mcpToolToAgentTool(spec, callTool, prefix = "mcp__", timeoutMs = MCP_CA
|
|
|
13050
13059
|
parameters: spec.inputSchema ?? { type: "object", properties: {} },
|
|
13051
13060
|
maxDurationMs: timeoutMs,
|
|
13052
13061
|
run(args, ctx) {
|
|
13053
|
-
return runMcpCall(spec.name, (o) => callTool(spec.name, args ?? {}, o), ctx, timeoutMs);
|
|
13062
|
+
return runMcpCall(spec.name, (o) => callTool(spec.name, objArgs(args) ?? {}, o), ctx, timeoutMs);
|
|
13054
13063
|
}
|
|
13055
13064
|
};
|
|
13056
13065
|
}
|
|
@@ -13119,7 +13128,8 @@ function makeMcpToolSearch(specs, callTool, options = {}) {
|
|
|
13119
13128
|
},
|
|
13120
13129
|
maxDurationMs: callTimeoutMs,
|
|
13121
13130
|
async run(input, ctx) {
|
|
13122
|
-
const { name
|
|
13131
|
+
const { name } = input ?? {};
|
|
13132
|
+
const args = objArgs(input?.args);
|
|
13123
13133
|
const n = String(name ?? "").trim();
|
|
13124
13134
|
if (!n) return `Error: McpCall requires \`name\` (the exact MCP tool name) \u2014 got keys [${Object.keys(input ?? {}).join(", ")}]. Call it as McpCall({ name: "mcp__<server>__<tool>", args: {...} }).`;
|
|
13125
13135
|
if (n === searchTool.name) return searchTool.run({ query: args?.query ?? args?.keyword ?? args?.q }, ctx);
|