@ordewell/core 0.12.2 → 0.12.4

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.
Files changed (46) hide show
  1. package/dist/{ModeResolver-CA2fUU9h.d.mts → ModeResolver-CkZnbIqs.d.mts} +1 -1
  2. package/dist/{ModeResolver-B64aUZXJ.d.ts → ModeResolver-DS-aCVOP.d.ts} +1 -1
  3. package/dist/{Task-CxGgN6I0.d.mts → Task-D3O49EUo.d.mts} +43 -6
  4. package/dist/{Task-CxGgN6I0.d.ts → Task-D3O49EUo.d.ts} +43 -6
  5. package/dist/{chunk-RZ23BMVR.mjs → chunk-3S5IVTZM.mjs} +80 -22
  6. package/dist/chunk-3S5IVTZM.mjs.map +1 -0
  7. package/dist/{chunk-FX33UKAD.mjs → chunk-IOYBL3E5.mjs} +3 -3
  8. package/dist/{chunk-UDUATSCJ.mjs → chunk-MJKCU4U7.mjs} +1 -1
  9. package/dist/{chunk-UDUATSCJ.mjs.map → chunk-MJKCU4U7.mjs.map} +1 -1
  10. package/dist/{chunk-PKJTN2PD.mjs → chunk-POD3KZQW.mjs} +7 -1
  11. package/dist/chunk-POD3KZQW.mjs.map +1 -0
  12. package/dist/{chunk-2IFKPYPO.mjs → chunk-YZDWWXCB.mjs} +58 -17
  13. package/dist/chunk-YZDWWXCB.mjs.map +1 -0
  14. package/dist/{eventStore-CTCSKS9E.d.ts → eventStore-BcoMsZtU.d.mts} +23 -7
  15. package/dist/{eventStore-CcB8yELZ.d.mts → eventStore-CSFKy48Y.d.ts} +23 -7
  16. package/dist/index.d.mts +251 -243
  17. package/dist/index.d.ts +251 -243
  18. package/dist/index.js +3059 -1448
  19. package/dist/index.js.map +1 -1
  20. package/dist/index.mjs +2716 -1203
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/parsing.d.mts +2 -2
  23. package/dist/parsing.d.ts +2 -2
  24. package/dist/parsing.js +43 -15
  25. package/dist/parsing.js.map +1 -1
  26. package/dist/parsing.mjs +3 -3
  27. package/dist/plan-utils.d.mts +4 -4
  28. package/dist/plan-utils.d.ts +4 -4
  29. package/dist/plan-utils.js +65 -14
  30. package/dist/plan-utils.js.map +1 -1
  31. package/dist/plan-utils.mjs +15 -3
  32. package/dist/plan-utils.mjs.map +1 -1
  33. package/dist/{runSettingsText-lKLDsyli.d.ts → runSettingsText-BFaZSPRG.d.ts} +686 -26
  34. package/dist/{runSettingsText-DFVpe6aU.d.mts → runSettingsText-DWsmcnBq.d.mts} +686 -26
  35. package/dist/testing.d.mts +46 -3
  36. package/dist/testing.d.ts +46 -3
  37. package/dist/testing.js +66 -4
  38. package/dist/testing.js.map +1 -1
  39. package/dist/testing.mjs +52 -5
  40. package/dist/testing.mjs.map +1 -1
  41. package/docker/task.Dockerfile +7 -4
  42. package/package.json +1 -1
  43. package/dist/chunk-2IFKPYPO.mjs.map +0 -1
  44. package/dist/chunk-PKJTN2PD.mjs.map +0 -1
  45. package/dist/chunk-RZ23BMVR.mjs.map +0 -1
  46. /package/dist/{chunk-FX33UKAD.mjs.map → chunk-IOYBL3E5.mjs.map} +0 -0
@@ -1,6 +1,7 @@
1
- import { b3 as RunnerId, bp as Task, p as DiscoveredModel, bl as StoredHandoff, bA as TaskSnapshot, b as AwaitingReason, bG as UsageRecord, b4 as RunnerSessionCost, J as HandoffCommit, bI as Verdict, aj as LegacyPlanState, bx as TaskReportTo, bz as TaskSkillSnapshot, by as TaskSkillNotice, bm as SubagentOutcome, c as BelowPlan, C as CheckWord, am as Mandate, aq as MandateRequest, ap as MandateRefusal, ad as IsolationTaskRef, a$ as RevertCommand, aa as IsolationRevertTask, h as ConversationMessage, bh as SkillLoadNotice, aw as PendingPlanTurn, K as HandoffDigest, a as AttemptUsage, bv as TaskLoop, bt as TaskIsolation, o as DelegatedRow, b2 as RunSettings, X as IsolationHandoff, aA as PlanUsage, a2 as IsolationMergeResult, aR as ReplyRun, ba as SessionBilling, ar as ModelUsage, bH as UsageTotals, g as ContextFill, aC as PlannerCompaction, s as ExecutionRecord, aY as ResearchStep, ay as PlanState, ab as IsolationRun, T as IWorktreeIsolation, aQ as RepairWait, ag as IsolationView, a9 as IsolationRevertResult, bB as TaskStatus, q as ExecutionActor, w as GuardTrip, at as NodeAuthority, v as GuardTarget, b7 as ScriptBody, r as ExecutionCommandName, aX as ResearchProgress, aW as ResearchLogEntry, bf as SkillInfo, bg as SkillLoad, bk as SkillsService, aE as PlannerContextPause, a0 as IsolationMergeBlock, _ as IsolationLandedTask, a4 as IsolationPreview, a_ as ResearchToolType, bo as SupervisorLevel, ak as LoopSubject, aZ as ResearchStepOutcome, aD as PlannerCompactionOutcome, aG as PlannerUsage, t as FindingSeverity, bC as TaskType, bn as SubtreeReport, av as PatchView, bu as TaskIsolationState, bD as TaskUsageSummary } from './Task-CxGgN6I0.js';
2
- import { q as ApprovalRequest, r as ApprovalSource, U as IApproval, bO as ToolOutcome, _ as IRunnerSession, a1 as IsolationRunController, V as IConfig, bR as UsageLimitSignal, bA as TaskMessageFrom, b4 as RunnerModelRef, aX as RunnerCommand, b1 as RunnerMcpServer, bs as StructuredTurnEnd, k as ApprovalDecision, bg as ScriptRun, bh as ScriptStatus, br as StructuredEvent, aj as NodePath, u as BoardDraft, v as BoardEntry, w as BoardPost, t as BoardAuthor, af as McpToolReply, J as EventStore, j as ApprovalAnswer, aK as QueuedTaskMessage, l as ApprovalKind, Y as INotification, Z as IRunner, b6 as RunnerRegistry, bo as SkillLookup, bJ as TaskShellSite, bI as TaskShell, K as ExecutionBackend, aR as ReservedLease, d as AgentProcessDeps, a as AgentAdapter, ar as OrdewellMcpServer, ap as OpenLease, W as IFileSystem, ay as PlannerModes, a0 as IsolatedExecution, aE as PlannerToolHandler, bG as TaskRunnerConfig, b0 as RunnerManifest, f as AiProvider, ax as PlannerBackendId, aq as OrchestratorOption, bl as SessionMeta } from './eventStore-CTCSKS9E.js';
3
- import { R as RunnerModeInfo } from './ModeResolver-B64aUZXJ.js';
1
+ import { b4 as RunnerId, bq as Task, p as DiscoveredModel, bm as StoredHandoff, bB as TaskSnapshot, b as AwaitingReason, bH as UsageRecord, b5 as RunnerSessionCost, J as HandoffCommit, bJ as Verdict, aj as LegacyPlanState, by as TaskReportTo, bA as TaskSkillSnapshot, bz as TaskSkillNotice, bn as SubagentOutcome, c as BelowPlan, C as CheckWord, am as Mandate, aq as MandateRequest, ap as MandateRefusal, ad as IsolationTaskRef, b0 as RevertCommand, aa as IsolationRevertTask, h as ConversationMessage, bi as SkillLoadNotice, aw as PendingPlanTurn, K as HandoffDigest, a as AttemptUsage, bw as TaskLoop, bu as TaskIsolation, o as DelegatedRow, b3 as RunSettings, X as IsolationHandoff, aA as PlanUsage, a2 as IsolationMergeResult, aS as ReplyRun, bb as SessionBilling, ar as ModelUsage, bI as UsageTotals, g as ContextFill, aC as PlannerCompaction, s as ExecutionRecord, aZ as ResearchStep, ay as PlanState, ab as IsolationRun, T as IWorktreeIsolation, aR as RepairWait, ag as IsolationView, a9 as IsolationRevertResult, bC as TaskStatus, q as ExecutionActor, w as GuardTrip, at as NodeAuthority, v as GuardTarget, b8 as ScriptBody, r as ExecutionCommandName, aF as PlannerNativeSession, aY as ResearchProgress, aX as ResearchLogEntry, bg as SkillInfo, bh as SkillLoad, bl as SkillsService, aE as PlannerContextPause, a0 as IsolationMergeBlock, _ as IsolationLandedTask, a4 as IsolationPreview, a$ as ResearchToolType, bp as SupervisorLevel, ak as LoopSubject, a_ as ResearchStepOutcome, aD as PlannerCompactionOutcome, aH as PlannerUsage, t as FindingSeverity, bD as TaskType, bo as SubtreeReport, av as PatchView, bv as TaskIsolationState, bE as TaskUsageSummary } from './Task-D3O49EUo.js';
2
+ import { q as ApprovalRequest, r as ApprovalSource, U as IApproval, bP as ToolOutcome, _ as IRunnerSession, a1 as IsolationRunController, V as IConfig, bS as UsageLimitSignal, bB as TaskMessageFrom, b5 as RunnerModelRef, aX as RunnerCommand, b2 as RunnerMcpServer, bt as StructuredTurnEnd, k as ApprovalDecision, bh as ScriptRun, bi as ScriptStatus, bs as StructuredEvent, aj as NodePath, u as BoardDraft, v as BoardEntry, w as BoardPost, t as BoardAuthor, af as McpToolReply, J as EventStore, j as ApprovalAnswer, aK as QueuedTaskMessage, l as ApprovalKind, Y as INotification, Z as IRunner, b7 as RunnerRegistry, bp as SkillLookup, bK as TaskShellSite, bJ as TaskShell, K as ExecutionBackend, aR as ReservedLease, d as AgentProcessDeps, a as AgentAdapter, ar as OrdewellMcpServer, ap as OpenLease, W as IFileSystem, ay as PlannerModes, a0 as IsolatedExecution, aE as PlannerToolHandler, bH as TaskRunnerConfig, b1 as RunnerManifest, S as Guarantee, b0 as RunnerLaunch, T as GuaranteeReport, f as AiProvider, ax as PlannerBackendId, aq as OrchestratorOption, bm as SessionMeta } from './eventStore-CSFKy48Y.js';
3
+ import { R as RunnerModeInfo } from './ModeResolver-DS-aCVOP.js';
4
+ import { ChildProcess } from 'child_process';
4
5
 
5
6
  /** What a planned task may be given: the runners it may run on and their modes. */
