@livx.cc/agentx 0.99.39 → 0.99.41

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/index.d.ts CHANGED
@@ -1,14 +1,15 @@
1
- import { a as AgentOptions, H as Hooks, i as RunResult, A as Agent } from './Agent-DJwg1g8V.js';
2
- export { C as ChatFragment, b as CompactResult, D as DEFAULT_MUTATING, c as Decision, P as PermissionOptions, d as PermissionPolicy, e as PermissionRule, f as PreToolUseDecision, R as ReasoningEffort, g as RecordingHooks, h as RecordingLifecycle, T as ToolUse, j as ToolUseMeta, k as composeHooks, l as estimateTokens, p as planMode, r as reasoningToChatFragment } from './Agent-DJwg1g8V.js';
1
+ import { a as AgentOptions, H as Hooks, i as RunResult, A as Agent } from './Agent-DydgLoT-.js';
2
+ export { C as ChatFragment, b as CompactResult, D as DEFAULT_MUTATING, c as Decision, P as PermissionOptions, d as PermissionPolicy, e as PermissionRule, f as PreToolUseDecision, R as ReasoningEffort, g as RecordingHooks, h as RecordingLifecycle, T as ToolUse, j as ToolUseMeta, k as composeHooks, l as estimateTokens, p as planMode, r as reasoningToChatFragment } from './Agent-DydgLoT-.js';
3
3
  export { MODEL_ALIASES, ModelSwitch, ResolveModelSwitchOpts, modelShortLabel, resolveModelAlias, resolveModelSwitch } from './models.js';
4
4
  import { IFilesystem, FileMetadata } from '@livx.cc/wcli/core';
5
5
  export { CommandExecutor, FileMetadata, IFilesystem, IndexedDbFilesystem, MemFilesystem, registerHeadlessCommands } from '@livx.cc/wcli/core';
6
6
  import { BodDB } from '@bod.ee/db';
7
- import { A as AgentTool, C as ChatLike, a as ChatOptions, b as ChatResponse, j as ToolCall, H as HostBridge, U as UserQuestion, g as MessageContent } from './tools-Byyh_bae.js';
8
- export { c as ContentPart, d as HostEvent, I as IMAGE_ELIDE_STUB, e as IMAGE_REF_SCHEME, f as ImageRef, M as Message, R as Role, S as SandboxJobRegistry, h as StreamChunk, T as TodoItem, i as Tool, k as ToolContext, l as bashTool, m as clearImageRefs, n as contentBytes, o as contentText, p as defaultTools, q as editTool, r as elideImages, s as elideInlineImages, t as elideStaleImages, u as exitSessionTool, v as expandImagesForSend, w as imagePart, x as imageRefPart, y as imageRefResult, z as makeContext, B as makeJobTools, D as messageHasImage, E as messageHasImageRef, F as messageHasInlineImage, G as mintImageRef, J as parseImageRef, K as readTool, L as remintImageRefs, N as sendBytes, O as sendBytesPer, P as toWireTools, Q as todoWriteTool, V as toolImageRef, W as toolRegistry, X as toolsByName } from './tools-Byyh_bae.js';
7
+ import { A as AgentTool, C as ChatLike, a as ChatOptions, b as ChatResponse, j as ToolCall, H as HostBridge, U as UserQuestion, g as MessageContent } from './tools-S-ArIR3o.js';
8
+ export { c as ContentPart, d as HostEvent, I as IMAGE_ELIDE_STUB, e as IMAGE_REF_SCHEME, f as ImageRef, M as Message, R as Role, S as SandboxJobRegistry, h as StreamChunk, T as TodoItem, i as Tool, k as ToolContext, l as bashTool, m as clearImageRefs, n as contentBytes, o as contentText, p as defaultTools, q as editTool, r as elideImages, s as elideInlineImages, t as elideStaleImages, u as exitSessionTool, v as expandImagesForSend, w as imagePart, x as imageRefPart, y as imageRefResult, z as makeContext, B as makeJobTools, D as messageHasImage, E as messageHasImageRef, F as messageHasInlineImage, G as mintImageRef, J as parseImageRef, K as readTool, L as remintImageRefs, N as sendBytes, O as sendBytesPer, P as toWireTools, Q as todoWriteTool, V as toolImageRef, W as toolRegistry, X as toolsByName } from './tools-S-ArIR3o.js';
9
+ import { ShellJobRegistry } from './tools.shell.js';
9
10
  import { SpokenSplitter } from '@bod.ee/voice';
