@drisp/protocol 0.6.0 → 0.6.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,202 @@
1
+ // src/domain.ts
2
+ import { z } from "zod";
3
+ var RunStatusSchema = z.enum([
4
+ "running",
5
+ "awaiting_attention",
6
+ "completed",
7
+ "blocked",
8
+ "exhausted",
9
+ "failed",
10
+ "cancelled"
11
+ ]);
12
+ var RunSchema = z.object({
13
+ runId: z.string(),
14
+ /** The durable Athena Session this Run belongs to. */
15
+ athenaSessionId: z.string(),
16
+ workflowName: z.string().optional(),
17
+ /** What the Run was asked to do — the `**Goal**` its Run section records. */
18
+ goal: z.string().optional(),
19
+ /** Index of the most recent Turn (0 before Turn 1). */
20
+ iteration: z.int().nonnegative(),
21
+ maxIterations: z.int().positive().optional(),
22
+ status: RunStatusSchema,
23
+ stopReason: z.string().optional(),
24
+ /** Vendor session id of the Run's most recent Agent Session (ADR 0014). */
25
+ adapterSessionId: z.string().optional(),
26
+ startedAt: z.number(),
27
+ endedAt: z.number().optional()
28
+ });
29
+ var TurnContinuationSchema = z.discriminatedUnion("mode", [
30
+ z.object({ mode: z.literal("fresh") }),
31
+ z.object({ mode: z.literal("resume"), handle: z.string() }),
32
+ z.object({ mode: z.literal("reuse-current") })
33
+ ]);
34
+ var TurnOutcomeSchema = z.discriminatedUnion("kind", [
35
+ z.object({ kind: z.literal("continue") }),
36
+ z.object({
37
+ kind: z.literal("stop"),
38
+ status: RunStatusSchema,
39
+ stopReason: z.string().optional()
40
+ }),
41
+ z.object({
42
+ kind: z.literal("suspend"),
43
+ status: RunStatusSchema,
44
+ stopReason: z.string()
45
+ })
46
+ ]);
47
+ var TurnSchema = z.object({
48
+ runId: z.string(),
49
+ /** 1-based Iteration of this Turn within its Run. */
50
+ iteration: z.int().positive(),
51
+ continuation: TurnContinuationSchema,
52
+ /** Vendor session id of the Agent Session this Turn ran in, once known. */
53
+ adapterSessionId: z.string().optional(),
54
+ startedAt: z.number(),
55
+ endedAt: z.number().optional(),
56
+ outcome: TurnOutcomeSchema.optional()
57
+ });
58
+ var HardFailureCodeSchema = z.enum([
59
+ "auth",
60
+ "billing",
61
+ "invalid_request",
62
+ "model_not_found",
63
+ "unclassified"
64
+ ]);
65
+ var ExhaustedCapSchema = z.enum([
66
+ "retry",
67
+ "nudge",
68
+ "iterations",
69
+ "handover",
70
+ "tokens"
71
+ ]);
72
+ var interruptionBase = {
73
+ /** Human-readable summary of why the Run parked. */
74
+ message: z.string()
75
+ };
76
+ var InterruptionSchema = z.discriminatedUnion("kind", [
77
+ z.object({
78
+ ...interruptionBase,
79
+ kind: z.literal("blocked"),
80
+ /** The `: reason` suffix of `NEEDS_HUMAN[: reason]`, when given. */
81
+ reason: z.string().optional()
82
+ }),
83
+ z.object({
84
+ ...interruptionBase,
85
+ kind: z.literal("question"),
86
+ /**
87
+ * The pending request an `answer` frame must address. Absent when the
88
+ * runner interrupted the Turn instead of leaving the question waiting
89
+ * (an unattended Workflow Run kills the Agent Session on a question,
90
+ * so there is no request left to answer); such a Run is woken with a
91
+ * `steer` carrying the human's guidance.
92
+ */
93
+ requestId: z.string().optional(),
94
+ question: z.string().optional()
95
+ }),
96
+ z.object({
97
+ ...interruptionBase,
98
+ kind: z.literal("hard_failure"),
99
+ code: HardFailureCodeSchema
100
+ }),
101
+ z.object({
102
+ ...interruptionBase,
103
+ kind: z.literal("cap_exhausted"),
104
+ cap: ExhaustedCapSchema,
105
+ limit: z.int().positive().optional(),
106
+ /** Structured policy decision. Older senders may supply only cap/message. */
107
+ resource: z.object({
108
+ cause: z.enum(["tokens", "iterations", "context", "restart"]),
109
+ limit: z.number().nonnegative(),
110
+ used: z.number().nonnegative(),
111
+ detail: z.string().optional(),
112
+ checkpointPath: z.string().optional(),
113
+ fresh: z.boolean()
114
+ }).optional()
115
+ })
116
+ ]);
117
+ var RunSpecSchema = z.looseObject({
118
+ prompt: z.string().optional(),
119
+ athenaSessionId: z.string().optional(),
120
+ adapterResumeSessionId: z.string().optional(),
121
+ sessionId: z.string().optional(),
122
+ projectDir: z.string().optional(),
123
+ workflow: z.looseObject({
124
+ source: z.string().optional(),
125
+ ref: z.string().optional(),
126
+ version: z.string().optional()
127
+ }).optional(),
128
+ harness: z.string().optional(),
129
+ env: z.record(z.string(), z.string()).optional(),
130
+ timeoutSec: z.number().optional(),
131
+ /** Per-run callback channel minted by the hub; both or neither. */
132
+ callbackWsUrl: z.string().optional(),
133
+ callbackToken: z.string().optional()
134
+ });
135
+ var RuntimeIntentSchema = z.discriminatedUnion("kind", [
136
+ z.object({ kind: z.literal("permission_allow") }),
137
+ z.object({ kind: z.literal("permission_deny"), reason: z.string() }),
138
+ z.object({
139
+ kind: z.literal("question_answer"),
140
+ answers: z.record(z.string(), z.string())
141
+ }),
142
+ z.object({ kind: z.literal("pre_tool_allow") }),
143
+ z.object({ kind: z.literal("pre_tool_deny"), reason: z.string() }),
144
+ z.object({ kind: z.literal("stop_block"), reason: z.string() }),
145
+ z.object({ kind: z.literal("compact_block"), reason: z.string() })
146
+ ]);
147
+ var RuntimeDecisionSchema = z.object({
148
+ type: z.enum(["passthrough", "block", "json"]),
149
+ source: z.enum(["user", "timeout", "rule"]),
150
+ intent: RuntimeIntentSchema.optional(),
151
+ reason: z.string().optional(),
152
+ data: z.unknown().optional()
153
+ });
154
+ var AttachmentSchema = z.object({
155
+ runnerId: z.string(),
156
+ name: z.string().optional(),
157
+ slug: z.string().optional(),
158
+ executionTarget: z.string().optional(),
159
+ remoteInstanceId: z.string().optional()
160
+ });
161
+ var InstalledWorkflowSourceSchema = z.discriminatedUnion("kind", [
162
+ z.object({ kind: z.literal("builtin") }),
163
+ z.object({ kind: z.literal("marketplace-remote"), ref: z.string() }),
164
+ z.object({
165
+ kind: z.literal("marketplace-local"),
166
+ repoDir: z.string(),
167
+ workflowName: z.string()
168
+ }),
169
+ z.object({ kind: z.literal("filesystem"), path: z.string() }),
170
+ z.object({ kind: z.literal("unknown") })
171
+ ]);
172
+ var InstalledWorkflowSchema = z.object({
173
+ name: z.string().min(1),
174
+ version: z.string().optional(),
175
+ source: InstalledWorkflowSourceSchema
176
+ });
177
+ var AssignmentRejectedReasonSchema = z.enum([
178
+ "local_capacity",
179
+ "duplicate",
180
+ "malformed_assignment",
181
+ "workspace_unresolved",
182
+ "workspace_invalid"
183
+ ]);
184
+
185
+ export {
186
+ RunStatusSchema,
187
+ RunSchema,
188
+ TurnContinuationSchema,
189
+ TurnOutcomeSchema,
190
+ TurnSchema,
191
+ HardFailureCodeSchema,
192
+ ExhaustedCapSchema,
193
+ InterruptionSchema,
194
+ RunSpecSchema,
195
+ RuntimeIntentSchema,
196
+ RuntimeDecisionSchema,
197
+ AttachmentSchema,
198
+ InstalledWorkflowSourceSchema,
199
+ InstalledWorkflowSchema,
200
+ AssignmentRejectedReasonSchema
201
+ };
202
+ //# sourceMappingURL=chunk-HMYWICNI.js.map
@@ -0,0 +1,376 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Workflow-execution domain shapes as the domain docs define them
5
+ * (UBIQUITOUS_LANGUAGE.md, ADR 0014-0016): the Workflow Run, the Turn, and the
6
+ * Interruption a Run parks on when it needs a human. These are the values the
7
+ * frames in `frames.ts` carry; nothing here knows about the wire.
8
+ */
9
+
10
+ /**
11
+ * The outcome of a Workflow Run. Terminal: `completed`, `failed`, `cancelled`.
12
+ * Non-terminal: `running`, and `awaiting_attention` — suspended until a human
13
+ * replies. `blocked` and `exhausted` are no longer emitted (both route to
14
+ * `awaiting_attention`) but stay valid on historical rows.
15
+ */
16
+ declare const RunStatusSchema: z.ZodEnum<{
17
+ running: "running";
18
+ awaiting_attention: "awaiting_attention";
19
+ completed: "completed";
20
+ blocked: "blocked";
21
+ exhausted: "exhausted";
22
+ failed: "failed";
23
+ cancelled: "cancelled";
24
+ }>;
25
+ type RunStatus = z.infer<typeof RunStatusSchema>;
26
+ /**
27
+ * One execution of a whole Workflow — the loop spanning every Turn from start
28
+ * to a terminal Run Status. Many per Athena Session.
29
+ */
30
+ declare const RunSchema: z.ZodObject<{
31
+ runId: z.ZodString;
32
+ athenaSessionId: z.ZodString;
33
+ workflowName: z.ZodOptional<z.ZodString>;
34
+ goal: z.ZodOptional<z.ZodString>;
35
+ iteration: z.ZodInt;
36
+ maxIterations: z.ZodOptional<z.ZodInt>;
37
+ status: z.ZodEnum<{
38
+ running: "running";
39
+ awaiting_attention: "awaiting_attention";
40
+ completed: "completed";
41
+ blocked: "blocked";
42
+ exhausted: "exhausted";
43
+ failed: "failed";
44
+ cancelled: "cancelled";
45
+ }>;
46
+ stopReason: z.ZodOptional<z.ZodString>;
47
+ adapterSessionId: z.ZodOptional<z.ZodString>;
48
+ startedAt: z.ZodNumber;
49
+ endedAt: z.ZodOptional<z.ZodNumber>;
50
+ }, z.core.$strip>;
51
+ type Run = z.infer<typeof RunSchema>;
52
+ /**
53
+ * How a Turn relates to the Agent Session before it: a fresh spawn, a resume
54
+ * of the prior Agent Session (Nudge / Retry / human reply), or reuse of the
55
+ * one already running.
56
+ */
57
+ declare const TurnContinuationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
58
+ mode: z.ZodLiteral<"fresh">;
59
+ }, z.core.$strip>, z.ZodObject<{
60
+ mode: z.ZodLiteral<"resume">;
61
+ handle: z.ZodString;
62
+ }, z.core.$strip>, z.ZodObject<{
63
+ mode: z.ZodLiteral<"reuse-current">;
64
+ }, z.core.$strip>], "mode">;
65
+ type TurnContinuation = z.infer<typeof TurnContinuationSchema>;
66
+ /**
67
+ * The Terminal Outcome after a Turn: continue looping, stop with a terminal
68
+ * Run Status, or suspend in `awaiting_attention` (ADR 0004, ADR 0014 §7).
69
+ */
70
+ declare const TurnOutcomeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
71
+ kind: z.ZodLiteral<"continue">;
72
+ }, z.core.$strip>, z.ZodObject<{
73
+ kind: z.ZodLiteral<"stop">;
74
+ status: z.ZodEnum<{
75
+ running: "running";
76
+ awaiting_attention: "awaiting_attention";
77
+ completed: "completed";
78
+ blocked: "blocked";
79
+ exhausted: "exhausted";
80
+ failed: "failed";
81
+ cancelled: "cancelled";
82
+ }>;
83
+ stopReason: z.ZodOptional<z.ZodString>;
84
+ }, z.core.$strip>, z.ZodObject<{
85
+ kind: z.ZodLiteral<"suspend">;
86
+ status: z.ZodEnum<{
87
+ running: "running";
88
+ awaiting_attention: "awaiting_attention";
89
+ completed: "completed";
90
+ blocked: "blocked";
91
+ exhausted: "exhausted";
92
+ failed: "failed";
93
+ cancelled: "cancelled";
94
+ }>;
95
+ stopReason: z.ZodString;
96
+ }, z.core.$strip>], "kind">;
97
+ type TurnOutcome = z.infer<typeof TurnOutcomeSchema>;
98
+ /**
99
+ * One agent execution — a single `claude -p` invocation / one Codex
100
+ * `thread.run` — numbered by its Iteration within the Run.
101
+ */
102
+ declare const TurnSchema: z.ZodObject<{
103
+ runId: z.ZodString;
104
+ iteration: z.ZodInt;
105
+ continuation: z.ZodDiscriminatedUnion<[z.ZodObject<{
106
+ mode: z.ZodLiteral<"fresh">;
107
+ }, z.core.$strip>, z.ZodObject<{
108
+ mode: z.ZodLiteral<"resume">;
109
+ handle: z.ZodString;
110
+ }, z.core.$strip>, z.ZodObject<{
111
+ mode: z.ZodLiteral<"reuse-current">;
112
+ }, z.core.$strip>], "mode">;
113
+ adapterSessionId: z.ZodOptional<z.ZodString>;
114
+ startedAt: z.ZodNumber;
115
+ endedAt: z.ZodOptional<z.ZodNumber>;
116
+ outcome: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
117
+ kind: z.ZodLiteral<"continue">;
118
+ }, z.core.$strip>, z.ZodObject<{
119
+ kind: z.ZodLiteral<"stop">;
120
+ status: z.ZodEnum<{
121
+ running: "running";
122
+ awaiting_attention: "awaiting_attention";
123
+ completed: "completed";
124
+ blocked: "blocked";
125
+ exhausted: "exhausted";
126
+ failed: "failed";
127
+ cancelled: "cancelled";
128
+ }>;
129
+ stopReason: z.ZodOptional<z.ZodString>;
130
+ }, z.core.$strip>, z.ZodObject<{
131
+ kind: z.ZodLiteral<"suspend">;
132
+ status: z.ZodEnum<{
133
+ running: "running";
134
+ awaiting_attention: "awaiting_attention";
135
+ completed: "completed";
136
+ blocked: "blocked";
137
+ exhausted: "exhausted";
138
+ failed: "failed";
139
+ cancelled: "cancelled";
140
+ }>;
141
+ stopReason: z.ZodString;
142
+ }, z.core.$strip>], "kind">>;
143
+ }, z.core.$strip>;
144
+ type Turn = z.infer<typeof TurnSchema>;
145
+ /** A hard (non-transient) Turn failure class — see `failureTaxonomy.ts`. */
146
+ declare const HardFailureCodeSchema: z.ZodEnum<{
147
+ auth: "auth";
148
+ billing: "billing";
149
+ invalid_request: "invalid_request";
150
+ model_not_found: "model_not_found";
151
+ unclassified: "unclassified";
152
+ }>;
153
+ type HardFailureCode = z.infer<typeof HardFailureCodeSchema>;
154
+ /**
155
+ * A Run budget that can be exhausted (ADR 0014 §3-§4, §7; ADR 0018 §2, §10):
156
+ * the Retry cap, the Nudge cap, `maxIterations`, the Handover cap — a streak
157
+ * of unproductive Handovers — and the opt-in cumulative token budget.
158
+ */
159
+ declare const ExhaustedCapSchema: z.ZodEnum<{
160
+ retry: "retry";
161
+ nudge: "nudge";
162
+ iterations: "iterations";
163
+ handover: "handover";
164
+ tokens: "tokens";
165
+ }>;
166
+ type ExhaustedCap = z.infer<typeof ExhaustedCapSchema>;
167
+ /**
168
+ * Why a Run parked in `awaiting_attention` — the payload of a Needs-attention
169
+ * escalation. One of: a declared `NEEDS_HUMAN` marker (spelled
170
+ * `WORKFLOW_BLOCKED` before 0.6), an elicitation the agent raised
171
+ * (`AskUserQuestion`), a hard failure, or an exhausted cap/ceiling.
172
+ * Resolved by a human reply (`answer` for a question, `steer` otherwise),
173
+ * which resumes the intact Agent Session.
174
+ */
175
+ declare const InterruptionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
176
+ kind: z.ZodLiteral<"blocked">;
177
+ reason: z.ZodOptional<z.ZodString>;
178
+ message: z.ZodString;
179
+ }, z.core.$strip>, z.ZodObject<{
180
+ kind: z.ZodLiteral<"question">;
181
+ requestId: z.ZodOptional<z.ZodString>;
182
+ question: z.ZodOptional<z.ZodString>;
183
+ message: z.ZodString;
184
+ }, z.core.$strip>, z.ZodObject<{
185
+ kind: z.ZodLiteral<"hard_failure">;
186
+ code: z.ZodEnum<{
187
+ auth: "auth";
188
+ billing: "billing";
189
+ invalid_request: "invalid_request";
190
+ model_not_found: "model_not_found";
191
+ unclassified: "unclassified";
192
+ }>;
193
+ message: z.ZodString;
194
+ }, z.core.$strip>, z.ZodObject<{
195
+ kind: z.ZodLiteral<"cap_exhausted">;
196
+ cap: z.ZodEnum<{
197
+ retry: "retry";
198
+ nudge: "nudge";
199
+ iterations: "iterations";
200
+ handover: "handover";
201
+ tokens: "tokens";
202
+ }>;
203
+ limit: z.ZodOptional<z.ZodInt>;
204
+ resource: z.ZodOptional<z.ZodObject<{
205
+ cause: z.ZodEnum<{
206
+ iterations: "iterations";
207
+ tokens: "tokens";
208
+ context: "context";
209
+ restart: "restart";
210
+ }>;
211
+ limit: z.ZodNumber;
212
+ used: z.ZodNumber;
213
+ detail: z.ZodOptional<z.ZodString>;
214
+ checkpointPath: z.ZodOptional<z.ZodString>;
215
+ fresh: z.ZodBoolean;
216
+ }, z.core.$strip>>;
217
+ message: z.ZodString;
218
+ }, z.core.$strip>], "kind">;
219
+ type Interruption = z.infer<typeof InterruptionSchema>;
220
+ /**
221
+ * The requested shape of a Run, owned by the hub; the runner owns its
222
+ * realization. Every field is optional *on the wire* and unknown fields are
223
+ * kept (protocol §15): the runner's admission gate — not frame parsing — is
224
+ * where a missing `prompt` becomes a first-class `malformed_assignment`
225
+ * rejection, and orthogonal readers (artifact capture) read the raw spec.
226
+ */
227
+ declare const RunSpecSchema: z.ZodObject<{
228
+ prompt: z.ZodOptional<z.ZodString>;
229
+ athenaSessionId: z.ZodOptional<z.ZodString>;
230
+ adapterResumeSessionId: z.ZodOptional<z.ZodString>;
231
+ sessionId: z.ZodOptional<z.ZodString>;
232
+ projectDir: z.ZodOptional<z.ZodString>;
233
+ workflow: z.ZodOptional<z.ZodObject<{
234
+ source: z.ZodOptional<z.ZodString>;
235
+ ref: z.ZodOptional<z.ZodString>;
236
+ version: z.ZodOptional<z.ZodString>;
237
+ }, z.core.$loose>>;
238
+ harness: z.ZodOptional<z.ZodString>;
239
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
240
+ timeoutSec: z.ZodOptional<z.ZodNumber>;
241
+ callbackWsUrl: z.ZodOptional<z.ZodString>;
242
+ callbackToken: z.ZodOptional<z.ZodString>;
243
+ }, z.core.$loose>;
244
+ type RunSpec = z.infer<typeof RunSpecSchema>;
245
+ /** Typed semantic intent of a decision — the adapter maps it to hook output. */
246
+ declare const RuntimeIntentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
247
+ kind: z.ZodLiteral<"permission_allow">;
248
+ }, z.core.$strip>, z.ZodObject<{
249
+ kind: z.ZodLiteral<"permission_deny">;
250
+ reason: z.ZodString;
251
+ }, z.core.$strip>, z.ZodObject<{
252
+ kind: z.ZodLiteral<"question_answer">;
253
+ answers: z.ZodRecord<z.ZodString, z.ZodString>;
254
+ }, z.core.$strip>, z.ZodObject<{
255
+ kind: z.ZodLiteral<"pre_tool_allow">;
256
+ }, z.core.$strip>, z.ZodObject<{
257
+ kind: z.ZodLiteral<"pre_tool_deny">;
258
+ reason: z.ZodString;
259
+ }, z.core.$strip>, z.ZodObject<{
260
+ kind: z.ZodLiteral<"stop_block">;
261
+ reason: z.ZodString;
262
+ }, z.core.$strip>, z.ZodObject<{
263
+ kind: z.ZodLiteral<"compact_block">;
264
+ reason: z.ZodString;
265
+ }, z.core.$strip>], "kind">;
266
+ type RuntimeIntent = z.infer<typeof RuntimeIntentSchema>;
267
+ /**
268
+ * A delayed answer that resolves a prior runtime event needing user input
269
+ * (a permission request, a question). Correlated by `requestId` on the frame.
270
+ */
271
+ declare const RuntimeDecisionSchema: z.ZodObject<{
272
+ type: z.ZodEnum<{
273
+ passthrough: "passthrough";
274
+ block: "block";
275
+ json: "json";
276
+ }>;
277
+ source: z.ZodEnum<{
278
+ user: "user";
279
+ timeout: "timeout";
280
+ rule: "rule";
281
+ }>;
282
+ intent: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
283
+ kind: z.ZodLiteral<"permission_allow">;
284
+ }, z.core.$strip>, z.ZodObject<{
285
+ kind: z.ZodLiteral<"permission_deny">;
286
+ reason: z.ZodString;
287
+ }, z.core.$strip>, z.ZodObject<{
288
+ kind: z.ZodLiteral<"question_answer">;
289
+ answers: z.ZodRecord<z.ZodString, z.ZodString>;
290
+ }, z.core.$strip>, z.ZodObject<{
291
+ kind: z.ZodLiteral<"pre_tool_allow">;
292
+ }, z.core.$strip>, z.ZodObject<{
293
+ kind: z.ZodLiteral<"pre_tool_deny">;
294
+ reason: z.ZodString;
295
+ }, z.core.$strip>, z.ZodObject<{
296
+ kind: z.ZodLiteral<"stop_block">;
297
+ reason: z.ZodString;
298
+ }, z.core.$strip>, z.ZodObject<{
299
+ kind: z.ZodLiteral<"compact_block">;
300
+ reason: z.ZodString;
301
+ }, z.core.$strip>], "kind">>;
302
+ reason: z.ZodOptional<z.ZodString>;
303
+ data: z.ZodOptional<z.ZodUnknown>;
304
+ }, z.core.$strip>;
305
+ type RuntimeDecision = z.infer<typeof RuntimeDecisionSchema>;
306
+ /**
307
+ * The binding between a paired runner instance and one hub-side runner.
308
+ * Owned by the hub; the runner only mirrors it.
309
+ */
310
+ declare const AttachmentSchema: z.ZodObject<{
311
+ runnerId: z.ZodString;
312
+ name: z.ZodOptional<z.ZodString>;
313
+ slug: z.ZodOptional<z.ZodString>;
314
+ executionTarget: z.ZodOptional<z.ZodString>;
315
+ remoteInstanceId: z.ZodOptional<z.ZodString>;
316
+ }, z.core.$strip>;
317
+ type Attachment = z.infer<typeof AttachmentSchema>;
318
+ /**
319
+ * Where an installed Workflow came from, as the runner's Workflow store
320
+ * records it: shipped with the CLI (`builtin`), installed from a remote
321
+ * marketplace (`marketplace-remote`, by ref), from a marketplace checkout on
322
+ * disk (`marketplace-local`), copied from a path (`filesystem`), or installed
323
+ * by a CLI that did not record a source (`unknown`).
324
+ */
325
+ declare const InstalledWorkflowSourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
326
+ kind: z.ZodLiteral<"builtin">;
327
+ }, z.core.$strip>, z.ZodObject<{
328
+ kind: z.ZodLiteral<"marketplace-remote">;
329
+ ref: z.ZodString;
330
+ }, z.core.$strip>, z.ZodObject<{
331
+ kind: z.ZodLiteral<"marketplace-local">;
332
+ repoDir: z.ZodString;
333
+ workflowName: z.ZodString;
334
+ }, z.core.$strip>, z.ZodObject<{
335
+ kind: z.ZodLiteral<"filesystem">;
336
+ path: z.ZodString;
337
+ }, z.core.$strip>, z.ZodObject<{
338
+ kind: z.ZodLiteral<"unknown">;
339
+ }, z.core.$strip>], "kind">;
340
+ type InstalledWorkflowSource = z.infer<typeof InstalledWorkflowSourceSchema>;
341
+ /**
342
+ * One Workflow a runner can run: reported on the runner's `hello` and
343
+ * replaced wholesale by `workflows.changed` (protocol §17.4). `version` is
344
+ * absent when the Workflow declares none.
345
+ */
346
+ declare const InstalledWorkflowSchema: z.ZodObject<{
347
+ name: z.ZodString;
348
+ version: z.ZodOptional<z.ZodString>;
349
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
350
+ kind: z.ZodLiteral<"builtin">;
351
+ }, z.core.$strip>, z.ZodObject<{
352
+ kind: z.ZodLiteral<"marketplace-remote">;
353
+ ref: z.ZodString;
354
+ }, z.core.$strip>, z.ZodObject<{
355
+ kind: z.ZodLiteral<"marketplace-local">;
356
+ repoDir: z.ZodString;
357
+ workflowName: z.ZodString;
358
+ }, z.core.$strip>, z.ZodObject<{
359
+ kind: z.ZodLiteral<"filesystem">;
360
+ path: z.ZodString;
361
+ }, z.core.$strip>, z.ZodObject<{
362
+ kind: z.ZodLiteral<"unknown">;
363
+ }, z.core.$strip>], "kind">;
364
+ }, z.core.$strip>;
365
+ type InstalledWorkflow = z.infer<typeof InstalledWorkflowSchema>;
366
+ /** Why a runner declined a delivered assignment (protocol §10). */
367
+ declare const AssignmentRejectedReasonSchema: z.ZodEnum<{
368
+ local_capacity: "local_capacity";
369
+ duplicate: "duplicate";
370
+ malformed_assignment: "malformed_assignment";
371
+ workspace_unresolved: "workspace_unresolved";
372
+ workspace_invalid: "workspace_invalid";
373
+ }>;
374
+ type AssignmentRejectedReason = z.infer<typeof AssignmentRejectedReasonSchema>;
375
+
376
+ export { type AssignmentRejectedReason as A, type ExhaustedCap as E, type HardFailureCode as H, type InstalledWorkflow as I, type Run as R, type Turn as T, AssignmentRejectedReasonSchema as a, type Attachment as b, AttachmentSchema as c, ExhaustedCapSchema as d, HardFailureCodeSchema as e, InstalledWorkflowSchema as f, type InstalledWorkflowSource as g, InstalledWorkflowSourceSchema as h, type Interruption as i, InterruptionSchema as j, RunSchema as k, type RunSpec as l, RunSpecSchema as m, type RunStatus as n, RunStatusSchema as o, type RuntimeDecision as p, RuntimeDecisionSchema as q, type RuntimeIntent as r, RuntimeIntentSchema as s, type TurnContinuation as t, TurnContinuationSchema as u, type TurnOutcome as v, TurnOutcomeSchema as w, TurnSchema as x };