@nylorun/core 0.3.0-beta → 0.5.0-beta

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.
Files changed (58) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/compatibility.d.ts +48 -1
  3. package/dist/compatibility.js +192 -1
  4. package/dist/contracts.d.ts +562 -19
  5. package/dist/contracts.js +442 -29
  6. package/dist/define.d.ts +9 -3
  7. package/dist/define.js +3 -0
  8. package/dist/definition/assemble.js +35 -0
  9. package/dist/definition/bind-tool.js +3 -0
  10. package/dist/definition/bound.d.ts +3 -0
  11. package/dist/definition/builder.d.ts +5 -5
  12. package/dist/definition/declaration.d.ts +2 -2
  13. package/dist/definition/declaration.js +13 -1
  14. package/dist/definition/delegate.d.ts +35 -0
  15. package/dist/definition/delegate.js +72 -0
  16. package/dist/definition/from.js +15 -2
  17. package/dist/definition/helpers.d.ts +1 -1
  18. package/dist/definition/helpers.js +8 -1
  19. package/dist/definition/manifest.js +3 -0
  20. package/dist/definition/variant.d.ts +7 -0
  21. package/dist/definition/variant.js +87 -0
  22. package/dist/definition/workflow/build.d.ts +38 -0
  23. package/dist/definition/workflow/build.js +62 -0
  24. package/dist/definition/workflow/chain.d.ts +49 -0
  25. package/dist/definition/workflow/chain.js +41 -0
  26. package/dist/definition/workflow/diagnostics.d.ts +14 -0
  27. package/dist/definition/workflow/diagnostics.js +38 -0
  28. package/dist/definition/workflow/index.d.ts +18 -0
  29. package/dist/definition/workflow/index.js +10 -0
  30. package/dist/definition/workflow/loop.d.ts +54 -0
  31. package/dist/definition/workflow/loop.js +102 -0
  32. package/dist/definition/workflow/map.d.ts +17 -0
  33. package/dist/definition/workflow/map.js +46 -0
  34. package/dist/definition/workflow/parallel.d.ts +19 -0
  35. package/dist/definition/workflow/parallel.js +37 -0
  36. package/dist/definition/workflow/patch.d.ts +11 -0
  37. package/dist/definition/workflow/patch.js +45 -0
  38. package/dist/definition/workflow/runnable.d.ts +40 -0
  39. package/dist/definition/workflow/runnable.js +251 -0
  40. package/dist/definition/workflow/slot.d.ts +23 -0
  41. package/dist/definition/workflow/slot.js +16 -0
  42. package/dist/definition/workflow/switch.d.ts +26 -0
  43. package/dist/definition/workflow/switch.js +66 -0
  44. package/dist/definition/workflow/types.d.ts +25 -0
  45. package/dist/definition/workflow/types.js +7 -0
  46. package/dist/definition/workflow/verdict.d.ts +20 -0
  47. package/dist/definition/workflow/verdict.js +25 -0
  48. package/dist/index.d.ts +1 -0
  49. package/dist/types/agent.d.ts +5 -0
  50. package/dist/types/manifest.d.ts +5 -0
  51. package/dist/types/middleware.d.ts +5 -0
  52. package/dist/types/observe.d.ts +87 -1
  53. package/dist/types/tool.d.ts +11 -0
  54. package/dist/types/workflow.d.ts +106 -0
  55. package/dist/types/workflow.js +1 -0
  56. package/dist/utils/hash.d.ts +3 -2
  57. package/dist/utils/hash.js +1 -1
  58. package/package.json +1 -1
@@ -1,14 +1,23 @@
1
1
  /** Public wire contracts only. Never import checkpoint or engine modules here. */
2
2
  import { z } from "zod";
3
3
  import type { AgentManifest } from "./types/manifest.js";
4
+ import type { JsonValue } from "./types/shared.js";
5
+ import type { WorkflowManifest } from "./types/workflow.js";
4
6
  export type { AgentManifest } from "./types/manifest.js";
5
- export declare const PROTOCOL_VERSION = 1;
7
+ export type { WorkflowManifest } from "./types/workflow.js";
8
+ export { PROTOCOL_VERSION, ERROR_CODES } from "./compatibility.js";
9
+ export type { ErrorCode } from "./compatibility.js";
6
10
  export declare const RequestIdSchema: z.ZodString;
7
11
  export declare const IdempotencyKeySchema: z.ZodString;
8
12
  export declare const AgentManifestSchema: z.ZodType<AgentManifest>;
13
+ /** Workflow definition document. `kind: "workflow"`; a missing `kind` is never a workflow. */
14
+ export declare const WorkflowManifestSchema: z.ZodType<WorkflowManifest>;
15
+ /** Registry document: agent (no `kind`, or legacy) or workflow (`kind: "workflow"`). */
16
+ export declare const DefinitionDocumentSchema: z.ZodUnion<readonly [z.ZodType<AgentManifest, unknown, z.core.$ZodTypeInternals<AgentManifest, unknown>>, z.ZodType<WorkflowManifest, unknown, z.core.$ZodTypeInternals<WorkflowManifest, unknown>>]>;
17
+ export type DefinitionDocument = AgentManifest | WorkflowManifest;
9
18
  export declare const PutAgentRequestSchema: z.ZodObject<{
10
19
  requestId: z.ZodString;
11
- manifest: z.ZodType<AgentManifest, unknown, z.core.$ZodTypeInternals<AgentManifest, unknown>>;
20
+ manifest: z.ZodUnion<readonly [z.ZodType<AgentManifest, unknown, z.core.$ZodTypeInternals<AgentManifest, unknown>>, z.ZodType<WorkflowManifest, unknown, z.core.$ZodTypeInternals<WorkflowManifest, unknown>>]>;
12
21
  implementationVersion: z.ZodString;
13
22
  pluginRoots: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
14
23
  }, z.core.$strict>;