6
7
  interface IntakeCatalog {
@@ -408,7 +409,7 @@ interface LiveTail {
408
409
  interface TaskOutputSource {
409
410
  /** Start capturing a session; replaces any earlier capture of the task. */
410
411
  attach(taskId: string, session: IRunnerSession): void;
411
- /** Stop capturing the task's session; what was captured stays readable. */
412
+ /** Stop capturing the task's session; its answer and the end of its output stay readable. */
412
413
  detach(taskId: string): void;
413
414
  /** Drop every capture (a new plan reuses task ids). */
414
415
  reset(): void;
@@ -450,6 +451,8 @@ declare class PlanStore {
450
451
  private _onMutate;
451
452
  private _onTree;
452
453
  private _executionLog;
454
+ private _revision;
455
+ private _statusMark;
453
456
  /** Hook called after every structural mutation (add/remove/update/resetForRun). */
454
457
  set onMutate(cb: (() => void) | null);
455
458
  /**
@@ -471,6 +474,13 @@ declare class PlanStore {
471
474
  isFinished(): boolean;
472
475
  isFailed(id: string): boolean;
473
476
  get(taskId: string): Readonly<Task> | undefined;
477
+ /**
478
+ * Moves with every write to the plan, so a reader that walks it can tell
479
+ * whether its last walk still stands. Writers reach a task through
480
+ * {@link edit}, so a write cannot leave this behind.
481
+ */
482
+ get revision(): number;
483
+ private edit;
474
484
  /**
475
485
  * Whether a task runs as an ops task (ADR-0020): a top-level AI task marked
476
486
  * so, or a script task, which is one by nature (ADR-0035). A subtask runs
@@ -1155,6 +1165,8 @@ interface NodePlan {
1155
1165
  interface SubtreeSource {
1156
1166
  /** The node reading: what is below it is what this reads. */
1157
1167
  here: NodePath;
1168
+ /** The plan of `here`: its delegated tasks name the children that stand. */
1169
+ tasks(): readonly Task[];
1158
1170
  /** Every node ever opened below `here`, closed ones too: a reference outlives the child it names (ADR-0057 R1). */
1159
1171
  nodes(): readonly SubtreeNode[];
1160
1172
  /** What a node's session file holds of its plan, which is read only when asked for (ADR-0055 D17). */
@@ -1174,8 +1186,20 @@ declare class Subtree {
1174
1186
  reachedBy(readable: ReadonlySet<string>): Subtree;
1175
1187
  private nodes;
1176
1188
  private planOf;
1177
- /** Every plan below that has been saved, nearest first, each once: a Continue opens a new node for the same child and its one plan (ADR-0055 D17). */
1189
+ /**
1190
+ * Whether a node is of the tree as it stands: its delegated task names its
1191
+ * session, as does each task above it, up to `session` or to here. A discard
1192
+ * clears that name and leaves the node, for the references that outlive it
1193
+ * (ADR-0055 D15). A plan that cannot be read says nothing against a child.
1194
+ */
1195
+ private stands;
1196
+ /** Each session's plan once, from its latest node: a Continue opens a new node for the same child and its one plan (ADR-0055 D17). */
1197
+ private plansOf;
1198
+ private indexed;
1199
+ /** Every plan the tree stands on that has been saved, nearest first. */
1178
1200
  plans(): NodePlan[];
1201
+ /** The plans a report from `node` stood on, whether or not that child still stands: a reference to the report means what it meant (ADR-0057 R1). */
1202
+ plansFrom(node: NodePath): NodePlan[];
1179
1203
  /** The plan a pinned reference names, whichever of a child's nodes it was pinned against. */
1180
1204
  planAt(path: NodePath): NodePlan | undefined;
1181
1205
  /**
@@ -1240,7 +1264,7 @@ declare class NodeBoard {
1240
1264
  /** Whether a pinned file has moved past what its entry was written on. */
1241
1265
  private stale;
1242
1266
  private marked;
1243
- /** `read` of `board`, or of one entry by its reference. */
1267
+ /** `read` of `board`, of a later page of its map, or of one entry by its reference. Entries are only ever added, so a page that moves repeats one and loses none. */
1244
1268
  read(written: string): Promise<McpToolReply>;
1245
1269
  /** The pins a new descendant of this node is told (R10). */
1246
1270
  pins(): string[];
@@ -1338,7 +1362,6 @@ interface TreeLedgerOptions {
1338
1362
  */
1339
1363
  declare class TreeLedger {
1340
1364
  private readonly store;
1341
- private readonly tree;
1342
1365
  private readonly reserve;
1343
1366
  private readonly failed;
1344
1367
  /** Sessions holding an allowance, by node. */
@@ -1349,15 +1372,24 @@ declare class TreeLedger {
1349
1372
  private readonly raiseListeners;
1350
1373
  /** Why each stopped node did, which a raise clears (M5). */
1351
1374
  private readonly stopped;
1375
+ /** Open children by parent, oldest first. The tree only grows, by thousands over a run's life, and a usage record asks this. */
1376
+ private readonly openUnder;
1377
+ /** Every opening of a session, oldest first: a Continue opens a new node for the same child (ADR-0055 D17). */
1378
+ private readonly openings;
1379
+ /** Every child a parent's session opened for a task, in any of its openings, oldest first, by {@link taskKey}. */
1380
+ private readonly forTask;
1352
1381
  private pending;
1353
1382
  private writing;
1354
1383
  private failureSaid;
1384
+ private readonly tree;
1355
1385
  private constructor();
1356
1386
  /** Rebuild from the log, and from nothing else (ADR-0058 S3). A log with no root gets one: this is the first carve of a tree. */
1357
1387
  static open(store: EventStore, root: {
1358
1388
  sessionId: string;
1359
1389
  limit: number;
1360
1390
  }, options?: TreeLedgerOptions): Promise<TreeLedger>;
1391
+ /** One fact on the tree and on what answers for walking it. */
1392
+ private apply;
1361
1393
  private write;
1362
1394
  /** What one step decides lands as one batch: the first await lets the step finish. */
1363
1395
  private flush;
@@ -1402,6 +1434,9 @@ declare class TreeLedger {
1402
1434
  spentOn(parent: NodePath, taskId: string): number;
1403
1435
  /** What raises gave every child `parent` opened for `taskId`: the tree granted it to the task, on top of its stated budget (ADR-0056 M5, M10). */
1404
1436
  raisedOn(parent: NodePath, taskId: string): number;
1437
+ /** What a task stating `stated` can still draw on `parent`: nothing while a child holds its limit in `committed`, else what the tree granted it less what it spent (ADR-0056 M5, M10). */
1438
+ stillAsks(parent: NodePath, taskId: string, stated: number): number;
1439
+ /** Under every opening of `parent`'s session: a Continue opens a new node for the same child, and what its tasks spent before stays spent (ADR-0055 D17, ADR-0056 M10). */
1405
1440
  private childrenFor;
1406
1441
  /** Close the children of `parent` that `gone` picks by their task: no session is live in them, so what they hold would stay committed for good. */
1407
1442
  closeChildren(parent: NodePath, gone: (taskId: string | undefined) => boolean): void;
@@ -2000,7 +2035,7 @@ type SurfaceTask<T extends Task = Task> = Omit<T, 'attemptSkills' | 'subtasks' |
2000
2035
  subtasks: SurfaceTask[];
2001
2036
  };
2002
2037
  /** A plan as the daemon and the VS Code webview are sent it: the session's own state, minus every skill body. */
2003
- type SurfacePlan = Omit<LegacyPlanState, 'tasks' | 'conversationHistory' | 'pendingTurns' | 'queuedMessages'> & {
2038
+ type SurfacePlan = Omit<LegacyPlanState, 'tasks' | 'conversationHistory' | 'pendingTurns' | 'queuedMessages' | 'plannerSession'> & {
2004
2039
  tasks: SurfaceTask[];
2005
2040
  conversationHistory?: SerializedConversationMessage[];
2006
2041
  pendingTurns?: SerializedPendingTurn[];
@@ -2218,7 +2253,12 @@ type SessionMessage =
2218
2253
  type: 'planner_detection';
2219
2254
  waiting: boolean;
2220
2255
  }
2221
- /** `escalations`: what waits on a person now (ADR-0053), whole; absent from an older daemon. */
2256
+ /**
2257
+ * `tasks` holds the tasks that moved, each whole, and a task left out is as
2258
+ * it was; `RunSnapshotFrame` gives a joining surface the rest. Now and then
2259
+ * it holds every task again. The run-wide fields are whole on every update.
2260
+ * `escalations`: what waits on a person now (ADR-0053); absent from an older daemon.
2261
+ */
2222
2262
  | {
2223
2263
  type: 'status_update';
2224
2264
  tasks: SerializedTaskStatus[];
@@ -2405,8 +2445,84 @@ type SessionBroadcaster = (msg: SessionMessage) => void;
2405
2445
  declare function serializeTask(t: SurfaceTask): SerializedTask;
2406
2446
  declare function serializeTaskStatus(t: Task, idleSince?: string | null, isolation?: TaskIsolation | null, queued?: readonly QueuedTaskMessage[], awaitingApproval?: number, mergeGate?: readonly string[], checkpoint?: string, waitsForApproval?: boolean, holdReason?: string | null, completionReceived?: Verdict['reported'] | null, attaching?: 1 | 2 | null, loopStranded?: boolean, delegation?: DelegatedRow | undefined): SerializedTaskStatus;
2407
2447
  /** The one place a plan's skill bodies come off before it leaves the session: every wire path that carries plan state goes through here. */
2408
- declare function surfacePlan({ queuedMessages: _carriedOverAtLoad, ...plan }: LegacyPlanState): SurfacePlan;
2448
+ declare function surfacePlan({ queuedMessages: _carriedOverAtLoad, plannerSession: _hint, ...plan }: LegacyPlanState): SurfacePlan;
2409
2449
  declare function surfacePlanState(state: PlanState): SurfacePlanState;
2450
+ /**
2451
+ * A plan below the root as a surface selects it (ADR-0055 D20). `sessionId`
2452
+ * holds still across a Continue, which opens a new `node` for the same child;
2453
+ * a fresh Retry is a new child with a new id.
2454
+ */
2455
+ interface ChildPlanEntry {
2456
+ sessionId: string;
2457
+ /** Its latest opening in the tree. */
2458
+ node: string;
2459
+ /** The plan above it: the root's id at depth 1. */
2460
+ parent: string;
2461
+ taskId?: string;
2462
+ title: string;
2463
+ depth: number;
2464
+ /** Its subplanner in a turn, parked between turns, or no longer there: an ended child only reads. */
2465
+ state: 'working' | 'parked' | 'ended';
2466
+ /** Why a message would be refused now, so a surface can say so before the person types one. */
2467
+ refused?: string;
2468
+ /** Its tasks waiting at a checkpoint now, so a surface can tell without opening it. */
2469
+ checkpoints?: string[];
2470
+ }
2471
+ /** A child plan as a surface opens it: a session's own load, as {@link ChildPlanEntry} places it. */
2472
+ interface ChildPlanView {
2473
+ child: ChildPlanEntry;
2474
+ goal?: string;
2475
+ /** Null while nothing of it has been saved yet. */
2476
+ plan: SurfacePlan | null;
2477
+ run: RunView;
2478
+ plannerTurnId?: string;
2479
+ plannerCompaction?: Extract<SessionMessage, {
2480
+ type: 'planner_compaction';
2481
+ }>;
2482
+ }
2483
+ /**
2484
+ * What became of a person's message to a subplanner: `woken` opened its turn
2485
+ * at once, and `queued` holds it for the turn in flight or for a slot. A
2486
+ * refusal is `view_only` once its attempt is over, or `refused` while what
2487
+ * stands over it (a Stop, its budget, a withdrawn grant) lets nothing start.
2488
+ */
2489
+ type ChildMessageOutcome = {
2490
+ ok: true;
2491
+ status: 'woken' | 'queued';
2492
+ } | {
2493
+ ok: false;
2494
+ code: 'view_only' | 'refused';
2495
+ message: string;
2496
+ };
2497
+ /**
2498
+ * What a person may ask of one task of a child plan (ADR-0055 D20). `question`
2499
+ * is the one they read, so an answer cannot land on a later one. There is no
2500
+ * raise and no force: those stay with the plan above and with the root's user.
2501
+ */
2502
+ type ChildTaskControl = {
2503
+ kind: 'message';
2504
+ text: string;
2505
+ } | {
2506
+ kind: 'checkpoint';
2507
+ answer: 'approve' | 'reject';
2508
+ question: string;
2509
+ reason?: string;
2510
+ };
2511
+ /**
2512
+ * What became of a {@link ChildTaskControl}: `id` is the message's, when it
2513
+ * reached a turn rather than resuming a paused task. A refusal adds to
2514
+ * {@link ChildMessageOutcome}'s `no_task` for a task this plan does not hold,
2515
+ * and `not_waiting` for a checkpoint that is not the one asked about.
2516
+ */
2517
+ type ChildControlOutcome = {
2518
+ ok: true;
2519
+ message: string;
2520
+ id?: string;
2521
+ } | {
2522
+ ok: false;
2523
+ code: 'view_only' | 'refused' | 'no_task' | 'not_waiting';
2524
+ message: string;
2525
+ };
2410
2526
  declare function serializePlan(plan: LegacyPlanState): SerializedPlan;
2411
2527
  /**
2412
2528
  * What a finished run did, task by task: `blocked` are those a failure kept
@@ -2739,6 +2855,8 @@ declare const STOPPED_BEFORE_START = "Not done: stopped before it could start. T
2739
2855
  interface OrchestratorObserver {
2740
2856
  /** Any task-shaped state changed (store mutation, checkpoint, retry, …). */
2741
2857
  onTaskChanged?(): void;
2858
+ /** A script attempt was claimed and its task is in progress, before anything of it has run (ADR-0035). */
2859
+ onScriptClaimed?(): void;
2742
2860
  /**
2743
2861
  * A run reached an outcome that stands until the user acts — completed,
2744
2862
  * failed, or awaiting the user — on its own, not as the answer to a call.
@@ -3077,6 +3195,14 @@ declare class TaskOrchestrator {
3077
3195
  private queuedStarts;
3078
3196
  /** Conflict repairs owed with every slot taken and no scheduler to claim them: a freed slot starts them. */
3079
3197
  private owedRepairs;
3198
+ /**
3199
+ * The delegated tasks a Continue from above owes their child (ADR-0055 D17):
3200
+ * Execute's fresh chance would discard each at its claim. Past a plan load,
3201
+ * which the run those claims belong to begins with; a Stop ends that run.
3202
+ */
3203
+ private owedReopens;
3204
+ /** The children a reopened run may not reach: each stays as it stands until someone decides (ADR-0055 D17). */
3205
+ private keptChildren;
3080
3206
  /**
3081
3207
  * The checks whose loop goes on with no scheduler: each failed a round in a
3082
3208
  * run the scheduler was not driving, so nothing else would start what it
@@ -3412,6 +3538,15 @@ declare class TaskOrchestrator {
3412
3538
  * `keepFailed`: failures nobody asked this run to try again (ADR-0030).
3413
3539
  */
3414
3540
  beginRun(origin: RunOrigin, keepFailed?: ReadonlySet<string>): Promise<void>;
3541
+ /**
3542
+ * A Continue from above reached this node (ADR-0055 D17): the run about to
3543
+ * begin is Execute's, but a Continue never discards a child, at any depth. So
3544
+ * each delegated task with a child to reopen is claimed as a continue when
3545
+ * the scheduler reaches it, its dependencies and approval as for any task,
3546
+ * and one whose child cannot be reopened is held rather than started fresh.
3547
+ * Answers what was held and why, for its subplanner to decide.
3548
+ */
3549
+ owesChildren(message: string): string[];
3415
3550
  /**
3416
3551
  * Take the plan into the run under way (#95), whose tasks were approved
3417
3552
  * first: a scheduled run starts them as their dependencies finish, and one
@@ -4713,9 +4848,9 @@ declare const OUTPUT_LINES_DEFAULT = 80;
4713
4848
  declare const OUTPUT_LINES_MAX = 400;
4714
4849
  /**
4715
4850
  * Character budget the rendered answer converges to. A running output tail is
4716
- * the only part with no natural bound — a runner may print for minutes — so
4717
- * the tail absorbs the clamp; everything else (task bodies, the catalog cap)
4718
- * is bounded upstream.
4851
+ * trimmed to what is left of it, and the tasks asked for stop where it runs out
4852
+ * ({@link readsInCap}); the catalog is bounded upstream. One task is the
4853
+ * exception: it is read whole, so a task with a long prompt can pass this.
4719
4854
  */
4720
4855
  declare const TASK_QUERY_ANSWER_MAX_CHARS = 20000;
4721
4856
  interface TaskQuery {
@@ -4822,6 +4957,14 @@ type CheckedChange = {
4822
4957
  type PassedChange = Extract<CheckedChange, {
4823
4958
  ok: true;
4824
4959
  }>;
4960
+ /** A node's budget as its ledger holds it (ADR-0056 M5): `limit` is where a raise, or a parent's turn taking room back, has moved it past the saved mandate. */
4961
+ interface NodeFunds {
4962
+ limit: number;
4963
+ /** What a carve can take now. */
4964
+ left: number;
4965
+ /** What a delegated task can still draw on this node: an open child's limit is already spoken for in `left`. */
4966
+ stillAsks(task: Pick<Task, 'id' | 'budget'>): number;
4967
+ }
4825
4968
  /** What a change is checked against, read as each check runs: a session's live state, or a one-shot planner's request. */
4826
4969
  interface PlanChangeScope {
4827
4970
  /** The plan's tasks as they stand. */
@@ -4836,11 +4979,13 @@ interface PlanChangeScope {
4836
4979
  * The node a change is made on, with what it holds now and how far below the
4837
4980
  * root it stands, read as each check runs (ADR-0056 M4). Absent or undefined,
4838
4981
  * nothing may delegate: a one-shot planner has no node, and a build that does
4839
- * not offer delegation reads no mandate for it.
4982
+ * not offer delegation reads no mandate for it. `budget` is absent while no
4983
+ * ledger is open: the mandate's limit is then all this node knows.
4840
4984
  */
4841
4985
  node?(): {
4842
4986
  mandate: Mandate;
4843
4987
  level: number;
4988
+ budget?: NodeFunds;
4844
4989
  } | undefined;
4845
4990
  /** Whether a script can run sealed here (ADR-0036 S6): a change that brings a read-only one waits on this, as an attached skill waits on its lookup. */
4846
4991
  canSeal?(): Promise<boolean>;
@@ -4893,11 +5038,13 @@ declare class PlanChangeCheck {
4893
5038
  private ungranted;
4894
5039
  /**
4895
5040
  * What a change leaves past this node's limits (ADR-0055 D2, D19): each
4896
- * delegated task it wrote narrowed as it is written (ADR-0056 M4), so a plan
4897
- * never holds what its carve would refuse, and a child held to what a child
4898
- * plan may be. Only what this change wrote: what stands in the plan is not
4899
- * this edit's to answer for. A root plan has no task limit, so a flat run
4900
- * does not change.
5041
+ * delegated task it wrote narrowed as it is written (ADR-0056 M4), the plan's
5042
+ * budgets together held to what a carve could give them (M5), and a child held
5043
+ * to what a child plan may be. Only what this change wrote or made bigger: what
5044
+ * stands in the plan is not this edit's to answer for, so a plan past its room
5045
+ * can still come down. Whatever passes here, the carve is what decides: spending
5046
+ * moves the room after a plan is accepted. A root plan has no task limit, so a
5047
+ * flat run does not change.
4901
5048
  */
4902
5049
  private pastMandate;
4903
5050
  private refused;
@@ -5054,6 +5201,8 @@ declare class CliAgentAiService implements IAiService {
5054
5201
  plannerToolsAttached(): boolean;
5055
5202
  /** The agent's own session id, a resumption hint only — Ordewell's transcript is authoritative (T4). */
5056
5203
  nativeSessionId(): string | null;
5204
+ /** What a later process needs to take this conversation's session up again, or null while it has none (ADR-0055 D17). */
5205
+ nativeSession(): PlannerNativeSession | null;
5057
5206
  /** The compactions the agents reported of their own context, never a subagent's or another thread's: their adapters drop those (ADR-0012 T10). */
5058
5207
  compactions(): number;
5059
5208
  promptCacheTtlMs(): number | undefined;
@@ -5061,6 +5210,13 @@ declare class CliAgentAiService implements IAiService {
5061
5210
  restart(): void;
5062
5211
  reset(): void;
5063
5212
  startConversation(req: ConversationRequest): Promise<ConversationTurn>;
5213
+ /**
5214
+ * Open a conversation in the session a process before this one left, and say
5215
+ * only what that session has not heard. Null when the runner would not take
5216
+ * it up, with `session` left to start afresh and replay the transcript: the
5217
+ * saved session is a hint, and Ordewell's transcript loses nothing (T4).
5218
+ */
5219
+ private takeUp;
5064
5220
  continueConversation(userMessage: string, onProgress: (progress: ResearchProgress) => void, signal?: AbortSignal): Promise<ConversationTurn>;
5065
5221
  private openingMessage;
5066
5222
  /**
@@ -5273,6 +5429,15 @@ interface ConversationRequest {
5273
5429
  * for them; the first call is the turn opened by `initialMessage`.
5274
5430
  */
5275
5431
  priorHistory?: ConversationMessage[];
5432
+ /**
5433
+ * A subplanner's saved native session, and what the transcript holds past it
5434
+ * (ADR-0055 D17). A backend that takes it up sends `since` where it would
5435
+ * replay `priorHistory`; any other, or one refused, replays `priorHistory`.
5436
+ */
5437
+ resume?: {
5438
+ session: PlannerNativeSession;
5439
+ since: ConversationMessage[];
5440
+ };
5276
5441
  /**
5277
5442
  * The user message that opens this turn. Defaults to `goal` — set it when
5278
5443
  * resuming so the system prompt keeps the original goal while the turn
@@ -5398,6 +5563,8 @@ interface IAiService {
5398
5563
  * unconditionally instead.
5399
5564
  */
5400
5565
  hasActiveConversation(): boolean;
5566
+ /** The native session of the latest conversation, its process gone or not; absent on a backend that has none (ADR-0055 D17). */
5567
+ nativeSession?(): PlannerNativeSession | null;
5401
5568
  /**
5402
5569
  * Optional: end the planner's live process but keep its own session id, so
5403
5570
  * the next turn starts a fresh one resumed from it (ADR-0009). What a
@@ -5779,7 +5946,11 @@ declare class ConversationBusyError extends ConversationEditError {
5779
5946
  * transcript.
5780
5947
  */
5781
5948
  declare class PlannerTurnDiscardedError extends Error {
5782
- constructor(options?: ErrorOptions);
5949
+ /** No turn had taken the input this answers, so the planner never read it. */
5950
+ readonly unread: boolean;
5951
+ constructor({ unread, ...options }?: ErrorOptions & {
5952
+ unread?: boolean;
5953
+ });
5783
5954
  }
5784
5955
  /**
5785
5956
  * A wake-up turn's backend ended without a reply — a dead agent, a usage
@@ -5842,6 +6013,8 @@ interface ReplyOptions {
5842
6013
  onCommit?: () => void;
5843
6014
  /** Wake-up digests delivered with this turn (ADR-0029), oldest first, ahead of the user's message if there is one. */
5844
6015
  wakeUps?: readonly string[];
6016
+ /** Which of `wakeUps` are asides read with the user's message, which the cap on run updates leaves alone. */
6017
+ asides?: readonly string[];
5845
6018
  /** Set when the turn is a wake-up's alone. */
5846
6019
  wakeUp?: WakeUpTurn;
5847
6020
  /** The user's message was force sent: the turn replaces the one it stopped (ADR-0023). */
@@ -6186,9 +6359,18 @@ declare class PlannerConversation {
6186
6359
  * Reopen the model context from the transcript — because the in-memory one
6187
6360
  * is gone (session reload, extension restart), or because it is stale
6188
6361
  * against the planner config now in effect. No LLM call happens for the
6189
- * replayed turns; the first call is the one the user's message opens.
6362
+ * replayed turns; the first call is the one the user's message opens. A
6363
+ * subplanner's saved native session goes with it, for the backend to take up
6364
+ * in place of the replay (ADR-0055 D17), unless the transcript has moved
6365
+ * behind what it holds.
6190
6366
  */
6191
6367
  private resume;
6368
+ /**
6369
+ * The process goes with the attempt and its session id with the process, so
6370
+ * what would take it up again is written as each turn ends, however it ended
6371
+ * (ADR-0055 D17). A root planner writes none: a new process replays (T4).
6372
+ */
6373
+ private keepNativeSession;
6192
6374
  /**
6193
6375
  * Answer every read the planner emits until it says something else.
6194
6376
  *
@@ -6543,6 +6725,138 @@ declare class PlannerModelMemory {
6543
6725
  recall(provider: string, catalog: PlannerModelCandidate[]): PlannerModelRecall;
6544
6726
  }
6545
6727
 
6728
+ /**
6729
+ * cmd.exe's command-line buffer. A longer line is truncated rather than
6730
+ * rejected, which would corrupt a planner's system prompt or a task's prompt
6731
+ * mid-sentence and produce a confident answer to half a question — so the
6732
+ * batch route refuses instead. See {@link CommandLineTooLongError}.
6733
+ */
6734
+ declare const CMD_EXE_MAX_COMMAND_LINE = 8191;
6735
+ /**
6736
+ * CreateProcess's own ceiling, which the native and PowerShell routes are
6737
+ * bounded by instead. Windows truncates here too, so the same refusal applies —
6738
+ * it is simply four times further away.
6739
+ */
6740
+ declare const WINDOWS_MAX_COMMAND_LINE = 32767;
6741
+ interface LaunchPlan {
6742
+ /** The executable handed to `spawn()`. */
6743
+ file: string;
6744
+ /** Arguments for `file`. Pass verbatim when {@link verbatim} is set. */
6745
+ args: string[];
6746
+ /**
6747
+ * Windows batch route only: `args` is already a quoted command line and must
6748
+ * not be re-quoted. Maps to `windowsVerbatimArguments` for `spawn`.
6749
+ */
6750
+ verbatim?: boolean;
6751
+ }
6752
+ /** Test seam: every OS touchpoint is injectable, and production uses the defaults. */
6753
+ interface LaunchDeps {
6754
+ platform?: NodeJS.Platform;
6755
+ /** The PATH executables are looked up on. Defaults to the augmented PATH. */
6756
+ resolvePath?: () => Promise<string>;
6757
+ /** True when `candidate` names an existing file. */
6758
+ exists?: (candidate: string) => boolean;
6759
+ /** Absolute path to the Windows command interpreter. */
6760
+ comSpec?: () => string;
6761
+ /** Absolute path to Windows PowerShell. */
6762
+ powerShell?: () => string;
6763
+ /** PATHEXT, as the environment reports it. */
6764
+ pathExt?: () => string;
6765
+ }
6766
+ /**
6767
+ * Thrown when a command's arguments do not fit the buffer of the only
6768
+ * interpreter that can start it. Windows truncates rather than rejecting, and a
6769
+ * system prompt cut off mid-sentence makes the planner answer half a question
6770
+ * confidently — the silent success this repo refuses — so this is raised
6771
+ * instead. `TaskOrchestrator.startTask` catches it and holds the task, so the
6772
+ * message is what the user reads: it names the fix, because they cannot infer
6773
+ * it from a truncated prompt.
6774
+ */
6775
+ declare class CommandLineTooLongError extends Error {
6776
+ readonly command: string;
6777
+ readonly length: number;
6778
+ readonly limit: number;
6779
+ constructor(command: string, length: number, limit?: number);
6780
+ }
6781
+ /**
6782
+ * Thrown when only a batch shim resolved for a multi-line argument. cmd.exe
6783
+ * reads up to the first CR/LF and discards the rest with no error and exit code
6784
+ * 0 — quoting does not help — so the agent would get the first paragraph of its
6785
+ * prompt without the instruction to report through `task_complete`, then exit looking successful.
6786
+ */
6787
+ declare class EmbeddedNewlineError extends Error {
6788
+ readonly command: string;
6789
+ constructor(command: string);
6790
+ }
6791
+ /**
6792
+ * Thrown when only a batch shim resolved for an argument holding a double
6793
+ * quote. cmd.exe flips its quote state at every `"`, whether or not a backslash
6794
+ * precedes it, so the quote ends the quoting we added and the rest of the
6795
+ * argument is read as commands: `--model "x\" & calc & \"y"` runs `calc`.
6796
+ */
6797
+ declare class BatchQuoteError extends Error {
6798
+ readonly command: string;
6799
+ constructor(command: string);
6800
+ }
6801
+ /**
6802
+ * Thrown when `command` cannot be resolved to a real file. Kept distinguishable
6803
+ * from `WorkspaceNotFoundError` (utils/workspace) even though both a missing
6804
+ * cwd and a missing binary surface as the same `spawn` ENOENT to Node — the two
6805
+ * are checked, and named, separately so the failure names the actual cause.
6806
+ */
6807
+ declare class ExecutableNotFoundError extends Error {
6808
+ readonly command: string;
6809
+ readonly searchedPath: string;
6810
+ constructor(command: string, searchedPath: string);
6811
+ }
6812
+ /**
6813
+ * Whether `command` actually resolves to a file, given the plan
6814
+ * {@link planDirectLaunch} produced for it and the PATH it was resolved
6815
+ * against.
6816
+ *
6817
+ * POSIX is deliberately identity in `planDirectLaunch` (execvp does its own
6818
+ * PATH search), so the search is repeated here instead. Windows already did
6819
+ * the search inside `planDirectLaunch` — signalled by the returned file
6820
+ * differing from the bare command name it was given; an unresolved command
6821
+ * comes back unchanged. A command that already names its file, location and
6822
+ * extension both, is found as itself, so that one is checked directly.
6823
+ */
6824
+ declare function isExecutableResolved(command: string, plan: LaunchPlan, PATH: string, deps?: LaunchDeps): boolean;
6825
+ /** The verbatim command line cmd.exe receives after `/d /s /c`, before wrapping. */
6826
+ declare function windowsCommandLine(file: string, args: string[]): string;
6827
+ /**
6828
+ * How to start `command` with `args` through `spawn()`, with no shell.
6829
+ *
6830
+ * POSIX returns its input unchanged — execvp already searches PATH, and adding
6831
+ * a resolution step there would be a new way for a working setup to break.
6832
+ *
6833
+ * Windows resolves the command against PATH × PATHEXT, preferring a native
6834
+ * executable (spawned directly) over a batch shim (through cmd.exe) over a
6835
+ * PowerShell script shim (through `powershell.exe -File`). A command that
6836
+ * resolves to nothing is returned unchanged, so the caller's existing ENOENT —
6837
+ * which names what the user typed — is what surfaces rather than a second,
6838
+ * vaguer error from here.
6839
+ *
6840
+ * The tiers are tried in preference order and the first that *fits* wins, with
6841
+ * one deliberate exception: an overflowing batch shim does not fall through to
6842
+ * PowerShell. Overflow means a very large prompt, which is precisely where
6843
+ * `-File` argument fidelity is least worth betting on, and where a clear held
6844
+ * task beats a plausibly-mangled one. So capacity does not reorder the tiers —
6845
+ * a `.ps1` beside a too-long `.cmd` still raises.
6846
+ *
6847
+ * A line break does reorder them: cmd.exe cannot carry one at any length, so a
6848
+ * `.ps1` beside a `.cmd` wins, and a lone `.cmd` raises. So does a double
6849
+ * quote, which cmd.exe cannot carry safely.
6850
+ *
6851
+ * @throws {CommandLineTooLongError} when the selected route's buffer cannot
6852
+ * carry the arguments.
6853
+ * @throws {EmbeddedNewlineError} when the arguments span lines and only the
6854
+ * batch route resolved.
6855
+ * @throws {BatchQuoteError} when an argument holds a double quote and only the
6856
+ * batch route resolved.
6857
+ */
6858
+ declare function planDirectLaunch(command: string, args: string[], deps?: LaunchDeps): Promise<LaunchPlan>;
6859
+
6546
6860
  /**
6547
6861
  * What a runner's own status command answered (ADR-0009). A surface flags a
6548
6862
  * planner on `signed-out` and never on `unknown`: only the runner can say its
@@ -6564,6 +6878,8 @@ interface RunnerAuthExecResult {
6564
6878
  interface RunnerAuthExecOptions {
6565
6879
  timeout: number;
6566
6880
  env: NodeJS.ProcessEnv;
6881
+ /** The args are one cmd.exe command line already quoted, as `planDirectLaunch`'s batch route hands back. */
6882
+ verbatim?: boolean;
6567
6883
  }
6568
6884
  type RunnerAuthExec = (command: string, args: string[], options: RunnerAuthExecOptions) => Promise<RunnerAuthExecResult>;
6569
6885
  interface ReadRunnerAuthOptions {
@@ -6571,6 +6887,8 @@ interface ReadRunnerAuthOptions {
6571
6887
  /** The workspace's own variables (ADR-0016), merged over the daemon's for the probe. */
6572
6888
  env?: Record<string, string>;
6573
6889
  timeoutMs?: number;
6890
+ /** How the status command is located and started; a test pins the Windows routes from any host. */
6891
+ launch?: LaunchDeps;
6574
6892
  }
6575
6893
  /**
6576
6894
  * Ask one runner whether its user is signed in. Never throws and never reads a
@@ -6619,6 +6937,12 @@ interface GlobalRunSettings {
6619
6937
  * delegation off. One value, so delegation is never on with no budget.
6620
6938
  */
6621
6939
  delegationTokens: number;
6940
+ /**
6941
+ * The last budget the user entered, kept while delegation is off so turning
6942
+ * it on again asks for nothing. 0 is none yet: the first enable takes a
6943
+ * number from the user, never a default. It never turns delegation on.
6944
+ */
6945
+ delegationBudget: number;
6622
6946
  }
6623
6947
  declare const RUN_SETTINGS_DEFAULTS: Readonly<GlobalRunSettings>;
6624
6948
  declare class RunSettingsError extends Error {
@@ -6645,6 +6969,7 @@ interface UserSettings {
6645
6969
  supervisorRetryLimit?: number;
6646
6970
  wakeUpReadBudget?: number;
6647
6971
  delegationTokens?: number;
6972
+ delegationBudget?: number;
6648
6973
  /**
6649
6974
  * Whether an API planner prunes its own context ahead of a call that would
6650
6975
  * pass 90% of its model's window. Absent means on. Set in the file only:
@@ -6660,8 +6985,8 @@ interface UserSettings {
6660
6985
  /**
6661
6986
  * Run tasks in containers (ADR-0059 L5), as `containerSettings` reads it:
6662
6987
  * absent means local worktrees. Kept as written, since one it cannot use must
6663
- * refuse a task, not fall back to the host. Set in the file only: no surface
6664
- * offers it.
6988
+ * refuse a task, not fall back to the host. Only a checkout's surfaces offer
6989
+ * it, through `changeContainers`.
6665
6990
  */
6666
6991
  containers?: unknown;
6667
6992
  }
@@ -6713,6 +7038,8 @@ declare class SettingsService {
6713
7038
  effort?: string;
6714
7039
  } | undefined): void;
6715
7040
  getEnabledRunners(): string[] | undefined;
7041
+ /** From what the file holds at this moment, as {@link updateEnabledRunners}; undefined takes it off the file. */
7042
+ updateContainers(change: (saved: unknown) => unknown): void;
6716
7043
  setEnabledRunners(ids: string[]): void;
6717
7044
  /**
6718
7045
  * Change the list from what the file holds at this moment: the change is
@@ -6745,7 +7072,7 @@ declare class SettingsService {
6745
7072
  setAutonomousMode(enabled: boolean): void;
6746
7073
  getRunSettings(): GlobalRunSettings;
6747
7074
  /** Checks every value before writing any, so a refused change saves nothing. */
6748
- updateRunSettings(changes: Partial<GlobalRunSettings>): GlobalRunSettings;
7075
+ updateRunSettings(given: Partial<GlobalRunSettings>): GlobalRunSettings;
6749
7076
  private load;
6750
7077
  /** Keep the bytes of a hand-edited file we cannot parse, and say so, instead of resetting it on the next save. */
6751
7078
  private moveAsideCorrupt;
@@ -6764,6 +7091,248 @@ declare class SettingsService {
6764
7091
  private persist;
6765
7092
  }
6766
7093
 
7094
+ /** One model API, as a gateway stands in front of it and a broker holds its key. */
7095
+ interface ModelApi {
7096
+ /** The variable that holds its key, and the one that names another address for it. */
7097
+ keyVariable: string;
7098
+ baseUrlVariable: string;
7099
+ upstream: string;
7100
+ /** Model traffic by method, and nothing else a key can do at this API. A route that reads what a key holds is out, however close its path sits to one that is in. */
7101
+ routes: Readonly<Record<'GET' | 'POST', RegExp>>;
7102
+ /** The header its key travels in; a runner's token comes the same way. */
7103
+ auth: 'x-api-key' | 'bearer';
7104
+ /** What a base URL of this API already ends in, so the path a runner asks under does not repeat it. */
7105
+ basePath: string;
7106
+ /** What a person is told it is. */
7107
+ name: string;
7108
+ /** Its runner reaches a model by this key and in no other way, so cloud credentials are no login for it. */
7109
+ keyOnly: boolean;
7110
+ /** What its runner uses over the key, by its documented precedence: beside one, a bearer the gateway drops or a cloud that never sees the gateway. */
7111
+ outranksKey: readonly string[];
7112
+ }
7113
+
7114
+ /**
7115
+ * Which login a container runs under, which a person chooses and nothing here
7116
+ * guesses: `broker`, API keys or cloud credentials from this host's environment,
7117
+ * or `own-sign-in`, the person's own sign-in to the unmodified binary, made
7118
+ * inside a container and kept in a volume Ordewell never reads (ADR-0059 L7).
7119
+ */
7120
+ type LeaseLogin = {
7121
+ kind: 'broker';
7122
+ variables: readonly string[];
7123
+ } | {
7124
+ kind: 'own-sign-in';
7125
+ };
7126
+ /** What a lease's login comes to. */
7127
+ interface IssuedLogin {
7128
+ /** The API key and where it goes, held on this host by the lease's gateway. */
7129
+ gated: {
7130
+ key: string;
7131
+ upstream: string;
7132
+ api: ModelApi;
7133
+ } | null;
7134
+ /** What no gateway can carry, for the runner by name, which it can read. */
7135
+ handed: Record<string, string>;
7136
+ }
7137
+ /**
7138
+ * Holds API keys and cloud-provider credentials for leases, and never a Claude
7139
+ * subscription's: Anthropic's terms forbid a product collecting, storing or
7140
+ * intermediating one (ADR-0059 L7). An API key stops at the gateway. What a cloud
7141
+ * provider's client signs with has to reach it, so a lease with one reports
7142
+ * `cred.unreadable` unproven. A login is one for a session's every runner, so a
7143
+ * key that serves another runner's API stays here: nothing gates it for this one,
7144
+ * and handing it over by name would put it in the clear.
7145
+ */
7146
+ declare class CredentialBroker {
7147
+ private readonly source;
7148
+ constructor(source: Record<string, string | undefined>);
7149
+ issue(variables: readonly string[], api?: ModelApi): IssuedLogin;
7150
+ /** That every variable is there and none undoes a key, for a surface that asks with no runner in mind: which of them serves which runner waits for {@link issue}. */
7151
+ check(variables: readonly string[]): void;
7152
+ private hold;
7153
+ }
7154
+
7155
+ /** Package caches a container keeps in the engine, by name, never by a host's path, and the variable that points a tool at one. */
7156
+ declare const CACHE_VARIABLES: {
7157
+ readonly npm: "npm_config_cache";
7158
+ readonly pip: "PIP_CACHE_DIR";
7159
+ readonly cargo: "CARGO_HOME";
7160
+ readonly go: "GOMODCACHE";
7161
+ };
7162
+ type CacheName = keyof typeof CACHE_VARIABLES;
7163
+ /** The `containers` setting, read. A checkout's surfaces set it (`changeContainers`); the settings file holds the rest. */
7164
+ interface ContainerSettings {
7165
+ /** The image the user built: Ordewell publishes none (ADR-0059 L5). */
7166
+ image: string;
7167
+ /** Docker's own words for the memory limit, which is also the limit on memory and swap together. */
7168
+ memory: string;
7169
+ memoryBytes: number;
7170
+ /** Which login it runs under, which a person chooses: it has no default. */
7171
+ login: LeaseLogin;
7172
+ caches: readonly CacheName[];
7173
+ /** The hosts a lease's sidecar opens: what `allow` names, or the registries of its caches. */
7174
+ allow: readonly string[];
7175
+ /** Guarantees an open fails without (L3). */
7176
+ required: readonly Guarantee[];
7177
+ }
7178
+
7179
+ /** How one `docker` command ended; `code` is -1 for a CLI that could not start. */
7180
+ interface DockerResult {
7181
+ code: number;
7182
+ stdout: string;
7183
+ stderr: string;
7184
+ /** Its stdout passed {@link DockerCall.stdoutTo}'s limit, and it was killed for it. */
7185
+ overflowed?: true;
7186
+ }
7187
+ interface DockerCall {
7188
+ input?: string | Buffer;
7189
+ /** Over this host's, for the CLI: what `-e NAME` hands over, so a secret never sits in an argument (ADR-0022 A5). */
7190
+ env?: Readonly<Record<string, string>>;
7191
+ timeoutMs?: number;
7192
+ /** Stdout to a file rather than to memory, for a bundle of any size up to `maxBytes`. */
7193
+ stdoutTo?: {
7194
+ file: string;
7195
+ maxBytes: number;
7196
+ };
7197
+ }
7198
+ /**
7199
+ * The Docker API through the docker CLI (ADR-0059 L5): one code path for any
7200
+ * local engine that speaks it. `inspectEngine` is what holds it to a local one.
7201
+ */
7202
+ interface DockerCli {
7203
+ call(args: readonly string[], opts?: DockerCall): Promise<DockerResult>;
7204
+ /** A command that runs for as long as a container does, with its stdio left open. */
7205
+ entry(args: readonly string[]): Promise<ChildProcess>;
7206
+ }
7207
+
7208
+ /** What a task's container holds for its runner to find. */
7209
+ interface PlacedRunner {
7210
+ /** The gateway's port on the container's loopback, under a key the gateway holds. */
7211
+ gatewayPort: number | null;
7212
+ signedIn: boolean;
7213
+ }
7214
+ /** A person's own sign-in for one runner, and how a task gets its copy of it: a runner never sees the volume (ADR-0059 L7). */
7215
+ interface ContainerSignIn {
7216
+ /** The kept volume, which a helper mounts read-only at `/login`. */
7217
+ volume: string;
7218
+ /** Where the runner talks to its service once it holds that sign-in. */
7219
+ hosts: readonly string[];
7220
+ /** The helper's command, which leaves the task's copy in its volume and exits 3 for a sign-in that is no use. */
7221
+ copy: readonly string[];
7222
+ /** A helper's command that says, with no network, whether the volume holds a sign-in: exit 0 for one, 1 for none. Absent, only {@link copy} says. */
7223
+ ask?: readonly string[];
7224
+ /** The copy, which the runner can read: a probe's proof that `cred.unreadable` does not hold. */
7225
+ path: string;
7226
+ env: Readonly<Record<string, string>>;
7227
+ }
7228
+ /** One runner a container has been proven with: all a lease knows of it. A protocol that needs this host's loopback or its own sandbox has not. */
7229
+ interface ContainerRunner {
7230
+ id: string;
7231
+ /** What the image has to hold. */
7232
+ binary: string;
7233
+ /** The model API its login is for: a key for any other stays on this host. */
7234
+ api: ModelApi;
7235
+ /** By provider id, the APIs it picks from a model's id and no gateway carries for it, so no broker login reaches them. */
7236
+ unbrokered?: Readonly<Record<string, ModelApi>>;
7237
+ signIn: ContainerSignIn;
7238
+ /** Its launch's arguments, for what it cannot be told by a variable. */
7239
+ args(launch: RunnerLaunch, placed: PlacedRunner): readonly string[];
7240
+ }
7241
+
7242
+ /** Why a container cannot be had yet, and what a person does about it. */
7243
+ interface ContainerProblem {
7244
+ code: string;
7245
+ message: string;
7246
+ remedy: string;
7247
+ }
7248
+ /** What the engine a lease would use said of itself. */
7249
+ interface EngineFacts {
7250
+ version: string;
7251
+ endpoint: string;
7252
+ /** What the engine has, which on a Mac is its VM's and not the Mac's. */
7253
+ memoryBytes: number;
7254
+ }
7255
+ interface PreflightDeps {
7256
+ cli: DockerCli;
7257
+ /** This host's, and a test's own. */
7258
+ platform?: NodeJS.Platform;
7259
+ }
7260
+ interface ReadinessDeps extends PreflightDeps {
7261
+ broker: CredentialBroker;
7262
+ /** False for a script, whose container holds no login at all. */
7263
+ agent?: boolean;
7264
+ /** Whose login is asked for. Absent, a surface's question, with no task in mind: a sign-in of any runner's, and every variable there. */
7265
+ runner?: ContainerRunner;
7266
+ setupCommand?: string;
7267
+ }
7268
+ /** Problems as one error for a person to read. */
7269
+ declare const describeProblems: (problems: readonly ContainerProblem[]) => string;
7270
+
7271
+ /** One change a surface can make: the rest of the setting stays in the file. */
7272
+ type ContainerChange = {
7273
+ on: boolean;
7274
+ } | {
7275
+ image: string;
7276
+ } | {
7277
+ login: unknown;
7278
+ };
7279
+ interface ContainerSettingStore {
7280
+ /** Handed what the file holds now; undefined, in or out, is off. */
7281
+ updateContainers(change: (saved: unknown) => unknown): void;
7282
+ }
7283
+ interface ChangeDeps extends Partial<PreflightDeps> {
7284
+ settings: ContainerSettingStore;
7285
+ }
7286
+ /** A setting a person can read off a surface, and what the last check made of it. */
7287
+ interface ContainerGuaranteeLine {
7288
+ guarantee: Guarantee;
7289
+ proven: boolean;
7290
+ by: string;
7291
+ required: boolean;
7292
+ }
7293
+ interface ContainerStatus {
7294
+ on: boolean;
7295
+ image?: string;
7296
+ /** Which login, by name: never a value. */
7297
+ login?: string;
7298
+ memory?: string;
7299
+ /** All a task can reach, past what its login needs. */
7300
+ allow?: readonly string[];
7301
+ /** No problem left that a check can see. A task still proves its own container at start (ADR-0059 L3). */
7302
+ ready: boolean;
7303
+ problems: ContainerProblem[];
7304
+ engine?: EngineFacts;
7305
+ /** Only from a check that ran: nothing is proven by a setting that reads well. */
7306
+ guarantees?: ContainerGuaranteeLine[];
7307
+ /** What is taken on trust, kept apart from what a probe measured. */
7308
+ assumptions: readonly string[];
7309
+ }
7310
+ interface StatusDeps extends Partial<ReadinessDeps> {
7311
+ /** Ask a container too, and not only the engine. Without it nothing is started. */
7312
+ prove?: boolean;
7313
+ /** How, for a test: the proof a lease makes unless told otherwise. */
7314
+ proof?: (settings: ContainerSettings) => Promise<GuaranteeReport>;
7315
+ }
7316
+ /**
7317
+ * The one way a surface changes the setting, and so the one place that holds it to
7318
+ * what a person is told (ADR-0059 L5): containers go on only over a Docker that
7319
+ * answers, and the image and login can wait, since `{}` is on and refuses every
7320
+ * task (never the host) until they are chosen. A choice needs no engine, as an
7321
+ * image may not be built yet, and it never turns containers on. What was chosen
7322
+ * goes with turning off, as the setting's presence is what is on. Empty means
7323
+ * done. A Session reads the setting once, so a change reaches new sessions.
7324
+ */
7325
+ declare function changeContainers(change: ContainerChange, { settings, cli, platform }: ChangeDeps): Promise<ContainerProblem[]>;
7326
+ /**
7327
+ * What a surface shows of the setting: its choices, what stands in a task's way,
7328
+ * and, kept apart, what was proven and what is only assumed. It starts nothing
7329
+ * unless asked to `prove`. A check holds no login, so it stops short of what a
7330
+ * lease proves, and a lease proves its own in any case.
7331
+ */
7332
+ declare function containerStatus(raw: unknown, { prove, proof, cli, broker, ...rest }?: StatusDeps): Promise<ContainerStatus>;
7333
+ /** A status as lines for a person, the same on every surface. */
7334
+ declare function describeContainers(status: ContainerStatus): string[];
7335
+
6767
7336
  /** What the preflight reads: the planner choice and whatever it needs to be reachable. */
6768
7337
  type PlannerReadinessConfig = Pick<IConfig, 'aiProvider' | 'planningModel' | 'openaiCompatibleBaseUrl' | 'getProviderApiKey'>;
6769
7338
  /**
@@ -6868,7 +7437,15 @@ type DaemonErrorCode = 'session_not_found' | 'task_not_found' | 'no_plan' | 'alr
6868
7437
  /** Merge all would merge work no check has passed; the message names the checks, and a surface asks before sending `pastChecks` (ADR-0055 D9). */
6869
7438
  | 'merge_past_check' | 'approval_not_outstanding'
6870
7439
  /** Another live Ordewell host runs this session (ADR-0049); `sessionHeld` names it. */
6871
- | 'session_held';
7440
+ | 'session_held'
7441
+ /** The tree does not hold that child plan: one id is refused like any other outside it (ADR-0055 D20). */
7442
+ | 'child_not_found'
7443
+ /** The child plan's attempt has ended: it reads, and Continue on its task is what speaks to it. */
7444
+ | 'child_view_only'
7445
+ /** That child plan holds no such task: a task's id, exactly. Nothing falls back to the root (ADR-0055 D20). */
7446
+ | 'child_task_not_found'
7447
+ /** The child plan is open, but its mandate, its grants, the tree's budget or the task's state refuses this now; the message says which. */
7448
+ | 'child_refused';
6872
7449
  /** The body of every non-2xx answer a route gives. */
6873
7450
  interface ErrorBody {
6874
7451
  error: string;
@@ -7069,6 +7646,39 @@ interface TaskLogResponse {
7069
7646
  attempt: number;
7070
7647
  events: TaskLogEvent[];
7071
7648
  }
7649
+ /** `GET /api/sessions/:id/children`: every plan below the root, parents before their children. */
7650
+ interface ChildListResponse {
7651
+ children: ChildPlanEntry[];
7652
+ }
7653
+ /**
7654
+ * `GET /api/sessions/:id/children/:childId`. Taken with `position`, which is
7655
+ * the last frame of the child's socket it accounts for. The numbering counts
7656
+ * only what a socket was watching, so a surface opens the socket first and
7657
+ * reads this and the child's logs after it.
7658
+ */
7659
+ type ChildPlanResponse = ChildPlanView & {
7660
+ position: StreamStamp;
7661
+ };
7662
+ /** `POST /api/sessions/:id/children/:childId/message`: `woken` opened a turn, `queued` goes with the next one the slots allow. */
7663
+ interface ChildMessageResponse {
7664
+ status: Extract<ChildMessageOutcome, {
7665
+ ok: true;
7666
+ }>['status'];
7667
+ }
7668
+ /**
7669
+ * `POST /api/sessions/:id/children/:childId/tasks/:taskId/message`, body
7670
+ * `{ message }`, and `.../checkpoint/approve|reject`, body `{ question, reason? }`:
7671
+ * what the child's runner was told. `question` is the words the person read
7672
+ * (`ChildPlanEntry.checkpoints` names the tasks, `tasks[].checkpoint` of the view
7673
+ * holds them), so an answer can never reach a later question. `id` is the message
7674
+ * delivered, which a watching surface sees again on the child's socket; absent
7675
+ * for an answer, and for a message that resumed a paused task rather than reach
7676
+ * a running one.
7677
+ */
7678
+ interface ChildTaskControlResponse {
7679
+ message: string;
7680
+ id?: string;
7681
+ }
7072
7682
  type SessionListResponse = SessionMeta[];
7073
7683
  interface SettingsResponse {
7074
7684
  orchestratorModel: string;
@@ -7084,6 +7694,11 @@ interface SettingsResponse {
7084
7694
  */
7085
7695
  run: GlobalRunSettings;
7086
7696
  }
7697
+ /** What `PATCH /api/settings/containers` answers: why the change was refused, if it was, and where the setting stands. */
7698
+ interface ContainerChangeResponse {
7699
+ refused: ContainerProblem[];
7700
+ status: ContainerStatus;
7701
+ }
7087
7702
  /** What `PATCH /api/settings` answers: the settings as they now stand, plus what the write itself decided. */
7088
7703
  interface SettingsUpdateResponse extends SettingsResponse {
7089
7704
  /**
@@ -7153,6 +7768,22 @@ interface RunSnapshotFrame extends Partial<StreamStamp> {
7153
7768
  /** Absent from a daemon older than the field: nothing is known, not "none waiting". */
7154
7769
  approvals?: ApprovalRequestMessage[];
7155
7770
  }
7771
+ /**
7772
+ * The tree below a root, on the root's socket, whole each time: unstamped, so
7773
+ * it replaces what a surface holds. Sent after the greeting and whenever a
7774
+ * child opens, ends or changes state; a session with no child plan sends none.
7775
+ *
7776
+ * A child's own socket is `/ws/session/:root/child/:childId`: `connected`, then
7777
+ * a `run_snapshot` under the child's id and frames numbered on its own count,
7778
+ * with no approvals (ADR-0056 M8) and no account limits. It closes with 4404
7779
+ * for what this root does not hold, or a root no longer loaded; 1012 when the
7780
+ * root is replaced, so reconnect; 1001 when the root is closed.
7781
+ */
7782
+ interface ChildTreeFrame {
7783
+ type: 'child_tree';
7784
+ sessionId: string;
7785
+ children: ChildPlanEntry[];
7786
+ }
7156
7787
  /** Independent of run snapshot stamps: quota reads have their own revision. */
7157
7788
  interface AccountLimitsFrame extends AccountLimitsMessage {
7158
7789
  sessionId: string;
@@ -8528,12 +9159,41 @@ declare const PLANNED_WITH_LABEL = "Planned-with line in commits Ordewell writes
8528
9159
  declare const trailerSummary: (run: GlobalRunSettings) => string;
8529
9160
  declare const autorunSummary: (run: GlobalRunSettings) => string;
8530
9161
  declare const delegationSummary: (run: GlobalRunSettings) => string;
9162
+ /** The budget turning delegation on again takes, or null where the user has entered none and must. */
9163
+ declare const keptDelegationBudget: (run: GlobalRunSettings) => number | null;
9164
+ /** What {@link delegationSwitchedOn} reads of the place it runs in, so a test can put it anywhere. */
9165
+ interface DelegationPlace {
9166
+ /** The variable's value, as this process has it. */
9167
+ env: string | undefined;
9168
+ /** Where this module runs from; null where nothing can say, as in a webview. */
9169
+ moduleDir: string | null;
9170
+ exists(path: string): boolean;
9171
+ }
8531
9172
  /** Whether any surface offers the delegation setting, and whether a planner may write a delegated task. */
8532
9173
  declare const DELEGATION_OFFERED: boolean;
9174
+ /**
9175
+ * Whether the `containers` setting is read at all. Containers are held out of
9176
+ * a published build like delegation (ADR-0055 D21), by the same test of a git
9177
+ * checkout and its own variable: the container review's findings are not all
9178
+ * closed, and a setting a user can type must not promise an isolation this
9179
+ * build does not yet prove. Read at call time, so a test can set the variable.
9180
+ */
9181
+ declare function containersOffered(place?: DelegationPlace): boolean;
8533
9182
  declare const ACT_RISK = "Tasks it adds run too, ops tasks included, which can act on real systems unattended.";
8534
9183
  declare const AUTORUN_RISK = "Plans start without review, ops tasks included, which can act on real systems unattended. In Full nobody is asked at all: the planner may start anything, script tasks included, from a plan no person read.";
8535
9184
  /** What turning delegation on accepts below the root, as Act and autorun accept it at the root (ADR-0056 M9). A container is not named as a remedy: only its own setting runs one, a child's tasks included (ADR-0059). */
8536
9185
  declare const DELEGATION_RISK = "A subplanner approves and runs its own plan, and no person reads it. Its change tasks keep the network they have in a flat run, so an instruction injected into something a subplanner read can become a plan nobody read, and run with that network. Delegation starts no container of its own: containers are opt-in, and only that setting runs a child's tasks in one.";
9186
+ /**
9187
+ * `changes` with the budget it turns delegation on at also kept as the user's
9188
+ * (see `GlobalRunSettings.delegationBudget`). Off keeps what was kept, and a
9189
+ * budget named in `changes` is never overridden. Every writer of a run
9190
+ * setting — the file, a session's copy — goes through this one rule.
9191
+ */
9192
+ declare function rememberDelegationBudget<T extends Partial<GlobalRunSettings>>(changes: T): T;
9193
+ /** What the Subplanners setting tells a user on every surface (ADR-0055, ADR-0056): where delegated work stops, how it is counted, and what runs unread. */
9194
+ declare const SUBPLANNER_SCOPE = "Lets a plan hand a separable part of its goal to a subplanner working on its own branch. A subplanner stays inside the mandate it is given and cannot widen it; this setting grants nothing else.";
9195
+ declare const SUBPLANNER_ACCOUNTING = "The budget is one allowance of tokens for the whole tree, counted approximately from what runners report: usage arrives after a call, so a tree can pass it a little.";
9196
+ declare const SUBPLANNER_CHILD = "A subplanner plans in Act with autorun: it approves and runs its own plan, and no person reads it. You confirm once, when you turn Subplanners on.";
8537
9197
  /** `on`/`off` as a switch's value; null for anything else. */
8538
9198
  declare function parseSwitch(arg: string): boolean | null;
8539
9199
  /** A delegation setting as typed: `off`, which is 0, or the tree's budget in tokens; null for anything else. */
@@ -8541,4 +9201,4 @@ declare function parseDelegation(arg: string): number | null;
8541
9201
  /** A whole number at least `min`, as typed; null for anything else. */
8542
9202
  declare function parseCount(arg: string | undefined, min: number): number | null;
8543
9203
 
8544
- export { DELEGATION_RISK as $, ACT_RISK as A, type BlockingSubject as B, CHAT_COMMANDS as C, CliAgentAiService as D, type CliAgentAiServiceDeps as E, type CommandBlock as F, type CommandDescriptor as G, type CommandOutcome as H, type CommandPayload as I, type CommandStatus as J, type CommandsResponse as K, type CompactionBlock as L, type CompactionStatus as M, type Consent as N, type ContextCondenseRequest as O, ConversationBusyError as P, type ConversationCompactResponse as Q, type ConversationCompaction as R, ConversationEditError as S, type ConversationForkResponse as T, type ConversationInput as U, type ConversationRequest as V, type ConversationRewindResponse as W, type ConversationTurn as X, type ConversationView as Y, DEFAULT_WEB_READ_BUDGET as Z, DELEGATION_OFFERED as _, AUTORUN_RISK as a, type NodeBudget as a$, type DaemonErrorCode as a0, type DecideOptions as a1, type DiffRow as a2, type DiffRowKind as a3, type DiffStat as a4, type DisplayBlock as a5, EMPTY_CONVERSATION as a6, EMPTY_HOLD as a7, EMPTY_RUN as a8, EMPTY_TASK_LOG as a9, type IsolationMergeResponse as aA, type IsolationPreviewNotice as aB, type IsolationPreviewResponse as aC, LEASE_HEARTBEAT_MS as aD, LEASE_STALE_MS as aE, LeaseHost as aF, type LeaseHostKind as aG, type LeaseHostOptions as aH, type LiveOutputLookup as aI, type LiveTail as aJ, type LiveTailOptions as aK, type LocalEntry as aL, type LoopCheckFacts as aM, type LoopCheckState as aN, type LoopGuard as aO, type MappedTool as aP, type MarkdownToken as aQ, type MergeGateEntry as aR, type MergeGateResponse as aS, type MergeWordingHandoff as aT, type MessageBlock as aU, type MessageRole as aV, type ModelsResponse as aW, NOT_STARTED as aX, NO_TURN as aY, type NewTaskFields as aZ, NodeBoard as a_, EMPTY_TASK_LOG_FOLLOW as aa, type ErrorBody as ab, type Escalation as ac, type EscalationInput as ad, type EscalationKind as ae, type EscalationOption as af, type EscalationOptionId as ag, type EscalationRun as ah, type EscalationsResponse as ai, type ExecuteCommandResponse as aj, type ExecuteResponse as ak, type ExecutionCommand as al, ExecutionCommands as am, type ExecutionHost as an, type ExecutionSummary as ao, type GatedConversation as ap, type GeneratePlanResponse as aq, type GlobalRunSettings as ar, HEADLESS_CLI_COMMANDS as as, type HandoffBlock as at, type HandoffForkRepo as au, type HandoffPeekSubject as av, type IAiService as aw, IDLE_ACTIVITY as ax, type IWebFetcher as ay, type IsolationDiffResponse as az, type AccountLimitBucket as b, type RunnerCatalog as b$, OUTPUT_LINES_DEFAULT as b0, OUTPUT_LINES_MAX as b1, type OkResponse as b2, type OpRef as b3, type OpRefusal as b4, type OrchestratorObserver as b5, type OutputPreview as b6, type OverrideDirection as b7, PLANNED_WITH_LABEL as b8, type PendingApproval as b9, type PrdResponse as bA, type PromptHold as bB, REPORT_PREVIEW_LINES as bC, RUN_SETTINGS_DEFAULTS as bD, type ReadRunnerAuthOptions as bE, type RefTask as bF, ResearchTasks as bG, type ResolveAll as bH, type ResolveConflictResponse as bI, type RevertPreviewTask as bJ, type RevertRefusal as bK, type RevertRefusalReason as bL, type RevertScope as bM, type RewindTarget as bN, type RewindTargetsResponse as bO, type RunActivity as bP, type RunInput as bQ, type RunMergeView as bR, RunSettingsError as bS, type RunSnapshotFrame as bT, type RunTask as bU, type RunTaskStatus as bV, type RunView as bW, type RunnerAuth as bX, type RunnerAuthExec as bY, type RunnerAuthExecOptions as bZ, type RunnerAuthExecResult as b_, PendingApprovals as ba, type PendingApprovalsOptions as bb, type PlanBlock as bc, type PlanBlocks as bd, type PlanIntake as be, type PlanMarkerStatus as bf, type PlanResponse as bg, type PlanSnapshot as bh, PlanStore as bi, type PlannerCommandSyntax as bj, type PlannerContextDeps as bk, type PlannerContextStatus as bl, PlannerConversation as bm, type PlannerConversationHost as bn, type PlannerModelCandidate as bo, type PlannerModelChoice as bp, PlannerModelMemory as bq, type PlannerModelRecall as br, type PlannerModelStore as bs, type PlannerNotReady as bt, PlannerNotReadyError as bu, type PlannerReadinessConfig as bv, type PlannerSubmission as bw, PlannerTurnDiscardedError as bx, PlannerTurnStoppedError as by, PlannerUsageLimitError as bz, type AccountLimitSnapshot as c, type TaskMessageResponse as c$, type RunnerLoadedBlock as c0, type RunnersResponse as c1, STALLED_LABEL as c2, STOPPED_BEFORE_START as c3, STOPPING_LABEL as c4, SUPERVISOR_LEVEL_LABEL as c5, type SerializedConversationMessage as c6, type SerializedPendingTurn as c7, type SerializedPlan as c8, type SerializedTask as c9, Subtree as cA, type SubtreeItemView as cB, type SubtreeView as cC, type SurfacePlan as cD, type SurfacePlanState as cE, type SurfaceTask as cF, TASK_QUERY_ANSWER_MAX_CHARS as cG, TASK_QUERY_ANSWER_OR_OPS as cH, TASK_QUERY_FIELDS as cI, TASK_QUERY_PROTOCOL as cJ, TASK_QUERY_REMINDER as cK, TERMINAL_UI_COMMANDS as cL, type TakenPrompt as cM, type TaskAction as cN, type TaskActivity as cO, type TaskAttemptSnapshot as cP, type TaskLogAttemptsResponse as cQ, type TaskLogBatch as cR, type TaskLogEvent as cS, type TaskLogFollow as cT, type TaskLogFollowInput as cU, type TaskLogHeaderKind as cV, type TaskLogHeaderTask as cW, type TaskLogHeaderUsage as cX, type TaskLogHeaderView as cY, type TaskLogResponse as cZ, type TaskLogView as c_, type SerializedTaskStatus as ca, type ServerInfoResponse as cb, type SessionBroadcaster as cc, type SessionFrame as cd, type SessionHeld as ce, SessionHeldError as cf, type SessionLease as cg, type SessionLeaseRecord as ch, type SessionListResponse as ci, type SessionMessage as cj, type SessionNotice as ck, type SessionResponse as cl, type SettingsResponse as cm, SettingsService as cn, type SettingsUpdateResponse as co, type SkillInvocation as cp, type SkillLoadBlock as cq, type SkillToken as cr, SlotPool as cs, type StartAdmission as ct, type StopResponse as cu, type StreamStamp as cv, type SubagentBlock as cw, type SubagentChild as cx, type SubagentStatus as cy, type SubplannerBrief as cz, type AccountLimitStatus as d, blockNotice as d$, type TaskOp as d0, TaskOrchestrator as d1, type TaskOrchestratorDeps as d2, type TaskOrchestratorOptions as d3, type TaskOutputSource as d4, type TaskPlacement as d5, type TaskQuery as d6, type TaskQueryCatalog as d7, type TaskQueryField as d8, type TaskRef as d9, WAITS_FOR_APPROVAL_LABEL as dA, type WakeUpItem as dB, type WebRead as dC, type WebReadDecision as dD, type WebReadOptions as dE, WebReadPolicy as dF, type Worded as dG, type WorkspacesResponse as dH, abbreviateHome as dI, accountLimitPercentText as dJ, accountLimitWindowLabel as dK, accountLimitsOf as dL, accountLimitsText as dM, accountLimitsTitle as dN, activityLabel as dO, aheadOfDraft as dP, applyTaskOps as dQ, approvalKindText as dR, approvalLabel as dS, approvalStatusText as dT, assignedRunnerOf as dU, assignmentIssue as dV, assignmentIssueText as dW, attachingLabel as dX, automergeSummary as dY, autorunSummary as dZ, awaitingLabel as d_, type TaskRevertPreview as da, type TaskRevertPreviewResponse as db, type TaskRowAction as dc, type TaskRowContext as dd, type TaskRowDelegated as de, type TaskRowHandoff as df, type TaskRowIsolation as dg, type TaskRowKind as dh, type TaskRowLoop as di, type TaskRowPlacement as dj, type TaskRowSubject as dk, type TaskRowUsage as dl, type TaskRowView as dm, type TaskRunFacts as dn, type TaskStatusKind as dp, type ThinkingDisplayBlock as dq, type ToolBlock as dr, type ToolHeadline as ds, type ToolStatus as dt, TreeLedger as du, type TreeTask as dv, TurnBudgets as dw, type TurnGate as dx, type UsageBlock as dy, type UserSettings as dz, type AccountLimitWindow as e, manualOverrideStopFirst as e$, blockNotices as e0, blockedByLabel as e1, blockingFailures as e2, canMergeTasks as e3, canSetDependencies as e4, canSplitTask as e5, capConflictFiles as e6, cardEditNeedsUnstarted as e7, cardEditable as e8, checkoutRule as e9, followTurn as eA, formatElapsed as eB, fromTranscript as eC, getSettingsPath as eD, handoffBaseLine as eE, handoffBranchName as eF, handoffFindingsText as eG, handoffPeekParts as eH, hasAccountLimits as eI, hasHiddenDetail as eJ, hasLongReport as eK, holdLabel as eL, holdPrompt as eM, isFileEditTool as eN, isRepoGroup as eO, isTaskRunning as eP, lastServedModel as eQ, loadedSkillTokens as eR, logContinues as eS, logResumes as eT, loopBodyLabel as eU, loopBodyRound as eV, loopCheckLabel as eW, loopCheckState as eX, loopLeaveNotice as eY, loopRowParts as eZ, manualOverrideConfirmation as e_, classifyOutcome as ea, closeTurn as eb, coalesceTaskLog as ec, compactionText as ed, confirmedOverride as ee, createAiService as ef, delegatedRowView as eg, delegationSummary as eh, dependencyCandidates as ei, dependentsNotice as ej, dependentsOf as ek, describeHeld as el, describeHolder as em, describeIsolationPreview as en, describeMergeResult as eo, describePlannerNotReady as ep, diffRows as eq, diffStat as er, diffSummary as es, digestTaskLog as et, drainNext as eu, editableWhileRunning as ev, elapsedSince as ew, escalations as ex, executionSummary as ey, followTaskLog as ez, type AccountLimitsFrame as f, serializeTask as f$, mapAgentTool as f0, markAction as f1, markdownHtml as f2, markdownTokens as f3, mergeOutcome as f4, mergePastChecksConfirmation as f5, mergeTarget as f6, namedRepos as f7, newTaskFields as f8, noExecutorRefusal as f9, reduceRun as fA, reduceTaskLog as fB, renderTaskQueryAnswer as fC, repairWaitLabel as fD, repairedLanded as fE, repairedNotice as fF, repeatingChecks as fG, replayTaskLog as fH, repoBaseLine as fI, repoResultLines as fJ, reposWithWork as fK, resetRunnerAuth as fL, resolveSkillInvocation as fM, resolveTaskRef as fN, resolveUserTaskRef as fO, resumeLabel as fP, resumeTime as fQ, revertEffect as fR, revertListLine as fS, revertTaskRef as fT, runHoldsEditors as fU, runSettingsOf as fV, runnerToolSubject as fW, scriptExitText as fX, scriptRunText as fY, secondsText as fZ, serializePlan as f_, normalizeAgentArgs as fa, opRefusalText as fb, opsEditable as fc, outputLines as fd, outputPreview as fe, overrideNeedsConfirmation as ff, parseCount as fg, parseDelegation as fh, parseSwitch as fi, parseTaskOpsJson as fj, parseTaskQueryJson as fk, pastGateConfirmation as fl, planBlocks as fm, planMarkerParts as fn, plannerMessage as fo, plannerNotReady as fp, plannerNotReadyFor as fq, plannerTranscript as fr, processLeaseHost as fs, ranSealed as ft, readRunnerAuth as fu, receiptLabel as fv, reconcileApprovals as fw, recordRunnerAuth as fx, recordedRunnerAuth as fy, reduceConversation as fz, type AccountLimitsMessage as g, serializeTaskStatus as g0, skillTokens as g1, skippedLabel as g2, stopTurn as g3, subtreeIds as g4, subtreeView as g5, summarizeToolCall as g6, supervisorSummary as g7, surfacePlan as g8, surfacePlanState as g9, unsendAll as gA, unsendLatest as gB, wakeUpItems as gC, walkPlan as gD, withoutSealedMark as gE, workspaceEnvOf as gF, takeAt as ga, taskActionCommand as gb, taskActivity as gc, taskChatAvailable as gd, taskLogCommands as ge, taskLogForSurface as gf, taskLogHeaderView as gg, taskOrderLabel as gh, taskPlacement as gi, taskQuerySignature as gj, taskRef as gk, taskRefOf as gl, taskRowActions as gm, taskRowView as gn, taskStartedNotice as go, taskStatusKind as gp, textHasTaskOps as gq, textHasTaskQuery as gr, titledRefs as gs, titledTaskRef as gt, titledTaskRefOf as gu, toTaskLogEvent as gv, toolHeadline as gw, trailerSummary as gx, trimToolOutput as gy, truncateCheckpointSummary as gz, type AdoptSessionResponse as h, type AnswerEscalationRequest as i, type ApplyTaskOpsResult as j, type ApprovalAnswerResponse as k, type ApprovalBlock as l, type ApprovalRequestMessage as m, type ApprovalStatus as n, type ApprovalsResponse as o, type ApproveReviewResponse as p, type AskOptions as q, type AssignmentCatalog as r, type AssignmentIssue as s, type AssignmentScope as t, type AssignmentWriter as u, type AutoMergeTrigger as v, CHECKPOINT_TRUNCATE_LENGTH as w, type CancelPlanningResponse as x, type CancelResumeResponse as y, type Carved as z };
9204
+ export { type ContainerChange as $, ACT_RISK as A, BatchQuoteError as B, CHAT_COMMANDS as C, type CancelResumeResponse as D, type Carved as E, type ChildControlOutcome as F, type ChildListResponse as G, type ChildMessageOutcome as H, type ChildMessageResponse as I, type ChildPlanEntry as J, type ChildPlanResponse as K, type ChildPlanView as L, type ChildTaskControl as M, type ChildTaskControlResponse as N, type ChildTreeFrame as O, CliAgentAiService as P, type CliAgentAiServiceDeps as Q, type CommandBlock as R, type CommandDescriptor as S, CommandLineTooLongError as T, type CommandOutcome as U, type CommandPayload as V, type CommandStatus as W, type CommandsResponse as X, type CompactionBlock as Y, type CompactionStatus as Z, type Consent as _, AUTORUN_RISK as a, type LaunchPlan as a$, type ContainerChangeResponse as a0, type ContainerGuaranteeLine as a1, type ContainerProblem as a2, type ContainerStatus as a3, type ContextCondenseRequest as a4, ConversationBusyError as a5, type ConversationCompactResponse as a6, type ConversationCompaction as a7, ConversationEditError as a8, type ConversationForkResponse as a9, type EscalationOptionId as aA, type EscalationRun as aB, type EscalationsResponse as aC, ExecutableNotFoundError as aD, type ExecuteCommandResponse as aE, type ExecuteResponse as aF, type ExecutionCommand as aG, ExecutionCommands as aH, type ExecutionHost as aI, type ExecutionSummary as aJ, type GatedConversation as aK, type GeneratePlanResponse as aL, type GlobalRunSettings as aM, HEADLESS_CLI_COMMANDS as aN, type HandoffBlock as aO, type HandoffForkRepo as aP, type HandoffPeekSubject as aQ, type IAiService as aR, IDLE_ACTIVITY as aS, type IWebFetcher as aT, type IsolationDiffResponse as aU, type IsolationMergeResponse as aV, type IsolationPreviewNotice as aW, type IsolationPreviewResponse as aX, LEASE_HEARTBEAT_MS as aY, LEASE_STALE_MS as aZ, type LaunchDeps as a_, type ConversationInput as aa, type ConversationRequest as ab, type ConversationRewindResponse as ac, type ConversationTurn as ad, type ConversationView as ae, DEFAULT_WEB_READ_BUDGET as af, DELEGATION_OFFERED as ag, DELEGATION_RISK as ah, type DaemonErrorCode as ai, type DecideOptions as aj, type DiffRow as ak, type DiffRowKind as al, type DiffStat as am, type DisplayBlock as an, type DockerCli as ao, EMPTY_CONVERSATION as ap, EMPTY_HOLD as aq, EMPTY_RUN as ar, EMPTY_TASK_LOG as as, EMPTY_TASK_LOG_FOLLOW as at, EmbeddedNewlineError as au, type ErrorBody as av, type Escalation as aw, type EscalationInput as ax, type EscalationKind as ay, type EscalationOption as az, type AccountLimitBucket as b, type ReadRunnerAuthOptions as b$, LeaseHost as b0, type LeaseHostKind as b1, type LeaseHostOptions as b2, type LiveOutputLookup as b3, type LiveTail as b4, type LiveTailOptions as b5, type LocalEntry as b6, type LoopCheckFacts as b7, type LoopCheckState as b8, type LoopGuard as b9, type PlanBlocks as bA, type PlanIntake as bB, type PlanMarkerStatus as bC, type PlanResponse as bD, type PlanSnapshot as bE, PlanStore as bF, type PlannerCommandSyntax as bG, type PlannerContextDeps as bH, type PlannerContextStatus as bI, PlannerConversation as bJ, type PlannerConversationHost as bK, type PlannerModelCandidate as bL, type PlannerModelChoice as bM, PlannerModelMemory as bN, type PlannerModelRecall as bO, type PlannerModelStore as bP, type PlannerNotReady as bQ, PlannerNotReadyError as bR, type PlannerReadinessConfig as bS, type PlannerSubmission as bT, PlannerTurnDiscardedError as bU, PlannerTurnStoppedError as bV, PlannerUsageLimitError as bW, type PrdResponse as bX, type PromptHold as bY, REPORT_PREVIEW_LINES as bZ, RUN_SETTINGS_DEFAULTS as b_, type MappedTool as ba, type MarkdownToken as bb, type MergeGateEntry as bc, type MergeGateResponse as bd, type MergeWordingHandoff as be, type MessageBlock as bf, type MessageRole as bg, type ModelsResponse as bh, NOT_STARTED as bi, NO_TURN as bj, type NewTaskFields as bk, NodeBoard as bl, type NodeBudget as bm, OUTPUT_LINES_DEFAULT as bn, OUTPUT_LINES_MAX as bo, type OkResponse as bp, type OpRef as bq, type OpRefusal as br, type OrchestratorObserver as bs, type OutputPreview as bt, type OverrideDirection as bu, PLANNED_WITH_LABEL as bv, type PendingApproval as bw, PendingApprovals as bx, type PendingApprovalsOptions as by, type PlanBlock as bz, type AccountLimitSnapshot as c, type SubtreeItemView as c$, type RefTask as c0, ResearchTasks as c1, type ResolveAll as c2, type ResolveConflictResponse as c3, type RevertPreviewTask as c4, type RevertRefusal as c5, type RevertRefusalReason as c6, type RevertScope as c7, type RewindTarget as c8, type RewindTargetsResponse as c9, type SerializedTaskStatus as cA, type ServerInfoResponse as cB, type SessionBroadcaster as cC, type SessionFrame as cD, type SessionHeld as cE, SessionHeldError as cF, type SessionLease as cG, type SessionLeaseRecord as cH, type SessionListResponse as cI, type SessionMessage as cJ, type SessionNotice as cK, type SessionResponse as cL, type SettingsResponse as cM, SettingsService as cN, type SettingsUpdateResponse as cO, type SkillInvocation as cP, type SkillLoadBlock as cQ, type SkillToken as cR, SlotPool as cS, type StartAdmission as cT, type StopResponse as cU, type StreamStamp as cV, type SubagentBlock as cW, type SubagentChild as cX, type SubagentStatus as cY, type SubplannerBrief as cZ, Subtree as c_, type RunActivity as ca, type RunInput as cb, type RunMergeView as cc, RunSettingsError as cd, type RunSnapshotFrame as ce, type RunTask as cf, type RunTaskStatus as cg, type RunView as ch, type RunnerAuth as ci, type RunnerAuthExec as cj, type RunnerAuthExecOptions as ck, type RunnerAuthExecResult as cl, type RunnerCatalog as cm, type RunnerLoadedBlock as cn, type RunnersResponse as co, STALLED_LABEL as cp, STOPPED_BEFORE_START as cq, STOPPING_LABEL as cr, SUBPLANNER_ACCOUNTING as cs, SUBPLANNER_CHILD as ct, SUBPLANNER_SCOPE as cu, SUPERVISOR_LEVEL_LABEL as cv, type SerializedConversationMessage as cw, type SerializedPendingTurn as cx, type SerializedPlan as cy, type SerializedTask as cz, type AccountLimitStatus as d, WINDOWS_MAX_COMMAND_LINE as d$, type SubtreeView as d0, type SurfacePlan as d1, type SurfacePlanState as d2, type SurfaceTask as d3, TASK_QUERY_ANSWER_MAX_CHARS as d4, TASK_QUERY_ANSWER_OR_OPS as d5, TASK_QUERY_FIELDS as d6, TASK_QUERY_PROTOCOL as d7, TASK_QUERY_REMINDER as d8, TERMINAL_UI_COMMANDS as d9, type TaskRef as dA, type TaskRevertPreview as dB, type TaskRevertPreviewResponse as dC, type TaskRowAction as dD, type TaskRowContext as dE, type TaskRowDelegated as dF, type TaskRowHandoff as dG, type TaskRowIsolation as dH, type TaskRowKind as dI, type TaskRowLoop as dJ, type TaskRowPlacement as dK, type TaskRowSubject as dL, type TaskRowUsage as dM, type TaskRowView as dN, type TaskRunFacts as dO, type TaskStatusKind as dP, type ThinkingDisplayBlock as dQ, type ToolBlock as dR, type ToolHeadline as dS, type ToolStatus as dT, TreeLedger as dU, type TreeTask as dV, TurnBudgets as dW, type TurnGate as dX, type UsageBlock as dY, type UserSettings as dZ, WAITS_FOR_APPROVAL_LABEL as d_, type TakenPrompt as da, type TaskAction as db, type TaskActivity as dc, type TaskAttemptSnapshot as dd, type TaskLogAttemptsResponse as de, type TaskLogBatch as df, type TaskLogEvent as dg, type TaskLogFollow as dh, type TaskLogFollowInput as di, type TaskLogHeaderKind as dj, type TaskLogHeaderTask as dk, type TaskLogHeaderUsage as dl, type TaskLogHeaderView as dm, type TaskLogResponse as dn, type TaskLogView as dp, type TaskMessageResponse as dq, type TaskOp as dr, TaskOrchestrator as ds, type TaskOrchestratorDeps as dt, type TaskOrchestratorOptions as du, type TaskOutputSource as dv, type TaskPlacement as dw, type TaskQuery as dx, type TaskQueryCatalog as dy, type TaskQueryField as dz, type AccountLimitWindow as e, editableWhileRunning as e$, type WakeUpItem as e0, type WebRead as e1, type WebReadDecision as e2, type WebReadOptions as e3, WebReadPolicy as e4, type Worded as e5, type WorkspacesResponse as e6, abbreviateHome as e7, accountLimitPercentText as e8, accountLimitWindowLabel as e9, changeContainers as eA, checkoutRule as eB, classifyOutcome as eC, closeTurn as eD, coalesceTaskLog as eE, compactionText as eF, confirmedOverride as eG, containerStatus as eH, containersOffered as eI, createAiService as eJ, delegatedRowView as eK, delegationSummary as eL, dependencyCandidates as eM, dependentsNotice as eN, dependentsOf as eO, describeContainers as eP, describeHeld as eQ, describeHolder as eR, describeIsolationPreview as eS, describeMergeResult as eT, describePlannerNotReady as eU, describeProblems as eV, diffRows as eW, diffStat as eX, diffSummary as eY, digestTaskLog as eZ, drainNext as e_, accountLimitsOf as ea, accountLimitsText as eb, accountLimitsTitle as ec, activityLabel as ed, aheadOfDraft as ee, applyTaskOps as ef, approvalKindText as eg, approvalLabel as eh, approvalStatusText as ei, assignedRunnerOf as ej, assignmentIssue as ek, assignmentIssueText as el, attachingLabel as em, automergeSummary as en, autorunSummary as eo, awaitingLabel as ep, blockNotice as eq, blockNotices as er, blockedByLabel as es, blockingFailures as et, canMergeTasks as eu, canSetDependencies as ev, canSplitTask as ew, capConflictFiles as ex, cardEditNeedsUnstarted as ey, cardEditable as ez, type AccountLimitsFrame as f, processLeaseHost as f$, elapsedSince as f0, escalations as f1, executionSummary as f2, followTaskLog as f3, followTurn as f4, formatElapsed as f5, fromTranscript as f6, getSettingsPath as f7, handoffBaseLine as f8, handoffBranchName as f9, markdownHtml as fA, markdownTokens as fB, mergeOutcome as fC, mergePastChecksConfirmation as fD, mergeTarget as fE, namedRepos as fF, newTaskFields as fG, noExecutorRefusal as fH, normalizeAgentArgs as fI, opRefusalText as fJ, opsEditable as fK, outputLines as fL, outputPreview as fM, overrideNeedsConfirmation as fN, parseCount as fO, parseDelegation as fP, parseSwitch as fQ, parseTaskOpsJson as fR, parseTaskQueryJson as fS, pastGateConfirmation as fT, planBlocks as fU, planDirectLaunch as fV, planMarkerParts as fW, plannerMessage as fX, plannerNotReady as fY, plannerNotReadyFor as fZ, plannerTranscript as f_, handoffFindingsText as fa, handoffPeekParts as fb, hasAccountLimits as fc, hasHiddenDetail as fd, hasLongReport as fe, holdLabel as ff, holdPrompt as fg, isExecutableResolved as fh, isFileEditTool as fi, isRepoGroup as fj, isTaskRunning as fk, keptDelegationBudget as fl, lastServedModel as fm, loadedSkillTokens as fn, logContinues as fo, logResumes as fp, loopBodyLabel as fq, loopBodyRound as fr, loopCheckLabel as fs, loopCheckState as ft, loopLeaveNotice as fu, loopRowParts as fv, manualOverrideConfirmation as fw, manualOverrideStopFirst as fx, mapAgentTool as fy, markAction as fz, type AccountLimitsMessage as g, textHasTaskQuery as g$, ranSealed as g0, readRunnerAuth as g1, receiptLabel as g2, reconcileApprovals as g3, recordRunnerAuth as g4, recordedRunnerAuth as g5, reduceConversation as g6, reduceRun as g7, reduceTaskLog as g8, rememberDelegationBudget as g9, serializeTaskStatus as gA, skillTokens as gB, skippedLabel as gC, stopTurn as gD, subtreeIds as gE, subtreeView as gF, summarizeToolCall as gG, supervisorSummary as gH, surfacePlan as gI, surfacePlanState as gJ, takeAt as gK, taskActionCommand as gL, taskActivity as gM, taskChatAvailable as gN, taskLogCommands as gO, taskLogForSurface as gP, taskLogHeaderView as gQ, taskOrderLabel as gR, taskPlacement as gS, taskQuerySignature as gT, taskRef as gU, taskRefOf as gV, taskRowActions as gW, taskRowView as gX, taskStartedNotice as gY, taskStatusKind as gZ, textHasTaskOps as g_, renderTaskQueryAnswer as ga, repairWaitLabel as gb, repairedLanded as gc, repairedNotice as gd, repeatingChecks as ge, replayTaskLog as gf, repoBaseLine as gg, repoResultLines as gh, reposWithWork as gi, resetRunnerAuth as gj, resolveSkillInvocation as gk, resolveTaskRef as gl, resolveUserTaskRef as gm, resumeLabel as gn, resumeTime as go, revertEffect as gp, revertListLine as gq, revertTaskRef as gr, runHoldsEditors as gs, runSettingsOf as gt, runnerToolSubject as gu, scriptExitText as gv, scriptRunText as gw, secondsText as gx, serializePlan as gy, serializeTask as gz, type AdoptSessionResponse as h, titledRefs as h0, titledTaskRef as h1, titledTaskRefOf as h2, toTaskLogEvent as h3, toolHeadline as h4, trailerSummary as h5, trimToolOutput as h6, truncateCheckpointSummary as h7, unsendAll as h8, unsendLatest as h9, wakeUpItems as ha, walkPlan as hb, windowsCommandLine as hc, withoutSealedMark as hd, workspaceEnvOf as he, type AnswerEscalationRequest as i, type ApplyTaskOpsResult as j, type ApprovalAnswerResponse as k, type ApprovalBlock as l, type ApprovalRequestMessage as m, type ApprovalStatus as n, type ApprovalsResponse as o, type ApproveReviewResponse as p, type AskOptions as q, type AssignmentCatalog as r, type AssignmentIssue as s, type AssignmentScope as t, type AssignmentWriter as u, type AutoMergeTrigger as v, type BlockingSubject as w, CHECKPOINT_TRUNCATE_LENGTH as x, CMD_EXE_MAX_COMMAND_LINE as y, type CancelPlanningResponse as z };