@livx.cc/agentx 0.99.129 → 0.99.131

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.d.ts CHANGED
@@ -147,6 +147,7 @@ interface Args {
147
147
  modeScope?: 'sticky' | 'message';
148
148
  maxSteps?: number;
149
149
  maxTokens?: number;
150
+ maxToolCalls?: number;
150
151
  timeoutMs?: number;
151
152
  reasoning?: ReasoningEffort;
152
153
  help: boolean;
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, args } = input ?? {};
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);
@@ -15404,7 +15414,8 @@ Windows paths: file tools accept ${cwd} style paths and the same path written ${
15404
15414
  ...o.maxTokens != null ? { maxTokens: o.maxTokens } : {},
15405
15415
  ...o.timeoutMs != null ? { timeoutMs: o.timeoutMs } : {},
15406
15416
  ...o.maxRepeats != null ? { maxRepeats: o.maxRepeats } : {},
15407
- ...o.maxToolCalls != null ? { maxToolCalls: o.maxToolCalls } : {},
15417
+ // a raised step budget raises the tool-call cap with it (else 100 stops a 300-step run at step ~86)
15418
+ ...o.maxToolCalls != null ? { maxToolCalls: o.maxToolCalls } : (o.maxSteps ?? 0) * 4 > 100 ? { maxToolCalls: o.maxSteps * 4 } : {},
15408
15419
  // Context-v2: by default, note-take over a long session (stub tool outputs older than the last 8).
15409
15420
  keepToolOutputs: o.keepToolOutputs ?? 8,
15410
15421
  ...o.maxContextTokens != null ? { maxContextTokens: o.maxContextTokens } : {},
@@ -19538,6 +19549,7 @@ function parseArgs(argv) {
19538
19549
  else if (x === "--fork-session") a.fork = true;
19539
19550
  else if (x === "--worktree" || x === "-w") a.worktree = val(++i, x);
19540
19551
  else if (x === "--max-steps") a.maxSteps = numFlag(argv[++i], "--max-steps");
19552
+ else if (x === "--max-tool-calls") a.maxToolCalls = numFlag(argv[++i], "--max-tool-calls");
19541
19553
  else if (x === "--max-tokens") a.maxTokens = numFlag(argv[++i], "--max-tokens");
19542
19554
  else if (x === "--timeout") a.timeoutMs = numFlag(argv[++i], "--timeout") * 1e3;
19543
19555
  else if (x === "--output-format") {
@@ -19651,6 +19663,7 @@ Flags:
19651
19663
  -w, --worktree <slug> run in an isolated git worktree (.claude/worktrees/<slug>); auto-cleaned on exit if no changes
19652
19664
  --max-steps <n> step budget (default 30)
19653
19665
  --max-tokens <n> token budget kill-switch (default 200000)
19666
+ --max-tool-calls <n> tool-call kill-switch (default 100, or 4 per step when --max-steps is higher)
19654
19667
  --timeout <sec> wall-clock kill-switch (default 120)
19655
19668
  --input-format stream-json with --duplex|--voice + --output-format stream-json: headless duplex for a host app
19656
19669
  (NDJSON turns/barge-ins on stdin, reflex text + worker speech + task events on stdout)
@@ -20432,7 +20445,7 @@ function optsFor(args, ai, cfg = {}, extraTools = []) {
20432
20445
  maxTokens: args.maxTokens ?? cfg.maxTokens,
20433
20446
  timeoutMs: args.timeoutMs ?? cfg.timeoutMs,
20434
20447
  maxRepeats: cfg.maxRepeats,
20435
- maxToolCalls: cfg.maxToolCalls,
20448
+ maxToolCalls: args.maxToolCalls ?? cfg.maxToolCalls,
20436
20449
  keepToolOutputs: cfg.keepToolOutputs,
20437
20450
  maxContextTokens: cfg.maxContextTokens,
20438
20451
  // Adaptive browser trimming (engages on actual browser tool USE, inside the Agent — see BROWSER_TRIM).