@gajae-code/coding-agent 0.17.4 → 0.17.6

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 (86) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/dist/types/config/autorouting-tier-map.d.ts +1031 -3
  3. package/dist/types/config/file-lock.d.ts +4 -2
  4. package/dist/types/config/model-registry.d.ts +3 -1
  5. package/dist/types/config/model-resolver.d.ts +1 -1
  6. package/dist/types/exec/bash-executor.d.ts +2 -0
  7. package/dist/types/extensibility/gjc-plugins/runtime-adapters.d.ts +11 -2
  8. package/dist/types/gjc-runtime/state-writer.d.ts +14 -1
  9. package/dist/types/harness-control-plane/control-endpoint.d.ts +4 -1
  10. package/dist/types/harness-control-plane/finalize.d.ts +14 -3
  11. package/dist/types/main.d.ts +1 -1
  12. package/dist/types/runtime-mcp/loader.d.ts +2 -0
  13. package/dist/types/runtime-mcp/manager.d.ts +13 -6
  14. package/dist/types/sdk/broker/broker.d.ts +4 -2
  15. package/dist/types/sdk/broker/ensure.d.ts +3 -0
  16. package/dist/types/sdk/broker/identity.d.ts +2 -0
  17. package/dist/types/sdk/broker/lifecycle-ledger.d.ts +11 -3
  18. package/dist/types/sdk/broker/managed-task-dag.d.ts +1335 -0
  19. package/dist/types/sdk/broker/managed-task-verification.d.ts +37 -0
  20. package/dist/types/sdk/broker/spawn-authority.d.ts +8 -0
  21. package/dist/types/sdk/broker/startup-failure.d.ts +4 -0
  22. package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +5 -1
  23. package/dist/types/sdk/prompt-deadline-flush.d.ts +2 -0
  24. package/dist/types/sdk/session.d.ts +3 -3
  25. package/dist/types/session/agent-session.d.ts +7 -2
  26. package/dist/types/task/types.d.ts +2 -0
  27. package/dist/types/tools/bash-interactive.d.ts +1 -0
  28. package/dist/types/tools/fetch.d.ts +10 -1
  29. package/dist/types/tools/subagent.d.ts +8 -1
  30. package/package.json +7 -7
  31. package/src/cli/public-command-registry.ts +8 -2
  32. package/src/cli/setup-cli.ts +1 -0
  33. package/src/cli/stats-cli.ts +11 -1
  34. package/src/config/autorouting-tier-map.ts +529 -3
  35. package/src/config/file-lock.ts +59 -14
  36. package/src/config/model-discovery-manager.ts +4 -4
  37. package/src/config/model-profile-activation.ts +83 -23
  38. package/src/config/model-registry.ts +72 -12
  39. package/src/config/model-resolver.ts +6 -1
  40. package/src/coordinator-mcp/question-state.ts +4 -1
  41. package/src/coordinator-mcp/server.ts +14 -6
  42. package/src/exec/bash-executor.ts +3 -0
  43. package/src/extensibility/gjc-plugins/runtime-adapters.ts +46 -8
  44. package/src/gjc-runtime/state-writer.ts +317 -6
  45. package/src/harness-control-plane/control-endpoint.ts +24 -6
  46. package/src/harness-control-plane/finalize.ts +312 -25
  47. package/src/harness-control-plane/owner.ts +323 -89
  48. package/src/internal-urls/docs-index.generated.ts +6 -4
  49. package/src/main.ts +69 -19
  50. package/src/modes/acp/acp-agent.ts +581 -37
  51. package/src/modes/components/gjc-bundle-settings.ts +21 -1
  52. package/src/modes/components/tool-status-header.ts +72 -6
  53. package/src/modes/controllers/runtime-mcp-command-controller.ts +1 -1
  54. package/src/runtime-mcp/loader.ts +6 -3
  55. package/src/runtime-mcp/manager.ts +177 -75
  56. package/src/sdk/broker/broker.ts +1058 -150
  57. package/src/sdk/broker/ensure.ts +65 -8
  58. package/src/sdk/broker/identity.ts +13 -0
  59. package/src/sdk/broker/lifecycle-ledger.ts +16 -4
  60. package/src/sdk/broker/managed-task-dag.ts +1927 -0
  61. package/src/sdk/broker/managed-task-verification.ts +642 -0
  62. package/src/sdk/broker/spawn-authority.ts +140 -7
  63. package/src/sdk/broker/startup-failure.ts +80 -1
  64. package/src/sdk/broker/transport.ts +1 -0
  65. package/src/sdk/bus/chat-daemon-control.ts +2 -2
  66. package/src/sdk/bus/index.ts +22 -6
  67. package/src/sdk/bus/telegram-daemon-contract.ts +5 -1
  68. package/src/sdk/cli/session-cli.ts +18 -0
  69. package/src/sdk/host/session-runtime.test.ts +46 -0
  70. package/src/sdk/host/session-runtime.ts +13 -6
  71. package/src/sdk/lifecycle/service.ts +2 -0
  72. package/src/sdk/prompt-deadline-flush.ts +26 -4
  73. package/src/sdk/session.ts +587 -115
  74. package/src/session/agent-session.ts +60 -14
  75. package/src/session/internal/managed-session-scope.ts +10 -0
  76. package/src/session/internal/managed-session-storage.ts +30 -1
  77. package/src/setup/provider-presets.json +2 -1
  78. package/src/slash-commands/builtin-registry.ts +1 -1
  79. package/src/task/executor.ts +46 -17
  80. package/src/task/types.ts +2 -0
  81. package/src/tools/bash-interactive.ts +2 -0
  82. package/src/tools/bash.ts +20 -0
  83. package/src/tools/fetch.ts +21 -5
  84. package/src/tools/subagent-render.ts +24 -1
  85. package/src/tools/subagent.ts +27 -1
  86. package/src/utils/mupdf.ts +11 -4