@@ -28,6 +37,9 @@ export declare const PutSessionRequestSchema: z.ZodObject<{
28
37
  serverName: z.ZodString;
29
38
  credentialId: z.ZodString;
30
39
  }, z.core.$strict>>>;
40
+ sandbox: z.ZodOptional<z.ZodObject<{
41
+ session: z.ZodString;
42
+ }, z.core.$strict>>;
31
43
  }, z.core.$strict>;
32
44
  export type PutSessionRequest = z.infer<typeof PutSessionRequestSchema>;
33
45
  export declare const CreateVaultRequestSchema: z.ZodObject<{
@@ -144,12 +156,20 @@ export interface CredentialInfo {
144
156
  readonly createdAt: string;
145
157
  readonly rotatedAt?: string;
146
158
  }
147
- export declare const MessageEventBodySchema: z.ZodObject<{
159
+ /** Exactly one of `content` or `data`. Optional `manifest` for per-turn agent patches. */
160
+ export declare const MessageEventBodySchema: z.ZodUnion<readonly [z.ZodObject<{
148
161
  requestId: z.ZodString;
149
162
  idempotencyKey: z.ZodString;
150
163
  type: z.ZodLiteral<"message">;
164
+ manifest: z.ZodOptional<z.ZodType<AgentManifest, unknown, z.core.$ZodTypeInternals<AgentManifest, unknown>>>;
151
165
  content: z.ZodString;
152
- }, z.core.$strict>;
166
+ }, z.core.$strict>, z.ZodObject<{
167
+ requestId: z.ZodString;
168
+ idempotencyKey: z.ZodString;
169
+ type: z.ZodLiteral<"message">;
170
+ manifest: z.ZodOptional<z.ZodType<AgentManifest, unknown, z.core.$ZodTypeInternals<AgentManifest, unknown>>>;
171
+ data: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
172
+ }, z.core.$strict>]>;
153
173
  export declare const ActionOutcomeSchema: z.ZodObject<{
154
174
  value: z.ZodUnknown;
155
175
  statePatch: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -167,12 +187,19 @@ export declare const ActionResultCommandSchema: z.ZodObject<{
167
187
  statePatch: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
168
188
  }, z.core.$strict>;
169
189
  }, z.core.$strict>;
170
- export declare const SessionCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
190
+ export declare const SessionCommandSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
171
191
  requestId: z.ZodString;
172
192
  idempotencyKey: z.ZodString;
173
193
  type: z.ZodLiteral<"message">;
194
+ manifest: z.ZodOptional<z.ZodType<AgentManifest, unknown, z.core.$ZodTypeInternals<AgentManifest, unknown>>>;
174
195
  content: z.ZodString;
175
196
  }, z.core.$strict>, z.ZodObject<{
197
+ requestId: z.ZodString;
198
+ idempotencyKey: z.ZodString;
199
+ type: z.ZodLiteral<"message">;
200
+ manifest: z.ZodOptional<z.ZodType<AgentManifest, unknown, z.core.$ZodTypeInternals<AgentManifest, unknown>>>;
201
+ data: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
202
+ }, z.core.$strict>]>, z.ZodObject<{
176
203
  requestId: z.ZodString;
177
204
  idempotencyKey: z.ZodString;
178
205
  type: z.ZodLiteral<"approve">;
@@ -200,13 +227,20 @@ export declare const SessionCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
200
227
  value: z.ZodUnknown;
201
228
  statePatch: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
202
229
  }, z.core.$strict>;
203
- }, z.core.$strict>], "type">;
204
- export declare const SessionEventBodySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
230
+ }, z.core.$strict>]>;
231
+ export declare const SessionEventBodySchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
205
232
  requestId: z.ZodString;
206
233
  idempotencyKey: z.ZodString;
207
234
  type: z.ZodLiteral<"message">;
235
+ manifest: z.ZodOptional<z.ZodType<AgentManifest, unknown, z.core.$ZodTypeInternals<AgentManifest, unknown>>>;
208
236
  content: z.ZodString;
209
237
  }, z.core.$strict>, z.ZodObject<{
238
+ requestId: z.ZodString;
239
+ idempotencyKey: z.ZodString;
240
+ type: z.ZodLiteral<"message">;
241
+ manifest: z.ZodOptional<z.ZodType<AgentManifest, unknown, z.core.$ZodTypeInternals<AgentManifest, unknown>>>;
242
+ data: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
243
+ }, z.core.$strict>]>, z.ZodObject<{
210
244
  requestId: z.ZodString;
211
245
  idempotencyKey: z.ZodString;
212
246
  type: z.ZodLiteral<"approve">;
@@ -234,13 +268,14 @@ export declare const SessionEventBodySchema: z.ZodDiscriminatedUnion<[z.ZodObjec
234
268
  value: z.ZodUnknown;
235
269
  statePatch: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
236
270
  }, z.core.$strict>;
237
- }, z.core.$strict>], "type">;
271
+ }, z.core.$strict>]>;
238
272
  export type SessionCommand = z.infer<typeof SessionCommandSchema>;
