@the-open-engine/zeroshot 6.10.2 → 6.12.0

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 (76) hide show
  1. package/cli/commands/providers.js +13 -13
  2. package/cli/index.js +77 -35
  3. package/cli/lib/first-run.js +12 -11
  4. package/cli/lib/update-checker.js +517 -132
  5. package/lib/agent-cli-provider/adapters/opencode.d.ts.map +1 -1
  6. package/lib/agent-cli-provider/adapters/opencode.js +3 -0
  7. package/lib/agent-cli-provider/adapters/opencode.js.map +1 -1
  8. package/lib/agent-cli-provider/types.d.ts +1 -0
  9. package/lib/agent-cli-provider/types.d.ts.map +1 -1
  10. package/lib/agent-cli-provider/types.js.map +1 -1
  11. package/lib/cluster/client.cjs +146 -0
  12. package/lib/cluster/client.d.ts +44 -0
  13. package/lib/cluster/client.mjs +141 -0
  14. package/lib/cluster/connection.cjs +382 -0
  15. package/lib/cluster/connection.d.ts +41 -0
  16. package/lib/cluster/connection.mjs +378 -0
  17. package/lib/cluster/errors.cjs +44 -0
  18. package/lib/cluster/errors.d.ts +23 -0
  19. package/lib/cluster/errors.mjs +32 -0
  20. package/lib/cluster/frames.cjs +49 -0
  21. package/lib/cluster/frames.d.ts +12 -0
  22. package/lib/cluster/frames.mjs +45 -0
  23. package/lib/cluster/generated/protocol-schema.cjs +5 -0
  24. package/lib/cluster/generated/protocol-schema.d.ts +1 -0
  25. package/lib/cluster/generated/protocol-schema.mjs +2 -0
  26. package/lib/cluster/generated/protocol.cjs +22 -0
  27. package/lib/cluster/generated/protocol.d.ts +781 -0
  28. package/lib/cluster/generated/protocol.mjs +19 -0
  29. package/lib/cluster/index.cjs +40 -0
  30. package/lib/cluster/index.d.ts +10 -0
  31. package/lib/cluster/index.mjs +6 -0
  32. package/lib/cluster/queue.cjs +71 -0
  33. package/lib/cluster/queue.d.ts +15 -0
  34. package/lib/cluster/queue.mjs +67 -0
  35. package/lib/cluster/socket.cjs +15 -0
  36. package/lib/cluster/socket.d.ts +11 -0
  37. package/lib/cluster/socket.mjs +12 -0
  38. package/lib/cluster/subscriptions.cjs +270 -0
  39. package/lib/cluster/subscriptions.d.ts +69 -0
  40. package/lib/cluster/subscriptions.mjs +264 -0
  41. package/lib/cluster/validators.cjs +46 -0
  42. package/lib/cluster/validators.d.ts +3 -0
  43. package/lib/cluster/validators.mjs +42 -0
  44. package/lib/settings.js +195 -23
  45. package/lib/setup-apply.js +45 -32
  46. package/lib/setup-undo.js +25 -16
  47. package/package.json +25 -3
  48. package/scripts/build-cluster.js +43 -0
  49. package/scripts/generate-cluster-types.js +203 -0
  50. package/scripts/release-dry-run.js +6 -6
  51. package/scripts/rust-distribution.js +933 -0
  52. package/src/agent/agent-hook-executor.js +14 -6
  53. package/src/agent/agent-lifecycle.js +25 -8
  54. package/src/agent/agent-task-executor.js +711 -139
  55. package/src/agent/output-reformatter.js +54 -41
  56. package/src/agent/pr-verification.js +11 -3
  57. package/src/agent/task-execution-handle.js +373 -0
  58. package/src/agent-cli-provider/adapters/opencode.ts +3 -0
  59. package/src/agent-cli-provider/types.ts +1 -0
  60. package/src/agent-wrapper.js +5 -2
  61. package/src/cluster/client.ts +199 -0
  62. package/src/cluster/connection.ts +300 -0
  63. package/src/cluster/errors.ts +32 -0
  64. package/src/cluster/frames.ts +44 -0
  65. package/src/cluster/generated/protocol-schema.ts +2 -0
  66. package/src/cluster/generated/protocol.ts +183 -0
  67. package/src/cluster/index.ts +38 -0
  68. package/src/cluster/queue.ts +84 -0
  69. package/src/cluster/socket.ts +31 -0
  70. package/src/cluster/subscriptions.ts +256 -0
  71. package/src/cluster/validators.ts +56 -0
  72. package/src/cluster/ws.d.ts +7 -0
  73. package/src/isolation-manager.js +16 -0
  74. package/src/issue-providers/jira-provider.js +1 -1
  75. package/src/issue-providers/linear-provider.js +4 -4
  76. package/task-lib/runner.js +3 -0