@@ -0,0 +1,1335 @@
1
+ import { z } from "zod";
2
+ export declare const ManagedPathResourceSchema: z.ZodObject<{
3
+ kind: z.ZodLiteral<"path">;
4
+ path: z.ZodString;
5
+ mode: z.ZodEnum<{
6
+ read: "read";
7
+ write: "write";
8
+ }>;
9
+ recursive: z.ZodBoolean;
10
+ namespace: z.ZodBoolean;
11
+ }, z.core.$strict>;
12
+ export declare const ManagedNamedResourceSchema: z.ZodObject<{
13
+ kind: z.ZodEnum<{
14
+ database: "database";
15
+ integration: "integration";
16
+ }>;
17
+ identity: z.ZodString;
18
+ mode: z.ZodEnum<{
19
+ read: "read";
20
+ write: "write";
21
+ }>;
22
+ }, z.core.$strict>;
23
+ export declare const ManagedPortResourceSchema: z.ZodObject<{
24
+ kind: z.ZodLiteral<"port">;
25
+ protocol: z.ZodEnum<{
26
+ tcp: "tcp";
27
+ udp: "udp";
28
+ }>;
29
+ address: z.ZodEnum<{
30
+ "*": "*";
31
+ "0.0.0.0": "0.0.0.0";
32
+ "127.0.0.1": "127.0.0.1";
33
+ "::": "::";
34
+ "::1": "::1";
35
+ }>;
36
+ port: z.ZodNumber;
37
+ mode: z.ZodEnum<{
38
+ read: "read";
39
+ write: "write";
40
+ }>;
41
+ }, z.core.$strict>;
42
+ export declare const ManagedResourceSchema: z.ZodUnion<readonly [z.ZodObject<{
43
+ kind: z.ZodLiteral<"path">;
44
+ path: z.ZodString;
45
+ mode: z.ZodEnum<{
46
+ read: "read";
47
+ write: "write";
48
+ }>;
49
+ recursive: z.ZodBoolean;
50
+ namespace: z.ZodBoolean;
51
+ }, z.core.$strict>, z.ZodObject<{
52
+ kind: z.ZodEnum<{
53
+ database: "database";
54
+ integration: "integration";
55
+ }>;
56
+ identity: z.ZodString;
57
+ mode: z.ZodEnum<{
58
+ read: "read";
59
+ write: "write";
60
+ }>;
61
+ }, z.core.$strict>, z.ZodObject<{
62
+ kind: z.ZodLiteral<"port">;
63
+ protocol: z.ZodEnum<{
64
+ tcp: "tcp";
65
+ udp: "udp";
66
+ }>;
67
+ address: z.ZodEnum<{
68
+ "*": "*";
69
+ "0.0.0.0": "0.0.0.0";
70
+ "127.0.0.1": "127.0.0.1";
71
+ "::": "::";
72
+ "::1": "::1";
73
+ }>;
74
+ port: z.ZodNumber;
75
+ mode: z.ZodEnum<{
76
+ read: "read";
77
+ write: "write";
78
+ }>;
79
+ }, z.core.$strict>]>;
80
+ export type ManagedResource = z.infer<typeof ManagedResourceSchema>;
81
+ export declare const ManagedArtifactSchema: z.ZodObject<{
82
+ path: z.ZodString;
83
+ role: z.ZodEnum<{
84
+ input: "input";
85
+ output: "output";
86
+ "read-write": "read-write";
87
+ "validation-output": "validation-output";
88
+ }>;
89
+ presence: z.ZodEnum<{
90
+ absent: "absent";
91
+ optional: "optional";
92
+ required: "required";
93
+ }>;
94
+ }, z.core.$strict>;
95
+ export type ManagedArtifact = z.infer<typeof ManagedArtifactSchema>;
96
+ export declare const ManagedTaskDefinitionSchema: z.ZodObject<{
97
+ id: z.ZodString;
98
+ task: z.ZodString;
99
+ workspace: z.ZodString;
100
+ predecessors: z.ZodArray<z.ZodString>;
101
+ criteriaIdentity: z.ZodString;
102
+ validations: z.ZodArray<z.ZodObject<{
103
+ name: z.ZodString;
104
+ command: z.ZodString;
105
+ }, z.core.$strict>>;
106
+ resources: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
107
+ kind: z.ZodLiteral<"path">;
108
+ path: z.ZodString;
109
+ mode: z.ZodEnum<{
110
+ read: "read";
111
+ write: "write";
112
+ }>;
113
+ recursive: z.ZodBoolean;
114
+ namespace: z.ZodBoolean;
115
+ }, z.core.$strict>, z.ZodObject<{
116
+ kind: z.ZodEnum<{
117
+ database: "database";
118
+ integration: "integration";
119
+ }>;
120
+ identity: z.ZodString;
121
+ mode: z.ZodEnum<{
122
+ read: "read";
123
+ write: "write";
124
+ }>;
125
+ }, z.core.$strict>, z.ZodObject<{
126
+ kind: z.ZodLiteral<"port">;
127
+ protocol: z.ZodEnum<{
128
+ tcp: "tcp";
129
+ udp: "udp";
130
+ }>;
131
+ address: z.ZodEnum<{
132
+ "*": "*";
133
+ "0.0.0.0": "0.0.0.0";
134
+ "127.0.0.1": "127.0.0.1";
135
+ "::": "::";
136
+ "::1": "::1";
137
+ }>;
138
+ port: z.ZodNumber;
139
+ mode: z.ZodEnum<{
140
+ read: "read";
141
+ write: "write";
142
+ }>;
143
+ }, z.core.$strict>]>>;
144
+ artifacts: z.ZodArray<z.ZodObject<{
145
+ path: z.ZodString;
146
+ role: z.ZodEnum<{
147
+ input: "input";
148
+ output: "output";
149
+ "read-write": "read-write";
150
+ "validation-output": "validation-output";
151
+ }>;
152
+ presence: z.ZodEnum<{
153
+ absent: "absent";
154
+ optional: "optional";
155
+ required: "required";
156
+ }>;
157
+ }, z.core.$strict>>;
158
+ }, z.core.$strict>;
159
+ export type ManagedTaskDefinition = z.infer<typeof ManagedTaskDefinitionSchema>;
160
+ export declare const ManagedDefinitionRecordSchema: z.ZodObject<{
161
+ revision: z.ZodNumber;
162
+ hash: z.ZodString;
163
+ definition: z.ZodObject<{
164
+ id: z.ZodString;
165
+ task: z.ZodString;
166
+ workspace: z.ZodString;
167
+ predecessors: z.ZodArray<z.ZodString>;
168
+ criteriaIdentity: z.ZodString;
169
+ validations: z.ZodArray<z.ZodObject<{
170
+ name: z.ZodString;
171
+ command: z.ZodString;
172
+ }, z.core.$strict>>;
173
+ resources: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
174
+ kind: z.ZodLiteral<"path">;
175
+ path: z.ZodString;
176
+ mode: z.ZodEnum<{
177
+ read: "read";
178
+ write: "write";
179
+ }>;
180
+ recursive: z.ZodBoolean;
181
+ namespace: z.ZodBoolean;
182
+ }, z.core.$strict>, z.ZodObject<{
183
+ kind: z.ZodEnum<{
184
+ database: "database";
185
+ integration: "integration";
186
+ }>;
187
+ identity: z.ZodString;
188
+ mode: z.ZodEnum<{
189
+ read: "read";
190
+ write: "write";
191
+ }>;
192
+ }, z.core.$strict>, z.ZodObject<{
193
+ kind: z.ZodLiteral<"port">;
194
+ protocol: z.ZodEnum<{
195
+ tcp: "tcp";
196
+ udp: "udp";
197
+ }>;
198
+ address: z.ZodEnum<{
199
+ "*": "*";
200
+ "0.0.0.0": "0.0.0.0";
201
+ "127.0.0.1": "127.0.0.1";
202
+ "::": "::";
203
+ "::1": "::1";
204
+ }>;
205
+ port: z.ZodNumber;
206
+ mode: z.ZodEnum<{
207
+ read: "read";
208
+ write: "write";
209
+ }>;
210
+ }, z.core.$strict>]>>;
211
+ artifacts: z.ZodArray<z.ZodObject<{
212
+ path: z.ZodString;
213
+ role: z.ZodEnum<{
214
+ input: "input";
215
+ output: "output";
216
+ "read-write": "read-write";
217
+ "validation-output": "validation-output";
218
+ }>;
219
+ presence: z.ZodEnum<{
220
+ absent: "absent";
221
+ optional: "optional";
222
+ required: "required";
223
+ }>;
224
+ }, z.core.$strict>>;
225
+ }, z.core.$strict>;
226
+ }, z.core.$strict>;
227
+ export type ManagedDefinitionRecord = z.infer<typeof ManagedDefinitionRecordSchema>;
228
+ export declare const ManagedManifestEntrySchema: z.ZodObject<{
229
+ path: z.ZodString;
230
+ object: z.ZodNullable<z.ZodString>;
231
+ kind: z.ZodEnum<{
232
+ absent: "absent";
233
+ directory: "directory";
234
+ file: "file";
235
+ }>;
236
+ hash: z.ZodNullable<z.ZodString>;
237
+ mode: z.ZodNullable<z.ZodNumber>;
238
+ }, z.core.$strict>;
239
+ export type ManagedManifestEntry = z.infer<typeof ManagedManifestEntrySchema>;
240
+ export type ManagedManifest = ManagedManifestEntry[];
241
+ export declare const ManagedPredecessorSchema: z.ZodObject<{
242
+ nodeId: z.ZodString;
243
+ taskRevision: z.ZodNumber;
244
+ attemptId: z.ZodString;
245
+ verificationId: z.ZodString;
246
+ verificationHash: z.ZodString;
247
+ produced: z.ZodArray<z.ZodObject<{
248
+ path: z.ZodString;
249
+ object: z.ZodNullable<z.ZodString>;
250
+ kind: z.ZodEnum<{
251
+ absent: "absent";
252
+ directory: "directory";
253
+ file: "file";
254
+ }>;
255
+ hash: z.ZodNullable<z.ZodString>;
256
+ mode: z.ZodNullable<z.ZodNumber>;
257
+ }, z.core.$strict>>;
258
+ }, z.core.$strict>;
259
+ export type ManagedPredecessor = z.infer<typeof ManagedPredecessorSchema>;
260
+ export declare const ManagedCanonicalResourceSchema: z.ZodObject<{
261
+ declaration: z.ZodUnion<readonly [z.ZodObject<{
262
+ kind: z.ZodLiteral<"path">;
263
+ path: z.ZodString;
264
+ mode: z.ZodEnum<{
265
+ read: "read";
266
+ write: "write";
267
+ }>;
268
+ recursive: z.ZodBoolean;
269
+ namespace: z.ZodBoolean;
270
+ }, z.core.$strict>, z.ZodObject<{
271
+ kind: z.ZodEnum<{
272
+ database: "database";
273
+ integration: "integration";
274
+ }>;
275
+ identity: z.ZodString;
276
+ mode: z.ZodEnum<{
277
+ read: "read";
278
+ write: "write";
279
+ }>;
280
+ }, z.core.$strict>, z.ZodObject<{
281
+ kind: z.ZodLiteral<"port">;
282
+ protocol: z.ZodEnum<{
283
+ tcp: "tcp";
284
+ udp: "udp";
285
+ }>;
286
+ address: z.ZodEnum<{
287
+ "*": "*";
288
+ "0.0.0.0": "0.0.0.0";
289
+ "127.0.0.1": "127.0.0.1";
290
+ "::": "::";
291
+ "::1": "::1";
292
+ }>;
293
+ port: z.ZodNumber;
294
+ mode: z.ZodEnum<{
295
+ read: "read";
296
+ write: "write";
297
+ }>;
298
+ }, z.core.$strict>]>;
299
+ path: z.ZodNullable<z.ZodString>;
300
+ object: z.ZodNullable<z.ZodString>;
301
+ ancestor: z.ZodNullable<z.ZodString>;
302
+ suffix: z.ZodNullable<z.ZodString>;
303
+ }, z.core.$strict>;
304
+ export type ManagedCanonicalResource = z.infer<typeof ManagedCanonicalResourceSchema>;
305
+ export declare const ManagedNativeIdentitySchema: z.ZodObject<{
306
+ key: z.ZodString;
307
+ identity: z.ZodString;
308
+ requestHash: z.ZodString;
309
+ }, z.core.$strict>;
310
+ export type ManagedNativeIdentity = z.infer<typeof ManagedNativeIdentitySchema>;
311
+ export declare const ManagedVerificationObservationSchema: z.ZodObject<{
312
+ name: z.ZodString;
313
+ command: z.ZodString;
314
+ cwd: z.ZodString;
315
+ exitStatus: z.ZodNumber;
316
+ pass: z.ZodBoolean;
317
+ }, z.core.$strict>;
318
+ export type ManagedVerificationObservation = z.infer<typeof ManagedVerificationObservationSchema>;
319
+ export declare const ManagedVerificationReceiptSchema: z.ZodObject<{
320
+ id: z.ZodString;
321
+ hash: z.ZodString;
322
+ envelope: z.ZodRecord<z.ZodString, z.ZodUnknown>;
323
+ }, z.core.$strict>;
324
+ export type ManagedVerificationReceipt = z.infer<typeof ManagedVerificationReceiptSchema>;
325
+ export declare const ManagedVerificationExecutionSchema: z.ZodObject<{
326
+ executionId: z.ZodString;
327
+ workspace: z.ZodString;
328
+ commands: z.ZodArray<z.ZodObject<{
329
+ name: z.ZodString;
330
+ command: z.ZodString;
331
+ }, z.core.$strict>>;
332
+ observations: z.ZodArray<z.ZodObject<{
333
+ name: z.ZodString;
334
+ command: z.ZodString;
335
+ cwd: z.ZodString;
336
+ exitStatus: z.ZodNumber;
337
+ pass: z.ZodBoolean;
338
+ }, z.core.$strict>>;
339
+ receipts: z.ZodArray<z.ZodObject<{
340
+ id: z.ZodString;
341
+ hash: z.ZodString;
342
+ envelope: z.ZodRecord<z.ZodString, z.ZodUnknown>;
343
+ }, z.core.$strict>>;
344
+ }, z.core.$strict>;
345
+ export type ManagedVerificationExecution = z.infer<typeof ManagedVerificationExecutionSchema>;
346
+ export declare const ManagedTaskAttemptSchema: z.ZodObject<{
347
+ id: z.ZodString;
348
+ nodeId: z.ZodString;
349
+ taskRevision: z.ZodNumber;
350
+ graphRevision: z.ZodNumber;
351
+ definitionHash: z.ZodString;
352
+ definition: z.ZodObject<{
353
+ id: z.ZodString;
354
+ task: z.ZodString;
355
+ workspace: z.ZodString;
356
+ predecessors: z.ZodArray<z.ZodString>;
357
+ criteriaIdentity: z.ZodString;
358
+ validations: z.ZodArray<z.ZodObject<{
359
+ name: z.ZodString;
360
+ command: z.ZodString;
361
+ }, z.core.$strict>>;
362
+ resources: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
363
+ kind: z.ZodLiteral<"path">;
364
+ path: z.ZodString;
365
+ mode: z.ZodEnum<{
366
+ read: "read";
367
+ write: "write";
368
+ }>;
369
+ recursive: z.ZodBoolean;
370
+ namespace: z.ZodBoolean;
371
+ }, z.core.$strict>, z.ZodObject<{
372
+ kind: z.ZodEnum<{
373
+ database: "database";
374
+ integration: "integration";
375
+ }>;
376
+ identity: z.ZodString;
377
+ mode: z.ZodEnum<{
378
+ read: "read";
379
+ write: "write";
380
+ }>;
381
+ }, z.core.$strict>, z.ZodObject<{
382
+ kind: z.ZodLiteral<"port">;
383
+ protocol: z.ZodEnum<{
384
+ tcp: "tcp";
385
+ udp: "udp";
386
+ }>;
387
+ address: z.ZodEnum<{
388
+ "*": "*";
389
+ "0.0.0.0": "0.0.0.0";
390
+ "127.0.0.1": "127.0.0.1";
391
+ "::": "::";
392
+ "::1": "::1";
393
+ }>;
394
+ port: z.ZodNumber;
395
+ mode: z.ZodEnum<{
396
+ read: "read";
397
+ write: "write";
398
+ }>;
399
+ }, z.core.$strict>]>>;
400
+ artifacts: z.ZodArray<z.ZodObject<{
401
+ path: z.ZodString;
402
+ role: z.ZodEnum<{
403
+ input: "input";
404
+ output: "output";
405
+ "read-write": "read-write";
406
+ "validation-output": "validation-output";
407
+ }>;
408
+ presence: z.ZodEnum<{
409
+ absent: "absent";
410
+ optional: "optional";
411
+ required: "required";
412
+ }>;
413
+ }, z.core.$strict>>;
414
+ }, z.core.$strict>;
415
+ native: z.ZodObject<{
416
+ key: z.ZodString;
417
+ identity: z.ZodString;
418
+ requestHash: z.ZodString;
419
+ }, z.core.$strict>;
420
+ inputs: z.ZodArray<z.ZodObject<{
421
+ path: z.ZodString;
422
+ object: z.ZodNullable<z.ZodString>;
423
+ kind: z.ZodEnum<{
424
+ absent: "absent";
425
+ directory: "directory";
426
+ file: "file";
427
+ }>;
428
+ hash: z.ZodNullable<z.ZodString>;
429
+ mode: z.ZodNullable<z.ZodNumber>;
430
+ }, z.core.$strict>>;
431
+ predecessors: z.ZodArray<z.ZodObject<{
432
+ nodeId: z.ZodString;
433
+ taskRevision: z.ZodNumber;
434
+ attemptId: z.ZodString;
435
+ verificationId: z.ZodString;
436
+ verificationHash: z.ZodString;
437
+ produced: z.ZodArray<z.ZodObject<{
438
+ path: z.ZodString;
439
+ object: z.ZodNullable<z.ZodString>;
440
+ kind: z.ZodEnum<{
441
+ absent: "absent";
442
+ directory: "directory";
443
+ file: "file";
444
+ }>;
445
+ hash: z.ZodNullable<z.ZodString>;
446
+ mode: z.ZodNullable<z.ZodNumber>;
447
+ }, z.core.$strict>>;
448
+ }, z.core.$strict>>;
449
+ resources: z.ZodArray<z.ZodObject<{
450
+ declaration: z.ZodUnion<readonly [z.ZodObject<{
451
+ kind: z.ZodLiteral<"path">;
452
+ path: z.ZodString;
453
+ mode: z.ZodEnum<{
454
+ read: "read";
455
+ write: "write";
456
+ }>;
457
+ recursive: z.ZodBoolean;
458
+ namespace: z.ZodBoolean;
459
+ }, z.core.$strict>, z.ZodObject<{
460
+ kind: z.ZodEnum<{
461
+ database: "database";
462
+ integration: "integration";
463
+ }>;
464
+ identity: z.ZodString;
465
+ mode: z.ZodEnum<{
466
+ read: "read";
467
+ write: "write";
468
+ }>;
469
+ }, z.core.$strict>, z.ZodObject<{
470
+ kind: z.ZodLiteral<"port">;
471
+ protocol: z.ZodEnum<{
472
+ tcp: "tcp";
473
+ udp: "udp";
474
+ }>;
475
+ address: z.ZodEnum<{
476
+ "*": "*";
477
+ "0.0.0.0": "0.0.0.0";
478
+ "127.0.0.1": "127.0.0.1";
479
+ "::": "::";
480
+ "::1": "::1";
481
+ }>;
482
+ port: z.ZodNumber;
483
+ mode: z.ZodEnum<{
484
+ read: "read";
485
+ write: "write";
486
+ }>;
487
+ }, z.core.$strict>]>;
488
+ path: z.ZodNullable<z.ZodString>;
489
+ object: z.ZodNullable<z.ZodString>;
490
+ ancestor: z.ZodNullable<z.ZodString>;
491
+ suffix: z.ZodNullable<z.ZodString>;
492
+ }, z.core.$strict>>;
493
+ produced: z.ZodNullable<z.ZodArray<z.ZodObject<{
494
+ path: z.ZodString;
495
+ object: z.ZodNullable<z.ZodString>;
496
+ kind: z.ZodEnum<{
497
+ absent: "absent";
498
+ directory: "directory";
499
+ file: "file";
500
+ }>;
501
+ hash: z.ZodNullable<z.ZodString>;
502
+ mode: z.ZodNullable<z.ZodNumber>;
503
+ }, z.core.$strict>>>;
504
+ validationImmutable: z.ZodNullable<z.ZodArray<z.ZodObject<{
505
+ path: z.ZodString;
506
+ object: z.ZodNullable<z.ZodString>;
507
+ kind: z.ZodEnum<{
508
+ absent: "absent";
509
+ directory: "directory";
510
+ file: "file";
511
+ }>;
512
+ hash: z.ZodNullable<z.ZodString>;
513
+ mode: z.ZodNullable<z.ZodNumber>;
514
+ }, z.core.$strict>>>;
515
+ validationOutputs: z.ZodNullable<z.ZodArray<z.ZodObject<{
516
+ path: z.ZodString;
517
+ object: z.ZodNullable<z.ZodString>;
518
+ kind: z.ZodEnum<{
519
+ absent: "absent";
520
+ directory: "directory";
521
+ file: "file";
522
+ }>;
523
+ hash: z.ZodNullable<z.ZodString>;
524
+ mode: z.ZodNullable<z.ZodNumber>;
525
+ }, z.core.$strict>>>;
526
+ worker: z.ZodEnum<{
527
+ authorized: "authorized";
528
+ closed: "closed";
529
+ "no-effect": "no-effect";
530
+ reserved: "reserved";
531
+ unknown: "unknown";
532
+ }>;
533
+ validation: z.ZodEnum<{
534
+ finished: "finished";
535
+ "not-started": "not-started";
536
+ running: "running";
537
+ unknown: "unknown";
538
+ }>;
539
+ fence: z.ZodEnum<{
540
+ canceled: "canceled";
541
+ current: "current";
542
+ failed: "failed";
543
+ superseded: "superseded";
544
+ }>;
545
+ retired: z.ZodBoolean;
546
+ accepted: z.ZodNullable<z.ZodObject<{
547
+ id: z.ZodString;
548
+ hash: z.ZodString;
549
+ }, z.core.$strict>>;
550
+ verificationExecution: z.ZodNullable<z.ZodObject<{
551
+ executionId: z.ZodString;
552
+ workspace: z.ZodString;
553
+ commands: z.ZodArray<z.ZodObject<{
554
+ name: z.ZodString;
555
+ command: z.ZodString;
556
+ }, z.core.$strict>>;
557
+ observations: z.ZodArray<z.ZodObject<{
558
+ name: z.ZodString;
559
+ command: z.ZodString;
560
+ cwd: z.ZodString;
561
+ exitStatus: z.ZodNumber;
562
+ pass: z.ZodBoolean;
563
+ }, z.core.$strict>>;
564
+ receipts: z.ZodArray<z.ZodObject<{
565
+ id: z.ZodString;
566
+ hash: z.ZodString;
567
+ envelope: z.ZodRecord<z.ZodString, z.ZodUnknown>;
568
+ }, z.core.$strict>>;
569
+ }, z.core.$strict>>;
570
+ }, z.core.$strict>;
571
+ export type ManagedTaskAttempt = z.infer<typeof ManagedTaskAttemptSchema>;
572
+ export declare const ManagedTaskGraphSchema: z.ZodObject<{
573
+ id: z.ZodString;
574
+ owner: z.ZodString;
575
+ revision: z.ZodNumber;
576
+ nodes: z.ZodArray<z.ZodObject<{
577
+ revision: z.ZodNumber;
578
+ hash: z.ZodString;
579
+ definition: z.ZodObject<{
580
+ id: z.ZodString;
581
+ task: z.ZodString;
582
+ workspace: z.ZodString;
583
+ predecessors: z.ZodArray<z.ZodString>;
584
+ criteriaIdentity: z.ZodString;
585
+ validations: z.ZodArray<z.ZodObject<{
586
+ name: z.ZodString;
587
+ command: z.ZodString;
588
+ }, z.core.$strict>>;
589
+ resources: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
590
+ kind: z.ZodLiteral<"path">;
591
+ path: z.ZodString;
592
+ mode: z.ZodEnum<{
593
+ read: "read";
594
+ write: "write";
595
+ }>;
596
+ recursive: z.ZodBoolean;
597
+ namespace: z.ZodBoolean;
598
+ }, z.core.$strict>, z.ZodObject<{
599
+ kind: z.ZodEnum<{
600
+ database: "database";
601
+ integration: "integration";
602
+ }>;
603
+ identity: z.ZodString;
604
+ mode: z.ZodEnum<{
605
+ read: "read";
606
+ write: "write";
607
+ }>;
608
+ }, z.core.$strict>, z.ZodObject<{
609
+ kind: z.ZodLiteral<"port">;
610
+ protocol: z.ZodEnum<{
611
+ tcp: "tcp";
612
+ udp: "udp";
613
+ }>;
614
+ address: z.ZodEnum<{
615
+ "*": "*";
616
+ "0.0.0.0": "0.0.0.0";
617
+ "127.0.0.1": "127.0.0.1";
618
+ "::": "::";
619
+ "::1": "::1";
620
+ }>;
621
+ port: z.ZodNumber;
622
+ mode: z.ZodEnum<{
623
+ read: "read";
624
+ write: "write";
625
+ }>;
626
+ }, z.core.$strict>]>>;
627
+ artifacts: z.ZodArray<z.ZodObject<{
628
+ path: z.ZodString;
629
+ role: z.ZodEnum<{
630
+ input: "input";
631
+ output: "output";
632
+ "read-write": "read-write";
633
+ "validation-output": "validation-output";
634
+ }>;
635
+ presence: z.ZodEnum<{
636
+ absent: "absent";
637
+ optional: "optional";
638
+ required: "required";
639
+ }>;
640
+ }, z.core.$strict>>;
641
+ }, z.core.$strict>;
642
+ }, z.core.$strict>>;
643
+ attempts: z.ZodArray<z.ZodObject<{
644
+ id: z.ZodString;
645
+ nodeId: z.ZodString;
646
+ taskRevision: z.ZodNumber;
647
+ graphRevision: z.ZodNumber;
648
+ definitionHash: z.ZodString;
649
+ definition: z.ZodObject<{
650
+ id: z.ZodString;
651
+ task: z.ZodString;
652
+ workspace: z.ZodString;
653
+ predecessors: z.ZodArray<z.ZodString>;
654
+ criteriaIdentity: z.ZodString;
655
+ validations: z.ZodArray<z.ZodObject<{
656
+ name: z.ZodString;
657
+ command: z.ZodString;
658
+ }, z.core.$strict>>;
659
+ resources: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
660
+ kind: z.ZodLiteral<"path">;
661
+ path: z.ZodString;
662
+ mode: z.ZodEnum<{
663
+ read: "read";
664
+ write: "write";
665
+ }>;
666
+ recursive: z.ZodBoolean;
667
+ namespace: z.ZodBoolean;
668
+ }, z.core.$strict>, z.ZodObject<{
669
+ kind: z.ZodEnum<{
670
+ database: "database";
671
+ integration: "integration";
672
+ }>;
673
+ identity: z.ZodString;
674
+ mode: z.ZodEnum<{
675
+ read: "read";
676
+ write: "write";
677
+ }>;
678
+ }, z.core.$strict>, z.ZodObject<{
679
+ kind: z.ZodLiteral<"port">;
680
+ protocol: z.ZodEnum<{
681
+ tcp: "tcp";
682
+ udp: "udp";
683
+ }>;
684
+ address: z.ZodEnum<{
685
+ "*": "*";
686
+ "0.0.0.0": "0.0.0.0";
687
+ "127.0.0.1": "127.0.0.1";
688
+ "::": "::";
689
+ "::1": "::1";
690
+ }>;
691
+ port: z.ZodNumber;
692
+ mode: z.ZodEnum<{
693
+ read: "read";
694
+ write: "write";
695
+ }>;
696
+ }, z.core.$strict>]>>;
697
+ artifacts: z.ZodArray<z.ZodObject<{
698
+ path: z.ZodString;
699
+ role: z.ZodEnum<{
700
+ input: "input";
701
+ output: "output";
702
+ "read-write": "read-write";
703
+ "validation-output": "validation-output";
704
+ }>;
705
+ presence: z.ZodEnum<{
706
+ absent: "absent";
707
+ optional: "optional";
708
+ required: "required";
709
+ }>;
710
+ }, z.core.$strict>>;
711
+ }, z.core.$strict>;
712
+ native: z.ZodObject<{
713
+ key: z.ZodString;
714
+ identity: z.ZodString;
715
+ requestHash: z.ZodString;
716
+ }, z.core.$strict>;
717
+ inputs: z.ZodArray<z.ZodObject<{
718
+ path: z.ZodString;
719
+ object: z.ZodNullable<z.ZodString>;
720
+ kind: z.ZodEnum<{
721
+ absent: "absent";
722
+ directory: "directory";
723
+ file: "file";
724
+ }>;
725
+ hash: z.ZodNullable<z.ZodString>;
726
+ mode: z.ZodNullable<z.ZodNumber>;
727
+ }, z.core.$strict>>;
728
+ predecessors: z.ZodArray<z.ZodObject<{
729
+ nodeId: z.ZodString;
730
+ taskRevision: z.ZodNumber;
731
+ attemptId: z.ZodString;
732
+ verificationId: z.ZodString;
733
+ verificationHash: z.ZodString;
734
+ produced: z.ZodArray<z.ZodObject<{
735
+ path: z.ZodString;
736
+ object: z.ZodNullable<z.ZodString>;
737
+ kind: z.ZodEnum<{
738
+ absent: "absent";
739
+ directory: "directory";
740
+ file: "file";
741
+ }>;
742
+ hash: z.ZodNullable<z.ZodString>;
743
+ mode: z.ZodNullable<z.ZodNumber>;
744
+ }, z.core.$strict>>;
745
+ }, z.core.$strict>>;
746
+ resources: z.ZodArray<z.ZodObject<{
747
+ declaration: z.ZodUnion<readonly [z.ZodObject<{
748
+ kind: z.ZodLiteral<"path">;
749
+ path: z.ZodString;
750
+ mode: z.ZodEnum<{
751
+ read: "read";
752
+ write: "write";
753
+ }>;
754
+ recursive: z.ZodBoolean;
755
+ namespace: z.ZodBoolean;
756
+ }, z.core.$strict>, z.ZodObject<{
757
+ kind: z.ZodEnum<{
758
+ database: "database";
759
+ integration: "integration";
760
+ }>;
761
+ identity: z.ZodString;
762
+ mode: z.ZodEnum<{
763
+ read: "read";
764
+ write: "write";
765
+ }>;
766
+ }, z.core.$strict>, z.ZodObject<{
767
+ kind: z.ZodLiteral<"port">;
768
+ protocol: z.ZodEnum<{
769
+ tcp: "tcp";
770
+ udp: "udp";
771
+ }>;
772
+ address: z.ZodEnum<{
773
+ "*": "*";
774
+ "0.0.0.0": "0.0.0.0";
775
+ "127.0.0.1": "127.0.0.1";
776
+ "::": "::";
777
+ "::1": "::1";
778
+ }>;
779
+ port: z.ZodNumber;
780
+ mode: z.ZodEnum<{
781
+ read: "read";
782
+ write: "write";
783
+ }>;
784
+ }, z.core.$strict>]>;
785
+ path: z.ZodNullable<z.ZodString>;
786
+ object: z.ZodNullable<z.ZodString>;
787
+ ancestor: z.ZodNullable<z.ZodString>;
788
+ suffix: z.ZodNullable<z.ZodString>;
789
+ }, z.core.$strict>>;
790
+ produced: z.ZodNullable<z.ZodArray<z.ZodObject<{
791
+ path: z.ZodString;
792
+ object: z.ZodNullable<z.ZodString>;
793
+ kind: z.ZodEnum<{
794
+ absent: "absent";
795
+ directory: "directory";
796
+ file: "file";
797
+ }>;
798
+ hash: z.ZodNullable<z.ZodString>;
799
+ mode: z.ZodNullable<z.ZodNumber>;
800
+ }, z.core.$strict>>>;
801
+ validationImmutable: z.ZodNullable<z.ZodArray<z.ZodObject<{
802
+ path: z.ZodString;
803
+ object: z.ZodNullable<z.ZodString>;
804
+ kind: z.ZodEnum<{
805
+ absent: "absent";
806
+ directory: "directory";
807
+ file: "file";
808
+ }>;
809
+ hash: z.ZodNullable<z.ZodString>;
810
+ mode: z.ZodNullable<z.ZodNumber>;
811
+ }, z.core.$strict>>>;
812
+ validationOutputs: z.ZodNullable<z.ZodArray<z.ZodObject<{
813
+ path: z.ZodString;
814
+ object: z.ZodNullable<z.ZodString>;
815
+ kind: z.ZodEnum<{
816
+ absent: "absent";
817
+ directory: "directory";
818
+ file: "file";
819
+ }>;
820
+ hash: z.ZodNullable<z.ZodString>;
821
+ mode: z.ZodNullable<z.ZodNumber>;
822
+ }, z.core.$strict>>>;
823
+ worker: z.ZodEnum<{
824
+ authorized: "authorized";
825
+ closed: "closed";
826
+ "no-effect": "no-effect";
827
+ reserved: "reserved";
828
+ unknown: "unknown";
829
+ }>;
830
+ validation: z.ZodEnum<{
831
+ finished: "finished";
832
+ "not-started": "not-started";
833
+ running: "running";
834
+ unknown: "unknown";
835
+ }>;
836
+ fence: z.ZodEnum<{
837
+ canceled: "canceled";
838
+ current: "current";
839
+ failed: "failed";
840
+ superseded: "superseded";
841
+ }>;
842
+ retired: z.ZodBoolean;
843
+ accepted: z.ZodNullable<z.ZodObject<{
844
+ id: z.ZodString;
845
+ hash: z.ZodString;
846
+ }, z.core.$strict>>;
847
+ verificationExecution: z.ZodNullable<z.ZodObject<{
848
+ executionId: z.ZodString;
849
+ workspace: z.ZodString;
850
+ commands: z.ZodArray<z.ZodObject<{
851
+ name: z.ZodString;
852
+ command: z.ZodString;
853
+ }, z.core.$strict>>;
854
+ observations: z.ZodArray<z.ZodObject<{
855
+ name: z.ZodString;
856
+ command: z.ZodString;
857
+ cwd: z.ZodString;
858
+ exitStatus: z.ZodNumber;
859
+ pass: z.ZodBoolean;
860
+ }, z.core.$strict>>;
861
+ receipts: z.ZodArray<z.ZodObject<{
862
+ id: z.ZodString;
863
+ hash: z.ZodString;
864
+ envelope: z.ZodRecord<z.ZodString, z.ZodUnknown>;
865
+ }, z.core.$strict>>;
866
+ }, z.core.$strict>>;
867
+ }, z.core.$strict>>;
868
+ canceled: z.ZodArray<z.ZodString>;
869
+ }, z.core.$strict>;
870
+ export type ManagedTaskGraph = z.infer<typeof ManagedTaskGraphSchema>;
871
+ export declare const ManagedDomainBindingSchema: z.ZodObject<{
872
+ controlRoot: z.ZodString;
873
+ rootIdentity: z.ZodString;
874
+ agentDir: z.ZodString;
875
+ agentDirIdentity: z.ZodString;
876
+ enrollmentId: z.ZodString;
877
+ worktrees: z.ZodArray<z.ZodObject<{
878
+ path: z.ZodString;
879
+ identity: z.ZodString;
880
+ }, z.core.$strict>>;
881
+ aliases: z.ZodArray<z.ZodObject<{
882
+ path: z.ZodString;
883
+ target: z.ZodString;
884
+ }, z.core.$strict>>;
885
+ }, z.core.$strict>;
886
+ export type ManagedDomainBinding = z.infer<typeof ManagedDomainBindingSchema>;
887
+ export declare const ManagedTaskDomainSchema: z.ZodObject<{
888
+ version: z.ZodLiteral<1>;
889
+ state_revision: z.ZodNumber;
890
+ binding: z.ZodObject<{
891
+ controlRoot: z.ZodString;
892
+ rootIdentity: z.ZodString;
893
+ agentDir: z.ZodString;
894
+ agentDirIdentity: z.ZodString;
895
+ enrollmentId: z.ZodString;
896
+ worktrees: z.ZodArray<z.ZodObject<{
897
+ path: z.ZodString;
898
+ identity: z.ZodString;
899
+ }, z.core.$strict>>;
900
+ aliases: z.ZodArray<z.ZodObject<{
901
+ path: z.ZodString;
902
+ target: z.ZodString;
903
+ }, z.core.$strict>>;
904
+ }, z.core.$strict>;
905
+ graphs: z.ZodArray<z.ZodObject<{
906
+ id: z.ZodString;
907
+ owner: z.ZodString;
908
+ revision: z.ZodNumber;
909
+ nodes: z.ZodArray<z.ZodObject<{
910
+ revision: z.ZodNumber;
911
+ hash: z.ZodString;
912
+ definition: z.ZodObject<{
913
+ id: z.ZodString;
914
+ task: z.ZodString;
915
+ workspace: z.ZodString;
916
+ predecessors: z.ZodArray<z.ZodString>;
917
+ criteriaIdentity: z.ZodString;
918
+ validations: z.ZodArray<z.ZodObject<{
919
+ name: z.ZodString;
920
+ command: z.ZodString;
921
+ }, z.core.$strict>>;
922
+ resources: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
923
+ kind: z.ZodLiteral<"path">;
924
+ path: z.ZodString;
925
+ mode: z.ZodEnum<{
926
+ read: "read";
927
+ write: "write";
928
+ }>;
929
+ recursive: z.ZodBoolean;
930
+ namespace: z.ZodBoolean;
931
+ }, z.core.$strict>, z.ZodObject<{
932
+ kind: z.ZodEnum<{
933
+ database: "database";
934
+ integration: "integration";
935
+ }>;
936
+ identity: z.ZodString;
937
+ mode: z.ZodEnum<{
938
+ read: "read";
939
+ write: "write";
940
+ }>;
941
+ }, z.core.$strict>, z.ZodObject<{
942
+ kind: z.ZodLiteral<"port">;
943
+ protocol: z.ZodEnum<{
944
+ tcp: "tcp";
945
+ udp: "udp";
946
+ }>;
947
+ address: z.ZodEnum<{
948
+ "*": "*";
949
+ "0.0.0.0": "0.0.0.0";
950
+ "127.0.0.1": "127.0.0.1";
951
+ "::": "::";
952
+ "::1": "::1";
953
+ }>;
954
+ port: z.ZodNumber;
955
+ mode: z.ZodEnum<{
956
+ read: "read";
957
+ write: "write";
958
+ }>;
959
+ }, z.core.$strict>]>>;
960
+ artifacts: z.ZodArray<z.ZodObject<{
961
+ path: z.ZodString;
962
+ role: z.ZodEnum<{
963
+ input: "input";
964
+ output: "output";
965
+ "read-write": "read-write";
966
+ "validation-output": "validation-output";
967
+ }>;
968
+ presence: z.ZodEnum<{
969
+ absent: "absent";
970
+ optional: "optional";
971
+ required: "required";
972
+ }>;
973
+ }, z.core.$strict>>;
974
+ }, z.core.$strict>;
975
+ }, z.core.$strict>>;
976
+ attempts: z.ZodArray<z.ZodObject<{
977
+ id: z.ZodString;
978
+ nodeId: z.ZodString;
979
+ taskRevision: z.ZodNumber;
980
+ graphRevision: z.ZodNumber;
981
+ definitionHash: z.ZodString;
982
+ definition: z.ZodObject<{
983
+ id: z.ZodString;
984
+ task: z.ZodString;
985
+ workspace: z.ZodString;
986
+ predecessors: z.ZodArray<z.ZodString>;
987
+ criteriaIdentity: z.ZodString;
988
+ validations: z.ZodArray<z.ZodObject<{
989
+ name: z.ZodString;
990
+ command: z.ZodString;
991
+ }, z.core.$strict>>;
992
+ resources: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
993
+ kind: z.ZodLiteral<"path">;
994
+ path: z.ZodString;
995
+ mode: z.ZodEnum<{
996
+ read: "read";
997
+ write: "write";
998
+ }>;
999
+ recursive: z.ZodBoolean;
1000
+ namespace: z.ZodBoolean;
1001
+ }, z.core.$strict>, z.ZodObject<{
1002
+ kind: z.ZodEnum<{
1003
+ database: "database";
1004
+ integration: "integration";
1005
+ }>;
1006
+ identity: z.ZodString;
1007
+ mode: z.ZodEnum<{
1008
+ read: "read";
1009
+ write: "write";
1010
+ }>;
1011
+ }, z.core.$strict>, z.ZodObject<{
1012
+ kind: z.ZodLiteral<"port">;
1013
+ protocol: z.ZodEnum<{
1014
+ tcp: "tcp";
1015
+ udp: "udp";
1016
+ }>;
1017
+ address: z.ZodEnum<{
1018
+ "*": "*";
1019
+ "0.0.0.0": "0.0.0.0";
1020
+ "127.0.0.1": "127.0.0.1";
1021
+ "::": "::";
1022
+ "::1": "::1";
1023
+ }>;
1024
+ port: z.ZodNumber;
1025
+ mode: z.ZodEnum<{
1026
+ read: "read";
1027
+ write: "write";
1028
+ }>;
1029
+ }, z.core.$strict>]>>;
1030
+ artifacts: z.ZodArray<z.ZodObject<{
1031
+ path: z.ZodString;
1032
+ role: z.ZodEnum<{
1033
+ input: "input";
1034
+ output: "output";
1035
+ "read-write": "read-write";
1036
+ "validation-output": "validation-output";
1037
+ }>;
1038
+ presence: z.ZodEnum<{
1039
+ absent: "absent";
1040
+ optional: "optional";
1041
+ required: "required";
1042
+ }>;
1043
+ }, z.core.$strict>>;
1044
+ }, z.core.$strict>;
1045
+ native: z.ZodObject<{
1046
+ key: z.ZodString;
1047
+ identity: z.ZodString;
1048
+ requestHash: z.ZodString;
1049
+ }, z.core.$strict>;
1050
+ inputs: z.ZodArray<z.ZodObject<{
1051
+ path: z.ZodString;
1052
+ object: z.ZodNullable<z.ZodString>;
1053
+ kind: z.ZodEnum<{
1054
+ absent: "absent";
1055
+ directory: "directory";
1056
+ file: "file";
1057
+ }>;
1058
+ hash: z.ZodNullable<z.ZodString>;
1059
+ mode: z.ZodNullable<z.ZodNumber>;
1060
+ }, z.core.$strict>>;
1061
+ predecessors: z.ZodArray<z.ZodObject<{
1062
+ nodeId: z.ZodString;
1063
+ taskRevision: z.ZodNumber;
1064
+ attemptId: z.ZodString;
1065
+ verificationId: z.ZodString;
1066
+ verificationHash: z.ZodString;
1067
+ produced: z.ZodArray<z.ZodObject<{
1068
+ path: z.ZodString;
1069
+ object: z.ZodNullable<z.ZodString>;
1070
+ kind: z.ZodEnum<{
1071
+ absent: "absent";
1072
+ directory: "directory";
1073
+ file: "file";
1074
+ }>;
1075
+ hash: z.ZodNullable<z.ZodString>;
1076
+ mode: z.ZodNullable<z.ZodNumber>;
1077
+ }, z.core.$strict>>;
1078
+ }, z.core.$strict>>;
1079
+ resources: z.ZodArray<z.ZodObject<{
1080
+ declaration: z.ZodUnion<readonly [z.ZodObject<{
1081
+ kind: z.ZodLiteral<"path">;
1082
+ path: z.ZodString;
1083
+ mode: z.ZodEnum<{
1084
+ read: "read";
1085
+ write: "write";
1086
+ }>;
1087
+ recursive: z.ZodBoolean;
1088
+ namespace: z.ZodBoolean;
1089
+ }, z.core.$strict>, z.ZodObject<{
1090
+ kind: z.ZodEnum<{
1091
+ database: "database";
1092
+ integration: "integration";
1093
+ }>;
1094
+ identity: z.ZodString;
1095
+ mode: z.ZodEnum<{
1096
+ read: "read";
1097
+ write: "write";
1098
+ }>;
1099
+ }, z.core.$strict>, z.ZodObject<{
1100
+ kind: z.ZodLiteral<"port">;
1101
+ protocol: z.ZodEnum<{
1102
+ tcp: "tcp";
1103
+ udp: "udp";
1104
+ }>;
1105
+ address: z.ZodEnum<{
1106
+ "*": "*";
1107
+ "0.0.0.0": "0.0.0.0";
1108
+ "127.0.0.1": "127.0.0.1";
1109
+ "::": "::";
1110
+ "::1": "::1";
1111
+ }>;
1112
+ port: z.ZodNumber;
1113
+ mode: z.ZodEnum<{
1114
+ read: "read";
1115
+ write: "write";
1116
+ }>;
1117
+ }, z.core.$strict>]>;
1118
+ path: z.ZodNullable<z.ZodString>;
1119
+ object: z.ZodNullable<z.ZodString>;
1120
+ ancestor: z.ZodNullable<z.ZodString>;
1121
+ suffix: z.ZodNullable<z.ZodString>;
1122
+ }, z.core.$strict>>;
1123
+ produced: z.ZodNullable<z.ZodArray<z.ZodObject<{
1124
+ path: z.ZodString;
1125
+ object: z.ZodNullable<z.ZodString>;
1126
+ kind: z.ZodEnum<{
1127
+ absent: "absent";
1128
+ directory: "directory";
1129
+ file: "file";
1130
+ }>;
1131
+ hash: z.ZodNullable<z.ZodString>;
1132
+ mode: z.ZodNullable<z.ZodNumber>;
1133
+ }, z.core.$strict>>>;
1134
+ validationImmutable: z.ZodNullable<z.ZodArray<z.ZodObject<{
1135
+ path: z.ZodString;
1136
+ object: z.ZodNullable<z.ZodString>;
1137
+ kind: z.ZodEnum<{
1138
+ absent: "absent";
1139
+ directory: "directory";
1140
+ file: "file";
1141
+ }>;
1142
+ hash: z.ZodNullable<z.ZodString>;
1143
+ mode: z.ZodNullable<z.ZodNumber>;
1144
+ }, z.core.$strict>>>;
1145
+ validationOutputs: z.ZodNullable<z.ZodArray<z.ZodObject<{
1146
+ path: z.ZodString;
1147
+ object: z.ZodNullable<z.ZodString>;
1148
+ kind: z.ZodEnum<{
1149
+ absent: "absent";
1150
+ directory: "directory";
1151
+ file: "file";
1152
+ }>;
1153
+ hash: z.ZodNullable<z.ZodString>;
1154
+ mode: z.ZodNullable<z.ZodNumber>;
1155
+ }, z.core.$strict>>>;
1156
+ worker: z.ZodEnum<{
1157
+ authorized: "authorized";
1158
+ closed: "closed";
1159
+ "no-effect": "no-effect";
1160
+ reserved: "reserved";
1161
+ unknown: "unknown";
1162
+ }>;
1163
+ validation: z.ZodEnum<{
1164
+ finished: "finished";
1165
+ "not-started": "not-started";
1166
+ running: "running";
1167
+ unknown: "unknown";
1168
+ }>;
1169
+ fence: z.ZodEnum<{
1170
+ canceled: "canceled";
1171
+ current: "current";
1172
+ failed: "failed";
1173
+ superseded: "superseded";
1174
+ }>;
1175
+ retired: z.ZodBoolean;
1176
+ accepted: z.ZodNullable<z.ZodObject<{
1177
+ id: z.ZodString;
1178
+ hash: z.ZodString;
1179
+ }, z.core.$strict>>;
1180
+ verificationExecution: z.ZodNullable<z.ZodObject<{
1181
+ executionId: z.ZodString;
1182
+ workspace: z.ZodString;
1183
+ commands: z.ZodArray<z.ZodObject<{
1184
+ name: z.ZodString;
1185
+ command: z.ZodString;
1186
+ }, z.core.$strict>>;
1187
+ observations: z.ZodArray<z.ZodObject<{
1188
+ name: z.ZodString;
1189
+ command: z.ZodString;
1190
+ cwd: z.ZodString;
1191
+ exitStatus: z.ZodNumber;
1192
+ pass: z.ZodBoolean;
1193
+ }, z.core.$strict>>;
1194
+ receipts: z.ZodArray<z.ZodObject<{
1195
+ id: z.ZodString;
1196
+ hash: z.ZodString;
1197
+ envelope: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1198
+ }, z.core.$strict>>;
1199
+ }, z.core.$strict>>;
1200
+ }, z.core.$strict>>;
1201
+ canceled: z.ZodArray<z.ZodString>;
1202
+ }, z.core.$strict>>;
1203
+ }, z.core.$strict>;
1204
+ export type ManagedTaskDomain = z.infer<typeof ManagedTaskDomainSchema>;
1205
+ /**
1206
+ * Internal M2 handoff object. It is returned only after a durable M1
1207
+ * reservation; M2 must keep it private after verified Broker admission.
1208
+ */
1209
+ export interface ManagedAttemptRef {
1210
+ readonly controlRoot: string;
1211
+ readonly enrollmentId: string;
1212
+ readonly agentDirIdentity: string;
1213
+ readonly graphId: string;
1214
+ readonly graphRevision: number;
1215
+ readonly nodeId: string;
1216
+ readonly taskRevision: number;
1217
+ readonly attemptId: string;
1218
+ readonly definitionHash: string;
1219
+ readonly criteriaIdentity: string;
1220
+ readonly inputIdentity: string;
1221
+ readonly predecessorIdentity: string;
1222
+ readonly resourceIdentity: string;
1223
+ readonly native: ManagedNativeIdentity;
1224
+ readonly nativeIdentity: string;
1225
+ }
1226
+ export declare function managedIdentity(value: unknown): string;
1227
+ export type ManagedEnrollmentRecord = {
1228
+ controlRoots: string[];
1229
+ establishedRoots: string[];
1230
+ publishingRoots: string[];
1231
+ nativeIdentities: string[];
1232
+ byRoot: Record<string, string[]>;
1233
+ };
1234
+ export declare function within(parent: string, child: string): boolean;
1235
+ export interface ManagedDomainBindingInput {
1236
+ controlRoot: string;
1237
+ agentDir: string;
1238
+ enrollmentId: string;
1239
+ worktrees: string[];
1240
+ aliases?: string[];
1241
+ }
1242
+ /** Explicit aliases are accepted only while their real target remains the enrolled target. */
1243
+ export declare function createManagedDomainBinding(input: ManagedDomainBindingInput): Promise<ManagedDomainBinding>;
1244
+ export declare function canonicalizeManagedResources(binding: ManagedDomainBinding, declarations: ManagedResource[]): Promise<ManagedCanonicalResource[]>;
1245
+ export declare function managedResourcesOverlap(a: ManagedCanonicalResource, b: ManagedCanonicalResource): boolean;
1246
+ export declare function managedResourcesConflict(a: ManagedCanonicalResource, b: ManagedCanonicalResource): boolean;
1247
+ export declare function parseManagedTaskDefinitions(value: unknown): ManagedTaskDefinition[];
1248
+ export declare function resourceCoversPath(resource: ManagedCanonicalResource, targetPath: string, needed: "read" | "write"): boolean;
1249
+ export declare function captureManagedManifest(binding: ManagedDomainBinding, paths: string[]): Promise<ManagedManifest>;
1250
+ export declare function assertManagedManifestCurrent(binding: ManagedDomainBinding, manifest: ManagedManifest): Promise<void>;
1251
+ export declare function managedTaskDomainPath(controlRoot: string): string;
1252
+ export declare function managedEnrollmentIndexPath(agentDir: string): string;
1253
+ export declare function validateManagedTaskDomain(value: unknown): ManagedTaskDomain;
1254
+ export interface ManagedDomainTransactionOptions {
1255
+ binding: ManagedDomainBinding;
1256
+ expectedRevision?: number;
1257
+ /** Only for first enrollment; caller checks its authoritative registration/native journal under this lock. */
1258
+ assertNoManagedEvidence?: () => Promise<void>;
1259
+ /** Publish a fail-closed marker after definition validation but before the first state write. */
1260
+ beforeFirstPublication?: () => Promise<void>;
1261
+ /** Runs under the domain lock after the first state is durable, serialized with stale-index reclamation. */
1262
+ onFirstPublication?: () => Promise<void>;
1263
+ /** Restore pending only when the state writer proves it failed before rename. */
1264
+ onFirstPublicationAborted?: () => Promise<void>;
1265
+ /** Trusted native/internal observation: reload under the lock and CAS against the live revision. */
1266
+ internal?: boolean;
1267
+ }
1268
+ /** Trusted internal policy boundary, NOT a public wire parser or receipt/PASS submission API. */
1269
+ export declare function transactManagedTaskDomain<T>(options: ManagedDomainTransactionOptions, mutation: (state: ManagedTaskDomain) => Promise<T>): Promise<{
1270
+ state: ManagedTaskDomain;
1271
+ result: T;
1272
+ }>;
1273
+ export declare function defineManagedTaskGraph(state: ManagedTaskDomain, input: {
1274
+ id: string;
1275
+ owner: string;
1276
+ nodes: unknown;
1277
+ }): Promise<ManagedTaskGraph>;
1278
+ export declare function readyManagedTasks(graph: ManagedTaskGraph): string[];
1279
+ /** Exact same-key retry observes the original reservation; otherwise admits a new one. */
1280
+ export declare function observeOrAdmitManagedTask(state: ManagedTaskDomain, input: {
1281
+ graphId: string;
1282
+ owner: string;
1283
+ nodeId: string;
1284
+ attemptId: string;
1285
+ native: ManagedNativeIdentity;
1286
+ }): Promise<ManagedAttemptRef>;
1287
+ /** Caller supplies native deriveIdempotencyIdentity result only after authenticated admission. No native effect here. */
1288
+ export declare function admitManagedTask(state: ManagedTaskDomain, input: {
1289
+ graphId: string;
1290
+ owner: string;
1291
+ nodeId: string;
1292
+ attemptId: string;
1293
+ native: ManagedNativeIdentity;
1294
+ }): Promise<ManagedAttemptRef>;
1295
+ export declare function canRetireManagedAttempt(attempt: ManagedTaskAttempt): boolean;
1296
+ export declare function retireManagedAttempt(attempt: ManagedTaskAttempt): void;
1297
+ /** Invalidation never releases reservations or rewrites old immutable attempts. */
1298
+ export declare function cancelManagedTasks(graph: ManagedTaskGraph, ids: string[]): string[];
1299
+ export declare function reviseManagedTaskGraph(state: ManagedTaskDomain, graph: ManagedTaskGraph, value: unknown): Promise<string[]>;
1300
+ export declare function reducedWorkroomManagedDefinitions(workspace: string, criteriaIdentity: string): ManagedTaskDefinition[];
1301
+ export type ManagedNativeEffectFence = "launch" | "seed";
1302
+ export declare function managedNativeVector(attempt: ManagedTaskAttempt): string;
1303
+ export declare function lookupManagedAttemptByNativeIdentity(state: ManagedTaskDomain, nativeIdentity: string): ManagedTaskAttempt | undefined;
1304
+ /** Trusted read of one attempt under the domain lock. Does not mint ManagedAttemptRef. */
1305
+ export declare function inspectManagedAttemptByNativeIdentity(binding: ManagedDomainBinding, nativeIdentity: string): Promise<ManagedTaskAttempt | undefined>;
1306
+ /**
1307
+ * Recheck current fence and immutable native vector, then run the native
1308
+ * transition before releasing the domain lock. Callers must not enter this
1309
+ * from a nested native serialization callback.
1310
+ */
1311
+ export declare function withManagedNativeEffectAuthorized<T>(binding: ManagedDomainBinding, nativeIdentity: string, expectedVector: string, fence: ManagedNativeEffectFence, effect: () => Promise<T>): Promise<T>;
1312
+ export declare function assertManagedNativeEffectAuthorized(binding: ManagedDomainBinding, nativeIdentity: string, expectedVector: string, fence: ManagedNativeEffectFence): Promise<void>;
1313
+ export declare function managedAttemptRefMatches(ref: ManagedAttemptRef, attempt: ManagedTaskAttempt, binding: ManagedDomainBinding): boolean;
1314
+ export type ManagedNativeObservation = "no-effect" | "authorized" | "unknown" | "closed";
1315
+ export declare function managedAttemptRefFromState(state: ManagedTaskDomain, attempt: ManagedTaskAttempt, graphId: string): ManagedAttemptRef;
1316
+ export declare function loadManagedEnrollmentIndex(agentDir: string): Promise<string[]>;
1317
+ export declare function loadManagedEnrollmentRecord(agentDir: string): Promise<ManagedEnrollmentRecord>;
1318
+ export declare function recordManagedEnrollment(agentDir: string, controlRoot: string, nativeIdentity?: string): Promise<void>;
1319
+ /** Mark a first domain publication in progress before its state rename. */
1320
+ export declare function markManagedEnrollmentPublishing(agentDir: string, controlRoot: string): Promise<void>;
1321
+ /** A valid domain snapshot is authoritative even if the marker update was interrupted. */
1322
+ export declare function markManagedEnrollmentEstablished(agentDir: string, controlRoot: string): Promise<void>;
1323
+ /** Only a proven pre-rename state-write failure may return publication to pending. */
1324
+ export declare function markManagedEnrollmentPending(agentDir: string, controlRoot: string): Promise<void>;
1325
+ export declare function currentManagedRevision(binding: ManagedDomainBinding): Promise<number>;
1326
+ export declare function recordManagedNativeObservation(binding: ManagedDomainBinding, nativeIdentity: string, worker: ManagedNativeObservation, authorize?: {
1327
+ fence: ManagedNativeEffectFence;
1328
+ expectedVector: string;
1329
+ }): Promise<void>;
1330
+ export type RestoredManagedAttemptRefs = {
1331
+ refs: ManagedAttemptRef[];
1332
+ failedRoots: string[];
1333
+ };
1334
+ export declare function restoreManagedAttemptRefs(agentDir: string): Promise<RestoredManagedAttemptRefs>;
1335
+ export declare function loadManagedDomainBinding(controlRoot: string): Promise<ManagedDomainBinding | undefined>;