@kottera/tera-web 0.0.0-stage → 0.1.0-rc.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.
@@ -0,0 +1,3522 @@
1
+ /**
2
+ *
3
+ * Schema: sdk/workorder/schema/v1/acknowledge.params.json
4
+ */
5
+ export type WorkOrderAcknowledgeParams = {
6
+ /** The failed Work Order to close permanently. */
7
+ id: string;
8
+ /** Why this outcome is accepted; recorded with the authenticated actor. */
9
+ reason: string;
10
+ };
11
+ /**
12
+ * `work_order.acknowledge` result (v1).
13
+ *
14
+ * What `work_order.acknowledge` answers on success (ADR-143 D4), generated from `workorder.AcknowledgeResult`. A refusal is not this document: it is the invocation's `error` envelope.
15
+ *
16
+ * Schema: sdk/workorder/schema/v1/acknowledge.result.json
17
+ */
18
+ export type WorkOrderAcknowledgeResult = {
19
+ from_state: string;
20
+ id: string;
21
+ state: string;
22
+ };
23
+ /**
24
+ *
25
+ * Schema: sdk/workorder/schema/v1/answer.params.json
26
+ */
27
+ export type WorkOrderAnswerParams = {
28
+ /** Files to hand this Work Order, each named by the HANDLE its upload minted — `tera artifacts upload <file> --description "…"` mints one in a single command, or over the API `POST /api/v1/artifacts/uploads/authorize` starts an upload and completing it mints the handle. A DISPATCHED RUN uses neither door — a worker-class caller is refused both — and attaches only a handle it has ALREADY PUBLISHED into this same train, which costs nothing and is not a re-upload. ATTACHMENTS CARRY A HANDLE AND NEVER FILE CONTENT, at any size: there is no inline, base64 or small-file form of this field on any surface, so upload first and pass the reference. You do not describe the file here — its filename, declared content type, size, digest and the uploader's description come from the upload itself, so what a later reader sees is what was actually uploaded rather than what the create said about it. An attach CONSUMES the artifact into this one Work Order's train: it leaves your staged account, the same handle keeps working, and it cannot be attached to a second Work Order — upload the file again for that. A handle you have not attached within 24 hours of uploading it is collected; attaching to a `draft` stops that clock for as long as the draft lives, and discarding the draft hands the file back to you with a fresh 24 hours rather than deleting it. Every unattachable handle answers the same way — never uploaded, already attached, expired, or somebody else's are one refusal, because telling them apart would say whether another principal's handle exists; `tera artifacts list --staged` lists what is actually yours (`GET /api/v1/artifacts/staged` over the API). A run has no staging account to list, and the handle it should be passing is one of its own outputs in this train. Inputs get their own byte allowance (64 MiB per Work Order) and never spend the separate allowance a run uses to publish artifacts about its own work. */
29
+ attachments?: {
30
+ /** The artifact handle the upload minted. Opaque: it carries no filename and no path, and nothing about it is constructible. */
31
+ handle: string;
32
+ }[];
33
+ /** Report the ADR-105 D8 classification and DO NOTHING ELSE: no generation is minted and the answer does not happen. The manifest says what a resume under the candidate would do — where it would land, which steps would be passed over with nothing recorded, which recorded results would be re-run, and which would be orphaned — with the verdict derived from it. Only meaningful with `repin`; on its own it is refused, since there is nothing else here to preview. */
34
+ dry_run?: boolean;
35
+ /** Work Order to resume. Must be `paused:awaiting-input` or `paused:awaiting-interactive-turn`, and the two are answered differently (ADR-129 D3/D4): a `paused:awaiting-input` Work Order asked a specific question — call work_order.get(id) and read its `question` field to see what — and the answer settles it. A `paused:awaiting-interactive-turn` Work Order is an interactive session waiting at its inbox; it asked NOTHING, and what you send is put in that inbox as a message for its next turn, read together with anything else that arrived while it was parked and in the order it all arrived. `delivery` in the response says which happened. */
36
+ id: string;
37
+ /** Interactive answer retry identity, scoped to caller; reuse only for the same text and ordered attachments. */
38
+ input_key?: string;
39
+ /** Cross EVERY refusal the re-pin gate raises, including a capability or operation switch, by ending the contract rather than preserving it: every held step binding is settled `superseded` and a FRESH CHAIN GENERATION is opened for the resume, which then selects against the new pin from nothing (ADR-130 D5's "a deliberate new chain gets an explicit new generation"). It is the refusal's own suggested repair — abandon this Work Order and create a new one — WITHOUT losing the Work Order, its train, its workspace, its artifacts or its history. What it does lose is what the run was doing: a `started` binding it supersedes is a dispatch that was running. It does NOT cross a generation/digest inconsistency, which ADR-105 D7 classifies as corruption rather than as a configuration change. A binding at `admitted` or `dispatch_pending` is refused rather than superseded — those states have no edge that settles; let reconciliation republish and cross again. Only meaningful with `repin`. Authorized against `api/v1/workorders/repin/new-chain` IN ADDITION to `api/v1/workorders/repin`. Pass `dry_run` first: the manifest's `would_open_new_chain` names every binding that would be superseded and how far each had got. */
40
+ new_chain?: boolean;
41
+ /** A structured answer taking precedence over text. For interactive ledger input, a JSON string or sole string-valued answer member becomes its decoded text; every other JSON value becomes one JSON text message with all fields preserved. Other answers retain the verbatim structured envelope. */
42
+ payload?: unknown;
43
+ /** Why. REQUIRED whenever `repin` is set, because it is stored on the new pin generation and an empty reason is what a first-dispatch pin carries — it means "nobody chose this". */
44
+ reason?: string;
45
+ /** Rebind this Work Order to the configuration its type resolves to NOW, as a new generation, and then answer (ADR-105 D7). DURABLE: every subsequent attempt uses the new generation, so it is not a one-shot override that the next attempt falls back off. ATTRIBUTED: your principal and your `reason` are stored on the generation, and the generation history is the audit trail of every forced upgrade. It is the ONLY door onto a Work Order whose pinned configuration is fatally flawed — including one whose pin this daemon cannot decode, which is the case it exists for. Authorized against `api/v1/workorders/repin` IN ADDITION to this capability's own resource; worker-class callers are refused by class and no grant restores it. Pass `dry_run` with it first to see what the resume would cross. */
46
+ repin?: boolean;
47
+ /** Displace an answer this Work Order is ALREADY holding. A Work Order whose answer was accepted and whose re-dispatch was then refused by something waiting can clear keeps that answer on its row and reads `paused:awaiting-input` again — because that is the pause it was put back into, not because it is still asking. Answering it without this flag is refused (answer_already_held); the refusal names who answered, what they said and when the daemon will next try to deliver it, so the ordinary move is to WAIT. Pass this only to correct that answer: it discards the held one and puts yours in its place, and the replacement is recorded on the transition. On a Work Order holding nothing it is a no-op, so it is safe to set on a caller that cannot read the row first — it is an acknowledgement that a held answer may be there, not an assertion that one is. Read `waiting_on.held_answer` on work_order.get to see which Work Orders it applies to. */
48
+ replace?: boolean;
49
+ /** Cross ONE refusal: a select site where this Work Order's live step binding is running a candidate the new pin no longer offers (ADR-130 D5, ratified crossable 2026-09-20). The binding row is RETAINED at the same chain generation and the resume RE-SELECTS from the new candidate set, running the candidate loop against live capacity exactly as a first admission would. It does NOT preserve the candidate the run is on — that candidate is gone, which is why the refusal exists. It lifts nothing else: a capability or operation switch at a fixed site has no candidate to re-select, and a withdrawn `yields_turn` offer is frozen for the life of a pinned conversation (ADR-129 D9). Over a site whose candidate IS still offered, or a fixed site, it is a no-op and says so in the manifest rather than refusing. Only meaningful with `repin`. Authorized against `api/v1/workorders/repin/reselect` IN ADDITION to `api/v1/workorders/repin`. Pass `dry_run` first: the manifest's `would_reselect` names the site, the candidate being given up and the set the resume will choose from. */
50
+ reselect?: boolean;
51
+ /** The operator's exact prose. Interactive answers become one durable ledger message; other answers are wrapped as {"answer": "<text>"}. Ignored when `payload` is supplied. */
52
+ text?: string;
53
+ };
54
+ /**
55
+ * `work_order.answer` result (v1).
56
+ *
57
+ * What `work_order.answer` answers on success (ADR-143 D4), generated from the arms of its result union; a value is exactly one of them. A refusal is not this document: it is the invocation's `error` envelope.
58
+ *
59
+ * Schema: sdk/workorder/schema/v1/answer.result.json
60
+ */
61
+ export type WorkOrderAnswerResult = {
62
+ resume_error?: string;
63
+ input?: {
64
+ message: {
65
+ kind?: string;
66
+ question_at?: string;
67
+ input_id?: string;
68
+ input_sequence?: number;
69
+ caller?: string;
70
+ /** Platform-attested provenance as recorded by the dispatching host; its actor schema belongs to that host. */
71
+ actor?: unknown;
72
+ issued_at?: string;
73
+ text: string;
74
+ attachments?: {
75
+ handle: string;
76
+ filename: string;
77
+ mime_type: string;
78
+ size: number;
79
+ description?: string;
80
+ }[];
81
+ };
82
+ state: string;
83
+ attempt?: {
84
+ id: string;
85
+ invocation_id: string;
86
+ dispatch_id: string;
87
+ observations?: {
88
+ observed_at: string;
89
+ state: string;
90
+ evidence: string;
91
+ }[];
92
+ };
93
+ resolution?: string;
94
+ };
95
+ input_barrier?: {
96
+ input_id: string;
97
+ input_sequence: number;
98
+ attempt_id?: string;
99
+ state: string;
100
+ reconciliation: string;
101
+ behind: number;
102
+ recovery: string;
103
+ };
104
+ id: string;
105
+ state: string;
106
+ delivered: boolean;
107
+ delivery: string;
108
+ resumed_parked_run: boolean;
109
+ outcome: string;
110
+ repin?: {
111
+ minted: boolean;
112
+ dry_run: boolean;
113
+ generation?: number;
114
+ config_digest?: string;
115
+ previous_state?: string;
116
+ previous_generation?: number;
117
+ classification: {
118
+ verdict: string;
119
+ caveat: string;
120
+ cause?: string;
121
+ manifest?: {
122
+ parked_step: string;
123
+ lands: boolean;
124
+ landing?: number;
125
+ absent?: {
126
+ name: string;
127
+ index: number;
128
+ cause: string;
129
+ }[];
130
+ rerun?: string[];
131
+ orphaned?: string[];
132
+ digests_agree: boolean;
133
+ sessions?: {
134
+ site: string;
135
+ logical_site_id?: string;
136
+ structural_path?: string;
137
+ chain_generation: number;
138
+ outcome: string;
139
+ reason: string;
140
+ }[];
141
+ };
142
+ warnings?: {
143
+ kind: string;
144
+ steps?: string[];
145
+ }[];
146
+ };
147
+ crossings?: {
148
+ would_reselect?: {
149
+ site: string;
150
+ logical_site_id?: string;
151
+ structural_path?: string;
152
+ from_candidate: string;
153
+ offered?: string[];
154
+ }[];
155
+ would_open_new_chain?: {
156
+ superseded: {
157
+ site: string;
158
+ logical_site_id?: string;
159
+ structural_path?: string;
160
+ chain_generation: number;
161
+ state: string;
162
+ candidate?: string;
163
+ }[] | null;
164
+ generation?: number;
165
+ };
166
+ reselected?: {
167
+ site: string;
168
+ logical_site_id?: string;
169
+ structural_path?: string;
170
+ from_candidate: string;
171
+ offered?: string[];
172
+ }[];
173
+ opened_new_chain?: {
174
+ superseded: {
175
+ site: string;
176
+ logical_site_id?: string;
177
+ structural_path?: string;
178
+ chain_generation: number;
179
+ state: string;
180
+ candidate?: string;
181
+ }[] | null;
182
+ generation?: number;
183
+ };
184
+ };
185
+ };
186
+ } | {
187
+ id: string;
188
+ state: string;
189
+ verb: string;
190
+ applied: boolean;
191
+ repin: {
192
+ minted: boolean;
193
+ dry_run: boolean;
194
+ generation?: number;
195
+ config_digest?: string;
196
+ previous_state?: string;
197
+ previous_generation?: number;
198
+ classification: {
199
+ verdict: string;
200
+ caveat: string;
201
+ cause?: string;
202
+ manifest?: {
203
+ parked_step: string;
204
+ lands: boolean;
205
+ landing?: number;
206
+ absent?: {
207
+ name: string;
208
+ index: number;
209
+ cause: string;
210
+ }[];
211
+ rerun?: string[];
212
+ orphaned?: string[];
213
+ digests_agree: boolean;
214
+ sessions?: {
215
+ site: string;
216
+ logical_site_id?: string;
217
+ structural_path?: string;
218
+ chain_generation: number;
219
+ outcome: string;
220
+ reason: string;
221
+ }[];
222
+ };
223
+ warnings?: {
224
+ kind: string;
225
+ steps?: string[];
226
+ }[];
227
+ };
228
+ crossings?: {
229
+ would_reselect?: {
230
+ site: string;
231
+ logical_site_id?: string;
232
+ structural_path?: string;
233
+ from_candidate: string;
234
+ offered?: string[];
235
+ }[];
236
+ would_open_new_chain?: {
237
+ superseded: {
238
+ site: string;
239
+ logical_site_id?: string;
240
+ structural_path?: string;
241
+ chain_generation: number;
242
+ state: string;
243
+ candidate?: string;
244
+ }[] | null;
245
+ generation?: number;
246
+ };
247
+ reselected?: {
248
+ site: string;
249
+ logical_site_id?: string;
250
+ structural_path?: string;
251
+ from_candidate: string;
252
+ offered?: string[];
253
+ }[];
254
+ opened_new_chain?: {
255
+ superseded: {
256
+ site: string;
257
+ logical_site_id?: string;
258
+ structural_path?: string;
259
+ chain_generation: number;
260
+ state: string;
261
+ candidate?: string;
262
+ }[] | null;
263
+ generation?: number;
264
+ };
265
+ };
266
+ };
267
+ };
268
+ /**
269
+ *
270
+ * Schema: sdk/workorder/schema/v1/cancel.params.json
271
+ */
272
+ export type WorkOrderCancelParams = {
273
+ /** Work Order to cancel. Cancellation cascades to its non-terminal descendants. */
274
+ id: string;
275
+ /** Short audit note recorded on the cancellation event. */
276
+ reason?: string;
277
+ };
278
+ /**
279
+ * `work_order.cancel` result (v1).
280
+ *
281
+ * What `work_order.cancel` answers on success (ADR-143 D4), generated from the arms of its result union; a value is exactly one of them. A refusal is not this document: it is the invocation's `error` envelope.
282
+ *
283
+ * Schema: sdk/workorder/schema/v1/cancel.result.json
284
+ */
285
+ export type WorkOrderCancelResult = {
286
+ id: string;
287
+ state: string;
288
+ action: string;
289
+ trigger: string;
290
+ repin?: {
291
+ minted: boolean;
292
+ dry_run: boolean;
293
+ generation?: number;
294
+ config_digest?: string;
295
+ previous_state?: string;
296
+ previous_generation?: number;
297
+ classification: {
298
+ verdict: string;
299
+ caveat: string;
300
+ cause?: string;
301
+ manifest?: {
302
+ parked_step: string;
303
+ lands: boolean;
304
+ landing?: number;
305
+ absent?: {
306
+ name: string;
307
+ index: number;
308
+ cause: string;
309
+ }[];
310
+ rerun?: string[];
311
+ orphaned?: string[];
312
+ digests_agree: boolean;
313
+ sessions?: {
314
+ site: string;
315
+ logical_site_id?: string;
316
+ structural_path?: string;
317
+ chain_generation: number;
318
+ outcome: string;
319
+ reason: string;
320
+ }[];
321
+ };
322
+ warnings?: {
323
+ kind: string;
324
+ steps?: string[];
325
+ }[];
326
+ };
327
+ crossings?: {
328
+ would_reselect?: {
329
+ site: string;
330
+ logical_site_id?: string;
331
+ structural_path?: string;
332
+ from_candidate: string;
333
+ offered?: string[];
334
+ }[];
335
+ would_open_new_chain?: {
336
+ superseded: {
337
+ site: string;
338
+ logical_site_id?: string;
339
+ structural_path?: string;
340
+ chain_generation: number;
341
+ state: string;
342
+ candidate?: string;
343
+ }[] | null;
344
+ generation?: number;
345
+ };
346
+ reselected?: {
347
+ site: string;
348
+ logical_site_id?: string;
349
+ structural_path?: string;
350
+ from_candidate: string;
351
+ offered?: string[];
352
+ }[];
353
+ opened_new_chain?: {
354
+ superseded: {
355
+ site: string;
356
+ logical_site_id?: string;
357
+ structural_path?: string;
358
+ chain_generation: number;
359
+ state: string;
360
+ candidate?: string;
361
+ }[] | null;
362
+ generation?: number;
363
+ };
364
+ };
365
+ };
366
+ disposition?: string;
367
+ runner?: string;
368
+ detail?: string;
369
+ } | {
370
+ id: string;
371
+ state: string;
372
+ cancel_requested: boolean;
373
+ cancelled: boolean;
374
+ requested_at: string;
375
+ upstream: string;
376
+ };
377
+ /**
378
+ *
379
+ * Schema: sdk/workorder/schema/v1/cohort_set.params.json
380
+ */
381
+ export type WorkOrderCohortSetParams = {
382
+ /** The cohort to move it into: a UUID read off the cohort_id of a Work Order already in that cohort. It must be borne by at least one Work Order you can read — the same rule as work_order.create's `cohort: <id>` — so a cohort is never created by naming it. */
383
+ cohort_id: string;
384
+ /** The ONE Work Order to move. Its descendants are not moved. You need reach on it, exactly as work_order.get would require. */
385
+ id: string;
386
+ };
387
+ /**
388
+ * `work_order.cohort_set` result (v1).
389
+ *
390
+ * What `work_order.cohort_set` answers on success (ADR-143 D4), generated from `workorder.CohortSetResult`. A refusal is not this document: it is the invocation's `error` envelope.
391
+ *
392
+ * Schema: sdk/workorder/schema/v1/cohort_set.result.json
393
+ */
394
+ export type WorkOrderCohortSetResult = {
395
+ id: string;
396
+ cohort_id: string;
397
+ previous_cohort_id: string;
398
+ applied: boolean;
399
+ };
400
+ /**
401
+ *
402
+ * Schema: sdk/workorder/schema/v1/complete.params.json
403
+ */
404
+ export type WorkOrderCompleteParams = {
405
+ /** Work Order id. Optional for the dispatched root recipe — omit it and the id is taken from the dispatch context. When supplied it must equal the Work Order this recipe was dispatched for. */
406
+ id?: string;
407
+ outputs?: {
408
+ [key: string]: unknown;
409
+ };
410
+ };
411
+ /**
412
+ * `work_order.complete` result (v1).
413
+ *
414
+ * What `work_order.complete` answers on success (ADR-143 D4), generated from `workorder.CompleteResult`. A refusal is not this document: it is the invocation's `error` envelope.
415
+ *
416
+ * Schema: sdk/workorder/schema/v1/complete.result.json
417
+ */
418
+ export type WorkOrderCompleteResult = {
419
+ id: string;
420
+ state: string;
421
+ guard_ok: boolean;
422
+ };
423
+ /**
424
+ *
425
+ * Schema: sdk/workorder/schema/v1/create.params.json
426
+ */
427
+ export type WorkOrderCreateParams = {
428
+ /** Files to hand this Work Order, each named by the HANDLE its upload minted — `tera artifacts upload <file> --description "…"` mints one in a single command, or over the API `POST /api/v1/artifacts/uploads/authorize` starts an upload and completing it mints the handle. A DISPATCHED RUN uses neither door — a worker-class caller is refused both — and attaches only a handle it has ALREADY PUBLISHED into this same train, which costs nothing and is not a re-upload. ATTACHMENTS CARRY A HANDLE AND NEVER FILE CONTENT, at any size: there is no inline, base64 or small-file form of this field on any surface, so upload first and pass the reference. You do not describe the file here — its filename, declared content type, size, digest and the uploader's description come from the upload itself, so what a later reader sees is what was actually uploaded rather than what the create said about it. An attach CONSUMES the artifact into this one Work Order's train: it leaves your staged account, the same handle keeps working, and it cannot be attached to a second Work Order — upload the file again for that. A handle you have not attached within 24 hours of uploading it is collected; attaching to a `draft` stops that clock for as long as the draft lives, and discarding the draft hands the file back to you with a fresh 24 hours rather than deleting it. Every unattachable handle answers the same way — never uploaded, already attached, expired, or somebody else's are one refusal, because telling them apart would say whether another principal's handle exists; `tera artifacts list --staged` lists what is actually yours (`GET /api/v1/artifacts/staged` over the API). A run has no staging account to list, and the handle it should be passing is one of its own outputs in this train. Inputs get their own byte allowance (64 MiB per Work Order) and never spend the separate allowance a run uses to publish artifacts about its own work. */
429
+ attachments?: {
430
+ /** The artifact handle the upload minted. Opaque: it carries no filename and no path, and nothing about it is constructible. */
431
+ handle: string;
432
+ }[];
433
+ /** The prose specification handed to the dispatched agent. */
434
+ body?: string;
435
+ /** The undertaking this Work Order belongs to — usually OMIT it. Unstated on a top-level Work Order, it is placed for you, in this order: the cohort of the Work Order whose dispatch is filing it; otherwise the one cohort every `depends_on` target shares; otherwise a new cohort of one, whose id is this Work Order's own. To file into an existing undertaking from outside a dispatch, pass `{"of": "<work-order-id>"}` — the cohort that Work Order is in; it is refused exactly as reading that Work Order would be. A bare cohort id (a UUID read off any Work Order's `cohort_id`) is also accepted, and must be one a Work Order you can read already carries. To OPEN a unit — a wave, a feature — pass `{"new": true, "label": "<name>"}` on the one call that files its first Work Order, and let everything beneath inherit: each call mints one cohort, so labelling every item you file makes one cohort per item. The new cohort's id is this Work Order's own. It nests under the cohort of the Work Order whose dispatch is filing it, if any; add `"detach": true` for unrelated work filed from inside a dispatch, which then nests under nothing. `label` is stored as given (at most 256 bytes, no control characters) and is a name, never an address. With `parent_id` the Work Order takes its parent's cohort, and two forms are accepted beside it: `{"new": true, "label"?: …}`, which opens a sub-unit nested under the parent's cohort, and `{"of": "<work-order-id>"}`, which joins that Work Order's cohort when it is the parent's or nested beneath it — how several children share one sub-unit: open it with the first, then name the first with `of` on every other. A cohort outside the parent's tree, a bare cohort id and `detach` are refused. The response always carries `cohort_id`. A drafted Work Order is placed when it is released, over the `depends_on` it holds then; a drafted `{"new": true}` is minted, and its label written, at that release. */
436
+ cohort?: string | {
437
+ of: string;
438
+ } | {
439
+ /** Mint with no parent cohort even when filed from inside a dispatch: unrelated work, not a sub-unit of what the dispatch is doing. */
440
+ detach?: boolean;
441
+ /** The new cohort's name, stored as given and drawn verbatim. At most 256 bytes; no control characters. Not unique, and never an address. */
442
+ label?: string;
443
+ new: true;
444
+ };
445
+ /** Capacity key; Work Orders sharing a resolved key do not run concurrently. */
446
+ concurrency_key?: string;
447
+ /** RFC3339 timestamp before which the Work Order is not dispatched. */
448
+ deferred_until?: string;
449
+ /** Work Order ids that must each complete successfully before this one is dispatched; until then it sits in `blocked:waiting-on-deps`. Reaching a terminal state is not enough — a dependency that ends `failed:awaiting-ack` or `cancelled` never releases its dependent, which stays blocked. Which field of `block_reason.detail` carries an id says what to do about it: `pending` is a live set of ids still outstanding that narrows as they complete, while `failed_deps` names dependencies that terminated unsuccessfully and `unknown_deps` ones that no longer exist — neither of the latter two clears on its own, so the dependent stays parked until the upstream is repaired. */
450
+ depends_on?: string[];
451
+ /** File this Work Order in `draft` instead of `scheduled`: it exists, it is durable, it is visible on `list` / `tree` / `get`, and it DOES NOT RUN. No gate is evaluated, no capacity is consumed and no seat is drawn, so a draft costs nothing while it sits. It leaves by exactly two doors — released into the normal lifecycle, or cancelled — and nothing puts a Work Order back into `draft` once it has left. A draft BLOCKS anything that names it in `depends_on`, which is what makes drafting a whole breakdown safe: the dependent reports the draft's id under `block_reason.detail.pending` and waits, so an unreleased item cannot be stepped over. It also never expires, and nothing sweeps it — an abandoned draft is clutter you can see and cancel, deliberately preferred to work deleted on a timer. OMIT IT unless something has to review this before it runs. Filing directly is the normal case and is exactly what it was before this field existed; drafting is for the breakdown that wants approving, the Work Order being composed incrementally, and the bulk file that should be checked before any of it dispatches. */
452
+ draft?: boolean;
453
+ /** De-duplication token for retrying this create after an ambiguous failure. Two creates carrying the same key from the same principal within 10m0s produce ONE Work Order: the second returns the first's result with `idempotent_replay: true` instead of filing a second. Use it whenever a lost response would leave you unable to tell "the request never landed" from "it landed and the reply was lost" — only the second is dangerous, and retrying it without a key files the work twice. Scoped per-principal, so it neither collides with nor can be claimed by another caller. The reservation is durable — it is written in the Work Order's own transaction and survives a daemon restart, which is exactly when a client is most likely to be mid-retry. Omit it and this create behaves exactly as it did before the field existed. */
454
+ idempotency_key?: string;
455
+ /** Typed inputs, validated against the type's declared input schema. */
456
+ inputs?: {
457
+ [key: string]: unknown;
458
+ };
459
+ /** Typed references to the vault DOCUMENTS that spawned or inform this Work Order — the PRD, ADR or plan it was filed against (ADR-048). Each entry is a {type, ref} pair with an optional note: `type` is `source` (the document that spawned this Work Order) or `references` (a related document to read it against), and `ref` is a vault document URI, `vault://<vault-id>/<path>[#<block-id>]` — `<vault-id>` the UUIDv7 of the vault volume, `<path>` the document's vault-relative path including its extension, e.g. `vault://0190d4f2-6b3a-7c11-9f2e-8a4c1d5e6f70/features/inspector/PRD.md`. Nothing else parses. A ref addresses a document at a path, so it cannot carry an external anchor — an issue or pull request in a forge has no path in a vault, and another Work Order is a row in the Work Order store rather than a document. An external anchor belongs in this type's own typed `inputs`: `code-implementation` declares `repository` and `issue_number`, which are validated per-type and actually consumed. To relate two Work Orders, use `depends_on` (causal, gates dispatch) or `parent_id` (files this one into that train). */
460
+ links?: {
461
+ note?: string;
462
+ ref: string;
463
+ type: "references" | "source";
464
+ }[];
465
+ /** External systems to mirror this Work Order into (e.g. an issue in an external tracker), each naming the connector and ref that back it. */
466
+ mirrors?: {
467
+ connector?: string;
468
+ mode?: "read" | "write" | "bidirectional";
469
+ options?: unknown;
470
+ ref?: string;
471
+ type: string;
472
+ }[];
473
+ /** File this Work Order behind the human-approval gate: it reaches `blocked:waiting-on-approval` on its first evaluation and stays there until a person runs `tera workorder approve <id>` (or `reject`, which fails it). It holds no worker slot and no subject claim while it waits, and an approval is durable — approving it once does not re-block it on the next evaluation. Omit it for the normal case; set it when something has to agree before this runs. It cannot be set later: state it here, or discard and re-file. Distinct from `draft`, which also holds a Work Order back but is a filing that is not yet committed to and is released by whoever is composing it — this one is committed work waiting on a decision. */
474
+ needs_approval?: boolean;
475
+ /** Existing Work Order to file this one beneath, making it part of that train. It must be one you can read with work_order.get; one you cannot is refused exactly as that read would refuse it. The new Work Order takes that parent's cohort, verbatim; beside it `cohort` accepts `{"new": true, "label"?: …}`, a sub-unit nested under the parent's cohort, and `{"of": "<work-order-id>"}`, joining the cohort of a Work Order in the parent's tree. */
476
+ parent_id?: string;
477
+ /** Dispatch priority; higher runs sooner among ready Work Orders. */
478
+ priority?: number;
479
+ /** Typed, NON-CAUSAL relations from this Work Order to others (supersedes / duplicate_of / about / related). Each entry is a {relation, work_order_id} pair with an optional note, and `work_order_id` is a bare Work Order id — the same spelling `depends_on` and `parent_id` use, never a `vault://` ref. Set them here when the fact is known at filing time, which for the superseding case it usually is; discovered later, use work_order.relate. Three of the four gate nothing: no dispatch is blocked, delayed or cancelled by `duplicate_of`, `about` or `related`. A `supersedes` entry is the exception and it is the point of setting one here — it RETIRES the Work Order it names, in this call's own transaction: that Work Order moves to `superseded` with `superseded_by` set to this one, and can no longer be retried. The target must be in `failed:awaiting-ack`; one that is still running is refused, and the door is work_order.force_fail(id, reason) first. A terminal one is refused too — there is no retry to close — and so is a `supersedes` entry on a drafted create, since a draft may never be released. To record the claim WITHOUT moving the row, use work_order.relate. Same authorization as work_order.relate — a worker-class caller is refused, and an operator-class one needs `api/v1/workorders/relate` on top of its create grant, because the edge is the relate operation whichever call delivered it. Every target must exist, and no two entries may name the same target. Reach on the target is required for the two EVALUATIVE relations (`supersedes`, `duplicate_of`) and not for the two descriptive ones (`about`, `related`), per entry rather than per payload. */
480
+ relations?: {
481
+ /** Optional free text recorded on the edge and on the event announcing it. At most 256 bytes — stated here rather than as `maxLength`, which counts code points, because the handler measures bytes and a schema promising otherwise would advertise a leniency it does not honour. */
482
+ note?: string;
483
+ /** What this Work Order claims about the target. about (this Work Order's work is examining or acting on that one), duplicate_of (this should not exist; that one is the real work), related (see-also, carrying no lifecycle implication), supersedes (this replaces that one; that one should not be retried). Deliberately absent: `retry_of` (the retry machinery already records attempts against a single Work Order) and anything blocking-shaped (that is `depends_on`, which is causal and gates dispatch). */
484
+ relation: "about" | "duplicate_of" | "related" | "supersedes";
485
+ /** The Work Order this claim is about, as a bare id — the same spelling `depends_on` and `parent_id` use. Not a `vault://` ref: those address a document at a path inside a volume, and a Work Order is a row in the Work Order store. */
486
+ work_order_id: string;
487
+ }[];
488
+ /** Free-form labels carried on the row for reporting, and selectable server-side: `work_order.list` takes a `tag` and matches it WHOLE, so pick a spelling (`repo:kottera/kottera`) and keep it — there is no prefix or wildcard match. Labels only: no tag arms a gate, changes a state transition or means anything to the daemon. At most 32 tags, each at most 128 BYTES (not characters — a tag of 128 multi-byte characters is refused). */
489
+ tags?: string[];
490
+ /** One-line human summary, shown on list / tree rows. */
491
+ title?: string;
492
+ /** Registered Work Order Type to file against. A bare leaf name is accepted when no other registered type shares it. */
493
+ type: string;
494
+ /** Worker to assign. Omit to take the type's own default worker. */
495
+ worker?: string;
496
+ };
497
+ /**
498
+ * `work_order.create` result (v1).
499
+ *
500
+ * What `work_order.create` answers on success (ADR-143 D4), generated from `workorder.CreateResult`. A refusal is not this document: it is the invocation's `error` envelope.
501
+ *
502
+ * Schema: sdk/workorder/schema/v1/create.result.json
503
+ */
504
+ export type WorkOrderCreateResult = {
505
+ id: string;
506
+ worker: string;
507
+ state: string;
508
+ type: string;
509
+ created_at: string;
510
+ cohort_id: string;
511
+ idempotent_replay?: boolean;
512
+ attachments?: {
513
+ handle: string;
514
+ filename: string;
515
+ mime_type: string;
516
+ size_bytes: number;
517
+ description?: string;
518
+ consumed: boolean;
519
+ }[];
520
+ delegation?: {
521
+ subject: string;
522
+ outstanding: string[] | null;
523
+ unavailable?: {
524
+ upstream: string;
525
+ gap: string;
526
+ }[];
527
+ withdrawn?: {
528
+ upstream: string;
529
+ gap: string;
530
+ }[];
531
+ door?: string;
532
+ walled?: string[];
533
+ fails_at?: string;
534
+ checked_at?: string;
535
+ dispatch_timeout_seconds?: number;
536
+ failures?: {
537
+ connection: string;
538
+ upstream?: string;
539
+ holder: {
540
+ kind: string;
541
+ name: string;
542
+ };
543
+ reason: string;
544
+ act_by: string;
545
+ repair: string;
546
+ evidence?: string;
547
+ }[];
548
+ };
549
+ warnings?: string[];
550
+ /** The Work Order's outputs, in the shape its type's output_schema declares. Present on a completed task-augmented create's result (ADR-089 D4); absent on a synchronous create. */
551
+ outputs?: unknown;
552
+ };
553
+ /**
554
+ *
555
+ * Schema: sdk/workorder/schema/v1/create_child.params.json
556
+ */
557
+ export type WorkOrderCreateChildParams = {
558
+ /** Files to hand this Work Order, each named by the HANDLE its upload minted — `tera artifacts upload <file> --description "…"` mints one in a single command, or over the API `POST /api/v1/artifacts/uploads/authorize` starts an upload and completing it mints the handle. A DISPATCHED RUN uses neither door — a worker-class caller is refused both — and attaches only a handle it has ALREADY PUBLISHED into this same train, which costs nothing and is not a re-upload. ATTACHMENTS CARRY A HANDLE AND NEVER FILE CONTENT, at any size: there is no inline, base64 or small-file form of this field on any surface, so upload first and pass the reference. You do not describe the file here — its filename, declared content type, size, digest and the uploader's description come from the upload itself, so what a later reader sees is what was actually uploaded rather than what the create said about it. An attach CONSUMES the artifact into this one Work Order's train: it leaves your staged account, the same handle keeps working, and it cannot be attached to a second Work Order — upload the file again for that. A handle you have not attached within 24 hours of uploading it is collected; attaching to a `draft` stops that clock for as long as the draft lives, and discarding the draft hands the file back to you with a fresh 24 hours rather than deleting it. Every unattachable handle answers the same way — never uploaded, already attached, expired, or somebody else's are one refusal, because telling them apart would say whether another principal's handle exists; `tera artifacts list --staged` lists what is actually yours (`GET /api/v1/artifacts/staged` over the API). A run has no staging account to list, and the handle it should be passing is one of its own outputs in this train. Inputs get their own byte allowance (64 MiB per Work Order) and never spend the separate allowance a run uses to publish artifacts about its own work. */
559
+ attachments?: {
560
+ /** The artifact handle the upload minted. Opaque: it carries no filename and no path, and nothing about it is constructible. */
561
+ handle: string;
562
+ }[];
563
+ /** The prose specification handed to the child. */
564
+ body?: string;
565
+ /** Usually OMIT it: the child takes this Work Order's cohort, and everything it files takes the child's. Pass `{"new": true, "label": "<name>"}` only when this child OPENS a sub-unit of what this Work Order is doing — a wave of a feature, or one group of a wave — and the child's own breakdown should be grouped under that name. It mints a cohort, nested under this Work Order's, whose id is the child's own; everything the child files inherits it. Each call mints one, so do not label every child you file: that makes one cohort per child. To put several children in ONE sub-unit, open it with the first and pass `{"of": "<that child's id>"}` on every other: `of` joins the cohort of a Work Order whose cohort is this Work Order's or nested beneath it, and is refused exactly as reading that Work Order would be. A child can name no cohort outside this Work Order's tree, cannot name one by bare id, and cannot detach. A drafted child's cohort is settled when it is released: a `new` is minted, and its label written, then; an `of` naming another draft needs that draft released first or in the same set. */
566
+ cohort?: {
567
+ /** The new cohort's name, stored as given and drawn verbatim. At most 256 bytes; no control characters. Not unique, and never an address. */
568
+ label?: string;
569
+ new?: true;
570
+ /** Join the cohort of the Work Order with this id, which must be this Work Order's cohort or nested beneath it. Alone: not beside `new` or `label`. */
571
+ of?: string;
572
+ };
573
+ /** Capacity key; Work Orders sharing a resolved key do not run concurrently. Omit to take the type's own template. */
574
+ concurrency_key?: string;
575
+ /** RFC3339 timestamp before which the child is not ready. */
576
+ deferred_until?: string;
577
+ /** Work Order ids that must each complete successfully before this child is ready. A dependency that ends failed or cancelled never releases its dependent. */
578
+ depends_on?: string[];
579
+ /** File this Work Order in `draft` instead of `scheduled`: it exists, it is durable, it is visible on `list` / `tree` / `get`, and it DOES NOT RUN. No gate is evaluated, no capacity is consumed and no seat is drawn, so a draft costs nothing while it sits. It leaves by exactly two doors — released into the normal lifecycle, or cancelled — and nothing puts a Work Order back into `draft` once it has left. A draft BLOCKS anything that names it in `depends_on`, which is what makes drafting a whole breakdown safe: the dependent reports the draft's id under `block_reason.detail.pending` and waits, so an unreleased item cannot be stepped over. It also never expires, and nothing sweeps it — an abandoned draft is clutter you can see and cancel, deliberately preferred to work deleted on a timer. OMIT IT unless something has to review this before it runs. Filing directly is the normal case and is exactly what it was before this field existed; drafting is for the breakdown that wants approving, the Work Order being composed incrementally, and the bulk file that should be checked before any of it dispatches. */
580
+ draft?: boolean;
581
+ /** Typed inputs, validated against the child type's declared input schema. */
582
+ inputs?: {
583
+ [key: string]: unknown;
584
+ };
585
+ /** File this child behind the human-approval gate: it reaches `blocked:waiting-on-approval` and waits there for a person. Stated per child and never inherited from the parent. */
586
+ needs_approval?: boolean;
587
+ /** Informational, like `policy`. */
588
+ on_child_failure?: "fail-fast" | "wait-others" | "ignore";
589
+ /** The off-tera Work Order you hold, to file this child beneath (ADR-139 D6). Honoured only for its current taker; omit it inside a dispatch, where the parent is the dispatch's own Work Order. */
590
+ parent?: string;
591
+ /** Informational: echoed back for your own bookkeeping. What governs whether the parent waits is the wait it declares, not this field. */
592
+ policy?: "wait-for-all" | "wait-for-any" | "fire-and-forget";
593
+ /** Dispatch priority; higher runs sooner among ready Work Orders. */
594
+ priority?: number;
595
+ /** At most 32 tags, each at most 128 BYTES (not characters — a tag of 128 multi-byte characters is refused). */
596
+ tags?: string[];
597
+ /** One-line human summary, shown on list and tree rows. */
598
+ title?: string;
599
+ /** Registered Work Order Type to file the child against. A bare leaf name is accepted when no other registered type shares it. */
600
+ type: string;
601
+ /** The child's owning worker. It must be the parent's; omit it to take the parent's. */
602
+ worker?: string;
603
+ };
604
+ /**
605
+ * `work_order.create_child` result (v1).
606
+ *
607
+ * What `work_order.create_child` answers on success (ADR-143 D4), generated from `workorder.CreateChildResult`. A refusal is not this document: it is the invocation's `error` envelope.
608
+ *
609
+ * Schema: sdk/workorder/schema/v1/create_child.result.json
610
+ */
611
+ export type WorkOrderCreateChildResult = {
612
+ id: string;
613
+ parent_id: string;
614
+ cohort_id: string;
615
+ worker: string;
616
+ state: string;
617
+ policy: string;
618
+ on_child_failure?: string;
619
+ attachments?: {
620
+ handle: string;
621
+ filename: string;
622
+ mime_type: string;
623
+ size_bytes: number;
624
+ description?: string;
625
+ consumed: boolean;
626
+ }[];
627
+ };
628
+ /**
629
+ *
630
+ * Schema: sdk/workorder/schema/v1/edit.params.json
631
+ */
632
+ export type WorkOrderEditParams = {
633
+ /** The prose specification handed to the dispatched agent. Stated empty clears it. To correct part of it without re-emitting the whole thing, use `edits`. */
634
+ body?: string;
635
+ /** Capacity key; Work Orders sharing a resolved key do not run concurrently. Stated empty removes the restriction. It is not re-derived from the type's template when `inputs` change — a stated key is yours to keep, so re-derivation would silently overwrite it from a field that has nothing to do with it; state the key to change it. */
636
+ concurrency_key?: string;
637
+ /** Work Order ids that must each complete successfully before this one is dispatched. REPLACES the current set; `[]` clears it. Every id must exist, none may repeat, and none may be this Work Order itself. Checked for cycles against the combined dependency / parent / wait graph BEFORE anything is written — a dependency that would close one refuses the whole call, naming the edges, and the draft is left exactly as it was including the other fields the call stated. */
638
+ depends_on?: string[];
639
+ /** Substring replacements against this draft's prose, stated instead of its new full value — the cheapest spelling there is, and the one the whole amendment exists for: a correction to a few sentences of a task document costs the correction rather than the document. Applied IN ORDER, each against the result of the previous, so a later edit may target text an earlier one produced. ANY failing edit refuses the WHOLE call and writes nothing — not the other edits, and not the other fields the same call stated. An `old_string` that is not found is a refusal (`string_edit_not_found`), and so is one matching more than once without `replace_all` (`string_edit_ambiguous`, which reports the count); the first match is never taken silently. A field cannot be both edited here and stated wholesale in the same call. */
640
+ edits?: {
641
+ /** What this edit addresses: `title`, `body`, or `inputs.<key>` for one key of the typed input document — e.g. `inputs.task`, which is where the code-* types keep their task prose. Everything after the first dot is the key verbatim, so an input key containing a dot is addressable. The addressed input must exist and must be a string. The other editable fields are refused by name: `worker` and `concurrency_key` are short identifiers cheaper to state whole, and `tags`, `depends_on`, `links`, `relations` and `priority` are not text. */
642
+ field: string;
643
+ /** What replaces it. May be empty, which deletes the text. May not equal `old_string`: replacing text with itself is an argument that was dropped, not a change. */
644
+ new_string: string;
645
+ /** The exact text to find. Never empty — the empty string occurs everywhere and so names no location. Include enough surrounding text to identify ONE occurrence, or set `replace_all`. */
646
+ old_string: string;
647
+ /** Replace EVERY occurrence. Unset, a second match refuses the call and reports the count rather than silently picking the first — a caller that meant a later occurrence would otherwise have no way to see that the wrong text moved. */
648
+ replace_all?: boolean;
649
+ }[];
650
+ /** The Work Order to edit: a draft for any field, any state for `title` and `links`. Required, and never defaulted from the caller's own dispatch: an edit is stated about a Work Order by somebody who is not running it, so a defaulted id would let a mistyped call rewrite the caller's own work. */
651
+ id: string;
652
+ /** Typed inputs, REPLACING the draft's current ones wholesale — this is not a merge, so state every key you want the Work Order to keep. To change SOME keys use `inputs_patch`, and to change some TEXT inside one key use `edits`; both cost the size of the correction rather than the size of the document. They are not validated against the type's input schema here: ADR-104 D10 makes an incomplete draft a legitimate artifact and checks validity at release, which is what lets a Work Order be composed across several edits. */
653
+ inputs?: {
654
+ [key: string]: unknown;
655
+ };
656
+ /** Typed inputs to change, MERGED per key — the cheap spelling of `inputs`, and the one to reach for when a correction is smaller than the document. A stated key replaces that key, an UNSTATED key is left exactly as it is, and a key stated as null is REMOVED. Only top-level keys: a stated object value replaces that input wholesale rather than merging into it, which is where this deliberately departs from RFC 7386 JSON Merge Patch — inputs are flat in practice, and recursion would make "replace a whole object-valued input" a question with a surprising answer. Cannot be stated together with `inputs`, which answers the same question wholesale. Because null is the removal spelling, an input cannot be SET to null through a patch; state `inputs` for that. Not validated against the type's input schema here — ADR-104 D10 checks validity at release. */
657
+ inputs_patch?: {
658
+ [key: string]: unknown;
659
+ };
660
+ /** Typed references to the vault DOCUMENTS that spawned or inform this Work Order (ADR-048). REPLACES the current list; `[]` clears it. Editable in any state, like `title`. Same grammar as on work_order.create: each entry is a {type, ref} pair with an optional note, and `ref` is `vault://<vault-id>/<path>[#<block-id>]`, e.g. `vault://0190d4f2-6b3a-7c11-9f2e-8a4c1d5e6f70/features/inspector/PRD.md`. */
661
+ links?: {
662
+ note?: string;
663
+ ref: string;
664
+ type: "references" | "source";
665
+ }[];
666
+ /** Dispatch priority; higher runs sooner among ready Work Orders. */
667
+ priority?: number;
668
+ /** Optional note recorded on the `edited` event, read by whoever asks why this draft says something different from what was filed. The event names the actor and the fields either way; this is the why. */
669
+ reason?: string;
670
+ /** Typed, NON-CAUSAL relations to ASSERT on this draft (supersedes / duplicate_of / about / related). ADDITIVE, unlike every other field here: entries are asserted and nothing is withdrawn by omission, because two of the four are evaluative — they change what the TARGET's own work_order.get says about how to treat it — and dropping one by leaving it out would retract a claim about another Work Order silently. To remove an edge, use work_order.unrelate, which names the triple it withdraws. Same authorization as work_order.relate: an operator-class caller needs `api/v1/workorders/relate` on top of its edit grant, because the edge is the relate operation whichever call delivered it. */
671
+ relations?: {
672
+ /** Optional free text recorded on the edge and on the event announcing it. At most 256 bytes — stated here rather than as `maxLength`, which counts code points, because the handler measures bytes and a schema promising otherwise would advertise a leniency it does not honour. */
673
+ note?: string;
674
+ /** What this Work Order claims about the target. about (this Work Order's work is examining or acting on that one), duplicate_of (this should not exist; that one is the real work), related (see-also, carrying no lifecycle implication), supersedes (this replaces that one; that one should not be retried). Deliberately absent: `retry_of` (the retry machinery already records attempts against a single Work Order) and anything blocking-shaped (that is `depends_on`, which is causal and gates dispatch). */
675
+ relation: "about" | "duplicate_of" | "related" | "supersedes";
676
+ /** The Work Order this claim is about, as a bare id — the same spelling `depends_on` and `parent_id` use. Not a `vault://` ref: those address a document at a path inside a volume, and a Work Order is a row in the Work Order store. */
677
+ work_order_id: string;
678
+ }[];
679
+ /** Free-form labels carried on the row for reporting, and selectable with `work_order.list`'s `tag` filter, which matches a tag whole. REPLACES the current set; `[]` clears it. At most 32 tags, each at most 128 BYTES (not characters — a tag of 128 multi-byte characters is refused). */
680
+ tags?: string[];
681
+ /** One-line human summary, shown on list / tree rows. Editable in any state, so a Work Order's title can follow what it turned out to be. Stated empty clears it. To change part of a DRAFT's title rather than all of it, use `edits`. */
682
+ title?: string;
683
+ /** The worker that will own the released Work Order. Releasing a draft requires one, so this is the field that repairs a draft filed against the wrong owner. */
684
+ worker?: string;
685
+ };
686
+ /**
687
+ * `work_order.edit` result (v1).
688
+ *
689
+ * What `work_order.edit` answers on success (ADR-143 D4), generated from `workorder.EditResult`. A refusal is not this document: it is the invocation's `error` envelope.
690
+ *
691
+ * Schema: sdk/workorder/schema/v1/edit.result.json
692
+ */
693
+ export type WorkOrderEditResult = {
694
+ id: string;
695
+ state: string;
696
+ applied: string[] | null;
697
+ worker: string;
698
+ title: string;
699
+ body: string;
700
+ /** The draft's inputs after the edit, in the shape its type's input_schema declares. */
701
+ inputs: unknown;
702
+ priority: number;
703
+ tags: string[] | null;
704
+ depends_on: string[] | null;
705
+ concurrency_key: string;
706
+ links: {
707
+ type: string;
708
+ ref: string;
709
+ note?: string;
710
+ }[] | null;
711
+ relations: {
712
+ relation: string;
713
+ work_order_id: string;
714
+ note?: string;
715
+ created_at: string;
716
+ created_by?: string;
717
+ }[] | null;
718
+ related_by: {
719
+ relation: string;
720
+ work_order_id: string;
721
+ note?: string;
722
+ created_at: string;
723
+ created_by?: string;
724
+ }[] | null;
725
+ relation_scope?: {
726
+ withheld_relations?: number;
727
+ withheld_related_by?: number;
728
+ note: string;
729
+ };
730
+ };
731
+ /**
732
+ *
733
+ * Schema: sdk/workorder/schema/v1/events.params.json
734
+ */
735
+ export type WorkOrderEventsParams = {
736
+ /** Work Order to read events for. Omit to read the global event stream across every Work Order (operator-gated). */
737
+ id?: string;
738
+ /** Maximum rows to return; 0 or absent means no cap. Exactly `limit` rows back means there is more to read. */
739
+ limit?: number;
740
+ /** A plugin principal, `plugin:<vault>/<name>`. Global stream only: returns just the events whose actor names that plugin (ADR-141 D7) — what it did as itself, the Work Orders its triggers filed, and what a person did through its on-behalf-of token. The cursor contract is unchanged. */
741
+ plugin?: string;
742
+ /** Exclusive cursor: return only events with id > since. Resume from the id of the last row processed. */
743
+ since?: number;
744
+ };
745
+ /**
746
+ * `work_order.events` result (v1).
747
+ *
748
+ * What `work_order.events` answers on success (ADR-143 D4), generated from `workorder.EventsResult`. A refusal is not this document: it is the invocation's `error` envelope.
749
+ *
750
+ * Schema: sdk/workorder/schema/v1/events.result.json
751
+ */
752
+ export type WorkOrderEventsResult = {
753
+ events: {
754
+ id: number;
755
+ work_order_id: string;
756
+ work_order_type?: string;
757
+ timestamp: string;
758
+ kind: string;
759
+ from_state?: string;
760
+ to_state: string;
761
+ reason?: string;
762
+ /** The event's payload, whose shape its kind decides, as the event log recorded it. */
763
+ payload?: unknown;
764
+ /** Who caused the event, as the event log recorded it. The shape written is an EventActor; a row written before a field existed lacks that key. */
765
+ actor?: unknown;
766
+ }[] | null;
767
+ /** Set on the global stream when since lies below the history watermark: events at or below this id may be missing from the stream because a delete removed them. Omitted when the stream from since is complete. */
768
+ trimmed_through?: number;
769
+ };
770
+ /**
771
+ *
772
+ * Schema: sdk/workorder/schema/v1/fail.params.json
773
+ */
774
+ export type WorkOrderFailParams = {
775
+ error: string;
776
+ /** Machine-readable failure signature (ADR-079 D1). Optional; `error` remains the human-readable line. Consumed by the exception funnel's intake to decide whether a deterministic pre-filter can act on this failure. */
777
+ failure?: {
778
+ /** kind=permission_denied: the capability whose invocation was refused (`work_order.fail`). Names the grant an operator has to restore. */
779
+ capability?: string;
780
+ /** Opaque per-kind detail. Not a place for a field the kind should name. */
781
+ detail?: unknown;
782
+ /** The wire error code the failure arrived with, verbatim (`envelope_missing`, `exec_error`, `local_execution_refused`). Provenance rather than a second discriminator: `kind` is this daemon's own closed vocabulary and is what you branch on, and this is the capability-plane value it was derived from — whose producer is free to add codes this daemon has no kind for. The derivation is lossy on purpose (`exec_error` and `producer_exit` share one kind), so this is where the distinction survives. One arm states the daemon's own attribution instead of the step's code: a dispatch whose pool member's credential died reports `producer_exit` like any other dead producer, and the daemon — which held the member and typed the death — records `account_auth_failed`, with the step's own code preserved on `detail.code`. Optional; most failures carry no code. */
783
+ error_code?: string;
784
+ /** Which failure shape this is. Selects which of the fields below are required. */
785
+ kind: "ceiling_exceeded" | "delegation_not_granted" | "dispatch_dead" | "dispatch_failed" | "environment_provisioning_failed" | "execution_error" | "permission_denied" | "result_envelope_invalid" | "result_envelope_missing" | "session_lost" | "test_failure" | "work_reported_failure" | "worker_removed";
786
+ /** error_code=account_auth_failed: the resource-pool member whose credential the dispatch drew on when the producer holding it reported that credential dead. The actionable half of that failure — the operator's next move is `tera seats credential <member>`, which takes this as its argument. Keyed on the code rather than on `kind`, because the dead-credential failure is an `execution_error` whose other producers name no member. Recorded, not required. */
787
+ member?: string;
788
+ /** kind=test_failure: repo-relative package the failure was reported in (`pkg/workorder`, `tests/harness`). */
789
+ package?: string;
790
+ /** kind=permission_denied: the authorization subject the refusal was decided on — the principal this Work Order's dispatches authorize as. Recorded, not required. */
791
+ subject?: string;
792
+ /** kind=test_failure: the failing test exactly as `--- FAIL:` spells it, including the `TestExternalHarness/<scenario>` prefix for harness scenarios. Matched for equality by the flake registry, so an approximation is worse than an absence. */
793
+ test_name?: string;
794
+ };
795
+ /** Work Order id. Optional for the dispatched root recipe — omit it and the id is taken from the dispatch context. When supplied it must equal the Work Order this recipe was dispatched for. */
796
+ id?: string;
797
+ retriable?: boolean;
798
+ };
799
+ /**
800
+ * `work_order.fail` result (v1).
801
+ *
802
+ * What `work_order.fail` answers on success (ADR-143 D4), generated from `workorder.FailResult`. A refusal is not this document: it is the invocation's `error` envelope.
803
+ *
804
+ * Schema: sdk/workorder/schema/v1/fail.result.json
805
+ */
806
+ export type WorkOrderFailResult = {
807
+ id: string;
808
+ state: string;
809
+ };
810
+ /**
811
+ *
812
+ * Schema: sdk/workorder/schema/v1/force_fail.params.json
813
+ */
814
+ export type WorkOrderForceFailParams = {
815
+ /** Machine-readable failure signature (ADR-079 D1). Optional; `error` remains the human-readable line. Consumed by the exception funnel's intake to decide whether a deterministic pre-filter can act on this failure. */
816
+ failure?: {
817
+ /** kind=permission_denied: the capability whose invocation was refused (`work_order.fail`). Names the grant an operator has to restore. */
818
+ capability?: string;
819
+ /** Opaque per-kind detail. Not a place for a field the kind should name. */
820
+ detail?: unknown;
821
+ /** The wire error code the failure arrived with, verbatim (`envelope_missing`, `exec_error`, `local_execution_refused`). Provenance rather than a second discriminator: `kind` is this daemon's own closed vocabulary and is what you branch on, and this is the capability-plane value it was derived from — whose producer is free to add codes this daemon has no kind for. The derivation is lossy on purpose (`exec_error` and `producer_exit` share one kind), so this is where the distinction survives. One arm states the daemon's own attribution instead of the step's code: a dispatch whose pool member's credential died reports `producer_exit` like any other dead producer, and the daemon — which held the member and typed the death — records `account_auth_failed`, with the step's own code preserved on `detail.code`. Optional; most failures carry no code. */
822
+ error_code?: string;
823
+ /** Which failure shape this is. Selects which of the fields below are required. */
824
+ kind: "ceiling_exceeded" | "delegation_not_granted" | "dispatch_dead" | "dispatch_failed" | "environment_provisioning_failed" | "execution_error" | "permission_denied" | "result_envelope_invalid" | "result_envelope_missing" | "session_lost" | "test_failure" | "work_reported_failure" | "worker_removed";
825
+ /** error_code=account_auth_failed: the resource-pool member whose credential the dispatch drew on when the producer holding it reported that credential dead. The actionable half of that failure — the operator's next move is `tera seats credential <member>`, which takes this as its argument. Keyed on the code rather than on `kind`, because the dead-credential failure is an `execution_error` whose other producers name no member. Recorded, not required. */
826
+ member?: string;
827
+ /** kind=test_failure: repo-relative package the failure was reported in (`pkg/workorder`, `tests/harness`). */
828
+ package?: string;
829
+ /** kind=permission_denied: the authorization subject the refusal was decided on — the principal this Work Order's dispatches authorize as. Recorded, not required. */
830
+ subject?: string;
831
+ /** kind=test_failure: the failing test exactly as `--- FAIL:` spells it, including the `TestExternalHarness/<scenario>` prefix for harness scenarios. Matched for equality by the flake registry, so an approximation is worse than an absence. */
832
+ test_name?: string;
833
+ };
834
+ /** The Work Order to force-fail. Required — this verb acts on a Work Order the caller is not running, so there is no dispatch context to take an id from. */
835
+ id: string;
836
+ /** Why this Work Order is being declared dead. Required, and recorded on the transition event — it is what someone reading the event log later has to distinguish an operator's judgement from the agent's own failure report. */
837
+ reason: string;
838
+ };
839
+ /**
840
+ * `work_order.force_fail` result (v1).
841
+ *
842
+ * What `work_order.force_fail` answers on success (ADR-143 D4), generated from `workorder.ForceFailResult`. A refusal is not this document: it is the invocation's `error` envelope.
843
+ *
844
+ * Schema: sdk/workorder/schema/v1/force_fail.result.json
845
+ */
846
+ export type WorkOrderForceFailResult = {
847
+ id: string;
848
+ state: string;
849
+ from_state: string;
850
+ upstream?: {
851
+ upstream?: string;
852
+ tracking_severed: boolean;
853
+ upstream_cancelled: boolean;
854
+ outcome_provenance: string;
855
+ outcome_cause: string;
856
+ last_reported_state?: string;
857
+ };
858
+ };
859
+ /**
860
+ *
861
+ * Schema: sdk/workorder/schema/v1/get.params.json
862
+ */
863
+ export type WorkOrderGetParams = {
864
+ /** Work Order to read. On a `paused:awaiting-input` Work Order the response's `question` field carries what is being asked — read it before calling work_order.answer. **Tell that state from `paused:awaiting-interactive-turn`, which carries no question and is not a run that needs you** (ADR-129 D3): `paused:awaiting-input` is a producer that asked a specific question and is stuck until a person decides it, while `paused:awaiting-interactive-turn` is an interactive session that has yielded the turn and is waiting at its inbox for whatever comes next — a message, any of its own children settling, or the pause's own deadline. "Input" is a generic word and the second is NOT a kind of the first. On any paused Work Order `waiting_on` carries what would reopen it: `resume` names the door (empty means no door consults this pause, so nothing will end it), and `inert_predicate` marks a recorded predicate nothing consults. A park whose `resume` is "children settle" is waiting on its children — answering it destroys the wait. **`waiting_on.refusal` outranks all of that**: present only while this run's resume is being turned away, it names the cause, the member or pool, whether waiting helps, and `clears` — what would end it. While it is set the door named in `resume` is NOT what is holding the run, so do not suggest waking it: a wake re-enters the same gate and is refused again. */
865
+ id: string;
866
+ /** How much of the Work Order to answer with. `full` (the default when absent) is the whole materialized snapshot. `summary` is the same document with the operator diagnostics left out — the lean read for a supervising caller: state, what a park is waiting on and asking, why it is blocked or failed, and `has_outputs` in place of the outputs; it carries no recovery, pin, selection, pause_reason, body, inputs or outputs. Any other value is refused. */
867
+ view?: "full" | "summary";
868
+ };
869
+ /**
870
+ * `work_order.get` result (v1).
871
+ *
872
+ * What `work_order.get` answers on success (ADR-143 D4), generated from `workorder.GetResult`. A refusal is not this document: it is the invocation's `error` envelope.
873
+ *
874
+ * Schema: sdk/workorder/schema/v1/get.result.json
875
+ */
876
+ export type WorkOrderGetResult = {
877
+ context_compactions?: {
878
+ state: string;
879
+ count: number | null;
880
+ latest_at?: string;
881
+ };
882
+ recovery?: {
883
+ workspace: {
884
+ state: string;
885
+ source: string;
886
+ host?: {
887
+ kind: string;
888
+ runner: string;
889
+ };
890
+ recorded_at?: string;
891
+ retired_at?: string;
892
+ };
893
+ session: {
894
+ resumability: string;
895
+ reason: string;
896
+ continuity_state: string;
897
+ latest_by_capability: {
898
+ event_id: number;
899
+ context_compactions?: number;
900
+ invocation_id?: string;
901
+ capability: string;
902
+ session_scope?: string;
903
+ session_id?: string;
904
+ resumed?: boolean;
905
+ resume_count?: number;
906
+ started_at?: string;
907
+ resume_refused?: boolean;
908
+ resume_refused_cause?: string;
909
+ resume_refused_reason?: string;
910
+ held_on?: string;
911
+ dispatched_to?: string;
912
+ unreported_resumes?: number;
913
+ unreported_resume_outcome?: string;
914
+ phase?: string;
915
+ observed_at: string;
916
+ }[] | null;
917
+ resume_tokens?: {
918
+ session_scope: string;
919
+ event_id: number;
920
+ session_id?: string;
921
+ stamped: boolean;
922
+ not_stamped_reason?: string;
923
+ }[];
924
+ };
925
+ guidance: string;
926
+ };
927
+ id: string;
928
+ worker: string;
929
+ type: string;
930
+ type_leaf: string;
931
+ parent_id?: string;
932
+ cohort_id: string;
933
+ state: string;
934
+ title?: string;
935
+ body?: string;
936
+ /** The Work Order's inputs, in the shape its type's input_schema declares. */
937
+ inputs?: unknown;
938
+ /** The Work Order's outputs, in the shape its type's output_schema declares. */
939
+ outputs?: unknown;
940
+ tags: string[] | null;
941
+ priority: number;
942
+ depends_on?: string[];
943
+ links?: {
944
+ type: string;
945
+ ref: string;
946
+ note?: string;
947
+ }[];
948
+ deferred_until?: string;
949
+ needs_approval?: boolean;
950
+ pause_reason?: {
951
+ kind: string;
952
+ /** The wait predicate the pause was taken on, as its pauser stated it: a WaitPredicate, a kind and that kind's spec. */
953
+ predicate?: unknown;
954
+ /** The pause context, in whatever shape the pauser wrote. */
955
+ context?: unknown;
956
+ delivery_envelope?: string;
957
+ authorized_by?: {
958
+ class: string;
959
+ principal?: string;
960
+ groups?: string[];
961
+ origin: string;
962
+ session_id?: string;
963
+ worker?: string;
964
+ parent_id?: string;
965
+ authorized_for?: string;
966
+ plugin?: string;
967
+ evidence_class?: string;
968
+ };
969
+ };
970
+ question?: {
971
+ text?: string;
972
+ /** The asker's structured evidence, or the whole pause context when it is not in the asking shape: its shape is the asker's. */
973
+ context?: unknown;
974
+ description?: string;
975
+ };
976
+ waiting_on?: {
977
+ pause_kind: string;
978
+ predicate_kind?: string;
979
+ resume: string;
980
+ inert_predicate?: boolean;
981
+ unsatisfiable?: boolean;
982
+ held_answer?: boolean;
983
+ refusal?: {
984
+ cause: string;
985
+ member?: string;
986
+ pool?: string;
987
+ pool_cause?: string;
988
+ verb?: string;
989
+ repairable: boolean;
990
+ refused_at?: string;
991
+ clears?: string;
992
+ };
993
+ input_barrier?: {
994
+ input_id: string;
995
+ input_sequence: number;
996
+ attempt_id?: string;
997
+ state: string;
998
+ reconciliation: string;
999
+ behind: number;
1000
+ recovery: string;
1001
+ };
1002
+ };
1003
+ delegation?: {
1004
+ subject: string;
1005
+ outstanding: string[] | null;
1006
+ unavailable?: {
1007
+ upstream: string;
1008
+ gap: string;
1009
+ }[];
1010
+ withdrawn?: {
1011
+ upstream: string;
1012
+ gap: string;
1013
+ }[];
1014
+ door?: string;
1015
+ walled?: string[];
1016
+ fails_at?: string;
1017
+ checked_at?: string;
1018
+ dispatch_timeout_seconds?: number;
1019
+ failures?: {
1020
+ connection: string;
1021
+ upstream?: string;
1022
+ holder: {
1023
+ kind: string;
1024
+ name: string;
1025
+ };
1026
+ reason: string;
1027
+ act_by: string;
1028
+ repair: string;
1029
+ evidence?: string;
1030
+ }[];
1031
+ };
1032
+ could_not_decide?: {
1033
+ kind: string;
1034
+ detail?: string;
1035
+ };
1036
+ block_reason?: {
1037
+ kind: string;
1038
+ detail?: unknown;
1039
+ };
1040
+ retry?: {
1041
+ attempt: number;
1042
+ max: number;
1043
+ next_retry_at?: string;
1044
+ hint?: string;
1045
+ reason?: string;
1046
+ resumed_unobserved?: boolean;
1047
+ /** The daemon's own account of why the previous attempt's result declaration was refused, composed at the retry: the violations as the refusal recorded them and the pinned output_schema the next attempt is judged by. */
1048
+ output_contract?: unknown;
1049
+ };
1050
+ failure?: {
1051
+ kind: string;
1052
+ test_name?: string;
1053
+ package?: string;
1054
+ capability?: string;
1055
+ member?: string;
1056
+ subject?: string;
1057
+ error_code?: string;
1058
+ /** Per-kind detail of the failure, opaque by contract: its shape is the producer's that reported it. */
1059
+ detail?: unknown;
1060
+ };
1061
+ step_refusal?: {
1062
+ state: string;
1063
+ binding?: {
1064
+ source: string;
1065
+ event_id: number;
1066
+ at: string;
1067
+ reason?: string;
1068
+ to_state?: string;
1069
+ site?: string;
1070
+ candidate?: string;
1071
+ selection_mode?: string;
1072
+ binding_state?: string;
1073
+ settlement_kind?: string;
1074
+ };
1075
+ step?: {
1076
+ source: string;
1077
+ event_id: number;
1078
+ at: string;
1079
+ reason?: string;
1080
+ to_state?: string;
1081
+ site?: string;
1082
+ candidate?: string;
1083
+ selection_mode?: string;
1084
+ binding_state?: string;
1085
+ settlement_kind?: string;
1086
+ };
1087
+ };
1088
+ salvage?: {
1089
+ inspected_at: string;
1090
+ duration_ms?: number;
1091
+ status: string;
1092
+ error?: string;
1093
+ ending?: string;
1094
+ volumes?: {
1095
+ id?: string;
1096
+ kind?: string;
1097
+ path?: string;
1098
+ present: boolean;
1099
+ inspected: boolean;
1100
+ skip_reason?: string;
1101
+ remotes?: {
1102
+ name?: string;
1103
+ url?: string;
1104
+ }[];
1105
+ base_ref?: string;
1106
+ base_sha?: string;
1107
+ branches?: {
1108
+ name: string;
1109
+ tip_sha?: string;
1110
+ push_state: string;
1111
+ push_reason?: string;
1112
+ remote_ref?: string;
1113
+ remote_sha?: string;
1114
+ upstream?: string;
1115
+ commits?: {
1116
+ sha: string;
1117
+ subject?: string;
1118
+ subject_truncated?: boolean;
1119
+ committed_at?: string;
1120
+ }[];
1121
+ history_truncated?: string;
1122
+ }[];
1123
+ branches_truncated?: boolean;
1124
+ worktree?: {
1125
+ modified: number;
1126
+ staged: number;
1127
+ untracked: number;
1128
+ untracked_excluding_dispatch_scratch?: number;
1129
+ };
1130
+ envelope?: {
1131
+ declared: boolean;
1132
+ path?: string;
1133
+ present: boolean;
1134
+ bytes?: number;
1135
+ parsed: boolean;
1136
+ parse_error?: string;
1137
+ content?: string;
1138
+ truncated?: boolean;
1139
+ };
1140
+ pull_request?: {
1141
+ determined: boolean;
1142
+ reason?: string;
1143
+ url?: string;
1144
+ number?: number;
1145
+ source?: string;
1146
+ hint_url?: string;
1147
+ };
1148
+ }[];
1149
+ truncated?: boolean;
1150
+ dropped?: string[];
1151
+ };
1152
+ workspace?: {
1153
+ runner: string;
1154
+ attempt: number;
1155
+ recorded_at: string;
1156
+ retired_at?: string;
1157
+ hold_started_at?: string;
1158
+ };
1159
+ session_loss?: {
1160
+ cause: string;
1161
+ held_on: string;
1162
+ dispatched_to: string;
1163
+ attempt: number;
1164
+ deadline?: string;
1165
+ held_since?: string;
1166
+ observed_at: string;
1167
+ volumes?: string[];
1168
+ };
1169
+ execution?: {
1170
+ waiter?: string;
1171
+ runner?: string;
1172
+ dispatch_id?: string;
1173
+ step_dispatch_id?: string;
1174
+ since?: string;
1175
+ late_results?: {
1176
+ disposition: string;
1177
+ runner: string;
1178
+ dispatch_id: string;
1179
+ step_dispatch_id?: string;
1180
+ attempt: number;
1181
+ status?: string;
1182
+ recorded_at?: string;
1183
+ event_id: number;
1184
+ }[];
1185
+ };
1186
+ upstream_task?: {
1187
+ upstream: string;
1188
+ task_id: string;
1189
+ tool?: string;
1190
+ last_reported_state?: string;
1191
+ sync: {
1192
+ last_synced_at?: string;
1193
+ reachability?: string;
1194
+ unreachable_since?: string;
1195
+ detail?: string;
1196
+ };
1197
+ outcome_provenance?: string;
1198
+ outcome_cause?: string;
1199
+ cancel_requested_at?: string;
1200
+ };
1201
+ take?: {
1202
+ principal: string;
1203
+ taken_at: string;
1204
+ last_progress_at?: string;
1205
+ describe?: string;
1206
+ caller_is_person?: boolean;
1207
+ outcome_provenance?: string;
1208
+ };
1209
+ outcome?: {
1210
+ outcome_provenance: string;
1211
+ attested_by?: string;
1212
+ };
1213
+ relations: {
1214
+ relation: string;
1215
+ work_order_id: string;
1216
+ note?: string;
1217
+ created_at: string;
1218
+ created_by?: string;
1219
+ }[] | null;
1220
+ related_by: {
1221
+ relation: string;
1222
+ work_order_id: string;
1223
+ note?: string;
1224
+ created_at: string;
1225
+ created_by?: string;
1226
+ }[] | null;
1227
+ relation_scope?: {
1228
+ withheld_relations?: number;
1229
+ withheld_related_by?: number;
1230
+ note: string;
1231
+ };
1232
+ validity?: {
1233
+ valid: boolean;
1234
+ reason?: string;
1235
+ field?: string;
1236
+ };
1237
+ pin?: {
1238
+ state: string;
1239
+ generation?: number;
1240
+ first_generation?: boolean;
1241
+ config_digest?: string;
1242
+ schema_version?: number;
1243
+ pinned_at?: string;
1244
+ provenance?: string;
1245
+ pinned_by?: string;
1246
+ reason?: string;
1247
+ absence?: string;
1248
+ refusal?: string;
1249
+ cause?: string;
1250
+ match?: {
1251
+ verdict: string;
1252
+ live_digest?: string;
1253
+ cause?: string;
1254
+ };
1255
+ } | null;
1256
+ selection?: {
1257
+ state: string;
1258
+ cause?: string;
1259
+ refusal?: string;
1260
+ refusal_cause?: string;
1261
+ pin_schema_version?: number;
1262
+ sites?: {
1263
+ state: string;
1264
+ logical_site_id: string;
1265
+ path?: string;
1266
+ step?: string;
1267
+ selectable: boolean;
1268
+ policy?: {
1269
+ mode: string;
1270
+ candidate?: string;
1271
+ order?: string[];
1272
+ };
1273
+ interaction?: string;
1274
+ interactive_request?: boolean;
1275
+ yields_turn_offer?: boolean;
1276
+ offer_contradiction?: boolean;
1277
+ workflow_instance_id?: string;
1278
+ chain_generation?: number;
1279
+ binding_state?: string;
1280
+ revision?: number;
1281
+ admission_revision?: number;
1282
+ pin_generation?: number;
1283
+ pin_digest?: string;
1284
+ site_definition_digest?: string;
1285
+ selection_mode?: string;
1286
+ selection_reason?: string;
1287
+ requested?: {
1288
+ candidate: string;
1289
+ };
1290
+ selected?: {
1291
+ candidate?: string;
1292
+ capability_type?: string;
1293
+ capability?: string;
1294
+ operation?: string;
1295
+ effective_config_digest?: string;
1296
+ native_input_digest?: string;
1297
+ profile_digest?: string;
1298
+ };
1299
+ admitted?: {
1300
+ revision: number;
1301
+ dispatch_id?: string;
1302
+ draws?: {
1303
+ provenance: string;
1304
+ pool: string;
1305
+ member?: string;
1306
+ }[];
1307
+ draws_unreadable?: boolean;
1308
+ };
1309
+ accepted?: {
1310
+ dispatch_document_digest?: string;
1311
+ receipt: boolean;
1312
+ };
1313
+ started?: {
1314
+ at: string;
1315
+ };
1316
+ settled?: {
1317
+ kind?: string;
1318
+ digest?: string;
1319
+ at?: string;
1320
+ };
1321
+ wait?: {
1322
+ fingerprint?: string;
1323
+ decisions?: {
1324
+ candidate?: string;
1325
+ class?: string;
1326
+ reason?: string;
1327
+ detail?: string;
1328
+ terminal?: boolean;
1329
+ }[];
1330
+ dependencies?: {
1331
+ candidate?: string;
1332
+ kind?: string;
1333
+ id?: string;
1334
+ deadline?: string;
1335
+ }[];
1336
+ earliest_deadline?: string;
1337
+ unreadable?: boolean;
1338
+ };
1339
+ attempt_digest?: string;
1340
+ model_policy?: {
1341
+ profile_id?: string;
1342
+ profile_version?: number;
1343
+ requested_tier?: string;
1344
+ requested_model?: string;
1345
+ requested_effort?: string;
1346
+ resolved_tier?: string;
1347
+ resolved_model?: string;
1348
+ resolved_effort?: string;
1349
+ table_source?: string;
1350
+ table_revision?: string;
1351
+ reported_state: string;
1352
+ reported_model?: string;
1353
+ reported_effort?: string;
1354
+ };
1355
+ refusal?: string;
1356
+ refusal_cause?: string;
1357
+ created_at?: string;
1358
+ updated_at?: string;
1359
+ }[];
1360
+ } | null;
1361
+ interaction: {
1362
+ mode?: string;
1363
+ provenance: string;
1364
+ cause?: string;
1365
+ } | null;
1366
+ activity: {
1367
+ state: string;
1368
+ partition?: string;
1369
+ partitions?: string[];
1370
+ cause?: string;
1371
+ } | null;
1372
+ created_by?: string;
1373
+ created_via?: string;
1374
+ created_at: string;
1375
+ updated_at: string;
1376
+ off_tera: boolean;
1377
+ has_outputs?: boolean;
1378
+ archived: boolean;
1379
+ history?: {
1380
+ disposition: string;
1381
+ locator?: string;
1382
+ trimmed_at: string;
1383
+ };
1384
+ terminal_at?: string;
1385
+ };
1386
+ /**
1387
+ *
1388
+ * Schema: sdk/workorder/schema/v1/guide.params.json
1389
+ */
1390
+ export type WorkOrderGuideParams = {
1391
+ /** Files to hand the RUNNING invocations this message reaches, each named by the HANDLE its upload minted — `tera artifacts upload <file> --description "…"` mints one in a single command, or over the API `POST /api/v1/artifacts/uploads/authorize` starts an upload and completing it mints the handle. ATTACHMENTS CARRY A HANDLE AND NEVER FILE CONTENT, at any size: there is no inline, base64 or small-file form of this field on any surface, so upload first and pass the reference. You do not describe the file here — its filename, declared content type, size and the uploader's description come from the upload itself, and they are what the notice announcing this message shows the run. Say what you want DONE with the files in `message`. What the run receives is metadata and an invitation to fetch: the platform writes nothing into its workspace, so there is no path for it to open and it reads the bytes back through its own `artifacts` verb. An attach CONSUMES the artifact into this Work Order's train: it leaves your staged account, the same handle keeps working, and it cannot be attached again. A `dry_run` consumes nothing. Nothing is consumed by a message that is refused, or that reaches nothing in flight. Every unattachable handle answers the same way — never uploaded, already attached, expired, or somebody else's are one refusal, because telling them apart would say whether another principal's handle exists; `tera artifacts list --staged` lists what is actually yours (`GET /api/v1/artifacts/staged` over the API). These files are weighed against the SAME 64 MiB per-Work-Order input allowance the Work Order was filed under, which is separate from the allowance a run uses to publish artifacts about its own work — so a long-running Work Order that was filed with attachments has less of it left. One message carries at most 64 files, a bound on the COUNT rather than the bytes: send more across more than one message. */
1392
+ attachments?: {
1393
+ /** The artifact handle the upload minted. Opaque: it carries no filename and no path, and nothing about it is constructible. */
1394
+ handle: string;
1395
+ }[];
1396
+ /** Resolve and report without enqueuing anything. The resolved set, each member's declared contract, and any refusals still come back — a refusal is decided from the capability's declaration, so it is evidence a dry run genuinely has. It CONSUMES NO ATTACHMENT: handles named alongside it are still staged and still yours afterwards. */
1397
+ dry_run?: boolean;
1398
+ /** The Work Order whose in-flight invocations to address. Required — this verb acts on a Work Order the caller is not running, so there is no dispatch context to take an id from. It resolves to the SET of in-flight invocations in that Work Order's dispatch tree; the whole set comes back on `resolved`, whether or not it was addressed. Only THIS Work Order's own invocations are addressed by default — a message addressed to a Work Order is never delivered to a descendant of it. If this Work Order is running nothing of its own the message is HELD and delivered when it next runs, whatever its descendants' hosts are doing. If it is running on a host this daemon holds no live link to, the message is HELD too, and delivered to that run when the host reconnects or to the next run, whichever comes first — never answered `accepted` against a run nobody can reach. The `held` block says so, and its `woke` member says the run was an interactive session at its inbox and a turn was started to read the message. OFF-TERA WORK (ADR-139 D9) is never held: deliver POSTS the message on that Work Order for its taker, present or future — ack `posted`, and the `posted` block names the event the taker's replies carry — and interrupt is refused, because there is no turn to interrupt. */
1399
+ id: string;
1400
+ /** Exclusive conversation sequence cursor for a dry-run history page; follow input_next_after. */
1401
+ input_after?: number;
1402
+ /** Interactive submission identity, scoped to this caller and conversation. Retry the same key with identical text and handles after a lost reply; omission creates a distinct message. */
1403
+ input_key?: string;
1404
+ /** Explicit resolution of an uncertain interactive attempt; requires correlated history or a stated operator replay decision. */
1405
+ input_recovery?: {
1406
+ attempt_id: string;
1407
+ evidence: string;
1408
+ input_id: string;
1409
+ state: "pending" | "incorporated" | "cancelled";
1410
+ };
1411
+ /** Address exactly this invocation instead of the default. Ids come from the `resolved` set of any call, including a dry run — so this narrows within a set already resolved and cannot redirect to something the resolution did not report. A named invocation is never held: one on an unreachable host answers `undetermined` and nothing is written. */
1412
+ invocation_id?: string;
1413
+ /** What to say to the running invocation. Content only — the platform composes the envelope around it (who sent it, attested, and when), so framing written here is content and not framing. Required unless `dry_run` is set or nothing is in flight. */
1414
+ message?: string;
1415
+ /** Which members of the resolved set to address. `addressee` is the default: the invocations of the Work Order named in `id`, and NEVER an invocation belonging to a descendant of it. `leaves` addresses the invocations actually doing the work anywhere beneath it — the old default, on request. A leaf is also addressable on its own by passing ITS Work Order id as `id`, which is what the refusal for an idle addressee names. A `leaves` call is never held: members on an unreachable host answer `undetermined` and nothing is written for them. */
1416
+ target?: "addressee" | "leaves";
1417
+ /** deliver queues the message for the invocation to take when it next reaches a point it can — its latency is bounded by the unit of work in flight, which each resolved member reports as `unit_of_work`. interrupt cancels that unit and presents the message as a fresh directive. Required: the two differ on what they cost, and the choice is the caller's. AGAINST AN INTERACTIVE RUN (ADR-129 D6): deliver to one parked at `paused:awaiting-interactive-turn` is held AND wakes it, so a turn starts to read it and `held.woke` is true; interrupt on one that is RUNNING discards the turn in flight and the run lands back at that inbox rather than failing or completing. interrupt is never held: against a run with nothing in flight it is refused — there is no unit of work to discard, and a held interrupt would arrive at a future turn it was never aimed at — and against a run on an unreachable host it answers `undetermined` and writes nothing. */
1418
+ verb: "deliver" | "interrupt";
1419
+ };
1420
+ /**
1421
+ * `work_order.guide` result (v1).
1422
+ *
1423
+ * What `work_order.guide` answers on success (ADR-143 D4), generated from `workorder.GuideResult`. A refusal is not this document: it is the invocation's `error` envelope.
1424
+ *
1425
+ * Schema: sdk/workorder/schema/v1/guide.result.json
1426
+ */
1427
+ export type WorkOrderGuideResult = {
1428
+ input_next_after?: number;
1429
+ inputs?: {
1430
+ message: {
1431
+ kind?: string;
1432
+ question_at?: string;
1433
+ input_id?: string;
1434
+ input_sequence?: number;
1435
+ caller?: string;
1436
+ /** Platform-attested provenance as recorded by the dispatching host; its actor schema belongs to that host. */
1437
+ actor?: unknown;
1438
+ issued_at?: string;
1439
+ text: string;
1440
+ attachments?: {
1441
+ handle: string;
1442
+ filename: string;
1443
+ mime_type: string;
1444
+ size: number;
1445
+ description?: string;
1446
+ }[];
1447
+ };
1448
+ state: string;
1449
+ attempt?: {
1450
+ id: string;
1451
+ invocation_id: string;
1452
+ dispatch_id: string;
1453
+ observations?: {
1454
+ observed_at: string;
1455
+ state: string;
1456
+ evidence: string;
1457
+ }[];
1458
+ };
1459
+ resolution?: string;
1460
+ }[];
1461
+ input_barrier?: {
1462
+ input_id: string;
1463
+ input_sequence: number;
1464
+ attempt_id?: string;
1465
+ state: string;
1466
+ reconciliation: string;
1467
+ behind: number;
1468
+ recovery: string;
1469
+ };
1470
+ id: string;
1471
+ verb: string;
1472
+ dry_run: boolean;
1473
+ selected: string;
1474
+ resolved: {
1475
+ invocation_id: string;
1476
+ capability: string;
1477
+ work_order_id?: string;
1478
+ started_at: string;
1479
+ leaf: boolean;
1480
+ addressed: boolean;
1481
+ accepts: string[] | null;
1482
+ unit_of_work?: string;
1483
+ deliver_latency?: string;
1484
+ ack?: {
1485
+ state: string;
1486
+ evidence: string;
1487
+ reason?: string;
1488
+ sequence?: number;
1489
+ };
1490
+ }[] | null;
1491
+ resolved_count: number;
1492
+ addressed_count: number;
1493
+ by_state?: {
1494
+ [key: string]: number;
1495
+ };
1496
+ undetermined?: {
1497
+ runner: string;
1498
+ reason: string;
1499
+ }[];
1500
+ ack?: {
1501
+ state: string;
1502
+ evidence: string;
1503
+ reason?: string;
1504
+ sequence?: number;
1505
+ };
1506
+ held?: {
1507
+ work_order_id: string;
1508
+ sequence: number;
1509
+ expires_at: string;
1510
+ woke?: boolean;
1511
+ };
1512
+ posted?: {
1513
+ work_order_id: string;
1514
+ event_id: number;
1515
+ taker?: string;
1516
+ attachments?: string[];
1517
+ };
1518
+ };
1519
+ /**
1520
+ *
1521
+ * Schema: sdk/workorder/schema/v1/history.params.json
1522
+ */
1523
+ export type WorkOrderHistoryParams = {
1524
+ /** Any member of the archived train. Required; never defaulted from a dispatch. */
1525
+ id: string;
1526
+ };
1527
+ /**
1528
+ * `work_order.history` result (v1).
1529
+ *
1530
+ * What `work_order.history` answers on success (ADR-143 D4), generated from `workorder.HistoryResult`. A refusal is not this document: it is the invocation's `error` envelope.
1531
+ *
1532
+ * Schema: sdk/workorder/schema/v1/history.result.json
1533
+ */
1534
+ export type WorkOrderHistoryResult = {
1535
+ id: string;
1536
+ locator: string;
1537
+ record: {
1538
+ header: {
1539
+ kind: string;
1540
+ record_version: number;
1541
+ root_id: string;
1542
+ type: string;
1543
+ partition?: string;
1544
+ terminal_at: string;
1545
+ };
1546
+ members: {
1547
+ id: string;
1548
+ worker?: string;
1549
+ type: string;
1550
+ parent_id?: string;
1551
+ cohort_id?: string;
1552
+ state: string;
1553
+ /** The parent step this member was filed for, as archived. */
1554
+ parent_step?: unknown;
1555
+ /** The pause reason the member last held, as archived. */
1556
+ pause_reason?: unknown;
1557
+ /** The block reason the member last held, as archived. */
1558
+ block_reason?: unknown;
1559
+ /** The member's retry policy and count, as archived. */
1560
+ retry?: unknown;
1561
+ /** The member's spec — title, body, inputs and the rest — as archived. */
1562
+ spec?: unknown;
1563
+ /** The member's outputs, as archived. */
1564
+ outputs?: unknown;
1565
+ /** The member's failure, as archived. */
1566
+ failure?: unknown;
1567
+ /** The member's salvage record, as archived. */
1568
+ salvage?: unknown;
1569
+ /** The member's workspace record, as archived. */
1570
+ workspace?: unknown;
1571
+ /** The member's session-loss record, as archived. */
1572
+ session_loss?: unknown;
1573
+ /** The member's activity-partition pin, as archived. */
1574
+ activity_partition?: unknown;
1575
+ /** The member's declared artefacts, as archived. */
1576
+ artefacts?: unknown;
1577
+ assignee?: string;
1578
+ created_by?: string;
1579
+ created_at: string;
1580
+ updated_at?: string;
1581
+ superseded_by?: string;
1582
+ terminal_at?: string;
1583
+ config_digest?: string;
1584
+ events?: {
1585
+ id: number;
1586
+ timestamp: string;
1587
+ kind: string;
1588
+ from_state?: string;
1589
+ to_state?: string;
1590
+ /** Who caused the event, as archived. */
1591
+ actor?: unknown;
1592
+ /** The event's payload, as archived. */
1593
+ payload?: unknown;
1594
+ reason?: string;
1595
+ }[];
1596
+ rows?: {
1597
+ kind: string;
1598
+ /** The row's domain shape, which its kind names. */
1599
+ shape: unknown;
1600
+ }[];
1601
+ artifacts?: {
1602
+ handle: string;
1603
+ filename: string;
1604
+ media_type: string;
1605
+ size: number;
1606
+ content_digest: string;
1607
+ }[];
1608
+ observations?: {
1609
+ id: string;
1610
+ digest: string;
1611
+ }[];
1612
+ correspondence?: {
1613
+ id: string;
1614
+ digest: string;
1615
+ }[];
1616
+ }[] | null;
1617
+ digest: string;
1618
+ };
1619
+ withheld?: {
1620
+ partition: string;
1621
+ members: number;
1622
+ }[];
1623
+ };
1624
+ /**
1625
+ *
1626
+ * Schema: sdk/workorder/schema/v1/history_unblock.params.json
1627
+ */
1628
+ export type WorkOrderHistoryUnblockParams = {
1629
+ /** The root of the blocked train. Required; never defaulted from a dispatch. */
1630
+ id: string;
1631
+ };
1632
+ /**
1633
+ * `work_order.history_unblock` result (v1).
1634
+ *
1635
+ * What `work_order.history_unblock` answers on success (ADR-143 D4), generated from `workorder.HistoryUnblockResult`. A refusal is not this document: it is the invocation's `error` envelope.
1636
+ *
1637
+ * Schema: sdk/workorder/schema/v1/history_unblock.result.json
1638
+ */
1639
+ export type WorkOrderHistoryUnblockResult = {
1640
+ id: string;
1641
+ table: string;
1642
+ effect: string;
1643
+ };
1644
+ /**
1645
+ *
1646
+ * Schema: sdk/workorder/schema/v1/human.ask.params.json
1647
+ */
1648
+ export type WorkOrderHumanAskParams = {
1649
+ /** Structured evidence the operator needs to decide, carried alongside the question everywhere it is surfaced. Opaque — attach whatever the answer turns on. */
1650
+ context?: unknown;
1651
+ /** Optional, and omitting it is the ordinary park. Record this ONLY when you stopped because you could not decide the thing you are asking about and are handing it up — not when you are asking something that was always going to a person. It is what makes "the human seat consulted only where no ancestor could decide" a measurement rather than a reconstruction, so a record you did not mean makes that number wrong. Accepted on reason "awaiting-input" only. */
1652
+ could_not_decide?: {
1653
+ /** Optional. What you tried and why the choice is not yours to make. The question beside this already says what is being asked, so do not repeat it here. */
1654
+ detail?: string;
1655
+ /** The typed classification. Today there is one: "undecidable-here" — this run could not take the decision at its own level of the tree. */
1656
+ kind: string;
1657
+ };
1658
+ /** Work Order to park. Optional for the dispatched root recipe — omit it and the id is taken from the dispatch context. */
1659
+ id?: string;
1660
+ /** What to ask the operator, in prose. This is the text the operator answers against: it comes back on work_order.get as `question.text`, inline per node on work_order.tree, and on `tera workorder show` / `answer`. Ask something answerable without the agent's context — the reader has the Work Order and this sentence. */
1661
+ question: string;
1662
+ };
1663
+ /**
1664
+ * `human.ask` result (v1).
1665
+ *
1666
+ * What `human.ask` answers on success (ADR-143 D4), generated from `workorder.PauseResult`. A refusal is not this document: it is the invocation's `error` envelope.
1667
+ *
1668
+ * Schema: sdk/workorder/schema/v1/human.ask.result.json
1669
+ */
1670
+ export type WorkOrderHumanAskResult = {
1671
+ id: string;
1672
+ state: string;
1673
+ resumed: boolean;
1674
+ /** The resume payload, in whatever shape its answerer sent. */
1675
+ payload?: unknown;
1676
+ };
1677
+ /**
1678
+ *
1679
+ * Schema: sdk/workorder/schema/v1/interrupt.params.json
1680
+ */
1681
+ export type WorkOrderInterruptParams = {
1682
+ /** The Work Order whose running dispatch to end. Required — this verb acts on a Work Order the caller is not running. */
1683
+ id: string;
1684
+ /** Why the run is being stopped. Required: it is handed to the running session as the stop's sentence and recorded on the park. */
1685
+ reason: string;
1686
+ };
1687
+ /**
1688
+ * `work_order.interrupt` result (v1).
1689
+ *
1690
+ * What `work_order.interrupt` answers on success (ADR-143 D4), generated from `workorder.InterruptResult`. A refusal is not this document: it is the invocation's `error` envelope.
1691
+ *
1692
+ * Schema: sdk/workorder/schema/v1/interrupt.result.json
1693
+ */
1694
+ export type WorkOrderInterruptResult = {
1695
+ id: string;
1696
+ state: string;
1697
+ parks_at: string;
1698
+ dispatches_stopped: number;
1699
+ resume: string;
1700
+ };
1701
+ /**
1702
+ *
1703
+ * Schema: sdk/workorder/schema/v1/list.params.json
1704
+ */
1705
+ export type WorkOrderListParams = {
1706
+ /** Select the Work Orders in this cohort — the undertaking a Work Order belongs to, read off any row's `cohort_id` (a Work Order filed alone is a cohort of one, whose id is its own). A UUID; anything else is refused rather than matched. Unlike `tag` this reads an indexed column on both store backends, so it is the filter to pass alone for 'everything in this undertaking', in every state, terminal included. Composes with the other filters as an AND. */
1707
+ cohort?: string;
1708
+ /** Select Work Orders filed with exactly this resolved capacity key. Matched verbatim against the key on the row, which is already materialized against that Work Order's own inputs — pass `prefilter/<subject id>`, not the type's `${inputs...}` template. This is how a caller asks 'is another Work Order of this tier already working my subject?' without reading inputs back out of every row. */
1709
+ concurrency_key?: string;
1710
+ /** Include archived Work Orders: those whose train left the hot window and whose history was trimmed, leaving a stub that keeps its id, type, worker, final state, parent and cohort. Absent or false answers about hot work only. An archived row carries `archived: true`; `tag`, `concurrency_key` and `subject` cannot match one, because the trim took what they read. */
1711
+ include_archived?: boolean;
1712
+ /** Maximum rows to return; 0 or absent means no cap. */
1713
+ limit?: number;
1714
+ /** Select the direct children of this Work Order — one generation. For a whole train, call work_order.tree. */
1715
+ parent_id?: string;
1716
+ /** Select Work Orders in exactly this state, e.g. `paused:awaiting-input` to find work that is waiting on an operator. Use `states` to match more than one. */
1717
+ state?: string;
1718
+ /** Select Work Orders in any of these states. Supersedes `state` when both are given. */
1719
+ states?: string[];
1720
+ /** Select Work Orders about this world subject, written bare as `<kind>/<id>` (`flake/TestShimServerSpawnsWithCredential`, `device/porch-temp`). This is the 'is anything already about this?' question a harness asks before it files, and it is answered from the subject index, so the answer spans every state INCLUDING terminal ones — work that is filed and blocked on deps, and work that was tried and failed, are two of the three useful answers. Reading is authorized per subject kind: a kind this deployment has not declared, or has not granted you, is refused rather than filtered to an empty list. */
1721
+ subject?: string;
1722
+ /** Select Work Orders carrying exactly this tag — `repo:kottera/kottera` to see everything in flight for one repository. Matched WHOLE, as an opaque string: there is no wildcard, no prefix match and no namespace, so `repo:*` selects Work Orders whose tag is literally `repo:*`. One tag per call, not a set. Tags ride the spec rather than a column, so this filter is unindexed on both store backends — pair it with `type`, `worker` or `states` when the table is large. */
1723
+ tag?: string;
1724
+ /** Select Work Orders of this type. A bare leaf name (`code-implementation`) is resolved against the registry, so the namespaced form is not required. */
1725
+ type?: string;
1726
+ /** Select Work Orders assigned to this worker. */
1727
+ worker?: string;
1728
+ /** Select Work Orders holding a workspace on this runner: their recorded workspace affinity (`recovery.workspace` on work_order.get) names it and has not been retired. This is what to ask before moving or wiping a host's data directory, because a PARKED Work Order holds its workspace as surely as a running one and a resume after the move would get a fresh, empty one. Terminal Work Orders whose bytes were retained match too, since a retry resumes there; pass `states` for live work only. Name the daemon's own host by its reserved runner name. Matched whole; unindexed on both store backends. */
1729
+ workspace_host?: string;
1730
+ };
1731
+ /**
1732
+ * `work_order.list` result (v1).
1733
+ *
1734
+ * What `work_order.list` answers on success (ADR-143 D4), generated from `workorder.ListResult`. A refusal is not this document: it is the invocation's `error` envelope.
1735
+ *
1736
+ * Schema: sdk/workorder/schema/v1/list.result.json
1737
+ */
1738
+ export type WorkOrderListResult = {
1739
+ work_orders: {
1740
+ context_compactions?: {
1741
+ state: string;
1742
+ count: number | null;
1743
+ latest_at?: string;
1744
+ };
1745
+ id: string;
1746
+ parent_id?: string;
1747
+ worker: string;
1748
+ type: string;
1749
+ state: string;
1750
+ title?: string;
1751
+ concurrency_key: string;
1752
+ cohort_id: string;
1753
+ tags: string[] | null;
1754
+ priority: number;
1755
+ validity?: {
1756
+ valid: boolean;
1757
+ reason?: string;
1758
+ field?: string;
1759
+ };
1760
+ block_reason?: {
1761
+ kind: string;
1762
+ detail?: unknown;
1763
+ };
1764
+ deferred_until?: string;
1765
+ created_at: string;
1766
+ updated_at: string;
1767
+ off_tera: boolean;
1768
+ archived: boolean;
1769
+ take?: {
1770
+ principal: string;
1771
+ taken_at: string;
1772
+ last_progress_at?: string;
1773
+ describe?: string;
1774
+ caller_is_person?: boolean;
1775
+ outcome_provenance?: string;
1776
+ };
1777
+ }[] | null;
1778
+ };
1779
+ /**
1780
+ *
1781
+ * Schema: sdk/workorder/schema/v1/list_off_tera.params.json
1782
+ */
1783
+ export type WorkOrderListOffTeraParams = Record<string, never>;
1784
+ /**
1785
+ * `work_order.list_off_tera` result (v1).
1786
+ *
1787
+ * What `work_order.list_off_tera` answers on success (ADR-143 D4), generated from `workorder.ListOffTeraResult`. A refusal is not this document: it is the invocation's `error` envelope.
1788
+ *
1789
+ * Schema: sdk/workorder/schema/v1/list_off_tera.result.json
1790
+ */
1791
+ export type WorkOrderListOffTeraResult = {
1792
+ posted: {
1793
+ id: string;
1794
+ type: string;
1795
+ state: string;
1796
+ title?: string;
1797
+ requirements: string;
1798
+ /** The Work Order's inputs, verbatim, in the shape its type's input_schema declares. */
1799
+ inputs?: unknown;
1800
+ created_at: string;
1801
+ age_seconds: number;
1802
+ take?: {
1803
+ principal: string;
1804
+ taken_at: string;
1805
+ last_progress_at?: string;
1806
+ describe?: string;
1807
+ caller_is_person?: boolean;
1808
+ outcome_provenance?: string;
1809
+ };
1810
+ take_age_seconds?: number;
1811
+ /** On a held entry: the JSON Schema this Work Order was pinned to at its first take, which submit_result grades the record against. Absent on posted and taken entries, and when the type declares none. */
1812
+ output_schema?: unknown;
1813
+ }[] | null;
1814
+ held: {
1815
+ id: string;
1816
+ type: string;
1817
+ state: string;
1818
+ title?: string;
1819
+ requirements: string;
1820
+ /** The Work Order's inputs, verbatim, in the shape its type's input_schema declares. */
1821
+ inputs?: unknown;
1822
+ created_at: string;
1823
+ age_seconds: number;
1824
+ take?: {
1825
+ principal: string;
1826
+ taken_at: string;
1827
+ last_progress_at?: string;
1828
+ describe?: string;
1829
+ caller_is_person?: boolean;
1830
+ outcome_provenance?: string;
1831
+ };
1832
+ take_age_seconds?: number;
1833
+ /** On a held entry: the JSON Schema this Work Order was pinned to at its first take, which submit_result grades the record against. Absent on posted and taken entries, and when the type declares none. */
1834
+ output_schema?: unknown;
1835
+ }[] | null;
1836
+ taken?: {
1837
+ id: string;
1838
+ type: string;
1839
+ state: string;
1840
+ title?: string;
1841
+ requirements: string;
1842
+ /** The Work Order's inputs, verbatim, in the shape its type's input_schema declares. */
1843
+ inputs?: unknown;
1844
+ created_at: string;
1845
+ age_seconds: number;
1846
+ take?: {
1847
+ principal: string;
1848
+ taken_at: string;
1849
+ last_progress_at?: string;
1850
+ describe?: string;
1851
+ caller_is_person?: boolean;
1852
+ outcome_provenance?: string;
1853
+ };
1854
+ take_age_seconds?: number;
1855
+ /** On a held entry: the JSON Schema this Work Order was pinned to at its first take, which submit_result grades the record against. Absent on posted and taken entries, and when the type declares none. */
1856
+ output_schema?: unknown;
1857
+ }[];
1858
+ taken_visible: boolean;
1859
+ };
1860
+ /**
1861
+ *
1862
+ * Schema: sdk/workorder/schema/v1/pause.params.json
1863
+ */
1864
+ export type WorkOrderPauseParams = {
1865
+ /** Opaque human-facing JSON, surfaced beside the Work Order and passed to a `cel` predicate as `context`. REQUIRED under reason "awaiting-review": that park's doors are a person, you have no outputs yet, and this is the only thing the reviewer gets — pass what they should open, e.g. {"artifact_url": "..."} or {"summary": "..."}. */
1866
+ context?: unknown;
1867
+ /** Optional, and omitting it is the ordinary park. Record this ONLY when you stopped because you could not decide the thing you are asking about and are handing it up — not when you are asking something that was always going to a person. It is what makes "the human seat consulted only where no ancestor could decide" a measurement rather than a reconstruction, so a record you did not mean makes that number wrong. Accepted on reason "awaiting-input" only. */
1868
+ could_not_decide?: {
1869
+ /** Optional. What you tried and why the choice is not yours to make. The question beside this already says what is being asked, so do not repeat it here. */
1870
+ detail?: string;
1871
+ /** The typed classification. Today there is one: "undecidable-here" — this run could not take the decision at its own level of the tree. */
1872
+ kind: string;
1873
+ };
1874
+ id?: string;
1875
+ /** Optional. What would end this wait. Required under reason "awaiting-event", whose door evaluates it; refused under "awaiting-review", whose doors are a reviewer's approve / reject / rework and evaluate nothing. */
1876
+ predicate?: {
1877
+ kind: "literal-match" | "cel" | "any-child-completes" | "all-children-complete" | "any-child-transitions" | "these-work-orders" | "these-work-orders-transitions";
1878
+ spec?: unknown;
1879
+ };
1880
+ reason: "awaiting-input" | "awaiting-event" | "awaiting-review" | "awaiting-children" | "awaiting-approval" | "awaiting-interactive-turn";
1881
+ /** Optional. How long this wait is willing to wait, in Go duration syntax ("30m", "2h"). When it elapses the run is woken and told that is why — it is not failed, not completed, and the wait is not re-armed; declare a fresh one if you still want notifying. Omit for an unbounded wait, which is the default. Not accepted on reason "awaiting-review". */
1882
+ timeout?: string;
1883
+ };
1884
+ /**
1885
+ * `work_order.pause` result (v1).
1886
+ *
1887
+ * What `work_order.pause` answers on success (ADR-143 D4), generated from `workorder.PauseResult`. A refusal is not this document: it is the invocation's `error` envelope.
1888
+ *
1889
+ * Schema: sdk/workorder/schema/v1/pause.result.json
1890
+ */
1891
+ export type WorkOrderPauseResult = {
1892
+ id: string;
1893
+ state: string;
1894
+ resumed: boolean;
1895
+ /** The resume payload, in whatever shape its answerer sent. */
1896
+ payload?: unknown;
1897
+ };
1898
+ /**
1899
+ *
1900
+ * Schema: sdk/workorder/schema/v1/prioritize.params.json
1901
+ */
1902
+ export type WorkOrderPrioritizeParams = {
1903
+ /** The Work Order whose priority changes. Required; never defaulted from a dispatch. */
1904
+ id: string;
1905
+ /** The new priority. Higher is admitted first; 0 is the default every Work Order is filed with. */
1906
+ priority: number;
1907
+ /** Why this Work Order's place in the queue changed. Required, and recorded beside the old and the new value. */
1908
+ reason: string;
1909
+ };
1910
+ /**
1911
+ * `work_order.prioritize` result (v1).
1912
+ *
1913
+ * What `work_order.prioritize` answers on success (ADR-143 D4), generated from `workorder.PrioritizeResult`. A refusal is not this document: it is the invocation's `error` envelope.
1914
+ *
1915
+ * Schema: sdk/workorder/schema/v1/prioritize.result.json
1916
+ */
1917
+ export type WorkOrderPrioritizeResult = {
1918
+ id: string;
1919
+ state: string;
1920
+ priority: number;
1921
+ previous_priority: number;
1922
+ effect: string;
1923
+ };
1924
+ /**
1925
+ *
1926
+ * Schema: sdk/workorder/schema/v1/progress.params.json
1927
+ */
1928
+ export type WorkOrderProgressParams = {
1929
+ /** The off-tera Work Order you hold. Required. */
1930
+ id: string;
1931
+ /** How the work is going, in your own words. Recorded on the Work Order's event log as off_tera.progress. At most 4096 bytes. */
1932
+ message: string;
1933
+ /** The id of the last event you have processed on this Work Order. The response carries the events addressed to you after it (a repost, a cancel, a wake, an answer, posted guidance), at most 32 with `more` set when there were more, plus `newest_event_id`. The server keeps no cursor: omit it, or pass 0, for everything addressed so far. */
1934
+ seen_through?: number;
1935
+ };
1936
+ /**
1937
+ * `work_order.progress` result (v1).
1938
+ *
1939
+ * What `work_order.progress` answers on success (ADR-143 D4), generated from `workorder.ProgressResult`. A refusal is not this document: it is the invocation's `error` envelope.
1940
+ *
1941
+ * Schema: sdk/workorder/schema/v1/progress.result.json
1942
+ */
1943
+ export type WorkOrderProgressResult = {
1944
+ id: string;
1945
+ state: string;
1946
+ take: {
1947
+ principal: string;
1948
+ taken_at: string;
1949
+ last_progress_at?: string;
1950
+ describe?: string;
1951
+ caller_is_person?: boolean;
1952
+ outcome_provenance?: string;
1953
+ } | null;
1954
+ addressed_events: {
1955
+ id: number;
1956
+ kind: string;
1957
+ timestamp: string;
1958
+ to_state?: string;
1959
+ reason?: string;
1960
+ /** Who caused the event, as the event log recorded it. The shape written is an EventActor; a row written before a field existed lacks that key. */
1961
+ actor?: unknown;
1962
+ /** The event's payload, whose shape its kind decides, as the event log recorded it. */
1963
+ payload?: unknown;
1964
+ /** True when the event concerns the take this reply is about — your current take; on a refusal, your take that ended; on a repost, the take it ended. False is an earlier take's history, not an instruction to you. */
1965
+ your_take: boolean;
1966
+ }[] | null;
1967
+ more: boolean;
1968
+ newest_event_id: number;
1969
+ warnings?: string[];
1970
+ };
1971
+ /**
1972
+ *
1973
+ * Schema: sdk/workorder/schema/v1/recall.params.json
1974
+ */
1975
+ export type WorkOrderRecallParams = {
1976
+ /** The Work Orders to recall, as bare ids. Recalled ATOMICALLY: all of them or none. Each must be released and never dispatched — `scheduled` or `blocked:*`, with no attempt behind it. Naming one twice is the same act said twice and is absorbed. */
1977
+ ids: string[];
1978
+ /** Why these are being recalled. Required, and recorded on every recall transition: a parent waiting on a child, or a reviewer who released it, reads this. */
1979
+ reason: string;
1980
+ };
1981
+ /**
1982
+ * `work_order.recall` result (v1).
1983
+ *
1984
+ * What `work_order.recall` answers on success (ADR-143 D4), generated from `workorder.RecallResult`. A refusal is not this document: it is the invocation's `error` envelope.
1985
+ *
1986
+ * Schema: sdk/workorder/schema/v1/recall.result.json
1987
+ */
1988
+ export type WorkOrderRecallResult = {
1989
+ recalled: {
1990
+ id: string;
1991
+ state: string;
1992
+ from: string;
1993
+ type: string;
1994
+ title?: string;
1995
+ }[] | null;
1996
+ count: number;
1997
+ };
1998
+ /**
1999
+ *
2000
+ * Schema: sdk/workorder/schema/v1/refile.params.json
2001
+ */
2002
+ export type WorkOrderRefileParams = {
2003
+ /** Which input key carries the prose brief, and therefore where the "what changed" block is seeded. Defaults to `task`, the key every direct type in the system-vault seed uses for the instruction a session reads. State it for a type that spells it differently. A key holding no string is refused rather than skipped — the block has to land where the dispatched session reads it. */
2004
+ brief_input?: string;
2005
+ /** Short note recorded on the `supersedes` edge. */
2006
+ note?: string;
2007
+ /** The Work Order this one replaces. Must be in `failed:awaiting-ack`: that is the one state with a retry door open, and closing that door is what a supersession is for. A still-running Work Order is refused with force-fail named as the door; a terminal one is refused because there is nothing to close. */
2008
+ predecessor: string;
2009
+ /** Override the copied title. Omit to keep the predecessor's, which is usually right: it is the same work, and a successor whose title no longer matches is harder to find beside it. */
2010
+ title?: string;
2011
+ /** Override the copied worker. State it when the predecessor died for a reason attached to its worker — a depleted tier, a host that went quiet. */
2012
+ worker?: string;
2013
+ };
2014
+ /**
2015
+ * `work_order.refile` result (v1).
2016
+ *
2017
+ * What `work_order.refile` answers on success (ADR-143 D4), generated from `workorder.RefileResult`. A refusal is not this document: it is the invocation's `error` envelope.
2018
+ *
2019
+ * Schema: sdk/workorder/schema/v1/refile.result.json
2020
+ */
2021
+ export type WorkOrderRefileResult = {
2022
+ id: string;
2023
+ state: string;
2024
+ type: string;
2025
+ worker: string;
2026
+ title?: string;
2027
+ predecessor: string;
2028
+ brief_input: string;
2029
+ what_changed_filled: boolean;
2030
+ };
2031
+ /**
2032
+ *
2033
+ * Schema: sdk/workorder/schema/v1/relate.params.json
2034
+ */
2035
+ export type WorkOrderRelateParams = {
2036
+ /** `add` asserts the edge, `remove` withdraws it. Required, with no default: the two are not the same act, and a default would make the choice by absence. */
2037
+ action: "add" | "remove";
2038
+ /** The Work Order that CARRIES the edge — the one that supersedes, that is a duplicate, that is about something. Required: this verb is stated about a relationship between two Work Orders by someone who is neither, so there is no dispatch context to take an id from. */
2039
+ id: string;
2040
+ /** Optional free text recorded on the edge, at most 256 bytes. Ignored on `remove`. Re-asserting an existing triple does NOT update the note — that is what makes re-assertion idempotent; change one by removing the edge and adding it again. */
2041
+ note?: string;
2042
+ /** What this Work Order claims about the target. about (this Work Order's work is examining or acting on that one), duplicate_of (this should not exist; that one is the real work), related (see-also, carrying no lifecycle implication), supersedes (this replaces that one; that one should not be retried). Deliberately absent: `retry_of` (the retry machinery already records attempts against a single Work Order) and anything blocking-shaped (that is `depends_on`, which is causal and gates dispatch). Required on `remove` too — the triple (id, relation, target_id) is the edge's identity, and there are no edge ids. */
2043
+ relation: "about" | "duplicate_of" | "related" | "supersedes";
2044
+ /** The Work Order the claim is about, as a bare id. Must exist. Whether the caller also needs REACH on it follows what the relation asserts. `supersedes` and `duplicate_of` are evaluative — because the inverse direction is the primary read, they change what the TARGET's own work_order.get says about how to treat it — so those require reach on the target, as every relation does on `id`. `about` and `related` assert nothing about the target's status and require none, which is what lets a Work Order record that it is examining another worker's work. */
2045
+ target_id: string;
2046
+ };
2047
+ /**
2048
+ * `work_order.relate` result (v1).
2049
+ *
2050
+ * What `work_order.relate` answers on success (ADR-143 D4), generated from `workorder.RelateResult`. A refusal is not this document: it is the invocation's `error` envelope.
2051
+ *
2052
+ * Schema: sdk/workorder/schema/v1/relate.result.json
2053
+ */
2054
+ export type WorkOrderRelateResult = {
2055
+ id: string;
2056
+ action: string;
2057
+ relation: string;
2058
+ target_id: string;
2059
+ note?: string;
2060
+ applied: boolean;
2061
+ outcome: string;
2062
+ relations: {
2063
+ relation: string;
2064
+ work_order_id: string;
2065
+ note?: string;
2066
+ created_at: string;
2067
+ created_by?: string;
2068
+ }[] | null;
2069
+ related_by: {
2070
+ relation: string;
2071
+ work_order_id: string;
2072
+ note?: string;
2073
+ created_at: string;
2074
+ created_by?: string;
2075
+ }[] | null;
2076
+ relation_scope?: {
2077
+ withheld_relations?: number;
2078
+ withheld_related_by?: number;
2079
+ note: string;
2080
+ };
2081
+ };
2082
+ /**
2083
+ *
2084
+ * Schema: sdk/workorder/schema/v1/release.params.json
2085
+ */
2086
+ export type WorkOrderReleaseParams = {
2087
+ /** The Work Orders to release, as bare ids. Released ATOMICALLY: all of them or none. Each must be in `draft` — a named id that is not is refused by name, rather than skipped, because you wrote it down. Naming one twice is the same act said twice and is absorbed, not doubled. */
2088
+ ids: string[];
2089
+ /** Short audit note recorded on every transition event in the set. One note for the whole set, because the set is one act — "the breakdown was approved in review" is the fact worth recording. */
2090
+ reason?: string;
2091
+ /** Release every DRAFT beneath each named Work Order as well, at any depth. This is the common spelling for a breakdown, and it is sugar over the same atomic set rather than a second path. It SELECTS drafts: a non-draft node is walked through and not released, which is what lets you name the run that derived a wave — that run is `active`, not a draft. A named root with no draft anywhere beneath it is refused rather than reported as a release of nothing. */
2092
+ subtree?: boolean;
2093
+ };
2094
+ /**
2095
+ * `work_order.release` result (v1).
2096
+ *
2097
+ * What `work_order.release` answers on success (ADR-143 D4), generated from `workorder.ReleaseResult`. A refusal is not this document: it is the invocation's `error` envelope.
2098
+ *
2099
+ * Schema: sdk/workorder/schema/v1/release.result.json
2100
+ */
2101
+ export type WorkOrderReleaseResult = {
2102
+ released: {
2103
+ id: string;
2104
+ state: string;
2105
+ type: string;
2106
+ title?: string;
2107
+ delegation?: {
2108
+ subject: string;
2109
+ outstanding: string[] | null;
2110
+ unavailable?: {
2111
+ upstream: string;
2112
+ gap: string;
2113
+ }[];
2114
+ withdrawn?: {
2115
+ upstream: string;
2116
+ gap: string;
2117
+ }[];
2118
+ door?: string;
2119
+ walled?: string[];
2120
+ fails_at?: string;
2121
+ checked_at?: string;
2122
+ dispatch_timeout_seconds?: number;
2123
+ failures?: {
2124
+ connection: string;
2125
+ upstream?: string;
2126
+ holder: {
2127
+ kind: string;
2128
+ name: string;
2129
+ };
2130
+ reason: string;
2131
+ act_by: string;
2132
+ repair: string;
2133
+ evidence?: string;
2134
+ }[];
2135
+ };
2136
+ }[] | null;
2137
+ count: number;
2138
+ subtree?: boolean;
2139
+ };
2140
+ /**
2141
+ *
2142
+ * Schema: sdk/workorder/schema/v1/repin.params.json
2143
+ */
2144
+ export type WorkOrderRepinParams = {
2145
+ /** Report the ADR-105 D8 classification and WRITE NOTHING. The manifest says what a resume under the candidate would do — where it would land, which steps would be passed over with nothing recorded, which recorded results would be re-run, and which would be orphaned — with the verdict derived from it. Unlike the `repin` MODE on the re-entry verbs, this is meaningful on its own: this verb IS the re-pin, so there is nothing else to suppress. */
2146
+ dry_run?: boolean;
2147
+ /** The ONE Work Order to re-pin. There is no `--type`, `--state` or tag selector, by ruling: *never automatic* is this act's defining property, and a loop over ids with one reason keeps every generation individually attributed. */
2148
+ id: string;
2149
+ /** Cross EVERY refusal the re-pin gate raises, including a capability or operation switch, by ending the contract rather than preserving it: every held step binding is settled `superseded` and a FRESH CHAIN GENERATION is opened for the resume, which then selects against the new pin from nothing (ADR-130 D5's "a deliberate new chain gets an explicit new generation"). It is the refusal's own suggested repair — abandon this Work Order and create a new one — WITHOUT losing the Work Order, its train, its workspace, its artifacts or its history. What it does lose is what the run was doing: a `started` binding it supersedes is a dispatch that was running. It does NOT cross a generation/digest inconsistency, which ADR-105 D7 classifies as corruption rather than as a configuration change. A binding at `admitted` or `dispatch_pending` is refused rather than superseded — those states have no edge that settles; let reconciliation republish and cross again. Authorized against `api/v1/workorders/repin/new-chain` IN ADDITION to `api/v1/workorders/repin`. Pass `dry_run` first: the manifest's `would_open_new_chain` names every binding that would be superseded and how far each had got. */
2150
+ new_chain?: boolean;
2151
+ /** Why. REQUIRED: it is stored on the new pin generation, and an empty reason is what a first-dispatch pin carries — it means "nobody chose this". */
2152
+ reason: string;
2153
+ /** Cross ONE refusal: a select site where this Work Order's live step binding is running a candidate the new pin no longer offers (ADR-130 D5, ratified crossable 2026-09-20). The binding row is RETAINED at the same chain generation and the resume RE-SELECTS from the new candidate set, running the candidate loop against live capacity exactly as a first admission would. It does NOT preserve the candidate the run is on — that candidate is gone, which is why the refusal exists. It lifts nothing else: a capability or operation switch at a fixed site has no candidate to re-select, and a withdrawn `yields_turn` offer is frozen for the life of a pinned conversation (ADR-129 D9). Over a site whose candidate IS still offered, or a fixed site, it is a no-op and says so in the manifest rather than refusing. Authorized against `api/v1/workorders/repin/reselect` IN ADDITION to `api/v1/workorders/repin`. Pass `dry_run` first: the manifest's `would_reselect` names the site, the candidate being given up and the set the resume will choose from. */
2154
+ reselect?: boolean;
2155
+ };
2156
+ /**
2157
+ * `work_order.repin` result (v1).
2158
+ *
2159
+ * What `work_order.repin` answers on success (ADR-143 D4), generated from `workorder.RepinResult`. A refusal is not this document: it is the invocation's `error` envelope.
2160
+ *
2161
+ * Schema: sdk/workorder/schema/v1/repin.result.json
2162
+ */
2163
+ export type WorkOrderRepinResult = {
2164
+ id: string;
2165
+ state: string;
2166
+ applied: boolean;
2167
+ repin: {
2168
+ minted: boolean;
2169
+ dry_run: boolean;
2170
+ generation?: number;
2171
+ config_digest?: string;
2172
+ previous_state?: string;
2173
+ previous_generation?: number;
2174
+ classification: {
2175
+ verdict: string;
2176
+ caveat: string;
2177
+ cause?: string;
2178
+ manifest?: {
2179
+ parked_step: string;
2180
+ lands: boolean;
2181
+ landing?: number;
2182
+ absent?: {
2183
+ name: string;
2184
+ index: number;
2185
+ cause: string;
2186
+ }[];
2187
+ rerun?: string[];
2188
+ orphaned?: string[];
2189
+ digests_agree: boolean;
2190
+ sessions?: {
2191
+ site: string;
2192
+ logical_site_id?: string;
2193
+ structural_path?: string;
2194
+ chain_generation: number;
2195
+ outcome: string;
2196
+ reason: string;
2197
+ }[];
2198
+ };
2199
+ warnings?: {
2200
+ kind: string;
2201
+ steps?: string[];
2202
+ }[];
2203
+ };
2204
+ crossings?: {
2205
+ would_reselect?: {
2206
+ site: string;
2207
+ logical_site_id?: string;
2208
+ structural_path?: string;
2209
+ from_candidate: string;
2210
+ offered?: string[];
2211
+ }[];
2212
+ would_open_new_chain?: {
2213
+ superseded: {
2214
+ site: string;
2215
+ logical_site_id?: string;
2216
+ structural_path?: string;
2217
+ chain_generation: number;
2218
+ state: string;
2219
+ candidate?: string;
2220
+ }[] | null;
2221
+ generation?: number;
2222
+ };
2223
+ reselected?: {
2224
+ site: string;
2225
+ logical_site_id?: string;
2226
+ structural_path?: string;
2227
+ from_candidate: string;
2228
+ offered?: string[];
2229
+ }[];
2230
+ opened_new_chain?: {
2231
+ superseded: {
2232
+ site: string;
2233
+ logical_site_id?: string;
2234
+ structural_path?: string;
2235
+ chain_generation: number;
2236
+ state: string;
2237
+ candidate?: string;
2238
+ }[] | null;
2239
+ generation?: number;
2240
+ };
2241
+ };
2242
+ };
2243
+ };
2244
+ /**
2245
+ *
2246
+ * Schema: sdk/workorder/schema/v1/repost.params.json
2247
+ */
2248
+ export type WorkOrderRepostParams = {
2249
+ /** The taken off-tera Work Order to post again. Required. */
2250
+ id: string;
2251
+ /** Why it is posted again. Recorded on off_tera.reposted, and named to the previous taker whenever it is refused afterwards. At most 4096 bytes. */
2252
+ reason: string;
2253
+ /** The id of the last event you have processed on this Work Order. The response carries the events addressed to you after it (a repost, a cancel, a wake, an answer, posted guidance), at most 32 with `more` set when there were more, plus `newest_event_id`. The server keeps no cursor: omit it, or pass 0, for everything addressed so far. */
2254
+ seen_through?: number;
2255
+ };
2256
+ /**
2257
+ * `work_order.repost` result (v1).
2258
+ *
2259
+ * What `work_order.repost` answers on success (ADR-143 D4), generated from `workorder.RepostResult`. A refusal is not this document: it is the invocation's `error` envelope.
2260
+ *
2261
+ * Schema: sdk/workorder/schema/v1/repost.result.json
2262
+ */
2263
+ export type WorkOrderRepostResult = {
2264
+ id: string;
2265
+ state: string;
2266
+ mode: string;
2267
+ previous_taker: string;
2268
+ addressed_events: {
2269
+ id: number;
2270
+ kind: string;
2271
+ timestamp: string;
2272
+ to_state?: string;
2273
+ reason?: string;
2274
+ /** Who caused the event, as the event log recorded it. The shape written is an EventActor; a row written before a field existed lacks that key. */
2275
+ actor?: unknown;
2276
+ /** The event's payload, whose shape its kind decides, as the event log recorded it. */
2277
+ payload?: unknown;
2278
+ /** True when the event concerns the take this reply is about — your current take; on a refusal, your take that ended; on a repost, the take it ended. False is an earlier take's history, not an instruction to you. */
2279
+ your_take: boolean;
2280
+ }[] | null;
2281
+ more: boolean;
2282
+ newest_event_id: number;
2283
+ warnings?: string[];
2284
+ };
2285
+ /**
2286
+ *
2287
+ * Schema: sdk/workorder/schema/v1/retry.params.json
2288
+ */
2289
+ export type WorkOrderRetryParams = {
2290
+ /** Go duration ('30s', '5m') overriding the type's retry_backoff step, recorded on next_retry_at for the orchestrator to honour. Accepted only when the Work Order is `active`; retrying a `failed:awaiting-ack` Work Order with a backoff is refused, because nothing enforces it on that path yet. */
2291
+ backoff?: string;
2292
+ /** Report the ADR-105 D8 classification and DO NOTHING ELSE: no generation is minted and the retry does not happen. The manifest says what a resume under the candidate would do — where it would land, which steps would be passed over with nothing recorded, which recorded results would be re-run, and which would be orphaned — with the verdict derived from it. Only meaningful with `repin`; on its own it is refused, since there is nothing else here to preview. */
2293
+ dry_run?: boolean;
2294
+ /** Natural-language guidance for the next attempt; surfaced on the dispatch envelope as retry_hint. */
2295
+ hint?: string;
2296
+ /** Work Order to retry. Optional for the dispatched root recipe — omit it and the id is taken from the dispatch context. */
2297
+ id?: string;
2298
+ /** Cross EVERY refusal the re-pin gate raises, including a capability or operation switch, by ending the contract rather than preserving it: every held step binding is settled `superseded` and a FRESH CHAIN GENERATION is opened for the resume, which then selects against the new pin from nothing (ADR-130 D5's "a deliberate new chain gets an explicit new generation"). It is the refusal's own suggested repair — abandon this Work Order and create a new one — WITHOUT losing the Work Order, its train, its workspace, its artifacts or its history. What it does lose is what the run was doing: a `started` binding it supersedes is a dispatch that was running. It does NOT cross a generation/digest inconsistency, which ADR-105 D7 classifies as corruption rather than as a configuration change. A binding at `admitted` or `dispatch_pending` is refused rather than superseded — those states have no edge that settles; let reconciliation republish and cross again. Only meaningful with `repin`. Authorized against `api/v1/workorders/repin/new-chain` IN ADDITION to `api/v1/workorders/repin`. Pass `dry_run` first: the manifest's `would_open_new_chain` names every binding that would be superseded and how far each had got. */
2299
+ new_chain?: boolean;
2300
+ /** Start a fresh harness session instead of resuming the one this Work Order last announced — for a session whose own content is the failure, or one the harness cannot resume. On a retry that re-dispatches it applies to that dispatch; on one that rejoins a running dispatch or collects a finished result it applies to the next dispatch the walk makes. Refused where it could apply to nothing: on the `active` edge (the session making the call is still running; interrupt or force_fail it first), on off-tera work, and beside `dry_run`, which writes nothing. Held on the Work Order's log, so a daemon restart does not lose it. The reply's `session` says what it applied to. */
2301
+ new_session?: boolean;
2302
+ /** Short audit note recorded on the retry event, and — with `repin` — the reason stored on the new pin generation. Required either way, and audit-only — guidance for the next attempt goes in `hint`, which is the field the agent actually reads. */
2303
+ reason: string;
2304
+ /** Rebind this Work Order to the configuration its type resolves to NOW, as a new generation, and then retry (ADR-105 D7). DURABLE: every subsequent attempt uses the new generation, so it is not a one-shot override that the next attempt falls back off. ATTRIBUTED: your principal and your `reason` are stored on the generation, and the generation history is the audit trail of every forced upgrade. It is the ONLY door onto a Work Order whose pinned configuration is fatally flawed — including one whose pin this daemon cannot decode, which is the case it exists for. Authorized against `api/v1/workorders/repin` IN ADDITION to this capability's own resource; worker-class callers are refused by class and no grant restores it. Pass `dry_run` with it first to see what the resume would cross. */
2305
+ repin?: boolean;
2306
+ /** Cross ONE refusal: a select site where this Work Order's live step binding is running a candidate the new pin no longer offers (ADR-130 D5, ratified crossable 2026-09-20). The binding row is RETAINED at the same chain generation and the resume RE-SELECTS from the new candidate set, running the candidate loop against live capacity exactly as a first admission would. It does NOT preserve the candidate the run is on — that candidate is gone, which is why the refusal exists. It lifts nothing else: a capability or operation switch at a fixed site has no candidate to re-select, and a withdrawn `yields_turn` offer is frozen for the life of a pinned conversation (ADR-129 D9). Over a site whose candidate IS still offered, or a fixed site, it is a no-op and says so in the manifest rather than refusing. Only meaningful with `repin`. Authorized against `api/v1/workorders/repin/reselect` IN ADDITION to `api/v1/workorders/repin`. Pass `dry_run` first: the manifest's `would_reselect` names the site, the candidate being given up and the set the resume will choose from. */
2307
+ reselect?: boolean;
2308
+ };
2309
+ /**
2310
+ * `work_order.retry` result (v1).
2311
+ *
2312
+ * What `work_order.retry` answers on success (ADR-143 D4), generated from the arms of its result union; a value is exactly one of them. A refusal is not this document: it is the invocation's `error` envelope.
2313
+ *
2314
+ * Schema: sdk/workorder/schema/v1/retry.result.json
2315
+ */
2316
+ export type WorkOrderRetryResult = {
2317
+ id: string;
2318
+ state: string;
2319
+ attempt: number;
2320
+ max: number;
2321
+ hint?: string;
2322
+ next_retry_at?: string;
2323
+ repin?: {
2324
+ minted: boolean;
2325
+ dry_run: boolean;
2326
+ generation?: number;
2327
+ config_digest?: string;
2328
+ previous_state?: string;
2329
+ previous_generation?: number;
2330
+ classification: {
2331
+ verdict: string;
2332
+ caveat: string;
2333
+ cause?: string;
2334
+ manifest?: {
2335
+ parked_step: string;
2336
+ lands: boolean;
2337
+ landing?: number;
2338
+ absent?: {
2339
+ name: string;
2340
+ index: number;
2341
+ cause: string;
2342
+ }[];
2343
+ rerun?: string[];
2344
+ orphaned?: string[];
2345
+ digests_agree: boolean;
2346
+ sessions?: {
2347
+ site: string;
2348
+ logical_site_id?: string;
2349
+ structural_path?: string;
2350
+ chain_generation: number;
2351
+ outcome: string;
2352
+ reason: string;
2353
+ }[];
2354
+ };
2355
+ warnings?: {
2356
+ kind: string;
2357
+ steps?: string[];
2358
+ }[];
2359
+ };
2360
+ crossings?: {
2361
+ would_reselect?: {
2362
+ site: string;
2363
+ logical_site_id?: string;
2364
+ structural_path?: string;
2365
+ from_candidate: string;
2366
+ offered?: string[];
2367
+ }[];
2368
+ would_open_new_chain?: {
2369
+ superseded: {
2370
+ site: string;
2371
+ logical_site_id?: string;
2372
+ structural_path?: string;
2373
+ chain_generation: number;
2374
+ state: string;
2375
+ candidate?: string;
2376
+ }[] | null;
2377
+ generation?: number;
2378
+ };
2379
+ reselected?: {
2380
+ site: string;
2381
+ logical_site_id?: string;
2382
+ structural_path?: string;
2383
+ from_candidate: string;
2384
+ offered?: string[];
2385
+ }[];
2386
+ opened_new_chain?: {
2387
+ superseded: {
2388
+ site: string;
2389
+ logical_site_id?: string;
2390
+ structural_path?: string;
2391
+ chain_generation: number;
2392
+ state: string;
2393
+ candidate?: string;
2394
+ }[] | null;
2395
+ generation?: number;
2396
+ };
2397
+ };
2398
+ };
2399
+ chain?: {
2400
+ inherits_generation: number;
2401
+ generation: number;
2402
+ };
2403
+ binding?: {
2404
+ released: number;
2405
+ dispatch_id?: string;
2406
+ runner?: string;
2407
+ note: string;
2408
+ };
2409
+ runner_hold?: {
2410
+ absence?: {
2411
+ reported_at: string;
2412
+ session_id: string;
2413
+ link_version: number;
2414
+ };
2415
+ runner: string;
2416
+ pool?: string;
2417
+ linked: boolean;
2418
+ superseded_attempt: number;
2419
+ workspace_retired: boolean;
2420
+ workspace_pinned: boolean;
2421
+ held_seats: {
2422
+ pool?: string;
2423
+ member?: string;
2424
+ runner?: string;
2425
+ attempt: number;
2426
+ }[] | null;
2427
+ seats_tracked: boolean;
2428
+ note: string;
2429
+ };
2430
+ arm?: string;
2431
+ session?: {
2432
+ resumed: boolean;
2433
+ fate: string;
2434
+ sessions?: {
2435
+ session_scope: string;
2436
+ session_id?: string;
2437
+ fresh?: boolean;
2438
+ }[];
2439
+ new_session?: {
2440
+ applied: boolean;
2441
+ to: string;
2442
+ note: string;
2443
+ };
2444
+ note: string;
2445
+ };
2446
+ } | {
2447
+ id: string;
2448
+ state: string;
2449
+ verb: string;
2450
+ applied: boolean;
2451
+ repin: {
2452
+ minted: boolean;
2453
+ dry_run: boolean;
2454
+ generation?: number;
2455
+ config_digest?: string;
2456
+ previous_state?: string;
2457
+ previous_generation?: number;
2458
+ classification: {
2459
+ verdict: string;
2460
+ caveat: string;
2461
+ cause?: string;
2462
+ manifest?: {
2463
+ parked_step: string;
2464
+ lands: boolean;
2465
+ landing?: number;
2466
+ absent?: {
2467
+ name: string;
2468
+ index: number;
2469
+ cause: string;
2470
+ }[];
2471
+ rerun?: string[];
2472
+ orphaned?: string[];
2473
+ digests_agree: boolean;
2474
+ sessions?: {
2475
+ site: string;
2476
+ logical_site_id?: string;
2477
+ structural_path?: string;
2478
+ chain_generation: number;
2479
+ outcome: string;
2480
+ reason: string;
2481
+ }[];
2482
+ };
2483
+ warnings?: {
2484
+ kind: string;
2485
+ steps?: string[];
2486
+ }[];
2487
+ };
2488
+ crossings?: {
2489
+ would_reselect?: {
2490
+ site: string;
2491
+ logical_site_id?: string;
2492
+ structural_path?: string;
2493
+ from_candidate: string;
2494
+ offered?: string[];
2495
+ }[];
2496
+ would_open_new_chain?: {
2497
+ superseded: {
2498
+ site: string;
2499
+ logical_site_id?: string;
2500
+ structural_path?: string;
2501
+ chain_generation: number;
2502
+ state: string;
2503
+ candidate?: string;
2504
+ }[] | null;
2505
+ generation?: number;
2506
+ };
2507
+ reselected?: {
2508
+ site: string;
2509
+ logical_site_id?: string;
2510
+ structural_path?: string;
2511
+ from_candidate: string;
2512
+ offered?: string[];
2513
+ }[];
2514
+ opened_new_chain?: {
2515
+ superseded: {
2516
+ site: string;
2517
+ logical_site_id?: string;
2518
+ structural_path?: string;
2519
+ chain_generation: number;
2520
+ state: string;
2521
+ candidate?: string;
2522
+ }[] | null;
2523
+ generation?: number;
2524
+ };
2525
+ };
2526
+ };
2527
+ };
2528
+ /**
2529
+ *
2530
+ * Schema: sdk/workorder/schema/v1/submit_result.params.json
2531
+ */
2532
+ export type WorkOrderSubmitResultParams = {
2533
+ /** The off-tera Work Order you hold. Required. */
2534
+ id: string;
2535
+ /** Your result declaration (ADR-099): `status` `complete` or `failed`, a `summary`, and whatever the type's output_schema requires. Graded against the schema this Work Order was pinned to; a violation is refused with its pointer and changes nothing. `paused` with a `reason` parks it, still yours: `awaiting-input` with a `question`, or a `predicate` to wait on your children (`awaiting-children`) or on named Work Orders (`awaiting-event`, kind `these-work-orders`); a wake makes it active again. A reason the type cannot park on is refused and changes nothing. */
2536
+ record: {
2537
+ [key: string]: unknown;
2538
+ };
2539
+ /** The id of the last event you have processed on this Work Order. The response carries the events addressed to you after it (a repost, a cancel, a wake, an answer, posted guidance), at most 32 with `more` set when there were more, plus `newest_event_id`. The server keeps no cursor: omit it, or pass 0, for everything addressed so far. */
2540
+ seen_through?: number;
2541
+ };
2542
+ /**
2543
+ * `work_order.submit_result` result (v1).
2544
+ *
2545
+ * What `work_order.submit_result` answers on success (ADR-143 D4), generated from `workorder.SubmitResultResult`. A refusal is not this document: it is the invocation's `error` envelope.
2546
+ *
2547
+ * Schema: sdk/workorder/schema/v1/submit_result.result.json
2548
+ */
2549
+ export type WorkOrderSubmitResultResult = {
2550
+ id: string;
2551
+ state: string;
2552
+ status: string;
2553
+ outcome?: {
2554
+ outcome_provenance: string;
2555
+ attested_by?: string;
2556
+ };
2557
+ checks?: string;
2558
+ addressed_events: {
2559
+ id: number;
2560
+ kind: string;
2561
+ timestamp: string;
2562
+ to_state?: string;
2563
+ reason?: string;
2564
+ /** Who caused the event, as the event log recorded it. The shape written is an EventActor; a row written before a field existed lacks that key. */
2565
+ actor?: unknown;
2566
+ /** The event's payload, whose shape its kind decides, as the event log recorded it. */
2567
+ payload?: unknown;
2568
+ /** True when the event concerns the take this reply is about — your current take; on a refusal, your take that ended; on a repost, the take it ended. False is an earlier take's history, not an instruction to you. */
2569
+ your_take: boolean;
2570
+ }[] | null;
2571
+ more: boolean;
2572
+ newest_event_id: number;
2573
+ warnings?: string[];
2574
+ };
2575
+ /**
2576
+ *
2577
+ * Schema: sdk/workorder/schema/v1/take.params.json
2578
+ */
2579
+ export type WorkOrderTakeParams = {
2580
+ /** Your own statement of where the work will be done — host, tool or session. Recorded as given and shown as given; tera never verifies, parses or keys on it. At most 1024 bytes. */
2581
+ describe?: string;
2582
+ /** The off-tera Work Order to take. Required — a take is made from outside any dispatch, so there is no dispatch context to take an id from. */
2583
+ id: string;
2584
+ };
2585
+ /**
2586
+ * `work_order.take` result (v1).
2587
+ *
2588
+ * What `work_order.take` answers on success (ADR-143 D4), generated from `workorder.TakeResult`. A refusal is not this document: it is the invocation's `error` envelope.
2589
+ *
2590
+ * Schema: sdk/workorder/schema/v1/take.result.json
2591
+ */
2592
+ export type WorkOrderTakeResult = {
2593
+ id: string;
2594
+ type: string;
2595
+ state: string;
2596
+ take: {
2597
+ principal: string;
2598
+ taken_at: string;
2599
+ last_progress_at?: string;
2600
+ describe?: string;
2601
+ caller_is_person?: boolean;
2602
+ outcome_provenance?: string;
2603
+ } | null;
2604
+ instructions: string;
2605
+ requirements?: string;
2606
+ /** The Work Order's inputs, verbatim, in the shape its type's input_schema declares. */
2607
+ inputs?: unknown;
2608
+ attachments: {
2609
+ handle: string;
2610
+ filename: string;
2611
+ mime_type?: string;
2612
+ size_bytes: number;
2613
+ description?: string;
2614
+ }[] | null;
2615
+ addressed_events: {
2616
+ id: number;
2617
+ kind: string;
2618
+ timestamp: string;
2619
+ to_state?: string;
2620
+ reason?: string;
2621
+ /** Who caused the event, as the event log recorded it. The shape written is an EventActor; a row written before a field existed lacks that key. */
2622
+ actor?: unknown;
2623
+ /** The event's payload, whose shape its kind decides, as the event log recorded it. */
2624
+ payload?: unknown;
2625
+ /** True when the event concerns the take this reply is about — your current take; on a refusal, your take that ended; on a repost, the take it ended. False is an earlier take's history, not an instruction to you. */
2626
+ your_take: boolean;
2627
+ }[] | null;
2628
+ more: boolean;
2629
+ newest_event_id: number;
2630
+ warnings?: string[];
2631
+ /** The JSON Schema this Work Order was pinned to at its first take, which submit_result grades the record against. Absent when the type declares none. */
2632
+ output_schema?: unknown;
2633
+ };
2634
+ /**
2635
+ *
2636
+ * Schema: sdk/workorder/schema/v1/transition.params.json
2637
+ */
2638
+ export type WorkOrderTransitionParams = {
2639
+ /** The externally-driven input to fire. The review actions (approve / reject / rework) are accepted only from `paused:awaiting-review`; `answer` only from `paused:awaiting-input` or `paused:awaiting-interactive-turn`. `wake` is the NON-DESTRUCTIVE door into a parked run: it makes the run's wait condition true and lets the ordinary paused → active machinery run, without re-dispatching, resurrecting or re-pinning anything. It is accepted from every paused state EXCEPT `paused:awaiting-review`, whose doors are approve / reject / rework because that park exists so a verdict is RECORDED, and `paused:interrupted`, whose one way out is work_order.guide(id, verb = "deliver") because the run was interrupted to be given a new instruction. It does NOT make the thing the run was waiting for happen: from `paused:awaiting-input` the run is told plainly that no answer was given, and from `paused:awaiting-capacity` / `paused:awaiting-credential` it means "proceed without it", so work needing that resource may fail immediately — that is the operator's call. From `paused:awaiting-upstream` it is sharper still: the backoff has NOT elapsed by construction, so the upstream that refused is very likely still refusing and the run may take the identical refusal at once. From `paused:plugin-contract-moved` it resumes the run on its OLD pin, so its next call to the plugin whose contract moved parks it again: that park's door is `work_order.repin`, which re-pins the run onto the installed contract version and resumes it. Authorized against api/v1/workorders/wake, which the transition grant does NOT imply, and `reason` is REQUIRED on it. For a Work Order that is terminal or merely stuck rather than parked, the road is work_order.force_fail then work_order.retry. `conclude` (ADR-129 D10) is the OPERATOR'S ENDING for an interactive conversation, accepted from `paused:awaiting-interactive-turn` and from NOTHING ELSE: it settles the run at the success terminal (`complete`) whatever the conversation decided, carrying an OPTIONAL `note`. An interactive dispatch has no ending of its own — its one exit is the turn boundary — so this is how the run ends, and there is no resume after it. A run mid-turn is INTERRUPTED first (work_order.guide(id, verb = "interrupt")), which lands it back at its inbox; a conclude arriving at an `active` row is refused and says so. Its children keep running to their own ends. Its optional note goes on `note`, NOT on `reason` — a conclude carrying `reason` is REFUSED rather than silently dropping your words, because unlike `wake` nothing here reaches the run. Authorized against api/v1/workorders/conclude, which the transition grant does NOT imply. */
2640
+ action: "answer" | "approve" | "reject" | "rework" | "cancel" | "retry" | "wake" | "conclude";
2641
+ /** Files to hand this Work Order, each named by the HANDLE its upload minted — `tera artifacts upload <file> --description "…"` mints one in a single command, or over the API `POST /api/v1/artifacts/uploads/authorize` starts an upload and completing it mints the handle. A DISPATCHED RUN uses neither door — a worker-class caller is refused both — and attaches only a handle it has ALREADY PUBLISHED into this same train, which costs nothing and is not a re-upload. ATTACHMENTS CARRY A HANDLE AND NEVER FILE CONTENT, at any size: there is no inline, base64 or small-file form of this field on any surface, so upload first and pass the reference. You do not describe the file here — its filename, declared content type, size, digest and the uploader's description come from the upload itself, so what a later reader sees is what was actually uploaded rather than what the create said about it. An attach CONSUMES the artifact into this one Work Order's train: it leaves your staged account, the same handle keeps working, and it cannot be attached to a second Work Order — upload the file again for that. A handle you have not attached within 24 hours of uploading it is collected; attaching to a `draft` stops that clock for as long as the draft lives, and discarding the draft hands the file back to you with a fresh 24 hours rather than deleting it. Every unattachable handle answers the same way — never uploaded, already attached, expired, or somebody else's are one refusal, because telling them apart would say whether another principal's handle exists; `tera artifacts list --staged` lists what is actually yours (`GET /api/v1/artifacts/staged` over the API). A run has no staging account to list, and the handle it should be passing is one of its own outputs in this train. Inputs get their own byte allowance (64 MiB per Work Order) and never spend the separate allowance a run uses to publish artifacts about its own work. */
2642
+ attachments?: {
2643
+ /** The artifact handle the upload minted. Opaque: it carries no filename and no path, and nothing about it is constructible. */
2644
+ handle: string;
2645
+ }[];
2646
+ /** Report the ADR-105 D8 classification and DO NOTHING ELSE: no generation is minted and the transition does not happen. The manifest says what a resume under the candidate would do — where it would land, which steps would be passed over with nothing recorded, which recorded results would be re-run, and which would be orphaned — with the verdict derived from it. Only meaningful with `repin`; on its own it is refused, since there is nothing else here to preview. */
2647
+ dry_run?: boolean;
2648
+ /** Work Order to drive. */
2649
+ id: string;
2650
+ /** action=answer only: interactive answer retry identity. */
2651
+ input_key?: string;
2652
+ /** Cross EVERY refusal the re-pin gate raises, including a capability or operation switch, by ending the contract rather than preserving it: every held step binding is settled `superseded` and a FRESH CHAIN GENERATION is opened for the resume, which then selects against the new pin from nothing (ADR-130 D5's "a deliberate new chain gets an explicit new generation"). It is the refusal's own suggested repair — abandon this Work Order and create a new one — WITHOUT losing the Work Order, its train, its workspace, its artifacts or its history. What it does lose is what the run was doing: a `started` binding it supersedes is a dispatch that was running. It does NOT cross a generation/digest inconsistency, which ADR-105 D7 classifies as corruption rather than as a configuration change. A binding at `admitted` or `dispatch_pending` is refused rather than superseded — those states have no edge that settles; let reconciliation republish and cross again. Only meaningful with `repin`. Authorized against `api/v1/workorders/repin/new-chain` IN ADDITION to `api/v1/workorders/repin`. Pass `dry_run` first: the manifest's `would_open_new_chain` names every binding that would be superseded and how far each had got. */
2653
+ new_chain?: boolean;
2654
+ /** action=rework: commentary injected into the resumed agent's context as guard_failure_note. action=conclude: the operator's OPTIONAL note on why the conversation ended, recorded on the transition's event-log row — it reaches nobody, because a concluded run does not run again. Read on those two actions and on no other. */
2655
+ note?: string;
2656
+ /** action=answer only: structured answer; takes precedence over text. */
2657
+ payload?: unknown;
2658
+ /** Short audit note recorded on the resulting event. Read as the rejection reason on action=reject (default: "review rejected") and as the cancellation reason on action=cancel, and — with `repin` — as the reason stored on the new pin generation, where it is REQUIRED. It is an audit line, not guidance — nothing reaches the agent through it. NOT ACCEPTED on action=conclude, which carries its operator note on `note` and refuses this field by name rather than dropping it. THE ONE EXCEPTION IS action=wake, where it is REQUIRED and DOES reach the run: it rides the wake payload, because a run woken with no explanation cannot act sensibly on having been woken. Even there it is PROVENANCE and not an instruction — it says why the wait was ended, the way a timeout wake says which bound elapsed. To instruct a run, use work_order.retry's `hint`, a rework `note`, or an answer. */
2659
+ reason?: string;
2660
+ /** Rebind this Work Order to the configuration its type resolves to NOW, as a new generation, and then transition (ADR-105 D7). DURABLE: every subsequent attempt uses the new generation, so it is not a one-shot override that the next attempt falls back off. ATTRIBUTED: your principal and your `reason` are stored on the generation, and the generation history is the audit trail of every forced upgrade. It is the ONLY door onto a Work Order whose pinned configuration is fatally flawed — including one whose pin this daemon cannot decode, which is the case it exists for. Authorized against `api/v1/workorders/repin` IN ADDITION to this capability's own resource; worker-class callers are refused by class and no grant restores it. Pass `dry_run` with it first to see what the resume would cross. */
2661
+ repin?: boolean;
2662
+ /** action=answer only: replace a definitely unsent held answer. */
2663
+ replace?: boolean;
2664
+ /** Cross ONE refusal: a select site where this Work Order's live step binding is running a candidate the new pin no longer offers (ADR-130 D5, ratified crossable 2026-09-20). The binding row is RETAINED at the same chain generation and the resume RE-SELECTS from the new candidate set, running the candidate loop against live capacity exactly as a first admission would. It does NOT preserve the candidate the run is on — that candidate is gone, which is why the refusal exists. It lifts nothing else: a capability or operation switch at a fixed site has no candidate to re-select, and a withdrawn `yields_turn` offer is frozen for the life of a pinned conversation (ADR-129 D9). Over a site whose candidate IS still offered, or a fixed site, it is a no-op and says so in the manifest rather than refusing. Only meaningful with `repin`. Authorized against `api/v1/workorders/repin/reselect` IN ADDITION to `api/v1/workorders/repin`. Pass `dry_run` first: the manifest's `would_reselect` names the site, the candidate being given up and the set the resume will choose from. */
2665
+ reselect?: boolean;
2666
+ /** action=answer only: the operator's answer text. Read work_order.get(id).question first — that is what is being asked. */
2667
+ text?: string;
2668
+ };
2669
+ /**
2670
+ * `work_order.transition` result (v1).
2671
+ *
2672
+ * What `work_order.transition` answers on success (ADR-143 D4), generated from the arms of its result union; a value is exactly one of them. A refusal is not this document: it is the invocation's `error` envelope.
2673
+ *
2674
+ * Schema: sdk/workorder/schema/v1/transition.result.json
2675
+ */
2676
+ export type WorkOrderTransitionResult = {
2677
+ id: string;
2678
+ state: string;
2679
+ action: string;
2680
+ trigger: string;
2681
+ repin?: {
2682
+ minted: boolean;
2683
+ dry_run: boolean;
2684
+ generation?: number;
2685
+ config_digest?: string;
2686
+ previous_state?: string;
2687
+ previous_generation?: number;
2688
+ classification: {
2689
+ verdict: string;
2690
+ caveat: string;
2691
+ cause?: string;
2692
+ manifest?: {
2693
+ parked_step: string;
2694
+ lands: boolean;
2695
+ landing?: number;
2696
+ absent?: {
2697
+ name: string;
2698
+ index: number;
2699
+ cause: string;
2700
+ }[];
2701
+ rerun?: string[];
2702
+ orphaned?: string[];
2703
+ digests_agree: boolean;
2704
+ sessions?: {
2705
+ site: string;
2706
+ logical_site_id?: string;
2707
+ structural_path?: string;
2708
+ chain_generation: number;
2709
+ outcome: string;
2710
+ reason: string;
2711
+ }[];
2712
+ };
2713
+ warnings?: {
2714
+ kind: string;
2715
+ steps?: string[];
2716
+ }[];
2717
+ };
2718
+ crossings?: {
2719
+ would_reselect?: {
2720
+ site: string;
2721
+ logical_site_id?: string;
2722
+ structural_path?: string;
2723
+ from_candidate: string;
2724
+ offered?: string[];
2725
+ }[];
2726
+ would_open_new_chain?: {
2727
+ superseded: {
2728
+ site: string;
2729
+ logical_site_id?: string;
2730
+ structural_path?: string;
2731
+ chain_generation: number;
2732
+ state: string;
2733
+ candidate?: string;
2734
+ }[] | null;
2735
+ generation?: number;
2736
+ };
2737
+ reselected?: {
2738
+ site: string;
2739
+ logical_site_id?: string;
2740
+ structural_path?: string;
2741
+ from_candidate: string;
2742
+ offered?: string[];
2743
+ }[];
2744
+ opened_new_chain?: {
2745
+ superseded: {
2746
+ site: string;
2747
+ logical_site_id?: string;
2748
+ structural_path?: string;
2749
+ chain_generation: number;
2750
+ state: string;
2751
+ candidate?: string;
2752
+ }[] | null;
2753
+ generation?: number;
2754
+ };
2755
+ };
2756
+ };
2757
+ disposition?: string;
2758
+ runner?: string;
2759
+ detail?: string;
2760
+ } | {
2761
+ id: string;
2762
+ state: string;
2763
+ verb: string;
2764
+ applied: boolean;
2765
+ repin: {
2766
+ minted: boolean;
2767
+ dry_run: boolean;
2768
+ generation?: number;
2769
+ config_digest?: string;
2770
+ previous_state?: string;
2771
+ previous_generation?: number;
2772
+ classification: {
2773
+ verdict: string;
2774
+ caveat: string;
2775
+ cause?: string;
2776
+ manifest?: {
2777
+ parked_step: string;
2778
+ lands: boolean;
2779
+ landing?: number;
2780
+ absent?: {
2781
+ name: string;
2782
+ index: number;
2783
+ cause: string;
2784
+ }[];
2785
+ rerun?: string[];
2786
+ orphaned?: string[];
2787
+ digests_agree: boolean;
2788
+ sessions?: {
2789
+ site: string;
2790
+ logical_site_id?: string;
2791
+ structural_path?: string;
2792
+ chain_generation: number;
2793
+ outcome: string;
2794
+ reason: string;
2795
+ }[];
2796
+ };
2797
+ warnings?: {
2798
+ kind: string;
2799
+ steps?: string[];
2800
+ }[];
2801
+ };
2802
+ crossings?: {
2803
+ would_reselect?: {
2804
+ site: string;
2805
+ logical_site_id?: string;
2806
+ structural_path?: string;
2807
+ from_candidate: string;
2808
+ offered?: string[];
2809
+ }[];
2810
+ would_open_new_chain?: {
2811
+ superseded: {
2812
+ site: string;
2813
+ logical_site_id?: string;
2814
+ structural_path?: string;
2815
+ chain_generation: number;
2816
+ state: string;
2817
+ candidate?: string;
2818
+ }[] | null;
2819
+ generation?: number;
2820
+ };
2821
+ reselected?: {
2822
+ site: string;
2823
+ logical_site_id?: string;
2824
+ structural_path?: string;
2825
+ from_candidate: string;
2826
+ offered?: string[];
2827
+ }[];
2828
+ opened_new_chain?: {
2829
+ superseded: {
2830
+ site: string;
2831
+ logical_site_id?: string;
2832
+ structural_path?: string;
2833
+ chain_generation: number;
2834
+ state: string;
2835
+ candidate?: string;
2836
+ }[] | null;
2837
+ generation?: number;
2838
+ };
2839
+ };
2840
+ };
2841
+ } | {
2842
+ resume_error?: string;
2843
+ input?: {
2844
+ message: {
2845
+ kind?: string;
2846
+ question_at?: string;
2847
+ input_id?: string;
2848
+ input_sequence?: number;
2849
+ caller?: string;
2850
+ /** Platform-attested provenance as recorded by the dispatching host; its actor schema belongs to that host. */
2851
+ actor?: unknown;
2852
+ issued_at?: string;
2853
+ text: string;
2854
+ attachments?: {
2855
+ handle: string;
2856
+ filename: string;
2857
+ mime_type: string;
2858
+ size: number;
2859
+ description?: string;
2860
+ }[];
2861
+ };
2862
+ state: string;
2863
+ attempt?: {
2864
+ id: string;
2865
+ invocation_id: string;
2866
+ dispatch_id: string;
2867
+ observations?: {
2868
+ observed_at: string;
2869
+ state: string;
2870
+ evidence: string;
2871
+ }[];
2872
+ };
2873
+ resolution?: string;
2874
+ };
2875
+ input_barrier?: {
2876
+ input_id: string;
2877
+ input_sequence: number;
2878
+ attempt_id?: string;
2879
+ state: string;
2880
+ reconciliation: string;
2881
+ behind: number;
2882
+ recovery: string;
2883
+ };
2884
+ id: string;
2885
+ state: string;
2886
+ delivered: boolean;
2887
+ delivery: string;
2888
+ resumed_parked_run: boolean;
2889
+ outcome: string;
2890
+ repin?: {
2891
+ minted: boolean;
2892
+ dry_run: boolean;
2893
+ generation?: number;
2894
+ config_digest?: string;
2895
+ previous_state?: string;
2896
+ previous_generation?: number;
2897
+ classification: {
2898
+ verdict: string;
2899
+ caveat: string;
2900
+ cause?: string;
2901
+ manifest?: {
2902
+ parked_step: string;
2903
+ lands: boolean;
2904
+ landing?: number;
2905
+ absent?: {
2906
+ name: string;
2907
+ index: number;
2908
+ cause: string;
2909
+ }[];
2910
+ rerun?: string[];
2911
+ orphaned?: string[];
2912
+ digests_agree: boolean;
2913
+ sessions?: {
2914
+ site: string;
2915
+ logical_site_id?: string;
2916
+ structural_path?: string;
2917
+ chain_generation: number;
2918
+ outcome: string;
2919
+ reason: string;
2920
+ }[];
2921
+ };
2922
+ warnings?: {
2923
+ kind: string;
2924
+ steps?: string[];
2925
+ }[];
2926
+ };
2927
+ crossings?: {
2928
+ would_reselect?: {
2929
+ site: string;
2930
+ logical_site_id?: string;
2931
+ structural_path?: string;
2932
+ from_candidate: string;
2933
+ offered?: string[];
2934
+ }[];
2935
+ would_open_new_chain?: {
2936
+ superseded: {
2937
+ site: string;
2938
+ logical_site_id?: string;
2939
+ structural_path?: string;
2940
+ chain_generation: number;
2941
+ state: string;
2942
+ candidate?: string;
2943
+ }[] | null;
2944
+ generation?: number;
2945
+ };
2946
+ reselected?: {
2947
+ site: string;
2948
+ logical_site_id?: string;
2949
+ structural_path?: string;
2950
+ from_candidate: string;
2951
+ offered?: string[];
2952
+ }[];
2953
+ opened_new_chain?: {
2954
+ superseded: {
2955
+ site: string;
2956
+ logical_site_id?: string;
2957
+ structural_path?: string;
2958
+ chain_generation: number;
2959
+ state: string;
2960
+ candidate?: string;
2961
+ }[] | null;
2962
+ generation?: number;
2963
+ };
2964
+ };
2965
+ };
2966
+ } | {
2967
+ id: string;
2968
+ state: string;
2969
+ cancel_requested: boolean;
2970
+ cancelled: boolean;
2971
+ requested_at: string;
2972
+ upstream: string;
2973
+ };
2974
+ /**
2975
+ *
2976
+ * Schema: sdk/workorder/schema/v1/tree.params.json
2977
+ */
2978
+ export type WorkOrderTreeParams = {
2979
+ /** Root of the train — any Work Order, not necessarily a top-level one. Every `paused:awaiting-input` node in the result carries its outstanding question inline as `question.text`, and every paused node carries `waiting_on` — the door that would reopen it, plus `waiting_on.refusal` when this run's resume is being refused, which is what is holding it instead of that door. */
2980
+ id: string;
2981
+ /** Maximum descendants to return. 0 or absent means the default; values above the maximum are clamped. */
2982
+ limit?: number;
2983
+ /** Generations below the root to walk. 0 or absent means the default; values above the maximum are clamped and reported as a truncation. */
2984
+ max_depth?: number;
2985
+ /** Return only descendants in any of these states, matched exactly as `work_order.list`'s `states` is. Absent or empty returns every descendant. Filters what is returned, never what is walked: a matching node beneath a non-matching one is still found. The root is always returned whatever its state; `counts`, `total` and `limit` count the returned descendants. */
2986
+ states?: string[];
2987
+ };
2988
+ /**
2989
+ * `work_order.tree` result (v1).
2990
+ *
2991
+ * What `work_order.tree` answers on success (ADR-143 D4), generated from `workorder.TreeResult`. A refusal is not this document: it is the invocation's `error` envelope.
2992
+ *
2993
+ * Schema: sdk/workorder/schema/v1/tree.result.json
2994
+ */
2995
+ export type WorkOrderTreeResult = {
2996
+ root: {
2997
+ context_compactions?: {
2998
+ state: string;
2999
+ count: number | null;
3000
+ latest_at?: string;
3001
+ };
3002
+ id: string;
3003
+ parent_id?: string;
3004
+ depth: number;
3005
+ worker: string;
3006
+ type: string;
3007
+ state: string;
3008
+ title?: string;
3009
+ cohort_id: string;
3010
+ depends_on?: string[];
3011
+ tags: string[] | null;
3012
+ priority: number;
3013
+ block_reason?: {
3014
+ kind: string;
3015
+ detail?: unknown;
3016
+ };
3017
+ deferred_until?: string;
3018
+ question?: {
3019
+ text?: string;
3020
+ /** The asker's structured evidence, or the whole pause context when it is not in the asking shape: its shape is the asker's. */
3021
+ context?: unknown;
3022
+ description?: string;
3023
+ };
3024
+ waiting_on?: {
3025
+ pause_kind: string;
3026
+ predicate_kind?: string;
3027
+ resume: string;
3028
+ inert_predicate?: boolean;
3029
+ unsatisfiable?: boolean;
3030
+ held_answer?: boolean;
3031
+ refusal?: {
3032
+ cause: string;
3033
+ member?: string;
3034
+ pool?: string;
3035
+ pool_cause?: string;
3036
+ verb?: string;
3037
+ repairable: boolean;
3038
+ refused_at?: string;
3039
+ clears?: string;
3040
+ };
3041
+ input_barrier?: {
3042
+ input_id: string;
3043
+ input_sequence: number;
3044
+ attempt_id?: string;
3045
+ state: string;
3046
+ reconciliation: string;
3047
+ behind: number;
3048
+ recovery: string;
3049
+ };
3050
+ };
3051
+ delegation?: {
3052
+ subject: string;
3053
+ outstanding: string[] | null;
3054
+ unavailable?: {
3055
+ upstream: string;
3056
+ gap: string;
3057
+ }[];
3058
+ withdrawn?: {
3059
+ upstream: string;
3060
+ gap: string;
3061
+ }[];
3062
+ door?: string;
3063
+ walled?: string[];
3064
+ fails_at?: string;
3065
+ checked_at?: string;
3066
+ dispatch_timeout_seconds?: number;
3067
+ failures?: {
3068
+ connection: string;
3069
+ upstream?: string;
3070
+ holder: {
3071
+ kind: string;
3072
+ name: string;
3073
+ };
3074
+ reason: string;
3075
+ act_by: string;
3076
+ repair: string;
3077
+ evidence?: string;
3078
+ }[];
3079
+ };
3080
+ could_not_decide?: {
3081
+ kind: string;
3082
+ detail?: string;
3083
+ };
3084
+ upstream_sync?: {
3085
+ last_synced_at?: string;
3086
+ reachability?: string;
3087
+ unreachable_since?: string;
3088
+ detail?: string;
3089
+ };
3090
+ outcome?: {
3091
+ outcome_provenance: string;
3092
+ attested_by?: string;
3093
+ };
3094
+ replaced?: {
3095
+ relation: string;
3096
+ work_order_id: string;
3097
+ note?: string;
3098
+ created_at: string;
3099
+ created_by?: string;
3100
+ }[];
3101
+ validity?: {
3102
+ valid: boolean;
3103
+ reason?: string;
3104
+ field?: string;
3105
+ };
3106
+ selection?: {
3107
+ state: string;
3108
+ cause?: string;
3109
+ refusal?: string;
3110
+ refusal_cause?: string;
3111
+ pin_schema_version?: number;
3112
+ sites?: {
3113
+ state: string;
3114
+ logical_site_id: string;
3115
+ path?: string;
3116
+ step?: string;
3117
+ selectable: boolean;
3118
+ policy?: {
3119
+ mode: string;
3120
+ candidate?: string;
3121
+ order?: string[];
3122
+ };
3123
+ interaction?: string;
3124
+ interactive_request?: boolean;
3125
+ yields_turn_offer?: boolean;
3126
+ offer_contradiction?: boolean;
3127
+ workflow_instance_id?: string;
3128
+ chain_generation?: number;
3129
+ binding_state?: string;
3130
+ revision?: number;
3131
+ admission_revision?: number;
3132
+ pin_generation?: number;
3133
+ pin_digest?: string;
3134
+ site_definition_digest?: string;
3135
+ selection_mode?: string;
3136
+ selection_reason?: string;
3137
+ requested?: {
3138
+ candidate: string;
3139
+ };
3140
+ selected?: {
3141
+ candidate?: string;
3142
+ capability_type?: string;
3143
+ capability?: string;
3144
+ operation?: string;
3145
+ effective_config_digest?: string;
3146
+ native_input_digest?: string;
3147
+ profile_digest?: string;
3148
+ };
3149
+ admitted?: {
3150
+ revision: number;
3151
+ dispatch_id?: string;
3152
+ draws?: {
3153
+ provenance: string;
3154
+ pool: string;
3155
+ member?: string;
3156
+ }[];
3157
+ draws_unreadable?: boolean;
3158
+ };
3159
+ accepted?: {
3160
+ dispatch_document_digest?: string;
3161
+ receipt: boolean;
3162
+ };
3163
+ started?: {
3164
+ at: string;
3165
+ };
3166
+ settled?: {
3167
+ kind?: string;
3168
+ digest?: string;
3169
+ at?: string;
3170
+ };
3171
+ wait?: {
3172
+ fingerprint?: string;
3173
+ decisions?: {
3174
+ candidate?: string;
3175
+ class?: string;
3176
+ reason?: string;
3177
+ detail?: string;
3178
+ terminal?: boolean;
3179
+ }[];
3180
+ dependencies?: {
3181
+ candidate?: string;
3182
+ kind?: string;
3183
+ id?: string;
3184
+ deadline?: string;
3185
+ }[];
3186
+ earliest_deadline?: string;
3187
+ unreadable?: boolean;
3188
+ };
3189
+ attempt_digest?: string;
3190
+ model_policy?: {
3191
+ profile_id?: string;
3192
+ profile_version?: number;
3193
+ requested_tier?: string;
3194
+ requested_model?: string;
3195
+ requested_effort?: string;
3196
+ resolved_tier?: string;
3197
+ resolved_model?: string;
3198
+ resolved_effort?: string;
3199
+ table_source?: string;
3200
+ table_revision?: string;
3201
+ reported_state: string;
3202
+ reported_model?: string;
3203
+ reported_effort?: string;
3204
+ };
3205
+ refusal?: string;
3206
+ refusal_cause?: string;
3207
+ created_at?: string;
3208
+ updated_at?: string;
3209
+ }[];
3210
+ };
3211
+ relation_scope?: {
3212
+ withheld_relations?: number;
3213
+ withheld_related_by?: number;
3214
+ note: string;
3215
+ };
3216
+ created_at: string;
3217
+ updated_at: string;
3218
+ archived: boolean;
3219
+ };
3220
+ descendants: {
3221
+ context_compactions?: {
3222
+ state: string;
3223
+ count: number | null;
3224
+ latest_at?: string;
3225
+ };
3226
+ id: string;
3227
+ parent_id?: string;
3228
+ depth: number;
3229
+ worker: string;
3230
+ type: string;
3231
+ state: string;
3232
+ title?: string;
3233
+ cohort_id: string;
3234
+ depends_on?: string[];
3235
+ tags: string[] | null;
3236
+ priority: number;
3237
+ block_reason?: {
3238
+ kind: string;
3239
+ detail?: unknown;
3240
+ };
3241
+ deferred_until?: string;
3242
+ question?: {
3243
+ text?: string;
3244
+ /** The asker's structured evidence, or the whole pause context when it is not in the asking shape: its shape is the asker's. */
3245
+ context?: unknown;
3246
+ description?: string;
3247
+ };
3248
+ waiting_on?: {
3249
+ pause_kind: string;
3250
+ predicate_kind?: string;
3251
+ resume: string;
3252
+ inert_predicate?: boolean;
3253
+ unsatisfiable?: boolean;
3254
+ held_answer?: boolean;
3255
+ refusal?: {
3256
+ cause: string;
3257
+ member?: string;
3258
+ pool?: string;
3259
+ pool_cause?: string;
3260
+ verb?: string;
3261
+ repairable: boolean;
3262
+ refused_at?: string;
3263
+ clears?: string;
3264
+ };
3265
+ input_barrier?: {
3266
+ input_id: string;
3267
+ input_sequence: number;
3268
+ attempt_id?: string;
3269
+ state: string;
3270
+ reconciliation: string;
3271
+ behind: number;
3272
+ recovery: string;
3273
+ };
3274
+ };
3275
+ delegation?: {
3276
+ subject: string;
3277
+ outstanding: string[] | null;
3278
+ unavailable?: {
3279
+ upstream: string;
3280
+ gap: string;
3281
+ }[];
3282
+ withdrawn?: {
3283
+ upstream: string;
3284
+ gap: string;
3285
+ }[];
3286
+ door?: string;
3287
+ walled?: string[];
3288
+ fails_at?: string;
3289
+ checked_at?: string;
3290
+ dispatch_timeout_seconds?: number;
3291
+ failures?: {
3292
+ connection: string;
3293
+ upstream?: string;
3294
+ holder: {
3295
+ kind: string;
3296
+ name: string;
3297
+ };
3298
+ reason: string;
3299
+ act_by: string;
3300
+ repair: string;
3301
+ evidence?: string;
3302
+ }[];
3303
+ };
3304
+ could_not_decide?: {
3305
+ kind: string;
3306
+ detail?: string;
3307
+ };
3308
+ upstream_sync?: {
3309
+ last_synced_at?: string;
3310
+ reachability?: string;
3311
+ unreachable_since?: string;
3312
+ detail?: string;
3313
+ };
3314
+ outcome?: {
3315
+ outcome_provenance: string;
3316
+ attested_by?: string;
3317
+ };
3318
+ replaced?: {
3319
+ relation: string;
3320
+ work_order_id: string;
3321
+ note?: string;
3322
+ created_at: string;
3323
+ created_by?: string;
3324
+ }[];
3325
+ validity?: {
3326
+ valid: boolean;
3327
+ reason?: string;
3328
+ field?: string;
3329
+ };
3330
+ selection?: {
3331
+ state: string;
3332
+ cause?: string;
3333
+ refusal?: string;
3334
+ refusal_cause?: string;
3335
+ pin_schema_version?: number;
3336
+ sites?: {
3337
+ state: string;
3338
+ logical_site_id: string;
3339
+ path?: string;
3340
+ step?: string;
3341
+ selectable: boolean;
3342
+ policy?: {
3343
+ mode: string;
3344
+ candidate?: string;
3345
+ order?: string[];
3346
+ };
3347
+ interaction?: string;
3348
+ interactive_request?: boolean;
3349
+ yields_turn_offer?: boolean;
3350
+ offer_contradiction?: boolean;
3351
+ workflow_instance_id?: string;
3352
+ chain_generation?: number;
3353
+ binding_state?: string;
3354
+ revision?: number;
3355
+ admission_revision?: number;
3356
+ pin_generation?: number;
3357
+ pin_digest?: string;
3358
+ site_definition_digest?: string;
3359
+ selection_mode?: string;
3360
+ selection_reason?: string;
3361
+ requested?: {
3362
+ candidate: string;
3363
+ };
3364
+ selected?: {
3365
+ candidate?: string;
3366
+ capability_type?: string;
3367
+ capability?: string;
3368
+ operation?: string;
3369
+ effective_config_digest?: string;
3370
+ native_input_digest?: string;
3371
+ profile_digest?: string;
3372
+ };
3373
+ admitted?: {
3374
+ revision: number;
3375
+ dispatch_id?: string;
3376
+ draws?: {
3377
+ provenance: string;
3378
+ pool: string;
3379
+ member?: string;
3380
+ }[];
3381
+ draws_unreadable?: boolean;
3382
+ };
3383
+ accepted?: {
3384
+ dispatch_document_digest?: string;
3385
+ receipt: boolean;
3386
+ };
3387
+ started?: {
3388
+ at: string;
3389
+ };
3390
+ settled?: {
3391
+ kind?: string;
3392
+ digest?: string;
3393
+ at?: string;
3394
+ };
3395
+ wait?: {
3396
+ fingerprint?: string;
3397
+ decisions?: {
3398
+ candidate?: string;
3399
+ class?: string;
3400
+ reason?: string;
3401
+ detail?: string;
3402
+ terminal?: boolean;
3403
+ }[];
3404
+ dependencies?: {
3405
+ candidate?: string;
3406
+ kind?: string;
3407
+ id?: string;
3408
+ deadline?: string;
3409
+ }[];
3410
+ earliest_deadline?: string;
3411
+ unreadable?: boolean;
3412
+ };
3413
+ attempt_digest?: string;
3414
+ model_policy?: {
3415
+ profile_id?: string;
3416
+ profile_version?: number;
3417
+ requested_tier?: string;
3418
+ requested_model?: string;
3419
+ requested_effort?: string;
3420
+ resolved_tier?: string;
3421
+ resolved_model?: string;
3422
+ resolved_effort?: string;
3423
+ table_source?: string;
3424
+ table_revision?: string;
3425
+ reported_state: string;
3426
+ reported_model?: string;
3427
+ reported_effort?: string;
3428
+ };
3429
+ refusal?: string;
3430
+ refusal_cause?: string;
3431
+ created_at?: string;
3432
+ updated_at?: string;
3433
+ }[];
3434
+ };
3435
+ relation_scope?: {
3436
+ withheld_relations?: number;
3437
+ withheld_related_by?: number;
3438
+ note: string;
3439
+ };
3440
+ created_at: string;
3441
+ updated_at: string;
3442
+ archived: boolean;
3443
+ }[] | null;
3444
+ counts: {
3445
+ [key: string]: number;
3446
+ } | null;
3447
+ total: number;
3448
+ truncated?: boolean;
3449
+ truncated_by?: string;
3450
+ };
3451
+ /**
3452
+ * Every type this module declares, mapped to the repository path of the schema
3453
+ * it was generated from.
3454
+ */
3455
+ export declare const WORK_ORDER_SCHEMAS: {
3456
+ readonly WorkOrderAcknowledgeParams: "sdk/workorder/schema/v1/acknowledge.params.json";
3457
+ readonly WorkOrderAcknowledgeResult: "sdk/workorder/schema/v1/acknowledge.result.json";
3458
+ readonly WorkOrderAnswerParams: "sdk/workorder/schema/v1/answer.params.json";
3459
+ readonly WorkOrderAnswerResult: "sdk/workorder/schema/v1/answer.result.json";
3460
+ readonly WorkOrderCancelParams: "sdk/workorder/schema/v1/cancel.params.json";
3461
+ readonly WorkOrderCancelResult: "sdk/workorder/schema/v1/cancel.result.json";
3462
+ readonly WorkOrderCohortSetParams: "sdk/workorder/schema/v1/cohort_set.params.json";
3463
+ readonly WorkOrderCohortSetResult: "sdk/workorder/schema/v1/cohort_set.result.json";
3464
+ readonly WorkOrderCompleteParams: "sdk/workorder/schema/v1/complete.params.json";
3465
+ readonly WorkOrderCompleteResult: "sdk/workorder/schema/v1/complete.result.json";
3466
+ readonly WorkOrderCreateParams: "sdk/workorder/schema/v1/create.params.json";
3467
+ readonly WorkOrderCreateResult: "sdk/workorder/schema/v1/create.result.json";
3468
+ readonly WorkOrderCreateChildParams: "sdk/workorder/schema/v1/create_child.params.json";
3469
+ readonly WorkOrderCreateChildResult: "sdk/workorder/schema/v1/create_child.result.json";
3470
+ readonly WorkOrderEditParams: "sdk/workorder/schema/v1/edit.params.json";
3471
+ readonly WorkOrderEditResult: "sdk/workorder/schema/v1/edit.result.json";
3472
+ readonly WorkOrderEventsParams: "sdk/workorder/schema/v1/events.params.json";
3473
+ readonly WorkOrderEventsResult: "sdk/workorder/schema/v1/events.result.json";
3474
+ readonly WorkOrderFailParams: "sdk/workorder/schema/v1/fail.params.json";
3475
+ readonly WorkOrderFailResult: "sdk/workorder/schema/v1/fail.result.json";
3476
+ readonly WorkOrderForceFailParams: "sdk/workorder/schema/v1/force_fail.params.json";
3477
+ readonly WorkOrderForceFailResult: "sdk/workorder/schema/v1/force_fail.result.json";
3478
+ readonly WorkOrderGetParams: "sdk/workorder/schema/v1/get.params.json";
3479
+ readonly WorkOrderGetResult: "sdk/workorder/schema/v1/get.result.json";
3480
+ readonly WorkOrderGuideParams: "sdk/workorder/schema/v1/guide.params.json";
3481
+ readonly WorkOrderGuideResult: "sdk/workorder/schema/v1/guide.result.json";
3482
+ readonly WorkOrderHistoryParams: "sdk/workorder/schema/v1/history.params.json";
3483
+ readonly WorkOrderHistoryResult: "sdk/workorder/schema/v1/history.result.json";
3484
+ readonly WorkOrderHistoryUnblockParams: "sdk/workorder/schema/v1/history_unblock.params.json";
3485
+ readonly WorkOrderHistoryUnblockResult: "sdk/workorder/schema/v1/history_unblock.result.json";
3486
+ readonly WorkOrderHumanAskParams: "sdk/workorder/schema/v1/human.ask.params.json";
3487
+ readonly WorkOrderHumanAskResult: "sdk/workorder/schema/v1/human.ask.result.json";
3488
+ readonly WorkOrderInterruptParams: "sdk/workorder/schema/v1/interrupt.params.json";
3489
+ readonly WorkOrderInterruptResult: "sdk/workorder/schema/v1/interrupt.result.json";
3490
+ readonly WorkOrderListParams: "sdk/workorder/schema/v1/list.params.json";
3491
+ readonly WorkOrderListResult: "sdk/workorder/schema/v1/list.result.json";
3492
+ readonly WorkOrderListOffTeraParams: "sdk/workorder/schema/v1/list_off_tera.params.json";
3493
+ readonly WorkOrderListOffTeraResult: "sdk/workorder/schema/v1/list_off_tera.result.json";
3494
+ readonly WorkOrderPauseParams: "sdk/workorder/schema/v1/pause.params.json";
3495
+ readonly WorkOrderPauseResult: "sdk/workorder/schema/v1/pause.result.json";
3496
+ readonly WorkOrderPrioritizeParams: "sdk/workorder/schema/v1/prioritize.params.json";
3497
+ readonly WorkOrderPrioritizeResult: "sdk/workorder/schema/v1/prioritize.result.json";
3498
+ readonly WorkOrderProgressParams: "sdk/workorder/schema/v1/progress.params.json";
3499
+ readonly WorkOrderProgressResult: "sdk/workorder/schema/v1/progress.result.json";
3500
+ readonly WorkOrderRecallParams: "sdk/workorder/schema/v1/recall.params.json";
3501
+ readonly WorkOrderRecallResult: "sdk/workorder/schema/v1/recall.result.json";
3502
+ readonly WorkOrderRefileParams: "sdk/workorder/schema/v1/refile.params.json";
3503
+ readonly WorkOrderRefileResult: "sdk/workorder/schema/v1/refile.result.json";
3504
+ readonly WorkOrderRelateParams: "sdk/workorder/schema/v1/relate.params.json";
3505
+ readonly WorkOrderRelateResult: "sdk/workorder/schema/v1/relate.result.json";
3506
+ readonly WorkOrderReleaseParams: "sdk/workorder/schema/v1/release.params.json";
3507
+ readonly WorkOrderReleaseResult: "sdk/workorder/schema/v1/release.result.json";
3508
+ readonly WorkOrderRepinParams: "sdk/workorder/schema/v1/repin.params.json";
3509
+ readonly WorkOrderRepinResult: "sdk/workorder/schema/v1/repin.result.json";
3510
+ readonly WorkOrderRepostParams: "sdk/workorder/schema/v1/repost.params.json";
3511
+ readonly WorkOrderRepostResult: "sdk/workorder/schema/v1/repost.result.json";
3512
+ readonly WorkOrderRetryParams: "sdk/workorder/schema/v1/retry.params.json";
3513
+ readonly WorkOrderRetryResult: "sdk/workorder/schema/v1/retry.result.json";
3514
+ readonly WorkOrderSubmitResultParams: "sdk/workorder/schema/v1/submit_result.params.json";
3515
+ readonly WorkOrderSubmitResultResult: "sdk/workorder/schema/v1/submit_result.result.json";
3516
+ readonly WorkOrderTakeParams: "sdk/workorder/schema/v1/take.params.json";
3517
+ readonly WorkOrderTakeResult: "sdk/workorder/schema/v1/take.result.json";
3518
+ readonly WorkOrderTransitionParams: "sdk/workorder/schema/v1/transition.params.json";
3519
+ readonly WorkOrderTransitionResult: "sdk/workorder/schema/v1/transition.result.json";
3520
+ readonly WorkOrderTreeParams: "sdk/workorder/schema/v1/tree.params.json";
3521
+ readonly WorkOrderTreeResult: "sdk/workorder/schema/v1/tree.result.json";
3522
+ };