@cleocode/contracts 2026.6.12 → 2026.6.13

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 (136) hide show
  1. package/dist/__tests__/operation-def.test.js +2 -1
  2. package/dist/__tests__/operation-def.test.js.map +1 -1
  3. package/dist/__tests__/sealed-credential.test.d.ts +19 -0
  4. package/dist/__tests__/sealed-credential.test.d.ts.map +1 -0
  5. package/dist/__tests__/sealed-credential.test.js +74 -0
  6. package/dist/__tests__/sealed-credential.test.js.map +1 -0
  7. package/dist/__tests__/skill-executor-contract.test.js +3 -0
  8. package/dist/__tests__/skill-executor-contract.test.js.map +1 -1
  9. package/dist/acceptance-gate.d.ts +2 -3
  10. package/dist/acceptance-gate.d.ts.map +1 -1
  11. package/dist/boundary.d.ts.map +1 -1
  12. package/dist/boundary.js +1 -19
  13. package/dist/boundary.js.map +1 -1
  14. package/dist/config.d.ts +102 -0
  15. package/dist/config.d.ts.map +1 -1
  16. package/dist/data-accessor.d.ts +21 -1
  17. package/dist/data-accessor.d.ts.map +1 -1
  18. package/dist/data-accessor.js.map +1 -1
  19. package/dist/dispatch/identity.d.ts +1 -1
  20. package/dist/dispatch/identity.d.ts.map +1 -1
  21. package/dist/dispatch/identity.js +5 -0
  22. package/dist/dispatch/identity.js.map +1 -1
  23. package/dist/dispatch/operations-registry.d.ts.map +1 -1
  24. package/dist/dispatch/operations-registry.js +46 -168
  25. package/dist/dispatch/operations-registry.js.map +1 -1
  26. package/dist/docs/read.d.ts +2 -2
  27. package/dist/index.d.ts +12 -7
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +3 -0
  30. package/dist/index.js.map +1 -1
  31. package/dist/lease-ipc/__tests__/freeze.test.d.ts +15 -0
  32. package/dist/lease-ipc/__tests__/freeze.test.d.ts.map +1 -0
  33. package/dist/lease-ipc/__tests__/freeze.test.js +221 -0
  34. package/dist/lease-ipc/__tests__/freeze.test.js.map +1 -0
  35. package/dist/lease-ipc/index.d.ts +17 -0
  36. package/dist/lease-ipc/index.d.ts.map +1 -0
  37. package/dist/lease-ipc/index.js +16 -0
  38. package/dist/lease-ipc/index.js.map +1 -0
  39. package/dist/lease-ipc/messages.d.ts +754 -0
  40. package/dist/lease-ipc/messages.d.ts.map +1 -0
  41. package/dist/lease-ipc/messages.js +383 -0
  42. package/dist/lease-ipc/messages.js.map +1 -0
  43. package/dist/lease-ipc/version.d.ts +41 -0
  44. package/dist/lease-ipc/version.d.ts.map +1 -0
  45. package/dist/lease-ipc/version.js +43 -0
  46. package/dist/lease-ipc/version.js.map +1 -0
  47. package/dist/llm/interfaces.d.ts +23 -0
  48. package/dist/llm/interfaces.d.ts.map +1 -1
  49. package/dist/llm/sealed-credential.d.ts +164 -0
  50. package/dist/llm/sealed-credential.d.ts.map +1 -0
  51. package/dist/llm/sealed-credential.js +43 -0
  52. package/dist/llm/sealed-credential.js.map +1 -0
  53. package/dist/llm/system-of-use.d.ts +383 -0
  54. package/dist/llm/system-of-use.d.ts.map +1 -0
  55. package/dist/llm/system-of-use.js +238 -0
  56. package/dist/llm/system-of-use.js.map +1 -0
  57. package/dist/llm/system-resolver.d.ts +45 -11
  58. package/dist/llm/system-resolver.d.ts.map +1 -1
  59. package/dist/llm/system-resolver.js +14 -7
  60. package/dist/llm/system-resolver.js.map +1 -1
  61. package/dist/operations/__tests__/ensures-schema-registry.test.d.ts +17 -0
  62. package/dist/operations/__tests__/ensures-schema-registry.test.d.ts.map +1 -0
  63. package/dist/operations/__tests__/ensures-schema-registry.test.js +113 -0
  64. package/dist/operations/__tests__/ensures-schema-registry.test.js.map +1 -0
  65. package/dist/operations/ensures-schema-registry.d.ts +172 -0
  66. package/dist/operations/ensures-schema-registry.d.ts.map +1 -0
  67. package/dist/operations/ensures-schema-registry.js +226 -0
  68. package/dist/operations/ensures-schema-registry.js.map +1 -0
  69. package/dist/operations/llm.d.ts +101 -9
  70. package/dist/operations/llm.d.ts.map +1 -1
  71. package/dist/operations/validate.d.ts +1 -12
  72. package/dist/operations/validate.d.ts.map +1 -1
  73. package/dist/operations/validate.js +1 -1
  74. package/dist/playbook.d.ts +60 -0
  75. package/dist/playbook.d.ts.map +1 -1
  76. package/dist/session.d.ts +11 -0
  77. package/dist/session.d.ts.map +1 -1
  78. package/dist/session.js.map +1 -1
  79. package/dist/templates/manifest.d.ts +1 -1
  80. package/dist/tools/agent-tools.d.ts +231 -0
  81. package/dist/tools/agent-tools.d.ts.map +1 -0
  82. package/dist/tools/agent-tools.js +25 -0
  83. package/dist/tools/agent-tools.js.map +1 -0
  84. package/dist/tools/atomic.d.ts +19 -0
  85. package/dist/tools/atomic.d.ts.map +1 -1
  86. package/dist/tools/atomic.js +17 -0
  87. package/dist/tools/atomic.js.map +1 -1
  88. package/dist/tools/index.d.ts +2 -0
  89. package/dist/tools/index.d.ts.map +1 -1
  90. package/dist/tools/skill-executor.d.ts +7 -0
  91. package/dist/tools/skill-executor.d.ts.map +1 -1
  92. package/dist/tools/web-tools.d.ts +217 -0
  93. package/dist/tools/web-tools.d.ts.map +1 -0
  94. package/dist/tools/web-tools.js +31 -0
  95. package/dist/tools/web-tools.js.map +1 -0
  96. package/package.json +6 -2
  97. package/src/__tests__/__snapshots__/operations-registry.test.ts.snap +1 -1
  98. package/src/__tests__/operation-def.test.ts +2 -1
  99. package/src/__tests__/sealed-credential.test.ts +100 -0
  100. package/src/__tests__/skill-executor-contract.test.ts +3 -0
  101. package/src/acceptance-gate.ts +2 -3
  102. package/src/boundary.ts +1 -20
  103. package/src/config.ts +104 -0
  104. package/src/data-accessor.ts +22 -1
  105. package/src/dispatch/identity.ts +5 -0
  106. package/src/dispatch/operations-registry.ts +51 -170
  107. package/src/index.ts +103 -24
  108. package/src/lease-ipc/__tests__/freeze.test.ts +246 -0
  109. package/src/lease-ipc/index.ts +63 -0
  110. package/src/lease-ipc/messages.ts +471 -0
  111. package/src/lease-ipc/version.ts +46 -0
  112. package/src/llm/interfaces.ts +23 -0
  113. package/src/llm/sealed-credential.ts +166 -0
  114. package/src/llm/system-of-use.ts +503 -0
  115. package/src/llm/system-resolver.ts +46 -11
  116. package/src/operations/__tests__/ensures-schema-registry.test.ts +169 -0
  117. package/src/operations/ensures-schema-registry.ts +260 -0
  118. package/src/operations/llm.ts +105 -8
  119. package/src/operations/validate.ts +1 -14
  120. package/src/playbook.ts +61 -0
  121. package/src/session.ts +11 -0
  122. package/src/tools/agent-tools.ts +270 -0
  123. package/src/tools/atomic.ts +21 -0
  124. package/src/tools/index.ts +46 -0
  125. package/src/tools/skill-executor.ts +7 -0
  126. package/src/tools/web-tools.ts +247 -0
  127. package/dist/tessera.d.ts +0 -32
  128. package/dist/tessera.d.ts.map +0 -1
  129. package/dist/tessera.js +0 -11
  130. package/dist/tessera.js.map +0 -1
  131. package/dist/warp-chain.d.ts +0 -129
  132. package/dist/warp-chain.d.ts.map +0 -1
  133. package/dist/warp-chain.js +0 -13
  134. package/dist/warp-chain.js.map +0 -1
  135. package/src/tessera.ts +0 -35
  136. package/src/warp-chain.ts +0 -185
