@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.
package/dist/v2.d.ts ADDED
@@ -0,0 +1,1283 @@
1
+ import { z } from 'zod';
2
+ import { f as InstalledWorkflowSchema } from './domain-B-kg2pa_.js';
3
+
4
+ /** Presentation of canonical fragment records; archive/cursor accounting always uses the original records. */
5
+ declare function readableHistory(records: HistoryRecord[]): HistoryRecord[];
6
+
7
+ declare const protocolVersion: {
8
+ readonly major: 2;
9
+ readonly minor: 1;
10
+ };
11
+ declare const conversationContinuationCapability = "conversation_continuation";
12
+ declare const abandonedConversationContinuationCapability = "abandoned_conversation_continuation";
13
+ declare const repositoryAccessCapability = "repository_checkout_v1";
14
+ /** The runner can install a Workflow named by a Run's install reference before it starts. */
15
+ declare const workflowInstallCapability = "workflow_install_v1";
16
+ /** Deployment-approved secret references, never secret values or process-control variables. */
17
+ declare const secretEnvironmentSchema: z.ZodRecord<z.ZodString, z.ZodString>;
18
+ declare const permissionAnswerSchema: z.ZodObject<{
19
+ kind: z.ZodLiteral<"permission">;
20
+ decision: z.ZodEnum<{
21
+ allow: "allow";
22
+ deny: "deny";
23
+ }>;
24
+ reason: z.ZodOptional<z.ZodString>;
25
+ }, z.core.$strict>;
26
+ declare const sequence: z.ZodNumber;
27
+ declare const scopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
28
+ visibility: z.ZodLiteral<"organization">;
29
+ }, z.core.$strict>, z.ZodObject<{
30
+ visibility: z.ZodLiteral<"private">;
31
+ ownerUserId: z.ZodString;
32
+ }, z.core.$strict>], "visibility">;
33
+ /** Workflows a runner can run; reported on hello and replaced wholesale by `workflows.changed`. */
34
+ declare const installedWorkflowsSchema: z.ZodArray<z.ZodObject<{
35
+ name: z.ZodString;
36
+ version: z.ZodOptional<z.ZodString>;
37
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
38
+ kind: z.ZodLiteral<"builtin">;
39
+ }, z.core.$strip>, z.ZodObject<{
40
+ kind: z.ZodLiteral<"marketplace-remote">;
41
+ ref: z.ZodString;
42
+ }, z.core.$strip>, z.ZodObject<{
43
+ kind: z.ZodLiteral<"marketplace-local">;
44
+ repoDir: z.ZodString;
45
+ workflowName: z.ZodString;
46
+ }, z.core.$strip>, z.ZodObject<{
47
+ kind: z.ZodLiteral<"filesystem">;
48
+ path: z.ZodString;
49
+ }, z.core.$strip>, z.ZodObject<{
50
+ kind: z.ZodLiteral<"unknown">;
51
+ }, z.core.$strip>], "kind">;
52
+ }, z.core.$strip>>;
53
+ /** The coding agents a Run can use. */
54
+ declare const harnessSchema: z.ZodEnum<{
55
+ "claude-code": "claude-code";
56
+ codex: "codex";
57
+ }>;
58
+ type Harness = z.infer<typeof harnessSchema>;
59
+ /** Whether one harness can start a Run on a Runner: its CLI is installed, and it is signed in. */
60
+ declare const harnessReadinessSchema: z.ZodObject<{
61
+ installed: z.ZodBoolean;
62
+ signedIn: z.ZodBoolean;
63
+ }, z.core.$strict>;
64
+ type HarnessReadiness = z.infer<typeof harnessReadinessSchema>;
65
+ /**
66
+ * Readiness (root ADR-0005): connected is not ready. A Runner reports each harness it checked, on hello and again
67
+ * with `readiness.changed`. A harness it does not report, like the whole field from an older runner, is unknown,
68
+ * never "not ready".
69
+ */
70
+ declare const runnerReadinessSchema: z.ZodObject<{
71
+ 'claude-code': z.ZodOptional<z.ZodObject<{
72
+ installed: z.ZodBoolean;
73
+ signedIn: z.ZodBoolean;
74
+ }, z.core.$strict>>;
75
+ codex: z.ZodOptional<z.ZodObject<{
76
+ installed: z.ZodBoolean;
77
+ signedIn: z.ZodBoolean;
78
+ }, z.core.$strict>>;
79
+ }, z.core.$strict>;
80
+ type RunnerReadiness = z.infer<typeof runnerReadinessSchema>;
81
+ /** The command that closes a harness's Readiness gap on the Runner's machine, or undefined when it is ready. */
82
+ declare function readinessFixCommand(harness: Harness, readiness: HarnessReadiness): string | undefined;
83
+ /** What brings a Runner below the Hub's minimum version up to date. Runner services never update themselves. */
84
+ declare const runnerUpdateCommand = "npm i -g @drisp/cli";
85
+ declare const interruptionSchema: z.ZodObject<{
86
+ interruptionId: z.ZodString;
87
+ revision: z.ZodNumber;
88
+ kind: z.ZodEnum<{
89
+ permission: "permission";
90
+ question: "question";
91
+ guidance: "guidance";
92
+ recovery: "recovery";
93
+ }>;
94
+ message: z.ZodString;
95
+ requestId: z.ZodOptional<z.ZodString>;
96
+ }, z.core.$strict>;
97
+ /** The Workflow a Run resolved on its runner: the registry name and, when the Workflow declares one, its version. */
98
+ declare const workflowIdentitySchema: z.ZodObject<{
99
+ name: z.ZodString;
100
+ version: z.ZodOptional<z.ZodString>;
101
+ }, z.core.$strict>;
102
+ type WorkflowIdentity = z.infer<typeof workflowIdentitySchema>;
103
+ declare const controlRecordSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
104
+ kind: z.ZodLiteral<"workflows.changed">;
105
+ workflows: z.ZodArray<z.ZodObject<{
106
+ name: z.ZodString;
107
+ version: z.ZodOptional<z.ZodString>;
108
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
109
+ kind: z.ZodLiteral<"builtin">;
110
+ }, z.core.$strip>, z.ZodObject<{
111
+ kind: z.ZodLiteral<"marketplace-remote">;
112
+ ref: z.ZodString;
113
+ }, z.core.$strip>, z.ZodObject<{
114
+ kind: z.ZodLiteral<"marketplace-local">;
115
+ repoDir: z.ZodString;
116
+ workflowName: z.ZodString;
117
+ }, z.core.$strip>, z.ZodObject<{
118
+ kind: z.ZodLiteral<"filesystem">;
119
+ path: z.ZodString;
120
+ }, z.core.$strip>, z.ZodObject<{
121
+ kind: z.ZodLiteral<"unknown">;
122
+ }, z.core.$strip>], "kind">;
123
+ }, z.core.$strip>>;
124
+ }, z.core.$strict>, z.ZodObject<{
125
+ kind: z.ZodLiteral<"readiness.changed">;
126
+ readiness: z.ZodObject<{
127
+ 'claude-code': z.ZodOptional<z.ZodObject<{
128
+ installed: z.ZodBoolean;
129
+ signedIn: z.ZodBoolean;
130
+ }, z.core.$strict>>;
131
+ codex: z.ZodOptional<z.ZodObject<{
132
+ installed: z.ZodBoolean;
133
+ signedIn: z.ZodBoolean;
134
+ }, z.core.$strict>>;
135
+ }, z.core.$strict>;
136
+ }, z.core.$strict>, z.ZodObject<{
137
+ kind: z.ZodLiteral<"assignment.accepted">;
138
+ runId: z.ZodString;
139
+ attemptId: z.ZodString;
140
+ }, z.core.$strict>, z.ZodObject<{
141
+ kind: z.ZodLiteral<"assignment.rejected">;
142
+ runId: z.ZodString;
143
+ attemptId: z.ZodString;
144
+ reason: z.ZodString;
145
+ }, z.core.$strict>, z.ZodObject<{
146
+ workflow: z.ZodOptional<z.ZodObject<{
147
+ name: z.ZodString;
148
+ version: z.ZodOptional<z.ZodString>;
149
+ }, z.core.$strict>>;
150
+ runId: z.ZodString;
151
+ attemptId: z.ZodString;
152
+ executionRevision: z.ZodNumber;
153
+ emittedAt: z.ZodISODateTime;
154
+ kind: z.ZodLiteral<"run.started">;
155
+ }, z.core.$strict>, z.ZodObject<{
156
+ runId: z.ZodString;
157
+ attemptId: z.ZodString;
158
+ executionRevision: z.ZodNumber;
159
+ emittedAt: z.ZodISODateTime;
160
+ kind: z.ZodLiteral<"run.resumed">;
161
+ }, z.core.$strict>, z.ZodObject<{
162
+ interruption: z.ZodObject<{
163
+ interruptionId: z.ZodString;
164
+ revision: z.ZodNumber;
165
+ kind: z.ZodEnum<{
166
+ permission: "permission";
167
+ question: "question";
168
+ guidance: "guidance";
169
+ recovery: "recovery";
170
+ }>;
171
+ message: z.ZodString;
172
+ requestId: z.ZodOptional<z.ZodString>;
173
+ }, z.core.$strict>;
174
+ occupancy: z.ZodEnum<{
175
+ held: "held";
176
+ released: "released";
177
+ }>;
178
+ historyThrough: z.ZodNumber;
179
+ continuation: z.ZodDiscriminatedUnion<[z.ZodObject<{
180
+ kind: z.ZodLiteral<"live_request">;
181
+ }, z.core.$strict>, z.ZodObject<{
182
+ kind: z.ZodLiteral<"local_checkpoint">;
183
+ checkpointId: z.ZodString;
184
+ }, z.core.$strict>, z.ZodObject<{
185
+ kind: z.ZodLiteral<"portable_checkpoint">;
186
+ checkpointId: z.ZodString;
187
+ }, z.core.$strict>, z.ZodObject<{
188
+ kind: z.ZodLiteral<"repair_required">;
189
+ detail: z.ZodString;
190
+ }, z.core.$strict>], "kind">;
191
+ runId: z.ZodString;
192
+ attemptId: z.ZodString;
193
+ executionRevision: z.ZodNumber;
194
+ emittedAt: z.ZodISODateTime;
195
+ kind: z.ZodLiteral<"run.attention">;
196
+ }, z.core.$strict>, z.ZodObject<{
197
+ status: z.ZodEnum<{
198
+ completed: "completed";
199
+ failed: "failed";
200
+ cancelled: "cancelled";
201
+ }>;
202
+ historyThrough: z.ZodNumber;
203
+ workspaceUnavailable: z.ZodOptional<z.ZodLiteral<true>>;
204
+ runId: z.ZodString;
205
+ attemptId: z.ZodString;
206
+ executionRevision: z.ZodNumber;
207
+ emittedAt: z.ZodISODateTime;
208
+ kind: z.ZodLiteral<"run.finished">;
209
+ }, z.core.$strict>, z.ZodObject<{
210
+ kind: z.ZodLiteral<"command.applied">;
211
+ runId: z.ZodString;
212
+ attemptId: z.ZodString;
213
+ commandId: z.ZodString;
214
+ }, z.core.$strict>, z.ZodObject<{
215
+ kind: z.ZodLiteral<"command.rejected">;
216
+ runId: z.ZodString;
217
+ attemptId: z.ZodString;
218
+ commandId: z.ZodString;
219
+ reason: z.ZodString;
220
+ }, z.core.$strict>, z.ZodObject<{
221
+ kind: z.ZodLiteral<"revoked_not_started">;
222
+ runId: z.ZodString;
223
+ attemptId: z.ZodString;
224
+ }, z.core.$strict>], "kind">;
225
+ /** Git references are data, never command options or shell expressions. */
226
+ declare const repositoryRefSchema: z.ZodString;
227
+ declare const repositoryWorkingDirectorySchema: z.ZodString;
228
+ declare const repositoryBindingSchema: z.ZodObject<{
229
+ defaultRef: z.ZodString;
230
+ workingDirectory: z.ZodString;
231
+ setupCommands: z.ZodArray<z.ZodString>;
232
+ revision: z.ZodNumber;
233
+ enabled: z.ZodBoolean;
234
+ repositoryId: z.ZodNumber;
235
+ installationId: z.ZodNumber;
236
+ owner: z.ZodString;
237
+ name: z.ZodString;
238
+ id: z.ZodString;
239
+ label: z.ZodString;
240
+ }, z.core.$strict>;
241
+ /** Resolved by the Hub; no credentials or client-selected clone URLs belong here. */
242
+ declare const repositorySourceSchema: z.ZodObject<{
243
+ ref: z.ZodString;
244
+ commitSha: z.ZodString;
245
+ branch: z.ZodString;
246
+ workingDirectory: z.ZodString;
247
+ setupCommands: z.ZodArray<z.ZodString>;
248
+ configRevision: z.ZodNumber;
249
+ repositoryId: z.ZodNumber;
250
+ installationId: z.ZodNumber;
251
+ owner: z.ZodString;
252
+ name: z.ZodString;
253
+ bindingId: z.ZodString;
254
+ }, z.core.$strict>;
255
+ type RepositoryBinding = z.infer<typeof repositoryBindingSchema>;
256
+ type RepositorySource = z.infer<typeof repositorySourceSchema>;
257
+ /**
258
+ * A Workflow named by a Run. A bare string is the registry name, exactly as before. The object form adds an install
259
+ * reference: `source` is an `owner/repo` GitHub marketplace slug (never a path or URL; segments start alphanumeric,
260
+ * the same rule as tests/fixtures/workflow-refs.json) and `version` is matched exactly. `ref` parses so that the Hub
261
+ * and Runner can refuse it with a specific reason; it is not honoured yet.
262
+ */
263
+ declare const workflowSourceSchema: z.ZodString;
264
+ declare const workflowReferenceSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
265
+ name: z.ZodString;
266
+ source: z.ZodOptional<z.ZodString>;
267
+ ref: z.ZodOptional<z.ZodString>;
268
+ version: z.ZodOptional<z.ZodString>;
269
+ }, z.core.$strict>]>;
270
+ type WorkflowReference = z.infer<typeof workflowReferenceSchema>;
271
+ type WorkflowInstallReference = Exclude<WorkflowReference, string> & {
272
+ source: string;
273
+ };
274
+ /** The registry name a Run's `spec.workflow` asks for, in either spelling. */
275
+ declare const workflowName: (workflow: WorkflowReference | undefined) => string | undefined;
276
+ /** The install reference, present only for the object form that carries a `source`. */
277
+ declare const installReference: (workflow: WorkflowReference | undefined) => WorkflowInstallReference | undefined;
278
+ /** Structural equality of two `spec.workflow` values; never `===`, which is false for equal objects. */
279
+ declare const sameWorkflow: (a: WorkflowReference | undefined, b: WorkflowReference | undefined) => boolean;
280
+ declare const runSpecSchema: z.ZodObject<{
281
+ prompt: z.ZodString;
282
+ projectDir: z.ZodString;
283
+ harness: z.ZodEnum<{
284
+ "claude-code": "claude-code";
285
+ codex: "codex";
286
+ }>;
287
+ workflow: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
288
+ name: z.ZodString;
289
+ source: z.ZodOptional<z.ZodString>;
290
+ ref: z.ZodOptional<z.ZodString>;
291
+ version: z.ZodOptional<z.ZodString>;
292
+ }, z.core.$strict>]>>;
293
+ repository: z.ZodOptional<z.ZodObject<{
294
+ ref: z.ZodString;
295
+ commitSha: z.ZodString;
296
+ branch: z.ZodString;
297
+ workingDirectory: z.ZodString;
298
+ setupCommands: z.ZodArray<z.ZodString>;
299
+ configRevision: z.ZodNumber;
300
+ repositoryId: z.ZodNumber;
301
+ installationId: z.ZodNumber;
302
+ owner: z.ZodString;
303
+ name: z.ZodString;
304
+ bindingId: z.ZodString;
305
+ }, z.core.$strict>>;
306
+ }, z.core.$strict>;
307
+ declare const commandSchema: z.ZodObject<{
308
+ commandId: z.ZodString;
309
+ hubEpoch: z.ZodString;
310
+ runId: z.ZodString;
311
+ expectedRecordRevision: z.ZodOptional<z.ZodNumber>;
312
+ intent: z.ZodDiscriminatedUnion<[z.ZodObject<{
313
+ kind: z.ZodLiteral<"start">;
314
+ sessionId: z.ZodString;
315
+ runnerId: z.ZodOptional<z.ZodString>;
316
+ computeProfileId: z.ZodOptional<z.ZodString>;
317
+ scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
318
+ visibility: z.ZodLiteral<"organization">;
319
+ }, z.core.$strict>, z.ZodObject<{
320
+ visibility: z.ZodLiteral<"private">;
321
+ ownerUserId: z.ZodString;
322
+ }, z.core.$strict>], "visibility">;
323
+ spec: z.ZodObject<{
324
+ prompt: z.ZodString;
325
+ projectDir: z.ZodString;
326
+ harness: z.ZodEnum<{
327
+ "claude-code": "claude-code";
328
+ codex: "codex";
329
+ }>;
330
+ workflow: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
331
+ name: z.ZodString;
332
+ source: z.ZodOptional<z.ZodString>;
333
+ ref: z.ZodOptional<z.ZodString>;
334
+ version: z.ZodOptional<z.ZodString>;
335
+ }, z.core.$strict>]>>;
336
+ repository: z.ZodOptional<z.ZodObject<{
337
+ ref: z.ZodString;
338
+ commitSha: z.ZodString;
339
+ branch: z.ZodString;
340
+ workingDirectory: z.ZodString;
341
+ setupCommands: z.ZodArray<z.ZodString>;
342
+ configRevision: z.ZodNumber;
343
+ repositoryId: z.ZodNumber;
344
+ installationId: z.ZodNumber;
345
+ owner: z.ZodString;
346
+ name: z.ZodString;
347
+ bindingId: z.ZodString;
348
+ }, z.core.$strict>>;
349
+ }, z.core.$strict>;
350
+ }, z.core.$strict>, z.ZodObject<{
351
+ kind: z.ZodLiteral<"cancel">;
352
+ }, z.core.$strict>, z.ZodObject<{
353
+ kind: z.ZodLiteral<"abandon">;
354
+ }, z.core.$strict>, z.ZodObject<{
355
+ kind: z.ZodLiteral<"steer">;
356
+ text: z.ZodString;
357
+ }, z.core.$strict>, z.ZodObject<{
358
+ kind: z.ZodLiteral<"answer">;
359
+ interruptionId: z.ZodString;
360
+ expectedInterruptionRevision: z.ZodNumber;
361
+ requestId: z.ZodOptional<z.ZodString>;
362
+ answer: z.ZodJSONSchema;
363
+ }, z.core.$strict>, z.ZodObject<{
364
+ kind: z.ZodLiteral<"resume">;
365
+ interruptionId: z.ZodString;
366
+ guidance: z.ZodOptional<z.ZodString>;
367
+ }, z.core.$strict>], "kind">;
368
+ }, z.core.$strict>;
369
+ declare const grantSchema: z.ZodObject<{
370
+ commandId: z.ZodString;
371
+ hubEpoch: z.ZodString;
372
+ runId: z.ZodString;
373
+ sessionId: z.ZodString;
374
+ runnerId: z.ZodString;
375
+ installationId: z.ZodString;
376
+ attemptId: z.ZodString;
377
+ generation: z.ZodNumber;
378
+ baseExecutionRevision: z.ZodNumber;
379
+ baseHistorySeq: z.ZodNumber;
380
+ cloudHistoryThrough: z.ZodNumber;
381
+ purpose: z.ZodEnum<{
382
+ start: "start";
383
+ resume: "resume";
384
+ }>;
385
+ spec: z.ZodObject<{
386
+ prompt: z.ZodString;
387
+ projectDir: z.ZodString;
388
+ harness: z.ZodEnum<{
389
+ "claude-code": "claude-code";
390
+ codex: "codex";
391
+ }>;
392
+ workflow: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
393
+ name: z.ZodString;
394
+ source: z.ZodOptional<z.ZodString>;
395
+ ref: z.ZodOptional<z.ZodString>;
396
+ version: z.ZodOptional<z.ZodString>;
397
+ }, z.core.$strict>]>>;
398
+ repository: z.ZodOptional<z.ZodObject<{
399
+ ref: z.ZodString;
400
+ commitSha: z.ZodString;
401
+ branch: z.ZodString;
402
+ workingDirectory: z.ZodString;
403
+ setupCommands: z.ZodArray<z.ZodString>;
404
+ configRevision: z.ZodNumber;
405
+ repositoryId: z.ZodNumber;
406
+ installationId: z.ZodNumber;
407
+ owner: z.ZodString;
408
+ name: z.ZodString;
409
+ bindingId: z.ZodString;
410
+ }, z.core.$strict>>;
411
+ }, z.core.$strict>;
412
+ continuation: z.ZodOptional<z.ZodJSONSchema>;
413
+ previousRun: z.ZodOptional<z.ZodObject<{
414
+ runId: z.ZodString;
415
+ executionRevision: z.ZodNumber;
416
+ historyProduced: z.ZodNumber;
417
+ closeReason: z.ZodOptional<z.ZodLiteral<"abandoned">>;
418
+ checkpoint: z.ZodOptional<z.ZodObject<{
419
+ checkpointId: z.ZodString;
420
+ checksum: z.ZodString;
421
+ }, z.core.$strict>>;
422
+ }, z.core.$strict>>;
423
+ checkpoint: z.ZodOptional<z.ZodObject<{
424
+ checkpointId: z.ZodString;
425
+ checksum: z.ZodString;
426
+ }, z.core.$strict>>;
427
+ }, z.core.$strict>;
428
+ declare const historyRecordSchema: z.ZodObject<{
429
+ eventId: z.ZodString;
430
+ attemptId: z.ZodString;
431
+ emittedAt: z.ZodISODateTime;
432
+ kind: z.ZodString;
433
+ data: z.ZodJSONSchema;
434
+ }, z.core.$strict>;
435
+ declare const runnerFrameSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
436
+ type: z.ZodLiteral<"hello">;
437
+ role: z.ZodLiteral<"runner">;
438
+ protocol: z.ZodObject<{
439
+ major: z.ZodLiteral<2>;
440
+ minor: z.ZodNumber;
441
+ }, z.core.$strict>;
442
+ runnerId: z.ZodString;
443
+ installationId: z.ZodString;
444
+ softwareVersion: z.ZodString;
445
+ capabilities: z.ZodArray<z.ZodString>;
446
+ workflows: z.ZodOptional<z.ZodArray<z.ZodObject<{
447
+ name: z.ZodString;
448
+ version: z.ZodOptional<z.ZodString>;
449
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
450
+ kind: z.ZodLiteral<"builtin">;
451
+ }, z.core.$strip>, z.ZodObject<{
452
+ kind: z.ZodLiteral<"marketplace-remote">;
453
+ ref: z.ZodString;
454
+ }, z.core.$strip>, z.ZodObject<{
455
+ kind: z.ZodLiteral<"marketplace-local">;
456
+ repoDir: z.ZodString;
457
+ workflowName: z.ZodString;
458
+ }, z.core.$strip>, z.ZodObject<{
459
+ kind: z.ZodLiteral<"filesystem">;
460
+ path: z.ZodString;
461
+ }, z.core.$strip>, z.ZodObject<{
462
+ kind: z.ZodLiteral<"unknown">;
463
+ }, z.core.$strip>], "kind">;
464
+ }, z.core.$strip>>>;
465
+ readiness: z.ZodOptional<z.ZodObject<{
466
+ 'claude-code': z.ZodOptional<z.ZodObject<{
467
+ installed: z.ZodBoolean;
468
+ signedIn: z.ZodBoolean;
469
+ }, z.core.$strict>>;
470
+ codex: z.ZodOptional<z.ZodObject<{
471
+ installed: z.ZodBoolean;
472
+ signedIn: z.ZodBoolean;
473
+ }, z.core.$strict>>;
474
+ }, z.core.$strict>>;
475
+ control: z.ZodObject<{
476
+ firstRetainedSeq: z.ZodNumber;
477
+ lastProducedSeq: z.ZodNumber;
478
+ }, z.core.$strict>;
479
+ }, z.core.$strict>, z.ZodObject<{
480
+ type: z.ZodLiteral<"control.batch">;
481
+ firstSeq: z.ZodNumber;
482
+ records: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
483
+ kind: z.ZodLiteral<"workflows.changed">;
484
+ workflows: z.ZodArray<z.ZodObject<{
485
+ name: z.ZodString;
486
+ version: z.ZodOptional<z.ZodString>;
487
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
488
+ kind: z.ZodLiteral<"builtin">;
489
+ }, z.core.$strip>, z.ZodObject<{
490
+ kind: z.ZodLiteral<"marketplace-remote">;
491
+ ref: z.ZodString;
492
+ }, z.core.$strip>, z.ZodObject<{
493
+ kind: z.ZodLiteral<"marketplace-local">;
494
+ repoDir: z.ZodString;
495
+ workflowName: z.ZodString;
496
+ }, z.core.$strip>, z.ZodObject<{
497
+ kind: z.ZodLiteral<"filesystem">;
498
+ path: z.ZodString;
499
+ }, z.core.$strip>, z.ZodObject<{
500
+ kind: z.ZodLiteral<"unknown">;
501
+ }, z.core.$strip>], "kind">;
502
+ }, z.core.$strip>>;
503
+ }, z.core.$strict>, z.ZodObject<{
504
+ kind: z.ZodLiteral<"readiness.changed">;
505
+ readiness: z.ZodObject<{
506
+ 'claude-code': z.ZodOptional<z.ZodObject<{
507
+ installed: z.ZodBoolean;
508
+ signedIn: z.ZodBoolean;
509
+ }, z.core.$strict>>;
510
+ codex: z.ZodOptional<z.ZodObject<{
511
+ installed: z.ZodBoolean;
512
+ signedIn: z.ZodBoolean;
513
+ }, z.core.$strict>>;
514
+ }, z.core.$strict>;
515
+ }, z.core.$strict>, z.ZodObject<{
516
+ kind: z.ZodLiteral<"assignment.accepted">;
517
+ runId: z.ZodString;
518
+ attemptId: z.ZodString;
519
+ }, z.core.$strict>, z.ZodObject<{
520
+ kind: z.ZodLiteral<"assignment.rejected">;
521
+ runId: z.ZodString;
522
+ attemptId: z.ZodString;
523
+ reason: z.ZodString;
524
+ }, z.core.$strict>, z.ZodObject<{
525
+ workflow: z.ZodOptional<z.ZodObject<{
526
+ name: z.ZodString;
527
+ version: z.ZodOptional<z.ZodString>;
528
+ }, z.core.$strict>>;
529
+ runId: z.ZodString;
530
+ attemptId: z.ZodString;
531
+ executionRevision: z.ZodNumber;
532
+ emittedAt: z.ZodISODateTime;
533
+ kind: z.ZodLiteral<"run.started">;
534
+ }, z.core.$strict>, z.ZodObject<{
535
+ runId: z.ZodString;
536
+ attemptId: z.ZodString;
537
+ executionRevision: z.ZodNumber;
538
+ emittedAt: z.ZodISODateTime;
539
+ kind: z.ZodLiteral<"run.resumed">;
540
+ }, z.core.$strict>, z.ZodObject<{
541
+ interruption: z.ZodObject<{
542
+ interruptionId: z.ZodString;
543
+ revision: z.ZodNumber;
544
+ kind: z.ZodEnum<{
545
+ permission: "permission";
546
+ question: "question";
547
+ guidance: "guidance";
548
+ recovery: "recovery";
549
+ }>;
550
+ message: z.ZodString;
551
+ requestId: z.ZodOptional<z.ZodString>;
552
+ }, z.core.$strict>;
553
+ occupancy: z.ZodEnum<{
554
+ held: "held";
555
+ released: "released";
556
+ }>;
557
+ historyThrough: z.ZodNumber;
558
+ continuation: z.ZodDiscriminatedUnion<[z.ZodObject<{
559
+ kind: z.ZodLiteral<"live_request">;
560
+ }, z.core.$strict>, z.ZodObject<{
561
+ kind: z.ZodLiteral<"local_checkpoint">;
562
+ checkpointId: z.ZodString;
563
+ }, z.core.$strict>, z.ZodObject<{
564
+ kind: z.ZodLiteral<"portable_checkpoint">;
565
+ checkpointId: z.ZodString;
566
+ }, z.core.$strict>, z.ZodObject<{
567
+ kind: z.ZodLiteral<"repair_required">;
568
+ detail: z.ZodString;
569
+ }, z.core.$strict>], "kind">;
570
+ runId: z.ZodString;
571
+ attemptId: z.ZodString;
572
+ executionRevision: z.ZodNumber;
573
+ emittedAt: z.ZodISODateTime;
574
+ kind: z.ZodLiteral<"run.attention">;
575
+ }, z.core.$strict>, z.ZodObject<{
576
+ status: z.ZodEnum<{
577
+ completed: "completed";
578
+ failed: "failed";
579
+ cancelled: "cancelled";
580
+ }>;
581
+ historyThrough: z.ZodNumber;
582
+ workspaceUnavailable: z.ZodOptional<z.ZodLiteral<true>>;
583
+ runId: z.ZodString;
584
+ attemptId: z.ZodString;
585
+ executionRevision: z.ZodNumber;
586
+ emittedAt: z.ZodISODateTime;
587
+ kind: z.ZodLiteral<"run.finished">;
588
+ }, z.core.$strict>, z.ZodObject<{
589
+ kind: z.ZodLiteral<"command.applied">;
590
+ runId: z.ZodString;
591
+ attemptId: z.ZodString;
592
+ commandId: z.ZodString;
593
+ }, z.core.$strict>, z.ZodObject<{
594
+ kind: z.ZodLiteral<"command.rejected">;
595
+ runId: z.ZodString;
596
+ attemptId: z.ZodString;
597
+ commandId: z.ZodString;
598
+ reason: z.ZodString;
599
+ }, z.core.$strict>, z.ZodObject<{
600
+ kind: z.ZodLiteral<"revoked_not_started">;
601
+ runId: z.ZodString;
602
+ attemptId: z.ZodString;
603
+ }, z.core.$strict>], "kind">>;
604
+ }, z.core.$strict>, z.ZodObject<{
605
+ type: z.ZodLiteral<"history.batch">;
606
+ runId: z.ZodString;
607
+ firstSeq: z.ZodNumber;
608
+ records: z.ZodArray<z.ZodObject<{
609
+ eventId: z.ZodString;
610
+ attemptId: z.ZodString;
611
+ emittedAt: z.ZodISODateTime;
612
+ kind: z.ZodString;
613
+ data: z.ZodJSONSchema;
614
+ }, z.core.$strict>>;
615
+ }, z.core.$strict>, z.ZodObject<{
616
+ type: z.ZodLiteral<"ping">;
617
+ nonce: z.ZodString;
618
+ }, z.core.$strict>, z.ZodObject<{
619
+ type: z.ZodLiteral<"reconcile.page">;
620
+ inventoryId: z.ZodDefault<z.ZodString>;
621
+ page: z.ZodDefault<z.ZodNumber>;
622
+ complete: z.ZodBoolean;
623
+ runs: z.ZodArray<z.ZodObject<{
624
+ runId: z.ZodString;
625
+ attemptId: z.ZodString;
626
+ executionRevision: z.ZodNumber;
627
+ phase: z.ZodEnum<{
628
+ recovery: "recovery";
629
+ admitted: "admitted";
630
+ prepared: "prepared";
631
+ executing: "executing";
632
+ parked: "parked";
633
+ terminal: "terminal";
634
+ }>;
635
+ }, z.core.$strict>>;
636
+ }, z.core.$strict>], "type">;
637
+ type InstalledWorkflow = z.infer<typeof InstalledWorkflowSchema>;
638
+ type Scope = z.infer<typeof scopeSchema>;
639
+ type Command = z.infer<typeof commandSchema>;
640
+ type Grant = z.infer<typeof grantSchema>;
641
+ type ControlRecord = z.infer<typeof controlRecordSchema>;
642
+ type RunnerFrame = z.infer<typeof runnerFrameSchema>;
643
+ type HistoryRecord = z.infer<typeof historyRecordSchema>;
644
+ type ExecutionFact = Extract<ControlRecord, {
645
+ executionRevision: number;
646
+ }>;
647
+ declare const runViewSchema: z.ZodObject<{
648
+ runId: z.ZodString;
649
+ sessionId: z.ZodString;
650
+ runnerId: z.ZodString;
651
+ computeProfileId: z.ZodOptional<z.ZodString>;
652
+ scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
653
+ visibility: z.ZodLiteral<"organization">;
654
+ }, z.core.$strict>, z.ZodObject<{
655
+ visibility: z.ZodLiteral<"private">;
656
+ ownerUserId: z.ZodString;
657
+ }, z.core.$strict>], "visibility">;
658
+ recordRevision: z.ZodNumber;
659
+ label: z.ZodOptional<z.ZodString>;
660
+ workflow: z.ZodOptional<z.ZodObject<{
661
+ name: z.ZodString;
662
+ version: z.ZodOptional<z.ZodString>;
663
+ }, z.core.$strict>>;
664
+ execution: z.ZodNullable<z.ZodObject<{
665
+ status: z.ZodEnum<{
666
+ completed: "completed";
667
+ failed: "failed";
668
+ cancelled: "cancelled";
669
+ running: "running";
670
+ awaiting_attention: "awaiting_attention";
671
+ }>;
672
+ revision: z.ZodNumber;
673
+ attemptId: z.ZodString;
674
+ occupancy: z.ZodEnum<{
675
+ held: "held";
676
+ released: "released";
677
+ }>;
678
+ startedAt: z.ZodOptional<z.ZodISODateTime>;
679
+ endedAt: z.ZodOptional<z.ZodISODateTime>;
680
+ interruption: z.ZodOptional<z.ZodObject<{
681
+ interruptionId: z.ZodString;
682
+ revision: z.ZodNumber;
683
+ kind: z.ZodEnum<{
684
+ permission: "permission";
685
+ question: "question";
686
+ guidance: "guidance";
687
+ recovery: "recovery";
688
+ }>;
689
+ message: z.ZodString;
690
+ requestId: z.ZodOptional<z.ZodString>;
691
+ }, z.core.$strict>>;
692
+ }, z.core.$strip>>;
693
+ scheduling: z.ZodEnum<{
694
+ admitted: "admitted";
695
+ queued: "queued";
696
+ dispatching: "dispatching";
697
+ idle: "idle";
698
+ }>;
699
+ closed: z.ZodBoolean;
700
+ closeReason: z.ZodOptional<z.ZodString>;
701
+ cancellation: z.ZodOptional<z.ZodString>;
702
+ pendingResume: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
703
+ kind: z.ZodLiteral<"start">;
704
+ sessionId: z.ZodString;
705
+ runnerId: z.ZodOptional<z.ZodString>;
706
+ computeProfileId: z.ZodOptional<z.ZodString>;
707
+ scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
708
+ visibility: z.ZodLiteral<"organization">;
709
+ }, z.core.$strict>, z.ZodObject<{
710
+ visibility: z.ZodLiteral<"private">;
711
+ ownerUserId: z.ZodString;
712
+ }, z.core.$strict>], "visibility">;
713
+ spec: z.ZodObject<{
714
+ prompt: z.ZodString;
715
+ projectDir: z.ZodString;
716
+ harness: z.ZodEnum<{
717
+ "claude-code": "claude-code";
718
+ codex: "codex";
719
+ }>;
720
+ workflow: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
721
+ name: z.ZodString;
722
+ source: z.ZodOptional<z.ZodString>;
723
+ ref: z.ZodOptional<z.ZodString>;
724
+ version: z.ZodOptional<z.ZodString>;
725
+ }, z.core.$strict>]>>;
726
+ repository: z.ZodOptional<z.ZodObject<{
727
+ ref: z.ZodString;
728
+ commitSha: z.ZodString;
729
+ branch: z.ZodString;
730
+ workingDirectory: z.ZodString;
731
+ setupCommands: z.ZodArray<z.ZodString>;
732
+ configRevision: z.ZodNumber;
733
+ repositoryId: z.ZodNumber;
734
+ installationId: z.ZodNumber;
735
+ owner: z.ZodString;
736
+ name: z.ZodString;
737
+ bindingId: z.ZodString;
738
+ }, z.core.$strict>>;
739
+ }, z.core.$strict>;
740
+ }, z.core.$strict>, z.ZodObject<{
741
+ kind: z.ZodLiteral<"cancel">;
742
+ }, z.core.$strict>, z.ZodObject<{
743
+ kind: z.ZodLiteral<"abandon">;
744
+ }, z.core.$strict>, z.ZodObject<{
745
+ kind: z.ZodLiteral<"steer">;
746
+ text: z.ZodString;
747
+ }, z.core.$strict>, z.ZodObject<{
748
+ kind: z.ZodLiteral<"answer">;
749
+ interruptionId: z.ZodString;
750
+ expectedInterruptionRevision: z.ZodNumber;
751
+ requestId: z.ZodOptional<z.ZodString>;
752
+ answer: z.ZodJSONSchema;
753
+ }, z.core.$strict>, z.ZodObject<{
754
+ kind: z.ZodLiteral<"resume">;
755
+ interruptionId: z.ZodString;
756
+ guidance: z.ZodOptional<z.ZodString>;
757
+ }, z.core.$strict>], "kind">>;
758
+ runnerStopped: z.ZodOptional<z.ZodBoolean>;
759
+ canAbandon: z.ZodOptional<z.ZodBoolean>;
760
+ historyThrough: z.ZodNumber;
761
+ expectedHistoryThrough: z.ZodOptional<z.ZodNumber>;
762
+ createdAt: z.ZodNumber;
763
+ checkpoint: z.ZodOptional<z.ZodObject<{
764
+ id: z.ZodString;
765
+ state: z.ZodEnum<{
766
+ pending: "pending";
767
+ ready: "ready";
768
+ }>;
769
+ checksum: z.ZodOptional<z.ZodString>;
770
+ }, z.core.$strip>>;
771
+ }, z.core.$strip>;
772
+ type RunView = z.infer<typeof runViewSchema>;
773
+ declare const clientFrameSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
774
+ type: z.ZodLiteral<"watch">;
775
+ hubEpoch: z.ZodString;
776
+ runIds: z.ZodArray<z.ZodString>;
777
+ }, z.core.$strict>, z.ZodObject<{
778
+ type: z.ZodLiteral<"watch.ack">;
779
+ subscriptionId: z.ZodString;
780
+ through: z.ZodNumber;
781
+ }, z.core.$strict>, z.ZodObject<{
782
+ type: z.ZodLiteral<"command.submit">;
783
+ command: z.ZodObject<{
784
+ commandId: z.ZodString;
785
+ hubEpoch: z.ZodString;
786
+ runId: z.ZodString;
787
+ expectedRecordRevision: z.ZodOptional<z.ZodNumber>;
788
+ intent: z.ZodDiscriminatedUnion<[z.ZodObject<{
789
+ kind: z.ZodLiteral<"start">;
790
+ sessionId: z.ZodString;
791
+ runnerId: z.ZodOptional<z.ZodString>;
792
+ computeProfileId: z.ZodOptional<z.ZodString>;
793
+ scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
794
+ visibility: z.ZodLiteral<"organization">;
795
+ }, z.core.$strict>, z.ZodObject<{
796
+ visibility: z.ZodLiteral<"private">;
797
+ ownerUserId: z.ZodString;
798
+ }, z.core.$strict>], "visibility">;
799
+ spec: z.ZodObject<{
800
+ prompt: z.ZodString;
801
+ projectDir: z.ZodString;
802
+ harness: z.ZodEnum<{
803
+ "claude-code": "claude-code";
804
+ codex: "codex";
805
+ }>;
806
+ workflow: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
807
+ name: z.ZodString;
808
+ source: z.ZodOptional<z.ZodString>;
809
+ ref: z.ZodOptional<z.ZodString>;
810
+ version: z.ZodOptional<z.ZodString>;
811
+ }, z.core.$strict>]>>;
812
+ repository: z.ZodOptional<z.ZodObject<{
813
+ ref: z.ZodString;
814
+ commitSha: z.ZodString;
815
+ branch: z.ZodString;
816
+ workingDirectory: z.ZodString;
817
+ setupCommands: z.ZodArray<z.ZodString>;
818
+ configRevision: z.ZodNumber;
819
+ repositoryId: z.ZodNumber;
820
+ installationId: z.ZodNumber;
821
+ owner: z.ZodString;
822
+ name: z.ZodString;
823
+ bindingId: z.ZodString;
824
+ }, z.core.$strict>>;
825
+ }, z.core.$strict>;
826
+ }, z.core.$strict>, z.ZodObject<{
827
+ kind: z.ZodLiteral<"cancel">;
828
+ }, z.core.$strict>, z.ZodObject<{
829
+ kind: z.ZodLiteral<"abandon">;
830
+ }, z.core.$strict>, z.ZodObject<{
831
+ kind: z.ZodLiteral<"steer">;
832
+ text: z.ZodString;
833
+ }, z.core.$strict>, z.ZodObject<{
834
+ kind: z.ZodLiteral<"answer">;
835
+ interruptionId: z.ZodString;
836
+ expectedInterruptionRevision: z.ZodNumber;
837
+ requestId: z.ZodOptional<z.ZodString>;
838
+ answer: z.ZodJSONSchema;
839
+ }, z.core.$strict>, z.ZodObject<{
840
+ kind: z.ZodLiteral<"resume">;
841
+ interruptionId: z.ZodString;
842
+ guidance: z.ZodOptional<z.ZodString>;
843
+ }, z.core.$strict>], "kind">;
844
+ }, z.core.$strict>;
845
+ }, z.core.$strict>, z.ZodObject<{
846
+ type: z.ZodLiteral<"ping">;
847
+ nonce: z.ZodString;
848
+ }, z.core.$strict>], "type">;
849
+ /** Stable JSON encoding for duplicate detection; independent of object key insertion order. */
850
+ declare function canonicalJson(value: unknown): string;
851
+ declare const checkpointPathSchema: z.ZodString;
852
+ declare const checkpointSchema: z.ZodObject<{
853
+ version: z.ZodLiteral<1>;
854
+ checkpointId: z.ZodString;
855
+ orgId: z.ZodString;
856
+ phase: z.ZodEnum<{
857
+ parked: "parked";
858
+ terminal: "terminal";
859
+ }>;
860
+ runId: z.ZodString;
861
+ sessionId: z.ZodString;
862
+ sourceAttemptId: z.ZodString;
863
+ executionRevision: z.ZodNumber;
864
+ historyProduced: z.ZodNumber;
865
+ historyAck: z.ZodNumber;
866
+ grant: z.ZodObject<{
867
+ commandId: z.ZodString;
868
+ hubEpoch: z.ZodString;
869
+ runId: z.ZodString;
870
+ sessionId: z.ZodString;
871
+ runnerId: z.ZodString;
872
+ installationId: z.ZodString;
873
+ attemptId: z.ZodString;
874
+ generation: z.ZodNumber;
875
+ baseExecutionRevision: z.ZodNumber;
876
+ baseHistorySeq: z.ZodNumber;
877
+ cloudHistoryThrough: z.ZodNumber;
878
+ purpose: z.ZodEnum<{
879
+ start: "start";
880
+ resume: "resume";
881
+ }>;
882
+ spec: z.ZodObject<{
883
+ prompt: z.ZodString;
884
+ projectDir: z.ZodString;
885
+ harness: z.ZodEnum<{
886
+ "claude-code": "claude-code";
887
+ codex: "codex";
888
+ }>;
889
+ workflow: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
890
+ name: z.ZodString;
891
+ source: z.ZodOptional<z.ZodString>;
892
+ ref: z.ZodOptional<z.ZodString>;
893
+ version: z.ZodOptional<z.ZodString>;
894
+ }, z.core.$strict>]>>;
895
+ repository: z.ZodOptional<z.ZodObject<{
896
+ ref: z.ZodString;
897
+ commitSha: z.ZodString;
898
+ branch: z.ZodString;
899
+ workingDirectory: z.ZodString;
900
+ setupCommands: z.ZodArray<z.ZodString>;
901
+ configRevision: z.ZodNumber;
902
+ repositoryId: z.ZodNumber;
903
+ installationId: z.ZodNumber;
904
+ owner: z.ZodString;
905
+ name: z.ZodString;
906
+ bindingId: z.ZodString;
907
+ }, z.core.$strict>>;
908
+ }, z.core.$strict>;
909
+ continuation: z.ZodOptional<z.ZodJSONSchema>;
910
+ previousRun: z.ZodOptional<z.ZodObject<{
911
+ runId: z.ZodString;
912
+ executionRevision: z.ZodNumber;
913
+ historyProduced: z.ZodNumber;
914
+ closeReason: z.ZodOptional<z.ZodLiteral<"abandoned">>;
915
+ checkpoint: z.ZodOptional<z.ZodObject<{
916
+ checkpointId: z.ZodString;
917
+ checksum: z.ZodString;
918
+ }, z.core.$strict>>;
919
+ }, z.core.$strict>>;
920
+ checkpoint: z.ZodOptional<z.ZodObject<{
921
+ checkpointId: z.ZodString;
922
+ checksum: z.ZodString;
923
+ }, z.core.$strict>>;
924
+ }, z.core.$strict>;
925
+ gitHead: z.ZodString;
926
+ gitBase: z.ZodOptional<z.ZodString>;
927
+ gitBundle: z.ZodString;
928
+ indexPatch: z.ZodString;
929
+ files: z.ZodArray<z.ZodObject<{
930
+ path: z.ZodString;
931
+ content: z.ZodString;
932
+ executable: z.ZodBoolean;
933
+ }, z.core.$strict>>;
934
+ deleted: z.ZodArray<z.ZodString>;
935
+ sessionRows: z.ZodArray<z.ZodObject<{
936
+ kind: z.ZodString;
937
+ id: z.ZodString;
938
+ payload: z.ZodString;
939
+ }, z.core.$strict>>;
940
+ history: z.ZodArray<z.ZodObject<{
941
+ seq: z.ZodNumber;
942
+ record: z.ZodObject<{
943
+ eventId: z.ZodString;
944
+ attemptId: z.ZodString;
945
+ emittedAt: z.ZodISODateTime;
946
+ kind: z.ZodString;
947
+ data: z.ZodJSONSchema;
948
+ }, z.core.$strict>;
949
+ }, z.core.$strict>>;
950
+ }, z.core.$strict>;
951
+ type Checkpoint = z.infer<typeof checkpointSchema>;
952
+ /**
953
+ * Connect (root ADR-0005): a member asks for a short, one-use Connect code bound to them and their Team, and a
954
+ * machine redeems it for a Runner credential. Codes use an alphabet without look-alike characters and are
955
+ * shown as `XXXX-XXXX`; redemption accepts either form.
956
+ */
957
+ declare const connectCodeAlphabet = "ABCDEFGHJKMNPQRSTUVWXYZ23456789";
958
+ declare const connectCodeSchema: z.ZodString;
959
+ declare const connectCodeRequestSchema: z.ZodObject<{
960
+ hubEpoch: z.ZodString;
961
+ }, z.core.$strict>;
962
+ declare const connectCodeResponseSchema: z.ZodObject<{
963
+ code: z.ZodString;
964
+ expiresAt: z.ZodNumber;
965
+ }, z.core.$strict>;
966
+ /** What a machine presents when it redeems a Connect code. The Hub uses it to name the Runner, never for authority. */
967
+ declare const connectRedeemRequestSchema: z.ZodObject<{
968
+ code: z.ZodString;
969
+ installationId: z.ZodString;
970
+ hostname: z.ZodString;
971
+ os: z.ZodString;
972
+ softwareVersion: z.ZodString;
973
+ }, z.core.$strict>;
974
+ /** Everything the machine needs to run as this Runner; `token` is the only copy of the credential. */
975
+ declare const connectRedeemResponseSchema: z.ZodObject<{
976
+ orgId: z.ZodString;
977
+ hubEpoch: z.ZodString;
978
+ runnerId: z.ZodString;
979
+ installationId: z.ZodString;
980
+ name: z.ZodString;
981
+ token: z.ZodString;
982
+ credentialId: z.ZodString;
983
+ expiresAt: z.ZodNumber;
984
+ }, z.core.$strict>;
985
+ /**
986
+ * One Runner per machine per Team (root ADR-0005): redeeming from an installation that already has a Runner in the
987
+ * code's Team is refused with `409` and this body, naming the Runner it already has. No credential is minted and
988
+ * the code is not spent.
989
+ */
990
+ declare const connectAlreadyConnectedSchema: z.ZodObject<{
991
+ error: z.ZodLiteral<"runner_already_connected">;
992
+ orgId: z.ZodString;
993
+ runnerId: z.ZodString;
994
+ name: z.ZodString;
995
+ }, z.core.$strict>;
996
+ /** Personal: serves only the member who connected it. Team: serves every member (only an admin widens it). */
997
+ declare const audienceSchema: z.ZodEnum<{
998
+ personal: "personal";
999
+ team: "team";
1000
+ }>;
1001
+ /** One entry of `GET /runners`. Runners enrolled before Connect, and managed Runners, carry no owner fields. */
1002
+ declare const runnerListEntrySchema: z.ZodObject<{
1003
+ id: z.ZodString;
1004
+ online: z.ZodNumber;
1005
+ capacity: z.ZodNumber;
1006
+ managed: z.ZodNumber;
1007
+ draining: z.ZodNumber;
1008
+ stopped: z.ZodNumber;
1009
+ name: z.ZodNullable<z.ZodString>;
1010
+ connectedBy: z.ZodNullable<z.ZodString>;
1011
+ audience: z.ZodNullable<z.ZodEnum<{
1012
+ personal: "personal";
1013
+ team: "team";
1014
+ }>>;
1015
+ softwareVersion: z.ZodNullable<z.ZodString>;
1016
+ lastSeen: z.ZodNullable<z.ZodNumber>;
1017
+ workflows: z.ZodOptional<z.ZodArray<z.ZodObject<{
1018
+ name: z.ZodString;
1019
+ version: z.ZodOptional<z.ZodString>;
1020
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
1021
+ kind: z.ZodLiteral<"builtin">;
1022
+ }, z.core.$strip>, z.ZodObject<{
1023
+ kind: z.ZodLiteral<"marketplace-remote">;
1024
+ ref: z.ZodString;
1025
+ }, z.core.$strip>, z.ZodObject<{
1026
+ kind: z.ZodLiteral<"marketplace-local">;
1027
+ repoDir: z.ZodString;
1028
+ workflowName: z.ZodString;
1029
+ }, z.core.$strip>, z.ZodObject<{
1030
+ kind: z.ZodLiteral<"filesystem">;
1031
+ path: z.ZodString;
1032
+ }, z.core.$strip>, z.ZodObject<{
1033
+ kind: z.ZodLiteral<"unknown">;
1034
+ }, z.core.$strip>], "kind">;
1035
+ }, z.core.$strip>>>;
1036
+ readOnly: z.ZodOptional<z.ZodBoolean>;
1037
+ readiness: z.ZodOptional<z.ZodObject<{
1038
+ 'claude-code': z.ZodOptional<z.ZodObject<{
1039
+ installed: z.ZodBoolean;
1040
+ signedIn: z.ZodBoolean;
1041
+ }, z.core.$strict>>;
1042
+ codex: z.ZodOptional<z.ZodObject<{
1043
+ installed: z.ZodBoolean;
1044
+ signedIn: z.ZodBoolean;
1045
+ }, z.core.$strict>>;
1046
+ }, z.core.$strict>>;
1047
+ updateRequired: z.ZodOptional<z.ZodBoolean>;
1048
+ needsOwner: z.ZodOptional<z.ZodBoolean>;
1049
+ }, z.core.$strip>;
1050
+ /** Where a member's Runs go when nothing else decides: a Team-audience Runner or a cloud compute profile. */
1051
+ declare const teamDefaultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1052
+ kind: z.ZodLiteral<"runner">;
1053
+ runnerId: z.ZodString;
1054
+ }, z.core.$strict>, z.ZodObject<{
1055
+ kind: z.ZodLiteral<"profile">;
1056
+ profileId: z.ZodString;
1057
+ }, z.core.$strict>], "kind">;
1058
+ /** `POST /team-default` (admin only); `null` clears it. */
1059
+ declare const teamDefaultRequestSchema: z.ZodObject<{
1060
+ hubEpoch: z.ZodString;
1061
+ teamDefault: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
1062
+ kind: z.ZodLiteral<"runner">;
1063
+ runnerId: z.ZodString;
1064
+ }, z.core.$strict>, z.ZodObject<{
1065
+ kind: z.ZodLiteral<"profile">;
1066
+ profileId: z.ZodString;
1067
+ }, z.core.$strict>], "kind">>;
1068
+ }, z.core.$strict>;
1069
+ /**
1070
+ * `POST /runners/<id>`: rename, set how many Runs it takes in parallel, or change its Audience. Its connected-by
1071
+ * member may rename it, set its capacity and narrow it to Personal; only an admin may widen it to Team.
1072
+ */
1073
+ declare const runnerUpdateRequestSchema: z.ZodObject<{
1074
+ hubEpoch: z.ZodString;
1075
+ name: z.ZodOptional<z.ZodString>;
1076
+ capacity: z.ZodOptional<z.ZodNumber>;
1077
+ audience: z.ZodOptional<z.ZodEnum<{
1078
+ personal: "personal";
1079
+ team: "team";
1080
+ }>>;
1081
+ }, z.core.$strict>;
1082
+ /** Where the viewer's next Run goes when it names no Runner (root ADR-0005), or why it cannot start. */
1083
+ declare const runsGoToSchema: z.ZodUnion<readonly [z.ZodObject<{
1084
+ via: z.ZodLiteral<"personal">;
1085
+ runnerId: z.ZodString;
1086
+ }, z.core.$strict>, z.ZodObject<{
1087
+ via: z.ZodLiteral<"team_default">;
1088
+ runnerId: z.ZodString;
1089
+ }, z.core.$strict>, z.ZodObject<{
1090
+ via: z.ZodLiteral<"team_default">;
1091
+ profileId: z.ZodString;
1092
+ }, z.core.$strict>, z.ZodObject<{
1093
+ via: z.ZodLiteral<"none">;
1094
+ reason: z.ZodEnum<{
1095
+ no_runner_available: "no_runner_available";
1096
+ runner_needs_owner: "runner_needs_owner";
1097
+ }>;
1098
+ }, z.core.$strict>]>;
1099
+ declare const runnerListSchema: z.ZodObject<{
1100
+ capabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
1101
+ historyRetentionDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1102
+ viewer: z.ZodOptional<z.ZodObject<{
1103
+ userId: z.ZodString;
1104
+ admin: z.ZodBoolean;
1105
+ }, z.core.$strip>>;
1106
+ teamDefault: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
1107
+ kind: z.ZodLiteral<"runner">;
1108
+ runnerId: z.ZodString;
1109
+ }, z.core.$strict>, z.ZodObject<{
1110
+ kind: z.ZodLiteral<"profile">;
1111
+ profileId: z.ZodString;
1112
+ }, z.core.$strict>], "kind">>>;
1113
+ runsGoTo: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
1114
+ via: z.ZodLiteral<"personal">;
1115
+ runnerId: z.ZodString;
1116
+ }, z.core.$strict>, z.ZodObject<{
1117
+ via: z.ZodLiteral<"team_default">;
1118
+ runnerId: z.ZodString;
1119
+ }, z.core.$strict>, z.ZodObject<{
1120
+ via: z.ZodLiteral<"team_default">;
1121
+ profileId: z.ZodString;
1122
+ }, z.core.$strict>, z.ZodObject<{
1123
+ via: z.ZodLiteral<"none">;
1124
+ reason: z.ZodEnum<{
1125
+ no_runner_available: "no_runner_available";
1126
+ runner_needs_owner: "runner_needs_owner";
1127
+ }>;
1128
+ }, z.core.$strict>]>>;
1129
+ minimumRunnerVersion: z.ZodOptional<z.ZodString>;
1130
+ runners: z.ZodArray<z.ZodObject<{
1131
+ id: z.ZodString;
1132
+ online: z.ZodNumber;
1133
+ capacity: z.ZodNumber;
1134
+ managed: z.ZodNumber;
1135
+ draining: z.ZodNumber;
1136
+ stopped: z.ZodNumber;
1137
+ name: z.ZodNullable<z.ZodString>;
1138
+ connectedBy: z.ZodNullable<z.ZodString>;
1139
+ audience: z.ZodNullable<z.ZodEnum<{
1140
+ personal: "personal";
1141
+ team: "team";
1142
+ }>>;
1143
+ softwareVersion: z.ZodNullable<z.ZodString>;
1144
+ lastSeen: z.ZodNullable<z.ZodNumber>;
1145
+ workflows: z.ZodOptional<z.ZodArray<z.ZodObject<{
1146
+ name: z.ZodString;
1147
+ version: z.ZodOptional<z.ZodString>;
1148
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
1149
+ kind: z.ZodLiteral<"builtin">;
1150
+ }, z.core.$strip>, z.ZodObject<{
1151
+ kind: z.ZodLiteral<"marketplace-remote">;
1152
+ ref: z.ZodString;
1153
+ }, z.core.$strip>, z.ZodObject<{
1154
+ kind: z.ZodLiteral<"marketplace-local">;
1155
+ repoDir: z.ZodString;
1156
+ workflowName: z.ZodString;
1157
+ }, z.core.$strip>, z.ZodObject<{
1158
+ kind: z.ZodLiteral<"filesystem">;
1159
+ path: z.ZodString;
1160
+ }, z.core.$strip>, z.ZodObject<{
1161
+ kind: z.ZodLiteral<"unknown">;
1162
+ }, z.core.$strip>], "kind">;
1163
+ }, z.core.$strip>>>;
1164
+ readOnly: z.ZodOptional<z.ZodBoolean>;
1165
+ readiness: z.ZodOptional<z.ZodObject<{
1166
+ 'claude-code': z.ZodOptional<z.ZodObject<{
1167
+ installed: z.ZodBoolean;
1168
+ signedIn: z.ZodBoolean;
1169
+ }, z.core.$strict>>;
1170
+ codex: z.ZodOptional<z.ZodObject<{
1171
+ installed: z.ZodBoolean;
1172
+ signedIn: z.ZodBoolean;
1173
+ }, z.core.$strict>>;
1174
+ }, z.core.$strict>>;
1175
+ updateRequired: z.ZodOptional<z.ZodBoolean>;
1176
+ needsOwner: z.ZodOptional<z.ZodBoolean>;
1177
+ }, z.core.$strip>>;
1178
+ profiles: z.ZodArray<z.ZodObject<{
1179
+ id: z.ZodString;
1180
+ label: z.ZodString;
1181
+ projectDir: z.ZodString;
1182
+ repositoryRequired: z.ZodOptional<z.ZodBoolean>;
1183
+ workflows: z.ZodOptional<z.ZodArray<z.ZodString>>;
1184
+ workflowSources: z.ZodOptional<z.ZodArray<z.ZodString>>;
1185
+ }, z.core.$strip>>;
1186
+ }, z.core.$strip>;
1187
+ type ConnectRedeemRequest = z.infer<typeof connectRedeemRequestSchema>;
1188
+ /**
1189
+ * Disconnect (root ADR-0005) ends a Runner's membership in its Team. From Settings, a member posts it for a Runner
1190
+ * they connected (an admin, for any Runner) to `/runners/{id}/disconnect`; from the machine, the Runner posts it
1191
+ * with its own credential to `/runner/disconnect`. A Disconnected Runner's next contact is refused with
1192
+ * `runner_disconnected` (HTTP 410, or an `error` frame on a live instance socket).
1193
+ */
1194
+ declare const runnerDisconnectRequestSchema: z.ZodObject<{
1195
+ hubEpoch: z.ZodString;
1196
+ }, z.core.$strict>;
1197
+ /** A body that carries only the Hub epoch it was made against: Disconnect and adopt. */
1198
+ declare const hubEpochRequestSchema: z.ZodObject<{
1199
+ hubEpoch: z.ZodString;
1200
+ }, z.core.$strict>;
1201
+ /** What a Disconnect will stop, for its confirmation. Runs the viewer cannot see are counted, never named. */
1202
+ declare const runnerDisconnectPreviewSchema: z.ZodObject<{
1203
+ runnerId: z.ZodString;
1204
+ name: z.ZodNullable<z.ZodString>;
1205
+ runs: z.ZodArray<z.ZodObject<{
1206
+ runId: z.ZodString;
1207
+ label: z.ZodOptional<z.ZodString>;
1208
+ state: z.ZodEnum<{
1209
+ parked: "parked";
1210
+ queued: "queued";
1211
+ working: "working";
1212
+ }>;
1213
+ }, z.core.$strip>>;
1214
+ hiddenRuns: z.ZodNumber;
1215
+ }, z.core.$strip>;
1216
+ declare const runnerDisconnectResponseSchema: z.ZodObject<{
1217
+ disconnected: z.ZodLiteral<true>;
1218
+ stoppedRuns: z.ZodNumber;
1219
+ }, z.core.$strip>;
1220
+ /**
1221
+ * `POST /runners/{id}/adopt` (admin only): take over a Runner paused as "Needs an owner" as its connected-by
1222
+ * member, so it serves again with its Audience, name and capacity unchanged. Answers the updated Runner-list
1223
+ * entry; a Runner that is not paused answers `runner_not_paused`.
1224
+ */
1225
+ declare const runnerAdoptRequestSchema: z.ZodObject<{
1226
+ hubEpoch: z.ZodString;
1227
+ }, z.core.$strict>;
1228
+ type RunnerAdoptRequest = z.infer<typeof runnerAdoptRequestSchema>;
1229
+ type RunnerDisconnectPreview = z.infer<typeof runnerDisconnectPreviewSchema>;
1230
+ type RunnerDisconnectResponse = z.infer<typeof runnerDisconnectResponseSchema>;
1231
+ type ConnectRedeemResponse = z.infer<typeof connectRedeemResponseSchema>;
1232
+ type ConnectAlreadyConnected = z.infer<typeof connectAlreadyConnectedSchema>;
1233
+ type RunnerListEntry = z.infer<typeof runnerListEntrySchema>;
1234
+ type RunnerList = z.infer<typeof runnerListSchema>;
1235
+ /**
1236
+ * The machine-initiated door of Connect (root ADR-0005). A machine with no credential asks for a Connect code
1237
+ * (`connectStart`), prints it with the approval URL and polls with its secret `deviceCode` (`connectPoll`). A
1238
+ * signed-in member sees what is asking (`connectPending`) and approves it into one of their Teams with an
1239
+ * Audience (`connectApprove`), or denies it (`connectDeny`). The approved poll answers a `connectRedeem` credential.
1240
+ */
1241
+ declare const connectStartRequestSchema: z.ZodObject<{
1242
+ installationId: z.ZodString;
1243
+ softwareVersion: z.ZodString;
1244
+ hostname: z.ZodString;
1245
+ os: z.ZodString;
1246
+ }, z.core.$strict>;
1247
+ declare const connectStartResponseSchema: z.ZodObject<{
1248
+ deviceCode: z.ZodString;
1249
+ code: z.ZodString;
1250
+ expiresAt: z.ZodNumber;
1251
+ intervalSec: z.ZodNumber;
1252
+ verificationUrl: z.ZodString;
1253
+ }, z.core.$strict>;
1254
+ declare const connectPollRequestSchema: z.ZodObject<{
1255
+ deviceCode: z.ZodString;
1256
+ }, z.core.$strict>;
1257
+ /** What the approval page shows about the machine: what the machine says about itself, never authority. */
1258
+ declare const connectPendingResponseSchema: z.ZodObject<{
1259
+ hostname: z.ZodString;
1260
+ os: z.ZodString;
1261
+ softwareVersion: z.ZodString;
1262
+ requestedAt: z.ZodNumber;
1263
+ expiresAt: z.ZodNumber;
1264
+ }, z.core.$strict>;
1265
+ declare const connectApproveRequestSchema: z.ZodObject<{
1266
+ code: z.ZodString;
1267
+ audience: z.ZodEnum<{
1268
+ personal: "personal";
1269
+ team: "team";
1270
+ }>;
1271
+ hubEpoch: z.ZodOptional<z.ZodString>;
1272
+ }, z.core.$strict>;
1273
+ declare const connectDenyRequestSchema: z.ZodObject<{
1274
+ code: z.ZodString;
1275
+ }, z.core.$strict>;
1276
+ type Audience = z.infer<typeof audienceSchema>;
1277
+ type ConnectStartRequest = z.infer<typeof connectStartRequestSchema>;
1278
+ type ConnectStartResponse = z.infer<typeof connectStartResponseSchema>;
1279
+ type ConnectPendingResponse = z.infer<typeof connectPendingResponseSchema>;
1280
+ type TeamDefault = z.infer<typeof teamDefaultSchema>;
1281
+ type RunsGoTo = z.infer<typeof runsGoToSchema>;
1282
+
1283
+ export { type Audience, type Checkpoint, type Command, type ConnectAlreadyConnected, type ConnectPendingResponse, type ConnectRedeemRequest, type ConnectRedeemResponse, type ConnectStartRequest, type ConnectStartResponse, type ControlRecord, type ExecutionFact, type Grant, type Harness, type HarnessReadiness, type HistoryRecord, type InstalledWorkflow, type RepositoryBinding, type RepositorySource, type RunView, type RunnerAdoptRequest, type RunnerDisconnectPreview, type RunnerDisconnectResponse, type RunnerFrame, type RunnerList, type RunnerListEntry, type RunnerReadiness, type RunsGoTo, type Scope, type TeamDefault, type WorkflowIdentity, type WorkflowInstallReference, type WorkflowReference, abandonedConversationContinuationCapability, audienceSchema, canonicalJson, checkpointPathSchema, checkpointSchema, clientFrameSchema, commandSchema, connectAlreadyConnectedSchema, connectApproveRequestSchema, connectCodeAlphabet, connectCodeRequestSchema, connectCodeResponseSchema, connectCodeSchema, connectDenyRequestSchema, connectPendingResponseSchema, connectPollRequestSchema, connectRedeemRequestSchema, connectRedeemResponseSchema, connectStartRequestSchema, connectStartResponseSchema, controlRecordSchema, conversationContinuationCapability, grantSchema, harnessReadinessSchema, harnessSchema, historyRecordSchema, hubEpochRequestSchema, installReference, installedWorkflowsSchema, interruptionSchema, permissionAnswerSchema, protocolVersion, readableHistory, readinessFixCommand, repositoryAccessCapability, repositoryBindingSchema, repositoryRefSchema, repositorySourceSchema, repositoryWorkingDirectorySchema, runSpecSchema, runViewSchema, runnerAdoptRequestSchema, runnerDisconnectPreviewSchema, runnerDisconnectRequestSchema, runnerDisconnectResponseSchema, runnerFrameSchema, runnerListEntrySchema, runnerListSchema, runnerReadinessSchema, runnerUpdateCommand, runnerUpdateRequestSchema, runsGoToSchema, sameWorkflow, scopeSchema, secretEnvironmentSchema, sequence, teamDefaultRequestSchema, teamDefaultSchema, workflowIdentitySchema, workflowInstallCapability, workflowName, workflowReferenceSchema, workflowSourceSchema };