239
273
  export type SessionEventBody = SessionCommand;
240
274
  export type MessageEventBody = z.infer<typeof MessageEventBodySchema>;
241
275
  export declare const LiveEventSchema: z.ZodObject<{
242
276
  eventId: z.ZodString;
243
277
  sessionId: z.ZodString;
278
+ tenantId: z.ZodString;
244
279
  turnId: z.ZodNullable<z.ZodString>;
245
280
  cursor: z.ZodString;
246
281
  createdAt: z.ZodString;
@@ -252,6 +287,7 @@ export declare const SessionItemsResponseSchema: z.ZodObject<{
252
287
  items: z.ZodArray<z.ZodObject<{
253
288
  eventId: z.ZodString;
254
289
  sessionId: z.ZodString;
290
+ tenantId: z.ZodString;
255
291
  turnId: z.ZodNullable<z.ZodString>;
256
292
  cursor: z.ZodString;
257
293
  createdAt: z.ZodString;
@@ -270,12 +306,39 @@ export declare const AcceptedResponseSchema: z.ZodObject<{
270
306
  export type AcceptedResponse = z.infer<typeof AcceptedResponseSchema>;
271
307
  export declare const RejectedResponseSchema: z.ZodObject<{
272
308
  status: z.ZodLiteral<"rejected">;
273
- code: z.ZodString;
309
+ code: z.ZodEnum<{
310
+ active_work: "active_work";
311
+ connection_missing: "connection_missing";
312
+ downgrade_refused: "downgrade_refused";
313
+ foreign_port: "foreign_port";
314
+ host_format_newer: "host_format_newer";
315
+ host_rejected: "host_rejected";
316
+ host_schema_newer: "host_schema_newer";
317
+ host_start_failed: "host_start_failed";
318
+ host_unresponsive: "host_unresponsive";
319
+ incompatible_host: "incompatible_host";
320
+ launcher_failed: "launcher_failed";
321
+ lock_timeout: "lock_timeout";
322
+ not_found: "not_found";
323
+ origin_rejected: "origin_rejected";
324
+ platform_unsupported: "platform_unsupported";
325
+ protocol_unsupported: "protocol_unsupported";
326
+ tenant_conflict: "tenant_conflict";
327
+ unsupported_media_type: "unsupported_media_type";
328
+ upgrade_failed: "upgrade_failed";
329
+ }>;
274
330
  message: z.ZodString;
331
+ details: z.ZodOptional<z.ZodUnknown>;
275
332
  activeTurnId: z.ZodOptional<z.ZodString>;
276
333
  requestId: z.ZodOptional<z.ZodString>;
277
334
  }, z.core.$strip>;
278
335
  export type RejectedResponse = z.infer<typeof RejectedResponseSchema>;
336
+ /** The agent a call belongs to. Set on work for an agent used as a tool; absent for the root. */
337
+ export declare const AgentRefSchema: z.ZodObject<{
338
+ id: z.ZodString;
339
+ path: z.ZodString;
340
+ delegationId: z.ZodOptional<z.ZodString>;
341
+ }, z.core.$strict>;
279
342
  /** The hook point an action runs, and the capabilities that registered it (manifest order). */
280
343
  export declare const ActionHookSchema: z.ZodObject<{
281
344
  at: z.ZodEnum<{
@@ -289,7 +352,7 @@ export declare const ActionHookSchema: z.ZodObject<{
289
352
  capabilityIds: z.ZodArray<z.ZodString>;
290
353
  }, z.core.$strict>;
291
354
  export type ActionHook = z.infer<typeof ActionHookSchema>;
292
- export declare const ActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
355
+ export declare const ActionSchema: z.ZodUnion<readonly [z.ZodObject<{
293
356
  actionId: z.ZodString;
294
357
  sessionId: z.ZodString;
295
358
  turnId: z.ZodString;
@@ -308,12 +371,46 @@ export declare const ActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
308
371
  generation: z.ZodNumber;
309
372
  claimId: z.ZodNullable<z.ZodString>;
310
373
  leaseExpiresAt: z.ZodNullable<z.ZodString>;
374
+ agent: z.ZodOptional<z.ZodObject<{
375
+ id: z.ZodString;
376
+ path: z.ZodString;
377
+ delegationId: z.ZodOptional<z.ZodString>;
378
+ }, z.core.$strict>>;
311
379
  kind: z.ZodLiteral<"tool">;
312
380
  capabilityId: z.ZodString;
313
381
  toolName: z.ZodString;
314
382
  inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
315
383
  outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
316
- }, z.core.$strip>, z.ZodObject<{
384
+ }, z.core.$strict>, z.ZodObject<{
385
+ actionId: z.ZodString;
386
+ sessionId: z.ZodString;
387
+ turnId: z.ZodString;
388
+ agentId: z.ZodString;
389
+ manifestHash: z.ZodString;
390
+ implementationVersion: z.ZodString;
391
+ input: z.ZodUnknown;
392
+ context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
393
+ status: z.ZodEnum<{
394
+ cancelled: "cancelled";
395
+ claimed: "claimed";
396
+ completed: "completed";
397
+ pending: "pending";
398
+ uncertain: "uncertain";
399
+ }>;
400
+ generation: z.ZodNumber;
401
+ claimId: z.ZodNullable<z.ZodString>;
402
+ leaseExpiresAt: z.ZodNullable<z.ZodString>;
403
+ agent: z.ZodOptional<z.ZodObject<{
404
+ id: z.ZodString;
405
+ path: z.ZodString;
406
+ delegationId: z.ZodOptional<z.ZodString>;
407
+ }, z.core.$strict>>;
408
+ kind: z.ZodLiteral<"tool">;
409
+ path: z.ZodString;
410
+ key: z.ZodString;
411
+ inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
412
+ outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
413
+ }, z.core.$strict>, z.ZodObject<{
317
414
  actionId: z.ZodString;
318
415
  sessionId: z.ZodString;
319
416
  turnId: z.ZodString;
@@ -332,6 +429,11 @@ export declare const ActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
332
429
  generation: z.ZodNumber;
333
430
  claimId: z.ZodNullable<z.ZodString>;
334
431
  leaseExpiresAt: z.ZodNullable<z.ZodString>;
432
+ agent: z.ZodOptional<z.ZodObject<{
433
+ id: z.ZodString;
434
+ path: z.ZodString;
435
+ delegationId: z.ZodOptional<z.ZodString>;
436
+ }, z.core.$strict>>;
335
437
  kind: z.ZodLiteral<"hook">;
336
438
  hook: z.ZodObject<{
337
439
  at: z.ZodEnum<{
@@ -344,7 +446,61 @@ export declare const ActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
344
446
  }>;
345
447
  capabilityIds: z.ZodArray<z.ZodString>;
346
448
  }, z.core.$strict>;
347
- }, z.core.$strip>], "kind">;
449
+ }, z.core.$strict>, z.ZodObject<{
450
+ actionId: z.ZodString;
451
+ sessionId: z.ZodString;
452
+ turnId: z.ZodString;
453
+ agentId: z.ZodString;
454
+ manifestHash: z.ZodString;
455
+ implementationVersion: z.ZodString;
456
+ input: z.ZodUnknown;
457
+ context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
458
+ status: z.ZodEnum<{
459
+ cancelled: "cancelled";
460
+ claimed: "claimed";
461
+ completed: "completed";
462
+ pending: "pending";
463
+ uncertain: "uncertain";
464
+ }>;
465
+ generation: z.ZodNumber;
466
+ claimId: z.ZodNullable<z.ZodString>;
467
+ leaseExpiresAt: z.ZodNullable<z.ZodString>;
468
+ agent: z.ZodOptional<z.ZodObject<{
469
+ id: z.ZodString;
470
+ path: z.ZodString;
471
+ delegationId: z.ZodOptional<z.ZodString>;
472
+ }, z.core.$strict>>;
473
+ kind: z.ZodLiteral<"fn">;
474
+ path: z.ZodString;
475
+ key: z.ZodString;
476
+ }, z.core.$strict>, z.ZodObject<{
477
+ actionId: z.ZodString;
478
+ sessionId: z.ZodString;
479
+ turnId: z.ZodString;
480
+ agentId: z.ZodString;
481
+ manifestHash: z.ZodString;
482
+ implementationVersion: z.ZodString;
483
+ input: z.ZodUnknown;
484
+ context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
485
+ status: z.ZodEnum<{
486
+ cancelled: "cancelled";
487
+ claimed: "claimed";
488
+ completed: "completed";
489
+ pending: "pending";
490
+ uncertain: "uncertain";
491
+ }>;
492
+ generation: z.ZodNumber;
493
+ claimId: z.ZodNullable<z.ZodString>;
494
+ leaseExpiresAt: z.ZodNullable<z.ZodString>;
495
+ agent: z.ZodOptional<z.ZodObject<{
496
+ id: z.ZodString;
497
+ path: z.ZodString;
498
+ delegationId: z.ZodOptional<z.ZodString>;
499
+ }, z.core.$strict>>;
500
+ kind: z.ZodLiteral<"verify">;
501
+ path: z.ZodString;
502
+ key: z.ZodString;
503
+ }, z.core.$strict>]>;
348
504
  export type Action = z.infer<typeof ActionSchema>;
349
505
  export declare const ActionClaimRequestSchema: z.ZodObject<{
350
506
  requestId: z.ZodString;
@@ -356,7 +512,7 @@ export declare const ActionHeartbeatRequestSchema: z.ZodObject<{
356
512
  generation: z.ZodNumber;
357
513
  }, z.core.$strict>;
358
514
  export declare const ActionClaimResponseSchema: z.ZodObject<{
359
- action: z.ZodDiscriminatedUnion<[z.ZodObject<{
515
+ action: z.ZodUnion<readonly [z.ZodObject<{
360
516
  actionId: z.ZodString;
361
517
  sessionId: z.ZodString;
362
518
  turnId: z.ZodString;
@@ -375,12 +531,17 @@ export declare const ActionClaimResponseSchema: z.ZodObject<{
375
531
  generation: z.ZodNumber;
376
532
  claimId: z.ZodNullable<z.ZodString>;
377
533
  leaseExpiresAt: z.ZodNullable<z.ZodString>;
534
+ agent: z.ZodOptional<z.ZodObject<{
535
+ id: z.ZodString;
536
+ path: z.ZodString;
537
+ delegationId: z.ZodOptional<z.ZodString>;
538
+ }, z.core.$strict>>;
378
539
  kind: z.ZodLiteral<"tool">;
379
540
  capabilityId: z.ZodString;
380
541
  toolName: z.ZodString;
381
542
  inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
382
543
  outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
383
- }, z.core.$strip>, z.ZodObject<{
544
+ }, z.core.$strict>, z.ZodObject<{
384
545
  actionId: z.ZodString;
385
546
  sessionId: z.ZodString;
386
547
  turnId: z.ZodString;
@@ -399,6 +560,40 @@ export declare const ActionClaimResponseSchema: z.ZodObject<{
399
560
  generation: z.ZodNumber;
400
561
  claimId: z.ZodNullable<z.ZodString>;
401
562
  leaseExpiresAt: z.ZodNullable<z.ZodString>;
563
+ agent: z.ZodOptional<z.ZodObject<{
564
+ id: z.ZodString;
565
+ path: z.ZodString;
566
+ delegationId: z.ZodOptional<z.ZodString>;
567
+ }, z.core.$strict>>;
568
+ kind: z.ZodLiteral<"tool">;
569
+ path: z.ZodString;
570
+ key: z.ZodString;
571
+ inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
572
+ outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
573
+ }, z.core.$strict>, z.ZodObject<{
574
+ actionId: z.ZodString;
575
+ sessionId: z.ZodString;
576
+ turnId: z.ZodString;
577
+ agentId: z.ZodString;
578
+ manifestHash: z.ZodString;
579
+ implementationVersion: z.ZodString;
580
+ input: z.ZodUnknown;
581
+ context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
582
+ status: z.ZodEnum<{
583
+ cancelled: "cancelled";
584
+ claimed: "claimed";
585
+ completed: "completed";
586
+ pending: "pending";
587
+ uncertain: "uncertain";
588
+ }>;
589
+ generation: z.ZodNumber;
590
+ claimId: z.ZodNullable<z.ZodString>;
591
+ leaseExpiresAt: z.ZodNullable<z.ZodString>;
592
+ agent: z.ZodOptional<z.ZodObject<{
593
+ id: z.ZodString;
594
+ path: z.ZodString;
595
+ delegationId: z.ZodOptional<z.ZodString>;
596
+ }, z.core.$strict>>;
402
597
  kind: z.ZodLiteral<"hook">;
403
598
  hook: z.ZodObject<{
404
599
  at: z.ZodEnum<{
@@ -411,7 +606,61 @@ export declare const ActionClaimResponseSchema: z.ZodObject<{
411
606
  }>;
412
607
  capabilityIds: z.ZodArray<z.ZodString>;
413
608
  }, z.core.$strict>;
414
- }, z.core.$strip>], "kind">;
609
+ }, z.core.$strict>, z.ZodObject<{
610
+ actionId: z.ZodString;
611
+ sessionId: z.ZodString;
612
+ turnId: z.ZodString;
613
+ agentId: z.ZodString;
614
+ manifestHash: z.ZodString;
615
+ implementationVersion: z.ZodString;
616
+ input: z.ZodUnknown;
617
+ context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
618
+ status: z.ZodEnum<{
619
+ cancelled: "cancelled";
620
+ claimed: "claimed";
621
+ completed: "completed";
622
+ pending: "pending";
623
+ uncertain: "uncertain";
624
+ }>;
625
+ generation: z.ZodNumber;
626
+ claimId: z.ZodNullable<z.ZodString>;
627
+ leaseExpiresAt: z.ZodNullable<z.ZodString>;
628
+ agent: z.ZodOptional<z.ZodObject<{
629
+ id: z.ZodString;
630
+ path: z.ZodString;
631
+ delegationId: z.ZodOptional<z.ZodString>;
632
+ }, z.core.$strict>>;
633
+ kind: z.ZodLiteral<"fn">;
634
+ path: z.ZodString;
635
+ key: z.ZodString;
636
+ }, z.core.$strict>, z.ZodObject<{
637
+ actionId: z.ZodString;
638
+ sessionId: z.ZodString;
639
+ turnId: z.ZodString;
640
+ agentId: z.ZodString;
641
+ manifestHash: z.ZodString;
642
+ implementationVersion: z.ZodString;
643
+ input: z.ZodUnknown;
644
+ context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
645
+ status: z.ZodEnum<{
646
+ cancelled: "cancelled";
647
+ claimed: "claimed";
648
+ completed: "completed";
649
+ pending: "pending";
650
+ uncertain: "uncertain";
651
+ }>;
652
+ generation: z.ZodNumber;
653
+ claimId: z.ZodNullable<z.ZodString>;
654
+ leaseExpiresAt: z.ZodNullable<z.ZodString>;
655
+ agent: z.ZodOptional<z.ZodObject<{
656
+ id: z.ZodString;
657
+ path: z.ZodString;
658
+ delegationId: z.ZodOptional<z.ZodString>;
659
+ }, z.core.$strict>>;
660
+ kind: z.ZodLiteral<"verify">;
661
+ path: z.ZodString;
662
+ key: z.ZodString;
663
+ }, z.core.$strict>]>;
415
664
  claimId: z.ZodString;
416
665
  generation: z.ZodNumber;
417
666
  leaseExpiresAt: z.ZodString;
@@ -444,6 +693,7 @@ export declare const RegisterExecutorsResponseSchema: z.ZodObject<{
444
693
  agentId: z.ZodString;
445
694
  implementationVersion: z.ZodString;
446
695
  rotated: z.ZodBoolean;
696
+ replacedBy: z.ZodOptional<z.ZodLiteral<"different-credential">>;
447
697
  }, z.core.$strip>>;
448
698
  }, z.core.$strip>;
449
699
  export declare const ExecutorSummarySchema: z.ZodObject<{
@@ -465,13 +715,24 @@ export declare const ListExecutorsResponseSchema: z.ZodObject<{
465
715
  export type ExecutorRegistration = z.infer<typeof ExecutorRegistrationSchema>;
466
716
  export type RegisterExecutorsResponse = z.infer<typeof RegisterExecutorsResponseSchema>;
467
717
  export type ExecutorSummary = z.infer<typeof ExecutorSummarySchema>;
718
+ export declare const ProtocolRangeSchema: z.ZodObject<{
719
+ min: z.ZodNumber;
720
+ max: z.ZodNumber;
721
+ features: z.ZodArray<z.ZodString>;
722
+ }, z.core.$strict>;
468
723
  export declare const HealthResponseSchema: z.ZodObject<{
469
724
  status: z.ZodLiteral<"ok">;
470
725
  service: z.ZodString;
471
- version: z.ZodOptional<z.ZodString>;
472
- scopeId: z.ZodOptional<z.ZodString>;
473
- pid: z.ZodOptional<z.ZodNumber>;
474
- }, z.core.$strip>;
726
+ version: z.ZodString;
727
+ protocol: z.ZodObject<{
728
+ min: z.ZodNumber;
729
+ max: z.ZodNumber;
730
+ features: z.ZodArray<z.ZodString>;
731
+ }, z.core.$strict>;
732
+ coreVersion: z.ZodString;
733
+ hostId: z.ZodString;
734
+ pid: z.ZodNumber;
735
+ }, z.core.$strict>;
475
736
  export declare const ReadyResponseSchema: z.ZodObject<{
476
737
  status: z.ZodEnum<{
477
738
  not_ready: "not_ready";
@@ -482,3 +743,285 @@ export declare const ReadyResponseSchema: z.ZodObject<{
482
743
  }, z.core.$strip>;
483
744
  export type HealthResponse = z.infer<typeof HealthResponseSchema>;
484
745
  export type ReadyResponse = z.infer<typeof ReadyResponseSchema>;
746
+ export declare const ProtocolRejectedResponseSchema: z.ZodObject<{
747
+ status: z.ZodLiteral<"rejected">;
748
+ code: z.ZodLiteral<"protocol_unsupported">;
749
+ protocol: z.ZodObject<{
750
+ min: z.ZodNumber;
751
+ max: z.ZodNumber;
752
+ features: z.ZodArray<z.ZodString>;
753
+ }, z.core.$strict>;
754
+ }, z.core.$strict>;
755
+ export type ProtocolRejectedResponse = z.infer<typeof ProtocolRejectedResponseSchema>;
756
+ export declare const TenantEnvelopeSchema: z.ZodObject<{
757
+ id: z.ZodString;
758
+ name: z.ZodString;
759
+ createdAt: z.ZodString;
760
+ updatedAt: z.ZodString;
761
+ schemaVersion: z.ZodNumber;
762
+ }, z.core.$strict>;
763
+ export type TenantEnvelope = z.infer<typeof TenantEnvelopeSchema>;
764
+ export declare const CreateTenantRequestSchema: z.ZodObject<{
765
+ tenantId: z.ZodString;
766
+ name: z.ZodString;
767
+ principalId: z.ZodString;
768
+ credentialHash: z.ZodString;
769
+ idempotencyKey: z.ZodString;
770
+ }, z.core.$strict>;
771
+ export type CreateTenantRequest = z.infer<typeof CreateTenantRequestSchema>;
772
+ export declare const AdminTenantSchema: z.ZodObject<{
773
+ id: z.ZodString;
774
+ name: z.ZodNullable<z.ZodString>;
775
+ state: z.ZodEnum<{
776
+ open: "open";
777
+ quarantined: "quarantined";
778
+ }>;
779
+ envelope: z.ZodNullable<z.ZodObject<{
780
+ id: z.ZodString;
781
+ name: z.ZodString;
782
+ createdAt: z.ZodString;
783
+ updatedAt: z.ZodString;
784
+ schemaVersion: z.ZodNumber;
785
+ }, z.core.$strict>>;
786
+ }, z.core.$strict>;
787
+ export type AdminTenant = z.infer<typeof AdminTenantSchema>;
788
+ export declare const QuarantineSchema: z.ZodObject<{
789
+ code: z.ZodEnum<{
790
+ corrupt: "corrupt";
791
+ "envelope-invalid": "envelope-invalid";
792
+ "kek-missing": "kek-missing";
793
+ locked: "locked";
794
+ "migration-failed": "migration-failed";
795
+ "open-failed": "open-failed";
796
+ "open-timeout": "open-timeout";
797
+ "schema-too-new": "schema-too-new";
798
+ }>;
799
+ message: z.ZodString;
800
+ repair: z.ZodString;
801
+ lockPath: z.ZodOptional<z.ZodString>;
802
+ lockPid: z.ZodOptional<z.ZodNumber>;
803
+ }, z.core.$strict>;
804
+ export type QuarantineInfo = z.infer<typeof QuarantineSchema>;
805
+ export declare const AdminTenantStatusSchema: z.ZodObject<{
806
+ id: z.ZodString;
807
+ name: z.ZodNullable<z.ZodString>;
808
+ state: z.ZodEnum<{
809
+ open: "open";
810
+ quarantined: "quarantined";
811
+ }>;
812
+ envelope: z.ZodNullable<z.ZodObject<{
813
+ id: z.ZodString;
814
+ name: z.ZodString;
815
+ createdAt: z.ZodString;
816
+ updatedAt: z.ZodString;
817
+ schemaVersion: z.ZodNumber;
818
+ }, z.core.$strict>>;
819
+ quarantine: z.ZodOptional<z.ZodObject<{
820
+ code: z.ZodEnum<{
821
+ corrupt: "corrupt";
822
+ "envelope-invalid": "envelope-invalid";
823
+ "kek-missing": "kek-missing";
824
+ locked: "locked";
825
+ "migration-failed": "migration-failed";
826
+ "open-failed": "open-failed";
827
+ "open-timeout": "open-timeout";
828
+ "schema-too-new": "schema-too-new";
829
+ }>;
830
+ message: z.ZodString;
831
+ repair: z.ZodString;
832
+ lockPath: z.ZodOptional<z.ZodString>;
833
+ lockPid: z.ZodOptional<z.ZodNumber>;
834
+ }, z.core.$strict>>;
835
+ }, z.core.$strict>;
836
+ export type AdminTenantStatus = z.infer<typeof AdminTenantStatusSchema>;
837
+ export declare const HostAggregateSchema: z.ZodObject<{
838
+ runningSessions: z.ZodNumber;
839
+ connectedExecutors: z.ZodNumber;
840
+ pendingActions: z.ZodNumber;
841
+ uncertainEffects: z.ZodNumber;
842
+ }, z.core.$strict>;
843
+ export type HostAggregate = z.infer<typeof HostAggregateSchema>;
844
+ export declare const AdminHostStatusSchema: z.ZodObject<{
845
+ hostId: z.ZodString;
846
+ url: z.ZodString;
847
+ pid: z.ZodNumber;
848
+ version: z.ZodString;
849
+ protocol: z.ZodObject<{
850
+ min: z.ZodNumber;
851
+ max: z.ZodNumber;
852
+ features: z.ZodArray<z.ZodString>;
853
+ }, z.core.$strict>;
854
+ tenants: z.ZodArray<z.ZodObject<{
855
+ id: z.ZodString;
856
+ name: z.ZodNullable<z.ZodString>;
857
+ state: z.ZodEnum<{
858
+ open: "open";
859
+ quarantined: "quarantined";
860
+ }>;
861
+ envelope: z.ZodNullable<z.ZodObject<{
862
+ id: z.ZodString;
863
+ name: z.ZodString;
864
+ createdAt: z.ZodString;
865
+ updatedAt: z.ZodString;
866
+ schemaVersion: z.ZodNumber;
867
+ }, z.core.$strict>>;
868
+ }, z.core.$strict>>;
869
+ aggregate: z.ZodObject<{
870
+ runningSessions: z.ZodNumber;
871
+ connectedExecutors: z.ZodNumber;
872
+ pendingActions: z.ZodNumber;
873
+ uncertainEffects: z.ZodNumber;
874
+ }, z.core.$strict>;
875
+ }, z.core.$strict>;
876
+ export type AdminHostStatus = z.infer<typeof AdminHostStatusSchema>;
877
+ /** Shared Admin API status (D§4.1). OSS fills `host`; Cloud omits it. */
878
+ export declare const AdminStatusSchema: z.ZodObject<{
879
+ service: z.ZodString;
880
+ version: z.ZodString;
881
+ protocol: z.ZodObject<{
882
+ min: z.ZodNumber;
883
+ max: z.ZodNumber;
884
+ features: z.ZodArray<z.ZodString>;
885
+ }, z.core.$strict>;
886
+ tenants: z.ZodArray<z.ZodObject<{
887
+ id: z.ZodString;
888
+ name: z.ZodNullable<z.ZodString>;
889
+ state: z.ZodEnum<{
890
+ open: "open";
891
+ quarantined: "quarantined";
892
+ }>;
893
+ envelope: z.ZodNullable<z.ZodObject<{
894
+ id: z.ZodString;
895
+ name: z.ZodString;
896
+ createdAt: z.ZodString;
897
+ updatedAt: z.ZodString;
898
+ schemaVersion: z.ZodNumber;
899
+ }, z.core.$strict>>;
900
+ }, z.core.$strict>>;
901
+ aggregate: z.ZodObject<{
902
+ runningSessions: z.ZodNumber;
903
+ connectedExecutors: z.ZodNumber;
904
+ pendingActions: z.ZodNumber;
905
+ uncertainEffects: z.ZodNumber;
906
+ }, z.core.$strict>;
907
+ host: z.ZodOptional<z.ZodObject<{
908
+ hostId: z.ZodString;
909
+ url: z.ZodString;
910
+ pid: z.ZodNumber;
911
+ }, z.core.$strict>>;
912
+ }, z.core.$strict>;
913
+ export type AdminStatus = z.infer<typeof AdminStatusSchema>;
914
+ export declare const ProjectLinkFileSchema: z.ZodObject<{
915
+ format: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>>;
916
+ hostUrl: z.ZodString;
917
+ hostId: z.ZodString;
918
+ tenantId: z.ZodString;
919
+ }, z.core.$loose>;
920
+ export type ProjectLinkFile = z.infer<typeof ProjectLinkFileSchema>;
921
+ export declare const ProjectCredentialsFileSchema: z.ZodObject<{
922
+ format: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>>;
923
+ applicationKey: z.ZodString;
924
+ principalId: z.ZodString;
925
+ }, z.core.$loose>;
926
+ export type ProjectCredentialsFile = z.infer<typeof ProjectCredentialsFileSchema>;
927
+ export declare const HostModelViewSchema: z.ZodUnion<readonly [z.ZodObject<{
928
+ configured: z.ZodLiteral<false>;
929
+ }, z.core.$strict>, z.ZodObject<{
930
+ configured: z.ZodLiteral<true>;
931
+ provider: z.ZodString;
932
+ model: z.ZodString;
933
+ authType: z.ZodEnum<{
934
+ api_key: "api_key";
935
+ oauth: "oauth";
936
+ }>;
937
+ baseUrl: z.ZodOptional<z.ZodString>;
938
+ }, z.core.$strict>]>;
939
+ export declare const TenantStatusSchema: z.ZodObject<{
940
+ tenant: z.ZodObject<{
941
+ id: z.ZodString;
942
+ name: z.ZodString;
943
+ createdAt: z.ZodString;
944
+ updatedAt: z.ZodString;
945
+ schemaVersion: z.ZodNumber;
946
+ }, z.core.$strict>;
947
+ path: z.ZodString;
948
+ checks: z.ZodObject<{
949
+ sqlite: z.ZodBoolean;
950
+ scheduler: z.ZodBoolean;
951
+ model: z.ZodBoolean;
952
+ executors: z.ZodBoolean;
953
+ schema: z.ZodBoolean;
954
+ }, z.core.$strict>;
955
+ model: z.ZodUnion<readonly [z.ZodObject<{
956
+ configured: z.ZodLiteral<false>;
957
+ }, z.core.$strict>, z.ZodObject<{
958
+ configured: z.ZodLiteral<true>;
959
+ provider: z.ZodString;
960
+ model: z.ZodString;
961
+ authType: z.ZodEnum<{
962
+ api_key: "api_key";
963
+ oauth: "oauth";
964
+ }>;
965
+ baseUrl: z.ZodOptional<z.ZodString>;
966
+ }, z.core.$strict>]>;
967
+ agents: z.ZodArray<z.ZodObject<{
968
+ agentId: z.ZodString;
969
+ registered: z.ZodBoolean;
970
+ connected: z.ZodBoolean;
971
+ }, z.core.$strict>>;
972
+ counts: z.ZodObject<{
973
+ sessions: z.ZodNumber;
974
+ runningSessions: z.ZodNumber;
975
+ pendingActions: z.ZodNumber;
976
+ uncertainEffects: z.ZodNumber;
977
+ }, z.core.$strict>;
978
+ sandbox: z.ZodObject<{
979
+ backend: z.ZodNullable<z.ZodString>;
980
+ retained: z.ZodNumber;
981
+ }, z.core.$strict>;
982
+ }, z.core.$strict>;
983
+ export type TenantStatus = z.infer<typeof TenantStatusSchema>;
984
+ export declare const SeedTenantConfigRequestSchema: z.ZodObject<{
985
+ requestId: z.ZodString;
986
+ sandbox: z.ZodOptional<z.ZodObject<{
987
+ backend: z.ZodEnum<{
988
+ auto: "auto";
989
+ microsandbox: "microsandbox";
990
+ virtual: "virtual";
991
+ }>;
992
+ }, z.core.$strict>>;
993
+ model: z.ZodOptional<z.ZodObject<{
994
+ provider: z.ZodString;
995
+ model: z.ZodString;
996
+ baseUrl: z.ZodOptional<z.ZodString>;
997
+ auth: z.ZodDiscriminatedUnion<[z.ZodObject<{
998
+ type: z.ZodLiteral<"api_key">;
999
+ key: z.ZodString;
1000
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1001
+ }, z.core.$strict>, z.ZodObject<{
1002
+ type: z.ZodLiteral<"oauth">;
1003
+ refresh: z.ZodString;
1004
+ access: z.ZodString;
1005
+ expires: z.ZodNumber;
1006
+ }, z.core.$loose>], "type">;
1007
+ }, z.core.$strict>>;
1008
+ }, z.core.$strict>;
1009
+ export type SeedTenantConfigRequest = z.infer<typeof SeedTenantConfigRequestSchema>;
1010
+ export declare const SeedTenantConfigResponseSchema: z.ZodObject<{
1011
+ applied: z.ZodArray<z.ZodString>;
1012
+ kept: z.ZodArray<z.ZodString>;
1013
+ }, z.core.$strict>;
1014
+ export type SeedTenantConfigResponse = z.infer<typeof SeedTenantConfigResponseSchema>;
1015
+ export declare const ResetTenantRequestSchema: z.ZodObject<{
1016
+ requestId: z.ZodString;
1017
+ scope: z.ZodEnum<{
1018
+ all: "all";
1019
+ sandboxes: "sandboxes";
1020
+ sessions: "sessions";
1021
+ }>;
1022
+ activeWork: z.ZodEnum<{
1023
+ cancel: "cancel";
1024
+ drain: "drain";
1025
+ }>;
1026
+ }, z.core.$strict>;
1027
+ export type ResetTenantRequest = z.infer<typeof ResetTenantRequestSchema>;