@ordewell/core 0.12.0 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ModeResolver-CHsaoV7M.d.ts → ModeResolver-B64aUZXJ.d.ts} +1 -1
- package/dist/{ModeResolver-b_7bPlBS.d.mts → ModeResolver-CA2fUU9h.d.mts} +1 -1
- package/dist/{Task-BTEH-ztX.d.mts → Task-CxGgN6I0.d.mts} +503 -16
- package/dist/{Task-BTEH-ztX.d.ts → Task-CxGgN6I0.d.ts} +503 -16
- package/dist/{chunk-BKTDYGIP.mjs → chunk-2IFKPYPO.mjs} +441 -17
- package/dist/chunk-2IFKPYPO.mjs.map +1 -0
- package/dist/{chunk-BFLVOYNR.mjs → chunk-FX33UKAD.mjs} +8 -6
- package/dist/chunk-FX33UKAD.mjs.map +1 -0
- package/dist/{chunk-F6WS3JLQ.mjs → chunk-PKJTN2PD.mjs} +20 -11
- package/dist/chunk-PKJTN2PD.mjs.map +1 -0
- package/dist/{chunk-HP2LNKST.mjs → chunk-RZ23BMVR.mjs} +345 -134
- package/dist/chunk-RZ23BMVR.mjs.map +1 -0
- package/dist/chunk-UDUATSCJ.mjs +48 -0
- package/dist/chunk-UDUATSCJ.mjs.map +1 -0
- package/dist/{IRunner-BwzyUVIL.d.mts → eventStore-CTCSKS9E.d.ts} +916 -129
- package/dist/{IRunner-DjJkYwko.d.ts → eventStore-CcB8yELZ.d.mts} +916 -129
- package/dist/index.d.mts +677 -97
- package/dist/index.d.ts +677 -97
- package/dist/index.js +8233 -2450
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6951 -1772
- 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 +277 -21
- package/dist/parsing.js.map +1 -1
- package/dist/parsing.mjs +3 -3
- package/dist/plan-utils.d.mts +30 -5
- package/dist/plan-utils.d.ts +30 -5
- package/dist/plan-utils.js +163 -16
- package/dist/plan-utils.js.map +1 -1
- package/dist/plan-utils.mjs +49 -3
- package/dist/plan-utils.mjs.map +1 -1
- package/dist/{runSettingsText-x-YML2ay.d.mts → runSettingsText-DFVpe6aU.d.mts} +1142 -934
- package/dist/{runSettingsText-CvZ40IPv.d.ts → runSettingsText-lKLDsyli.d.ts} +1142 -934
- package/dist/testing.d.mts +83 -4
- package/dist/testing.d.ts +83 -4
- package/dist/testing.js +142 -1
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +126 -2
- package/dist/testing.mjs.map +1 -1
- package/docker/task.Dockerfile +22 -0
- package/package.json +2 -1
- package/skills/diagnose/SKILL.md +2 -2
- package/skills/explore/SKILL.md +1 -1
- package/dist/chunk-BFLVOYNR.mjs.map +0 -1
- package/dist/chunk-BKTDYGIP.mjs.map +0 -1
- package/dist/chunk-F6WS3JLQ.mjs.map +0 -1
- package/dist/chunk-HP2LNKST.mjs.map +0 -1
|
@@ -5,7 +5,7 @@ declare const SEVERITY_LABEL: Record<FindingSeverity, string>;
|
|
|
5
5
|
declare function severityLabel(severity: FindingSeverity): string;
|
|
6
6
|
/** The worst severity among `findings`, or null for none: what a compact row says at a glance. */
|
|
7
7
|
declare function worstSeverity(findings: readonly Pick<HandoffFinding, 'severity'>[]): FindingSeverity | null;
|
|
8
|
-
/** The plan a pinned reference is under
|
|
8
|
+
/** The root's plan: the node a pinned reference is under until a plan below names its own (ADR-0057 R1). */
|
|
9
9
|
declare const ROOT_NODE = "root";
|
|
10
10
|
/**
|
|
11
11
|
* A typed reference a reader can check rather than trust. A `task` names the
|
|
@@ -26,16 +26,23 @@ type HandoffEvidence = {
|
|
|
26
26
|
sha: string;
|
|
27
27
|
repo?: string;
|
|
28
28
|
resolved?: boolean;
|
|
29
|
-
} | {
|
|
29
|
+
} | TaskEvidence | {
|
|
30
|
+
kind: 'url';
|
|
31
|
+
url: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* `label` is how the task's own plan names it, kept once a reference has
|
|
35
|
+
* crossed a level: a reader in another plan has no plan to name it from, and a
|
|
36
|
+
* task id can repeat between plans, so no plan names one that has it.
|
|
37
|
+
*/
|
|
38
|
+
interface TaskEvidence {
|
|
30
39
|
kind: 'task';
|
|
31
40
|
node?: string;
|
|
32
41
|
task: string;
|
|
33
42
|
attempt?: number;
|
|
34
43
|
finding?: string;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
url: string;
|
|
38
|
-
};
|
|
44
|
+
label?: string;
|
|
45
|
+
}
|
|
39
46
|
/**
|
|
40
47
|
* What a saved patch does not carry as the task's worktree held it
|
|
41
48
|
* (ADR-0050): `excluded`, a symbolic link or a submodule, never carried;
|
|
@@ -92,6 +99,41 @@ interface HandoffCommit {
|
|
|
92
99
|
subject: string;
|
|
93
100
|
body?: string;
|
|
94
101
|
}
|
|
102
|
+
/** A finding as it crossed a level (ADR-0057 R2): its author's words, by the reference that names it. A subplanner's own has none. */
|
|
103
|
+
interface ReportItem {
|
|
104
|
+
ref?: TaskEvidence;
|
|
105
|
+
finding: HandoffFinding;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* What a delegated task's report carries past any task's (ADR-0057 R2). All of
|
|
109
|
+
* it comes from Ordewell, the findings by reference, so what a subplanner left
|
|
110
|
+
* out shows and it cannot have reworded what it passes on. It is read once, as
|
|
111
|
+
* the report is taken, so the renderer stays a pure function of the digest:
|
|
112
|
+
* references are pinned, so the words cannot have moved.
|
|
113
|
+
*/
|
|
114
|
+
interface SubtreeReport {
|
|
115
|
+
/** The child plan's node: what a read of this report's subtree starts from. */
|
|
116
|
+
node: string;
|
|
117
|
+
counts: {
|
|
118
|
+
done: number;
|
|
119
|
+
failed: number;
|
|
120
|
+
blocked: number;
|
|
121
|
+
skipped: number;
|
|
122
|
+
commits: number;
|
|
123
|
+
tokens: number;
|
|
124
|
+
};
|
|
125
|
+
/** Every finding below, by severity, read from the latest attempt of each task. */
|
|
126
|
+
findings: Record<FindingSeverity, number>;
|
|
127
|
+
/** What the parent must decide. */
|
|
128
|
+
open: ReportItem[];
|
|
129
|
+
/** What the subplanner passed up. */
|
|
130
|
+
promoted: ReportItem[];
|
|
131
|
+
/** What its branch changed outside its declared scope, first paths and how many (ADR-0056 M7). */
|
|
132
|
+
outsideScope?: {
|
|
133
|
+
paths: string[];
|
|
134
|
+
count: number;
|
|
135
|
+
};
|
|
136
|
+
}
|
|
95
137
|
/** What the plan keeps on a task: enough for a surface or a dependent's prompt without reading a log. */
|
|
96
138
|
interface HandoffDigest {
|
|
97
139
|
commit?: HandoffCommit;
|
|
@@ -102,6 +144,10 @@ interface HandoffDigest {
|
|
|
102
144
|
artifacts?: HandoffArtifact[];
|
|
103
145
|
/** The attempt it is from, which a reference to it is pinned to (ADR-0057 R1); absent on a plan saved before it was kept. */
|
|
104
146
|
attempt?: number;
|
|
147
|
+
/** A delegated task's: what Ordewell derived of its subtree. */
|
|
148
|
+
subtree?: SubtreeReport;
|
|
149
|
+
/** A delegated task's words with no {@link subtree} to say whose they are: a repair's, or a report that never opened a child. */
|
|
150
|
+
held?: true;
|
|
105
151
|
}
|
|
106
152
|
/** The whole handoff, as the attempt's log keeps it. */
|
|
107
153
|
interface StoredHandoff extends HandoffDigest {
|
|
@@ -116,6 +162,7 @@ interface Handoff {
|
|
|
116
162
|
findings?: Omit<HandoffFinding, 'id'>[];
|
|
117
163
|
artifacts?: HandoffArtifact[];
|
|
118
164
|
report?: string;
|
|
165
|
+
subtree?: SubtreeReport;
|
|
119
166
|
}
|
|
120
167
|
/** The most a report keeps: whole findings fit, and a runaway one does not bloat the files that hold it. */
|
|
121
168
|
declare const REPORT_MAX_CHARS = 20000;
|
|
@@ -128,6 +175,7 @@ declare const HANDOFF_LIMITS: {
|
|
|
128
175
|
readonly commitSubject: 100;
|
|
129
176
|
readonly commitBody: 500;
|
|
130
177
|
readonly findings: 50;
|
|
178
|
+
readonly promoted: 8;
|
|
131
179
|
readonly title: 200;
|
|
132
180
|
readonly detail: 2000;
|
|
133
181
|
readonly reference: 2000;
|
|
@@ -159,6 +207,13 @@ interface WrittenTaskRef {
|
|
|
159
207
|
attempt?: number;
|
|
160
208
|
finding?: string;
|
|
161
209
|
}
|
|
210
|
+
/** The plan a written reference names below this one, `3/2:#4@2/F3`, and the rest as a plan reads it (ADR-0057 R1). */
|
|
211
|
+
declare function parsePlanPath(written: string): {
|
|
212
|
+
path: string;
|
|
213
|
+
rest: string;
|
|
214
|
+
} | undefined;
|
|
215
|
+
/** A node's path as a reader writes it: `root/3/2` is `3/2`. */
|
|
216
|
+
declare function nodeText(node: string): string;
|
|
162
217
|
/**
|
|
163
218
|
* The parts of a written reference, its task as written. What this cuts off
|
|
164
219
|
* is no part of `TaskRefs`' grammar, which stays as it was; a caller tries the
|
|
@@ -182,7 +237,7 @@ declare function resolveWrittenRef(plan: readonly Task[], written: string): (Omi
|
|
|
182
237
|
* reference naming no attempt takes the newest one cited. `asked` is an attempt
|
|
183
238
|
* given apart from the text. Undefined when nothing it may read cites one.
|
|
184
239
|
*/
|
|
185
|
-
declare function removedAttempt(plan: readonly Task[],
|
|
240
|
+
declare function removedAttempt(plan: readonly Task[], readable: ReadonlySet<string>, logs: HandoffLogs, written: string, asked?: number): {
|
|
186
241
|
taskId: string;
|
|
187
242
|
attempt: number;
|
|
188
243
|
finding?: string;
|
|
@@ -240,6 +295,12 @@ declare function savedPatchView(handoff: HandoffDigest | undefined): PatchView |
|
|
|
240
295
|
declare function findingLines(f: HandoffFinding, taskName?: HandoffTaskName): string[];
|
|
241
296
|
/** A handoff's artifacts as one line, or none when it lists none. */
|
|
242
297
|
declare function artifactLines(handoff: HandoffDigest, taskName?: HandoffTaskName): string[];
|
|
298
|
+
/** A delegated task's words as its parent's update holds them, every line indented, so none can pass for a line of Ordewell's (ADR-0057 R3). */
|
|
299
|
+
declare function heldWords(text: string): string[];
|
|
300
|
+
/** The same handoff, marked as a delegated task's where no report already says so: a mark that travels with it to whatever renders it. */
|
|
301
|
+
declare function heldHandoff<H extends HandoffDigest>(task: {
|
|
302
|
+
type?: string;
|
|
303
|
+
}, handoff: H): H;
|
|
243
304
|
/** A handoff's opening as text: its commit, subject then body, then the summary. */
|
|
244
305
|
declare function openingLines(handoff: HandoffDigest): string[];
|
|
245
306
|
/**
|
|
@@ -302,7 +363,26 @@ interface HandoffPins {
|
|
|
302
363
|
logs?: HandoffLogs;
|
|
303
364
|
/** The attempt making the call: what a task naming itself is pinned to. */
|
|
304
365
|
attempt?: number;
|
|
366
|
+
/** The plan these references are pinned under. Absent, the root's. */
|
|
367
|
+
node?: string;
|
|
368
|
+
/** What the producer may cite in `plan`, for one the plan's graph cannot give it: a subplanner, the plan below its own delegated task, is in none of its tasks' graphs. */
|
|
369
|
+
readable?: ReadonlySet<string>;
|
|
370
|
+
/** The plan at a path below this one that the producer may read; undefined for one it may not, or that is not there. */
|
|
371
|
+
below?: (path: string) => BelowPlan | undefined;
|
|
372
|
+
/** The handoff goes up a level, so what it cites keeps the name its plan gives it. */
|
|
373
|
+
crossing?: true;
|
|
305
374
|
}
|
|
375
|
+
/** A plan of the subtree, as a reference reads it. */
|
|
376
|
+
interface BelowPlan {
|
|
377
|
+
node: string;
|
|
378
|
+
tasks: readonly Task[];
|
|
379
|
+
logs: HandoffLogs;
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* One written reference pinned, in the producer's plan or a plan below it:
|
|
383
|
+
* the text is tried whole first, since a title may read like a path.
|
|
384
|
+
*/
|
|
385
|
+
declare function pinReference(plan: readonly Task[], producerId: string, pins: HandoffPins, ref: TaskEvidence, field: string, findings: number, refuse: (why: string) => void): TaskEvidence | undefined;
|
|
306
386
|
/**
|
|
307
387
|
* Check the references a handoff makes, at the call (ADR-0047): a `task`
|
|
308
388
|
* must be one the producer may read and a finding of it one that exists, and
|
|
@@ -319,6 +399,8 @@ interface HandoffPins {
|
|
|
319
399
|
declare function checkHandoff<H extends Handoff>(handoff: H, producerId: string, plan: readonly Task[], pins?: HandoffPins): HandoffCheck<H>;
|
|
320
400
|
|
|
321
401
|
interface TaskDiffRead {
|
|
402
|
+
/** Only the changed paths, joined by NUL: what a verdict reads (ADR-0055 D6). */
|
|
403
|
+
names?: boolean;
|
|
322
404
|
repo?: string;
|
|
323
405
|
path?: string;
|
|
324
406
|
}
|
|
@@ -472,6 +554,8 @@ interface IsolationTaskRecord {
|
|
|
472
554
|
status: IsolationTaskStatus;
|
|
473
555
|
/** Keyed by repo path. */
|
|
474
556
|
repos: Record<string, IsolationTaskRepo>;
|
|
557
|
+
/** The child session whose code root this worktree is (ADR-0055 D11): what stops a prune taking it from under that child (D17). */
|
|
558
|
+
childSession?: string;
|
|
475
559
|
/** Unrecovered branches from a conflict fallback, so a later continue cannot forget them. */
|
|
476
560
|
continuationWork?: PreservedWork[];
|
|
477
561
|
/** The repo whose merge stopped the task from landing, while `status` is `conflict` or `failed`. */
|
|
@@ -572,7 +656,13 @@ interface IsolationRepo {
|
|
|
572
656
|
*/
|
|
573
657
|
interface IsolationRun {
|
|
574
658
|
id: string;
|
|
659
|
+
/** The code root: what git reads for the run's repos, branch and base (ADR-0055 D11). */
|
|
575
660
|
workspaceRoot: string;
|
|
661
|
+
/**
|
|
662
|
+
* A child run's state root, the root Session's workspace: where its worktrees
|
|
663
|
+
* and Ordewell's own files go. Absent on a flat run, whose workspace is both.
|
|
664
|
+
*/
|
|
665
|
+
stateRoot?: string;
|
|
576
666
|
repos: IsolationRepo[];
|
|
577
667
|
/**
|
|
578
668
|
* Workspace paths outside every isolated repo, linked live into each task
|
|
@@ -962,6 +1052,8 @@ interface IWorktreeIsolation {
|
|
|
962
1052
|
* each, and the config enabled; otherwise the reason it is not.
|
|
963
1053
|
*/
|
|
964
1054
|
isActive(workspaceRoot: string): Promise<IsolationAvailability>;
|
|
1055
|
+
/** What the git on this machine holds back, as the line the user is told; null when it does everything, or there is no git to speak of. */
|
|
1056
|
+
gitShortfall(): Promise<string | null>;
|
|
965
1057
|
/**
|
|
966
1058
|
* Put the tracked changes of every dirty repo of the group on its git stash,
|
|
967
1059
|
* the user's way out of a `dirty` refusal. Untracked files stay: they never
|
|
@@ -971,9 +1063,11 @@ interface IWorktreeIsolation {
|
|
|
971
1063
|
/**
|
|
972
1064
|
* Mint a run: resolve each repo's base ref to a commit now, and share the
|
|
973
1065
|
* repos that cannot be isolated. Only meaningful after `isActive` said yes;
|
|
974
|
-
* throws when no repo of the group can be isolated after all.
|
|
1066
|
+
* throws when no repo of the group can be isolated after all. `stateRoot`
|
|
1067
|
+
* makes it a child's run (ADR-0055 D11), and it throws for a `workspaceRoot`
|
|
1068
|
+
* that is not a task's workspace under that root (D12).
|
|
975
1069
|
*/
|
|
976
|
-
startRun(workspaceRoot: string): Promise<IsolationRun>;
|
|
1070
|
+
startRun(workspaceRoot: string, stateRoot?: string): Promise<IsolationRun>;
|
|
977
1071
|
/**
|
|
978
1072
|
* Create the task workspace — one worktree per isolated repo from its
|
|
979
1073
|
* integration tip, the shared paths linked in — and return the cwd to spawn
|
|
@@ -1002,6 +1096,13 @@ interface IWorktreeIsolation {
|
|
|
1002
1096
|
* else: a task that fails stays `repairing` until released.
|
|
1003
1097
|
*/
|
|
1004
1098
|
verifyRepair(task: Task, run: IsolationRun): Promise<RepairEvidence>;
|
|
1099
|
+
/**
|
|
1100
|
+
* The paths a repair brings onto the integration tip, by their place in the
|
|
1101
|
+
* workspace: `repairBase` to the branch where the landing changed a repo, and
|
|
1102
|
+
* the task's tip to it where it did not, since a repair can still edit that
|
|
1103
|
+
* repo. Read after {@link verifyRepair} commits, before `integrate` moves the tip.
|
|
1104
|
+
*/
|
|
1105
|
+
repairPaths?(task: Task, run: IsolationRun): Promise<string[]>;
|
|
1005
1106
|
/**
|
|
1006
1107
|
* Land the task atomically across the repos it changed: commit each
|
|
1007
1108
|
* worktree, then `git merge --no-ff` the task branch into each changed
|
|
@@ -1071,6 +1172,14 @@ interface IWorktreeIsolation {
|
|
|
1071
1172
|
/** Unified diff of each repo's integration branch against its base ref. */
|
|
1072
1173
|
reviewDiff(run: IsolationRun): Promise<string>;
|
|
1073
1174
|
taskDiff?(run: IsolationRun, taskId: string, options: TaskDiffRead): Promise<TaskDiffResult>;
|
|
1175
|
+
/**
|
|
1176
|
+
* The blob `file` holds on `branch`, relative to `root`, the workspace
|
|
1177
|
+
* (ADR-0057 R9): null where it holds none, undefined where nothing can be read.
|
|
1178
|
+
* Refs are shared across worktrees, so a child reads an ancestor's branch too.
|
|
1179
|
+
* A branch gone with its merged run reads as what `root` has checked out, which
|
|
1180
|
+
* is where it merged.
|
|
1181
|
+
*/
|
|
1182
|
+
blobOn?(root: string, branch: string, file: string): Promise<string | null | undefined>;
|
|
1074
1183
|
/**
|
|
1075
1184
|
* Read each landed task's mark again from git: on where the user's branch
|
|
1076
1185
|
* contains its work in every repo it changed (`git merge-base --is-ancestor`),
|
|
@@ -1119,6 +1228,7 @@ interface IWorktreeIsolation {
|
|
|
1119
1228
|
* Never a branch of `run` itself, one a worktree has checked out, or any
|
|
1120
1229
|
* branch of a run that still has a worktree — that run may be live in
|
|
1121
1230
|
* another plan. Tries every repo, then throws naming those where git failed.
|
|
1231
|
+
* A child's run sweeps nothing (ADR-0055 D11).
|
|
1122
1232
|
*/
|
|
1123
1233
|
sweep(run: IsolationRun): Promise<void>;
|
|
1124
1234
|
}
|
|
@@ -1220,6 +1330,12 @@ declare function partedPromptUsage(parts: {
|
|
|
1220
1330
|
cacheRead?: number;
|
|
1221
1331
|
cacheWrite?: number;
|
|
1222
1332
|
}): Pick<UsageRecord, 'inputTokens' | 'cachedInputTokens'>;
|
|
1333
|
+
/**
|
|
1334
|
+
* What a budget counts (ADR-0056 M5), of a record or of totals alike: the same
|
|
1335
|
+
* tokens a total holds, input and output. `cachedInputTokens` is a share of the
|
|
1336
|
+
* input, so cache reads count, once.
|
|
1337
|
+
*/
|
|
1338
|
+
declare function spentTokens({ inputTokens, outputTokens }: Pick<UsageTotals, 'inputTokens' | 'outputTokens'>): number;
|
|
1223
1339
|
declare function addUsage(totals: UsageTotals, record: UsageRecord): UsageTotals;
|
|
1224
1340
|
/**
|
|
1225
1341
|
* What the planner has consumed over a session (#49). `totals` includes every
|
|
@@ -1332,6 +1448,7 @@ interface PlanUsage {
|
|
|
1332
1448
|
}
|
|
1333
1449
|
declare function addUsageTotals(totals: UsageTotals, addition: UsageTotals): UsageTotals;
|
|
1334
1450
|
interface UsageTask {
|
|
1451
|
+
type?: string;
|
|
1335
1452
|
attemptUsage?: readonly AttemptUsage[];
|
|
1336
1453
|
subtasks?: readonly UsageTask[];
|
|
1337
1454
|
}
|
|
@@ -1347,7 +1464,7 @@ interface TaskUsageSummary {
|
|
|
1347
1464
|
attempts: number;
|
|
1348
1465
|
contextFill?: ContextFill;
|
|
1349
1466
|
}
|
|
1350
|
-
declare function taskUsageSummary(task: Pick<UsageTask, 'attemptUsage'>): TaskUsageSummary;
|
|
1467
|
+
declare function taskUsageSummary(task: Pick<UsageTask, 'attemptUsage' | 'type'>): TaskUsageSummary;
|
|
1351
1468
|
/** `950`, `1.5k`, `61k`, `261k`, `1.2M`. */
|
|
1352
1469
|
declare function formatTokenCount(n: number): string;
|
|
1353
1470
|
/** Two decimals from 1 up and up to four below it: a call can cost a fraction of a cent, a session several dollars. */
|
|
@@ -1565,6 +1682,349 @@ declare class SkillsService {
|
|
|
1565
1682
|
*/
|
|
1566
1683
|
declare function createSkillsService(workspaceRoot?: string, workspaceRepos?: readonly string[]): SkillsService;
|
|
1567
1684
|
|
|
1685
|
+
/** A script task's time limit when it sets none. */
|
|
1686
|
+
declare const DEFAULT_SCRIPT_TIMEOUT_MS: number;
|
|
1687
|
+
/** What a script task runs, its time limit filled in. */
|
|
1688
|
+
type ScriptBody =
|
|
1689
|
+
/** Argument vectors run in order with no shell, stopping at the first that fails. */
|
|
1690
|
+
{
|
|
1691
|
+
commands: string[][];
|
|
1692
|
+
timeoutMs: number;
|
|
1693
|
+
}
|
|
1694
|
+
/** One script, run by the research shell's interpreter. */
|
|
1695
|
+
| {
|
|
1696
|
+
script: string;
|
|
1697
|
+
timeoutMs: number;
|
|
1698
|
+
};
|
|
1699
|
+
type BodyFields = Pick<Task, 'type' | 'commands' | 'script' | 'timeoutMs'>;
|
|
1700
|
+
/** The body a script task runs; null for any other task, or one whose body the plan's rules refuse. */
|
|
1701
|
+
declare function scriptBodyOf(task: BodyFields): ScriptBody | null;
|
|
1702
|
+
/**
|
|
1703
|
+
* An argument vector as a reader would type it in a shell: a word is quoted
|
|
1704
|
+
* only where it needs to be, and one holding a character a reader cannot see
|
|
1705
|
+
* is written with escapes (`$'…'`), so a command is always one line and reads
|
|
1706
|
+
* as what runs. For reading only; nothing runs it.
|
|
1707
|
+
*/
|
|
1708
|
+
declare function commandLine(argv: readonly string[]): string;
|
|
1709
|
+
/**
|
|
1710
|
+
* A script task's body as the approval card shows it (ADR-0035), so the
|
|
1711
|
+
* consent is to what will run: each command on a line of its own, or the
|
|
1712
|
+
* script as written, then the time limit. A character a reader cannot see in
|
|
1713
|
+
* a script, but for its line breaks and tabs, is shown as its code.
|
|
1714
|
+
*/
|
|
1715
|
+
declare function scriptBodyText(body: ScriptBody): string;
|
|
1716
|
+
/**
|
|
1717
|
+
* A script task as a row shows it: the body {@link scriptBodyText} gives the
|
|
1718
|
+
* approval card, so what the user read when consenting is what the plan lists.
|
|
1719
|
+
* A task whose body the plan's rules refuse says so rather than showing nothing.
|
|
1720
|
+
*/
|
|
1721
|
+
declare function scriptTaskText(task: BodyFields): string;
|
|
1722
|
+
/** A time limit in the largest units it is a whole number of: "10 minutes", "90 seconds". */
|
|
1723
|
+
declare function timeLimitText(ms: number): string;
|
|
1724
|
+
|
|
1725
|
+
/**
|
|
1726
|
+
* The planner's standing approvals (ADR-0026): what runs without asking
|
|
1727
|
+
* anyone, under every approval mode.
|
|
1728
|
+
*
|
|
1729
|
+
* One entry is one of:
|
|
1730
|
+
*
|
|
1731
|
+
* - a **command rule**, `gh issue list` or `gcloud * * list`: the binary,
|
|
1732
|
+
* then words matched against the command's leading arguments, the ones
|
|
1733
|
+
* before its first flag. A command whose leading words match the rule's
|
|
1734
|
+
* runs, whatever arguments follow — but the rule must spell out at least
|
|
1735
|
+
* the words the command's approval scope holds (ADR-0008, T1), so
|
|
1736
|
+
* `az group` never covers `az group delete`, and a one-word read takes a
|
|
1737
|
+
* `*` for its argument (`kubectl get *`). `*` stands for one word, and
|
|
1738
|
+
* inside a word for any run of characters (`describe-*`). An entry equal
|
|
1739
|
+
* to a scope also matches that scope, as pre-approved scopes always did.
|
|
1740
|
+
* - an **MCP tool rule**, `mcp:find-*`: a glob over the tool's own name,
|
|
1741
|
+
* without the server, case-insensitive.
|
|
1742
|
+
* - a **scope pattern**, anything starting with `/`, `~`, `http://`,
|
|
1743
|
+
* `https://`, `web_search:`, `mcp__`, `mcp-server:` or a drive letter: matched against an approval's
|
|
1744
|
+
* scope as ADR-0008 always matched pre-approved entries, `*` matching any
|
|
1745
|
+
* run of characters.
|
|
1746
|
+
*
|
|
1747
|
+
* A leading `!` excludes instead, and an exclusion wins over every rule. A
|
|
1748
|
+
* command exclusion's words are looked for anywhere among the arguments, in
|
|
1749
|
+
* order, flags included and case ignored, so `!kubectl *secret*` and
|
|
1750
|
+
* `!* --endpoint*` hold wherever the word appears; a lone short flag (`-s`)
|
|
1751
|
+
* also holds inside a bundle (`-As`, `-shost`). `*` as its binary covers
|
|
1752
|
+
* every command.
|
|
1753
|
+
*/
|
|
1754
|
+
/** The words a command rule is matched against: a lexed segment's binary and arguments. */
|
|
1755
|
+
interface CommandWords {
|
|
1756
|
+
binary: string;
|
|
1757
|
+
args: readonly string[];
|
|
1758
|
+
/** How many leading arguments the command's approval scope holds; a rule must cover at least that many. */
|
|
1759
|
+
scopeWords?: number;
|
|
1760
|
+
}
|
|
1761
|
+
interface RuleWord {
|
|
1762
|
+
matches: (word: string) => boolean;
|
|
1763
|
+
wildcard: boolean;
|
|
1764
|
+
}
|
|
1765
|
+
interface CommandRule {
|
|
1766
|
+
text: string;
|
|
1767
|
+
binary: string;
|
|
1768
|
+
words: RuleWord[];
|
|
1769
|
+
}
|
|
1770
|
+
interface PlannerAllowlist {
|
|
1771
|
+
commands: CommandRule[];
|
|
1772
|
+
commandExclusions: CommandRule[];
|
|
1773
|
+
tools: RegExp[];
|
|
1774
|
+
toolExclusions: RegExp[];
|
|
1775
|
+
scopes: RegExp[];
|
|
1776
|
+
scopeExclusions: RegExp[];
|
|
1777
|
+
}
|
|
1778
|
+
declare function parseAllowlist(entries: readonly string[]): PlannerAllowlist;
|
|
1779
|
+
/** The rule that lets this command run unasked, or undefined when none does or an exclusion holds. */
|
|
1780
|
+
declare function commandAllowedBy(list: PlannerAllowlist, command: CommandWords): string | undefined;
|
|
1781
|
+
/** Whether an MCP tool, by its own name without the server, runs unasked. */
|
|
1782
|
+
declare function toolAllowed(list: PlannerAllowlist, tool: string): boolean;
|
|
1783
|
+
/** Whether an approval scope — a directory, an origin, a tool's full name — is pre-approved. */
|
|
1784
|
+
declare function scopeAllowed(list: PlannerAllowlist, scope: string): boolean;
|
|
1785
|
+
/**
|
|
1786
|
+
* Read-only command families that are safe to run unasked: they read, never
|
|
1787
|
+
* write a file or change a resource, and need no argument that runs code.
|
|
1788
|
+
* Absent on purpose: commands that run the repository's own code (test
|
|
1789
|
+
* runners, builds, package scripts, a package manager the repository pins or
|
|
1790
|
+
* extends — on an untrusted repository someone else wrote that code), commands
|
|
1791
|
+
* a repository's own config can point at another endpoint with the user's
|
|
1792
|
+
* credentials (`.npmrc`, `.sentryclirc`, a Terraform or Pulumi backend), and
|
|
1793
|
+
* commands whose usual output is a secret.
|
|
1794
|
+
*/
|
|
1795
|
+
declare const DEFAULT_PLANNER_ALLOWLIST: readonly string[];
|
|
1796
|
+
|
|
1797
|
+
/** A delegated task's budget: tokens, and optionally wall-clock time (ADR-0056 M5). */
|
|
1798
|
+
interface DelegatedBudget {
|
|
1799
|
+
tokens: number;
|
|
1800
|
+
wallClockMs?: number;
|
|
1801
|
+
}
|
|
1802
|
+
/** Where a child plan's tasks stand now: the counts a delegated task's row shows while its child runs (ADR-0055 D20). */
|
|
1803
|
+
interface ChildTaskCounts {
|
|
1804
|
+
completed: number;
|
|
1805
|
+
running: number;
|
|
1806
|
+
/** Waiting on a person, a checkpoint among them. */
|
|
1807
|
+
waiting: number;
|
|
1808
|
+
pending: number;
|
|
1809
|
+
failed: number;
|
|
1810
|
+
skipped: number;
|
|
1811
|
+
}
|
|
1812
|
+
/**
|
|
1813
|
+
* What a delegated task's row says beyond any task's (ADR-0055 D16, D20): all of
|
|
1814
|
+
* it derived where it is read, from the child's plan, the tree's ledger and the
|
|
1815
|
+
* Stop, never kept. Every part is absent when there is nothing to say.
|
|
1816
|
+
*/
|
|
1817
|
+
interface DelegatedRow {
|
|
1818
|
+
/** The child's tasks by where they stand; absent with no child session open. */
|
|
1819
|
+
tasks?: ChildTaskCounts;
|
|
1820
|
+
/** The task's token budget, and what the tree has not yet spent of it, across every child it has had (ADR-0056 M10). */
|
|
1821
|
+
tokens?: {
|
|
1822
|
+
budget: number;
|
|
1823
|
+
left: number;
|
|
1824
|
+
};
|
|
1825
|
+
/** A Stop is still winding the subtree down, though the task already reads as not started (D16). */
|
|
1826
|
+
stopping?: true;
|
|
1827
|
+
}
|
|
1828
|
+
/** What a task declares it works on (ADR-0057 R6). Advisory: nothing gates on it. */
|
|
1829
|
+
interface TaskScope {
|
|
1830
|
+
paths?: string[];
|
|
1831
|
+
provides?: string[];
|
|
1832
|
+
consumes?: string[];
|
|
1833
|
+
}
|
|
1834
|
+
/** Something a check is made of. A `command` is the check itself at any length, where prose says little until it has some. */
|
|
1835
|
+
interface CheckWord {
|
|
1836
|
+
text: string;
|
|
1837
|
+
command: boolean;
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
/**
|
|
1841
|
+
* The effect allowlist (ADR-0035): the user's standing approval for named
|
|
1842
|
+
* effects, beside the planner allowlist, which names reads. It pre-approves a
|
|
1843
|
+
* script task whose `commands` are all covered; it never covers a `script`
|
|
1844
|
+
* body, whose shell text no rule can be matched against.
|
|
1845
|
+
*
|
|
1846
|
+
* A rule is matched against the whole command, every word in order and flags
|
|
1847
|
+
* included, because an effect's flags change what it does: `git push origin
|
|
1848
|
+
* feature/*` covers `git push origin feature/login`, never the same push with
|
|
1849
|
+
* `--force`. `*` stands for one word, or inside a word for any run of
|
|
1850
|
+
* characters, as in the planner allowlist, except that it never stands for
|
|
1851
|
+
* what changes the effect: a flag (`--force`, and `/force` on Windows), a
|
|
1852
|
+
* refspec's force or delete (`+main`, `:main`), or a `:` outside a URL
|
|
1853
|
+
* (`feature/x:main`, which pushes to `main`). The rule writes any of those
|
|
1854
|
+
* itself. A rule spells out its operation before any `*`, so
|
|
1855
|
+
* `az webapp config * set` is no rule at all.
|
|
1856
|
+
*
|
|
1857
|
+
* Exclusions are the planner allowlist's `!` entries, with any `!` entry
|
|
1858
|
+
* written here; an exclusion wins. A command exclusion is matched as the
|
|
1859
|
+
* planner allowlist matches it; a path or URL exclusion holds for an argument
|
|
1860
|
+
* that names an absolute path or URL it covers, whole or after a `=`, `@`,
|
|
1861
|
+
* `:` or `,` or a short flag (`--url=…`, `-d @…`). A relative path is not
|
|
1862
|
+
* resolved, since the body does not say where it runs. A program named by its
|
|
1863
|
+
* path is a file the repository ships (ADR-0026), so it is never covered.
|
|
1864
|
+
* There are no built-in rules: a default would pre-approve an effect the user
|
|
1865
|
+
* never chose.
|
|
1866
|
+
*/
|
|
1867
|
+
interface EffectRule {
|
|
1868
|
+
text: string;
|
|
1869
|
+
binary: string;
|
|
1870
|
+
words: RuleWord[];
|
|
1871
|
+
}
|
|
1872
|
+
interface EffectRules {
|
|
1873
|
+
rules: EffectRule[];
|
|
1874
|
+
exclusions: PlannerAllowlist;
|
|
1875
|
+
platform: NodeJS.Platform;
|
|
1876
|
+
/** The entries that are no rule, each with the warning that says why it is ignored. */
|
|
1877
|
+
ignored: {
|
|
1878
|
+
rule: string;
|
|
1879
|
+
warning: string;
|
|
1880
|
+
}[];
|
|
1881
|
+
}
|
|
1882
|
+
/**
|
|
1883
|
+
* `entries` are the effect allowlist's; `plannerEntries` the planner allowlist
|
|
1884
|
+
* in force, whose `!` entries hold here too; `platform` the one the commands
|
|
1885
|
+
* run on, which decides how a flag is spelled and how a path resolves.
|
|
1886
|
+
*/
|
|
1887
|
+
declare function parseEffectAllowlist(entries: readonly string[], plannerEntries?: readonly string[], platform?: NodeJS.Platform): EffectRules;
|
|
1888
|
+
/**
|
|
1889
|
+
* The rules, by name, that cover every command of a `commands` body, or null
|
|
1890
|
+
* when one command is not covered, an exclusion holds for one, or the body is
|
|
1891
|
+
* a `script`.
|
|
1892
|
+
*/
|
|
1893
|
+
declare function effectRuleFor(list: EffectRules, body: ScriptBody): string | null;
|
|
1894
|
+
|
|
1895
|
+
/**
|
|
1896
|
+
* The mandate (ADR-0056): what a node may do without a person, and within what
|
|
1897
|
+
* limits. The root's is derived on each read from today's settings and never
|
|
1898
|
+
* saved; a child's is one pure function of its parent's and its request, which
|
|
1899
|
+
* can only narrow what the parent may hand on. Authority only: capability stays
|
|
1900
|
+
* at the boundary a session runs in, and a prompt enforces nothing.
|
|
1901
|
+
*/
|
|
1902
|
+
declare const GRANTS: readonly ["observe", "steer", "control", "replan", "approve", "delegate", "effect", "research", "merge"];
|
|
1903
|
+
/** Each is a set of things a node may do unasked (M2). */
|
|
1904
|
+
type Grant = (typeof GRANTS)[number];
|
|
1905
|
+
/** What a mandate could not finish without: a child holds these unasked, and `narrow` refuses one that would lack any (M2). */
|
|
1906
|
+
declare const FLOOR_GRANTS: readonly Grant[];
|
|
1907
|
+
/** The shape of a tree, by ADR-0055 D19: refused past the hard cap, never dropped. */
|
|
1908
|
+
declare const SHAPE_LIMITS: {
|
|
1909
|
+
readonly depth: {
|
|
1910
|
+
readonly default: 2;
|
|
1911
|
+
readonly hard: 4;
|
|
1912
|
+
};
|
|
1913
|
+
readonly delegatedTasks: {
|
|
1914
|
+
readonly default: 8;
|
|
1915
|
+
readonly hard: 30;
|
|
1916
|
+
};
|
|
1917
|
+
readonly tasksPerPlan: {
|
|
1918
|
+
readonly default: 30;
|
|
1919
|
+
readonly hard: 100;
|
|
1920
|
+
};
|
|
1921
|
+
};
|
|
1922
|
+
interface MandateLimits {
|
|
1923
|
+
/** The node's token budget; the root's is the tree's, from the delegation setting (M3, M5). */
|
|
1924
|
+
tokens: number;
|
|
1925
|
+
/** Null: no limit, which only the root has. */
|
|
1926
|
+
wallClockMs: number | null;
|
|
1927
|
+
/** How many levels may still open below this node. */
|
|
1928
|
+
depth: number;
|
|
1929
|
+
delegatedTasks: number;
|
|
1930
|
+
tasksPerPlan: number;
|
|
1931
|
+
runners: readonly RunnerId[];
|
|
1932
|
+
/** The models a runner is held to; a runner not named may use any it offers, as the user's allowlist reads. */
|
|
1933
|
+
models: Readonly<Record<RunnerId, readonly string[]>>;
|
|
1934
|
+
}
|
|
1935
|
+
interface MandateExclusions {
|
|
1936
|
+
protectedPaths: readonly string[];
|
|
1937
|
+
}
|
|
1938
|
+
interface Mandate {
|
|
1939
|
+
/** What this node may do. */
|
|
1940
|
+
grants: ReadonlySet<Grant>;
|
|
1941
|
+
/** What it may hand a child. */
|
|
1942
|
+
grantable: ReadonlySet<Grant>;
|
|
1943
|
+
/** Read in place of the global level. */
|
|
1944
|
+
autonomy: 'full' | 'guarded';
|
|
1945
|
+
limits: MandateLimits;
|
|
1946
|
+
/** These only accumulate. */
|
|
1947
|
+
exclusions: MandateExclusions;
|
|
1948
|
+
/** One per level, each with its own `!` rules: a command must match at every level (M4). */
|
|
1949
|
+
effectRules: readonly EffectRules[];
|
|
1950
|
+
/** The level of `effectRules` this node's own request added: all of it a node keeps, the levels above being read as they stand (M1). */
|
|
1951
|
+
ownEffectRules: readonly EffectRules[];
|
|
1952
|
+
}
|
|
1953
|
+
/** What the root's mandate is read from, each where it lives today (M1). */
|
|
1954
|
+
interface RootSettings {
|
|
1955
|
+
/** The run's own copy: where a guard or a failure lowers it, and the user's change lands. */
|
|
1956
|
+
level: SupervisorLevel;
|
|
1957
|
+
autorun: boolean;
|
|
1958
|
+
autonomous: boolean;
|
|
1959
|
+
/** The tree's budget; 0 is delegation off (ADR-0055 D21). */
|
|
1960
|
+
delegationTokens: number;
|
|
1961
|
+
/** The effect allowlist, absent where nothing was read. */
|
|
1962
|
+
effects?: EffectRules;
|
|
1963
|
+
runners: readonly RunnerId[];
|
|
1964
|
+
models: Readonly<Record<RunnerId, readonly string[]>>;
|
|
1965
|
+
}
|
|
1966
|
+
/** What a delegated task asks of the mandate it is given. `grants` names what it asks for past the floor; absent asks for nothing. */
|
|
1967
|
+
interface MandateRequest {
|
|
1968
|
+
/** The level of the node narrowing, the root being 0: the one a refusal names. */
|
|
1969
|
+
level: number;
|
|
1970
|
+
grants?: readonly Grant[];
|
|
1971
|
+
autonomy?: Mandate['autonomy'];
|
|
1972
|
+
/** A delegated task must carry one (M5). */
|
|
1973
|
+
tokens?: number;
|
|
1974
|
+
wallClockMs?: number;
|
|
1975
|
+
depth?: number;
|
|
1976
|
+
delegatedTasks?: number;
|
|
1977
|
+
tasksPerPlan?: number;
|
|
1978
|
+
runners?: readonly RunnerId[];
|
|
1979
|
+
models?: Readonly<Record<RunnerId, readonly string[]>>;
|
|
1980
|
+
protectedPaths?: readonly string[];
|
|
1981
|
+
effectRules?: EffectRules;
|
|
1982
|
+
}
|
|
1983
|
+
interface MandateRefusal {
|
|
1984
|
+
level: number;
|
|
1985
|
+
field: string;
|
|
1986
|
+
asked: string;
|
|
1987
|
+
there: string;
|
|
1988
|
+
}
|
|
1989
|
+
type Narrowed = {
|
|
1990
|
+
ok: true;
|
|
1991
|
+
mandate: Mandate;
|
|
1992
|
+
} | {
|
|
1993
|
+
ok: false;
|
|
1994
|
+
refusal: MandateRefusal;
|
|
1995
|
+
};
|
|
1996
|
+
declare function mandateRefusalText({ level, field, asked, there }: MandateRefusal): string;
|
|
1997
|
+
/**
|
|
1998
|
+
* The root's mandate, as it stands now (M1): built afresh on each read, so an
|
|
1999
|
+
* Act that a guard lowered reads Watch at the next check, and nothing saved
|
|
2000
|
+
* could disagree with the settings.
|
|
2001
|
+
*/
|
|
2002
|
+
declare function rootMandate(settings: RootSettings): Mandate;
|
|
2003
|
+
/**
|
|
2004
|
+
* What holds at a node now (M1): its saved mandate within every ancestor's
|
|
2005
|
+
* `grantable` as it stands, under every ancestor's effect rules as they stand,
|
|
2006
|
+
* so a change at the root reaches the subtree at the next check. This reading
|
|
2007
|
+
* intersects and refuses nothing: the floor binds {@link narrow}, which writes
|
|
2008
|
+
* a new child, not this.
|
|
2009
|
+
*/
|
|
2010
|
+
declare function heldMandate(saved: Mandate, ancestors: readonly Mandate[]): Mandate;
|
|
2011
|
+
/**
|
|
2012
|
+
* A child's mandate (M4), or the refusal that names the level that refused,
|
|
2013
|
+
* the field, what was asked and what is there. Pure, and written to be proved:
|
|
2014
|
+
* no result is wider than its parent. `parent.limits.tokens` and `wallClockMs`
|
|
2015
|
+
* are what the parent has left, which is the caller's to read.
|
|
2016
|
+
*/
|
|
2017
|
+
declare function narrow(parent: Mandate, request: MandateRequest): Narrowed;
|
|
2018
|
+
/** What a node reads of its own authority, at each check (M1). */
|
|
2019
|
+
interface NodeAuthority {
|
|
2020
|
+
/** How far below the root, which is 0 and where a person remains. */
|
|
2021
|
+
readonly depth: number;
|
|
2022
|
+
/** The mandate that holds now. `level` is what the root's is read at; a child's does not depend on it. */
|
|
2023
|
+
mandate(level: SupervisorLevel): Mandate;
|
|
2024
|
+
}
|
|
2025
|
+
/** The root: its settings read as each check asks, the level included, which each caller names. */
|
|
2026
|
+
declare function rootAuthority(settings: () => Omit<RootSettings, 'level'>): NodeAuthority;
|
|
2027
|
+
|
|
1568
2028
|
/** How many times a loop's check runs when the loop sets no `maxRounds`. */
|
|
1569
2029
|
declare const DEFAULT_LOOP_ROUNDS = 3;
|
|
1570
2030
|
/** The most rounds a loop may set: past it, the fix is not converging, and a person should look. */
|
|
@@ -1698,7 +2158,7 @@ interface EditMemory {
|
|
|
1698
2158
|
* It wakes the planner whatever the supervisor's level, since the planner
|
|
1699
2159
|
* asked for it.
|
|
1700
2160
|
*/
|
|
1701
|
-
type RunEventKind = 'task_passed' | 'task_failed' | 'waiting_input' | 'waiting_approval' | 'task_idle' | 'landing_conflict' | 'usage_limit' | 'auto_merge_stopped' | 'run_finished' | 'task_report';
|
|
2161
|
+
type RunEventKind = 'task_passed' | 'task_failed' | 'waiting_input' | 'waiting_approval' | 'approval_denied' | 'task_idle' | 'landing_conflict' | 'usage_limit' | 'auto_merge_stopped' | 'start_refused' | 'run_finished' | 'task_report';
|
|
1702
2162
|
type RunEvent = {
|
|
1703
2163
|
kind: RunEventKind;
|
|
1704
2164
|
taskId?: string;
|
|
@@ -1755,7 +2215,7 @@ interface UserStep {
|
|
|
1755
2215
|
* `script_exit` is a script task's exit status, its one evidence (ADR-0035).
|
|
1756
2216
|
*/
|
|
1757
2217
|
interface VerificationCheck {
|
|
1758
|
-
name: 'exit_code' | 'completion_marker' | 'task_complete' | 'manual' | 'script_exit';
|
|
2218
|
+
name: 'exit_code' | 'completion_marker' | 'task_complete' | 'manual' | 'script_exit' | 'protected_paths';
|
|
1759
2219
|
passed: boolean;
|
|
1760
2220
|
/** A check that did not apply. Skipped checks don't affect the verdict. */
|
|
1761
2221
|
skipped: boolean;
|
|
@@ -1786,8 +2246,11 @@ interface TaskOutputSummary {
|
|
|
1786
2246
|
logTail: string;
|
|
1787
2247
|
capturedAt: string;
|
|
1788
2248
|
}
|
|
1789
|
-
/**
|
|
1790
|
-
|
|
2249
|
+
/**
|
|
2250
|
+
* `script` is an ops task whose body Ordewell runs with no model (ADR-0035);
|
|
2251
|
+
* `delegated` holds a goal, and its attempt is a child plan (ADR-0055).
|
|
2252
|
+
*/
|
|
2253
|
+
type TaskType = 'ai' | 'user' | 'script' | 'delegated';
|
|
1791
2254
|
/**
|
|
1792
2255
|
* `skipped` is terminal and verdict-less: the task will not be waited for, and
|
|
1793
2256
|
* nothing it did lands. Its dependents go ahead without it once the work it
|
|
@@ -1804,7 +2267,7 @@ type TaskMode = string;
|
|
|
1804
2267
|
* usage limit. Saved, so no surface has to guess it from whether an attempt
|
|
1805
2268
|
* is live.
|
|
1806
2269
|
*/
|
|
1807
|
-
type AwaitingReason = 'input' | 'checkpoint' | 'conflict' | 'files-changed' | 'usage-limit';
|
|
2270
|
+
type AwaitingReason = 'input' | 'checkpoint' | 'question-lost' | 'conflict' | 'files-changed' | 'usage-limit';
|
|
1808
2271
|
declare function isAwaitingReason(value: unknown): value is AwaitingReason;
|
|
1809
2272
|
interface TaskModelAssignment {
|
|
1810
2273
|
modelId: string;
|
|
@@ -1869,6 +2332,12 @@ interface Task {
|
|
|
1869
2332
|
runnerSessionOwner?: RunnerId;
|
|
1870
2333
|
/** Set only while `status` is `awaiting_user`, and not always then — a pause saved by an older build has none. */
|
|
1871
2334
|
awaitingReason?: AwaitingReason;
|
|
2335
|
+
/**
|
|
2336
|
+
* The question a delegated task's subplanner is parked on (ADR-0056 M8). The
|
|
2337
|
+
* live one is held in memory by what answers it, so this copy is only what a
|
|
2338
|
+
* restart can still say was lost (ADR-0055 D17). Goes with the wait.
|
|
2339
|
+
*/
|
|
2340
|
+
parkedQuestion?: string;
|
|
1872
2341
|
/**
|
|
1873
2342
|
* How many waits have ended since its latest attempt started, or since the
|
|
1874
2343
|
* task was written if none has: an attempt can wait many times, and this
|
|
@@ -1945,6 +2414,22 @@ interface Task {
|
|
|
1945
2414
|
script?: string;
|
|
1946
2415
|
/** A script task's time limit; absent means ten minutes (`DEFAULT_SCRIPT_TIMEOUT_MS`). */
|
|
1947
2416
|
timeoutMs?: number;
|
|
2417
|
+
/** What a delegated task's child plan must achieve, in place of a prompt (ADR-0055 D1). */
|
|
2418
|
+
goal?: string;
|
|
2419
|
+
/** A delegated task's budget (ADR-0056 M5). */
|
|
2420
|
+
budget?: DelegatedBudget;
|
|
2421
|
+
/** What a delegated task asks for past the floor; absent asks for nothing (ADR-0056 M2). */
|
|
2422
|
+
grants?: Grant[];
|
|
2423
|
+
/** The paths a delegated task's child may not change, what its check runs among them (ADR-0055 D7). */
|
|
2424
|
+
protectedPaths?: string[];
|
|
2425
|
+
/** What a delegated task declares it works on (ADR-0057 R6). */
|
|
2426
|
+
scope?: TaskScope;
|
|
2427
|
+
/**
|
|
2428
|
+
* On a delegated task, it answers a question and lands nothing (ADR-0055 D1).
|
|
2429
|
+
* On a script task, it runs sealed in a throwaway worktree, past no gate (D8).
|
|
2430
|
+
* A read-only AI task says so by its mode (ADR-0031) and stores none.
|
|
2431
|
+
*/
|
|
2432
|
+
readOnly?: boolean;
|
|
1948
2433
|
/** Set on a loop's check (ADR-0045): the tasks that fix what it finds, and how many times it may run. */
|
|
1949
2434
|
loop?: TaskLoop;
|
|
1950
2435
|
/**
|
|
@@ -2270,6 +2755,8 @@ interface PendingPlanTurn {
|
|
|
2270
2755
|
* the run. While the user has stopped all of them it opens no turn (ADR-0029).
|
|
2271
2756
|
*/
|
|
2272
2757
|
tasks?: string[];
|
|
2758
|
+
/** It goes with the next turn and opens none (ADR-0057 R6). */
|
|
2759
|
+
rides?: true;
|
|
2273
2760
|
}
|
|
2274
2761
|
/**
|
|
2275
2762
|
* The run's own copy of the user's run settings (ADR-0030): taken when the
|
|
@@ -2467,4 +2954,4 @@ type ApprovalRecord = Pick<LegacyPlanState, 'approved' | 'approvedTasks'>;
|
|
|
2467
2954
|
*/
|
|
2468
2955
|
declare function waitsForApproval(task: Pick<Task, 'id' | 'type' | 'status'>, record: ApprovalRecord): boolean;
|
|
2469
2956
|
|
|
2470
|
-
export { type
|
|
2957
|
+
export { type IsolationLanding as $, type ApprovalRecord as A, BUILTIN_SKILL_NAMES as B, type CheckWord as C, DEFAULT_LOOP_ROUNDS as D, type EffectRules as E, FLOOR_GRANTS as F, GRANTS as G, HANDOFF_LIMITS as H, type HandoffCheck as I, type HandoffCommit as J, type HandoffDigest as K, type HandoffEvidence as L, type HandoffFinding as M, type HandoffLogs as N, type HandoffPatch as O, type HandoffPins as P, type HandoffPreviewOptions as Q, type HandoffTaskName as R, type IIsolationPreview as S, type IWorktreeIsolation as T, type IntegrationDisposal as U, type InvalidSkill as V, type IsolationAvailability as W, type IsolationHandoff as X, type IsolationHandoffRepo as Y, type IsolationInactiveReason as Z, type IsolationLandedTask as _, type AttemptUsage as a, type RevertCommand as a$, type IsolationMergeBlock as a0, type IsolationMergeBlockReason as a1, type IsolationMergeResult as a2, type IsolationOutcome as a3, type IsolationPreview as a4, type IsolationPruneResult as a5, type IsolationRemoval as a6, type IsolationRepo as a7, type IsolationRepoRevert as a8, type IsolationRevertResult as a9, type PlanUsage as aA, type PlannerAllowlist as aB, type PlannerCompaction as aC, type PlannerCompactionOutcome as aD, type PlannerContextPause as aE, type PlannerResendState as aF, type PlannerUsage as aG, type PrepareIntent as aH, type PreparedTask as aI, type PreservedWork as aJ, type PreviewRepo as aK, type PreviousWork as aL, REPORT_MAX_CHARS as aM, ROOT_NODE as aN, type RefusedRemoval as aO, type RepairEvidence as aP, type RepairWait as aQ, type ReplyRun as aR, type RepoGroupLayout as aS, type RepoHead as aT, type ReportItem as aU, type ReportedWindow as aV, type ResearchLogEntry as aW, type ResearchProgress as aX, type ResearchStep as aY, type ResearchStepOutcome as aZ, type ResearchToolType as a_, type IsolationRevertTask as aa, type IsolationRun as ab, type IsolationTaskRecord as ac, type IsolationTaskRef as ad, type IsolationTaskRepo as ae, type IsolationTaskStatus as af, type IsolationView as ag, type LandedTask as ah, type LandedWork as ai, type LegacyPlanState as aj, type LoopSubject as ak, MAX_LOOP_ROUNDS as al, type Mandate as am, type MandateExclusions as an, type MandateLimits as ao, type MandateRefusal as ap, type MandateRequest as aq, type ModelUsage as ar, type Narrowed as as, type NodeAuthority as at, type PatchFlag as au, type PatchView as av, type PendingPlanTurn as aw, type PlanIsolation as ax, type PlanState as ay, type PlanStatus as az, type AwaitingReason as b, costText as b$, type RevertWatch as b0, type RootSettings as b1, type RunSettings as b2, type RunnerId as b3, type RunnerSessionCost as b4, SEVERITY_LABEL as b5, SHAPE_LIMITS as b6, type ScriptBody as b7, type ScriptConsent as b8, type ScriptResult as b9, type TaskSnapshot as bA, type TaskStatus as bB, type TaskType as bC, type TaskUsageSummary as bD, type TreeSnapshot as bE, type UsageLine as bF, type UsageRecord as bG, type UsageTotals as bH, type Verdict as bI, type VerificationCheck as bJ, type WrittenTaskRef as bK, actorAuthority as bL, addAttemptUsage as bM, addModelUsage as bN, addPlannerUsage as bO, addUsage as bP, addUsageTotals as bQ, artifactLines as bR, betweenRounds as bS, boundedHandoffLines as bT, byteSize as bU, checkHandoff as bV, checkOf as bW, commandAllowedBy as bX, commandLine as bY, contextMeterText as bZ, contextMeterTitle as b_, type SessionBilling as ba, type SetupFailure as bb, type ShadowedSkill as bc, type SkillAppliesTo as bd, type SkillCatalog as be, type SkillInfo as bf, type SkillLoad as bg, type SkillLoadNotice as bh, type SkillMetadata as bi, type SkillSource as bj, SkillsService as bk, type StoredHandoff as bl, type SubagentOutcome as bm, type SubtreeReport as bn, type SupervisorLevel as bo, type Task as bp, type TaskDiffRead as bq, type TaskDiffResult as br, type TaskEvidence as bs, type TaskIsolation as bt, type TaskIsolationState as bu, type TaskLoop as bv, type TaskModelAssignment as bw, type TaskReportTo as bx, type TaskSkillNotice as by, type TaskSkillSnapshot as bz, type BelowPlan as c, scriptTaskText as c$, countedSessionCost as c0, createEmptyPlan as c1, createSkillsService as c2, createTask as c3, effectRuleFor as c4, endAttemptUsage as c5, findingLines as c6, findingRefText as c7, flattenTasks as c8, flattenTasksWithParents as c9, parseEffectAllowlist as cA, parseFindingRef as cB, parsePlanPath as cC, partedPromptUsage as cD, patchChangesText as cE, patchFlagText as cF, patchLines as cG, patchLinesText as cH, patchText as cI, patchView as cJ, pausedOnLimit as cK, pinReference as cL, planUsage as cM, plannerContextFill as cN, readableTaskIds as cO, rejoinPlanTree as cP, removedAttempt as cQ, resolveWrittenRef as cR, resumedSessionWindow as cS, rootAuthority as cT, rootMandate as cU, savedPatchOf as cV, savedPatchView as cW, savedPatchViews as cX, scopeAllowed as cY, scriptBodyOf as cZ, scriptBodyText as c_, formatCost as ca, formatTokenCount as cb, handoffDigest as cc, handoffLines as cd, handoffPreviewLines as ce, handoffReferenceText as cf, handoffWakeLines as cg, heldHandoff as ch, heldMandate as ci, heldWords as cj, inLoop as ck, isAwaitingReason as cl, isMeasured as cm, isSupervisorLevel as cn, isUserMessage as co, loopRemovalRefusal as cp, loopRoundOf as cq, mandateRefusalText as cr, migratePlanState as cs, modelCostTitle as ct, namedHandoff as cu, narrow as cv, nodeText as cw, openingLines as cx, outOfRounds as cy, parseAllowlist as cz, type ChildTaskCounts as d, severityLabel as d0, spentTokens as d1, startAttemptUsage as d2, storedHandoff as d3, subagentCostTitle as d4, taskUsageSummary as d5, tasksTotalText as d6, timeLimitText as d7, toolAllowed as d8, usageLine as d9, usageText as da, waitsForApproval as db, withPatch as dc, wordsFrom as dd, worstSeverity as de, type CommandWords as e, type ContextCheckpoint as f, type ContextFill as g, type ConversationMessage as h, type CostProvenance as i, DEFAULT_PLANNER_ALLOWLIST as j, DEFAULT_RUNNERS as k, DEFAULT_SCRIPT_TIMEOUT_MS as l, DEFAULT_SUPERVISOR_RETRY_LIMIT as m, DIGEST_FINDINGS as n, type DelegatedRow as o, type DiscoveredModel as p, type ExecutionActor as q, type ExecutionCommandName as r, type ExecutionRecord as s, type FindingSeverity as t, type Grant as u, type GuardTarget as v, type GuardTrip as w, HANDOFF_PUSH_CHARS as x, type Handoff as y, type HandoffArtifact as z };
|