@livx.cc/agentx 0.99.30 → 0.99.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.
@@ -1,4 +1,4 @@
1
- import { A as AgentTool } from './tools-BZVppx-6.js';
1
+ import { A as AgentTool } from './tools-Byyh_bae.js';
2
2
 
3
3
  /**
4
4
  * MCP bridge — adapt a Model Context Protocol tool list into the agent's AgentTool[],
@@ -1,5 +1,5 @@
1
- import { e as McpToolSearchOptions, f as McpToolSpec } from './mcp-Cnq0pS95.js';
2
- import { A as AgentTool } from './tools-BZVppx-6.js';
1
+ import { e as McpToolSearchOptions, f as McpToolSpec } from './mcp-Bd19NiCL.js';
2
+ import { A as AgentTool } from './tools-Byyh_bae.js';
3
3
  import '@livx.cc/wcli/core';
4
4
 
5
5
  /** A JSON-RPC 2.0 transport: request (awaits a result), notify (fire-and-forget), close. */
@@ -161,9 +161,10 @@ interface ChatResponse {
161
161
  output?: unknown;
162
162
  status: 'running' | 'completed' | 'error';
163
163
  }[];
164
- /** A delegated runtime (cursor/claude-code) ended this turn on a tool with NO assistant text after it —
165
- * it went silent post-work. Signals the loop's closure reflex (see AgentOptions.closeDelegatedTurns). */
166
- endedOnToolNoText?: boolean;
164
+ /** A delegated runtime (cursor/claude-code) ran tools this turn but never CLOSED it: either no assistant
165
+ * text followed the last tool (it went silent post-work), or the text it did emit ends on an action it
166
+ * announced and never took. Signals the loop's closure reflex (see AgentOptions.closeDelegatedTurns). */
167
+ endedWithoutClosing?: boolean;
167
168
  }
168
169
  /**
169
170
  * One incremental event from a streamed `chat({stream:true})` call — mirrors
@@ -1,4 +1,4 @@
1
- import { A as AgentTool } from './tools-BZVppx-6.js';
1
+ import { A as AgentTool } from './tools-Byyh_bae.js';
2
2
  import '@livx.cc/wcli/core';
3
3
 
4
4
  /**
@@ -55,6 +55,9 @@ interface RealShellOptions {
55
55
  spawn?: SpawnFn;
56
56
  /** Per-command wall-clock cap (kill on overrun). Default 120s. */
57
57
  timeoutMs?: number;
58
+ /** Ceiling for the model-supplied `timeoutMs` argument (a long build can ask for more than the
59
+ * default, but not for an unbounded turn). Default 10min. */
60
+ maxTimeoutMs?: number;
58
61
  /** Extra env merged over the (optionally scrubbed) base env for the child. */
59
62
  env?: Record<string, string>;
60
63
  /** Strip likely-secret vars (API keys, tokens, cloud creds) from the child's env. Default ON.
@@ -446,20 +446,23 @@ var ShellJobRegistry = class {
446
446
  }
447
447
  };
448
448
  function makeRealShellTool(options) {
449
- const timeoutMs = options.timeoutMs ?? 12e4;
449
+ const defaultTimeoutMs = options.timeoutMs ?? 12e4;
450
+ const maxTimeoutMs = Math.max(options.maxTimeoutMs ?? 6e5, defaultTimeoutMs);
450
451
  return {
451
452
  name: "Shell",
452
- description: "Run a shell command via /bin/sh in the working directory. Executes any installed binary \u2014 ls, cat, grep, git, bun, node, curl, scripts, etc. Returns combined stdout+stderr; non-zero exits are prefixed `[exit N]`. Runs non-interactively with no terminal (stdin is /dev/null): commands that prompt for input fail fast rather than hang \u2014 for privileged actions use a non-interactive flag (e.g. `sudo -n`), or ask the user to run the command themselves. Set `background:true` for long-running processes (servers, watchers) \u2014 returns a job id immediately; poll with ShellOutput, stop with ShellKill.",
453
+ description: `Run a shell command via /bin/sh in the working directory. Executes any installed binary \u2014 ls, cat, grep, git, bun, node, curl, scripts, etc. Returns combined stdout+stderr; non-zero exits are prefixed \`[exit N]\`. Runs non-interactively with no terminal (stdin is /dev/null): commands that prompt for input fail fast rather than hang \u2014 for privileged actions use a non-interactive flag (e.g. \`sudo -n\`), or ask the user to run the command themselves. Each command is killed after ${defaultTimeoutMs}ms (result \`[exit 124]\` with whatever output it produced) \u2014 pass \`timeoutMs\` (max ${maxTimeoutMs}) for a legitimately slower command, and always bound network commands yourself (e.g. \`curl -m 10\`). Set \`background:true\` for long-running processes (servers, watchers) \u2014 returns a job id immediately; poll with ShellOutput, stop with ShellKill.`,
453
454
  parameters: {
454
455
  type: "object",
455
456
  required: ["command"],
456
457
  properties: {
457
458
  command: { type: "string", description: "the shell command line to execute" },
458
- background: { type: "boolean", description: "run detached and return a job id immediately (for servers/watchers/long builds)" }
459
+ background: { type: "boolean", description: "run detached and return a job id immediately (for servers/watchers/long builds)" },
460
+ timeoutMs: { type: "number", description: "wall-clock cap for THIS command, overriding the default (clamped to the tool max)" }
459
461
  }
460
462
  },
461
- async run({ command, background }, ctx) {
463
+ async run({ command, background, timeoutMs: askedTimeoutMs }, ctx) {
462
464
  const cmd = String(command ?? "");
465
+ const timeoutMs = Number.isFinite(askedTimeoutMs) && Number(askedTimeoutMs) > 0 ? Math.min(Number(askedTimeoutMs), maxTimeoutMs) : defaultTimeoutMs;
463
466
  if (!cmd.trim()) return "[exit 1] empty command";
464
467
  if (background) {
465
468
  if (!options.registry) return "Error: background execution is not enabled in this host (no job registry).";