@demicodes/agent 0.21.0 → 0.22.0
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/client-entry.d.mts +2 -2
- package/dist/index.d.mts +187 -41
- package/dist/index.mjs +434 -200
- package/dist/stdio-transport.d.mts +1 -1
- package/dist/{transport-_eV2zg9M.d.mts → transport-vzA9vMxT.d.mts} +2 -0
- package/dist/{websocket-transport-BC7OstFf.d.mts → websocket-transport-CyoM_NS1.d.mts} +1 -1
- package/package.json +5 -5
package/dist/client-entry.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as TranscriptPatch, l as ServerFrame, n as AgentServerTransport, o as ClientFrame, r as AgentTransport, s as ClientSessionEvent, t as AgentClientTransport, u as ShellCommandStatusLike, x as AgentMetadata } from "./transport-
|
|
2
|
-
import { a as AgentClient, i as AgentActionOptions, n as createWebSocketClientTransport, o as AgentClientListener, r as createWebSocketServerTransport, t as JsonWebSocket } from "./websocket-transport-
|
|
1
|
+
import { f as TranscriptPatch, l as ServerFrame, n as AgentServerTransport, o as ClientFrame, r as AgentTransport, s as ClientSessionEvent, t as AgentClientTransport, u as ShellCommandStatusLike, x as AgentMetadata } from "./transport-vzA9vMxT.mjs";
|
|
2
|
+
import { a as AgentClient, i as AgentActionOptions, n as createWebSocketClientTransport, o as AgentClientListener, r as createWebSocketServerTransport, t as JsonWebSocket } from "./websocket-transport-CyoM_NS1.mjs";
|
|
3
3
|
import { ProviderSelection } from "@demicodes/provider";
|
|
4
4
|
export { type AgentActionOptions, AgentClient, type AgentClientListener, type AgentClientTransport, type AgentMetadata, type AgentServerTransport, type AgentTransport, type ClientFrame, type ClientSessionEvent, type JsonWebSocket, type ProviderSelection, type ServerFrame, type ShellCommandStatusLike, type TranscriptPatch, createWebSocketClientTransport, createWebSocketServerTransport };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as AgentSystemPromptContext, B as CompactionWindow, C as AgentReferenceResolveContext, D as AgentSessionParams, E as AgentSessionOptions, F as ExternalMutationReservation, G as DEFAULT_TURN_RETRY_POLICY, H as TranscriptLog, I as ModelSwitchApply, J as resolveRetryPolicy, K as TurnRetryPolicy, L as SessionEvent, M as AgentToolContext, N as AgentToolInvokeContext, O as AgentSessionRestoreParams, P as AgentToolInvokeResult, R as SessionEventListener, S as AgentPromptContext, T as AgentSessionCloneParams, U as TranscriptOptions, V as DrainedTranscriptPatches, W as estimateTranscriptBlockTokens, Y as retryDelayMs, _ as AgentHarnessContext, a as createInProcessTransportPair, b as AgentLifecycleEvent, c as ConversationSummary, d as SubagentJob, f as TranscriptPatch, g as AgentHarness, h as AgentDisposeContext, i as InProcessTransportPair, j as AgentTool, k as AgentSessionStore, l as ServerFrame, m as AbortTarget, n as AgentServerTransport, o as ClientFrame, p as AbortResult, q as isRetryableCode, r as AgentTransport, s as ClientSessionEvent, t as AgentClientTransport, u as ShellCommandStatusLike, v as AgentHarnessRuntime, w as AgentSessionCheckpoint, x as AgentMetadata, y as AgentHostContext, z as SubagentProfile } from "./transport-
|
|
2
|
-
import { a as AgentClient, i as AgentActionOptions, n as createWebSocketClientTransport, o as AgentClientListener, r as createWebSocketServerTransport, t as JsonWebSocket } from "./websocket-transport-
|
|
3
|
-
import { BashAuditEvent, BashEnvironment, BashEnvironmentOptions, Command, CommandMetadataRecord, Host, HostStore, ShellCommandStatus, ShellOutputChunk } from "@demicodes/shell";
|
|
1
|
+
import { A as AgentSystemPromptContext, B as CompactionWindow, C as AgentReferenceResolveContext, D as AgentSessionParams, E as AgentSessionOptions, F as ExternalMutationReservation, G as DEFAULT_TURN_RETRY_POLICY, H as TranscriptLog, I as ModelSwitchApply, J as resolveRetryPolicy, K as TurnRetryPolicy, L as SessionEvent, M as AgentToolContext, N as AgentToolInvokeContext, O as AgentSessionRestoreParams, P as AgentToolInvokeResult, R as SessionEventListener, S as AgentPromptContext, T as AgentSessionCloneParams, U as TranscriptOptions, V as DrainedTranscriptPatches, W as estimateTranscriptBlockTokens, Y as retryDelayMs, _ as AgentHarnessContext, a as createInProcessTransportPair, b as AgentLifecycleEvent, c as ConversationSummary, d as SubagentJob, f as TranscriptPatch, g as AgentHarness, h as AgentDisposeContext, i as InProcessTransportPair, j as AgentTool, k as AgentSessionStore, l as ServerFrame, m as AbortTarget, n as AgentServerTransport, o as ClientFrame, p as AbortResult, q as isRetryableCode, r as AgentTransport, s as ClientSessionEvent, t as AgentClientTransport, u as ShellCommandStatusLike, v as AgentHarnessRuntime, w as AgentSessionCheckpoint, x as AgentMetadata, y as AgentHostContext, z as SubagentProfile } from "./transport-vzA9vMxT.mjs";
|
|
2
|
+
import { a as AgentClient, i as AgentActionOptions, n as createWebSocketClientTransport, o as AgentClientListener, r as createWebSocketServerTransport, t as JsonWebSocket } from "./websocket-transport-CyoM_NS1.mjs";
|
|
3
|
+
import { BashAuditEvent, BashEnvironment, BashEnvironmentOptions, Command, CommandMetadataRecord, CommandRegistry, Host, HostStore, ShellCommandStatus, ShellOutputChunk } from "@demicodes/shell";
|
|
4
4
|
import { AgentProvider, Provider } from "@demicodes/provider";
|
|
5
5
|
import { Block, Model, ModelMediaKind, ModelSelection, ProviderErrorDiagnostics, QueuedMessage, SessionPhase, UserContentBlock } from "@demicodes/core";
|
|
6
6
|
//#region src/recovery.d.ts
|
|
@@ -140,6 +140,8 @@ declare class AgentSession<State> {
|
|
|
140
140
|
abort(): Promise<AbortResult>;
|
|
141
141
|
scheduleYieldWakeup(durationMs: number, metadata?: AgentMetadata | null): AgentToolInvokeResult;
|
|
142
142
|
waitUntilDone(): Promise<void>;
|
|
143
|
+
/** True when no turn is running and no action (including queued user sends) is pending. */
|
|
144
|
+
isSettled(): boolean;
|
|
143
145
|
/**
|
|
144
146
|
* Tears the session down: aborts any in-flight turn and releases provider-held resources
|
|
145
147
|
* (e.g. a long-lived CLI subprocess). Called when the owning connection closes.
|
|
@@ -278,6 +280,11 @@ interface AgentServerOptions {
|
|
|
278
280
|
* the parent itself. Defaults to true.
|
|
279
281
|
*/
|
|
280
282
|
notifyParentOnIdle?: boolean;
|
|
283
|
+
/**
|
|
284
|
+
* Live-children ceiling applied to every session in the tree (each session
|
|
285
|
+
* counts its own direct children). Defaults to {@link MAX_LIVE_SUBAGENTS}.
|
|
286
|
+
*/
|
|
287
|
+
maxLiveSubagents?: number;
|
|
281
288
|
};
|
|
282
289
|
/**
|
|
283
290
|
* Optional host-side shell prep (env, PATH, etc.). Implementation-agnostic —
|
|
@@ -323,6 +330,7 @@ declare class AgentServer {
|
|
|
323
330
|
private readonly sessionOptions;
|
|
324
331
|
private readonly prepareShell;
|
|
325
332
|
private readonly notifyParentOnIdle;
|
|
333
|
+
private readonly maxLiveSubagents;
|
|
326
334
|
private readonly bindings;
|
|
327
335
|
private readonly sessionOwnership;
|
|
328
336
|
constructor(options: AgentServerOptions);
|
|
@@ -338,35 +346,140 @@ declare class AgentServer {
|
|
|
338
346
|
}
|
|
339
347
|
//#endregion
|
|
340
348
|
//#region src/subagent.d.ts
|
|
349
|
+
/** Default per-session live-children ceiling; override with `AgentServerOptions.subagents.maxLiveSubagents`. */
|
|
341
350
|
declare const MAX_LIVE_SUBAGENTS = 8;
|
|
342
|
-
declare const MAX_ARCHIVED_SUBAGENTS = 16;
|
|
343
351
|
declare const SUBAGENT_RESULT_MAX_BYTES: number;
|
|
344
352
|
type SubagentExecution = 'idle' | 'provider_streaming' | 'tool_executing' | 'compacting' | 'finalizing' | 'pending_yield';
|
|
353
|
+
interface SubagentClose {
|
|
354
|
+
phase: 'completed' | 'aborted' | 'error';
|
|
355
|
+
result?: string;
|
|
356
|
+
failure?: string;
|
|
357
|
+
}
|
|
358
|
+
interface ChildToolRecord {
|
|
359
|
+
toolUseId: string;
|
|
360
|
+
title: string;
|
|
361
|
+
startedAt: number;
|
|
362
|
+
endedAt: number | null;
|
|
363
|
+
status: 'executing' | 'completed' | 'error';
|
|
364
|
+
}
|
|
365
|
+
interface ChildJob<State> {
|
|
366
|
+
id: string;
|
|
367
|
+
description: string;
|
|
368
|
+
profile: SubagentProfile<State>;
|
|
369
|
+
profileName: string | null;
|
|
370
|
+
metadata: AgentMetadata | null;
|
|
371
|
+
session: AgentSession<State>;
|
|
372
|
+
/** Supervisor of this child's own children (the grandchildren of this supervisor's owner). */
|
|
373
|
+
ownSupervisor: ChildSupervisor<State>;
|
|
374
|
+
commandRegistry: CommandRegistry;
|
|
375
|
+
commandNames: string[];
|
|
376
|
+
environments: Map<Host, BashEnvironment>;
|
|
377
|
+
pendingEnvironments: Map<Host, Promise<BashEnvironment>>;
|
|
378
|
+
readonlyHosts: WeakMap<Host, Host>;
|
|
379
|
+
spawnedAt: number;
|
|
380
|
+
lastEventAt: number;
|
|
381
|
+
tools: ChildToolRecord[];
|
|
382
|
+
lastAssistantTextAt: number | null;
|
|
383
|
+
phase: SubagentJob['phase'];
|
|
384
|
+
failure: string | null;
|
|
385
|
+
unsubscribe: () => void;
|
|
386
|
+
closed: Promise<SubagentClose>;
|
|
387
|
+
settleClosed: (close: SubagentClose) => void;
|
|
388
|
+
isClosing: boolean;
|
|
389
|
+
/** Wakes the settle loop when the child set or an inbound send changes the picture. */
|
|
390
|
+
wake: (() => void) | null;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Connection-wide flat registry of every live session in the tree: the root
|
|
394
|
+
* plus every subagent at any depth. The sole basis for cross-tree addressing —
|
|
395
|
+
* `send`, `steer`, `show`, and `list` resolve here, with no routing rules
|
|
396
|
+
* along the tree.
|
|
397
|
+
*/
|
|
398
|
+
declare class AgentDirectory<State = unknown> {
|
|
399
|
+
private root;
|
|
400
|
+
private readonly entries;
|
|
401
|
+
attachRoot(session: AgentSession<State>, supervisor: ChildSupervisor<State>): void;
|
|
402
|
+
rootId(): string;
|
|
403
|
+
rootSession(): AgentSession<State>;
|
|
404
|
+
register(job: ChildJob<State>, owner: ChildSupervisor<State>): void;
|
|
405
|
+
unregister(id: string): void;
|
|
406
|
+
liveEntry(id: string): {
|
|
407
|
+
job: ChildJob<State>;
|
|
408
|
+
owner: ChildSupervisor<State>;
|
|
409
|
+
} | null;
|
|
410
|
+
/** The parent session id of a live agent; null for the root, undefined for an unknown id. */
|
|
411
|
+
parentIdOf(id: string): string | null | undefined;
|
|
412
|
+
/**
|
|
413
|
+
* The whole session tree: the root, every live agent, and each live node's
|
|
414
|
+
* archived children (their supervisors exist, so their archives are
|
|
415
|
+
* readable). Live children order by spawn time; archived newest first.
|
|
416
|
+
*/
|
|
417
|
+
tree(): Promise<AgentTreeNode[]>;
|
|
418
|
+
}
|
|
419
|
+
interface AgentTreeNode {
|
|
420
|
+
id: string;
|
|
421
|
+
parentId: string | null;
|
|
422
|
+
kind: 'root' | 'live' | 'archived';
|
|
423
|
+
description: string;
|
|
424
|
+
profile: string | null;
|
|
425
|
+
phase: SubagentJob['phase'];
|
|
426
|
+
closedAgoMs: number | null;
|
|
427
|
+
/** Pre-rendered live status line (id, phase, ages, execution, activity); null for root/archived. */
|
|
428
|
+
line: string | null;
|
|
429
|
+
children: AgentTreeNode[];
|
|
430
|
+
}
|
|
345
431
|
interface ChildSupervisorOptions<State> {
|
|
346
432
|
agent: AgentHarness<State>;
|
|
347
433
|
cwd: string;
|
|
348
434
|
/** Harness-configured profiles; null means the implicit `default` only. */
|
|
349
435
|
profiles: SubagentProfile<State>[] | null;
|
|
350
|
-
/**
|
|
436
|
+
/** The owner session's harness commands, before the `demi agent` injection. */
|
|
351
437
|
parentCommands: Command[];
|
|
352
438
|
shellOptions: Omit<BashEnvironmentOptions, 'host' | 'commands'>;
|
|
353
439
|
prepareShell: PrepareShell | null;
|
|
354
440
|
sessionOptions: AgentServerSessionOptions;
|
|
355
441
|
/** When false, a child closing never wakes an idle parent; the host app orchestrates the wakeup from the `subagent closed` frame. */
|
|
356
442
|
notifyParentOnIdle: boolean;
|
|
357
|
-
/** Backing store for child checkpoints and job metadata
|
|
443
|
+
/** Backing store for child checkpoints and job metadata. */
|
|
358
444
|
store: HostStore;
|
|
445
|
+
/** Store key prefix of the owner session's directory (e.g. `agent-sessions/<id>`); children nest under `<prefix>/subagents/<childId>`. */
|
|
446
|
+
storePrefix: string;
|
|
447
|
+
/** Connection-wide registry shared by every supervisor in the tree. */
|
|
448
|
+
directory: AgentDirectory<State>;
|
|
449
|
+
/** Live-children ceiling for this supervisor (from `AgentServerOptions.subagents.maxLiveSubagents`). */
|
|
450
|
+
maxLiveSubagents: number;
|
|
451
|
+
/** When false, this supervisor's owner may not spawn: its `demi agent` tree carries communication and reads only. */
|
|
452
|
+
canSpawn: boolean;
|
|
453
|
+
/** Invoked whenever the live-children set changes; wired to the owning job's settle loop. */
|
|
454
|
+
onJobsChanged: (() => void) | null;
|
|
359
455
|
emit(frame: ServerFrame): void;
|
|
360
456
|
}
|
|
361
457
|
/**
|
|
362
|
-
*
|
|
363
|
-
*
|
|
364
|
-
*
|
|
365
|
-
*
|
|
366
|
-
*
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
458
|
+
* The on-store shape of a child (`<prefix>/subagents/<id>/job.json`); its
|
|
459
|
+
* checkpoint sits beside it. Without `closedPhase` the child is live (a parent
|
|
460
|
+
* restore resumes it); with `closedPhase` it is archived — finished but
|
|
461
|
+
* revivable with `demi agent resume`, skipped by restore, never pruned: it
|
|
462
|
+
* lives exactly as long as the owning session directory.
|
|
463
|
+
*/
|
|
464
|
+
interface PersistedSubagentJob {
|
|
465
|
+
description: string;
|
|
466
|
+
profileName: string | null;
|
|
467
|
+
metadata: AgentMetadata | null;
|
|
468
|
+
spawnedAt: number;
|
|
469
|
+
/** Absent means true; false pins the child to a communication-only `demi agent` tree across restores. */
|
|
470
|
+
canSpawnSubagents?: boolean;
|
|
471
|
+
closedPhase?: SubagentClose['phase'];
|
|
472
|
+
closedAt?: number;
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Per-session subagent supervisor. Every session — root or subagent — owns one
|
|
476
|
+
* and carries the identical `demi agent` command tree, so spawn nests to any
|
|
477
|
+
* depth. The supervisor owns its direct children's lifecycle (spawn / abort /
|
|
478
|
+
* resume / natural end), their shell environments, and the `subagent*`
|
|
479
|
+
* protocol frames; communication and reads (`send` / `steer` / `show` /
|
|
480
|
+
* `list`) resolve through the shared AgentDirectory and reach any live agent
|
|
481
|
+
* in the tree. Children persist under the owner's session directory,
|
|
482
|
+
* recursively, and reopening a session restores its whole subtree.
|
|
370
483
|
*/
|
|
371
484
|
declare class ChildSupervisor<State = unknown> {
|
|
372
485
|
private readonly options;
|
|
@@ -375,29 +488,33 @@ declare class ChildSupervisor<State = unknown> {
|
|
|
375
488
|
private isDisposed;
|
|
376
489
|
constructor(options: ChildSupervisorOptions<State>);
|
|
377
490
|
attachParent(session: AgentSession<State>): void;
|
|
378
|
-
|
|
491
|
+
ownerId(): string;
|
|
492
|
+
hasLiveJobs(): boolean;
|
|
493
|
+
/** The `agent` node AgentServer (and every child assembly) grafts under the registry's `demi` root. */
|
|
379
494
|
rootCommandNode(): Command;
|
|
495
|
+
private spawnableCommandNode;
|
|
380
496
|
hasShell(shellId: string): boolean;
|
|
381
|
-
/** Resolves the
|
|
497
|
+
/** Resolves the descendant scope owning a shell (recursively), for the command bridge dispatch. */
|
|
382
498
|
environmentScopeForShell(shellId: string): {
|
|
383
499
|
environment: BashEnvironment;
|
|
384
500
|
commandNames: ReadonlySet<string>;
|
|
385
501
|
agentSessionId: string;
|
|
386
502
|
} | null;
|
|
387
|
-
/** Re-emits `subagent started` + transcript reset for
|
|
503
|
+
/** Re-emits `subagent started` + transcript reset for the whole live subtree (transcript resync). */
|
|
388
504
|
replay(): void;
|
|
389
505
|
/**
|
|
390
|
-
* Detaches
|
|
391
|
-
* flushes checkpoints, and keeps the persisted
|
|
392
|
-
*
|
|
506
|
+
* Detaches the live subtree on connection teardown: aborts in-flight turns,
|
|
507
|
+
* flushes checkpoints, and keeps the persisted jobs so the next open of the
|
|
508
|
+
* owner restores them — the same dispose semantics as the owner session.
|
|
393
509
|
* No `closed` frame is emitted: the children are not done, just paused.
|
|
394
510
|
*/
|
|
395
511
|
dispose(): Promise<void>;
|
|
396
512
|
/**
|
|
397
|
-
* Rebuilds every persisted live child of this
|
|
513
|
+
* Rebuilds every persisted live child of this owner and finishes what it was
|
|
398
514
|
* doing: an interrupted turn resumes from its resume point; an already
|
|
399
|
-
* quiescent child closes with its result.
|
|
400
|
-
*
|
|
515
|
+
* quiescent child closes with its result. Recursive: each restored child
|
|
516
|
+
* restores its own subtree. Children share the owner's persistence
|
|
517
|
+
* lifecycle — a session restore is a subtree restore.
|
|
401
518
|
*/
|
|
402
519
|
restore(): Promise<void>;
|
|
403
520
|
private restoreJob;
|
|
@@ -410,14 +527,21 @@ declare class ChildSupervisor<State = unknown> {
|
|
|
410
527
|
* transcript.
|
|
411
528
|
*/
|
|
412
529
|
private resumeArchived;
|
|
413
|
-
/** Every archived (finished, revivable) child of this
|
|
414
|
-
|
|
415
|
-
|
|
530
|
+
/** Every archived (finished, revivable) child of this owner, newest first. */
|
|
531
|
+
listArchivedJobs(): Promise<{
|
|
532
|
+
id: string;
|
|
533
|
+
meta: PersistedSubagentJob;
|
|
534
|
+
}[]>;
|
|
416
535
|
abortSubtree(id: string): Promise<void>;
|
|
417
|
-
/** Aborts every live child; the archive is untouched. */
|
|
536
|
+
/** Aborts every live child (each with its subtree); the archive is untouched. */
|
|
418
537
|
abortAll(): Promise<void>;
|
|
419
538
|
private spawn;
|
|
420
|
-
/**
|
|
539
|
+
/**
|
|
540
|
+
* Everything spawn and restore share: the command tree (identical to the
|
|
541
|
+
* owner's — children spawn, message, and observe exactly like any session),
|
|
542
|
+
* the child's own supervisor, the harness runtime, and the job record
|
|
543
|
+
* (session attached separately).
|
|
544
|
+
*/
|
|
421
545
|
private assembleJob;
|
|
422
546
|
private attachSession;
|
|
423
547
|
private childStoreKey;
|
|
@@ -425,20 +549,42 @@ declare class ChildSupervisor<State = unknown> {
|
|
|
425
549
|
private deletePersistedJob;
|
|
426
550
|
/** Shared spawn/resume foreground behaviour: announce the id, wire abort and stdin steers, wait for close, report the outcome. */
|
|
427
551
|
private attendChild;
|
|
428
|
-
/**
|
|
552
|
+
/**
|
|
553
|
+
* Resolves a send/steer target against the directory. `parent` is the
|
|
554
|
+
* session that spawned the caller; a caller cannot message itself.
|
|
555
|
+
*/
|
|
556
|
+
private resolveTarget;
|
|
557
|
+
/**
|
|
558
|
+
* Mailbox delivery: an ordinary user send on the target session. The
|
|
559
|
+
* session's own action queue is the inbox — a busy target sees it as a new
|
|
560
|
+
* user turn after the current one; an idle root wakes; a finishing subagent
|
|
561
|
+
* is kept open for one more turn by its settle loop (the enqueue lands
|
|
562
|
+
* before the loop's synchronous close check, so nothing drops silently).
|
|
563
|
+
*/
|
|
564
|
+
private deliverSend;
|
|
565
|
+
/** Chime-in delivery: injects into the target's running turn; no fallback when idle. */
|
|
566
|
+
private deliverSteer;
|
|
567
|
+
private senderPrefix;
|
|
568
|
+
/** Metadata for a turn on the root: the sender subtree's spawning round, or null from the root itself. */
|
|
569
|
+
private senderMetadata;
|
|
570
|
+
/** Delivers one stdin chunk from the attending spawner: mid-turn as a steer, otherwise as a new user turn. */
|
|
429
571
|
private steerChild;
|
|
430
572
|
private pumpStdinSteers;
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
573
|
+
/** Observes one turn promise of an own child: a non-abort failure closes the job as an error. */
|
|
574
|
+
private trackTurn;
|
|
575
|
+
/**
|
|
576
|
+
* The one place a child closes naturally. Loops until the child is
|
|
577
|
+
* quiescent: no running or queued turn (the session action queue doubles as
|
|
578
|
+
* the mailbox), no pending yield wakeups, and no live children of its own.
|
|
579
|
+
* The final check-and-close is synchronous, so a send that lands before it
|
|
580
|
+
* is processed and one that lands after it fails on `isClosing` — nothing
|
|
581
|
+
* drops silently.
|
|
582
|
+
*/
|
|
583
|
+
private settleJob;
|
|
436
584
|
private closeJob;
|
|
437
585
|
private disposeJobShells;
|
|
438
|
-
/** Wakes an idle
|
|
586
|
+
/** Wakes an idle owner with a user send; an owner blocked in the spawn gets the tool result instead. */
|
|
439
587
|
private notifyIdleParent;
|
|
440
|
-
private createChildAgentNode;
|
|
441
|
-
private deliverToParent;
|
|
442
588
|
private childEnvironment;
|
|
443
589
|
private createChildEnvironment;
|
|
444
590
|
private resolveProfile;
|
|
@@ -448,9 +594,9 @@ declare class ChildSupervisor<State = unknown> {
|
|
|
448
594
|
private executionOf;
|
|
449
595
|
private activityOf;
|
|
450
596
|
private executionForMs;
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
597
|
+
snapshot(job: ChildJob<State>, detailed: boolean): Record<string, unknown>;
|
|
598
|
+
renderListLine(job: ChildJob<State>): string;
|
|
599
|
+
renderShow(job: ChildJob<State>): string;
|
|
454
600
|
private wireJob;
|
|
455
601
|
}
|
|
456
602
|
/**
|
|
@@ -534,4 +680,4 @@ interface ShellToolView {
|
|
|
534
680
|
declare function finishShellToolResult<State>(environment: BashEnvironment, result: ShellCommandStatus, ctx: AgentToolInvokeContext<State>): Promise<AgentToolInvokeResult>;
|
|
535
681
|
declare function shellCommandHandleRequired(result: ShellCommandStatus, budgetTokens: number): boolean;
|
|
536
682
|
//#endregion
|
|
537
|
-
export { AbortResult, AbortTarget, ActiveTurnPhase, AgentActionOptions, AgentClient, AgentClientListener, AgentClientTransport, AgentDisposeContext, AgentHarness, AgentHarnessContext, AgentHarnessRuntime, AgentHostContext, AgentLifecycleEvent, AgentMetadata, AgentPromptContext, AgentReferenceResolveContext, AgentServer, AgentServerOptions, AgentServerSessionOptions, AgentServerTransport, AgentSession, AgentSessionCheckpoint, AgentSessionCloneParams, AgentSessionOptions, AgentSessionParams, AgentSessionRestoreParams, AgentSessionStore, AgentSystemPromptContext, AgentTool, AgentToolContext, AgentToolInvokeContext, AgentToolInvokeResult, AgentTransport, AgentTransportBinding, ChildSupervisor, ChildSupervisorOptions, ClientFrame, ClientSessionEvent, CompactionWindow, ConversationSummary, DEFAULT_MAX_MEDIA_BYTES, DEFAULT_TURN_RETRY_POLICY, DrainedTranscriptPatches, ExternalMutationReservation, InProcessTransportPair, JsonWebSocket,
|
|
683
|
+
export { AbortResult, AbortTarget, ActiveTurnPhase, AgentActionOptions, AgentClient, AgentClientListener, AgentClientTransport, AgentDirectory, AgentDisposeContext, AgentHarness, AgentHarnessContext, AgentHarnessRuntime, AgentHostContext, AgentLifecycleEvent, AgentMetadata, AgentPromptContext, AgentReferenceResolveContext, AgentServer, AgentServerOptions, AgentServerSessionOptions, AgentServerTransport, AgentSession, AgentSessionCheckpoint, AgentSessionCloneParams, AgentSessionOptions, AgentSessionParams, AgentSessionRestoreParams, AgentSessionStore, AgentSystemPromptContext, AgentTool, AgentToolContext, AgentToolInvokeContext, AgentToolInvokeResult, AgentTransport, AgentTransportBinding, AgentTreeNode, ChildSupervisor, ChildSupervisorOptions, ClientFrame, ClientSessionEvent, CompactionWindow, ConversationSummary, DEFAULT_MAX_MEDIA_BYTES, DEFAULT_TURN_RETRY_POLICY, DrainedTranscriptPatches, ExternalMutationReservation, InProcessTransportPair, JsonWebSocket, MAX_LIVE_SUBAGENTS, ModelSwitchApply, PrepareShell, PrepareShellContext, ProviderStreamError, ResumePoint, RunCommandLineCommandNotRegisteredError, RunCommandLineOptions, RunCommandLineResult, RunCommandLineShellNotFoundError, RunCommandLineTimeoutError, SHELL_VIEW_MAX_CHARS, SUBAGENT_RESULT_MAX_BYTES, ServerFrame, SessionEvent, SessionEventListener, ShellCommandStatusLike, ShellToolResultOptions, ShellToolView, StandardAgentToolOptions, SubagentExecution, SubagentJob, SubagentProfile, TranscriptLog, TranscriptOptions, TranscriptPatch, TurnRetryPolicy, applyTranscriptPatches, cloneBlocks, createInProcessTransportPair, createReadonlyHost, createStandardAgentTools, createWebSocketClientTransport, createWebSocketServerTransport, estimateTranscriptBlockTokens, findResumePoint, finishShellToolResult, injectSubagentCommand, isContextLengthExceeded, isRetryableCode, resolveRetryPolicy, retryDelayMs, shellCommandHandleRequired, shellPreviewBudgetTokens, toShellToolResult };
|