@@ -0,0 +1,781 @@
1
+ export declare const JSON_RPC_VERSION: "2.0";
2
+ export declare const PROTOCOL_VERSION: "openengine.cluster/v1";
3
+ export declare const SUBSCRIPTION_QUEUE_CAPACITY: 1024;
4
+ export declare const MAX_FRAME_BYTES: 1048576;
5
+ export declare const CLUSTER_METHODS: readonly ["initialize", "plan", "apply", "update", "stop", "retry", "resubmit", "delete", "get", "watch", "logs", "agent/attach"];
6
+ export type ClusterMethod = (typeof CLUSTER_METHODS)[number];
7
+ export declare const UNARY_METHODS: readonly ["initialize", "plan", "apply", "update", "stop", "retry", "resubmit", "delete", "get"];
8
+ export type UnaryClusterMethod = (typeof UNARY_METHODS)[number];
9
+ export declare const SUBSCRIPTION_METHODS: readonly ["watch", "logs", "agent/attach"];
10
+ export type SubscriptionMethod = (typeof SUBSCRIPTION_METHODS)[number];
11
+ export declare const METHOD_RESULT_DEFINITIONS: {
12
+ readonly initialize: "InitializeResult";
13
+ readonly plan: "PlanResult";
14
+ readonly apply: "ApplyResult";
15
+ readonly update: "UpdateResult";
16
+ readonly stop: "StopResult";
17
+ readonly retry: "RetryResult";
18
+ readonly resubmit: "ResubmitResult";
19
+ readonly delete: "DeleteResult";
20
+ readonly get: "GetResult";
21
+ readonly watch: "WatchResult";
22
+ readonly logs: "LogsResult";
23
+ readonly "agent/attach": "AgentAttachResult";
24
+ };
25
+ export declare const JSON_RPC_ERROR_CODES: {
26
+ readonly PARSE_ERROR: -32700;
27
+ readonly INVALID_REQUEST: -32600;
28
+ readonly METHOD_NOT_FOUND: -32601;
29
+ readonly INVALID_PARAMS: -32602;
30
+ readonly INTERNAL_ERROR: -32603;
31
+ readonly APPLICATION_ERROR: -32000;
32
+ };
33
+ export declare const DOMAIN_ERROR_CODES: readonly ["NOT_FOUND", "GONE", "SLOW_CONSUMER", "UNSUPPORTED_PROTOCOL_VERSION", "INTERNAL_ERROR"];
34
+ export type AdmissionTransition = {
35
+ readonly "runId": string;
36
+ readonly "seedInput": unknown;
37
+ readonly "spec": GraphSpec;
38
+ };
39
+ export type AgentAttachClosedNotification = {
40
+ readonly "reason": SubscriptionCloseReason;
41
+ readonly "subscriptionId": string;
42
+ };
43
+ export type AgentAttachEvent = {
44
+ readonly "type": "working";
45
+ } | {
46
+ readonly "text": string;
47
+ readonly "type": "output";
48
+ } | {
49
+ readonly "type": "settled";
50
+ };
51
+ export type AgentAttachEventNotification = AgentAttachEventNotificationWire;
52
+ export type AgentAttachEventNotificationWire = {
53
+ readonly "event": AgentAttachEvent;
54
+ readonly "subscriptionId": string;
55
+ };
56
+ export type AgentAttachParams = {
57
+ readonly "execution": string;
58
+ };
59
+ export type AgentAttachResult = {
60
+ readonly "subscriptionId": string;
61
+ };
62
+ export type ApplyParams = {
63
+ readonly "dryRun"?: boolean;
64
+ readonly "graph": GraphSpec;
65
+ readonly "idempotencyKey"?: string;
66
+ readonly "ifGeneration"?: number;
67
+ readonly "input"?: unknown;
68
+ };
69
+ export type ApplyResult = {
70
+ readonly "deduped": boolean;
71
+ readonly "diff"?: GraphDiff | null;
72
+ readonly "generation"?: number | null;
73
+ readonly "phase": Phase;
74
+ readonly "runId"?: string | null;
75
+ };
76
+ export type ArtifactLineage = {
77
+ readonly "attempt": number;
78
+ readonly "generation": number;
79
+ readonly "runId": string;
80
+ };
81
+ export type ArtifactProducer = {
82
+ readonly "node": string;
83
+ readonly "worker": string;
84
+ };
85
+ export type ArtifactRef = {
86
+ readonly "artifactId": string;
87
+ readonly "byteLength": number;
88
+ readonly "lineage": ArtifactLineage;
89
+ readonly "mediaType": string;
90
+ readonly "producer": ArtifactProducer;
91
+ readonly "redaction": RedactionClass;
92
+ readonly "sha256": string;
93
+ readonly "typeId": string;
94
+ };
95
+ export type BackendFault = BackendFaultWire;
96
+ export type BackendFaultWire = {
97
+ readonly "action": FaultAction;
98
+ readonly "code": FaultCode;
99
+ readonly "consequence": FaultConsequence;
100
+ readonly "eventId": string;
101
+ readonly "executionRef"?: string | null;
102
+ readonly "retry": FaultRetryDisposition;
103
+ readonly "severity": FaultSeverity;
104
+ readonly "source": ReadonlyArray<FaultSourceFrame>;
105
+ readonly "summary": string;
106
+ };
107
+ export type CancelRequestParams = {
108
+ readonly "id": RequestId;
109
+ };
110
+ export type ChoiceBranch = {
111
+ readonly "node": GraphNode;
112
+ readonly "when": Guard;
113
+ };
114
+ export type ClusterStatus = {
115
+ readonly "atCursor"?: string | null;
116
+ readonly "currentRunId"?: string | null;
117
+ readonly "observedGeneration"?: number | null;
118
+ readonly "operational"?: OperationalStatus | null;
119
+ readonly "phase": Phase;
120
+ };
121
+ export type ControlSelector = {
122
+ readonly "field"?: string | null;
123
+ readonly "name": string;
124
+ readonly "source": ControlSource;
125
+ };
126
+ export type ControlSource = "signal" | "error" | "group";
127
+ export type DataSelector = {
128
+ readonly "path": ReadonlyArray<string>;
129
+ readonly "source": "state";
130
+ } | {
131
+ readonly "path": ReadonlyArray<string>;
132
+ readonly "source": "item";
133
+ };
134
+ export type DeleteParams = {
135
+ readonly "idempotencyKey": string;
136
+ readonly "ifGeneration": number;
137
+ readonly "ifRunId"?: string | null;
138
+ };
139
+ export type DeleteResult = {
140
+ readonly "atCursor"?: string | null;
141
+ readonly "deduped": boolean;
142
+ readonly "deleted": boolean;
143
+ readonly "generation"?: number | null;
144
+ readonly "phase": Phase;
145
+ readonly "runId"?: string | null;
146
+ };
147
+ export type DiagnosticPathSegment = {
148
+ readonly "kind": "field";
149
+ readonly "name": string;
150
+ } | {
151
+ readonly "index": number;
152
+ readonly "kind": "index";
153
+ } | {
154
+ readonly "kind": "node";
155
+ readonly "name": string;
156
+ };
157
+ export type DiagnosticSeverity = "error" | "warning" | "info";
158
+ export type DispatchState = "active" | "suspended" | "draining" | "force_stopping" | "stopped";
159
+ export type DomainErrorData = {
160
+ readonly "code": string;
161
+ readonly "details"?: unknown;
162
+ };
163
+ export type EventNotification = {
164
+ readonly "cursor": string;
165
+ readonly "event": WatchEvent;
166
+ readonly "runId": string;
167
+ readonly "subscriptionId": string;
168
+ };
169
+ export type FaultAction = "none" | "retry" | "wait" | "escalate" | "abort";
170
+ export type FaultCode = "unavailable" | "resource_exhausted" | "deadline_exceeded" | "permission_denied" | "failed_precondition" | "not_found" | "aborted" | "internal" | "unknown";
171
+ export type FaultConsequence = "turn_failed" | "run_failed" | "run_degraded" | "no_observable_effect";
172
+ export type FaultRetryDisposition = "retryable" | "retryable_after_backoff" | "not_retryable" | "indeterminate";
173
+ export type FaultSeverity = "info" | "warning" | "error" | "critical";
174
+ export type FaultSourceFrame = {
175
+ readonly "component": string;
176
+ };
177
+ export type GetParams = {
178
+ readonly "atCursor"?: string | null;
179
+ };
180
+ export type GetResult = {
181
+ readonly "atCursor"?: string | null;
182
+ readonly "spec"?: GraphSpec | null;
183
+ readonly "status": ClusterStatus;
184
+ };
185
+ export type GraphDiagnostic = {
186
+ readonly "code": GraphDiagnosticCode;
187
+ readonly "message": string;
188
+ readonly "path": ReadonlyArray<DiagnosticPathSegment>;
189
+ readonly "relatedNodes": ReadonlyArray<string>;
190
+ readonly "severity": DiagnosticSeverity;
191
+ };
192
+ export type GraphDiagnosticCode = "schema_safety" | "reachability" | "choice_exhaustiveness" | "loop_exit_satisfiability" | "missing_bound" | "write_conflict" | "ceiling_exceeded" | "cyclic_reference" | "undefined_read" | "invalid_graph_shape";
193
+ export type GraphDiff = {
194
+ readonly "added": ReadonlyArray<string>;
195
+ readonly "changed": ReadonlyArray<string>;
196
+ readonly "removed": ReadonlyArray<string>;
197
+ };
198
+ export type GraphNode = {
199
+ readonly "attempts": number;
200
+ readonly "input": PayloadType;
201
+ readonly "inputBindings": ReadonlyArray<InputBinding>;
202
+ readonly "kind": "step";
203
+ readonly "name": string;
204
+ readonly "output": PayloadType;
205
+ readonly "timeoutMs": number;
206
+ readonly "worker": string;
207
+ readonly "writeBindings": ReadonlyArray<WriteBinding>;
208
+ } | {
209
+ readonly "attempts": number;
210
+ readonly "diagnostic": PayloadType;
211
+ readonly "input": PayloadType;
212
+ readonly "inputBindings": ReadonlyArray<InputBinding>;
213
+ readonly "kind": "verifier";
214
+ readonly "name": string;
215
+ readonly "output": PayloadType;
216
+ readonly "signals": {
217
+ readonly [key: string]: ReadonlyArray<string>;
218
+ };
219
+ readonly "timeoutMs": number;
220
+ readonly "worker": string;
221
+ readonly "writeBindings": ReadonlyArray<WriteBinding>;
222
+ } | {
223
+ readonly "children": NonEmptyVec_of_GraphNode;
224
+ readonly "kind": "seq";
225
+ readonly "name": string;
226
+ readonly "promotedStatePaths": ReadonlyArray<ReadonlyArray<string>>;
227
+ readonly "state": PayloadType;
228
+ } | ({
229
+ readonly "branches": NonEmptyVec_of_ChoiceBranch;
230
+ readonly "kind": "choice";
231
+ readonly "name": string;
232
+ readonly "otherwise"?: GraphNode | null;
233
+ readonly "promotedStatePaths": ReadonlyArray<ReadonlyArray<string>>;
234
+ readonly "state": PayloadType;
235
+ }) | {
236
+ readonly "branches": NonEmptyVec_of_GraphNode;
237
+ readonly "join": Join;
238
+ readonly "kind": "par";
239
+ readonly "name": string;
240
+ readonly "promotedStatePaths": ReadonlyArray<ReadonlyArray<string>>;
241
+ readonly "state": PayloadType;
242
+ } | {
243
+ readonly "body": GraphNode;
244
+ readonly "kind": "loop";
245
+ readonly "maxIterations": number;
246
+ readonly "name": string;
247
+ readonly "promotedStatePaths": ReadonlyArray<ReadonlyArray<string>>;
248
+ readonly "state": PayloadType;
249
+ readonly "until": Guard;
250
+ } | {
251
+ readonly "body": GraphNode;
252
+ readonly "kind": "map";
253
+ readonly "maxItems": number;
254
+ readonly "name": string;
255
+ readonly "over": DataSelector;
256
+ readonly "promotedStatePaths": ReadonlyArray<ReadonlyArray<string>>;
257
+ readonly "state": PayloadType;
258
+ } | {
259
+ readonly "bindings": ReadonlyArray<InputBinding>;
260
+ readonly "kind": "succeed";
261
+ readonly "name": string;
262
+ readonly "output": PayloadType;
263
+ } | {
264
+ readonly "kind": "fail";
265
+ readonly "name": string;
266
+ readonly "reason": string;
267
+ };
268
+ export type GraphProfile = "openengine.graph.full/v1" | "openengine.graph.single-worker/v1";
269
+ export type GraphSpec = {
270
+ readonly "initialInput": PayloadType;
271
+ readonly "policy": PolicyBinding;
272
+ readonly "profile": GraphProfile;
273
+ readonly "root": GraphNode;
274
+ };
275
+ export type Guard = {
276
+ readonly "kind": "in";
277
+ readonly "labels": ReadonlyArray<string>;
278
+ readonly "value": ControlSelector;
279
+ } | {
280
+ readonly "guards": NonEmptyVec_of_Guard;
281
+ readonly "kind": "all";
282
+ } | {
283
+ readonly "guards": NonEmptyVec_of_Guard;
284
+ readonly "kind": "any";
285
+ } | {
286
+ readonly "guard": Guard;
287
+ readonly "kind": "not";
288
+ } | {
289
+ readonly "count": number;
290
+ readonly "kind": "k_of_n";
291
+ readonly "labels": ReadonlyArray<string>;
292
+ readonly "values": NonEmptyVec_of_ControlSelector;
293
+ } | {
294
+ readonly "count": number;
295
+ readonly "kind": "k_of_map";
296
+ readonly "labels": ReadonlyArray<string>;
297
+ readonly "value": ControlSelector;
298
+ };
299
+ export type InitializeParams = {
300
+ readonly "protocolVersion": "openengine.cluster/v1";
301
+ };
302
+ export type InitializeResult = {
303
+ readonly "capabilities": ServerCapabilities;
304
+ readonly "protocolVersion": "openengine.cluster/v1";
305
+ readonly "status": ClusterStatus;
306
+ };
307
+ export type InputBinding = {
308
+ readonly "target": ReadonlyArray<string>;
309
+ readonly "value": DataSelector;
310
+ };
311
+ export type Join = {
312
+ readonly "kind": "all";
313
+ } | {
314
+ readonly "kind": "any";
315
+ } | {
316
+ readonly "count": number;
317
+ readonly "kind": "quorum";
318
+ } | {
319
+ readonly "kind": "first";
320
+ readonly "when": Guard;
321
+ };
322
+ export type JsonRpcError = {
323
+ readonly "code": number;
324
+ readonly "data"?: DomainErrorData | null;
325
+ readonly "message": string;
326
+ };
327
+ export type JsonRpcErrorResponse = {
328
+ readonly "error": JsonRpcError;
329
+ readonly "id"?: RequestId | null;
330
+ readonly "jsonrpc": string;
331
+ };
332
+ export type JsonRpcNotification = {
333
+ readonly "jsonrpc": string;
334
+ readonly "method": string;
335
+ readonly "params": EventNotification;
336
+ };
337
+ export type JsonRpcNotification2 = {
338
+ readonly "jsonrpc": string;
339
+ readonly "method": string;
340
+ readonly "params": SubscriptionCancelParams;
341
+ };
342
+ export type JsonRpcNotification3 = {
343
+ readonly "jsonrpc": string;
344
+ readonly "method": string;
345
+ readonly "params": SubscriptionClosedNotification;
346
+ };
347
+ export type JsonRpcNotification4 = {
348
+ readonly "jsonrpc": string;
349
+ readonly "method": string;
350
+ readonly "params": CancelRequestParams;
351
+ };
352
+ export type JsonRpcNotification5 = {
353
+ readonly "jsonrpc": string;
354
+ readonly "method": string;
355
+ readonly "params": LogEventNotification;
356
+ };
357
+ export type JsonRpcNotification6 = {
358
+ readonly "jsonrpc": string;
359
+ readonly "method": string;
360
+ readonly "params": LogsClosedNotification;
361
+ };
362
+ export type JsonRpcNotification7 = {
363
+ readonly "jsonrpc": string;
364
+ readonly "method": string;
365
+ readonly "params": AgentAttachEventNotification;
366
+ };
367
+ export type JsonRpcNotification8 = {
368
+ readonly "jsonrpc": string;
369
+ readonly "method": string;
370
+ readonly "params": AgentAttachClosedNotification;
371
+ };
372
+ export type JsonRpcRequest = {
373
+ readonly "id": RequestId;
374
+ readonly "jsonrpc": string;
375
+ readonly "method": string;
376
+ readonly "params": InitializeParams;
377
+ };
378
+ export type JsonRpcRequest10 = {
379
+ readonly "id": RequestId;
380
+ readonly "jsonrpc": string;
381
+ readonly "method": string;
382
+ readonly "params": WatchParams;
383
+ };
384
+ export type JsonRpcRequest11 = {
385
+ readonly "id": RequestId;
386
+ readonly "jsonrpc": string;
387
+ readonly "method": string;
388
+ readonly "params": LogsParams;
389
+ };
390
+ export type JsonRpcRequest12 = {
391
+ readonly "id": RequestId;
392
+ readonly "jsonrpc": string;
393
+ readonly "method": string;
394
+ readonly "params": AgentAttachParams;
395
+ };
396
+ export type JsonRpcRequest2 = {
397
+ readonly "id": RequestId;
398
+ readonly "jsonrpc": string;
399
+ readonly "method": string;
400
+ readonly "params": PlanParams;
401
+ };
402
+ export type JsonRpcRequest3 = {
403
+ readonly "id": RequestId;
404
+ readonly "jsonrpc": string;
405
+ readonly "method": string;
406
+ readonly "params": ApplyParams;
407
+ };
408
+ export type JsonRpcRequest4 = {
409
+ readonly "id": RequestId;
410
+ readonly "jsonrpc": string;
411
+ readonly "method": string;
412
+ readonly "params": GetParams;
413
+ };
414
+ export type JsonRpcRequest5 = {
415
+ readonly "id": RequestId;
416
+ readonly "jsonrpc": string;
417
+ readonly "method": string;
418
+ readonly "params": UpdateParams;
419
+ };
420
+ export type JsonRpcRequest6 = {
421
+ readonly "id": RequestId;
422
+ readonly "jsonrpc": string;
423
+ readonly "method": string;
424
+ readonly "params": StopParams;
425
+ };
426
+ export type JsonRpcRequest7 = {
427
+ readonly "id": RequestId;
428
+ readonly "jsonrpc": string;
429
+ readonly "method": string;
430
+ readonly "params": RetryParams;
431
+ };
432
+ export type JsonRpcRequest8 = {
433
+ readonly "id": RequestId;
434
+ readonly "jsonrpc": string;
435
+ readonly "method": string;
436
+ readonly "params": ResubmitParams;
437
+ };
438
+ export type JsonRpcRequest9 = {
439
+ readonly "id": RequestId;
440
+ readonly "jsonrpc": string;
441
+ readonly "method": string;
442
+ readonly "params": DeleteParams;
443
+ };
444
+ export type JsonRpcResponse = JsonRpcSuccess | JsonRpcErrorResponse;
445
+ export type JsonRpcResponse10 = JsonRpcSuccess10 | JsonRpcErrorResponse;
446
+ export type JsonRpcResponse11 = JsonRpcSuccess11 | JsonRpcErrorResponse;
447
+ export type JsonRpcResponse12 = JsonRpcSuccess12 | JsonRpcErrorResponse;
448
+ export type JsonRpcResponse2 = JsonRpcSuccess2 | JsonRpcErrorResponse;
449
+ export type JsonRpcResponse3 = JsonRpcSuccess3 | JsonRpcErrorResponse;
450
+ export type JsonRpcResponse4 = JsonRpcSuccess4 | JsonRpcErrorResponse;
451
+ export type JsonRpcResponse5 = JsonRpcSuccess5 | JsonRpcErrorResponse;
452
+ export type JsonRpcResponse6 = JsonRpcSuccess6 | JsonRpcErrorResponse;
453
+ export type JsonRpcResponse7 = JsonRpcSuccess7 | JsonRpcErrorResponse;
454
+ export type JsonRpcResponse8 = JsonRpcSuccess8 | JsonRpcErrorResponse;
455
+ export type JsonRpcResponse9 = JsonRpcSuccess9 | JsonRpcErrorResponse;
456
+ export type JsonRpcSuccess = {
457
+ readonly "id": RequestId;
458
+ readonly "jsonrpc": string;
459
+ readonly "result": InitializeResult;
460
+ };
461
+ export type JsonRpcSuccess10 = {
462
+ readonly "id": RequestId;
463
+ readonly "jsonrpc": string;
464
+ readonly "result": WatchResult;
465
+ };
466
+ export type JsonRpcSuccess11 = {
467
+ readonly "id": RequestId;
468
+ readonly "jsonrpc": string;
469
+ readonly "result": LogsResult;
470
+ };
471
+ export type JsonRpcSuccess12 = {
472
+ readonly "id": RequestId;
473
+ readonly "jsonrpc": string;
474
+ readonly "result": AgentAttachResult;
475
+ };
476
+ export type JsonRpcSuccess2 = {
477
+ readonly "id": RequestId;
478
+ readonly "jsonrpc": string;
479
+ readonly "result": PlanResult;
480
+ };
481
+ export type JsonRpcSuccess3 = {
482
+ readonly "id": RequestId;
483
+ readonly "jsonrpc": string;
484
+ readonly "result": ApplyResult;
485
+ };
486
+ export type JsonRpcSuccess4 = {
487
+ readonly "id": RequestId;
488
+ readonly "jsonrpc": string;
489
+ readonly "result": GetResult;
490
+ };
491
+ export type JsonRpcSuccess5 = {
492
+ readonly "id": RequestId;
493
+ readonly "jsonrpc": string;
494
+ readonly "result": UpdateResult;
495
+ };
496
+ export type JsonRpcSuccess6 = {
497
+ readonly "id": RequestId;
498
+ readonly "jsonrpc": string;
499
+ readonly "result": StopResult;
500
+ };
501
+ export type JsonRpcSuccess7 = {
502
+ readonly "id": RequestId;
503
+ readonly "jsonrpc": string;
504
+ readonly "result": RetryResult;
505
+ };
506
+ export type JsonRpcSuccess8 = {
507
+ readonly "id": RequestId;
508
+ readonly "jsonrpc": string;
509
+ readonly "result": ResubmitResult;
510
+ };
511
+ export type JsonRpcSuccess9 = {
512
+ readonly "id": RequestId;
513
+ readonly "jsonrpc": string;
514
+ readonly "result": DeleteResult;
515
+ };
516
+ export type Labels = {
517
+ readonly [key: string]: string;
518
+ };
519
+ export type LogEventNotification = LogEventNotificationWire;
520
+ export type LogEventNotificationWire = {
521
+ readonly "record": LogRecord;
522
+ readonly "subscriptionId": string;
523
+ };
524
+ export type LogLevel = "trace" | "debug" | "info" | "warn" | "error";
525
+ export type LogRecord = {
526
+ readonly "level": LogLevel;
527
+ readonly "message": string;
528
+ readonly "target": string;
529
+ };
530
+ export type LogsClosedNotification = {
531
+ readonly "reason": SubscriptionCloseReason;
532
+ readonly "subscriptionId": string;
533
+ };
534
+ export type LogsParams = Record<string, never>;
535
+ export type LogsResult = {
536
+ readonly "subscriptionId": string;
537
+ };
538
+ export type NodeAddress = {
539
+ readonly "attempt": number;
540
+ readonly "node": string;
541
+ };
542
+ export type NodeOutputChannel = "out" | "signal" | "diagnostic";
543
+ export type NodeOutputSelector = {
544
+ readonly "channel": NodeOutputChannel;
545
+ readonly "node": string;
546
+ readonly "path": ReadonlyArray<string>;
547
+ };
548
+ export type NonEmptyVec_of_ChoiceBranch = ReadonlyArray<ChoiceBranch>;
549
+ export type NonEmptyVec_of_ControlSelector = ReadonlyArray<ControlSelector>;
550
+ export type NonEmptyVec_of_FieldPath = ReadonlyArray<ReadonlyArray<string>>;
551
+ export type NonEmptyVec_of_GraphNode = ReadonlyArray<GraphNode>;
552
+ export type NonEmptyVec_of_Guard = ReadonlyArray<Guard>;
553
+ export type NonEmptyVec_of_NodeName = ReadonlyArray<string>;
554
+ export type OperationalStatus = {
555
+ readonly "dispatchState": DispatchState;
556
+ readonly "inFlight": number;
557
+ readonly "labels": Labels;
558
+ readonly "logLevel": LogLevel;
559
+ readonly "stopMode"?: StopMode | null;
560
+ };
561
+ export type PayloadType = {
562
+ readonly "kind": "null";
563
+ } | {
564
+ readonly "kind": "boolean";
565
+ } | {
566
+ readonly "kind": "integer";
567
+ } | {
568
+ readonly "kind": "number";
569
+ } | {
570
+ readonly "kind": "string";
571
+ } | {
572
+ readonly "fields": {
573
+ readonly [key: string]: RecordField;
574
+ };
575
+ readonly "kind": "record";
576
+ } | {
577
+ readonly "items": PayloadType;
578
+ readonly "kind": "array";
579
+ } | {
580
+ readonly "kind": "enum";
581
+ readonly "values": ReadonlyArray<string>;
582
+ };
583
+ export type Phase = "empty" | "admitting" | "running" | "finished" | "deleting";
584
+ export type PlanParams = {
585
+ readonly "graph": GraphSpec;
586
+ };
587
+ export type PlanResult = {
588
+ readonly "bounds"?: StructuralBounds | null;
589
+ readonly "diagnostics": ReadonlyArray<GraphDiagnostic>;
590
+ readonly "ok": boolean;
591
+ };
592
+ export type PolicyBinding = {
593
+ readonly "default": PolicyDefault;
594
+ readonly "policy": string;
595
+ };
596
+ export type PolicyDefault = "deny";
597
+ export type RecordField = {
598
+ readonly "required": boolean;
599
+ readonly "type": PayloadType;
600
+ };
601
+ export type RedactionClass = "public" | "internal" | "confidential" | "restricted";
602
+ export type RequestId = string | number;
603
+ export type ResubmitParams = {
604
+ readonly "idempotencyKey": string;
605
+ readonly "ifGeneration": number;
606
+ readonly "ifRunId": string;
607
+ readonly "replacementInput"?: unknown;
608
+ };
609
+ export type ResubmitResult = {
610
+ readonly "atCursor": string;
611
+ readonly "deduped": boolean;
612
+ readonly "generation": number;
613
+ readonly "operational": OperationalStatus;
614
+ readonly "phase": Phase;
615
+ readonly "priorRunId": string;
616
+ readonly "runId": string;
617
+ };
618
+ export type RetryParams = {
619
+ readonly "idempotencyKey": string;
620
+ readonly "ifGeneration": number;
621
+ };
622
+ export type RetryResult = {
623
+ readonly "atCursor": string;
624
+ readonly "deduped": boolean;
625
+ readonly "generation": number;
626
+ readonly "operational": OperationalStatus;
627
+ readonly "phase": Phase;
628
+ readonly "retriedTurnId": string;
629
+ readonly "retryTurnId": string;
630
+ readonly "runId": string;
631
+ };
632
+ export type ServerCapabilities = {
633
+ readonly "agentAttach"?: boolean;
634
+ readonly "graphProfiles"?: ReadonlyArray<GraphProfile>;
635
+ readonly "logs"?: boolean;
636
+ };
637
+ export type StopMode = "drain" | "force";
638
+ export type StopParams = {
639
+ readonly "idempotencyKey": string;
640
+ readonly "ifGeneration": number;
641
+ readonly "mode": StopMode;
642
+ };
643
+ export type StopResult = {
644
+ readonly "acceptedMode": StopMode;
645
+ readonly "atCursor": string;
646
+ readonly "deduped": boolean;
647
+ readonly "effectiveMode": StopMode;
648
+ readonly "generation": number;
649
+ readonly "operational": OperationalStatus;
650
+ readonly "phase": Phase;
651
+ readonly "runId": string;
652
+ };
653
+ export type StructuralBounds = {
654
+ readonly "attemptsPerNode": {
655
+ readonly [key: string]: number;
656
+ };
657
+ readonly "maxNodeExecutions": number;
658
+ readonly "peakConcurrency": number;
659
+ readonly "termination": TerminationWitness;
660
+ };
661
+ export type SubscriptionCancelParams = {
662
+ readonly "subscriptionId": string;
663
+ };
664
+ export type SubscriptionCloseReason = "done" | "SLOW_CONSUMER";
665
+ export type SubscriptionClosedNotification = {
666
+ readonly "lastDeliveredCursor"?: string | null;
667
+ readonly "reason": SubscriptionCloseReason;
668
+ readonly "subscriptionId": string;
669
+ };
670
+ export type TerminationWitness = {
671
+ readonly "kind": "acyclic";
672
+ readonly "order": NonEmptyVec_of_NodeName;
673
+ } | {
674
+ readonly "kind": "bounded";
675
+ readonly "maxIterations": number;
676
+ readonly "ranking": NonEmptyVec_of_FieldPath;
677
+ };
678
+ export type UpdateParams = ({
679
+ readonly "idempotencyKey": string;
680
+ readonly "ifGeneration": number;
681
+ readonly "labels"?: Labels;
682
+ readonly "logLevel"?: LogLevel;
683
+ readonly "suspended"?: boolean;
684
+ }) & ({
685
+ readonly "labels": unknown;
686
+ } | {
687
+ readonly "logLevel": unknown;
688
+ } | {
689
+ readonly "suspended": unknown;
690
+ });
691
+ export type UpdateResult = {
692
+ readonly "atCursor": string;
693
+ readonly "deduped": boolean;
694
+ readonly "generation": number;
695
+ readonly "operational": OperationalStatus;
696
+ readonly "phase": Phase;
697
+ readonly "runId": string;
698
+ };
699
+ export type WatchEvent = ({
700
+ readonly "admission"?: AdmissionTransition | null;
701
+ readonly "status": ClusterStatus;
702
+ readonly "type": "phase";
703
+ }) | {
704
+ readonly "input": unknown;
705
+ readonly "node": NodeAddress;
706
+ readonly "type": "node_begin";
707
+ } | {
708
+ readonly "node": NodeAddress;
709
+ readonly "outcome": WorkerOutcome;
710
+ readonly "type": "node_end";
711
+ } | {
712
+ readonly "type": "bookmark";
713
+ } | {
714
+ readonly "fault": BackendFault;
715
+ readonly "type": "fault";
716
+ } | ({
717
+ readonly "final_status": ClusterStatus;
718
+ readonly "stop_mode"?: StopMode | null;
719
+ readonly "type": "finished";
720
+ });
721
+ export type WatchParams = {
722
+ readonly "fromCursor"?: string | null;
723
+ readonly "runId"?: string | null;
724
+ };
725
+ export type WatchResult = {
726
+ readonly "atCursor"?: string | null;
727
+ readonly "runId"?: string | null;
728
+ readonly "subscriptionId": string;
729
+ };
730
+ export type WorkerErrorCode = "timeout" | "crash" | "malformed" | "refusal";
731
+ export type WorkerFailureReason = "declared_failure" | "policy_denied" | "interactive_input_required" | "authentication_required" | "malformed_result";
732
+ export type WorkerOutcome = WorkerOutcomeWire & unknown;
733
+ export type WorkerOutcomeWire = {
734
+ readonly "artifacts": ReadonlyArray<ArtifactRef>;
735
+ readonly "output": unknown;
736
+ readonly "status": "verified";
737
+ } | {
738
+ readonly "artifacts": ReadonlyArray<ArtifactRef>;
739
+ readonly "diagnostic": unknown;
740
+ readonly "output": unknown;
741
+ readonly "signals": {
742
+ readonly [key: string]: string;
743
+ };
744
+ readonly "status": "verifier";
745
+ } | {
746
+ readonly "code": WorkerErrorCode;
747
+ readonly "reason": WorkerFailureReason;
748
+ readonly "status": "error";
749
+ };
750
+ export type WriteBinding = {
751
+ readonly "target": ReadonlyArray<string>;
752
+ readonly "value": NodeOutputSelector;
753
+ };
754
+ export interface ClusterMethodParams {
755
+ readonly initialize: InitializeParams;
756
+ readonly plan: PlanParams;
757
+ readonly apply: ApplyParams;
758
+ readonly update: UpdateParams;
759
+ readonly stop: StopParams;
760
+ readonly retry: RetryParams;
761
+ readonly resubmit: ResubmitParams;
762
+ readonly delete: DeleteParams;
763
+ readonly get: GetParams;
764
+ readonly watch: WatchParams;
765
+ readonly logs: LogsParams;
766
+ readonly 'agent/attach': AgentAttachParams;
767
+ }
768
+ export interface ClusterMethodResults {
769
+ readonly initialize: InitializeResult;
770
+ readonly plan: PlanResult;
771
+ readonly apply: ApplyResult;
772
+ readonly update: UpdateResult;
773
+ readonly stop: StopResult;
774
+ readonly retry: RetryResult;
775
+ readonly resubmit: ResubmitResult;
776
+ readonly delete: DeleteResult;
777
+ readonly get: GetResult;
778
+ readonly watch: WatchResult;
779
+ readonly logs: LogsResult;
780
+ readonly 'agent/attach': AgentAttachResult;
781
+ }