@ordewell/core 0.11.2 → 0.12.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/AUTHORS.md +3 -1
- package/dist/{IRunner-ihalYfTo.d.mts → IRunner-BwzyUVIL.d.mts} +62 -18
- package/dist/{IRunner-DOMtDTVt.d.ts → IRunner-DjJkYwko.d.ts} +62 -18
- package/dist/{ModeResolver-DyXeZ9ib.d.ts → ModeResolver-CHsaoV7M.d.ts} +1 -1
- package/dist/{ModeResolver-BDAgouuE.d.mts → ModeResolver-b_7bPlBS.d.mts} +1 -1
- package/dist/{Task-BL4Idm9r.d.mts → Task-BTEH-ztX.d.mts} +301 -26
- package/dist/{Task-BL4Idm9r.d.ts → Task-BTEH-ztX.d.ts} +301 -26
- package/dist/{chunk-MYXMIVWA.mjs → chunk-BFLVOYNR.mjs} +3 -3
- package/dist/{chunk-YAFNYNFX.mjs → chunk-BKTDYGIP.mjs} +14 -2
- package/dist/chunk-BKTDYGIP.mjs.map +1 -0
- package/dist/{chunk-QTZ5XTBY.mjs → chunk-F6WS3JLQ.mjs} +446 -10
- package/dist/chunk-F6WS3JLQ.mjs.map +1 -0
- package/dist/{chunk-7WNLN63J.mjs → chunk-HP2LNKST.mjs} +315 -51
- package/dist/chunk-HP2LNKST.mjs.map +1 -0
- package/dist/index.d.mts +242 -78
- package/dist/index.d.ts +242 -78
- package/dist/index.js +5598 -2005
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4701 -1782
- package/dist/index.mjs.map +1 -1
- package/dist/parsing.d.mts +2 -2
- package/dist/parsing.d.ts +2 -2
- package/dist/parsing.js.map +1 -1
- package/dist/parsing.mjs +3 -3
- package/dist/plan-utils.d.mts +4 -4
- package/dist/plan-utils.d.ts +4 -4
- package/dist/plan-utils.js +135 -19
- package/dist/plan-utils.js.map +1 -1
- package/dist/plan-utils.mjs +25 -3
- package/dist/{runSettingsText-CYMhTWfw.d.ts → runSettingsText-CvZ40IPv.d.ts} +1086 -190
- package/dist/{runSettingsText-tnmvdSfS.d.mts → runSettingsText-x-YML2ay.d.mts} +1086 -190
- package/dist/testing.d.mts +18 -2
- package/dist/testing.d.ts +18 -2
- package/dist/testing.js +71 -7
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +68 -7
- package/dist/testing.mjs.map +1 -1
- package/package.json +2 -1
- package/dist/chunk-7WNLN63J.mjs.map +0 -1
- package/dist/chunk-QTZ5XTBY.mjs.map +0 -1
- package/dist/chunk-YAFNYNFX.mjs.map +0 -1
- /package/dist/{chunk-MYXMIVWA.mjs.map → chunk-BFLVOYNR.mjs.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { q as ApprovalRequest, r as ApprovalSource, N as IApproval,
|
|
3
|
-
import { R as RunnerModeInfo } from './ModeResolver-
|
|
1
|
+
import { a_ as StoredHandoff, b1 as Task, aK as RunnerId, bb as TaskSnapshot, b as AwaitingReason, bh as UsageRecord, aL as RunnerSessionCost, i as DiscoveredModel, aZ as SkillsService, aU as SkillInfo, az as RepoGroupLayout, z as IWorktreeIsolation, a0 as IsolationRun, M as IsolationHandoff, af as PlanIsolation, a1 as IsolationTaskRecord, b4 as TaskIsolation, a5 as IsolationView, ao as PrepareIntent, as as PreviousWork, q as HandoffCommit, U as IsolationOutcome, aw as RepairEvidence, bf as TreeSnapshot, b2 as TaskDiffRead, b3 as TaskDiffResult, T as IsolationMergeResult, a7 as LandedWork, aI as RevertWatch, _ as IsolationRevertResult, bj as Verdict, a8 as LegacyPlanState, b8 as TaskReportTo, ba as TaskSkillSnapshot, b9 as TaskSkillNotice, a$ as SubagentOutcome, a2 as IsolationTaskRef, aH as RevertCommand, $ as IsolationRevertTask, d as ConversationMessage, aW as SkillLoadNotice, ae as PendingPlanTurn, r as HandoffDigest, a as AttemptUsage, b6 as TaskLoop, aJ as RunSettings, ai as PlanUsage, ay as ReplyRun, aP as SessionBilling, ab as ModelUsage, bi as UsageTotals, c as ContextFill, aj as PlannerCompaction, k as ExecutionRecord, aE as ResearchStep, ag as PlanState, ax as RepairWait, b0 as SupervisorLevel, bc as TaskStatus, E as ExecutionActor, l as GuardTrip, G as GuardTarget, j as ExecutionCommandName, aD as ResearchProgress, aC as ResearchLogEntry, aV as SkillLoad, al as PlannerContextPause, ah as PlanStatus, R as IsolationMergeBlock, P as IsolationLandedTask, V as IsolationPreview, aG as ResearchToolType, a9 as LoopSubject, aF as ResearchStepOutcome, ak as PlannerCompactionOutcome, an as PlannerUsage, F as FindingSeverity, bd as TaskType, ad as PatchView, b5 as TaskIsolationState, be as TaskUsageSummary } from './Task-BTEH-ztX.js';
|
|
2
|
+
import { q as ApprovalRequest, r as ApprovalSource, N as IApproval, bs as ToolOutcome, R as IRunnerSession, O as IConfig, bt as UsageLimitSignal, be as TaskMessageFrom, aN as RunnerModelRef, aE as RunnerCommand, aK as RunnerMcpServer, b6 as StructuredTurnEnd, k as ApprovalDecision, aZ as ScriptRun, a_ as ScriptStatus, b5 as StructuredEvent, j as ApprovalAnswer, ar as QueuedTaskMessage, l as ApprovalKind, Q as IRunner, aO as RunnerRegistry, bn as TaskShellSite, bm as TaskShell, az as RuleWord, af as PlannerAllowlist, aW as ScriptBody, d as AgentProcessDeps, a as AgentAdapter, a9 as OrdewellMcpServer, P as IFileSystem, am as PlannerToolHandler, aJ as RunnerManifest, bk as TaskRunnerConfig, f as AiProvider, ag as PlannerBackendId, a8 as OrchestratorOption } from './IRunner-DjJkYwko.js';
|
|
3
|
+
import { R as RunnerModeInfo } from './ModeResolver-CHsaoV7M.js';
|
|
4
4
|
|
|
5
5
|
type NotificationAction = {
|
|
6
6
|
label: string;
|
|
@@ -261,6 +261,8 @@ declare class PlanStore {
|
|
|
261
261
|
* with the top-level task it hangs under.
|
|
262
262
|
*/
|
|
263
263
|
isOps(taskId: string): boolean;
|
|
264
|
+
/** Every task's status and what it waits for, to tell cheaply whether one has changed since this was read. */
|
|
265
|
+
statusMark(): string;
|
|
264
266
|
/** A copy of the task tree, detached from the store: later status changes do not reach it. */
|
|
265
267
|
snapshot(): Task[];
|
|
266
268
|
getExecutionLog(): ReadonlyArray<TaskSnapshot>;
|
|
@@ -274,13 +276,7 @@ declare class PlanStore {
|
|
|
274
276
|
clearLog(): void;
|
|
275
277
|
private notifyMutate;
|
|
276
278
|
private countStatus;
|
|
277
|
-
|
|
278
|
-
* `keepFailed` adopts failed tasks as failed: an edit reconciled into a run
|
|
279
|
-
* is not a retry, and the tasks it blocks wait for one (ADR-0034).
|
|
280
|
-
*/
|
|
281
|
-
load(tasks: ReadonlyArray<Readonly<Task>>, runners: readonly RunnerId[], opts?: {
|
|
282
|
-
keepFailed?: boolean;
|
|
283
|
-
}): void;
|
|
279
|
+
load(tasks: ReadonlyArray<Readonly<Task>>, runners: readonly RunnerId[]): void;
|
|
284
280
|
add(partial: Partial<Task>): Task;
|
|
285
281
|
remove(taskId: string): void;
|
|
286
282
|
update(taskId: string, changes: Partial<Task>): Task | undefined;
|
|
@@ -288,22 +284,36 @@ declare class PlanStore {
|
|
|
288
284
|
* Run preparation as one named op: flip every AI and script task to 'approved'. By
|
|
289
285
|
* default completed tasks keep their status so a reloaded half-finished plan
|
|
290
286
|
* resumes the remainder instead of re-running work that already succeeded,
|
|
291
|
-
* and skipped ones stay skipped: a new run is not a retry of them.
|
|
287
|
+
* and skipped ones stay skipped: a new run is not a retry of them. A failed
|
|
288
|
+
* task gets its fresh chance here, not at a load (ADR-0053).
|
|
292
289
|
* `preserveCompleted: false` is for a freshly committed plan, where
|
|
293
|
-
* everything starts over. `
|
|
294
|
-
*
|
|
295
|
-
*
|
|
290
|
+
* everything starts over. `edited` is an edit adopted between runs, which is
|
|
291
|
+
* not the user starting over: a failed task stays failed, and a task waiting
|
|
292
|
+
* on the user, whatever for, stays waiting. `keepFailed` is what failed in
|
|
293
|
+
* the reply autorun's run follows: nobody asked for those to run again.
|
|
296
294
|
*/
|
|
297
295
|
resetForRun(opts?: {
|
|
298
296
|
preserveCompleted?: boolean;
|
|
299
|
-
|
|
297
|
+
edited?: boolean;
|
|
298
|
+
keepFailed?: ReadonlySet<string>;
|
|
300
299
|
}): void;
|
|
300
|
+
/**
|
|
301
|
+
* Execute's fresh chance with work already live (ADR-0053), which
|
|
302
|
+
* `resetForRun` would take back: only what failed and is not at work is
|
|
303
|
+
* readied, and a check between rounds still leaves its body to run first.
|
|
304
|
+
*/
|
|
305
|
+
readyFailed(live: (taskId: string) => boolean): void;
|
|
306
|
+
/** See {@link releaseMadeManual}; `live` names what a runner still holds. */
|
|
307
|
+
releaseMadeManual(live?: (taskId: string) => boolean): void;
|
|
308
|
+
private ready;
|
|
301
309
|
markCompleted(id: string): void;
|
|
302
310
|
markFailed(id: string): void;
|
|
303
311
|
markSkipped(id: string, reason?: string): void;
|
|
304
312
|
markInProgress(id: string): void;
|
|
305
313
|
/** Its first attempt is starting: from now on its chat exists, whatever becomes of the attempt. */
|
|
306
314
|
markAttempted(id: string): void;
|
|
315
|
+
/** Its attempt starts: the number now tells its waits from the last attempt's, so they count from nothing (ADR-0053). */
|
|
316
|
+
markAttemptStarted(id: string): void;
|
|
307
317
|
markAwaitingUser(id: string, reason?: AwaitingReason): void;
|
|
308
318
|
/** When a task paused on a usage limit resumes on its own; undefined leaves it to a manual retry. */
|
|
309
319
|
setTaskResumeAt(id: string, resumeAt: string | undefined): void;
|
|
@@ -316,6 +326,8 @@ declare class PlanStore {
|
|
|
316
326
|
retry(id: string, opts?: {
|
|
317
327
|
sameRound?: boolean;
|
|
318
328
|
}): void;
|
|
329
|
+
/** Its landed work was reverted (ADR-0054): as a retry leaves it, marked so until it starts. */
|
|
330
|
+
markReverted(id: string): void;
|
|
319
331
|
/** A loop's check counts its rounds afresh from its next run (ADR-0045 L7). */
|
|
320
332
|
startRoundsOver(id: string): void;
|
|
321
333
|
/**
|
|
@@ -326,6 +338,10 @@ declare class PlanStore {
|
|
|
326
338
|
repeat(id: string): void;
|
|
327
339
|
/** Kept on the task: it was force-started past its merge gate, before these ancestors' work was merged (ADR-0020). */
|
|
328
340
|
setForcedPastGate(id: string, dependencies: string[]): void;
|
|
341
|
+
/** One of the task's waits is over, so what it waits on next is another (ADR-0053). */
|
|
342
|
+
endWait(id: string): void;
|
|
343
|
+
/** Work under way is the one status nobody could be waiting on, so moving off any other ends a wait. */
|
|
344
|
+
private leaveStatus;
|
|
329
345
|
/** A reason outlives nothing: any status but `awaiting_user` drops it, and the resume time with it; any status drops a skip's reason. */
|
|
330
346
|
private setStatus;
|
|
331
347
|
setTaskVerdict(id: string, verdict: Task['verdict']): void;
|
|
@@ -638,8 +654,12 @@ interface IsolationRunListener {
|
|
|
638
654
|
handoff(handoff: IsolationHandoff): void;
|
|
639
655
|
/** The run was cleared up and forgotten: nothing was handed over, or it was discarded. */
|
|
640
656
|
closed(): void;
|
|
657
|
+
/** The run is over, discarded or cleared up, whether or not its record stays: nothing it carried goes on (ADR-0045 L5). A Merge all it goes on after is not this. */
|
|
658
|
+
ended(): void;
|
|
641
659
|
/** Already said through the notifications; also for a surface that shows no toasts. */
|
|
642
660
|
notice(level: IsolationNoticeLevel, message: string): void;
|
|
661
|
+
/** A clean-up took the branches these resolver tasks would merge, and their links with them. */
|
|
662
|
+
resolversEnded(resolverIds: readonly string[]): void;
|
|
643
663
|
}
|
|
644
664
|
interface IsolationRunControllerDeps {
|
|
645
665
|
isolation: IWorktreeIsolation;
|
|
@@ -653,6 +673,8 @@ interface IsolationRunControllerDeps {
|
|
|
653
673
|
* the user mid-attempt.
|
|
654
674
|
*/
|
|
655
675
|
liveTasks: () => ReadonlySet<string>;
|
|
676
|
+
/** What a task depends on now, directly or not, read as it lands: the plan may let go of that later, and a revert may not (ADR-0054). */
|
|
677
|
+
landedOn: (taskId: string) => readonly string[];
|
|
656
678
|
}
|
|
657
679
|
/**
|
|
658
680
|
* The lifecycle of a plan's isolation run (ADR-0013, ADR-0014, ADR-0020),
|
|
@@ -670,6 +692,7 @@ declare class IsolationRunController {
|
|
|
670
692
|
private readonly workspaceRoot;
|
|
671
693
|
private readonly listener;
|
|
672
694
|
private readonly liveTasks;
|
|
695
|
+
private readonly landedOn;
|
|
673
696
|
private run;
|
|
674
697
|
/** See {@link mergedRun}. */
|
|
675
698
|
private merged;
|
|
@@ -687,10 +710,13 @@ declare class IsolationRunController {
|
|
|
687
710
|
/** Resolver task id → the conflicted task it resolves; see {@link linkResolver}. */
|
|
688
711
|
private resolvers;
|
|
689
712
|
private opening;
|
|
713
|
+
private opened;
|
|
690
714
|
/** Bumped by an interrupt, so an activation in flight across it does not open the run it ended. */
|
|
691
715
|
private activations;
|
|
692
716
|
/** The start a dirty tree turned away, handed back once the user chooses how to go on. */
|
|
693
717
|
private blockedStart;
|
|
718
|
+
/** How many starts it has turned away; a replay can be turned away again in the same run. */
|
|
719
|
+
private turnedAway;
|
|
694
720
|
/** The dirty repos behind {@link blockedStart}, for the stash notice. */
|
|
695
721
|
private blockedRepos;
|
|
696
722
|
constructor(deps: IsolationRunControllerDeps);
|
|
@@ -705,12 +731,16 @@ declare class IsolationRunController {
|
|
|
705
731
|
*/
|
|
706
732
|
get mergedRun(): string | null;
|
|
707
733
|
get isOpen(): boolean;
|
|
734
|
+
/** How many runs have opened: what tells one run's launches from the next one's. */
|
|
735
|
+
get epoch(): number;
|
|
708
736
|
/** The open run has decided whether it isolates. */
|
|
709
737
|
get decided(): boolean;
|
|
710
738
|
/** The open run executes in worktrees. */
|
|
711
739
|
get isolating(): boolean;
|
|
712
740
|
/** A run is waiting on the user to stash or to go on without isolation. */
|
|
713
741
|
get blocked(): boolean;
|
|
742
|
+
/** How many starts a dirty tree has turned away: what tells one wait on it from the next (ADR-0053). */
|
|
743
|
+
get blockedStarts(): number;
|
|
714
744
|
/** What the plan persists of isolated execution; null when no run ever isolated. */
|
|
715
745
|
get planIsolation(): PlanIsolation | null;
|
|
716
746
|
/** The one guard of every action on the run: a plan that never isolated is a request refused, not a fault. */
|
|
@@ -769,10 +799,11 @@ declare class IsolationRunController {
|
|
|
769
799
|
/**
|
|
770
800
|
* Go on with the start a dirty tree turned away. `stash` puts the user's
|
|
771
801
|
* tracked changes on the git stash first, so the run isolates; `shared` runs
|
|
772
|
-
* this one run in the workspace root, knowingly
|
|
773
|
-
*
|
|
802
|
+
* this one run in the workspace root, knowingly; `reread` does nothing to the
|
|
803
|
+
* tree, so the replay asks about it again (ADR-0053). Returns the parked start
|
|
804
|
+
* for the caller to replay; null when nothing was parked.
|
|
774
805
|
*/
|
|
775
|
-
continueBlocked(how: 'stash' | 'shared'): Promise<(() => Promise<void>) | null>;
|
|
806
|
+
continueBlocked(how: 'stash' | 'shared' | 'reread'): Promise<(() => Promise<void>) | null>;
|
|
776
807
|
/**
|
|
777
808
|
* The working directory of an attempt that may run in a worktree — which
|
|
778
809
|
* attempts do is the attempt kind's to say (see `attemptKind.attemptCwd`):
|
|
@@ -797,6 +828,7 @@ declare class IsolationRunController {
|
|
|
797
828
|
* settles. A git error is `failed`, never a throw.
|
|
798
829
|
*/
|
|
799
830
|
integrate(task: Task, commit?: HandoffCommit): Promise<IsolationOutcome>;
|
|
831
|
+
private keepLandedOn;
|
|
800
832
|
/** What a conflict repair's work shows (ADR-0015); git that cannot tell counts against it. */
|
|
801
833
|
verifyRepair(task: Task): Promise<RepairEvidence>;
|
|
802
834
|
/**
|
|
@@ -824,10 +856,12 @@ declare class IsolationRunController {
|
|
|
824
856
|
awaitsMerge(taskId: string): boolean;
|
|
825
857
|
/**
|
|
826
858
|
* Look again for landed work the user has merged — by Merge all, or by hand
|
|
827
|
-
* with git. Resolves true when
|
|
859
|
+
* with git — or has taken back out. Resolves true when a mark changed.
|
|
828
860
|
*/
|
|
829
861
|
refreshInHead(): Promise<boolean>;
|
|
830
|
-
/**
|
|
862
|
+
/** Whether any landed work reads as merged: an answer git can take back, if the user takes the merge out. */
|
|
863
|
+
get readsMerged(): boolean;
|
|
864
|
+
/** Mark the run's landed work as git finds it now; true when a mark changed. */
|
|
831
865
|
private findLanded;
|
|
832
866
|
/** The run landed something and every landing is in the user's HEAD. */
|
|
833
867
|
private allMerged;
|
|
@@ -858,6 +892,8 @@ declare class IsolationRunController {
|
|
|
858
892
|
linkResolver(resolverId: string, conflictedId: string): void;
|
|
859
893
|
/** The conflicted task a landed resolver was added for, forgotten as it is returned. */
|
|
860
894
|
takeResolver(resolverId: string): string | undefined;
|
|
895
|
+
/** The tasks added to resolve this task's conflict: one, but for a plan saved before that was the rule (ADR-0015). */
|
|
896
|
+
resolversOf(conflictedId: string): string[];
|
|
861
897
|
taskDiff(taskId: string, options: TaskDiffRead): Promise<TaskDiffResult>;
|
|
862
898
|
reviewDiff(): Promise<string>;
|
|
863
899
|
/**
|
|
@@ -869,6 +905,18 @@ declare class IsolationRunController {
|
|
|
869
905
|
* HEAD somehow does not contain stays for the next run's sweep.
|
|
870
906
|
*/
|
|
871
907
|
merge(): Promise<IsolationMergeResult>;
|
|
908
|
+
/** What git says of landed work a revert would take; see {@link IWorktreeIsolation.readLanded}. */
|
|
909
|
+
readLanded(taskIds: readonly string[]): Promise<LandedWork>;
|
|
910
|
+
/**
|
|
911
|
+
* Revert tasks' landings on the integration branches (ADR-0054). The record
|
|
912
|
+
* is reported changed once the tips are set and before the first commit,
|
|
913
|
+
* again as each commit is made, so a crash leaves it to tell them from
|
|
914
|
+
* anyone's, and once it settles. Bound to the run it was
|
|
915
|
+
* asked in: a plan loaded meanwhile has records of its own under these ids,
|
|
916
|
+
* and is saved without what this would write to that run's branches, so it
|
|
917
|
+
* stops the revert and leaves them as they were.
|
|
918
|
+
*/
|
|
919
|
+
revert(taskIds: readonly string[], watch: Omit<RevertWatch, 'persist'>): Promise<IsolationRevertResult>;
|
|
872
920
|
/**
|
|
873
921
|
* Worktrees and task branches go; the integration branch and the record stay
|
|
874
922
|
* for review and merge. Refused while a task of the run is still live.
|
|
@@ -895,6 +943,8 @@ declare class IsolationRunController {
|
|
|
895
943
|
private discardMerged;
|
|
896
944
|
/** Say what a removal kept back instead of deleting: where the work went, or which worktree stayed. */
|
|
897
945
|
private report;
|
|
946
|
+
/** The branches the links' resolvers would merge have gone: the links go, and the scheduler is told of the tasks left. */
|
|
947
|
+
private endResolvers;
|
|
898
948
|
/** The run goes from the plan; `merged` names it as {@link mergedRun} when everything it landed was merged. */
|
|
899
949
|
private forget;
|
|
900
950
|
private assess;
|
|
@@ -907,7 +957,8 @@ declare class IsolationRunController {
|
|
|
907
957
|
* means a resumed plan's dependents must start from a tip that holds their
|
|
908
958
|
* predecessors' work, and anything held — a kept attempt, a conflict, a
|
|
909
959
|
* repair — is work the user may still want, which a fresh run's mint would
|
|
910
|
-
* delete. Only a run with no records at all is superseded
|
|
960
|
+
* delete. Only a run with no records at all is superseded, and not one that
|
|
961
|
+
* reverted the tasks it had: a retry starts from its tip (ADR-0054).
|
|
911
962
|
*/
|
|
912
963
|
private continuableRun;
|
|
913
964
|
/**
|
|
@@ -1082,8 +1133,18 @@ declare class Landing {
|
|
|
1082
1133
|
outcome: Promise<LandingOutcome>;
|
|
1083
1134
|
} | null;
|
|
1084
1135
|
private landConflicted;
|
|
1085
|
-
/**
|
|
1136
|
+
/**
|
|
1137
|
+
* The repair a conflicted task is owed next; null when repair is off, used
|
|
1138
|
+
* up, or there is no isolated run to repair it in. A resolver takes the
|
|
1139
|
+
* conflict instead: a conflict has one worker (ADR-0015).
|
|
1140
|
+
*/
|
|
1086
1141
|
nextRepair(taskId: string): RepairAttempt | null;
|
|
1142
|
+
/**
|
|
1143
|
+
* The tasks in the plan still out to resolve this task's conflict. A skipped
|
|
1144
|
+
* one has been given up, and a link to one that left the plan points at
|
|
1145
|
+
* nothing, so either leaves the conflict free for another worker.
|
|
1146
|
+
*/
|
|
1147
|
+
liveResolvers(taskId: string): Readonly<Task>[];
|
|
1087
1148
|
/** What a repair is asked to do; read once `reopen` has recorded the tips it must bring in. */
|
|
1088
1149
|
repairPrompt(task: Task): string;
|
|
1089
1150
|
private hasUnlandedWork;
|
|
@@ -1185,7 +1246,9 @@ type TaskLogEvent =
|
|
|
1185
1246
|
/**
|
|
1186
1247
|
* A turn began by delivering `message`; `messageId` names it when it had been
|
|
1187
1248
|
* queued, `forced` when it was force sent. `from` on this and the other
|
|
1188
|
-
* message events marks one Ordewell sent rather than the user.
|
|
1249
|
+
* message events marks one Ordewell sent rather than the user. `startedAt`
|
|
1250
|
+
* (ISO) is when it began, which a reload needs to date its open turn (#81);
|
|
1251
|
+
* a log saved before it was kept has none.
|
|
1189
1252
|
*/
|
|
1190
1253
|
| {
|
|
1191
1254
|
type: 'turn_start';
|
|
@@ -1193,6 +1256,7 @@ type TaskLogEvent =
|
|
|
1193
1256
|
messageId?: string;
|
|
1194
1257
|
forced?: boolean;
|
|
1195
1258
|
from?: TaskMessageFrom;
|
|
1259
|
+
startedAt?: string;
|
|
1196
1260
|
}
|
|
1197
1261
|
/**
|
|
1198
1262
|
* A turn began by running the runner's own command `/name args` (#66): the
|
|
@@ -1203,6 +1267,7 @@ type TaskLogEvent =
|
|
|
1203
1267
|
name: string;
|
|
1204
1268
|
args?: string;
|
|
1205
1269
|
messageId?: string;
|
|
1270
|
+
startedAt?: string;
|
|
1206
1271
|
}
|
|
1207
1272
|
/** What the running command printed, for one that runs without the model. */
|
|
1208
1273
|
| {
|
|
@@ -1450,6 +1515,8 @@ interface TaskLogReader {
|
|
|
1450
1515
|
patch?(taskId: string, attempt: number): Buffer | undefined;
|
|
1451
1516
|
}
|
|
1452
1517
|
|
|
1518
|
+
/** Where a start stands against the user's Stop (ADR-0029): no longer current once one comes. */
|
|
1519
|
+
type Admitted = Pick<StartAdmission, 'current'>;
|
|
1453
1520
|
type AttemptPhase = 'starting' | 'running' | 'integrating';
|
|
1454
1521
|
/** Read-only view of a task's live attempt. */
|
|
1455
1522
|
interface TaskAttemptSnapshot {
|
|
@@ -1475,9 +1542,10 @@ type StartWait =
|
|
|
1475
1542
|
kind: 'started';
|
|
1476
1543
|
}
|
|
1477
1544
|
/**
|
|
1478
|
-
* A loop's check between rounds (ADR-0045 L3):
|
|
1479
|
-
*
|
|
1480
|
-
*
|
|
1545
|
+
* A loop's check between rounds (ADR-0045 L3): it runs again, as round
|
|
1546
|
+
* `round` of `maxRounds`, once its body has passed and landed; `waiting` is
|
|
1547
|
+
* the body that has not yet. Whether anything will run it then is no part
|
|
1548
|
+
* of the rule: a Stop or a reload leaves that to a start of it (L5).
|
|
1481
1549
|
*/
|
|
1482
1550
|
| {
|
|
1483
1551
|
kind: 'repeating';
|
|
@@ -1489,6 +1557,11 @@ type StartWait =
|
|
|
1489
1557
|
| {
|
|
1490
1558
|
kind: 'completing';
|
|
1491
1559
|
}
|
|
1560
|
+
/** A task added to resolve its conflict has it: a conflict has one worker (ADR-0015). */
|
|
1561
|
+
| {
|
|
1562
|
+
kind: 'resolver';
|
|
1563
|
+
resolver: string;
|
|
1564
|
+
}
|
|
1492
1565
|
/** An AI task with no prompt yet, or a script task with no body to run: there is nothing to run. */
|
|
1493
1566
|
| {
|
|
1494
1567
|
kind: 'no-prompt';
|
|
@@ -1551,15 +1624,44 @@ type StartWait =
|
|
|
1551
1624
|
* and goes past the whole gate and a planner turn's start hold. Queued behind
|
|
1552
1625
|
* its dependencies, it starts later with nobody asking, so it waits for a
|
|
1553
1626
|
* start hold as the scheduler's starts do, and goes past only the gate it was
|
|
1554
|
-
* confirmed past: `pastGate`.
|
|
1627
|
+
* confirmed past: `pastGate`. `asScheduled` is one the start rule has already
|
|
1628
|
+
* passed whole, carried back to the queue if it has to wait again.
|
|
1555
1629
|
*/
|
|
1556
1630
|
type ForcedStart = {
|
|
1557
1631
|
queued: false;
|
|
1558
1632
|
} | {
|
|
1559
1633
|
queued: true;
|
|
1560
1634
|
pastGate: readonly string[];
|
|
1635
|
+
asScheduled?: true;
|
|
1561
1636
|
};
|
|
1562
1637
|
|
|
1638
|
+
type RevertRefusalReason = 'no-landing' | 'no-own-merge' | 'checked-out' | 'in-a-loop' | 'live-dependent' | 'in-branch' | 'git';
|
|
1639
|
+
interface RevertRefusal {
|
|
1640
|
+
reason: RevertRefusalReason;
|
|
1641
|
+
message: string;
|
|
1642
|
+
/** `live-dependent`: the tasks in the way. */
|
|
1643
|
+
tasks?: IsolationTaskRef[];
|
|
1644
|
+
/** `in-branch`: what undoes the work there, newest first, for the user to run. */
|
|
1645
|
+
commands?: RevertCommand[];
|
|
1646
|
+
}
|
|
1647
|
+
/** The tasks a revert would take, the one asked for first; `refusal` says why it may not go ahead, and with no landing there is nothing to take. */
|
|
1648
|
+
interface RevertScope {
|
|
1649
|
+
taskIds: string[];
|
|
1650
|
+
refusal?: RevertRefusal;
|
|
1651
|
+
}
|
|
1652
|
+
/** A task a preview lists; `dependent` is one that goes with the task the user chose, and `ref` how the plan calls it, a subtask's full path. */
|
|
1653
|
+
interface RevertPreviewTask extends IsolationRevertTask {
|
|
1654
|
+
dependent: boolean;
|
|
1655
|
+
ref?: string;
|
|
1656
|
+
}
|
|
1657
|
+
/** What a revert would do now, for a surface to confirm with the user before anything changes. */
|
|
1658
|
+
type TaskRevertPreview = {
|
|
1659
|
+
revertible: true;
|
|
1660
|
+
tasks: RevertPreviewTask[];
|
|
1661
|
+
} | ({
|
|
1662
|
+
revertible: false;
|
|
1663
|
+
} & RevertRefusal);
|
|
1664
|
+
|
|
1563
1665
|
/** One reported window: what share of it is used, how long it is, and when it resets. */
|
|
1564
1666
|
interface AccountLimitWindow {
|
|
1565
1667
|
/** Which of a bucket's windows this is, in the order reported; only a label when the length is unknown. */
|
|
@@ -1629,6 +1731,178 @@ declare function accountLimitsText(snapshot: AccountLimitSnapshot): string | nul
|
|
|
1629
1731
|
*/
|
|
1630
1732
|
declare function accountLimitsTitle(snapshot: AccountLimitSnapshot, time: (at: Date) => string): string;
|
|
1631
1733
|
|
|
1734
|
+
/**
|
|
1735
|
+
* The bridge between "core needs an answer" and "a human somewhere is looking
|
|
1736
|
+
* at a UI". Core cannot prompt: the human may be at a browser, a TUI, a CLI
|
|
1737
|
+
* stream, or a VS Code webview, and on the web server they are on the far end
|
|
1738
|
+
* of a socket. So the Session parks a promise here, announces the request
|
|
1739
|
+
* through the normal broadcast seam, and every surface answers through the
|
|
1740
|
+
* same `resolve(id, granted)` call.
|
|
1741
|
+
*
|
|
1742
|
+
* Timeouts are load-bearing rather than defensive: a planner turn that blocks
|
|
1743
|
+
* forever on an unanswered prompt would hang the whole research loop with no
|
|
1744
|
+
* visible cause. On expiry the request resolves to denied and the model gets a
|
|
1745
|
+
* normal, actionable tool result. A task runner's request is the exception
|
|
1746
|
+
* (ADR-0018, A1): the runner is parked on it rather than a research loop, and
|
|
1747
|
+
* it waits for a person — or the supervisor — however long that takes.
|
|
1748
|
+
*/
|
|
1749
|
+
interface PendingApproval {
|
|
1750
|
+
id: string;
|
|
1751
|
+
request: ApprovalRequest;
|
|
1752
|
+
createdAt: string;
|
|
1753
|
+
}
|
|
1754
|
+
interface PendingApprovalsOptions {
|
|
1755
|
+
/** Denies and resolves after this long with no answer. Default 5 minutes. */
|
|
1756
|
+
timeoutMs?: number;
|
|
1757
|
+
/** Announce a new request to the surfaces. */
|
|
1758
|
+
onRequest?: (pending: PendingApproval) => void;
|
|
1759
|
+
/** Announce that a request is no longer actionable (answered or expired). */
|
|
1760
|
+
onSettled?: (id: string, granted: boolean, settled: {
|
|
1761
|
+
request: ApprovalRequest;
|
|
1762
|
+
decision: ApprovalDecision;
|
|
1763
|
+
}) => void;
|
|
1764
|
+
}
|
|
1765
|
+
interface AskOptions {
|
|
1766
|
+
/**
|
|
1767
|
+
* An id the caller already announced the request under. One still in use is
|
|
1768
|
+
* refused — denied at once — rather than overwriting the request that has it.
|
|
1769
|
+
*/
|
|
1770
|
+
id?: string;
|
|
1771
|
+
/** Wait for an answer however long it takes. */
|
|
1772
|
+
noTimeout?: boolean;
|
|
1773
|
+
/**
|
|
1774
|
+
* Given the answer as the request settles, before anything awaiting the
|
|
1775
|
+
* promise runs: a caller about to tear down what asked (a runner being
|
|
1776
|
+
* stopped) must deliver the answer before it goes.
|
|
1777
|
+
*/
|
|
1778
|
+
onDecision?: (decision: ApprovalDecision) => void;
|
|
1779
|
+
}
|
|
1780
|
+
declare class PendingApprovals {
|
|
1781
|
+
private readonly opts;
|
|
1782
|
+
private readonly entries;
|
|
1783
|
+
private readonly listeners;
|
|
1784
|
+
constructor(opts?: PendingApprovalsOptions);
|
|
1785
|
+
/** Hear each new request once it is announced — the supervisor wakes on a runner's (ADR-0029). */
|
|
1786
|
+
listen(listener: (pending: PendingApproval) => void): () => void;
|
|
1787
|
+
/** Park a request and return the promise the approval policy awaits. */
|
|
1788
|
+
ask(request: ApprovalRequest, options?: AskOptions): Promise<boolean>;
|
|
1789
|
+
/** Park a request whose answer is more than yes or no. */
|
|
1790
|
+
decide(request: ApprovalRequest, options?: AskOptions): Promise<ApprovalDecision>;
|
|
1791
|
+
/**
|
|
1792
|
+
* Answer one request. Returns false when the id is unknown or already
|
|
1793
|
+
* settled. "Allow for this task" on a request that did not offer it is a
|
|
1794
|
+
* plain allow: no grant is made that the requester never proposed.
|
|
1795
|
+
*/
|
|
1796
|
+
resolve(id: string, answer: ApprovalAnswer): boolean;
|
|
1797
|
+
/** Everything still awaiting an answer — replayed to a surface that connects late. */
|
|
1798
|
+
outstanding(): PendingApproval[];
|
|
1799
|
+
/**
|
|
1800
|
+
* Deny everything in flight, or only the requests `which` picks. Called on
|
|
1801
|
+
* abort and on session reset.
|
|
1802
|
+
*/
|
|
1803
|
+
clear(which?: (request: ApprovalRequest) => boolean, note?: string): void;
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
/**
|
|
1807
|
+
* What an escalation waits on (ADR-0053). `approval`, `checkpoint`, `input`,
|
|
1808
|
+
* `conflict`, `files-changed` and `usage-limit` are a task's wait; `failed` and
|
|
1809
|
+
* `out-of-rounds` its end; `merge-gate`, `unapproved`, `on-hold`, `no-prompt`
|
|
1810
|
+
* and `by-hand` what alone keeps a task from starting; `merge-all` and
|
|
1811
|
+
* `blocked-run` are the run's own.
|
|
1812
|
+
*/
|
|
1813
|
+
type EscalationKind = 'approval' | 'checkpoint' | 'input' | 'conflict' | 'files-changed' | 'usage-limit' | 'failed' | 'out-of-rounds' | 'merge-gate' | 'unapproved' | 'on-hold' | 'no-prompt' | 'by-hand' | 'merge-all' | 'blocked-run';
|
|
1814
|
+
type EscalationOptionId = 'allow' | 'allow-for-task' | 'deny' | 'approve' | 'reject' | 'reply' | 'resume' | 'continue' | 'retry' | 'run' | 'force-start' | 'skip' | 'complete' | 'merge-all' | 'resolve-conflict' | 'start-resolver' | 'stash' | 'run-without-isolation';
|
|
1815
|
+
/** One answer the user may give: what the wait's own card or command offers. */
|
|
1816
|
+
interface EscalationOption {
|
|
1817
|
+
id: EscalationOptionId;
|
|
1818
|
+
label: string;
|
|
1819
|
+
/** What this answer does with a note; absent when it takes none. */
|
|
1820
|
+
note?: 'optional' | 'required';
|
|
1821
|
+
/** The question a surface asks first, as it does on the card; the answer then carries the user's yes. */
|
|
1822
|
+
confirm?: string;
|
|
1823
|
+
}
|
|
1824
|
+
/**
|
|
1825
|
+
* One thing the run waits on a person for, derived and never stored
|
|
1826
|
+
* (ADR-0053). No deadline and no default answer: answering for the user on a
|
|
1827
|
+
* timer is a consent decision, which belongs to the mandate (#23).
|
|
1828
|
+
*/
|
|
1829
|
+
interface Escalation {
|
|
1830
|
+
/**
|
|
1831
|
+
* Kind, task and attempt, then the approval, what a merge gate waits to have
|
|
1832
|
+
* merged, and how many of the attempt's waits ended before it; for Merge all,
|
|
1833
|
+
* the run and the attempts it would merge. A later wait is another
|
|
1834
|
+
* escalation, so a stale answer is told from a live one.
|
|
1835
|
+
*/
|
|
1836
|
+
id: string;
|
|
1837
|
+
kind: EscalationKind;
|
|
1838
|
+
/** The task it belongs to, the link to its evidence; absent on the run's own. */
|
|
1839
|
+
task?: {
|
|
1840
|
+
id: string;
|
|
1841
|
+
ref: string;
|
|
1842
|
+
title: string;
|
|
1843
|
+
};
|
|
1844
|
+
/** The attempt it was raised in; absent before any ran. */
|
|
1845
|
+
attempt?: number;
|
|
1846
|
+
/** The runner request it answers, for `approval`. */
|
|
1847
|
+
approval?: string;
|
|
1848
|
+
/** The task out to resolve it, for a `conflict` nothing is starting that task for. */
|
|
1849
|
+
resolver?: string;
|
|
1850
|
+
reason: string;
|
|
1851
|
+
options: EscalationOption[];
|
|
1852
|
+
}
|
|
1853
|
+
/** What the list reads of the run. */
|
|
1854
|
+
interface EscalationRun {
|
|
1855
|
+
/** A full-plan run is scheduling, held, or ended on a failure a retry continues: only then, or in a carried loop, does a task that has not started wait on anyone, a reverted one apart. */
|
|
1856
|
+
open: boolean;
|
|
1857
|
+
/** Something could move a task on unasked, so the seam refuses a Mark complete (ADR-0029). */
|
|
1858
|
+
advancing: boolean;
|
|
1859
|
+
/** A Merge all is under way. */
|
|
1860
|
+
merging: boolean;
|
|
1861
|
+
/** Ordewell merges at gates by itself: the setting is on, and no merge has stopped it. */
|
|
1862
|
+
autoMerges: boolean;
|
|
1863
|
+
/** The run's close merges what landed by itself, so nobody has to; a Stop or a merge that stopped ends this, and the wait is real. */
|
|
1864
|
+
mergesAtClose: boolean;
|
|
1865
|
+
/** What Merge all would merge now. */
|
|
1866
|
+
merge: RunMergeView | null;
|
|
1867
|
+
/** The isolated run's id. */
|
|
1868
|
+
id: string | null;
|
|
1869
|
+
/** Which of the session's starts a dirty checkout turned away, when one waits on it; null when none does. */
|
|
1870
|
+
blocked: number | null;
|
|
1871
|
+
}
|
|
1872
|
+
/** What the list is derived from: nothing here is kept for it. */
|
|
1873
|
+
interface EscalationInput {
|
|
1874
|
+
/** The plan tree. */
|
|
1875
|
+
tasks: readonly Task[];
|
|
1876
|
+
/** Every task's start waits; see `planStartWaits`. */
|
|
1877
|
+
waits: ReadonlyMap<string, readonly StartWait[]>;
|
|
1878
|
+
approvals: readonly PendingApproval[];
|
|
1879
|
+
/** The task's latest attempt, 0 before any ran. */
|
|
1880
|
+
attempt: (task: Readonly<Task>) => number;
|
|
1881
|
+
/** An attempt of the task is live, so a runner is there to hear an answer. */
|
|
1882
|
+
live: (taskId: string) => boolean;
|
|
1883
|
+
/** What the task's waiting checkpoint asks, whole. */
|
|
1884
|
+
checkpoint: (taskId: string) => string | undefined;
|
|
1885
|
+
/** Added since the user approved the plan, and left for them (ADR-0035). */
|
|
1886
|
+
waitsForApproval: (taskId: string) => boolean;
|
|
1887
|
+
/** Queued to start with no scheduler, once what holds it clears. */
|
|
1888
|
+
startQueued: (taskId: string) => boolean;
|
|
1889
|
+
/** Why the task is on hold. */
|
|
1890
|
+
holdReason: (taskId: string) => string | null | undefined;
|
|
1891
|
+
/** Something will run this check between rounds without being asked (ADR-0045 L5). */
|
|
1892
|
+
loopRunsOn: (taskId: string) => boolean;
|
|
1893
|
+
/** A loop carried on with no scheduler starts this task, so the run is open for it alone (ADR-0045 L5). */
|
|
1894
|
+
carried: (taskId: string) => boolean;
|
|
1895
|
+
run: EscalationRun;
|
|
1896
|
+
}
|
|
1897
|
+
/**
|
|
1898
|
+
* Everything that will not move without a person (ADR-0053), in the order of
|
|
1899
|
+
* what stops the most first: a run that cannot start, then the plan's tasks in
|
|
1900
|
+
* order, then the work waiting to be merged. Pure and derived, as `planBlocks`
|
|
1901
|
+
* and `startWaits` are: nothing is stored, so nothing has to be cleared, and it
|
|
1902
|
+
* survives a reload as the waits it reads do.
|
|
1903
|
+
*/
|
|
1904
|
+
declare function escalations(input: EscalationInput): Escalation[];
|
|
1905
|
+
|
|
1632
1906
|
type SerializedTaskStatus = {
|
|
1633
1907
|
id: string;
|
|
1634
1908
|
/** The task's type, so a status-only surface can tag a script task (ADR-0035); absent from an older daemon. */
|
|
@@ -1692,6 +1966,8 @@ type SerializedTaskStatus = {
|
|
|
1692
1966
|
waitsForApproval?: true;
|
|
1693
1967
|
/** Why a task is held out of auto-scheduling, in the user's words; absent when it is not held. */
|
|
1694
1968
|
holdReason?: string;
|
|
1969
|
+
/** A loop's check between rounds that nothing will run, after a Stop or a reload (ADR-0045 L5). Absent for any other task. */
|
|
1970
|
+
loopStranded?: true;
|
|
1695
1971
|
/** Set only on a research task, so a stream of statuses alone can say which task is one (ADR-0037). */
|
|
1696
1972
|
research?: true;
|
|
1697
1973
|
/** The latest attempt's handoff, as the plan keeps it (ADR-0047); absent when the attempt left none. */
|
|
@@ -1859,6 +2135,8 @@ type SessionMessage =
|
|
|
1859
2135
|
* digests the turn delivers, shown ahead of the prompt; `supervisor` marks a
|
|
1860
2136
|
* wake-up turn, which no user message opened (ADR-0029). `forced`: the
|
|
1861
2137
|
* prompt was force sent, and this turn replaces the one it stopped.
|
|
2138
|
+
* `startedAt` (ISO) is when it began, which a surface counts its elapsed
|
|
2139
|
+
* time from (#81); an older daemon sends none.
|
|
1862
2140
|
*/
|
|
1863
2141
|
| {
|
|
1864
2142
|
type: 'planner_turn_started';
|
|
@@ -1868,6 +2146,7 @@ type SessionMessage =
|
|
|
1868
2146
|
wakeUps?: string[];
|
|
1869
2147
|
supervisor?: true;
|
|
1870
2148
|
forced?: true;
|
|
2149
|
+
startedAt?: string;
|
|
1871
2150
|
} | {
|
|
1872
2151
|
type: 'planner_skill_loaded';
|
|
1873
2152
|
turnId: string;
|
|
@@ -1978,12 +2257,26 @@ type SessionMessage =
|
|
|
1978
2257
|
type: 'planner_compaction';
|
|
1979
2258
|
compaction: PlannerCompaction;
|
|
1980
2259
|
turnId?: string;
|
|
1981
|
-
}
|
|
2260
|
+
}
|
|
2261
|
+
/**
|
|
2262
|
+
* A planner turn waits for the probe of installed coding agents (ADR-0009),
|
|
2263
|
+
* or nothing does any longer. While `waiting`, no planner has heard of that
|
|
2264
|
+
* turn, so a surface says so rather than that it is planning. It ends with
|
|
2265
|
+
* the probe, whatever became of the turn: one stopped at the gate leaves it
|
|
2266
|
+
* `true` for the next to wait under.
|
|
2267
|
+
*/
|
|
2268
|
+
| {
|
|
2269
|
+
type: 'planner_detection';
|
|
2270
|
+
waiting: boolean;
|
|
2271
|
+
}
|
|
2272
|
+
/** `escalations`: what waits on a person now (ADR-0053), whole; absent from an older daemon. */
|
|
2273
|
+
| {
|
|
1982
2274
|
type: 'status_update';
|
|
1983
2275
|
tasks: SerializedTaskStatus[];
|
|
1984
2276
|
runMerge?: RunMergeView;
|
|
1985
2277
|
usage?: PlanUsage;
|
|
1986
2278
|
activity?: RunActivity;
|
|
2279
|
+
escalations?: Escalation[];
|
|
1987
2280
|
} | {
|
|
1988
2281
|
type: 'review_needed';
|
|
1989
2282
|
tasks: SerializedTask[];
|
|
@@ -2097,7 +2390,7 @@ type PlanSnapshot = {
|
|
|
2097
2390
|
plan: SurfacePlan | SurfacePlanState;
|
|
2098
2391
|
};
|
|
2099
2392
|
/** What only the status stream says about a task; a plan refresh keeps these as they were. */
|
|
2100
|
-
type RunTaskStatus = Partial<Pick<SerializedTaskStatus, 'verdict' | 'idleSince' | 'completionReceived' | 'attaching' | 'isolation' | 'checkpoint' | 'queued' | 'continuable' | 'awaitingApproval' | 'mergeGate' | 'forcedPastGate' | 'waitsForApproval' | 'holdReason' | 'handoff' | 'attempted'>>;
|
|
2393
|
+
type RunTaskStatus = Partial<Pick<SerializedTaskStatus, 'verdict' | 'idleSince' | 'completionReceived' | 'attaching' | 'isolation' | 'checkpoint' | 'queued' | 'continuable' | 'awaitingApproval' | 'mergeGate' | 'forcedPastGate' | 'waitsForApproval' | 'holdReason' | 'loopStranded' | 'handoff' | 'attempted'>>;
|
|
2101
2394
|
/** A task in the run view: the plan's fields, then the status stream's. */
|
|
2102
2395
|
type RunTask = Omit<SerializedTask, 'subtasks'> & RunTaskStatus & {
|
|
2103
2396
|
subtasks: RunTask[];
|
|
@@ -2144,6 +2437,8 @@ interface RunView {
|
|
|
2144
2437
|
mergeResult: IsolationMergeResult | null;
|
|
2145
2438
|
/** What the scheduler is doing with the plan, as {@link RunActivity}. */
|
|
2146
2439
|
activity?: RunActivity;
|
|
2440
|
+
/** What will not move without a person (ADR-0053), as the newest status update said; absent from an older daemon's snapshot. */
|
|
2441
|
+
escalations?: Escalation[];
|
|
2147
2442
|
}
|
|
2148
2443
|
type RunInput = SessionMessage | PlanSnapshot;
|
|
2149
2444
|
/**
|
|
@@ -2159,7 +2454,7 @@ type SessionNotice = {
|
|
|
2159
2454
|
};
|
|
2160
2455
|
type SessionBroadcaster = (msg: SessionMessage) => void;
|
|
2161
2456
|
declare function serializeTask(t: SurfaceTask): SerializedTask;
|
|
2162
|
-
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): SerializedTaskStatus;
|
|
2457
|
+
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): SerializedTaskStatus;
|
|
2163
2458
|
/** 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. */
|
|
2164
2459
|
declare function surfacePlan({ queuedMessages: _carriedOverAtLoad, ...plan }: LegacyPlanState): SurfacePlan;
|
|
2165
2460
|
declare function surfacePlanState(state: PlanState): SurfacePlanState;
|
|
@@ -2249,9 +2544,11 @@ declare class SessionHeldError extends Error {
|
|
|
2249
2544
|
interface SessionLease {
|
|
2250
2545
|
/**
|
|
2251
2546
|
* Hold `sessionId`'s lease in `workspace`, letting go of the one held before
|
|
2252
|
-
* only once this one is held. Throws {@link SessionHeldError}.
|
|
2547
|
+
* only once this one is held. Throws {@link SessionHeldError}. `commit` runs
|
|
2548
|
+
* holding both: when it throws, the one held before is still held, and a
|
|
2549
|
+
* lease this claim took is let go.
|
|
2253
2550
|
*/
|
|
2254
|
-
claim(sessionId: string, workspace: string): void;
|
|
2551
|
+
claim(sessionId: string, workspace: string, commit?: () => void): void;
|
|
2255
2552
|
/**
|
|
2256
2553
|
* Null while this Session holds `sessionId`'s lease, claiming it when no
|
|
2257
2554
|
* live host holds it; otherwise who holds it. A lease another host took from
|
|
@@ -2332,7 +2629,7 @@ declare class HostedLease implements SessionLease {
|
|
|
2332
2629
|
workspace: string;
|
|
2333
2630
|
private lostLease;
|
|
2334
2631
|
constructor(host: LeaseHost, onLost: (held: SessionHeld) => void);
|
|
2335
|
-
claim(sessionId: string, workspace: string): void;
|
|
2632
|
+
claim(sessionId: string, workspace: string, commit?: () => void): void;
|
|
2336
2633
|
hold(sessionId: string, workspace: string): SessionHeld | null;
|
|
2337
2634
|
release(): void;
|
|
2338
2635
|
/** @internal Another host took `file`'s lease from this one. */
|
|
@@ -2354,10 +2651,12 @@ type AutoMergeTrigger = {
|
|
|
2354
2651
|
};
|
|
2355
2652
|
/**
|
|
2356
2653
|
* Who opened a run (ADR-0029): a call the user made, or one made for them; a
|
|
2357
|
-
* call of the supervisor's own
|
|
2358
|
-
*
|
|
2654
|
+
* call of the supervisor's own, or a subplanner's, which has no user to make
|
|
2655
|
+
* one for (ADR-0056 M6); a usage-limit reset resuming what it paused; or a loop
|
|
2656
|
+
* carried on with no scheduler (ADR-0045 L5). Only the user's starts a run's
|
|
2657
|
+
* supervision afresh.
|
|
2359
2658
|
*/
|
|
2360
|
-
type RunOrigin = 'user' | 'supervisor' | 'limit-reset';
|
|
2659
|
+
type RunOrigin = 'user' | 'supervisor' | 'limit-reset' | 'loop';
|
|
2361
2660
|
/** What the scheduler reads of the open run's settings, at each decision it makes from them. */
|
|
2362
2661
|
type SchedulerRunSettings = Pick<RunSettings, 'mergeAtGatesAutomatically'>;
|
|
2363
2662
|
/**
|
|
@@ -2515,6 +2814,8 @@ interface TaskOrchestratorDeps {
|
|
|
2515
2814
|
* owns it, and the scheduler starts nothing outside it.
|
|
2516
2815
|
*/
|
|
2517
2816
|
isApproved: (taskId: string) => boolean;
|
|
2817
|
+
/** Read beside the run's setting at each automatic merge, which passes no command (ADR-0056 M6). */
|
|
2818
|
+
mayMergeUnasked: () => boolean;
|
|
2518
2819
|
/** A read-only attempt's shell (ADR-0046); absent, its runner is given no `run_command`. */
|
|
2519
2820
|
taskShell?: (site: TaskShellSite) => TaskShell | undefined;
|
|
2520
2821
|
/** The session's web fetcher for one read-only attempt (ADR-0046); absent, its `fetch` and `web_search` are not available. */
|
|
@@ -2556,6 +2857,8 @@ interface TaskOrchestratorOptions {
|
|
|
2556
2857
|
plannedWith?: () => boolean;
|
|
2557
2858
|
/** Every task is approved unless a Session supplies its record: an orchestrator on its own has no user to ask. */
|
|
2558
2859
|
isApproved?: (taskId: string) => boolean;
|
|
2860
|
+
/** Whether this node's mandate lets an automatic merge run; true unless set. */
|
|
2861
|
+
mayMergeUnasked?: () => boolean;
|
|
2559
2862
|
taskShell?: (site: TaskShellSite) => TaskShell | undefined;
|
|
2560
2863
|
taskWebFetcher?: (task: string) => IWebFetcher | undefined;
|
|
2561
2864
|
keepPatch?: (taskId: string, attempt: number, patch: Buffer) => string;
|
|
@@ -2589,6 +2892,10 @@ declare class TaskOrchestrator {
|
|
|
2589
2892
|
private runState;
|
|
2590
2893
|
/** Planner turns in flight that new starts wait for (ADR-0029); running attempts carry on. */
|
|
2591
2894
|
private startHolds;
|
|
2895
|
+
/** The judgement a {@link judgingOnce} read shares, while one runs. */
|
|
2896
|
+
private judgement;
|
|
2897
|
+
/** The {@link revertReach} of each revert under way: unlike a hold, it stops a start admitted before the revert too. */
|
|
2898
|
+
private readonly reverting;
|
|
2592
2899
|
/** Bumped by the user's Stop: a start admitted under an older generation never takes its claim. */
|
|
2593
2900
|
private stopGeneration;
|
|
2594
2901
|
/** Starts admitted and not yet claimed or let go; see {@link StartAdmission}. */
|
|
@@ -2625,6 +2932,16 @@ declare class TaskOrchestrator {
|
|
|
2625
2932
|
private queuedStarts;
|
|
2626
2933
|
/** Conflict repairs owed with every slot taken and no scheduler to claim them: a freed slot starts them. */
|
|
2627
2934
|
private owedRepairs;
|
|
2935
|
+
/**
|
|
2936
|
+
* The checks whose loop goes on with no scheduler: each failed a round in a
|
|
2937
|
+
* run the scheduler was not driving, so nothing else would start what it
|
|
2938
|
+
* owes (ADR-0045 L5). Held here and not on the plan, because a Stop ends it
|
|
2939
|
+
* and a reload does not bring it back; an edit does neither. A loop stopped
|
|
2940
|
+
* by its body stays here, so a retry of that task resumes it (L7).
|
|
2941
|
+
*/
|
|
2942
|
+
private readonly carriedLoops;
|
|
2943
|
+
/** What was last said of a carried loop's approvals, so it is said once. */
|
|
2944
|
+
private loopNotice;
|
|
2628
2945
|
/**
|
|
2629
2946
|
* Tasks Mark complete is landing after it ended their attempt, or that
|
|
2630
2947
|
* their conflict resolver is landing, and that landing: in progress with
|
|
@@ -2649,6 +2966,7 @@ declare class TaskOrchestrator {
|
|
|
2649
2966
|
private previousRounds;
|
|
2650
2967
|
private runSettings;
|
|
2651
2968
|
private isApproved;
|
|
2969
|
+
private mayMergeUnasked;
|
|
2652
2970
|
constructor(deps: TaskOrchestratorDeps);
|
|
2653
2971
|
/**
|
|
2654
2972
|
* The composition root: resolves every optional collaborator and wires the
|
|
@@ -2716,6 +3034,10 @@ declare class TaskOrchestrator {
|
|
|
2716
3034
|
get isReviewApproved(): boolean;
|
|
2717
3035
|
/** The scheduler is driving the plan: ready tasks start on their own as slots free. Narrower than {@link isRunning}. */
|
|
2718
3036
|
get isScheduling(): boolean;
|
|
3037
|
+
/** A scheduled run, driving the plan or held by a usage limit that gives it back: a hold never closes one. */
|
|
3038
|
+
get scheduledRun(): boolean;
|
|
3039
|
+
/** A usage limit holds the run, whatever it goes back to at the reset. */
|
|
3040
|
+
get runHeld(): boolean;
|
|
2719
3041
|
/**
|
|
2720
3042
|
* A full-plan run with nothing starting that something still resumes: a
|
|
2721
3043
|
* usage limit's reset, or a retry of a failed task its blocked tasks wait on.
|
|
@@ -2726,6 +3048,8 @@ declare class TaskOrchestrator {
|
|
|
2726
3048
|
/** Task id → session id of every attempt whose runner is up; a spawn in flight has no session yet. */
|
|
2727
3049
|
get activeSessionMap(): Map<string, string>;
|
|
2728
3050
|
getAttempt(taskId: string): TaskAttemptSnapshot | undefined;
|
|
3051
|
+
/** The number of the task's latest attempt, live or ended; 0 before any ran. */
|
|
3052
|
+
latestAttempt(task: Readonly<Task>): number;
|
|
2729
3053
|
/** A planner turn holds new starts: what is ready starts when it releases them. */
|
|
2730
3054
|
get startsHeld(): boolean;
|
|
2731
3055
|
/**
|
|
@@ -2745,11 +3069,19 @@ declare class TaskOrchestrator {
|
|
|
2745
3069
|
* Something can still start that nobody has to ask for again: a start
|
|
2746
3070
|
* admitted and not yet claimed, a force start queued behind its
|
|
2747
3071
|
* dependencies, a conflict repair owed a slot or the end of a start hold,
|
|
2748
|
-
* a task that resumes on its own at its usage limit's reset,
|
|
2749
|
-
* dirty checkout parked for Stash and continue to replay
|
|
2750
|
-
* it, whether or not anything runs.
|
|
3072
|
+
* a task that resumes on its own at its usage limit's reset, a start a
|
|
3073
|
+
* dirty checkout parked for Stash and continue to replay, or a loop carried
|
|
3074
|
+
* on with no scheduler. A Stop is owed to it, whether or not anything runs.
|
|
3075
|
+
* A carried loop a body task stopped starts nothing, so it is not here: see
|
|
3076
|
+
* {@link loopCarried}.
|
|
2751
3077
|
*/
|
|
2752
3078
|
get startsPending(): boolean;
|
|
3079
|
+
/**
|
|
3080
|
+
* A loop is carried on, one a body task stopped included. Nothing of that
|
|
3081
|
+
* one starts by itself, so nothing here moves a task on, but a retry that
|
|
3082
|
+
* passes would resume it: a Stop is owed to it too (ADR-0045 L7).
|
|
3083
|
+
*/
|
|
3084
|
+
get loopCarried(): boolean;
|
|
2753
3085
|
/**
|
|
2754
3086
|
* The plan's activity as one word for every surface: a start on its way,
|
|
2755
3087
|
* work running, a scheduler driving the plan, or a run that resumes by
|
|
@@ -2769,7 +3101,9 @@ declare class TaskOrchestrator {
|
|
|
2769
3101
|
*/
|
|
2770
3102
|
get advancesOnItsOwn(): boolean;
|
|
2771
3103
|
/** A start admitted now that nothing has to count as live work: one that claims before it awaits, or follows on from one that did. */
|
|
2772
|
-
|
|
3104
|
+
admittedNow(): Admitted;
|
|
3105
|
+
/** The user's Stop found nothing to stop: it still withdraws every start admitted before it, one no live work counts included (ADR-0029). */
|
|
3106
|
+
stopAsked(): void;
|
|
2773
3107
|
/** Run `work`, which awaits before it claims, under an admission it holds throughout and claims under. */
|
|
2774
3108
|
private whileAdmitted;
|
|
2775
3109
|
/**
|
|
@@ -2787,6 +3121,13 @@ declare class TaskOrchestrator {
|
|
|
2787
3121
|
* over as before.
|
|
2788
3122
|
*/
|
|
2789
3123
|
private closeRun;
|
|
3124
|
+
/**
|
|
3125
|
+
* Whether closing the run merges what landed, with nobody asked. The run
|
|
3126
|
+
* says it has ended before it closes, and a list read in between must not
|
|
3127
|
+
* name a Merge all it is about to do itself (ADR-0053). A Stop takes the run
|
|
3128
|
+
* out of isolating and a merge that stopped blocks this, so neither wait is hidden.
|
|
3129
|
+
*/
|
|
3130
|
+
get mergesAtClose(): boolean;
|
|
2790
3131
|
/**
|
|
2791
3132
|
* The run as a surface offers Merge all mid-run (ADR-0020): what has landed
|
|
2792
3133
|
* and is not merged, and whether the run is paused at its gates with nothing
|
|
@@ -2809,9 +3150,41 @@ declare class TaskOrchestrator {
|
|
|
2809
3150
|
* Takes the task, not its id: the one the command seam located.
|
|
2810
3151
|
*/
|
|
2811
3152
|
startWaits(task: Readonly<Task>, forced?: ForcedStart): StartWait[];
|
|
3153
|
+
/** Every task's {@link startWaits}, the plan judged once. */
|
|
3154
|
+
planStartWaits(): Map<string, StartWait[]>;
|
|
3155
|
+
/**
|
|
3156
|
+
* Run `read`, a synchronous read of the plan, on one judgement of it: what a
|
|
3157
|
+
* read asks task by task would otherwise judge the whole plan per task.
|
|
3158
|
+
* Nothing can change the plan inside it, so no answer can be stale.
|
|
3159
|
+
*/
|
|
3160
|
+
judgingOnce<T>(read: () => T): T;
|
|
2812
3161
|
private startRule;
|
|
3162
|
+
/**
|
|
3163
|
+
* Why no resolver may be added to this task's conflict now, or null: a
|
|
3164
|
+
* conflict has one worker (ADR-0015), so a repair or a resolver that has it
|
|
3165
|
+
* keeps it. The words are for whoever asked, since a surface may still offer
|
|
3166
|
+
* the action from a status update it has not yet replaced.
|
|
3167
|
+
*/
|
|
3168
|
+
resolverRefusal(taskId: string): string | null;
|
|
3169
|
+
/** What the conflict repair this task is owed waits for; null when no repair will start by itself. */
|
|
3170
|
+
repairWait(taskId: string): RepairWait | null;
|
|
3171
|
+
/** A usage limit keeps this task from starting by itself: the hold on the run, or its own runner's limit with no reset to wait for. */
|
|
3172
|
+
private onUsageLimit;
|
|
3173
|
+
/** Where a task's isolated work stands, and who has its conflict: the record says the first, the scheduler the second. */
|
|
3174
|
+
taskIsolation(taskId: string): TaskIsolation | null;
|
|
3175
|
+
/** Each task's isolation mark and the run's handoff, as {@link taskIsolation} reads them. */
|
|
3176
|
+
isolationView(): IsolationView | null;
|
|
3177
|
+
private withConflictWorker;
|
|
3178
|
+
/**
|
|
3179
|
+
* A repair will start by itself: the task is not started, it has one left,
|
|
3180
|
+
* and something will claim it, the scheduler or {@link owedRepairs}. Nothing
|
|
3181
|
+
* saves this: a reload or a Stop leaves the conflict waiting on the user.
|
|
3182
|
+
*/
|
|
3183
|
+
private owesRepair;
|
|
2813
3184
|
/** The failed tasks a task not started yet waits on, through its dependencies (ADR-0034); empty when it is not blocked. */
|
|
2814
3185
|
getBlockedBy(taskId: string): string[];
|
|
3186
|
+
/** Throws what {@link loadPlan} would, for a caller with work of its own to do before it loads. */
|
|
3187
|
+
assertLoadable(tasks: readonly Task[], planRunners?: RunnerId[]): void;
|
|
2815
3188
|
/**
|
|
2816
3189
|
* `edited`: the plan is the last one edited, not a new one. Only a Stop
|
|
2817
3190
|
* withdraws a queued start (ADR-0035), so one of a task the edit keeps
|
|
@@ -2825,8 +3198,9 @@ declare class TaskOrchestrator {
|
|
|
2825
3198
|
* reload would clear the holds and the review approval, so a task the user
|
|
2826
3199
|
* cancelled would be re-armed by the tick that follows, and a retry after
|
|
2827
3200
|
* the edit would run the failed task alone, its failure lost. Otherwise it
|
|
2828
|
-
* is the plan the next run starts from, with
|
|
2829
|
-
*
|
|
3201
|
+
* is the plan the next run starts from, with a failed task still failed and
|
|
3202
|
+
* what waits on the user still waiting: an edit between runs is not the user
|
|
3203
|
+
* starting over.
|
|
2830
3204
|
*/
|
|
2831
3205
|
adoptEdit(tasks: readonly Task[], planRunners: RunnerId[]): void;
|
|
2832
3206
|
/**
|
|
@@ -2841,37 +3215,51 @@ declare class TaskOrchestrator {
|
|
|
2841
3215
|
* input it waits at — adopting the snapshot's "pending" would offer the
|
|
2842
3216
|
* scheduler work a runner is already doing.
|
|
2843
3217
|
*
|
|
2844
|
-
* A failed task stays failed
|
|
2845
|
-
*
|
|
3218
|
+
* A failed task stays failed: an edit is not a retry, and the tasks it blocks
|
|
3219
|
+
* wait for that retry (ADR-0034). One the edit made manual has no retry to wait for.
|
|
2846
3220
|
*/
|
|
2847
3221
|
reconcilePlan(newTasks: readonly Task[], planRunners?: RunnerId[]): void;
|
|
2848
3222
|
/**
|
|
2849
3223
|
* An edit landed on the plan — a planner's task ops through
|
|
2850
3224
|
* {@link reconcilePlan}, or the user's direct edit through the PlanEditor.
|
|
2851
|
-
*
|
|
2852
|
-
*
|
|
2853
|
-
*
|
|
2854
|
-
*
|
|
2855
|
-
*
|
|
3225
|
+
* A task it made manual is the manual task it now is (ADR-0053), a runner
|
|
3226
|
+
* still at a question apart. One that leaves a loop's check out of rounds
|
|
3227
|
+
* ends the loop (ADR-0045 L6): what of its body has not run will not run,
|
|
3228
|
+
* and, while the run is under way, the check settles once more so the
|
|
3229
|
+
* supervisor hears the end. Nothing else notices such an edit: the check
|
|
3230
|
+
* settled when it failed a round, and no round will run it again.
|
|
2856
3231
|
*/
|
|
2857
3232
|
planEdited(before: readonly Task[]): void;
|
|
2858
3233
|
/**
|
|
2859
|
-
* Begin the full-plan run afresh, as Execute does with
|
|
2860
|
-
* Whatever an earlier run left goes: its state,
|
|
2861
|
-
*
|
|
2862
|
-
*
|
|
3234
|
+
* Begin the full-plan run afresh, as Execute does with no open run to join.
|
|
3235
|
+
* Whatever an earlier run left goes: its state, which {@link start} would
|
|
3236
|
+
* take as a run already under way; its scheduled resumes and execution log;
|
|
3237
|
+
* and, as the plan is loaded over
|
|
2863
3238
|
* itself, its retry counts, holds, loop rounds and review approval. Every
|
|
2864
3239
|
* task not done is ready to run again, and the scheduler starts it; a plan
|
|
2865
|
-
* with nothing left to run ends at once, and the scheduler says so
|
|
3240
|
+
* with nothing left to run ends at once, and the scheduler says so, but for
|
|
3241
|
+
* `keepFailed`: failures nobody asked this run to try again (ADR-0030).
|
|
2866
3242
|
*/
|
|
2867
|
-
beginRun(origin: RunOrigin): Promise<void>;
|
|
3243
|
+
beginRun(origin: RunOrigin, keepFailed?: ReadonlySet<string>): Promise<void>;
|
|
2868
3244
|
/**
|
|
2869
3245
|
* Take the plan into the run under way (#95), whose tasks were approved
|
|
2870
3246
|
* first: a scheduled run starts them as their dependencies finish, and one
|
|
2871
3247
|
* the scheduler was not driving — tasks started on their own — becomes the
|
|
2872
|
-
* plan's run, as Execute would make it.
|
|
3248
|
+
* plan's run, as Execute would make it. A hold starts nothing either way:
|
|
3249
|
+
* the plan's run is what its reset gives back (ADR-0018 U1). A start a dirty
|
|
3250
|
+
* checkout parked in a scheduled run is replayed, which reads the checkout
|
|
3251
|
+
* again; a new run would take back the run's failures (ADR-0053).
|
|
2873
3252
|
*/
|
|
2874
3253
|
joinRun(origin: RunOrigin): Promise<void>;
|
|
3254
|
+
private joinHold;
|
|
3255
|
+
/**
|
|
3256
|
+
* The user's Execute takes in work the scheduler was not driving: it becomes
|
|
3257
|
+
* the plan's run, so what failed gets the fresh chance Execute gives
|
|
3258
|
+
* (ADR-0053). A scheduled run keeps its failures, which a retry continues
|
|
3259
|
+
* (ADR-0034), and Execute only approves what waits in it: a hold that gives
|
|
3260
|
+
* one back is that run still.
|
|
3261
|
+
*/
|
|
3262
|
+
readyFailed(): void;
|
|
2875
3263
|
/** Start the full-plan run, or continue one that is held or ended on a failure. */
|
|
2876
3264
|
start(origin?: RunOrigin): Promise<void>;
|
|
2877
3265
|
/**
|
|
@@ -2881,6 +3269,18 @@ declare class TaskOrchestrator {
|
|
|
2881
3269
|
* for meanwhile.
|
|
2882
3270
|
*/
|
|
2883
3271
|
stop(reason?: 'user' | 'restart'): void;
|
|
3272
|
+
/**
|
|
3273
|
+
* Nothing claims a repair once the run has stopped, so what was owed one is
|
|
3274
|
+
* a conflict waiting on the user, listed with its options, not a task that
|
|
3275
|
+
* reads as never started.
|
|
3276
|
+
*/
|
|
3277
|
+
private withdrawRepairs;
|
|
3278
|
+
/**
|
|
3279
|
+
* A force start behind a dependency lifted a reverted task's hold for that
|
|
3280
|
+
* start alone, in the queue or left to the scheduler. With the start
|
|
3281
|
+
* withdrawn, the task stays what the user took back (ADR-0054).
|
|
3282
|
+
*/
|
|
3283
|
+
private withdrawQueuedStarts;
|
|
2884
3284
|
private chosenHoldsNow;
|
|
2885
3285
|
private restoreHolds;
|
|
2886
3286
|
private releaseUnchosenHolds;
|
|
@@ -2942,13 +3342,26 @@ declare class TaskOrchestrator {
|
|
|
2942
3342
|
* Work that did not land waits on the user — it never fails the task or
|
|
2943
3343
|
* blocks its dependents — unless its conflict is owed a repair, which takes
|
|
2944
3344
|
* the slot the ending attempt freed and never one more than the run allows.
|
|
2945
|
-
* A planner turn's start hold holds it as it holds any new spawn (ADR-0029)
|
|
2946
|
-
*
|
|
2947
|
-
*
|
|
3345
|
+
* A planner turn's start hold holds it as it holds any new spawn (ADR-0029),
|
|
3346
|
+
* and a usage limit does too: `reopen` spends a repair, so one the runner
|
|
3347
|
+
* would refuse is not tried. The repair follows on from the start whose work
|
|
3348
|
+
* it repairs: a Stop since that was admitted withdraws it.
|
|
2948
3349
|
*/
|
|
2949
3350
|
private settleUnlanded;
|
|
2950
3351
|
/** Start the repairs {@link settleUnlanded} left owed, as slots and any start hold allow. */
|
|
2951
3352
|
private startOwedRepairs;
|
|
3353
|
+
/**
|
|
3354
|
+
* A conflict ended some other way than through its resolver: the task
|
|
3355
|
+
* landed, was retried or skipped, or left the plan. The merge the resolver
|
|
3356
|
+
* was added for is no longer needed, so it goes with its link: skipped,
|
|
3357
|
+
* with why, and never started (ADR-0015).
|
|
3358
|
+
*/
|
|
3359
|
+
private retireResolvers;
|
|
3360
|
+
private retireResolver;
|
|
3361
|
+
/** A planner's remove reaches no {@link releaseTask}: what it took out of the plan since `before` ends its conflicts here. */
|
|
3362
|
+
private retireResolversLeft;
|
|
3363
|
+
/** A control that would end a conflict waits for the resolver at work on it: a conflict has one worker (ADR-0015). */
|
|
3364
|
+
private refuseBesideResolver;
|
|
2952
3365
|
private landResolved;
|
|
2953
3366
|
/**
|
|
2954
3367
|
* Hold a task for as long as `landing` is merging its worktree. Its end lets
|
|
@@ -2959,6 +3372,10 @@ declare class TaskOrchestrator {
|
|
|
2959
3372
|
getReadyTasks(): Task[];
|
|
2960
3373
|
private readiness;
|
|
2961
3374
|
private mergesAutomatically;
|
|
3375
|
+
/** A Merge all is under way. */
|
|
3376
|
+
get isMerging(): boolean;
|
|
3377
|
+
/** A gate reached now is merged with nobody asked: the setting is on, and no merge has stopped it. */
|
|
3378
|
+
get mergesAtGates(): boolean;
|
|
2962
3379
|
/**
|
|
2963
3380
|
* The user changed the run settings under an open run (ADR-0030). The
|
|
2964
3381
|
* scheduler reads them at each decision it makes from them, so a merge gate
|
|
@@ -2993,6 +3410,7 @@ declare class TaskOrchestrator {
|
|
|
2993
3410
|
* Cancel a running (or scheduled) task: kill its session and return it to
|
|
2994
3411
|
* 'pending' — "not executed". The task is put on hold so the scheduler
|
|
2995
3412
|
* doesn't immediately restart it; Retry / Force Start release the hold.
|
|
3413
|
+
* A repair, running or owed a start, leaves its conflict waiting instead.
|
|
2996
3414
|
*
|
|
2997
3415
|
* The attempt's worktree is kept, as a stopped or failed one is: a runner is
|
|
2998
3416
|
* often cancelled because it looked stuck after doing the work, and Mark
|
|
@@ -3028,6 +3446,33 @@ declare class TaskOrchestrator {
|
|
|
3028
3446
|
* to waiting on their own, because the scheduler gates on `isCompleted`.
|
|
3029
3447
|
*/
|
|
3030
3448
|
markTaskIncomplete(taskId: string): Promise<void>;
|
|
3449
|
+
/**
|
|
3450
|
+
* What reverting a task would take, and what stands in its way, as far as
|
|
3451
|
+
* the plan can say (ADR-0054); {@link revertPreview} and the revert itself
|
|
3452
|
+
* ask git the rest.
|
|
3453
|
+
*/
|
|
3454
|
+
revertScope(taskId: string): RevertScope;
|
|
3455
|
+
/** What a revert of the task would do now: the tasks, newest landing first, or why it would not go ahead. */
|
|
3456
|
+
revertPreview(taskId: string): Promise<TaskRevertPreview>;
|
|
3457
|
+
/**
|
|
3458
|
+
* Revert the task's landed work, with its landed dependents, on the
|
|
3459
|
+
* integration branches (ADR-0054). No new start while it waits for its
|
|
3460
|
+
* turn and works: one that took its claim now would be cut from a tip about
|
|
3461
|
+
* to lose what it depends on, so the claim of anything depending on the work
|
|
3462
|
+
* is refused too, a start admitted before the revert with it. What it finds
|
|
3463
|
+
* in the way there is judged again: a Mark complete landing a dependent is
|
|
3464
|
+
* live like any other. Tasks not depending on it keep running.
|
|
3465
|
+
*/
|
|
3466
|
+
revertTask(taskId: string): Promise<IsolationRevertResult>;
|
|
3467
|
+
private revertRefusalNow;
|
|
3468
|
+
/**
|
|
3469
|
+
* Each reverted task goes back to not started, held like a stopped one so
|
|
3470
|
+
* the scheduler does not run it again, and starts over when retried: from
|
|
3471
|
+
* the current tip, which no longer holds its work. Its completion goes as
|
|
3472
|
+
* Mark not done takes one back; the logs of its attempts stay. A conflict it
|
|
3473
|
+
* held is over, so a resolver out to it goes too (ADR-0015).
|
|
3474
|
+
*/
|
|
3475
|
+
private takeBack;
|
|
3031
3476
|
/**
|
|
3032
3477
|
* Skip: end a task as `skipped`, with no verdict and nothing of its work
|
|
3033
3478
|
* landed. Its worktree is kept, as a failed attempt's is, so the user can
|
|
@@ -3044,8 +3489,10 @@ declare class TaskOrchestrator {
|
|
|
3044
3489
|
* the task ended in rather than a fresh one given its prompt again. The
|
|
3045
3490
|
* worktree keeps the same path, where the runner keeps its sessions, and
|
|
3046
3491
|
* restores the previous work so that session's memory matches its files.
|
|
3492
|
+
* `revives` is {@link claimRefusal}'s, read as the start is asked for: a dirty
|
|
3493
|
+
* tree's replay carries the first answer, not one read after a skip.
|
|
3047
3494
|
*/
|
|
3048
|
-
continueTask(taskId: string, message: string, origin?: RunOrigin): Promise<void>;
|
|
3495
|
+
continueTask(taskId: string, message: string, origin?: RunOrigin, revives?: boolean): Promise<void>;
|
|
3049
3496
|
/**
|
|
3050
3497
|
* Keep a task paused on its runner's usage limit from resuming on its own:
|
|
3051
3498
|
* it waits for a manual retry, as one whose reset time could not be read
|
|
@@ -3108,9 +3555,9 @@ declare class TaskOrchestrator {
|
|
|
3108
3555
|
* Reuses the scheduler's own claim so a force-started task gets the same
|
|
3109
3556
|
* augmented prompt, session tracking, and exit handling — callers must not
|
|
3110
3557
|
* re-spawn the runner themselves. No-op if the task is unknown, a user
|
|
3111
|
-
* task, or already running.
|
|
3558
|
+
* task, or already running. `revives` is as on {@link continueTask}.
|
|
3112
3559
|
*/
|
|
3113
|
-
forceStartTask(taskId: string, origin?: RunOrigin): Promise<string | undefined>;
|
|
3560
|
+
forceStartTask(taskId: string, origin?: RunOrigin, revives?: boolean): Promise<string | undefined>;
|
|
3114
3561
|
/**
|
|
3115
3562
|
* Start an approved task once its merge gate opens, never past it: a script
|
|
3116
3563
|
* task `run_script` added behind work not merged into the user's branch yet
|
|
@@ -3119,6 +3566,17 @@ declare class TaskOrchestrator {
|
|
|
3119
3566
|
* so it starts once Merge all has merged that work, and a Stop withdraws it.
|
|
3120
3567
|
*/
|
|
3121
3568
|
startAtGate(taskId: string): void;
|
|
3569
|
+
/** A start of this task waits in the queue, and starts with nobody asked once what holds it clears. */
|
|
3570
|
+
startQueuedFor(taskId: string): boolean;
|
|
3571
|
+
/**
|
|
3572
|
+
* Start a task the user's own act asked for, under the one start rule and
|
|
3573
|
+
* past none of it (ADR-0015). A scheduler driving the run claims it as it
|
|
3574
|
+
* would any task; otherwise it waits with the queued starts for a slot, a
|
|
3575
|
+
* start hold or a usage limit, says what holds it, and a Stop withdraws it.
|
|
3576
|
+
* A conflict repair is started the same way, and this is what a resolver
|
|
3577
|
+
* added outside a run has in place of one.
|
|
3578
|
+
*/
|
|
3579
|
+
startWhenAllowed(taskId: string): void;
|
|
3122
3580
|
/**
|
|
3123
3581
|
* A forced start, from its run opening to its claim. It is judged again once
|
|
3124
3582
|
* the run has opened, against the task as it stands then, which is what
|
|
@@ -3159,6 +3617,9 @@ declare class TaskOrchestrator {
|
|
|
3159
3617
|
private holdsQueued;
|
|
3160
3618
|
private slotsFull;
|
|
3161
3619
|
private sayQueuedAtGate;
|
|
3620
|
+
/** A start asked for under the whole rule that the rule holds back, in words the user can act on; a turn's hold ends by itself. */
|
|
3621
|
+
private sayQueuedHeld;
|
|
3622
|
+
private sayOnce;
|
|
3162
3623
|
private refuseOpsDuringMerge;
|
|
3163
3624
|
/**
|
|
3164
3625
|
* A force start passes a merge gate (ADR-0020), and the surface confirmed it
|
|
@@ -3172,6 +3633,8 @@ declare class TaskOrchestrator {
|
|
|
3172
3633
|
isAnyFailed(): boolean;
|
|
3173
3634
|
approveReview(origin?: RunOrigin): Promise<void>;
|
|
3174
3635
|
tick(): Promise<void>;
|
|
3636
|
+
/** One of a tick's starters: takes the next of `waiting` as each start it made has attached. */
|
|
3637
|
+
private startReady;
|
|
3175
3638
|
/**
|
|
3176
3639
|
* The one step that decides, with nothing at work and nothing the scheduler
|
|
3177
3640
|
* can start, whether the run goes on, is held, waits on the user or is over
|
|
@@ -3179,9 +3642,11 @@ declare class TaskOrchestrator {
|
|
|
3179
3642
|
* only an end emits it. A run the scheduler is not driving — tasks started
|
|
3180
3643
|
* on their own — ends on a verdict; a cancel, Mark complete or failed spawn
|
|
3181
3644
|
* just closes it, so the next run decides its own mode rather than inherit
|
|
3182
|
-
* this one's.
|
|
3645
|
+
* this one's. A loop carried on outside a scheduled run holds that run open
|
|
3646
|
+
* as a scheduled one is held, on whatever the start rule waits for.
|
|
3183
3647
|
*/
|
|
3184
3648
|
private settleRun;
|
|
3649
|
+
private waitOnUser;
|
|
3185
3650
|
/**
|
|
3186
3651
|
* A loop's check failed (ADR-0045). With `failed` evidence and rounds left,
|
|
3187
3652
|
* a round starts: its body runs again as new attempts, each from the
|
|
@@ -3189,7 +3654,9 @@ declare class TaskOrchestrator {
|
|
|
3189
3654
|
* the failure is the round's, not the task's. Approval is not spent by a
|
|
3190
3655
|
* run, so the plan's approval of the body covers every round. Out of
|
|
3191
3656
|
* rounds, the body still to run will not run. A body task the user skipped
|
|
3192
|
-
* has stopped the loop (L7): no round starts, and the skip stands.
|
|
3657
|
+
* has stopped the loop (L7): no round starts, and the skip stands. One they
|
|
3658
|
+
* reverted keeps its hold, which a round takes as any start does (L5, ADR-0054):
|
|
3659
|
+
* the rest of the body runs, and the loop waits for them to say.
|
|
3193
3660
|
*/
|
|
3194
3661
|
private startRound;
|
|
3195
3662
|
/**
|
|
@@ -3205,6 +3672,39 @@ declare class TaskOrchestrator {
|
|
|
3205
3672
|
* complete, a reload in between — resumes the loop alike.
|
|
3206
3673
|
*/
|
|
3207
3674
|
private repeatChecks;
|
|
3675
|
+
private repeatCheck;
|
|
3676
|
+
/**
|
|
3677
|
+
* Something will run this check between rounds without being asked: a
|
|
3678
|
+
* scheduler, the one a reset gives back, or its loop carried on (ADR-0045
|
|
3679
|
+
* L5). What the seam reads before it says so to anyone.
|
|
3680
|
+
*/
|
|
3681
|
+
loopRunsOn(checkId: string): boolean;
|
|
3682
|
+
/** A start of this task would be its loop's next round: between rounds, its body landed, and nothing else will run it. */
|
|
3683
|
+
private ownsNextRound;
|
|
3684
|
+
/** A check between rounds that nothing will run: it waits on a person, its failure no longer one its loop answers (ADR-0045 L5, ADR-0053). */
|
|
3685
|
+
loopStranded(taskId: string): boolean;
|
|
3686
|
+
/** A tick starts something: the scheduler the plan, or the loops carried on, their tasks alone. */
|
|
3687
|
+
private get startsOnTick();
|
|
3688
|
+
/**
|
|
3689
|
+
* The carried loops with work owed now: a check between rounds whose loop
|
|
3690
|
+
* goes on, or a round waiting to start. None under a scheduler, which owes
|
|
3691
|
+
* them itself, or while a usage limit holds the run, which starts nothing.
|
|
3692
|
+
* One a body task stopped is not here until that task passes (L7).
|
|
3693
|
+
*/
|
|
3694
|
+
private loopsCarriedOn;
|
|
3695
|
+
/**
|
|
3696
|
+
* The run that carried them is over, by a Stop or by what gives the run up
|
|
3697
|
+
* or clears it up: a retry of a body task that passes runs that task alone.
|
|
3698
|
+
*/
|
|
3699
|
+
private endCarriedLoops;
|
|
3700
|
+
/** What a tick may start with no scheduler: the loops carried on, and nothing that depends on them. */
|
|
3701
|
+
carriedTasks(): Set<string>;
|
|
3702
|
+
/**
|
|
3703
|
+
* A task of a carried loop outside the user's approval record waits as any
|
|
3704
|
+
* does (ADR-0045, Consent). Said here, once, as well as listed: a run they
|
|
3705
|
+
* started one task of says nothing else of why the loop's next step does not come.
|
|
3706
|
+
*/
|
|
3707
|
+
private sayUnapprovedInLoop;
|
|
3208
3708
|
/** Skipped work is not completed work, so a run with any says so rather than that everything completed. */
|
|
3209
3709
|
private sayFinished;
|
|
3210
3710
|
/** How a run that ended on failures ends: what it finished, what failed, and what that blocks. */
|
|
@@ -3219,9 +3719,14 @@ declare class TaskOrchestrator {
|
|
|
3219
3719
|
/**
|
|
3220
3720
|
* Why a start may not take its claim now, or null when it may: a Stop came
|
|
3221
3721
|
* since it was admitted (ADR-0029), the task left the plan or is being
|
|
3222
|
-
* marked complete,
|
|
3223
|
-
*
|
|
3224
|
-
*
|
|
3722
|
+
* marked complete, a resolver has its conflict, so a start of it would be a
|
|
3723
|
+
* second worker on it (ADR-0015), a revert is taking back work it depends on
|
|
3724
|
+
* or skipped it since (ADR-0054), it
|
|
3725
|
+
* is outside the user's approval record (ADR-0035), or every slot is taken.
|
|
3726
|
+
* Read in the same synchronous step as the claim it
|
|
3727
|
+
* guards, so nothing can change in between. `revives` is a start asked of a
|
|
3728
|
+
* task already skipped, as a force start or a continue may be: only that runs
|
|
3729
|
+
* one again. A retry has made it pending by the time it claims.
|
|
3225
3730
|
*/
|
|
3226
3731
|
private claimRefusal;
|
|
3227
3732
|
/** An explicit start's refusal, before it changes anything: its caller's answer, as a {@link TaskControlError}. */
|
|
@@ -3244,10 +3749,196 @@ declare class TaskOrchestrator {
|
|
|
3244
3749
|
/**
|
|
3245
3750
|
* Replay the start a dirty tree turned away. `stash` puts the user's tracked
|
|
3246
3751
|
* changes on the git stash first, so the run isolates; `shared` runs this one
|
|
3247
|
-
* run in the workspace root, knowingly
|
|
3752
|
+
* run in the workspace root, knowingly; `reread` reads the tree again, which
|
|
3753
|
+
* may turn the start away again.
|
|
3248
3754
|
*/
|
|
3249
|
-
continueBlockedRun(how: 'stash' | 'shared'): Promise<void>;
|
|
3755
|
+
continueBlockedRun(how: 'stash' | 'shared' | 'reread'): Promise<void>;
|
|
3756
|
+
}
|
|
3757
|
+
|
|
3758
|
+
/**
|
|
3759
|
+
* The effect allowlist (ADR-0035): the user's standing approval for named
|
|
3760
|
+
* effects, beside the planner allowlist, which names reads. It pre-approves a
|
|
3761
|
+
* script task whose `commands` are all covered; it never covers a `script`
|
|
3762
|
+
* body, whose shell text no rule can be matched against.
|
|
3763
|
+
*
|
|
3764
|
+
* A rule is matched against the whole command, every word in order and flags
|
|
3765
|
+
* included, because an effect's flags change what it does: `git push origin
|
|
3766
|
+
* feature/*` covers `git push origin feature/login`, never the same push with
|
|
3767
|
+
* `--force`. `*` stands for one word, or inside a word for any run of
|
|
3768
|
+
* characters, as in the planner allowlist, except that it never stands for
|
|
3769
|
+
* what changes the effect: a flag (`--force`, and `/force` on Windows), a
|
|
3770
|
+
* refspec's force or delete (`+main`, `:main`), or a `:` outside a URL
|
|
3771
|
+
* (`feature/x:main`, which pushes to `main`). The rule writes any of those
|
|
3772
|
+
* itself. A rule spells out its operation before any `*`, so
|
|
3773
|
+
* `az webapp config * set` is no rule at all.
|
|
3774
|
+
*
|
|
3775
|
+
* Exclusions are the planner allowlist's `!` entries, with any `!` entry
|
|
3776
|
+
* written here; an exclusion wins. A command exclusion is matched as the
|
|
3777
|
+
* planner allowlist matches it; a path or URL exclusion holds for an argument
|
|
3778
|
+
* that names an absolute path or URL it covers, whole or after a `=`, `@`,
|
|
3779
|
+
* `:` or `,` or a short flag (`--url=…`, `-d @…`). A relative path is not
|
|
3780
|
+
* resolved, since the body does not say where it runs. A program named by its
|
|
3781
|
+
* path is a file the repository ships (ADR-0026), so it is never covered.
|
|
3782
|
+
* There are no built-in rules: a default would pre-approve an effect the user
|
|
3783
|
+
* never chose.
|
|
3784
|
+
*/
|
|
3785
|
+
interface EffectRule {
|
|
3786
|
+
text: string;
|
|
3787
|
+
binary: string;
|
|
3788
|
+
words: RuleWord[];
|
|
3789
|
+
}
|
|
3790
|
+
interface EffectRules {
|
|
3791
|
+
rules: EffectRule[];
|
|
3792
|
+
exclusions: PlannerAllowlist;
|
|
3793
|
+
platform: NodeJS.Platform;
|
|
3794
|
+
/** The entries that are no rule, each with the warning that says why it is ignored. */
|
|
3795
|
+
ignored: {
|
|
3796
|
+
rule: string;
|
|
3797
|
+
warning: string;
|
|
3798
|
+
}[];
|
|
3250
3799
|
}
|
|
3800
|
+
/**
|
|
3801
|
+
* `entries` are the effect allowlist's; `plannerEntries` the planner allowlist
|
|
3802
|
+
* in force, whose `!` entries hold here too; `platform` the one the commands
|
|
3803
|
+
* run on, which decides how a flag is spelled and how a path resolves.
|
|
3804
|
+
*/
|
|
3805
|
+
declare function parseEffectAllowlist(entries: readonly string[], plannerEntries?: readonly string[], platform?: NodeJS.Platform): EffectRules;
|
|
3806
|
+
/**
|
|
3807
|
+
* The rules, by name, that cover every command of a `commands` body, or null
|
|
3808
|
+
* when one command is not covered, an exclusion holds for one, or the body is
|
|
3809
|
+
* a `script`.
|
|
3810
|
+
*/
|
|
3811
|
+
declare function effectRuleFor(list: EffectRules, body: ScriptBody): string | null;
|
|
3812
|
+
|
|
3813
|
+
/**
|
|
3814
|
+
* The mandate (ADR-0056): what a node may do without a person, and within what
|
|
3815
|
+
* limits. The root's is derived on each read from today's settings and never
|
|
3816
|
+
* saved; a child's is one pure function of its parent's and its request, which
|
|
3817
|
+
* can only narrow what the parent may hand on. Authority only: capability stays
|
|
3818
|
+
* at the boundary a session runs in, and a prompt enforces nothing.
|
|
3819
|
+
*/
|
|
3820
|
+
declare const GRANTS: readonly ["observe", "steer", "control", "replan", "approve", "delegate", "effect", "research", "merge"];
|
|
3821
|
+
/** Each is a set of things a node may do unasked (M2). */
|
|
3822
|
+
type Grant = (typeof GRANTS)[number];
|
|
3823
|
+
/** What a mandate could not finish without: a child holds these unasked, and `narrow` refuses one that would lack any (M2). */
|
|
3824
|
+
declare const FLOOR_GRANTS: readonly Grant[];
|
|
3825
|
+
/** The shape of a tree, by ADR-0055 D19: refused past the hard cap, never dropped. */
|
|
3826
|
+
declare const SHAPE_LIMITS: {
|
|
3827
|
+
readonly depth: {
|
|
3828
|
+
readonly default: 2;
|
|
3829
|
+
readonly hard: 4;
|
|
3830
|
+
};
|
|
3831
|
+
readonly delegatedTasks: {
|
|
3832
|
+
readonly default: 8;
|
|
3833
|
+
readonly hard: 30;
|
|
3834
|
+
};
|
|
3835
|
+
readonly tasksPerPlan: {
|
|
3836
|
+
readonly default: 30;
|
|
3837
|
+
readonly hard: 100;
|
|
3838
|
+
};
|
|
3839
|
+
};
|
|
3840
|
+
interface MandateLimits {
|
|
3841
|
+
/** The node's token budget; the root's is the tree's, from the delegation setting (M3, M5). */
|
|
3842
|
+
tokens: number;
|
|
3843
|
+
/** Null: no limit, which only the root has. */
|
|
3844
|
+
wallClockMs: number | null;
|
|
3845
|
+
/** How many levels may still open below this node. */
|
|
3846
|
+
depth: number;
|
|
3847
|
+
delegatedTasks: number;
|
|
3848
|
+
tasksPerPlan: number;
|
|
3849
|
+
runners: readonly RunnerId[];
|
|
3850
|
+
/** The models a runner is held to; a runner not named may use any it offers, as the user's allowlist reads. */
|
|
3851
|
+
models: Readonly<Record<RunnerId, readonly string[]>>;
|
|
3852
|
+
}
|
|
3853
|
+
interface MandateExclusions {
|
|
3854
|
+
protectedPaths: readonly string[];
|
|
3855
|
+
}
|
|
3856
|
+
interface Mandate {
|
|
3857
|
+
/** What this node may do. */
|
|
3858
|
+
grants: ReadonlySet<Grant>;
|
|
3859
|
+
/** What it may hand a child. */
|
|
3860
|
+
grantable: ReadonlySet<Grant>;
|
|
3861
|
+
/** Read in place of the global level. */
|
|
3862
|
+
autonomy: 'full' | 'guarded';
|
|
3863
|
+
limits: MandateLimits;
|
|
3864
|
+
/** These only accumulate. */
|
|
3865
|
+
exclusions: MandateExclusions;
|
|
3866
|
+
/** One per level, each with its own `!` rules: a command must match at every level (M4). */
|
|
3867
|
+
effectRules: readonly EffectRules[];
|
|
3868
|
+
}
|
|
3869
|
+
/** What the root's mandate is read from, each where it lives today (M1). */
|
|
3870
|
+
interface RootSettings {
|
|
3871
|
+
/** The run's own copy: where a guard or a failure lowers it, and the user's change lands. */
|
|
3872
|
+
level: SupervisorLevel;
|
|
3873
|
+
autorun: boolean;
|
|
3874
|
+
autonomous: boolean;
|
|
3875
|
+
/** The tree's budget; 0 is delegation off (ADR-0055 D21). */
|
|
3876
|
+
delegationTokens: number;
|
|
3877
|
+
/** The effect allowlist, absent where nothing was read. */
|
|
3878
|
+
effects?: EffectRules;
|
|
3879
|
+
runners: readonly RunnerId[];
|
|
3880
|
+
models: Readonly<Record<RunnerId, readonly string[]>>;
|
|
3881
|
+
}
|
|
3882
|
+
/** What a delegated task asks of the mandate it is given. `grants` names what it asks for past the floor; absent asks for nothing. */
|
|
3883
|
+
interface MandateRequest {
|
|
3884
|
+
/** The level of the node narrowing, the root being 0: the one a refusal names. */
|
|
3885
|
+
level: number;
|
|
3886
|
+
grants?: readonly Grant[];
|
|
3887
|
+
autonomy?: Mandate['autonomy'];
|
|
3888
|
+
/** A delegated task must carry one (M5). */
|
|
3889
|
+
tokens?: number;
|
|
3890
|
+
wallClockMs?: number;
|
|
3891
|
+
depth?: number;
|
|
3892
|
+
delegatedTasks?: number;
|
|
3893
|
+
tasksPerPlan?: number;
|
|
3894
|
+
runners?: readonly RunnerId[];
|
|
3895
|
+
models?: Readonly<Record<RunnerId, readonly string[]>>;
|
|
3896
|
+
protectedPaths?: readonly string[];
|
|
3897
|
+
effectRules?: EffectRules;
|
|
3898
|
+
}
|
|
3899
|
+
interface MandateRefusal {
|
|
3900
|
+
level: number;
|
|
3901
|
+
field: string;
|
|
3902
|
+
asked: string;
|
|
3903
|
+
there: string;
|
|
3904
|
+
}
|
|
3905
|
+
type Narrowed = {
|
|
3906
|
+
ok: true;
|
|
3907
|
+
mandate: Mandate;
|
|
3908
|
+
} | {
|
|
3909
|
+
ok: false;
|
|
3910
|
+
refusal: MandateRefusal;
|
|
3911
|
+
};
|
|
3912
|
+
declare function mandateRefusalText({ level, field, asked, there }: MandateRefusal): string;
|
|
3913
|
+
/**
|
|
3914
|
+
* The root's mandate, as it stands now (M1): built afresh on each read, so an
|
|
3915
|
+
* Act that a guard lowered reads Watch at the next check, and nothing saved
|
|
3916
|
+
* could disagree with the settings.
|
|
3917
|
+
*/
|
|
3918
|
+
declare function rootMandate(settings: RootSettings): Mandate;
|
|
3919
|
+
/**
|
|
3920
|
+
* What holds at a node now (M1): its saved mandate within every ancestor's
|
|
3921
|
+
* `grantable` as it stands, so a change at the root reaches the subtree at the
|
|
3922
|
+
* next check. This reading intersects and refuses nothing: the floor binds
|
|
3923
|
+
* {@link narrow}, which writes a new child, not this.
|
|
3924
|
+
*/
|
|
3925
|
+
declare function heldMandate(saved: Mandate, ancestors: readonly Mandate[]): Mandate;
|
|
3926
|
+
/**
|
|
3927
|
+
* A child's mandate (M4), or the refusal that names the level that refused,
|
|
3928
|
+
* the field, what was asked and what is there. Pure, and written to be proved:
|
|
3929
|
+
* no result is wider than its parent. `parent.limits.tokens` and `wallClockMs`
|
|
3930
|
+
* are what the parent has left, which is the caller's to read.
|
|
3931
|
+
*/
|
|
3932
|
+
declare function narrow(parent: Mandate, request: MandateRequest): Narrowed;
|
|
3933
|
+
/** What a node reads of its own authority, at each check (M1). */
|
|
3934
|
+
interface NodeAuthority {
|
|
3935
|
+
/** How far below the root, which is 0 and where a person remains. */
|
|
3936
|
+
readonly depth: number;
|
|
3937
|
+
/** The mandate that holds now. `level` is what the root's is read at; a child's does not depend on it. */
|
|
3938
|
+
mandate(level: SupervisorLevel): Mandate;
|
|
3939
|
+
}
|
|
3940
|
+
/** The root: its settings read as each check asks, the level included, which each caller names. */
|
|
3941
|
+
declare function rootAuthority(settings: () => Omit<RootSettings, 'level'>): NodeAuthority;
|
|
3251
3942
|
|
|
3252
3943
|
/** One call at the command seam, as every route words it (ADR-0029). Task references are resolved here. */
|
|
3253
3944
|
type ExecutionCommand = {
|
|
@@ -3322,6 +4013,18 @@ type ExecutionCommand = {
|
|
|
3322
4013
|
confirmed?: boolean;
|
|
3323
4014
|
seen?: TaskStatus;
|
|
3324
4015
|
}
|
|
4016
|
+
/**
|
|
4017
|
+
* The user takes a task's landed work off the integration branch, before
|
|
4018
|
+
* Merge all, with its landed dependents (ADR-0054). Needs `confirmed`, their
|
|
4019
|
+
* yes to what the preview listed; `seen` is the task ids it listed, and a
|
|
4020
|
+
* set that changed since is refused.
|
|
4021
|
+
*/
|
|
4022
|
+
| {
|
|
4023
|
+
command: 'revert_task';
|
|
4024
|
+
task: string;
|
|
4025
|
+
confirmed?: boolean;
|
|
4026
|
+
seen?: string[];
|
|
4027
|
+
}
|
|
3325
4028
|
/** Stop a structured task's running turn, keeping its session: it then waits for the user's message. */
|
|
3326
4029
|
| {
|
|
3327
4030
|
command: 'interrupt_task';
|
|
@@ -3395,6 +4098,11 @@ type CommandPayload =
|
|
|
3395
4098
|
| {
|
|
3396
4099
|
kind: 'merge';
|
|
3397
4100
|
result: IsolationMergeResult;
|
|
4101
|
+
}
|
|
4102
|
+
/** The user's `revert_task`, reverted or stopped: which tasks, or the task and files, or the commands that do it by hand. */
|
|
4103
|
+
| {
|
|
4104
|
+
kind: 'revert';
|
|
4105
|
+
result: IsolationRevertResult;
|
|
3398
4106
|
};
|
|
3399
4107
|
/**
|
|
3400
4108
|
* What a call came to: `message` is written for the caller, a model included,
|
|
@@ -3426,19 +4134,6 @@ type Consent = {
|
|
|
3426
4134
|
* body is never covered.
|
|
3427
4135
|
*/
|
|
3428
4136
|
type EffectAllowlist = (body: ScriptBody) => string | null;
|
|
3429
|
-
/**
|
|
3430
|
-
* What a supervisor at `level` may do. The mandate (#23) replaces this check;
|
|
3431
|
-
* nothing above it moves.
|
|
3432
|
-
*/
|
|
3433
|
-
type SupervisorPolicy = (level: SupervisorLevel, command: ExecutionCommandName) => Consent;
|
|
3434
|
-
/**
|
|
3435
|
-
* The supervisor levels (ADR-0029). Off: it does not act. Watch: it reads and
|
|
3436
|
-
* suggests, and every execution command it calls is refused. Act: every
|
|
3437
|
-
* command runs without asking — choosing Act is the consent — inside the loop
|
|
3438
|
-
* guards; what a command may never do, like allowing an approval, is still
|
|
3439
|
-
* refused by the command itself.
|
|
3440
|
-
*/
|
|
3441
|
-
declare const SUPERVISOR_LEVELS: SupervisorPolicy;
|
|
3442
4137
|
/**
|
|
3443
4138
|
* A check that stops an actor spinning (ADR-0029's loop guards): the trip —
|
|
3444
4139
|
* the note naming the guard and what would be accepted, and what the user is
|
|
@@ -3467,6 +4162,8 @@ interface ExecutionHost {
|
|
|
3467
4162
|
waitsForApproval(taskId: string): boolean;
|
|
3468
4163
|
/** A start the user consented to approves these tasks, before it acts. */
|
|
3469
4164
|
approve(taskIds: readonly string[]): void;
|
|
4165
|
+
/** A start under Full with autorun makes the plan approved, as autorun's own start does, so nothing later in the session is refused for it (ADR-0030). */
|
|
4166
|
+
approvePlan(): void;
|
|
3470
4167
|
/** Full autonomy: starts follow plan approval without a question. */
|
|
3471
4168
|
autonomous(): boolean;
|
|
3472
4169
|
/** The user's autorun setting, as it is now (ADR-0030). */
|
|
@@ -3477,14 +4174,28 @@ interface ExecutionHost {
|
|
|
3477
4174
|
startsHeld(): boolean;
|
|
3478
4175
|
/** Work is running right now. */
|
|
3479
4176
|
hasLiveWork(): boolean;
|
|
4177
|
+
/** A usage limit holds the run: what it paused resumes at the reset. */
|
|
4178
|
+
runHeld(): boolean;
|
|
4179
|
+
/** A scheduled run is open, driving the plan or held by a usage limit that gives it back, whether or not anything is live. */
|
|
4180
|
+
scheduledRun(): boolean;
|
|
3480
4181
|
/** Something will start without being asked again: a start admitted and not yet claimed, or a scheduled resume. */
|
|
3481
4182
|
startsPending(): boolean;
|
|
4183
|
+
/** A plan the turn in flight submitted, whose start autorun makes as the turn ends (ADR-0030): a start on its way that no run holds yet. */
|
|
4184
|
+
submittedStartWaits(): boolean;
|
|
4185
|
+
/** A loop is carried on, one a body task stopped included; see {@link TaskOrchestrator.loopCarried}. */
|
|
4186
|
+
loopCarried(): boolean;
|
|
4187
|
+
/** A run with nothing starting that something still resumes: a usage limit's reset, or a retry of a failure; see {@link TaskOrchestrator.awaitsResume}. */
|
|
4188
|
+
awaitsResume(): boolean;
|
|
4189
|
+
/** Something will run this loop's check between rounds without being asked; see {@link TaskOrchestrator.loopRunsOn}. */
|
|
4190
|
+
loopRunsOn(taskId: string): boolean;
|
|
3482
4191
|
/** Something could move a task on without being asked: a start, an attempt in any phase, the scheduler or a usage-limit hold. */
|
|
3483
4192
|
advancesOnItsOwn(): boolean;
|
|
3484
4193
|
/** Admit a start that waits before it claims; see {@link StartAdmission}. */
|
|
3485
4194
|
admitStart(): StartAdmission;
|
|
3486
4195
|
/** The task's attempt is live: starting, running or landing. */
|
|
3487
4196
|
running(taskId: string): boolean;
|
|
4197
|
+
/** A conflict repair of the task will start by itself: there is a start to withdraw (ADR-0015). */
|
|
4198
|
+
repairOwed(taskId: string): boolean;
|
|
3488
4199
|
maxParallel(): number;
|
|
3489
4200
|
/** The run waits on the user to stash or skip isolation before anything starts. */
|
|
3490
4201
|
runBlocked(): boolean;
|
|
@@ -3504,14 +4215,26 @@ interface ExecutionHost {
|
|
|
3504
4215
|
* `left` still wait. Answers the line that says so.
|
|
3505
4216
|
*/
|
|
3506
4217
|
joinRun(approved: number, left: number): Promise<string>;
|
|
4218
|
+
/** The fresh chance the user's Execute gives what failed, for work it takes in (ADR-0053); none while the scheduler drives the run. */
|
|
4219
|
+
readyFailed(): void;
|
|
3507
4220
|
startTask(taskId: string, actor: ExecutionActor): Promise<void>;
|
|
3508
4221
|
/** Force start the task; answers the line saying it waits for its dependencies, when it was queued behind them rather than started. */
|
|
3509
4222
|
forceStart(taskId: string): Promise<string | undefined>;
|
|
3510
4223
|
markComplete(taskId: string): Promise<void>;
|
|
3511
4224
|
markNotDone(taskId: string): Promise<void>;
|
|
4225
|
+
/** What reverting the task would take, as far as the plan can say; see {@link TaskOrchestrator.revertScope}. */
|
|
4226
|
+
revertScope(taskId: string): RevertScope;
|
|
4227
|
+
/** Revert the task's landed work, through the queue it shares with landings. */
|
|
4228
|
+
revertTask(taskId: string): Promise<IsolationRevertResult>;
|
|
3512
4229
|
interrupt(taskId: string): Promise<void>;
|
|
3513
|
-
|
|
3514
|
-
|
|
4230
|
+
/** `actor` is who stopped it: the user's stop holds the supervisor back from it (ADR-0029). */
|
|
4231
|
+
stopTask(taskId: string, actor: ExecutionActor): Promise<void>;
|
|
4232
|
+
/** `actor` is who stopped it: the user's Stop stands the supervisor down (ADR-0029). */
|
|
4233
|
+
stopRun(actor: ExecutionActor): void;
|
|
4234
|
+
/** The user's Stop found nothing to stop: what was admitted before it is withdrawn all the same. */
|
|
4235
|
+
stopAsked(): void;
|
|
4236
|
+
/** A start cleared its last check and is about to act; the user's ends their Stop (ADR-0029). */
|
|
4237
|
+
startAsked(actor: ExecutionActor): void;
|
|
3515
4238
|
retryTask(taskId: string, actor: ExecutionActor): Promise<void>;
|
|
3516
4239
|
/** End the task as skipped, landing nothing of it; see {@link TaskOrchestrator.skipTask}. */
|
|
3517
4240
|
skipTask(taskId: string, reason: string | undefined, actor: ExecutionActor): Promise<void>;
|
|
@@ -3565,6 +4288,12 @@ interface ExecutionHost {
|
|
|
3565
4288
|
awaitEnd(taskId: string, ms: number, signal?: AbortSignal): Promise<void>;
|
|
3566
4289
|
/** The task's result is owed to the planner, in a turn acting for whoever started it (ADR-0037, R2, R3). */
|
|
3567
4290
|
owe(taskId: string, to: TaskReportTo): void;
|
|
4291
|
+
/** What waits on a person now, derived afresh (ADR-0053). */
|
|
4292
|
+
escalations(): readonly Escalation[];
|
|
4293
|
+
/** Add the task that merges a conflicted task's branch by hand; false when it has no conflict left. */
|
|
4294
|
+
resolveConflict(taskId: string): Promise<boolean>;
|
|
4295
|
+
/** Replay the run a dirty checkout turned away, stashing first or for this run without isolation. */
|
|
4296
|
+
continueRun(how: 'stash' | 'shared'): Promise<void>;
|
|
3568
4297
|
/** The end of a task's output, as a planner turn is told it; see {@link taskReport}. */
|
|
3569
4298
|
reportTail(taskId: string): string | undefined;
|
|
3570
4299
|
}
|
|
@@ -3572,7 +4301,8 @@ interface ExecutionCommandsDeps {
|
|
|
3572
4301
|
host: ExecutionHost;
|
|
3573
4302
|
/** The approval card channel a Guarded start asks through. */
|
|
3574
4303
|
consent: Pick<IApproval, 'request'>;
|
|
3575
|
-
|
|
4304
|
+
/** What this node may do unasked, read at each check (ADR-0056 M1); a root with nothing past what the host says unless set. */
|
|
4305
|
+
authority?: NodeAuthority;
|
|
3576
4306
|
guards?: readonly LoopGuard[];
|
|
3577
4307
|
/** What pre-approves a script's effect (ADR-0035); nothing does unless set. */
|
|
3578
4308
|
effects?: EffectAllowlist;
|
|
@@ -3592,7 +4322,7 @@ interface ExecutionCommandsDeps {
|
|
|
3592
4322
|
declare class ExecutionCommands {
|
|
3593
4323
|
private readonly deps;
|
|
3594
4324
|
private readonly host;
|
|
3595
|
-
private readonly
|
|
4325
|
+
private readonly authority;
|
|
3596
4326
|
private readonly guards;
|
|
3597
4327
|
private readonly effects;
|
|
3598
4328
|
private readonly now;
|
|
@@ -3616,6 +4346,15 @@ declare class ExecutionCommands {
|
|
|
3616
4346
|
* committed, its own edits in the turn included (ADR-0022 P2).
|
|
3617
4347
|
*/
|
|
3618
4348
|
run(asked: ExecutionCommand, actor: ExecutionActor, signal?: AbortSignal): Promise<CommandOutcome>;
|
|
4349
|
+
/**
|
|
4350
|
+
* The user's answer to an escalation (ADR-0053): the list derived afresh,
|
|
4351
|
+
* and the option chosen dispatched to the existing command for that wait, as
|
|
4352
|
+
* the user, so every check it has still applies and this adds no authority.
|
|
4353
|
+
* It takes no actor because it is the user's alone: no planner tool reaches
|
|
4354
|
+
* it, and the supervisor keeps its own tools. `confirmed` is the user's yes to
|
|
4355
|
+
* an option's `confirm`, which a choice cannot imply.
|
|
4356
|
+
*/
|
|
4357
|
+
answerEscalation(id: string, option: string, note?: string, confirmed?: boolean): Promise<CommandOutcome>;
|
|
3619
4358
|
/** A valid, consented call, from the user's answer where one is needed to the act and its record. */
|
|
3620
4359
|
private carryOut;
|
|
3621
4360
|
/**
|
|
@@ -3643,23 +4382,26 @@ declare class ExecutionCommands {
|
|
|
3643
4382
|
*/
|
|
3644
4383
|
private scriptUnready;
|
|
3645
4384
|
/**
|
|
3646
|
-
* Who may run a script
|
|
3647
|
-
*
|
|
3648
|
-
*
|
|
3649
|
-
*
|
|
3650
|
-
* supervisor's level decides for it first: at Watch it is refused,
|
|
3651
|
-
* suggest it instead, covered or not; at Act it runs, the task it adds
|
|
3652
|
-
* being approved (ADR-0029).
|
|
4385
|
+
* Who may run a script, as ADR-0035's table says. An effect the user's
|
|
4386
|
+
* allowlist covers runs in every row but one, and is recorded by its rule.
|
|
4387
|
+
* In the user's turn: otherwise autorun in Full runs it, on a first plan as
|
|
4388
|
+
* on an approved one (ADR-0030), and failing that they are asked on the
|
|
4389
|
+
* card. The supervisor's level decides for it first: at Watch it is refused,
|
|
4390
|
+
* to suggest it instead, covered or not; at Act it runs, the task it adds
|
|
4391
|
+
* being approved (ADR-0029). A subplanner's is its grants alone (ADR-0056 M6).
|
|
3653
4392
|
*/
|
|
3654
4393
|
private scriptConsent;
|
|
3655
4394
|
/**
|
|
3656
|
-
* Of the tasks a planner edit
|
|
3657
|
-
*
|
|
3658
|
-
*
|
|
3659
|
-
*
|
|
3660
|
-
*
|
|
4395
|
+
* Of the tasks a planner edit wrote, the ones autorun approves as the edit
|
|
4396
|
+
* commits. Under Full every one of them, a rewritten script's new body
|
|
4397
|
+
* included, for the user's turn and a supervisor at Act alike. Otherwise only
|
|
4398
|
+
* in the user's turn, and all but a script task, which runs unasked only
|
|
4399
|
+
* where `run_script` would run it unasked (ADR-0035), so under Guarded it
|
|
4400
|
+
* waits for the user unless their effect allowlist covers it. Its row shows
|
|
4401
|
+
* the body verbatim, and starting it is their consent. Below the root this
|
|
4402
|
+
* is the `approve` grant (ADR-0056 M6).
|
|
3661
4403
|
*/
|
|
3662
|
-
autorunApproves(written: readonly Readonly<Task>[]): string[];
|
|
4404
|
+
autorunApproves(actor: ExecutionActor, written: readonly Readonly<Task>[]): string[];
|
|
3663
4405
|
/**
|
|
3664
4406
|
* A task `run_script` answered for before it ended has ended: its result
|
|
3665
4407
|
* joins the timeline beside its start, with who asked and how it was
|
|
@@ -3671,16 +4413,22 @@ declare class ExecutionCommands {
|
|
|
3671
4413
|
* The tasks a start approves, read from the plan as it stands at the
|
|
3672
4414
|
* command's last check. Autorun starts a plan as the user's standing
|
|
3673
4415
|
* instruction, so its start approves what it runs as the user's does; so
|
|
3674
|
-
* does a start under
|
|
3675
|
-
*
|
|
4416
|
+
* does a start under Full with autorun. Under Guarded it leaves a script task
|
|
4417
|
+
* the commit left unapproved: that waits for the user (ADR-0035). A yes on
|
|
4418
|
+
* the card approves the tasks the card named, and no others.
|
|
3676
4419
|
*/
|
|
3677
4420
|
private consented;
|
|
3678
4421
|
/**
|
|
3679
|
-
* With autorun on and Full, a planner turn
|
|
3680
|
-
*
|
|
3681
|
-
*
|
|
4422
|
+
* With autorun on and Full, nobody is asked: a planner turn, or a supervisor
|
|
4423
|
+
* its level lets act, may start anything, on a first plan as on an approved
|
|
4424
|
+
* one (ADR-0030). Read at each start, so switching either off stops it at
|
|
4425
|
+
* once. Below Act the level has refused the call before this is read. A
|
|
4426
|
+
* subplanner has nobody to ask, so `approve` alone says it: its `autonomy`
|
|
4427
|
+
* says what its runners may do, not whether a person is asked (ADR-0056 M7).
|
|
3682
4428
|
*/
|
|
3683
|
-
private
|
|
4429
|
+
private startsUnattended;
|
|
4430
|
+
/** The mandate that answers for `actor` now: read at each check, so a change reaches the next one (ADR-0056 M1). */
|
|
4431
|
+
private mandateOf;
|
|
3684
4432
|
/**
|
|
3685
4433
|
* Guarded means "ask the user first": a planner start in the user's own
|
|
3686
4434
|
* turn asks, so tasks they have not approved go into the question rather
|
|
@@ -3689,12 +4437,23 @@ declare class ExecutionCommands {
|
|
|
3689
4437
|
*/
|
|
3690
4438
|
private asksToApprove;
|
|
3691
4439
|
/**
|
|
3692
|
-
* Who may do what
|
|
3693
|
-
* consent, and their own controls are theirs alone; a
|
|
3694
|
-
*
|
|
3695
|
-
*
|
|
4440
|
+
* Who may do what, in the one place it is decided (ADR-0056 M6): the user's
|
|
4441
|
+
* own call needs no consent, and their own controls are theirs alone; a turn
|
|
4442
|
+
* the user opened keeps ADR-0029's table, since a person needs no mandate: it
|
|
4443
|
+
* may always end or steer work, and starts it only as the autonomy level says.
|
|
4444
|
+
* The supervisor's level decides for it through its mandate, and a subplanner
|
|
4445
|
+
* has its grants alone, allow or refuse: nobody is there to ask.
|
|
3696
4446
|
*/
|
|
3697
|
-
|
|
4447
|
+
consent(actor: ExecutionActor, command: ExecutionCommandName): Consent;
|
|
4448
|
+
private supervisorConsent;
|
|
4449
|
+
private grantConsent;
|
|
4450
|
+
/**
|
|
4451
|
+
* Autorun is the user's standing instruction, so at the root it is not held
|
|
4452
|
+
* to a level: Watch has no `control`, and autorun still starts its plan. Below
|
|
4453
|
+
* the root there is no user behind it, and `approve` and `control` narrow it
|
|
4454
|
+
* (ADR-0056 M6).
|
|
4455
|
+
*/
|
|
4456
|
+
private autorunConsent;
|
|
3698
4457
|
/**
|
|
3699
4458
|
* A checkpoint asks a person for judgement on the work, so the user answers
|
|
3700
4459
|
* it from the task's card; the supervisor may only at Act, in a wake-up turn
|
|
@@ -3709,8 +4468,16 @@ declare class ExecutionCommands {
|
|
|
3709
4468
|
*/
|
|
3710
4469
|
private prepare;
|
|
3711
4470
|
private prepareRunPlan;
|
|
4471
|
+
/**
|
|
4472
|
+
* What a planner is told of its `run_plan`: it leaves a failure as it is
|
|
4473
|
+
* (ADR-0053), so the line says so, and where nothing was left to start the
|
|
4474
|
+
* run has ended again and the line does not say it runs.
|
|
4475
|
+
*/
|
|
4476
|
+
private runningLine;
|
|
3712
4477
|
/** A start of one task: `run_task`, or a fresh `retry_task`, which also takes a task that failed or waits on the user. */
|
|
3713
4478
|
private prepareStart;
|
|
4479
|
+
/** Why the work this task builds on keeps a start of it, a fresh one or a continue, from running now; null when it does not. */
|
|
4480
|
+
private heldBehind;
|
|
3714
4481
|
/**
|
|
3715
4482
|
* The user's force start goes past what the scheduler waits for, so only
|
|
3716
4483
|
* what no start could get past is refused here; the start rule decides the
|
|
@@ -3742,6 +4509,13 @@ declare class ExecutionCommands {
|
|
|
3742
4509
|
private overriddenBy;
|
|
3743
4510
|
private prepareMarkComplete;
|
|
3744
4511
|
private prepareMarkNotDone;
|
|
4512
|
+
/**
|
|
4513
|
+
* A revert asks nothing of the run, so unlike an override it waits for no
|
|
4514
|
+
* task that does not depend on the work (ADR-0054). What only git can say —
|
|
4515
|
+
* that it is in the user's branch, that it conflicts — it says as it runs,
|
|
4516
|
+
* in its turn on the queue.
|
|
4517
|
+
*/
|
|
4518
|
+
private prepareRevert;
|
|
3745
4519
|
private prepareInterrupt;
|
|
3746
4520
|
private prepareCancelResume;
|
|
3747
4521
|
private prepareCheckpoint;
|
|
@@ -3753,6 +4527,8 @@ declare class ExecutionCommands {
|
|
|
3753
4527
|
*/
|
|
3754
4528
|
private prepareResume;
|
|
3755
4529
|
private prepareStop;
|
|
4530
|
+
/** What a refused Stop of a conflicted task can do instead: nothing runs it, so there is something else to press. */
|
|
4531
|
+
private conflictNext;
|
|
3756
4532
|
private prepareStopRun;
|
|
3757
4533
|
private prepareMessage;
|
|
3758
4534
|
/** A message queued behind the running turn, sent now or taken back; one delivered meanwhile is past either. */
|
|
@@ -3771,9 +4547,11 @@ declare class ExecutionCommands {
|
|
|
3771
4547
|
*/
|
|
3772
4548
|
private skippedRefusal;
|
|
3773
4549
|
/**
|
|
3774
|
-
* Why a loop's check between rounds is not started from the seam:
|
|
3775
|
-
*
|
|
3776
|
-
*
|
|
4550
|
+
* Why a loop's check between rounds is not started from the seam: something
|
|
4551
|
+
* will run it, once its body has landed, or nothing will and its body has
|
|
4552
|
+
* yet to land (ADR-0045 L5). Each says only what is true of it. Null for any
|
|
4553
|
+
* other task, and for a check whose fix has landed that nothing else will
|
|
4554
|
+
* run, which a start runs as its next round rather than leave it stranded.
|
|
3777
4555
|
*/
|
|
3778
4556
|
private betweenRounds;
|
|
3779
4557
|
/**
|
|
@@ -3959,6 +4737,8 @@ interface PlanChangeScope {
|
|
|
3959
4737
|
handles?(): ReadonlyMap<string, string>;
|
|
3960
4738
|
/** A further refusal of what the change leaves: the supervisor's oscillation guard (ADR-0029). */
|
|
3961
4739
|
guard?(before: readonly Task[], after: readonly Task[]): string | undefined;
|
|
4740
|
+
/** The node, below the root: a child's change is held to its mandate, where a commit would otherwise approve with no command (ADR-0056 M6). Absent, or undefined, at the root. */
|
|
4741
|
+
child?(): NodeAuthority | undefined;
|
|
3962
4742
|
}
|
|
3963
4743
|
/** What a whole plan's JSON is held to as it is submitted. */
|
|
3964
4744
|
interface PlanIntake {
|
|
@@ -3992,6 +4772,8 @@ declare class PlanChangeCheck {
|
|
|
3992
4772
|
/** A plan's JSON read into tasks as it is submitted; nothing in it reads the plan. */
|
|
3993
4773
|
private read;
|
|
3994
4774
|
private rules;
|
|
4775
|
+
/** What a child's mandate leaves out of this change: `replan` for any, and `research` for a research task it brings. */
|
|
4776
|
+
private ungranted;
|
|
3995
4777
|
private refused;
|
|
3996
4778
|
}
|
|
3997
4779
|
|
|
@@ -4129,6 +4911,7 @@ declare class CliAgentAiService implements IAiService {
|
|
|
4129
4911
|
nativeSessionId(): string | null;
|
|
4130
4912
|
/** The compactions the agents reported of their own context, never a subagent's or another thread's: their adapters drop those (ADR-0012 T10). */
|
|
4131
4913
|
compactions(): number;
|
|
4914
|
+
promptCacheTtlMs(): number | undefined;
|
|
4132
4915
|
heldSecrets(): readonly string[];
|
|
4133
4916
|
restart(): void;
|
|
4134
4917
|
reset(): void;
|
|
@@ -4301,6 +5084,8 @@ interface LandedHistory {
|
|
|
4301
5084
|
*/
|
|
4302
5085
|
interface PlannerToolsOffer {
|
|
4303
5086
|
sessionId: string;
|
|
5087
|
+
/** The tools a child's grants leave out of its list, fixed as its session starts (ADR-0056 M6); the root's list is not filtered. */
|
|
5088
|
+
withheld?: readonly string[];
|
|
4304
5089
|
handler: PlannerToolHandler;
|
|
4305
5090
|
}
|
|
4306
5091
|
/**
|
|
@@ -4498,6 +5283,8 @@ interface IAiService {
|
|
|
4498
5283
|
* T10). Absent where nothing compacts a context in place.
|
|
4499
5284
|
*/
|
|
4500
5285
|
compactions?(): number;
|
|
5286
|
+
/** How long this planner's prompt cache lasts, as its connector states it; absent when it states none (ADR-0057 R4). */
|
|
5287
|
+
promptCacheTtlMs?(): number | undefined;
|
|
4501
5288
|
/**
|
|
4502
5289
|
* Optional: what automatic compaction does for the planner's model now
|
|
4503
5290
|
* (ADR-0002) — on, off in the settings file, or off for want of a known
|
|
@@ -4681,6 +5468,14 @@ declare class PlannerTurn {
|
|
|
4681
5468
|
}
|
|
4682
5469
|
/** What a planner turn may change: the whole plan, or tasks through edits. */
|
|
4683
5470
|
type PlanChange = 'plan' | 'edit';
|
|
5471
|
+
/** A wake-up turn's brief, as `PlannerBriefing` sends it: whole to a context that does not hold it, else a line on a change (ADR-0057 R5). */
|
|
5472
|
+
interface WakeBrief {
|
|
5473
|
+
/** Which brief this is: a level's, or a report turn's. */
|
|
5474
|
+
key: string;
|
|
5475
|
+
whole: string;
|
|
5476
|
+
/** All a context holding {@link whole} needs told, and all that may differ between two wake-ups of one brief. */
|
|
5477
|
+
line: string;
|
|
5478
|
+
}
|
|
4684
5479
|
/**
|
|
4685
5480
|
* A wake-up turn (ADR-0029): a supervisor's turn on wake-up digests alone, no
|
|
4686
5481
|
* user message in it. What it may do is its level's, decided by the host.
|
|
@@ -4695,7 +5490,7 @@ interface WakeUpTurn {
|
|
|
4695
5490
|
*/
|
|
4696
5491
|
refused(change: PlanChange): string | undefined;
|
|
4697
5492
|
/** Told to the model after the digests and never saved, like the plan block: who it is in this turn, and what it may do. */
|
|
4698
|
-
brief?:
|
|
5493
|
+
brief?: WakeBrief;
|
|
4699
5494
|
/**
|
|
4700
5495
|
* Who the turn acts for at the command seam, read at each call; absent, the
|
|
4701
5496
|
* supervisor at the run's level. A turn on a report owed to the user's turn
|
|
@@ -4918,6 +5713,8 @@ declare class PlannerConversation {
|
|
|
4918
5713
|
private readonly blocks;
|
|
4919
5714
|
private live;
|
|
4920
5715
|
private openTurn;
|
|
5716
|
+
/** When the live context's newest turn opened; null with no live context. */
|
|
5717
|
+
private requestedAt;
|
|
4921
5718
|
/**
|
|
4922
5719
|
* What an API planner's chat condenses its context through during a turn
|
|
4923
5720
|
* (ADR-0002): the open turn, the history that landed before it, and the
|
|
@@ -4926,6 +5723,14 @@ declare class PlannerConversation {
|
|
|
4926
5723
|
private readonly compaction;
|
|
4927
5724
|
constructor(host: PlannerConversationHost);
|
|
4928
5725
|
get transcript(): readonly ConversationMessage[];
|
|
5726
|
+
/**
|
|
5727
|
+
* When the planner's prefix was last sent, as its provider counts a prompt
|
|
5728
|
+
* cache's life: from the start of a request (ADR-0057 R4). The turn's opening
|
|
5729
|
+
* stands for it: a turn's later calls keep the prefix warm for longer, so
|
|
5730
|
+
* this can only say a wake is due earlier than it had to be. Null with no live
|
|
5731
|
+
* context, whose next turn is a replay.
|
|
5732
|
+
*/
|
|
5733
|
+
get lastRequestAt(): number | null;
|
|
4929
5734
|
/** Whether a planner turn holds the conversation. */
|
|
4930
5735
|
get isTurnInFlight(): boolean;
|
|
4931
5736
|
/** Stop the planner turn in flight; it settles as stopped. False when none is. */
|
|
@@ -5311,7 +6116,12 @@ declare class PlannerConversation {
|
|
|
5311
6116
|
* whole block or what changed (ADR-0012 T10).
|
|
5312
6117
|
*/
|
|
5313
6118
|
private planView;
|
|
5314
|
-
/**
|
|
6119
|
+
/**
|
|
6120
|
+
* One line per task, subtasks indented under their parent, with stable
|
|
6121
|
+
* references — null until the plan has tasks. Past a size only the tasks a
|
|
6122
|
+
* planner acts on get a line (`planWindow`); what a line waits for costs a
|
|
6123
|
+
* start-rule walk, so the rest are not walked.
|
|
6124
|
+
*/
|
|
5315
6125
|
private planRows;
|
|
5316
6126
|
}
|
|
5317
6127
|
|
|
@@ -5389,78 +6199,6 @@ interface SessionData {
|
|
|
5389
6199
|
plan: LegacyPlanState;
|
|
5390
6200
|
}
|
|
5391
6201
|
|
|
5392
|
-
/**
|
|
5393
|
-
* The bridge between "core needs an answer" and "a human somewhere is looking
|
|
5394
|
-
* at a UI". Core cannot prompt: the human may be at a browser, a TUI, a CLI
|
|
5395
|
-
* stream, or a VS Code webview, and on the web server they are on the far end
|
|
5396
|
-
* of a socket. So the Session parks a promise here, announces the request
|
|
5397
|
-
* through the normal broadcast seam, and every surface answers through the
|
|
5398
|
-
* same `resolve(id, granted)` call.
|
|
5399
|
-
*
|
|
5400
|
-
* Timeouts are load-bearing rather than defensive: a planner turn that blocks
|
|
5401
|
-
* forever on an unanswered prompt would hang the whole research loop with no
|
|
5402
|
-
* visible cause. On expiry the request resolves to denied and the model gets a
|
|
5403
|
-
* normal, actionable tool result. A task runner's request is the exception
|
|
5404
|
-
* (ADR-0018, A1): the runner is parked on it rather than a research loop, and
|
|
5405
|
-
* it waits for a person — or the supervisor — however long that takes.
|
|
5406
|
-
*/
|
|
5407
|
-
interface PendingApproval {
|
|
5408
|
-
id: string;
|
|
5409
|
-
request: ApprovalRequest;
|
|
5410
|
-
createdAt: string;
|
|
5411
|
-
}
|
|
5412
|
-
interface PendingApprovalsOptions {
|
|
5413
|
-
/** Denies and resolves after this long with no answer. Default 5 minutes. */
|
|
5414
|
-
timeoutMs?: number;
|
|
5415
|
-
/** Announce a new request to the surfaces. */
|
|
5416
|
-
onRequest?: (pending: PendingApproval) => void;
|
|
5417
|
-
/** Announce that a request is no longer actionable (answered or expired). */
|
|
5418
|
-
onSettled?: (id: string, granted: boolean, settled: {
|
|
5419
|
-
request: ApprovalRequest;
|
|
5420
|
-
decision: ApprovalDecision;
|
|
5421
|
-
}) => void;
|
|
5422
|
-
}
|
|
5423
|
-
interface AskOptions {
|
|
5424
|
-
/**
|
|
5425
|
-
* An id the caller already announced the request under. One still in use is
|
|
5426
|
-
* refused — denied at once — rather than overwriting the request that has it.
|
|
5427
|
-
*/
|
|
5428
|
-
id?: string;
|
|
5429
|
-
/** Wait for an answer however long it takes. */
|
|
5430
|
-
noTimeout?: boolean;
|
|
5431
|
-
/**
|
|
5432
|
-
* Given the answer as the request settles, before anything awaiting the
|
|
5433
|
-
* promise runs: a caller about to tear down what asked (a runner being
|
|
5434
|
-
* stopped) must deliver the answer before it goes.
|
|
5435
|
-
*/
|
|
5436
|
-
onDecision?: (decision: ApprovalDecision) => void;
|
|
5437
|
-
}
|
|
5438
|
-
declare class PendingApprovals {
|
|
5439
|
-
private readonly opts;
|
|
5440
|
-
private readonly entries;
|
|
5441
|
-
private readonly listeners;
|
|
5442
|
-
constructor(opts?: PendingApprovalsOptions);
|
|
5443
|
-
/** Hear each new request once it is announced — the supervisor wakes on a runner's (ADR-0029). */
|
|
5444
|
-
listen(listener: (pending: PendingApproval) => void): () => void;
|
|
5445
|
-
/** Park a request and return the promise the approval policy awaits. */
|
|
5446
|
-
ask(request: ApprovalRequest, options?: AskOptions): Promise<boolean>;
|
|
5447
|
-
/** Park a request whose answer is more than yes or no. */
|
|
5448
|
-
decide(request: ApprovalRequest, options?: AskOptions): Promise<ApprovalDecision>;
|
|
5449
|
-
/**
|
|
5450
|
-
* Answer one request. Returns false when the id is unknown or already
|
|
5451
|
-
* settled. "Allow for this task" on a request that did not offer it is a
|
|
5452
|
-
* plain allow: no grant is made that the requester never proposed.
|
|
5453
|
-
*/
|
|
5454
|
-
resolve(id: string, answer: ApprovalAnswer): boolean;
|
|
5455
|
-
/** Everything still awaiting an answer — replayed to a surface that connects late. */
|
|
5456
|
-
outstanding(): PendingApproval[];
|
|
5457
|
-
/**
|
|
5458
|
-
* Deny everything in flight, or only the requests `which` picks. Called on
|
|
5459
|
-
* abort and on session reset.
|
|
5460
|
-
*/
|
|
5461
|
-
clear(which?: (request: ApprovalRequest) => boolean, note?: string): void;
|
|
5462
|
-
}
|
|
5463
|
-
|
|
5464
6202
|
/** One repo that kept "Merge all" from touching anything, as part of one line. */
|
|
5465
6203
|
declare function blockNotice({ repo, reason, files, expected, actual, rebasing }: IsolationMergeBlock): string;
|
|
5466
6204
|
/** Every repo's reason, in the order "Merge all" named them, so a surface can list them or join them. */
|
|
@@ -5719,6 +6457,11 @@ interface GlobalRunSettings {
|
|
|
5719
6457
|
supervisorRetryLimit: number;
|
|
5720
6458
|
/** Reads a wake-up turn may make, in place of a user message's caps. */
|
|
5721
6459
|
wakeUpReadBudget: number;
|
|
6460
|
+
/**
|
|
6461
|
+
* The token budget of a delegation tree (ADR-0055 D21, ADR-0056 M5); 0 is
|
|
6462
|
+
* delegation off. One value, so delegation is never on with no budget.
|
|
6463
|
+
*/
|
|
6464
|
+
delegationTokens: number;
|
|
5722
6465
|
}
|
|
5723
6466
|
declare const RUN_SETTINGS_DEFAULTS: Readonly<GlobalRunSettings>;
|
|
5724
6467
|
declare class RunSettingsError extends Error {
|
|
@@ -5744,12 +6487,19 @@ interface UserSettings {
|
|
|
5744
6487
|
autorun?: boolean;
|
|
5745
6488
|
supervisorRetryLimit?: number;
|
|
5746
6489
|
wakeUpReadBudget?: number;
|
|
6490
|
+
delegationTokens?: number;
|
|
5747
6491
|
/**
|
|
5748
6492
|
* Whether an API planner prunes its own context ahead of a call that would
|
|
5749
6493
|
* pass 90% of its model's window. Absent means on. Set in the file only:
|
|
5750
6494
|
* no surface offers it.
|
|
5751
6495
|
*/
|
|
5752
6496
|
plannerAutoCompaction?: boolean;
|
|
6497
|
+
/**
|
|
6498
|
+
* What a task runner loads of the user's own setup: all of it (`user`) or
|
|
6499
|
+
* what a task needs (`minimal`). Absent means `user`. Set in the file only:
|
|
6500
|
+
* no surface offers it.
|
|
6501
|
+
*/
|
|
6502
|
+
taskRunnerConfig?: TaskRunnerConfig;
|
|
5753
6503
|
}
|
|
5754
6504
|
/**
|
|
5755
6505
|
* The model allowlist, remembered planner models and enabled runners are shared
|
|
@@ -5994,6 +6744,24 @@ interface ExecuteCommandResponse {
|
|
|
5994
6744
|
message: string;
|
|
5995
6745
|
payload?: CommandPayload;
|
|
5996
6746
|
}
|
|
6747
|
+
/**
|
|
6748
|
+
* `GET /api/plans/:id/escalations`: what waits on a person now (ADR-0053). A
|
|
6749
|
+
* client holding a socket has the same list on every status update.
|
|
6750
|
+
*/
|
|
6751
|
+
interface EscalationsResponse {
|
|
6752
|
+
escalations: Escalation[];
|
|
6753
|
+
}
|
|
6754
|
+
/**
|
|
6755
|
+
* The body of `POST /api/plans/:id/escalations/answer`, run as the user, and
|
|
6756
|
+
* answered as `execute-command` answers. `confirmed` is the user's yes to the
|
|
6757
|
+
* option's `confirm`.
|
|
6758
|
+
*/
|
|
6759
|
+
interface AnswerEscalationRequest {
|
|
6760
|
+
id: string;
|
|
6761
|
+
option: string;
|
|
6762
|
+
note?: string;
|
|
6763
|
+
confirmed?: boolean;
|
|
6764
|
+
}
|
|
5997
6765
|
/**
|
|
5998
6766
|
* A plan as the planner routes return it: the session's plan state, not the
|
|
5999
6767
|
* `SerializedPlan` a websocket `plan_generated` carries. The two differ —
|
|
@@ -6054,6 +6822,8 @@ interface MergeGateEntry {
|
|
|
6054
6822
|
interface MergeGateResponse {
|
|
6055
6823
|
mergeGate: MergeGateEntry[];
|
|
6056
6824
|
}
|
|
6825
|
+
/** A revert that would not go ahead is an answer, not a failure, so it comes back 200 with why (ADR-0054). */
|
|
6826
|
+
type TaskRevertPreviewResponse = TaskRevertPreview;
|
|
6057
6827
|
interface IsolationDiffResponse {
|
|
6058
6828
|
diff: string;
|
|
6059
6829
|
}
|
|
@@ -6579,6 +7349,8 @@ interface TaskLogView extends BlockList {
|
|
|
6579
7349
|
readonly queued: readonly QueuedTaskMessage[];
|
|
6580
7350
|
/** A turn is running. */
|
|
6581
7351
|
readonly working: boolean;
|
|
7352
|
+
/** When the open turn began (ISO), for a surface to count from; absent between turns and for a log saved before it was kept (#81). */
|
|
7353
|
+
readonly turnStartedAt?: string;
|
|
6582
7354
|
/** How the last turn ended; absent before the first one does. */
|
|
6583
7355
|
readonly lastTurnEnd?: StructuredTurnEnd;
|
|
6584
7356
|
/** What the runner reported over the attempt, subagents included. */
|
|
@@ -6605,6 +7377,70 @@ declare function reduceTaskLog(view: TaskLogView, event: TaskLogEvent): TaskLogV
|
|
|
6605
7377
|
/** A whole attempt's events, folded from the start — what a reload shows. */
|
|
6606
7378
|
declare function replayTaskLog(events: readonly TaskLogEvent[], from?: TaskLogView): TaskLogView;
|
|
6607
7379
|
|
|
7380
|
+
/** What the label reads: a `TaskLogView`'s blocks, which is all a webview holds of one. */
|
|
7381
|
+
type LoggedBlocks = {
|
|
7382
|
+
readonly blocks: readonly DisplayBlock[];
|
|
7383
|
+
readonly turnStartedAt?: string;
|
|
7384
|
+
};
|
|
7385
|
+
/** What {@link taskActivity} reads of a log: the view's turn flag, and whether the log is an attempt the runner is no longer in. */
|
|
7386
|
+
type LoggedTurn = LoggedBlocks & {
|
|
7387
|
+
/** A turn is open in the log, as its `turn_start` said; a log that streams without one has open blocks but this unset. Absent where a surface holds no such flag, which reads as open. */
|
|
7388
|
+
readonly working?: boolean;
|
|
7389
|
+
/** How the last turn ended, as the view says; set means the log has seen a turn end, so what it left open is not a turn. */
|
|
7390
|
+
readonly lastTurnEnd?: StructuredTurnEnd;
|
|
7391
|
+
/** The log is an earlier attempt, browsed: whatever it left open ended with it. */
|
|
7392
|
+
readonly archived?: boolean;
|
|
7393
|
+
};
|
|
7394
|
+
/**
|
|
7395
|
+
* What a task's runner is busy with, from its log: the latest block still
|
|
7396
|
+
* open decides, since that is what the runner is doing now. Several running
|
|
7397
|
+
* subagents are counted rather than named, as no one of them is the task's
|
|
7398
|
+
* latest work. The label holds runner output — a surface sanitizes it.
|
|
7399
|
+
*/
|
|
7400
|
+
declare function activityLabel(view: LoggedBlocks): string;
|
|
7401
|
+
/** The line above a composer: `busy` animates, and a quiet task's does not. */
|
|
7402
|
+
interface TaskActivity {
|
|
7403
|
+
label: string;
|
|
7404
|
+
busy: boolean;
|
|
7405
|
+
/** When the open turn began (ISO): a surface counts from it on its own ticks (#81). Absent for a log saved before turns were dated. */
|
|
7406
|
+
since?: string;
|
|
7407
|
+
}
|
|
7408
|
+
/**
|
|
7409
|
+
* The activity line of an open task log, or null when it has none to show: a
|
|
7410
|
+
* task not running, and one waiting on a runner request, whose card in the log
|
|
7411
|
+
* already asks the user. A running task whose runner has gone quiet is named
|
|
7412
|
+
* as the plan pane names it and is never `busy`, so a runner that is not
|
|
7413
|
+
* producing anything cannot look as if it were. Nor can a runner between
|
|
7414
|
+
* turns: `busy` needs an open turn, a running subagent that outlived it, or,
|
|
7415
|
+
* in a log that has seen no turn end, a block still open (a stream whose
|
|
7416
|
+
* `turn_start` this view never saw).
|
|
7417
|
+
* A browsed earlier attempt has no line, whatever its log was left open on.
|
|
7418
|
+
* A script task has no exception here, on any surface: it runs no model, but
|
|
7419
|
+
* its log is what it printed, so a step still open is one running.
|
|
7420
|
+
*/
|
|
7421
|
+
declare function taskActivity(view: LoggedTurn, task: {
|
|
7422
|
+
status: string;
|
|
7423
|
+
idleSince?: string | null;
|
|
7424
|
+
awaitingApproval?: number;
|
|
7425
|
+
}): TaskActivity | null;
|
|
7426
|
+
|
|
7427
|
+
/**
|
|
7428
|
+
* How long something has run, for an activity line: whole seconds (`42s`),
|
|
7429
|
+
* then minutes and zero-padded seconds (`3m 05s`), then from an hour hours and
|
|
7430
|
+
* zero-padded minutes (`1h 05m`), since seconds mean nothing by then. A
|
|
7431
|
+
* fraction of a unit is dropped, not rounded up, so a time never reads ahead
|
|
7432
|
+
* of the clock. Returns '' for a negative or non-finite input: a start time
|
|
7433
|
+
* ahead of the reader's clock (skew between hosts) is not a duration to show.
|
|
7434
|
+
*/
|
|
7435
|
+
declare function formatElapsed(ms: number): string;
|
|
7436
|
+
/**
|
|
7437
|
+
* The time from `startedAt` (ISO) to `now` (epoch ms), formatted. The clock is
|
|
7438
|
+
* the caller's, so a surface counts on a tick it already draws and a test
|
|
7439
|
+
* fixes it. '' when there is nothing to show: no start (a log saved before
|
|
7440
|
+
* turns were dated) or one that cannot be read.
|
|
7441
|
+
*/
|
|
7442
|
+
declare function elapsedSince(startedAt: string | undefined, now: number): string;
|
|
7443
|
+
|
|
6608
7444
|
/**
|
|
6609
7445
|
* The one-line head of a command row, shared by every surface: the tool's name
|
|
6610
7446
|
* and the argument that says what the call is about.
|
|
@@ -6714,6 +7550,8 @@ declare function aheadOfDraft(text: string, draft: string): string;
|
|
|
6714
7550
|
interface TurnGate {
|
|
6715
7551
|
readonly open: string | null;
|
|
6716
7552
|
readonly stopped: string | null;
|
|
7553
|
+
/** When the open turn began (ISO), for its elapsed time (#81); absent when none is open or its daemon did not say. */
|
|
7554
|
+
readonly openedAt?: string;
|
|
6717
7555
|
}
|
|
6718
7556
|
declare const NO_TURN: TurnGate;
|
|
6719
7557
|
interface GatedConversation {
|
|
@@ -6732,6 +7570,13 @@ declare function followTurn(view: ConversationView, gate: TurnGate, input: Conve
|
|
|
6732
7570
|
* turn's late output never lands. Nothing changes when no turn is open.
|
|
6733
7571
|
*/
|
|
6734
7572
|
declare function stopTurn(view: ConversationView, gate: TurnGate): GatedConversation;
|
|
7573
|
+
/**
|
|
7574
|
+
* The turn is over without its `planner_turn_ended` having been heard: its
|
|
7575
|
+
* call failed or returned the plan. The open turn and its start go, so the
|
|
7576
|
+
* next turn does not count from this one's; a stop still standing stays, as
|
|
7577
|
+
* the stopped turn's stragglers have not stopped.
|
|
7578
|
+
*/
|
|
7579
|
+
declare function closeTurn(gate: TurnGate): TurnGate;
|
|
6735
7580
|
|
|
6736
7581
|
/**
|
|
6737
7582
|
* Whether the conversation holds anything the collapsed view hides — thinking,
|
|
@@ -6856,11 +7701,15 @@ declare function taskStatusKind(task: {
|
|
|
6856
7701
|
status: string;
|
|
6857
7702
|
idleSince?: string | null;
|
|
6858
7703
|
}): TaskStatusKind;
|
|
7704
|
+
/** The word for a running task whose runner has printed nothing for a while (`quiet`). */
|
|
7705
|
+
declare const STALLED_LABEL = "Stalled";
|
|
6859
7706
|
/** What an awaiting_user task waits on (ADR-0018, W1); null when no reason was saved. */
|
|
6860
7707
|
declare function awaitingLabel(task: {
|
|
6861
7708
|
status: string;
|
|
6862
7709
|
awaitingReason?: AwaitingReason;
|
|
6863
7710
|
}): string | null;
|
|
7711
|
+
/** A conflict repair that will start by itself (ADR-0015): progress, in words that ask nothing of the user. */
|
|
7712
|
+
declare function repairWaitLabel(wait: RepairWait): string;
|
|
6864
7713
|
/** "Blocked by #1, #2.1": the failed tasks a blocked task waits on, by reference (ADR-0034). */
|
|
6865
7714
|
declare function blockedByLabel(refs: readonly string[]): string;
|
|
6866
7715
|
/** "On hold: could not connect to Ordewell's tools; start it again": why a task is out of the scheduler. */
|
|
@@ -6971,6 +7820,8 @@ interface ActionSubject {
|
|
|
6971
7820
|
resumeAt?: string | null;
|
|
6972
7821
|
/** Its last attempt left a runner session to continue (ADR-0018, K1). */
|
|
6973
7822
|
continuable?: boolean;
|
|
7823
|
+
/** A conflict repair of it will start by itself, which Stop withdraws (ADR-0015). */
|
|
7824
|
+
repairWaits?: unknown;
|
|
6974
7825
|
}
|
|
6975
7826
|
/** The actions a task's row offers while a plan runs, in the order they are laid out. */
|
|
6976
7827
|
declare function taskRowActions(task: ActionSubject, placement?: TaskRowPlacement): TaskRowAction[];
|
|
@@ -7099,6 +7950,8 @@ interface TaskRowSubject {
|
|
|
7099
7950
|
outcome: string;
|
|
7100
7951
|
reported?: string;
|
|
7101
7952
|
} | null;
|
|
7953
|
+
/** Between rounds with nothing to run it: only the run knows that, so it is told (ADR-0045 L5). */
|
|
7954
|
+
loopStranded?: boolean;
|
|
7102
7955
|
/** The latest attempt's handoff as the plan keeps it (ADR-0047); a row shows it without opening the task. */
|
|
7103
7956
|
handoff?: HandoffDigest;
|
|
7104
7957
|
}
|
|
@@ -7112,6 +7965,11 @@ interface TaskRowIsolation {
|
|
|
7112
7965
|
limit: number;
|
|
7113
7966
|
};
|
|
7114
7967
|
repairedFiles?: string[];
|
|
7968
|
+
/** Core's word that its landing can be reverted (ADR-0054); a surface offers the action only then. */
|
|
7969
|
+
revertible?: true;
|
|
7970
|
+
repairWaits?: RepairWait;
|
|
7971
|
+
/** The task added to resolve its conflict, by id. */
|
|
7972
|
+
resolver?: string;
|
|
7115
7973
|
}
|
|
7116
7974
|
/**
|
|
7117
7975
|
* The plan a row labels its references against: the tree, so a subtask's
|
|
@@ -7234,10 +8092,16 @@ interface TaskRowView {
|
|
|
7234
8092
|
autonomous: boolean;
|
|
7235
8093
|
/** The repos its isolated work changed, by path; empty for a group of one. */
|
|
7236
8094
|
repos: string[];
|
|
7237
|
-
/** Integration stopped on a conflict: the one isolation state that needs the user. */
|
|
8095
|
+
/** Integration stopped on a conflict: the one isolation state that needs the user. `resolver` is the task, by reference, that has it; then a second is not offered. */
|
|
7238
8096
|
conflict: {
|
|
7239
8097
|
repo: string | null;
|
|
7240
8098
|
files: string | null;
|
|
8099
|
+
resolver: string | null;
|
|
8100
|
+
} | null;
|
|
8101
|
+
/** A conflict repair that starts by itself once what it waits for clears (ADR-0015): `label` says what, in sentence case. Progress, so `conflict` is null. */
|
|
8102
|
+
repairWaiting: {
|
|
8103
|
+
label: string;
|
|
8104
|
+
files: string | null;
|
|
7241
8105
|
} | null;
|
|
7242
8106
|
/** A conflict repair in flight (ADR-0015) — progress, not a blocker. */
|
|
7243
8107
|
repairing: {
|
|
@@ -7270,6 +8134,8 @@ interface TaskRowView {
|
|
|
7270
8134
|
dependencies: string[];
|
|
7271
8135
|
/** What the row offers while a plan runs. */
|
|
7272
8136
|
actions: TaskRowAction[];
|
|
8137
|
+
/** Its landed work can be reverted before Merge all (ADR-0054): a surface offers Revert only then, and core's preview says the rest. */
|
|
8138
|
+
revertible: boolean;
|
|
7273
8139
|
/** The one mark its toggle sets. */
|
|
7274
8140
|
mark: 'complete' | 'uncomplete';
|
|
7275
8141
|
opsEditable: boolean;
|
|
@@ -7313,6 +8179,8 @@ interface TaskLogHeaderTask {
|
|
|
7313
8179
|
idleSince?: string | null;
|
|
7314
8180
|
/** Its last attempt left a runner session the task's composer can continue (ADR-0018, K1). */
|
|
7315
8181
|
continuable?: boolean;
|
|
8182
|
+
/** A conflict repair of it starts by itself once this clears (ADR-0015). */
|
|
8183
|
+
repairWaits?: RepairWait;
|
|
7316
8184
|
attemptUsage?: readonly AttemptUsage[];
|
|
7317
8185
|
}
|
|
7318
8186
|
/**
|
|
@@ -7401,6 +8269,21 @@ type OverrideDirection = 'complete' | 'uncomplete';
|
|
|
7401
8269
|
* completion, never the work or what already ran on it.
|
|
7402
8270
|
*/
|
|
7403
8271
|
declare function manualOverrideConfirmation(direction: OverrideDirection, label: string): string;
|
|
8272
|
+
/** What a revert does (ADR-0054), told with the list of tasks it takes: the same words on every surface. */
|
|
8273
|
+
declare const revertEffect = "Its landed work comes off the integration branch, newest first, and each task listed is held as not started until you retry it. Nothing in your own branch changes.";
|
|
8274
|
+
/** How a revert's confirmation calls a task: a subtask's order alone would name a top-level task. */
|
|
8275
|
+
declare function revertTaskRef(task: {
|
|
8276
|
+
order: number;
|
|
8277
|
+
ref?: string;
|
|
8278
|
+
}): string;
|
|
8279
|
+
/** One task of a revert's confirmation: `dependent` is one that goes with the task the user chose. */
|
|
8280
|
+
declare function revertListLine(task: {
|
|
8281
|
+
order: number;
|
|
8282
|
+
ref?: string;
|
|
8283
|
+
title: string;
|
|
8284
|
+
repos: readonly string[];
|
|
8285
|
+
dependent: boolean;
|
|
8286
|
+
}): string;
|
|
7404
8287
|
/** Why a manual override waits for the run to stop (ADR-0029); `label` names the task. */
|
|
7405
8288
|
declare function manualOverrideStopFirst(direction: OverrideDirection, label: string): string;
|
|
7406
8289
|
interface NewTaskFields {
|
|
@@ -7430,11 +8313,24 @@ declare const automergeSummary: (run: GlobalRunSettings) => string;
|
|
|
7430
8313
|
declare const PLANNED_WITH_LABEL = "Planned-with line in commits Ordewell writes";
|
|
7431
8314
|
declare const trailerSummary: (run: GlobalRunSettings) => string;
|
|
7432
8315
|
declare const autorunSummary: (run: GlobalRunSettings) => string;
|
|
8316
|
+
declare const delegationSummary: (run: GlobalRunSettings) => string;
|
|
8317
|
+
/**
|
|
8318
|
+
* Whether any surface offers the delegation setting. Off until a delegated task
|
|
8319
|
+
* exists (ADR-0055 D21): until then a control for it promises something that
|
|
8320
|
+
* does nothing and warns about tokens that cannot be spent. The setting, its
|
|
8321
|
+
* validation and its stored value stay in core and stay inert; the delegated-task
|
|
8322
|
+
* slice turns this on, and only here.
|
|
8323
|
+
*/
|
|
8324
|
+
declare const DELEGATION_OFFERED = false;
|
|
7433
8325
|
declare const ACT_RISK = "Tasks it adds run too, ops tasks included, which can act on real systems unattended.";
|
|
7434
|
-
declare const AUTORUN_RISK = "Plans start without review, ops tasks included, which can act on real systems unattended. In Full
|
|
8326
|
+
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.";
|
|
8327
|
+
/** What turning delegation on accepts below the root, as Act and autorun accept it at the root (ADR-0056 M9). */
|
|
8328
|
+
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.";
|
|
7435
8329
|
/** `on`/`off` as a switch's value; null for anything else. */
|
|
7436
8330
|
declare function parseSwitch(arg: string): boolean | null;
|
|
8331
|
+
/** A delegation setting as typed: `off`, which is 0, or the tree's budget in tokens; null for anything else. */
|
|
8332
|
+
declare function parseDelegation(arg: string): number | null;
|
|
7437
8333
|
/** A whole number at least `min`, as typed; null for anything else. */
|
|
7438
8334
|
declare function parseCount(arg: string | undefined, min: number): number | null;
|
|
7439
8335
|
|
|
7440
|
-
export { type DiffRowKind as $, ACT_RISK as A, type BlockingSubject as B, CHAT_COMMANDS as C, type CommandBlock as D, type CommandDescriptor as E, type CommandOutcome as F, type CommandPayload as G, type CommandStatus as H, type CommandsResponse as I, type CompactionBlock as J, type CompactionStatus as K, type Consent as L, type ContextCondenseRequest as M, ConversationBusyError as N, type ConversationCompactResponse as O, type ConversationCompaction as P, ConversationEditError as Q, type ConversationForkResponse as R, type ConversationInput as S, type ConversationRequest as T, type ConversationRewindResponse as U, type ConversationTurn as V, type ConversationView as W, DEFAULT_WEB_READ_BUDGET as X, type DaemonErrorCode as Y, type DecideOptions as Z, type DiffRow as _, AUTORUN_RISK as a, type PendingApproval as a$, type DiffStat as a0, type DisplayBlock as a1, EMPTY_CONVERSATION as a2, EMPTY_HOLD as a3, EMPTY_RUN as a4, EMPTY_TASK_LOG as a5, EMPTY_TASK_LOG_FOLLOW as a6, type ErrorBody as a7, type ExecuteCommandResponse as a8, type ExecuteResponse as a9, type LiveTail as aA, type LiveTailOptions as aB, type LocalEntry as aC, type LoopCheckFacts as aD, type LoopCheckState as aE, type LoopGuard as aF, type MappedTool as aG, type MarkdownToken as aH, type MergeGateEntry as aI, type MergeGateResponse as aJ, type MergeWordingHandoff as aK, type MessageBlock as aL, type MessageRole as aM, type ModelsResponse as aN, NOT_STARTED as aO, NO_TURN as aP, type NewTaskFields as aQ, type NotificationAction as aR, OUTPUT_LINES_DEFAULT as aS, OUTPUT_LINES_MAX as aT, type OkResponse as aU, type OpRef as aV, type OpRefusal as aW, type OrchestratorObserver as aX, type OutputPreview as aY, type OverrideDirection as aZ, PLANNED_WITH_LABEL as a_, type ExecutionCommand as aa, ExecutionCommands as ab, type ExecutionHost as ac, type ExecutionSummary as ad, type GatedConversation as ae, type GeneratePlanResponse as af, type GlobalRunSettings as ag, HEADLESS_CLI_COMMANDS as ah, type HandoffBlock as ai, type HandoffForkRepo as aj, type HandoffPeekSubject as ak, type IAiService as al, IDLE_ACTIVITY as am, type INotification as an, type IWebFetcher as ao, type IsolationDiffResponse as ap, type IsolationMergeResponse as aq, type IsolationPreviewNotice as ar, type IsolationPreviewResponse as as, IsolationRunController as at, LEASE_HEARTBEAT_MS as au, LEASE_STALE_MS as av, LeaseHost as aw, type LeaseHostKind as ax, type LeaseHostOptions as ay, type LiveOutputLookup as az, type AccountLimitBucket as b, type SessionData as b$, PendingApprovals as b0, type PendingApprovalsOptions as b1, type PlanBlock as b2, type PlanBlocks as b3, type PlanIntake as b4, type PlanMarkerStatus as b5, type PlanResponse as b6, type PlanSnapshot as b7, PlanStore as b8, type PlannerCommandSyntax as b9, type RewindTarget as bA, type RewindTargetsResponse as bB, type RunActivity as bC, type RunInput as bD, type RunMergeView as bE, RunSettingsError as bF, type RunSnapshotFrame as bG, type RunTask as bH, type RunTaskStatus as bI, type RunView as bJ, type RunnerAuth as bK, type RunnerAuthExec as bL, type RunnerAuthExecOptions as bM, type RunnerAuthExecResult as bN, type RunnerCatalog as bO, type RunnerLoadedBlock as bP, type RunnersResponse as bQ, STOPPED_BEFORE_START as bR, SUPERVISOR_LEVELS as bS, SUPERVISOR_LEVEL_LABEL as bT, type SerializedConversationMessage as bU, type SerializedPendingTurn as bV, type SerializedPlan as bW, type SerializedTask as bX, type SerializedTaskStatus as bY, type ServerInfoResponse as bZ, type SessionBroadcaster as b_, type PlannerContextDeps as ba, type PlannerContextStatus as bb, PlannerConversation as bc, type PlannerConversationHost as bd, type PlannerModelCandidate as be, type PlannerModelChoice as bf, PlannerModelMemory as bg, type PlannerModelRecall as bh, type PlannerModelStore as bi, type PlannerModes as bj, type PlannerNotReady as bk, PlannerNotReadyError as bl, type PlannerReadinessConfig as bm, type PlannerSubmission as bn, PlannerTurnDiscardedError as bo, PlannerTurnStoppedError as bp, PlannerUsageLimitError as bq, type PrdResponse as br, type PromptHold as bs, REPORT_PREVIEW_LINES as bt, RUN_SETTINGS_DEFAULTS as bu, type ReadRunnerAuthOptions as bv, type RefTask as bw, ResearchTasks as bx, type ResolveAll as by, type ResolveConflictResponse as bz, type AccountLimitSnapshot as c, type TaskRowPlacement as c$, type SessionFrame as c0, type SessionHeld as c1, SessionHeldError as c2, type SessionLease as c3, type SessionLeaseRecord as c4, type SessionListResponse as c5, type SessionMessage as c6, type SessionMeta as c7, type SessionNotice as c8, type SessionResponse as c9, type TaskLogBatch as cA, type TaskLogEvent as cB, type TaskLogFollow as cC, type TaskLogFollowInput as cD, type TaskLogHeaderKind as cE, type TaskLogHeaderTask as cF, type TaskLogHeaderUsage as cG, type TaskLogHeaderView as cH, type TaskLogResponse as cI, type TaskLogView as cJ, type TaskMessageResponse as cK, type TaskOp as cL, TaskOrchestrator as cM, type TaskOrchestratorDeps as cN, type TaskOrchestratorOptions as cO, type TaskOutputSource as cP, type TaskPlacement as cQ, type TaskQuery as cR, type TaskQueryCatalog as cS, type TaskQueryField as cT, type TaskRef as cU, type TaskRowAction as cV, type TaskRowContext as cW, type TaskRowHandoff as cX, type TaskRowIsolation as cY, type TaskRowKind as cZ, type TaskRowLoop as c_, type SettingsResponse as ca, SettingsService as cb, type SettingsUpdateResponse as cc, type SkillInvocation as cd, type SkillLoadBlock as ce, type SkillToken as cf, type StartAdmission as cg, type StopResponse as ch, type StreamStamp as ci, type SubagentBlock as cj, type SubagentChild as ck, type SubagentStatus as cl, type SupervisorPolicy as cm, type SurfacePlan as cn, type SurfacePlanState as co, type SurfaceTask as cp, TASK_QUERY_ANSWER_MAX_CHARS as cq, TASK_QUERY_ANSWER_OR_OPS as cr, TASK_QUERY_FIELDS as cs, TASK_QUERY_PROTOCOL as ct, TASK_QUERY_REMINDER as cu, TERMINAL_UI_COMMANDS as cv, type TakenPrompt as cw, type TaskAction as cx, type TaskAttemptSnapshot as cy, type TaskLogAttemptsResponse as cz, type AccountLimitStatus as d, describeMergeResult as d$, type TaskRowSubject as d0, type TaskRowUsage as d1, type TaskRowView as d2, type TaskRunFacts as d3, type TaskStatusKind as d4, type ThinkingDisplayBlock as d5, type ToolBlock as d6, type ToolHeadline as d7, type ToolStatus as d8, type TreeTask as d9, assignmentIssueText as dA, attachingLabel as dB, automergeSummary as dC, autorunSummary as dD, awaitingLabel as dE, blockNotice as dF, blockNotices as dG, blockedByLabel as dH, blockingFailures as dI, canMergeTasks as dJ, canSetDependencies as dK, canSplitTask as dL, capConflictFiles as dM, cardEditNeedsUnstarted as dN, cardEditable as dO, checkoutRule as dP, classifyOutcome as dQ, coalesceTaskLog as dR, compactionText as dS, confirmedOverride as dT, createAiService as dU, dependencyCandidates as dV, dependentsNotice as dW, dependentsOf as dX, describeHeld as dY, describeHolder as dZ, describeIsolationPreview as d_, TurnBudgets as da, type TurnGate as db, type UsageBlock as dc, type UserSettings as dd, WAITS_FOR_APPROVAL_LABEL as de, type WakeUpItem as df, type WebRead as dg, type WebReadDecision as dh, type WebReadOptions as di, WebReadPolicy as dj, type Worded as dk, type WorkspacesResponse as dl, abbreviateHome as dm, accountLimitPercentText as dn, accountLimitWindowLabel as dp, accountLimitsOf as dq, accountLimitsText as dr, accountLimitsTitle as ds, aheadOfDraft as dt, applyTaskOps as du, approvalKindText as dv, approvalLabel as dw, approvalStatusText as dx, assignedRunnerOf as dy, assignmentIssue as dz, type AccountLimitWindow as e, ranSealed as e$, describePlannerNotReady as e0, diffRows as e1, diffStat as e2, diffSummary as e3, digestTaskLog as e4, drainNext as e5, editableWhileRunning as e6, executionSummary as e7, followTaskLog as e8, followTurn as e9, mapAgentTool as eA, markAction as eB, markdownHtml as eC, markdownTokens as eD, mergeOutcome as eE, mergeTarget as eF, namedRepos as eG, newTaskFields as eH, noExecutorRefusal as eI, normalizeAgentArgs as eJ, opRefusalText as eK, opsEditable as eL, outputLines as eM, outputPreview as eN, overrideNeedsConfirmation as eO, parseCount as eP, parseSwitch as eQ, parseTaskOpsJson as eR, parseTaskQueryJson as eS, pastGateConfirmation as eT, planBlocks as eU, planMarkerParts as eV, plannerMessage as eW, plannerNotReady as eX, plannerNotReadyFor as eY, plannerTranscript as eZ, processLeaseHost as e_, fromTranscript as ea, getSettingsPath as eb, handoffBaseLine as ec, handoffBranchName as ed, handoffFindingsText as ee, handoffPeekParts as ef, hasAccountLimits as eg, hasHiddenDetail as eh, hasLongReport as ei, holdLabel as ej, holdPrompt as ek, isFileEditTool as el, isRepoGroup as em, isTaskRunning as en, lastServedModel as eo, loadedSkillTokens as ep, logContinues as eq, logResumes as er, loopBodyLabel as es, loopBodyRound as et, loopCheckLabel as eu, loopCheckState as ev, loopLeaveNotice as ew, loopRowParts as ex, manualOverrideConfirmation as ey, manualOverrideStopFirst as ez, type AccountLimitsFrame as f, truncateCheckpointSummary as f$, readRunnerAuth as f0, receiptLabel as f1, reconcileApprovals as f2, recordRunnerAuth as f3, recordedRunnerAuth as f4, reduceConversation as f5, reduceRun as f6, reduceTaskLog as f7, renderTaskQueryAnswer as f8, repairedLanded as f9, supervisorSummary as fA, surfacePlan as fB, surfacePlanState as fC, takeAt as fD, taskActionCommand as fE, taskChatAvailable as fF, taskLogCommands as fG, taskLogForSurface as fH, taskLogHeaderView as fI, taskOrderLabel as fJ, taskPlacement as fK, taskQuerySignature as fL, taskRef as fM, taskRefOf as fN, taskRowActions as fO, taskRowView as fP, taskStartedNotice as fQ, taskStatusKind as fR, textHasTaskOps as fS, textHasTaskQuery as fT, titledRefs as fU, titledTaskRef as fV, titledTaskRefOf as fW, toTaskLogEvent as fX, toolHeadline as fY, trailerSummary as fZ, trimToolOutput as f_, repairedNotice as fa, repeatingChecks as fb, replayTaskLog as fc, repoBaseLine as fd, repoResultLines as fe, reposWithWork as ff, resetRunnerAuth as fg, resolveSkillInvocation as fh, resolveTaskRef as fi, resolveUserTaskRef as fj, resumeLabel as fk, resumeTime as fl, runHoldsEditors as fm, runSettingsOf as fn, runnerToolSubject as fo, scriptExitText as fp, scriptRunText as fq, secondsText as fr, serializePlan as fs, serializeTask as ft, serializeTaskStatus as fu, skillTokens as fv, skippedLabel as fw, stopTurn as fx, subtreeIds as fy, summarizeToolCall as fz, type AccountLimitsMessage as g, unsendAll as g0, unsendLatest as g1, wakeUpItems as g2, walkPlan as g3, withoutSealedMark as g4, workspaceEnvOf as g5, type AdoptSessionResponse as h, type ApplyTaskOpsResult as i, type ApprovalAnswerResponse as j, type ApprovalBlock as k, type ApprovalRequestMessage as l, type ApprovalStatus as m, type ApprovalsResponse as n, type ApproveReviewResponse as o, type AskOptions as p, type AssignmentCatalog as q, type AssignmentIssue as r, type AssignmentScope as s, type AssignmentWriter as t, type AutoMergeTrigger as u, CHECKPOINT_TRUNCATE_LENGTH as v, type CancelPlanningResponse as w, type CancelResumeResponse as x, CliAgentAiService as y, type CliAgentAiServiceDeps as z };
|
|
8336
|
+
export { type DaemonErrorCode as $, ACT_RISK as A, type BlockingSubject as B, CHAT_COMMANDS as C, type CliAgentAiServiceDeps as D, type CommandBlock as E, type CommandDescriptor as F, type CommandOutcome as G, type CommandPayload as H, type CommandStatus as I, type CommandsResponse as J, type CompactionBlock as K, type CompactionStatus as L, type Consent as M, type ContextCondenseRequest as N, ConversationBusyError as O, type ConversationCompactResponse as P, type ConversationCompaction as Q, ConversationEditError as R, type ConversationForkResponse as S, type ConversationInput as T, type ConversationRequest as U, type ConversationRewindResponse as V, type ConversationTurn as W, type ConversationView as X, DEFAULT_WEB_READ_BUDGET as Y, DELEGATION_OFFERED as Z, DELEGATION_RISK as _, AUTORUN_RISK as a, type MergeGateEntry as a$, type DecideOptions as a0, type DiffRow as a1, type DiffRowKind as a2, type DiffStat as a3, type DisplayBlock as a4, EMPTY_CONVERSATION as a5, EMPTY_HOLD as a6, EMPTY_RUN as a7, EMPTY_TASK_LOG as a8, EMPTY_TASK_LOG_FOLLOW as a9, IDLE_ACTIVITY as aA, type INotification as aB, type IWebFetcher as aC, type IsolationDiffResponse as aD, type IsolationMergeResponse as aE, type IsolationPreviewNotice as aF, type IsolationPreviewResponse as aG, IsolationRunController as aH, LEASE_HEARTBEAT_MS as aI, LEASE_STALE_MS as aJ, LeaseHost as aK, type LeaseHostKind as aL, type LeaseHostOptions as aM, type LiveOutputLookup as aN, type LiveTail as aO, type LiveTailOptions as aP, type LocalEntry as aQ, type LoopCheckFacts as aR, type LoopCheckState as aS, type LoopGuard as aT, type Mandate as aU, type MandateExclusions as aV, type MandateLimits as aW, type MandateRefusal as aX, type MandateRequest as aY, type MappedTool as aZ, type MarkdownToken as a_, type EffectRules 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, FLOOR_GRANTS as ap, GRANTS as aq, type GatedConversation as ar, type GeneratePlanResponse as as, type GlobalRunSettings as at, type Grant as au, HEADLESS_CLI_COMMANDS as av, type HandoffBlock as aw, type HandoffForkRepo as ax, type HandoffPeekSubject as ay, type IAiService as az, type AccountLimitBucket as b, type RootSettings as b$, type MergeGateResponse as b0, type MergeWordingHandoff as b1, type MessageBlock as b2, type MessageRole as b3, type ModelsResponse as b4, NOT_STARTED as b5, NO_TURN as b6, type Narrowed as b7, type NewTaskFields as b8, type NodeAuthority as b9, type PlannerModelChoice as bA, PlannerModelMemory as bB, type PlannerModelRecall as bC, type PlannerModelStore as bD, type PlannerModes as bE, type PlannerNotReady as bF, PlannerNotReadyError as bG, type PlannerReadinessConfig as bH, type PlannerSubmission as bI, PlannerTurnDiscardedError as bJ, PlannerTurnStoppedError as bK, PlannerUsageLimitError as bL, type PrdResponse as bM, type PromptHold as bN, REPORT_PREVIEW_LINES as bO, RUN_SETTINGS_DEFAULTS as bP, type ReadRunnerAuthOptions as bQ, type RefTask as bR, ResearchTasks as bS, type ResolveAll as bT, type ResolveConflictResponse as bU, type RevertPreviewTask as bV, type RevertRefusal as bW, type RevertRefusalReason as bX, type RevertScope as bY, type RewindTarget as bZ, type RewindTargetsResponse as b_, type NotificationAction as ba, OUTPUT_LINES_DEFAULT as bb, OUTPUT_LINES_MAX as bc, type OkResponse as bd, type OpRef as be, type OpRefusal as bf, type OrchestratorObserver as bg, type OutputPreview as bh, type OverrideDirection as bi, PLANNED_WITH_LABEL as bj, type PendingApproval as bk, PendingApprovals as bl, type PendingApprovalsOptions as bm, type PlanBlock as bn, type PlanBlocks as bo, type PlanIntake as bp, type PlanMarkerStatus as bq, type PlanResponse as br, type PlanSnapshot as bs, PlanStore as bt, type PlannerCommandSyntax as bu, type PlannerContextDeps as bv, type PlannerContextStatus as bw, PlannerConversation as bx, type PlannerConversationHost as by, type PlannerModelCandidate as bz, type AccountLimitSnapshot as c, type TaskLogBatch as c$, type RunActivity as c0, type RunInput as c1, type RunMergeView as c2, RunSettingsError as c3, type RunSnapshotFrame as c4, type RunTask as c5, type RunTaskStatus as c6, type RunView as c7, type RunnerAuth as c8, type RunnerAuthExec as c9, type SessionResponse as cA, type SettingsResponse as cB, SettingsService as cC, type SettingsUpdateResponse as cD, type SkillInvocation as cE, type SkillLoadBlock as cF, type SkillToken as cG, type StartAdmission as cH, type StopResponse as cI, type StreamStamp as cJ, type SubagentBlock as cK, type SubagentChild as cL, type SubagentStatus as cM, type SurfacePlan as cN, type SurfacePlanState as cO, type SurfaceTask as cP, TASK_QUERY_ANSWER_MAX_CHARS as cQ, TASK_QUERY_ANSWER_OR_OPS as cR, TASK_QUERY_FIELDS as cS, TASK_QUERY_PROTOCOL as cT, TASK_QUERY_REMINDER as cU, TERMINAL_UI_COMMANDS as cV, type TakenPrompt as cW, type TaskAction as cX, type TaskActivity as cY, type TaskAttemptSnapshot as cZ, type TaskLogAttemptsResponse as c_, type RunnerAuthExecOptions as ca, type RunnerAuthExecResult as cb, type RunnerCatalog as cc, type RunnerLoadedBlock as cd, type RunnersResponse as ce, SHAPE_LIMITS as cf, STALLED_LABEL as cg, STOPPED_BEFORE_START as ch, SUPERVISOR_LEVEL_LABEL as ci, type SerializedConversationMessage as cj, type SerializedPendingTurn as ck, type SerializedPlan as cl, type SerializedTask as cm, type SerializedTaskStatus as cn, type ServerInfoResponse as co, type SessionBroadcaster as cp, type SessionData as cq, type SessionFrame as cr, type SessionHeld as cs, SessionHeldError as ct, type SessionLease as cu, type SessionLeaseRecord as cv, type SessionListResponse as cw, type SessionMessage as cx, type SessionMeta as cy, type SessionNotice as cz, type AccountLimitStatus as d, approvalStatusText as d$, type TaskLogEvent as d0, type TaskLogFollow as d1, type TaskLogFollowInput as d2, type TaskLogHeaderKind as d3, type TaskLogHeaderTask as d4, type TaskLogHeaderUsage as d5, type TaskLogHeaderView as d6, type TaskLogResponse as d7, type TaskLogView as d8, type TaskMessageResponse as d9, type ToolBlock as dA, type ToolHeadline as dB, type ToolStatus as dC, type TreeTask as dD, TurnBudgets as dE, type TurnGate as dF, type UsageBlock as dG, type UserSettings as dH, WAITS_FOR_APPROVAL_LABEL as dI, type WakeUpItem as dJ, type WebRead as dK, type WebReadDecision as dL, type WebReadOptions as dM, WebReadPolicy as dN, type Worded as dO, type WorkspacesResponse as dP, abbreviateHome as dQ, accountLimitPercentText as dR, accountLimitWindowLabel as dS, accountLimitsOf as dT, accountLimitsText as dU, accountLimitsTitle as dV, activityLabel as dW, aheadOfDraft as dX, applyTaskOps as dY, approvalKindText as dZ, approvalLabel as d_, type TaskOp as da, TaskOrchestrator as db, type TaskOrchestratorDeps as dc, type TaskOrchestratorOptions as dd, type TaskOutputSource as de, type TaskPlacement as df, type TaskQuery as dg, type TaskQueryCatalog as dh, type TaskQueryField as di, type TaskRef as dj, type TaskRevertPreview as dk, type TaskRevertPreviewResponse as dl, type TaskRowAction as dm, type TaskRowContext as dn, type TaskRowHandoff as dp, type TaskRowIsolation as dq, type TaskRowKind as dr, type TaskRowLoop as ds, type TaskRowPlacement as dt, type TaskRowSubject as du, type TaskRowUsage as dv, type TaskRowView as dw, type TaskRunFacts as dx, type TaskStatusKind as dy, type ThinkingDisplayBlock as dz, type AccountLimitWindow as e, logContinues as e$, assignedRunnerOf as e0, assignmentIssue as e1, assignmentIssueText as e2, attachingLabel as e3, automergeSummary as e4, autorunSummary as e5, awaitingLabel as e6, blockNotice as e7, blockNotices as e8, blockedByLabel as e9, digestTaskLog as eA, drainNext as eB, editableWhileRunning as eC, effectRuleFor as eD, elapsedSince as eE, escalations as eF, executionSummary as eG, followTaskLog as eH, followTurn as eI, formatElapsed as eJ, fromTranscript as eK, getSettingsPath as eL, handoffBaseLine as eM, handoffBranchName as eN, handoffFindingsText as eO, handoffPeekParts as eP, hasAccountLimits as eQ, hasHiddenDetail as eR, hasLongReport as eS, heldMandate as eT, holdLabel as eU, holdPrompt as eV, isFileEditTool as eW, isRepoGroup as eX, isTaskRunning as eY, lastServedModel as eZ, loadedSkillTokens as e_, blockingFailures as ea, canMergeTasks as eb, canSetDependencies as ec, canSplitTask as ed, capConflictFiles as ee, cardEditNeedsUnstarted as ef, cardEditable as eg, checkoutRule as eh, classifyOutcome as ei, closeTurn as ej, coalesceTaskLog as ek, compactionText as el, confirmedOverride as em, createAiService as en, delegationSummary as eo, dependencyCandidates as ep, dependentsNotice as eq, dependentsOf as er, describeHeld as es, describeHolder as et, describeIsolationPreview as eu, describeMergeResult as ev, describePlannerNotReady as ew, diffRows as ex, diffStat as ey, diffSummary as ez, type AccountLimitsFrame as f, resumeTime as f$, logResumes as f0, loopBodyLabel as f1, loopBodyRound as f2, loopCheckLabel as f3, loopCheckState as f4, loopLeaveNotice as f5, loopRowParts as f6, mandateRefusalText as f7, manualOverrideConfirmation as f8, manualOverrideStopFirst as f9, plannerNotReady as fA, plannerNotReadyFor as fB, plannerTranscript as fC, processLeaseHost as fD, ranSealed as fE, readRunnerAuth as fF, receiptLabel as fG, reconcileApprovals as fH, recordRunnerAuth as fI, recordedRunnerAuth as fJ, reduceConversation as fK, reduceRun as fL, reduceTaskLog as fM, renderTaskQueryAnswer as fN, repairWaitLabel as fO, repairedLanded as fP, repairedNotice as fQ, repeatingChecks as fR, replayTaskLog as fS, repoBaseLine as fT, repoResultLines as fU, reposWithWork as fV, resetRunnerAuth as fW, resolveSkillInvocation as fX, resolveTaskRef as fY, resolveUserTaskRef as fZ, resumeLabel as f_, mapAgentTool as fa, markAction as fb, markdownHtml as fc, markdownTokens as fd, mergeOutcome as fe, mergeTarget as ff, namedRepos as fg, narrow as fh, newTaskFields as fi, noExecutorRefusal as fj, normalizeAgentArgs as fk, opRefusalText as fl, opsEditable as fm, outputLines as fn, outputPreview as fo, overrideNeedsConfirmation as fp, parseCount as fq, parseDelegation as fr, parseEffectAllowlist as fs, parseSwitch as ft, parseTaskOpsJson as fu, parseTaskQueryJson as fv, pastGateConfirmation as fw, planBlocks as fx, planMarkerParts as fy, plannerMessage as fz, type AccountLimitsMessage as g, revertEffect as g0, revertListLine as g1, revertTaskRef as g2, rootAuthority as g3, rootMandate as g4, runHoldsEditors as g5, runSettingsOf as g6, runnerToolSubject as g7, scriptExitText as g8, scriptRunText as g9, taskStartedNotice as gA, taskStatusKind as gB, textHasTaskOps as gC, textHasTaskQuery as gD, titledRefs as gE, titledTaskRef as gF, titledTaskRefOf as gG, toTaskLogEvent as gH, toolHeadline as gI, trailerSummary as gJ, trimToolOutput as gK, truncateCheckpointSummary as gL, unsendAll as gM, unsendLatest as gN, wakeUpItems as gO, walkPlan as gP, withoutSealedMark as gQ, workspaceEnvOf as gR, secondsText as ga, serializePlan as gb, serializeTask as gc, serializeTaskStatus as gd, skillTokens as ge, skippedLabel as gf, stopTurn as gg, subtreeIds as gh, summarizeToolCall as gi, supervisorSummary as gj, surfacePlan as gk, surfacePlanState as gl, takeAt as gm, taskActionCommand as gn, taskActivity as go, taskChatAvailable as gp, taskLogCommands as gq, taskLogForSurface as gr, taskLogHeaderView as gs, taskOrderLabel as gt, taskPlacement as gu, taskQuerySignature as gv, taskRef as gw, taskRefOf as gx, taskRowActions as gy, taskRowView 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, CliAgentAiService as z };
|