@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/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export { c as ContentPart, d as HostEvent, I as IMAGE_ELIDE_STUB, e as IMAGE_REF
|
|
|
9
9
|
import { ShellJobRegistry } from './tools.shell.js';
|
|
10
10
|
import { SpokenSplitter } from '@bod.ee/voice';
|
|
11
11
|
export { AudioSink, AudioSource, AuthProvider, CartesiaTTS, CartesiaTTSOptions, STT_SAMPLE_RATE, SonioxSTT, SonioxSTTOptions, SttLike, TTS_SAMPLE_RATE, TtsLike, VoiceEngine, VoiceEngineOptions, VoiceState, resolveAuth } from '@bod.ee/voice';
|
|
12
|
-
export { M as McpCall, a as McpImage, b as McpRoute, c as McpRouteResolver, d as McpToolResult, e as McpToolSearchOptions, f as McpToolSpec, g as MountedMcpLike, h as buildMcpCatalog, m as makeLazyMcpToolSearch, i as makeMcpToolSearch, j as makeMcpToolSearchFromMounted, k as mcpToolToAgentTool, l as mcpToolsToAgentTools } from './mcp-
|
|
12
|
+
export { M as McpCall, a as McpImage, b as McpRoute, c as McpRouteResolver, d as McpToolResult, e as McpToolSearchOptions, f as McpToolSpec, g as MountedMcpLike, h as buildMcpCatalog, m as makeLazyMcpToolSearch, i as makeMcpToolSearch, j as makeMcpToolSearchFromMounted, k as mcpToolToAgentTool, l as mcpToolsToAgentTools } from './mcp-BZJXDo5Q.js';
|
|
13
13
|
import * as libx_js_src_modules_log from 'libx.js/src/modules/log';
|
|
14
14
|
export { log } from 'libx.js/src/modules/log';
|
|
15
15
|
|
package/dist/index.js
CHANGED
|
@@ -12711,6 +12711,15 @@ async function runMcpCall(name, call, ctx, timeoutMs) {
|
|
|
12711
12711
|
const soft = jobs.options.foregroundMs.mcp ?? 0;
|
|
12712
12712
|
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.`;
|
|
12713
12713
|
}
|
|
12714
|
+
var objArgs = (v) => {
|
|
12715
|
+
if (typeof v !== "string") return v;
|
|
12716
|
+
try {
|
|
12717
|
+
const j = JSON.parse(v);
|
|
12718
|
+
return j && typeof j === "object" && !Array.isArray(j) ? j : v;
|
|
12719
|
+
} catch {
|
|
12720
|
+
return v;
|
|
12721
|
+
}
|
|
12722
|
+
};
|
|
12714
12723
|
function mcpToolToAgentTool(spec, callTool, prefix = "mcp__", timeoutMs = MCP_CALL_TIMEOUT_MS) {
|
|
12715
12724
|
return {
|
|
12716
12725
|
name: `${prefix}${spec.name}`,
|
|
@@ -12718,7 +12727,7 @@ function mcpToolToAgentTool(spec, callTool, prefix = "mcp__", timeoutMs = MCP_CA
|
|
|
12718
12727
|
parameters: spec.inputSchema ?? { type: "object", properties: {} },
|
|
12719
12728
|
maxDurationMs: timeoutMs,
|
|
12720
12729
|
run(args, ctx) {
|
|
12721
|
-
return runMcpCall(spec.name, (o) => callTool(spec.name, args ?? {}, o), ctx, timeoutMs);
|
|
12730
|
+
return runMcpCall(spec.name, (o) => callTool(spec.name, objArgs(args) ?? {}, o), ctx, timeoutMs);
|
|
12722
12731
|
}
|
|
12723
12732
|
};
|
|
12724
12733
|
}
|
|
@@ -12787,7 +12796,8 @@ function makeMcpToolSearch(specs, callTool, options = {}) {
|
|
|
12787
12796
|
},
|
|
12788
12797
|
maxDurationMs: callTimeoutMs,
|
|
12789
12798
|
async run(input, ctx) {
|
|
12790
|
-
const { name
|
|
12799
|
+
const { name } = input ?? {};
|
|
12800
|
+
const args = objArgs(input?.args);
|
|
12791
12801
|
const n = String(name ?? "").trim();
|
|
12792
12802
|
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: {...} }).`;
|
|
12793
12803
|
if (n === searchTool.name) return searchTool.run({ query: args?.query ?? args?.keyword ?? args?.q }, ctx);
|