@@ -0,0 +1,754 @@
1
+ /**
2
+ * `lease-ipc` v1.1 — PARALLEL message contract (Zod schemas) for the
3
+ * DbWriterLease IPC surface (T11627 ST-1).
4
+ *
5
+ * This is the byte-for-byte TypeScript mirror of the Rust serde types in
6
+ * `crates/cleo-supervisor/src/lease_ipc.rs`. The wire format is newline-delimited
7
+ * JSON (NDJSON): one {@link LeaseIpcEnvelope} per line — identical framing to the
8
+ * frozen `supervisor-ipc` v1.0 envelope, only the version string
9
+ * ({@link LEASE_IPC_PROTOCOL_VERSION}) and the inner union differ.
10
+ *
11
+ * Wire-shape contract (snake_case keys — matches serde defaults):
12
+ *
13
+ * ```jsonc
14
+ * // request
15
+ * { "protocol_version": "1.1.0", "id": "abc", "direction": "request",
16
+ * "request": { "kind": "lease_acquire", "scope": "project", "lane": "tasks",
17
+ * "holder_id": "pid-42:tasks", "priority": 0, "ttl_ms": 30000,
18
+ * "reentrant": true } }
19
+ * // response
20
+ * { "protocol_version": "1.1.0", "id": "abc", "direction": "response",
21
+ * "response": { "kind": "lease_granted", "scope": "project", "lane": "tasks",
22
+ * "holder_id": "pid-42:tasks", "epoch": 7, "ttl_ms": 30000,
23
+ * "expires_at_ms": 1000030000 } }
24
+ * ```
25
+ *
26
+ * Staged delivery: every kind is *declared* so the protocol freeze is stable,
27
+ * but `rate_check` / `tool_grant` handlers are deferred (return
28
+ * `E_LEASE_UNIMPLEMENTED`) until a follow-up task. This module (ST-1) ships the
29
+ * protocol surface with **no consumer** — zero behavior change.
30
+ *
31
+ * @task T11627
32
+ * @packageDocumentation
33
+ */
34
+ import { z } from 'zod';
35
+ /**
36
+ * The cleo.db scope a lease is arbitrated within. Mirrors `DbScope` in Rust.
37
+ *
38
+ * Under the dual-cleo.db split, a `project` lease lives inside the project's
39
+ * `cleo.db` and a `global` lease inside the global `cleo.db` — different files,
40
+ * so they never serialize against each other (AC2).
41
+ */
42
+ export declare const LeaseScopeSchema: z.ZodEnum<{
43
+ project: "project";
44
+ global: "global";
45
+ }>;
46
+ /** The cleo.db scope a lease is arbitrated within (inferred). */
47
+ export type LeaseScope = z.infer<typeof LeaseScopeSchema>;
48
+ /**
49
+ * The write lane a lease arbitrates within a single scope file. Mirrors
50
+ * `LeaseLane` in Rust.
51
+ *
52
+ * - `tasks` — the primary task-chokepoint write lane.
53
+ * - `brain` — the BRAIN memory write lane (gated separately — AC4).
54
+ * - `bulk` — the bulk / bypass-writer lane (conduit, telemetry, nexus graph).
55
+ */
56
+ export declare const LeaseLaneSchema: z.ZodEnum<{
57
+ tasks: "tasks";
58
+ brain: "brain";
59
+ bulk: "bulk";
60
+ }>;
61
+ /** The write lane a lease arbitrates within a scope (inferred). */
62
+ export type LeaseLane = z.infer<typeof LeaseLaneSchema>;
63
+ /**
64
+ * Acquire (or re-enter) the writer lease for a (scope, lane). Mirrors
65
+ * `LeaseAcquireReq`. `[v1 core]`
66
+ */
67
+ export declare const LeaseAcquireRequestSchema: z.ZodObject<{
68
+ kind: z.ZodLiteral<"lease_acquire">;
69
+ scope: z.ZodEnum<{
70
+ project: "project";
71
+ global: "global";
72
+ }>;
73
+ lane: z.ZodEnum<{
74
+ tasks: "tasks";
75
+ brain: "brain";
76
+ bulk: "bulk";
77
+ }>;
78
+ holder_id: z.ZodString;
79
+ priority: z.ZodNumber;
80
+ ttl_ms: z.ZodNumber;
81
+ reentrant: z.ZodBoolean;
82
+ }, z.core.$strict>;
83
+ /** Acquire request payload (inferred from {@link LeaseAcquireRequestSchema}). */
84
+ export type LeaseAcquireRequest = z.infer<typeof LeaseAcquireRequestSchema>;
85
+ /**
86
+ * Release the held writer lease. Mirrors `LeaseReleaseReq`. `[v1 core]`
87
+ */
88
+ export declare const LeaseReleaseRequestSchema: z.ZodObject<{
89
+ kind: z.ZodLiteral<"lease_release">;
90
+ scope: z.ZodEnum<{
91
+ project: "project";
92
+ global: "global";
93
+ }>;
94
+ lane: z.ZodEnum<{
95
+ tasks: "tasks";
96
+ brain: "brain";
97
+ bulk: "bulk";
98
+ }>;
99
+ holder_id: z.ZodString;
100
+ epoch: z.ZodNumber;
101
+ }, z.core.$strict>;
102
+ /** Release request payload (inferred from {@link LeaseReleaseRequestSchema}). */
103
+ export type LeaseReleaseRequest = z.infer<typeof LeaseReleaseRequestSchema>;
104
+ /**
105
+ * Heartbeat / renew the held lease's TTL. Mirrors `LeaseRenewReq`. `[v1 core]`
106
+ */
107
+ export declare const LeaseRenewRequestSchema: z.ZodObject<{
108
+ kind: z.ZodLiteral<"lease_renew">;
109
+ scope: z.ZodEnum<{
110
+ project: "project";
111
+ global: "global";
112
+ }>;
113
+ lane: z.ZodEnum<{
114
+ tasks: "tasks";
115
+ brain: "brain";
116
+ bulk: "bulk";
117
+ }>;
118
+ holder_id: z.ZodString;
119
+ epoch: z.ZodNumber;
120
+ }, z.core.$strict>;
121
+ /** Renew request payload (inferred from {@link LeaseRenewRequestSchema}). */
122
+ export type LeaseRenewRequest = z.infer<typeof LeaseRenewRequestSchema>;
123
+ /**
124
+ * Check the per-scope write rate budget. Mirrors `RateCheckReq`.
125
+ * `[declared; handler deferred — returns E_LEASE_UNIMPLEMENTED]`
126
+ */
127
+ export declare const RateCheckRequestSchema: z.ZodObject<{
128
+ kind: z.ZodLiteral<"rate_check">;
129
+ scope: z.ZodEnum<{
130
+ project: "project";
131
+ global: "global";
132
+ }>;
133
+ lane: z.ZodEnum<{
134
+ tasks: "tasks";
135
+ brain: "brain";
136
+ bulk: "bulk";
137
+ }>;
138
+ est_bytes: z.ZodNumber;
139
+ }, z.core.$strict>;
140
+ /** Rate-check request payload (inferred from {@link RateCheckRequestSchema}). */
141
+ export type RateCheckRequest = z.infer<typeof RateCheckRequestSchema>;
142
+ /**
143
+ * Request a tool-use grant. Mirrors `ToolGrantReq`.
144
+ * `[declared; handler deferred — returns E_LEASE_UNIMPLEMENTED]`
145
+ */
146
+ export declare const ToolGrantRequestSchema: z.ZodObject<{
147
+ kind: z.ZodLiteral<"tool_grant">;
148
+ tool: z.ZodString;
149
+ holder_id: z.ZodString;
150
+ }, z.core.$strict>;
151
+ /** Tool-grant request payload (inferred from {@link ToolGrantRequestSchema}). */
152
+ export type ToolGrantRequest = z.infer<typeof ToolGrantRequestSchema>;
153
+ /**
154
+ * The discriminated union of all client → arbiter lease requests. The `kind`
155
+ * field selects the variant, matching the serde `#[serde(tag = "kind")]`
156
+ * tagging on the Rust `LeaseRequest` enum.
157
+ */
158
+ export declare const LeaseIpcRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
159
+ kind: z.ZodLiteral<"lease_acquire">;
160
+ scope: z.ZodEnum<{
161
+ project: "project";
162
+ global: "global";
163
+ }>;
164
+ lane: z.ZodEnum<{
165
+ tasks: "tasks";
166
+ brain: "brain";
167
+ bulk: "bulk";
168
+ }>;
169
+ holder_id: z.ZodString;
170
+ priority: z.ZodNumber;
171
+ ttl_ms: z.ZodNumber;
172
+ reentrant: z.ZodBoolean;
173
+ }, z.core.$strict>, z.ZodObject<{
174
+ kind: z.ZodLiteral<"lease_release">;
175
+ scope: z.ZodEnum<{
176
+ project: "project";
177
+ global: "global";
178
+ }>;
179
+ lane: z.ZodEnum<{
180
+ tasks: "tasks";
181
+ brain: "brain";
182
+ bulk: "bulk";
183
+ }>;
184
+ holder_id: z.ZodString;
185
+ epoch: z.ZodNumber;
186
+ }, z.core.$strict>, z.ZodObject<{
187
+ kind: z.ZodLiteral<"lease_renew">;
188
+ scope: z.ZodEnum<{
189
+ project: "project";
190
+ global: "global";
191
+ }>;
192
+ lane: z.ZodEnum<{
193
+ tasks: "tasks";
194
+ brain: "brain";
195
+ bulk: "bulk";
196
+ }>;
197
+ holder_id: z.ZodString;
198
+ epoch: z.ZodNumber;
199
+ }, z.core.$strict>, z.ZodObject<{
200
+ kind: z.ZodLiteral<"rate_check">;
201
+ scope: z.ZodEnum<{
202
+ project: "project";
203
+ global: "global";
204
+ }>;
205
+ lane: z.ZodEnum<{
206
+ tasks: "tasks";
207
+ brain: "brain";
208
+ bulk: "bulk";
209
+ }>;
210
+ est_bytes: z.ZodNumber;
211
+ }, z.core.$strict>, z.ZodObject<{
212
+ kind: z.ZodLiteral<"tool_grant">;
213
+ tool: z.ZodString;
214
+ holder_id: z.ZodString;
215
+ }, z.core.$strict>], "kind">;
216
+ /** Any lease IPC request (inferred from {@link LeaseIpcRequestSchema}). */
217
+ export type LeaseIpcRequest = z.infer<typeof LeaseIpcRequestSchema>;
218
+ /**
219
+ * The lease was granted to the caller. Mirrors `LeaseGranted`.
220
+ */
221
+ export declare const LeaseGrantedResponseSchema: z.ZodObject<{
222
+ kind: z.ZodLiteral<"lease_granted">;
223
+ scope: z.ZodEnum<{
224
+ project: "project";
225
+ global: "global";
226
+ }>;
227
+ lane: z.ZodEnum<{
228
+ tasks: "tasks";
229
+ brain: "brain";
230
+ bulk: "bulk";
231
+ }>;
232
+ holder_id: z.ZodString;
233
+ epoch: z.ZodNumber;
234
+ ttl_ms: z.ZodNumber;
235
+ expires_at_ms: z.ZodNumber;
236
+ }, z.core.$strict>;
237
+ /** Lease-granted response payload (inferred from {@link LeaseGrantedResponseSchema}). */
238
+ export type LeaseGrantedResponse = z.infer<typeof LeaseGrantedResponseSchema>;
239
+ /**
240
+ * The caller was placed in the per-scope FIFO+priority queue. Mirrors
241
+ * `LeaseQueued`.
242
+ */
243
+ export declare const LeaseQueuedResponseSchema: z.ZodObject<{
244
+ kind: z.ZodLiteral<"lease_queued">;
245
+ scope: z.ZodEnum<{
246
+ project: "project";
247
+ global: "global";
248
+ }>;
249
+ lane: z.ZodEnum<{
250
+ tasks: "tasks";
251
+ brain: "brain";
252
+ bulk: "bulk";
253
+ }>;
254
+ ticket: z.ZodNumber;
255
+ ahead: z.ZodNumber;
256
+ }, z.core.$strict>;
257
+ /** Lease-queued response payload (inferred from {@link LeaseQueuedResponseSchema}). */
258
+ export type LeaseQueuedResponse = z.infer<typeof LeaseQueuedResponseSchema>;
259
+ /**
260
+ * The acquire was denied. Mirrors `LeaseDenied`.
261
+ */
262
+ export declare const LeaseDeniedResponseSchema: z.ZodObject<{
263
+ kind: z.ZodLiteral<"lease_denied">;
264
+ scope: z.ZodEnum<{
265
+ project: "project";
266
+ global: "global";
267
+ }>;
268
+ code: z.ZodString;
269
+ message: z.ZodString;
270
+ }, z.core.$strict>;
271
+ /** Lease-denied response payload (inferred from {@link LeaseDeniedResponseSchema}). */
272
+ export type LeaseDeniedResponse = z.infer<typeof LeaseDeniedResponseSchema>;
273
+ /**
274
+ * Reply to a deferred `rate_check`. Mirrors `RateResult`.
275
+ */
276
+ export declare const RateResultResponseSchema: z.ZodObject<{
277
+ kind: z.ZodLiteral<"rate_result">;
278
+ scope: z.ZodEnum<{
279
+ project: "project";
280
+ global: "global";
281
+ }>;
282
+ ok: z.ZodBoolean;
283
+ retry_after_ms: z.ZodNumber;
284
+ tokens_remaining: z.ZodNumber;
285
+ }, z.core.$strict>;
286
+ /** Rate-result response payload (inferred from {@link RateResultResponseSchema}). */
287
+ export type RateResultResponse = z.infer<typeof RateResultResponseSchema>;
288
+ /**
289
+ * Reply to a deferred `tool_grant`. Mirrors `ToolGranted`.
290
+ */
291
+ export declare const ToolGrantedResponseSchema: z.ZodObject<{
292
+ kind: z.ZodLiteral<"tool_granted">;
293
+ tool: z.ZodString;
294
+ holder_id: z.ZodString;
295
+ }, z.core.$strict>;
296
+ /** Tool-granted response payload (inferred from {@link ToolGrantedResponseSchema}). */
297
+ export type ToolGrantedResponse = z.infer<typeof ToolGrantedResponseSchema>;
298
+ /**
299
+ * Unsolicited event: a held lease was revoked. Mirrors `LeaseRevoked`.
300
+ */
301
+ export declare const LeaseRevokedResponseSchema: z.ZodObject<{
302
+ kind: z.ZodLiteral<"lease_revoked">;
303
+ scope: z.ZodEnum<{
304
+ project: "project";
305
+ global: "global";
306
+ }>;
307
+ lane: z.ZodEnum<{
308
+ tasks: "tasks";
309
+ brain: "brain";
310
+ bulk: "bulk";
311
+ }>;
312
+ holder_id: z.ZodString;
313
+ reason: z.ZodString;
314
+ }, z.core.$strict>;
315
+ /** Lease-revoked event payload (inferred from {@link LeaseRevokedResponseSchema}). */
316
+ export type LeaseRevokedResponse = z.infer<typeof LeaseRevokedResponseSchema>;
317
+ /**
318
+ * Unsolicited event: a lease holder was killed for being unresponsive. Mirrors
319
+ * `ChildKilled` carried by the `child_killed_unresponsive` response variant.
320
+ */
321
+ export declare const ChildKilledUnresponsiveResponseSchema: z.ZodObject<{
322
+ kind: z.ZodLiteral<"child_killed_unresponsive">;
323
+ child_id: z.ZodString;
324
+ holder_id: z.ZodString;
325
+ scope: z.ZodEnum<{
326
+ project: "project";
327
+ global: "global";
328
+ }>;
329
+ reason: z.ZodString;
330
+ }, z.core.$strict>;
331
+ /** Child-killed event payload (inferred from {@link ChildKilledUnresponsiveResponseSchema}). */
332
+ export type ChildKilledUnresponsiveResponse = z.infer<typeof ChildKilledUnresponsiveResponseSchema>;
333
+ /**
334
+ * An error response correlated to a request. Mirrors the v1.0
335
+ * `crate::ipc::ErrorResult` shape reused by the Rust `LeaseResponse::Error`
336
+ * variant — error framing is shared across protocol versions.
337
+ */
338
+ export declare const LeaseErrorResponseSchema: z.ZodObject<{
339
+ kind: z.ZodLiteral<"error">;
340
+ code: z.ZodString;
341
+ message: z.ZodString;
342
+ }, z.core.$strict>;
343
+ /** Lease error response payload (inferred from {@link LeaseErrorResponseSchema}). */
344
+ export type LeaseErrorResponse = z.infer<typeof LeaseErrorResponseSchema>;
345
+ /**
346
+ * The discriminated union of all arbiter → client lease responses and events.
347
+ * The `kind` field selects the variant, matching the serde
348
+ * `#[serde(tag = "kind")]` tagging on the Rust `LeaseResponse` enum.
349
+ */
350
+ export declare const LeaseIpcResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
351
+ kind: z.ZodLiteral<"lease_granted">;
352
+ scope: z.ZodEnum<{
353
+ project: "project";
354
+ global: "global";
355
+ }>;
356
+ lane: z.ZodEnum<{
357
+ tasks: "tasks";
358
+ brain: "brain";
359
+ bulk: "bulk";
360
+ }>;
361
+ holder_id: z.ZodString;
362
+ epoch: z.ZodNumber;
363
+ ttl_ms: z.ZodNumber;
364
+ expires_at_ms: z.ZodNumber;
365
+ }, z.core.$strict>, z.ZodObject<{
366
+ kind: z.ZodLiteral<"lease_queued">;
367
+ scope: z.ZodEnum<{
368
+ project: "project";
369
+ global: "global";
370
+ }>;
371
+ lane: z.ZodEnum<{
372
+ tasks: "tasks";
373
+ brain: "brain";
374
+ bulk: "bulk";
375
+ }>;
376
+ ticket: z.ZodNumber;
377
+ ahead: z.ZodNumber;
378
+ }, z.core.$strict>, z.ZodObject<{
379
+ kind: z.ZodLiteral<"lease_denied">;
380
+ scope: z.ZodEnum<{
381
+ project: "project";
382
+ global: "global";
383
+ }>;
384
+ code: z.ZodString;
385
+ message: z.ZodString;
386
+ }, z.core.$strict>, z.ZodObject<{
387
+ kind: z.ZodLiteral<"rate_result">;
388
+ scope: z.ZodEnum<{
389
+ project: "project";
390
+ global: "global";
391
+ }>;
392
+ ok: z.ZodBoolean;
393
+ retry_after_ms: z.ZodNumber;
394
+ tokens_remaining: z.ZodNumber;
395
+ }, z.core.$strict>, z.ZodObject<{
396
+ kind: z.ZodLiteral<"tool_granted">;
397
+ tool: z.ZodString;
398
+ holder_id: z.ZodString;
399
+ }, z.core.$strict>, z.ZodObject<{
400
+ kind: z.ZodLiteral<"lease_revoked">;
401
+ scope: z.ZodEnum<{
402
+ project: "project";
403
+ global: "global";
404
+ }>;
405
+ lane: z.ZodEnum<{
406
+ tasks: "tasks";
407
+ brain: "brain";
408
+ bulk: "bulk";
409
+ }>;
410
+ holder_id: z.ZodString;
411
+ reason: z.ZodString;
412
+ }, z.core.$strict>, z.ZodObject<{
413
+ kind: z.ZodLiteral<"child_killed_unresponsive">;
414
+ child_id: z.ZodString;
415
+ holder_id: z.ZodString;
416
+ scope: z.ZodEnum<{
417
+ project: "project";
418
+ global: "global";
419
+ }>;
420
+ reason: z.ZodString;
421
+ }, z.core.$strict>, z.ZodObject<{
422
+ kind: z.ZodLiteral<"error">;
423
+ code: z.ZodString;
424
+ message: z.ZodString;
425
+ }, z.core.$strict>], "kind">;
426
+ /** Any lease IPC response (inferred from {@link LeaseIpcResponseSchema}). */
427
+ export type LeaseIpcResponse = z.infer<typeof LeaseIpcResponseSchema>;
428
+ /**
429
+ * A client → arbiter lease request envelope.
430
+ *
431
+ * The `direction` discriminator + flattened `request` payload mirror the serde
432
+ * `#[serde(tag = "direction")]` `LeasePayload::Request { request }` variant.
433
+ */
434
+ export declare const LeaseIpcRequestEnvelopeSchema: z.ZodObject<{
435
+ protocol_version: z.ZodString;
436
+ id: z.ZodString;
437
+ direction: z.ZodLiteral<"request">;
438
+ request: z.ZodDiscriminatedUnion<[z.ZodObject<{
439
+ kind: z.ZodLiteral<"lease_acquire">;
440
+ scope: z.ZodEnum<{
441
+ project: "project";
442
+ global: "global";
443
+ }>;
444
+ lane: z.ZodEnum<{
445
+ tasks: "tasks";
446
+ brain: "brain";
447
+ bulk: "bulk";
448
+ }>;
449
+ holder_id: z.ZodString;
450
+ priority: z.ZodNumber;
451
+ ttl_ms: z.ZodNumber;
452
+ reentrant: z.ZodBoolean;
453
+ }, z.core.$strict>, z.ZodObject<{
454
+ kind: z.ZodLiteral<"lease_release">;
455
+ scope: z.ZodEnum<{
456
+ project: "project";
457
+ global: "global";
458
+ }>;
459
+ lane: z.ZodEnum<{
460
+ tasks: "tasks";
461
+ brain: "brain";
462
+ bulk: "bulk";
463
+ }>;
464
+ holder_id: z.ZodString;
465
+ epoch: z.ZodNumber;
466
+ }, z.core.$strict>, z.ZodObject<{
467
+ kind: z.ZodLiteral<"lease_renew">;
468
+ scope: z.ZodEnum<{
469
+ project: "project";
470
+ global: "global";
471
+ }>;
472
+ lane: z.ZodEnum<{
473
+ tasks: "tasks";
474
+ brain: "brain";
475
+ bulk: "bulk";
476
+ }>;
477
+ holder_id: z.ZodString;
478
+ epoch: z.ZodNumber;
479
+ }, z.core.$strict>, z.ZodObject<{
480
+ kind: z.ZodLiteral<"rate_check">;
481
+ scope: z.ZodEnum<{
482
+ project: "project";
483
+ global: "global";
484
+ }>;
485
+ lane: z.ZodEnum<{
486
+ tasks: "tasks";
487
+ brain: "brain";
488
+ bulk: "bulk";
489
+ }>;
490
+ est_bytes: z.ZodNumber;
491
+ }, z.core.$strict>, z.ZodObject<{
492
+ kind: z.ZodLiteral<"tool_grant">;
493
+ tool: z.ZodString;
494
+ holder_id: z.ZodString;
495
+ }, z.core.$strict>], "kind">;
496
+ }, z.core.$strict>;
497
+ /** Lease request envelope (inferred from {@link LeaseIpcRequestEnvelopeSchema}). */
498
+ export type LeaseIpcRequestEnvelope = z.infer<typeof LeaseIpcRequestEnvelopeSchema>;
499
+ /**
500
+ * An arbiter → client lease response/event envelope.
501
+ *
502
+ * The `direction` discriminator + flattened `response` payload mirror the serde
503
+ * `LeasePayload::Response { response }` variant.
504
+ */
505
+ export declare const LeaseIpcResponseEnvelopeSchema: z.ZodObject<{
506
+ protocol_version: z.ZodString;
507
+ id: z.ZodString;
508
+ direction: z.ZodLiteral<"response">;
509
+ response: z.ZodDiscriminatedUnion<[z.ZodObject<{
510
+ kind: z.ZodLiteral<"lease_granted">;
511
+ scope: z.ZodEnum<{
512
+ project: "project";
513
+ global: "global";
514
+ }>;
515
+ lane: z.ZodEnum<{
516
+ tasks: "tasks";
517
+ brain: "brain";
518
+ bulk: "bulk";
519
+ }>;
520
+ holder_id: z.ZodString;
521
+ epoch: z.ZodNumber;
522
+ ttl_ms: z.ZodNumber;
523
+ expires_at_ms: z.ZodNumber;
524
+ }, z.core.$strict>, z.ZodObject<{
525
+ kind: z.ZodLiteral<"lease_queued">;
526
+ scope: z.ZodEnum<{
527
+ project: "project";
528
+ global: "global";
529
+ }>;
530
+ lane: z.ZodEnum<{
531
+ tasks: "tasks";
532
+ brain: "brain";
533
+ bulk: "bulk";
534
+ }>;
535
+ ticket: z.ZodNumber;
536
+ ahead: z.ZodNumber;
537
+ }, z.core.$strict>, z.ZodObject<{
538
+ kind: z.ZodLiteral<"lease_denied">;
539
+ scope: z.ZodEnum<{
540
+ project: "project";
541
+ global: "global";
542
+ }>;
543
+ code: z.ZodString;
544
+ message: z.ZodString;
545
+ }, z.core.$strict>, z.ZodObject<{
546
+ kind: z.ZodLiteral<"rate_result">;
547
+ scope: z.ZodEnum<{
548
+ project: "project";
549
+ global: "global";
550
+ }>;
551
+ ok: z.ZodBoolean;
552
+ retry_after_ms: z.ZodNumber;
553
+ tokens_remaining: z.ZodNumber;
554
+ }, z.core.$strict>, z.ZodObject<{
555
+ kind: z.ZodLiteral<"tool_granted">;
556
+ tool: z.ZodString;
557
+ holder_id: z.ZodString;
558
+ }, z.core.$strict>, z.ZodObject<{
559
+ kind: z.ZodLiteral<"lease_revoked">;
560
+ scope: z.ZodEnum<{
561
+ project: "project";
562
+ global: "global";
563
+ }>;
564
+ lane: z.ZodEnum<{
565
+ tasks: "tasks";
566
+ brain: "brain";
567
+ bulk: "bulk";
568
+ }>;
569
+ holder_id: z.ZodString;
570
+ reason: z.ZodString;
571
+ }, z.core.$strict>, z.ZodObject<{
572
+ kind: z.ZodLiteral<"child_killed_unresponsive">;
573
+ child_id: z.ZodString;
574
+ holder_id: z.ZodString;
575
+ scope: z.ZodEnum<{
576
+ project: "project";
577
+ global: "global";
578
+ }>;
579
+ reason: z.ZodString;
580
+ }, z.core.$strict>, z.ZodObject<{
581
+ kind: z.ZodLiteral<"error">;
582
+ code: z.ZodString;
583
+ message: z.ZodString;
584
+ }, z.core.$strict>], "kind">;
585
+ }, z.core.$strict>;
586
+ /** Lease response envelope (inferred from {@link LeaseIpcResponseEnvelopeSchema}). */
587
+ export type LeaseIpcResponseEnvelope = z.infer<typeof LeaseIpcResponseEnvelopeSchema>;
588
+ /**
589
+ * The top-level lease IPC envelope: a versioned, correlated wrapper that is
590
+ * either a request or a response, discriminated by `direction`. One envelope per
591
+ * NDJSON line. Mirrors the Rust `LeaseEnvelope`.
592
+ */
593
+ export declare const LeaseIpcEnvelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
594
+ protocol_version: z.ZodString;
595
+ id: z.ZodString;
596
+ direction: z.ZodLiteral<"request">;
597
+ request: z.ZodDiscriminatedUnion<[z.ZodObject<{
598
+ kind: z.ZodLiteral<"lease_acquire">;
599
+ scope: z.ZodEnum<{
600
+ project: "project";
601
+ global: "global";
602
+ }>;
603
+ lane: z.ZodEnum<{
604
+ tasks: "tasks";
605
+ brain: "brain";
606
+ bulk: "bulk";
607
+ }>;
608
+ holder_id: z.ZodString;
609
+ priority: z.ZodNumber;
610
+ ttl_ms: z.ZodNumber;
611
+ reentrant: z.ZodBoolean;
612
+ }, z.core.$strict>, z.ZodObject<{
613
+ kind: z.ZodLiteral<"lease_release">;
614
+ scope: z.ZodEnum<{
615
+ project: "project";
616
+ global: "global";
617
+ }>;
618
+ lane: z.ZodEnum<{
619
+ tasks: "tasks";
620
+ brain: "brain";
621
+ bulk: "bulk";
622
+ }>;
623
+ holder_id: z.ZodString;
624
+ epoch: z.ZodNumber;
625
+ }, z.core.$strict>, z.ZodObject<{
626
+ kind: z.ZodLiteral<"lease_renew">;
627
+ scope: z.ZodEnum<{
628
+ project: "project";
629
+ global: "global";
630
+ }>;
631
+ lane: z.ZodEnum<{
632
+ tasks: "tasks";
633
+ brain: "brain";
634
+ bulk: "bulk";
635
+ }>;
636
+ holder_id: z.ZodString;
637
+ epoch: z.ZodNumber;
638
+ }, z.core.$strict>, z.ZodObject<{
639
+ kind: z.ZodLiteral<"rate_check">;
640
+ scope: z.ZodEnum<{
641
+ project: "project";
642
+ global: "global";
643
+ }>;
644
+ lane: z.ZodEnum<{
645
+ tasks: "tasks";
646
+ brain: "brain";
647
+ bulk: "bulk";
648
+ }>;
649
+ est_bytes: z.ZodNumber;
650
+ }, z.core.$strict>, z.ZodObject<{
651
+ kind: z.ZodLiteral<"tool_grant">;
652
+ tool: z.ZodString;
653
+ holder_id: z.ZodString;
654
+ }, z.core.$strict>], "kind">;
655
+ }, z.core.$strict>, z.ZodObject<{
656
+ protocol_version: z.ZodString;
657
+ id: z.ZodString;
658
+ direction: z.ZodLiteral<"response">;
659
+ response: z.ZodDiscriminatedUnion<[z.ZodObject<{
660
+ kind: z.ZodLiteral<"lease_granted">;
661
+ scope: z.ZodEnum<{
662
+ project: "project";
663
+ global: "global";
664
+ }>;
665
+ lane: z.ZodEnum<{
666
+ tasks: "tasks";
667
+ brain: "brain";
668
+ bulk: "bulk";
669
+ }>;
670
+ holder_id: z.ZodString;
671
+ epoch: z.ZodNumber;
672
+ ttl_ms: z.ZodNumber;
673
+ expires_at_ms: z.ZodNumber;
674
+ }, z.core.$strict>, z.ZodObject<{
675
+ kind: z.ZodLiteral<"lease_queued">;
676
+ scope: z.ZodEnum<{
677
+ project: "project";
678
+ global: "global";
679
+ }>;
680
+ lane: z.ZodEnum<{
681
+ tasks: "tasks";
682
+ brain: "brain";
683
+ bulk: "bulk";
684
+ }>;
685
+ ticket: z.ZodNumber;
686
+ ahead: z.ZodNumber;
687
+ }, z.core.$strict>, z.ZodObject<{
688
+ kind: z.ZodLiteral<"lease_denied">;
689
+ scope: z.ZodEnum<{
690
+ project: "project";
691
+ global: "global";
692
+ }>;
693
+ code: z.ZodString;
694
+ message: z.ZodString;
695
+ }, z.core.$strict>, z.ZodObject<{
696
+ kind: z.ZodLiteral<"rate_result">;
697
+ scope: z.ZodEnum<{
698
+ project: "project";
699
+ global: "global";
700
+ }>;
701
+ ok: z.ZodBoolean;
702
+ retry_after_ms: z.ZodNumber;
703
+ tokens_remaining: z.ZodNumber;
704
+ }, z.core.$strict>, z.ZodObject<{
705
+ kind: z.ZodLiteral<"tool_granted">;
706
+ tool: z.ZodString;
707
+ holder_id: z.ZodString;
708
+ }, z.core.$strict>, z.ZodObject<{
709
+ kind: z.ZodLiteral<"lease_revoked">;
710
+ scope: z.ZodEnum<{
711
+ project: "project";
712
+ global: "global";
713
+ }>;
714
+ lane: z.ZodEnum<{
715
+ tasks: "tasks";
716
+ brain: "brain";
717
+ bulk: "bulk";
718
+ }>;
719
+ holder_id: z.ZodString;
720
+ reason: z.ZodString;
721
+ }, z.core.$strict>, z.ZodObject<{
722
+ kind: z.ZodLiteral<"child_killed_unresponsive">;
723
+ child_id: z.ZodString;
724
+ holder_id: z.ZodString;
725
+ scope: z.ZodEnum<{
726
+ project: "project";
727
+ global: "global";
728
+ }>;
729
+ reason: z.ZodString;
730
+ }, z.core.$strict>, z.ZodObject<{
731
+ kind: z.ZodLiteral<"error">;
732
+ code: z.ZodString;
733
+ message: z.ZodString;
734
+ }, z.core.$strict>], "kind">;
735
+ }, z.core.$strict>], "direction">;
736
+ /** Any lease IPC envelope (inferred from {@link LeaseIpcEnvelopeSchema}). */
737
+ export type LeaseIpcEnvelope = z.infer<typeof LeaseIpcEnvelopeSchema>;
738
+ /**
739
+ * The v1.1 request `kind` values, in declaration order. The schema-drift guard
740
+ * test pins this tuple; any addition/removal is a contract-breaking change
741
+ * requiring a coordinated dual (Rust + TS) edit.
742
+ */
743
+ export declare const LEASE_IPC_REQUEST_KINDS: readonly ["lease_acquire", "lease_release", "lease_renew", "rate_check", "tool_grant"];
744
+ /**
745
+ * The v1.1 response `kind` values, in declaration order. The schema-drift guard
746
+ * test pins this tuple.
747
+ */
748
+ export declare const LEASE_IPC_RESPONSE_KINDS: readonly ["lease_granted", "lease_queued", "lease_denied", "rate_result", "tool_granted", "lease_revoked", "child_killed_unresponsive", "error"];
749
+ /**
750
+ * The complete v1.1 message kind set (requests + responses), used by the drift
751
+ * guard on both the TS and Rust sides.
752
+ */
753
+ export declare const LEASE_IPC_MESSAGE_KINDS: readonly ["lease_acquire", "lease_release", "lease_renew", "rate_check", "tool_grant", "lease_granted", "lease_queued", "lease_denied", "rate_result", "tool_granted", "lease_revoked", "child_killed_unresponsive", "error"];
754
+ //# sourceMappingURL=messages.d.ts.map