10
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';
11
- 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-Bd19NiCL.js';
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-D5eN0JyQ.js';
12
13
  import * as libx_js_src_modules_log from 'libx.js/src/modules/log';
13
14
  export { log } from 'libx.js/src/modules/log';
14
15
 
@@ -438,6 +439,26 @@ declare function diskAgentOptions(opts?: Partial<AgentOptions>): Partial<AgentOp
438
439
  * edge-safe to import. `cwd` defaults to `process.cwd()`; secret env is scrubbed from spawned children. */
439
440
  declare function fullAgentOptions(opts?: Partial<AgentOptions> & {
440
441
  cwd?: string;
442
+ /**
443
+ * Push a finished background job back to the MODEL (Claude-Code parity). Without it `background:true`
444
+ * is write-only: the job finishes and nothing ever tells the model — so the Shell tool's description
445
+ * drops its cross-turn promise too, rather than lying to the model about this host.
446
+ *
447
+ * Wire it to the agent you are about to build — the closure runs long after construction:
448
+ * const agent = new Agent(await fullAgentOptions({ ai, onJobExit: (n) => agent.inject(n) }));
449
+ */
450
+ onJobExit?: (notice: string) => void;
451
+ /**
452
+ * Bring your OWN registry instead of letting the preset build one. This is the handle a preset host
453
+ * otherwise never gets (the preset returns `AgentOptions`, not the registry), which is what left
454
+ * `ShellJobRegistry.setOnExit()` unreachable from this path — a host can now wire (or rewire) the
455
+ * completion callback after the Agent exists:
456
+ * const jobs = new ShellJobRegistry({ cwd, killOnExit: true });
457
+ * const agent = new Agent(await fullAgentOptions({ ai, jobs }));
458
+ * jobs.setOnExit((n) => agent.inject(formatJobExit(n)));
459
+ * `onJobExit` still works and, when both are given, is applied to the registry you passed.
460
+ */
461
+ jobs?: ShellJobRegistry;
441
462
  }): Promise<Partial<AgentOptions>>;
442
463
 
443
464
  /**
@@ -1258,6 +1279,25 @@ interface TaskToolOptions {
1258
1279
  maxParallel?: number;
1259
1280
  /** Parent hooks — `onSubagentStop` fires with each child's summary when it finishes. */
1260
1281
  hooks?: Hooks;
1282
+ /**
1283
+ * Wall-clock ceiling for ONE child run, in ms (default `SUBAGENT_MAX_DURATION_MS`). `maxSteps` alone is
1284
+ * not a bound: 25 steps x a 600s Shell is ~250 minutes, far past any transport deadline wrapping the
1285
+ * parent — and an undeclared tool cannot be named by `toolTimeoutViolations`. This deadline is ENFORCED
1286
+ * (the child's signal is aborted) and therefore honestly declarable as the tool's `maxDurationMs`.
1287
+ */
1288
+ maxDurationMs?: number;
1289
+ /** The parent's toolbelt — the child INHERITS it by default (otherwise it falls back to the jailed
1290
+ * `defaultTools()` and loses everything the host injected: a real shell, Write/Grep, MCP tools).
1291
+ * An agentType def's `tools` allowlist still narrows it (and can name one of these by name). */
1292
+ tools?: AgentTool[];
1293
+ /** The parent's system prompt — inherited by a plain (untyped) child so it keeps the host's persona
1294
+ * instead of reverting to agentx's generic built-in one. An agentType def's body overrides it. */
1295
+ systemPrompt?: string;
1296
+ /** Provider-specific options for the CHILD's model, recomputed per child (IoC — same seam duplex uses
1297
+ * for its workers). The child's model may differ from the parent's (explicit `model` / agentType def),
1298
+ * and provider options are NOT portable across providers (cursor `cwd`/`cursorSession` on anthropic
1299
+ * is a hard 400), so they are derived, never blindly inherited. */
1300
+ providerOptionsFor?: (model: string) => Record<string, unknown> | undefined;
1261
1301
  /** Origin-anchored real-disk dir for child transcript traces (see `AgentOptions.traceDir`). Passed
1262
1302
  * down UNCHANGED to nested children so every level writes to the same origin `.agent`. */
1263
1303
  traceDir?: string;