@tai42/api-client 13.3.0 → 15.0.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.
package/dist/schemas.d.ts CHANGED
@@ -9,6 +9,29 @@ import { z } from 'zod';
9
9
  export declare const jsonValue: z.ZodType;
10
10
  /** A JSON Schema object (Pydantic-emitted). Permissive; parsed by the auto-form. */
11
11
  export declare const jsonSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
12
+ /**
13
+ * One authored-text value: either inline `content` (text written in place) or a
14
+ * stored template `id` (a template resource fetched and rendered), never both and
15
+ * never neither. `kwargs` are the render parameters and apply in BOTH cases — a
16
+ * prompt with placeholders needs its values whether it was typed inline or fetched.
17
+ * `.strict()` refuses any other key so a drifting field fails the parse loudly.
18
+ */
19
+ export declare const templatedText: z.ZodObject<{
20
+ content: z.ZodOptional<z.ZodString>;
21
+ id: z.ZodOptional<z.ZodString>;
22
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
23
+ }, z.core.$strict>;
24
+ export type TemplatedText = z.infer<typeof templatedText>;
25
+ /**
26
+ * A templated-text value that must carry a source: inline `content` is non-empty, or
27
+ * a stored template `id` is chosen. Used where the platform contract requires a
28
+ * value (e.g. a state binding's subject, an update's adapter when present).
29
+ */
30
+ export declare const requiredTemplatedText: z.ZodObject<{
31
+ content: z.ZodOptional<z.ZodString>;
32
+ id: z.ZodOptional<z.ZodString>;
33
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
34
+ }, z.core.$strict>;
12
35
  export declare const toolNames: z.ZodArray<z.ZodString>;
13
36
  export declare const toolSchema: z.ZodObject<{
14
37
  input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
@@ -118,8 +141,9 @@ export declare const presetExtensions: z.ZodArray<z.ZodArray<z.ZodUnion<readonly
118
141
  * One preset as `GET /api/presets` returns it. Every preset is versioned, so
119
142
  * `active_version` is always an int; `conflicted` marks a QUARANTINED row (its
120
143
  * name collided with a foreign tool at boot — delete-only). `extensions` are the
121
- * ACTIVE version's extension combos and `output_schema` the optional author-set
122
- * output JSON Schema. Categorization tags live in the tool_meta overlay
144
+ * ACTIVE version's extension combos, `output_schema` the optional author-set
145
+ * output JSON Schema, and `input_schema` the optional author-set input JSON
146
+ * Schema. Categorization tags live in the tool_meta overlay
123
147
  * (`GET /api/tool-meta`), never on the record. A drift throws `ApiSchemaError`;
124
148
  * nothing is coerced.
125
149
  */
@@ -133,6 +157,7 @@ export declare const presetRecord: z.ZodObject<{
133
157
  config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
134
158
  }, z.core.$strip>]>>>;
135
159
  output_schema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
160
+ input_schema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
136
161
  conflicted: z.ZodBoolean;
137
162
  conflicted_reason: z.ZodNullable<z.ZodString>;
138
163
  uses: z.ZodArray<z.ZodString>;
@@ -149,6 +174,7 @@ export declare const presetList: z.ZodArray<z.ZodObject<{
149
174
  config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
150
175
  }, z.core.$strip>]>>>;
151
176
  output_schema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
177
+ input_schema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
152
178
  conflicted: z.ZodBoolean;
153
179
  conflicted_reason: z.ZodNullable<z.ZodString>;
154
180
  uses: z.ZodArray<z.ZodString>;
@@ -165,6 +191,7 @@ export declare const presetDetail: z.ZodObject<{
165
191
  config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
166
192
  }, z.core.$strip>]>>>;
167
193
  output_schema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
194
+ input_schema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
168
195
  conflicted: z.ZodBoolean;
169
196
  conflicted_reason: z.ZodNullable<z.ZodString>;
170
197
  uses: z.ZodArray<z.ZodString>;
@@ -172,6 +199,153 @@ export declare const presetDetail: z.ZodObject<{
172
199
  fixed_kwargs: z.ZodRecord<z.ZodString, z.ZodUnknown>;
173
200
  }, z.core.$strip>;
174
201
  export type PresetDetail = z.infer<typeof presetDetail>;
202
+ /**
203
+ * One input injection of a state binding: BEFORE the run, a value is produced and
204
+ * placed into the run input under `into` (the run-input field name). A template
205
+ * `input` jq (`template_jq`, named `name` or attachment-qualified `template.name`) reads the
206
+ * record — its input is the record (`.`), with declared params bound as `$params`; a
207
+ * custom `jq` reads `{record, input}` → the value. Exactly one of `template_jq`/`jq`
208
+ * carries the program; the other is `null`.
209
+ */
210
+ export declare const stateInjection: z.ZodObject<{
211
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodString>>;
212
+ jq: z.ZodDefault<z.ZodNullable<z.ZodObject<{
213
+ content: z.ZodOptional<z.ZodString>;
214
+ id: z.ZodOptional<z.ZodString>;
215
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
216
+ }, z.core.$strict>>>;
217
+ into: z.ZodString;
218
+ }, z.core.$strip>;
219
+ export type StateInjection = z.infer<typeof stateInjection>;
220
+ /**
221
+ * One update of a state binding: AFTER the run, a template-relative op batch is
222
+ * applied through the store. A NAMED update (`template_jq`) runs the template `update`
223
+ * jq over `{record, input}` where `input` is built by `adapter` — a jq over
224
+ * `{output, input}` that constructs the update jq's declared input object. A custom
225
+ * `jq` runs over `{record, output, input}` → `[{op, path, value}]` and carries no
226
+ * adapter. `op_id` is an optional idempotency-key expression. Exactly one of
227
+ * `template_jq`/`jq` carries the program.
228
+ */
229
+ export declare const stateUpdate: z.ZodObject<{
230
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodString>>;
231
+ jq: z.ZodDefault<z.ZodNullable<z.ZodObject<{
232
+ content: z.ZodOptional<z.ZodString>;
233
+ id: z.ZodOptional<z.ZodString>;
234
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
235
+ }, z.core.$strict>>>;
236
+ adapter: z.ZodDefault<z.ZodNullable<z.ZodObject<{
237
+ content: z.ZodOptional<z.ZodString>;
238
+ id: z.ZodOptional<z.ZodString>;
239
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
240
+ }, z.core.$strict>>>;
241
+ op_id: z.ZodDefault<z.ZodNullable<z.ZodObject<{
242
+ content: z.ZodOptional<z.ZodString>;
243
+ id: z.ZodOptional<z.ZodString>;
244
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
245
+ }, z.core.$strict>>>;
246
+ }, z.core.$strip>;
247
+ export type StateUpdate = z.infer<typeof stateUpdate>;
248
+ /**
249
+ * One attached state of a binding: the `state`, one or more `templates`
250
+ * (attach-on-use — attached to the state on the binding's save), the `subject_expr`
251
+ * (a jq yielding the record KEY — a bare key string OR a full subject object — that
252
+ * this binding reads and updates), an optional `scope_expr` (a boolean jq predicate;
253
+ * when it is false this state is skipped for the run), and the ordered
254
+ * `input_injections` (before the run) and `updates` (after it).
255
+ */
256
+ export declare const stateAttach: z.ZodObject<{
257
+ state: z.ZodString;
258
+ templates: z.ZodDefault<z.ZodArray<z.ZodString>>;
259
+ subject_expr: z.ZodObject<{
260
+ content: z.ZodOptional<z.ZodString>;
261
+ id: z.ZodOptional<z.ZodString>;
262
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
263
+ }, z.core.$strict>;
264
+ scope_expr: z.ZodDefault<z.ZodNullable<z.ZodObject<{
265
+ content: z.ZodOptional<z.ZodString>;
266
+ id: z.ZodOptional<z.ZodString>;
267
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
268
+ }, z.core.$strict>>>;
269
+ input_injections: z.ZodDefault<z.ZodArray<z.ZodObject<{
270
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodString>>;
271
+ jq: z.ZodDefault<z.ZodNullable<z.ZodObject<{
272
+ content: z.ZodOptional<z.ZodString>;
273
+ id: z.ZodOptional<z.ZodString>;
274
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
275
+ }, z.core.$strict>>>;
276
+ into: z.ZodString;
277
+ }, z.core.$strip>>>;
278
+ updates: z.ZodDefault<z.ZodArray<z.ZodObject<{
279
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodString>>;
280
+ jq: z.ZodDefault<z.ZodNullable<z.ZodObject<{
281
+ content: z.ZodOptional<z.ZodString>;
282
+ id: z.ZodOptional<z.ZodString>;
283
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
284
+ }, z.core.$strict>>>;
285
+ adapter: z.ZodDefault<z.ZodNullable<z.ZodObject<{
286
+ content: z.ZodOptional<z.ZodString>;
287
+ id: z.ZodOptional<z.ZodString>;
288
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
289
+ }, z.core.$strict>>>;
290
+ op_id: z.ZodDefault<z.ZodNullable<z.ZodObject<{
291
+ content: z.ZodOptional<z.ZodString>;
292
+ id: z.ZodOptional<z.ZodString>;
293
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
294
+ }, z.core.$strict>>>;
295
+ }, z.core.$strip>>>;
296
+ }, z.core.$strip>;
297
+ export type StateAttach = z.infer<typeof stateAttach>;
298
+ /**
299
+ * The one generic binding shape carried, optionally, on every runnable definition
300
+ * (a preset, a channel route, a schedule, a hook) and repeated per node by the
301
+ * flow engine. It attaches one or more states, each with its templates, subject,
302
+ * injections and updates. `null` on a definition means no binding. Mirrors the
303
+ * platform `StateBinding` document.
304
+ */
305
+ export declare const stateBinding: z.ZodObject<{
306
+ states: z.ZodArray<z.ZodObject<{
307
+ state: z.ZodString;
308
+ templates: z.ZodDefault<z.ZodArray<z.ZodString>>;
309
+ subject_expr: z.ZodObject<{
310
+ content: z.ZodOptional<z.ZodString>;
311
+ id: z.ZodOptional<z.ZodString>;
312
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
313
+ }, z.core.$strict>;
314
+ scope_expr: z.ZodDefault<z.ZodNullable<z.ZodObject<{
315
+ content: z.ZodOptional<z.ZodString>;
316
+ id: z.ZodOptional<z.ZodString>;
317
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
318
+ }, z.core.$strict>>>;
319
+ input_injections: z.ZodDefault<z.ZodArray<z.ZodObject<{
320
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodString>>;
321
+ jq: z.ZodDefault<z.ZodNullable<z.ZodObject<{
322
+ content: z.ZodOptional<z.ZodString>;
323
+ id: z.ZodOptional<z.ZodString>;
324
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
325
+ }, z.core.$strict>>>;
326
+ into: z.ZodString;
327
+ }, z.core.$strip>>>;
328
+ updates: z.ZodDefault<z.ZodArray<z.ZodObject<{
329
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodString>>;
330
+ jq: z.ZodDefault<z.ZodNullable<z.ZodObject<{
331
+ content: z.ZodOptional<z.ZodString>;
332
+ id: z.ZodOptional<z.ZodString>;
333
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
334
+ }, z.core.$strict>>>;
335
+ adapter: z.ZodDefault<z.ZodNullable<z.ZodObject<{
336
+ content: z.ZodOptional<z.ZodString>;
337
+ id: z.ZodOptional<z.ZodString>;
338
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
339
+ }, z.core.$strict>>>;
340
+ op_id: z.ZodDefault<z.ZodNullable<z.ZodObject<{
341
+ content: z.ZodOptional<z.ZodString>;
342
+ id: z.ZodOptional<z.ZodString>;
343
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
344
+ }, z.core.$strict>>>;
345
+ }, z.core.$strip>>>;
346
+ }, z.core.$strip>>;
347
+ }, z.core.$strip>;
348
+ export type StateBinding = z.infer<typeof stateBinding>;
175
349
  /** The full version body a preset stores under `kind="preset"`. */
176
350
  export declare const presetBody: z.ZodObject<{
177
351
  base_tool: z.ZodString;
@@ -182,6 +356,50 @@ export declare const presetBody: z.ZodObject<{
182
356
  config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
183
357
  }, z.core.$strip>]>>>;
184
358
  output_schema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
359
+ input_schema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
360
+ state_binding: z.ZodDefault<z.ZodNullable<z.ZodObject<{
361
+ states: z.ZodArray<z.ZodObject<{
362
+ state: z.ZodString;
363
+ templates: z.ZodDefault<z.ZodArray<z.ZodString>>;
364
+ subject_expr: z.ZodObject<{
365
+ content: z.ZodOptional<z.ZodString>;
366
+ id: z.ZodOptional<z.ZodString>;
367
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
368
+ }, z.core.$strict>;
369
+ scope_expr: z.ZodDefault<z.ZodNullable<z.ZodObject<{
370
+ content: z.ZodOptional<z.ZodString>;
371
+ id: z.ZodOptional<z.ZodString>;
372
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
373
+ }, z.core.$strict>>>;
374
+ input_injections: z.ZodDefault<z.ZodArray<z.ZodObject<{
375
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodString>>;
376
+ jq: z.ZodDefault<z.ZodNullable<z.ZodObject<{
377
+ content: z.ZodOptional<z.ZodString>;
378
+ id: z.ZodOptional<z.ZodString>;
379
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
380
+ }, z.core.$strict>>>;
381
+ into: z.ZodString;
382
+ }, z.core.$strip>>>;
383
+ updates: z.ZodDefault<z.ZodArray<z.ZodObject<{
384
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodString>>;
385
+ jq: z.ZodDefault<z.ZodNullable<z.ZodObject<{
386
+ content: z.ZodOptional<z.ZodString>;
387
+ id: z.ZodOptional<z.ZodString>;
388
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
389
+ }, z.core.$strict>>>;
390
+ adapter: z.ZodDefault<z.ZodNullable<z.ZodObject<{
391
+ content: z.ZodOptional<z.ZodString>;
392
+ id: z.ZodOptional<z.ZodString>;
393
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
394
+ }, z.core.$strict>>>;
395
+ op_id: z.ZodDefault<z.ZodNullable<z.ZodObject<{
396
+ content: z.ZodOptional<z.ZodString>;
397
+ id: z.ZodOptional<z.ZodString>;
398
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
399
+ }, z.core.$strict>>>;
400
+ }, z.core.$strip>>>;
401
+ }, z.core.$strip>>;
402
+ }, z.core.$strip>>>;
185
403
  }, z.core.$strip>;
186
404
  export type PresetBody = z.infer<typeof presetBody>;
187
405
  /**
@@ -201,6 +419,50 @@ export declare const presetVersion: z.ZodObject<{
201
419
  config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
202
420
  }, z.core.$strip>]>>>;
203
421
  output_schema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
422
+ input_schema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
423
+ state_binding: z.ZodDefault<z.ZodNullable<z.ZodObject<{
424
+ states: z.ZodArray<z.ZodObject<{
425
+ state: z.ZodString;
426
+ templates: z.ZodDefault<z.ZodArray<z.ZodString>>;
427
+ subject_expr: z.ZodObject<{
428
+ content: z.ZodOptional<z.ZodString>;
429
+ id: z.ZodOptional<z.ZodString>;
430
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
431
+ }, z.core.$strict>;
432
+ scope_expr: z.ZodDefault<z.ZodNullable<z.ZodObject<{
433
+ content: z.ZodOptional<z.ZodString>;
434
+ id: z.ZodOptional<z.ZodString>;
435
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
436
+ }, z.core.$strict>>>;
437
+ input_injections: z.ZodDefault<z.ZodArray<z.ZodObject<{
438
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodString>>;
439
+ jq: z.ZodDefault<z.ZodNullable<z.ZodObject<{
440
+ content: z.ZodOptional<z.ZodString>;
441
+ id: z.ZodOptional<z.ZodString>;
442
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
443
+ }, z.core.$strict>>>;
444
+ into: z.ZodString;
445
+ }, z.core.$strip>>>;
446
+ updates: z.ZodDefault<z.ZodArray<z.ZodObject<{
447
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodString>>;
448
+ jq: z.ZodDefault<z.ZodNullable<z.ZodObject<{
449
+ content: z.ZodOptional<z.ZodString>;
450
+ id: z.ZodOptional<z.ZodString>;
451
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
452
+ }, z.core.$strict>>>;
453
+ adapter: z.ZodDefault<z.ZodNullable<z.ZodObject<{
454
+ content: z.ZodOptional<z.ZodString>;
455
+ id: z.ZodOptional<z.ZodString>;
456
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
457
+ }, z.core.$strict>>>;
458
+ op_id: z.ZodDefault<z.ZodNullable<z.ZodObject<{
459
+ content: z.ZodOptional<z.ZodString>;
460
+ id: z.ZodOptional<z.ZodString>;
461
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
462
+ }, z.core.$strict>>>;
463
+ }, z.core.$strip>>>;
464
+ }, z.core.$strip>>;
465
+ }, z.core.$strip>>>;
204
466
  }, z.core.$strip>;
205
467
  tags: z.ZodArray<z.ZodString>;
206
468
  created_at: z.ZodString;
@@ -218,6 +480,50 @@ export declare const presetVersionList: z.ZodArray<z.ZodObject<{
218
480
  config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
219
481
  }, z.core.$strip>]>>>;
220
482
  output_schema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
483
+ input_schema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
484
+ state_binding: z.ZodDefault<z.ZodNullable<z.ZodObject<{
485
+ states: z.ZodArray<z.ZodObject<{
486
+ state: z.ZodString;
487
+ templates: z.ZodDefault<z.ZodArray<z.ZodString>>;
488
+ subject_expr: z.ZodObject<{
489
+ content: z.ZodOptional<z.ZodString>;
490
+ id: z.ZodOptional<z.ZodString>;
491
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
492
+ }, z.core.$strict>;
493
+ scope_expr: z.ZodDefault<z.ZodNullable<z.ZodObject<{
494
+ content: z.ZodOptional<z.ZodString>;
495
+ id: z.ZodOptional<z.ZodString>;
496
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
497
+ }, z.core.$strict>>>;
498
+ input_injections: z.ZodDefault<z.ZodArray<z.ZodObject<{
499
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodString>>;
500
+ jq: z.ZodDefault<z.ZodNullable<z.ZodObject<{
501
+ content: z.ZodOptional<z.ZodString>;
502
+ id: z.ZodOptional<z.ZodString>;
503
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
504
+ }, z.core.$strict>>>;
505
+ into: z.ZodString;
506
+ }, z.core.$strip>>>;
507
+ updates: z.ZodDefault<z.ZodArray<z.ZodObject<{
508
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodString>>;
509
+ jq: z.ZodDefault<z.ZodNullable<z.ZodObject<{
510
+ content: z.ZodOptional<z.ZodString>;
511
+ id: z.ZodOptional<z.ZodString>;
512
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
513
+ }, z.core.$strict>>>;
514
+ adapter: z.ZodDefault<z.ZodNullable<z.ZodObject<{
515
+ content: z.ZodOptional<z.ZodString>;
516
+ id: z.ZodOptional<z.ZodString>;
517
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
518
+ }, z.core.$strict>>>;
519
+ op_id: z.ZodDefault<z.ZodNullable<z.ZodObject<{
520
+ content: z.ZodOptional<z.ZodString>;
521
+ id: z.ZodOptional<z.ZodString>;
522
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
523
+ }, z.core.$strict>>>;
524
+ }, z.core.$strip>>>;
525
+ }, z.core.$strip>>;
526
+ }, z.core.$strip>>>;
221
527
  }, z.core.$strip>;
222
528
  tags: z.ZodArray<z.ZodString>;
223
529
  created_at: z.ZodString;
@@ -1769,6 +2075,49 @@ export declare const conversationRoute: z.ZodObject<{
1769
2075
  turns_per_hour_override: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1770
2076
  error_reply_text: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1771
2077
  execution_key_fingerprint: z.ZodString;
2078
+ state_binding: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2079
+ states: z.ZodArray<z.ZodObject<{
2080
+ state: z.ZodString;
2081
+ templates: z.ZodDefault<z.ZodArray<z.ZodString>>;
2082
+ subject_expr: z.ZodObject<{
2083
+ content: z.ZodOptional<z.ZodString>;
2084
+ id: z.ZodOptional<z.ZodString>;
2085
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2086
+ }, z.core.$strict>;
2087
+ scope_expr: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2088
+ content: z.ZodOptional<z.ZodString>;
2089
+ id: z.ZodOptional<z.ZodString>;
2090
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2091
+ }, z.core.$strict>>>;
2092
+ input_injections: z.ZodDefault<z.ZodArray<z.ZodObject<{
2093
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2094
+ jq: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2095
+ content: z.ZodOptional<z.ZodString>;
2096
+ id: z.ZodOptional<z.ZodString>;
2097
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2098
+ }, z.core.$strict>>>;
2099
+ into: z.ZodString;
2100
+ }, z.core.$strip>>>;
2101
+ updates: z.ZodDefault<z.ZodArray<z.ZodObject<{
2102
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2103
+ jq: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2104
+ content: z.ZodOptional<z.ZodString>;
2105
+ id: z.ZodOptional<z.ZodString>;
2106
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2107
+ }, z.core.$strict>>>;
2108
+ adapter: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2109
+ content: z.ZodOptional<z.ZodString>;
2110
+ id: z.ZodOptional<z.ZodString>;
2111
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2112
+ }, z.core.$strict>>>;
2113
+ op_id: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2114
+ content: z.ZodOptional<z.ZodString>;
2115
+ id: z.ZodOptional<z.ZodString>;
2116
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2117
+ }, z.core.$strict>>>;
2118
+ }, z.core.$strip>>>;
2119
+ }, z.core.$strip>>;
2120
+ }, z.core.$strip>>>;
1772
2121
  }, z.core.$strip>;
1773
2122
  export type ConversationRoute = z.infer<typeof conversationRoute>;
1774
2123
  export declare const conversationRoutes: z.ZodObject<{
@@ -1796,6 +2145,49 @@ export declare const conversationRoutes: z.ZodObject<{
1796
2145
  turns_per_hour_override: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1797
2146
  error_reply_text: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1798
2147
  execution_key_fingerprint: z.ZodString;
2148
+ state_binding: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2149
+ states: z.ZodArray<z.ZodObject<{
2150
+ state: z.ZodString;
2151
+ templates: z.ZodDefault<z.ZodArray<z.ZodString>>;
2152
+ subject_expr: z.ZodObject<{
2153
+ content: z.ZodOptional<z.ZodString>;
2154
+ id: z.ZodOptional<z.ZodString>;
2155
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2156
+ }, z.core.$strict>;
2157
+ scope_expr: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2158
+ content: z.ZodOptional<z.ZodString>;
2159
+ id: z.ZodOptional<z.ZodString>;
2160
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2161
+ }, z.core.$strict>>>;
2162
+ input_injections: z.ZodDefault<z.ZodArray<z.ZodObject<{
2163
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2164
+ jq: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2165
+ content: z.ZodOptional<z.ZodString>;
2166
+ id: z.ZodOptional<z.ZodString>;
2167
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2168
+ }, z.core.$strict>>>;
2169
+ into: z.ZodString;
2170
+ }, z.core.$strip>>>;
2171
+ updates: z.ZodDefault<z.ZodArray<z.ZodObject<{
2172
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2173
+ jq: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2174
+ content: z.ZodOptional<z.ZodString>;
2175
+ id: z.ZodOptional<z.ZodString>;
2176
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2177
+ }, z.core.$strict>>>;
2178
+ adapter: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2179
+ content: z.ZodOptional<z.ZodString>;
2180
+ id: z.ZodOptional<z.ZodString>;
2181
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2182
+ }, z.core.$strict>>>;
2183
+ op_id: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2184
+ content: z.ZodOptional<z.ZodString>;
2185
+ id: z.ZodOptional<z.ZodString>;
2186
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2187
+ }, z.core.$strict>>>;
2188
+ }, z.core.$strip>>>;
2189
+ }, z.core.$strip>>;
2190
+ }, z.core.$strip>>>;
1799
2191
  }, z.core.$strip>>;
1800
2192
  total: z.ZodNumber;
1801
2193
  }, z.core.$strip>;
@@ -1836,6 +2228,49 @@ export declare const conversationRouteCreate: z.ZodObject<{
1836
2228
  callback_url: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1837
2229
  turns_per_hour_override: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1838
2230
  error_reply_text: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2231
+ state_binding: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2232
+ states: z.ZodArray<z.ZodObject<{
2233
+ state: z.ZodString;
2234
+ templates: z.ZodDefault<z.ZodArray<z.ZodString>>;
2235
+ subject_expr: z.ZodObject<{
2236
+ content: z.ZodOptional<z.ZodString>;
2237
+ id: z.ZodOptional<z.ZodString>;
2238
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2239
+ }, z.core.$strict>;
2240
+ scope_expr: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2241
+ content: z.ZodOptional<z.ZodString>;
2242
+ id: z.ZodOptional<z.ZodString>;
2243
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2244
+ }, z.core.$strict>>>;
2245
+ input_injections: z.ZodDefault<z.ZodArray<z.ZodObject<{
2246
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2247
+ jq: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2248
+ content: z.ZodOptional<z.ZodString>;
2249
+ id: z.ZodOptional<z.ZodString>;
2250
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2251
+ }, z.core.$strict>>>;
2252
+ into: z.ZodString;
2253
+ }, z.core.$strip>>>;
2254
+ updates: z.ZodDefault<z.ZodArray<z.ZodObject<{
2255
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2256
+ jq: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2257
+ content: z.ZodOptional<z.ZodString>;
2258
+ id: z.ZodOptional<z.ZodString>;
2259
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2260
+ }, z.core.$strict>>>;
2261
+ adapter: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2262
+ content: z.ZodOptional<z.ZodString>;
2263
+ id: z.ZodOptional<z.ZodString>;
2264
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2265
+ }, z.core.$strict>>>;
2266
+ op_id: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2267
+ content: z.ZodOptional<z.ZodString>;
2268
+ id: z.ZodOptional<z.ZodString>;
2269
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2270
+ }, z.core.$strict>>>;
2271
+ }, z.core.$strip>>>;
2272
+ }, z.core.$strip>>;
2273
+ }, z.core.$strip>>>;
1839
2274
  }, z.core.$strip>;
1840
2275
  export type ConversationRouteCreate = z.infer<typeof conversationRouteCreate>;
1841
2276
  /**
@@ -1872,6 +2307,49 @@ export declare const conversationRouteWritten: z.ZodObject<{
1872
2307
  turns_per_hour_override: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1873
2308
  error_reply_text: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1874
2309
  execution_key_fingerprint: z.ZodString;
2310
+ state_binding: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2311
+ states: z.ZodArray<z.ZodObject<{
2312
+ state: z.ZodString;
2313
+ templates: z.ZodDefault<z.ZodArray<z.ZodString>>;
2314
+ subject_expr: z.ZodObject<{
2315
+ content: z.ZodOptional<z.ZodString>;
2316
+ id: z.ZodOptional<z.ZodString>;
2317
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2318
+ }, z.core.$strict>;
2319
+ scope_expr: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2320
+ content: z.ZodOptional<z.ZodString>;
2321
+ id: z.ZodOptional<z.ZodString>;
2322
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2323
+ }, z.core.$strict>>>;
2324
+ input_injections: z.ZodDefault<z.ZodArray<z.ZodObject<{
2325
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2326
+ jq: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2327
+ content: z.ZodOptional<z.ZodString>;
2328
+ id: z.ZodOptional<z.ZodString>;
2329
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2330
+ }, z.core.$strict>>>;
2331
+ into: z.ZodString;
2332
+ }, z.core.$strip>>>;
2333
+ updates: z.ZodDefault<z.ZodArray<z.ZodObject<{
2334
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2335
+ jq: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2336
+ content: z.ZodOptional<z.ZodString>;
2337
+ id: z.ZodOptional<z.ZodString>;
2338
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2339
+ }, z.core.$strict>>>;
2340
+ adapter: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2341
+ content: z.ZodOptional<z.ZodString>;
2342
+ id: z.ZodOptional<z.ZodString>;
2343
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2344
+ }, z.core.$strict>>>;
2345
+ op_id: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2346
+ content: z.ZodOptional<z.ZodString>;
2347
+ id: z.ZodOptional<z.ZodString>;
2348
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2349
+ }, z.core.$strict>>>;
2350
+ }, z.core.$strip>>>;
2351
+ }, z.core.$strip>>;
2352
+ }, z.core.$strip>>>;
1875
2353
  }, z.core.$strip>;
1876
2354
  callback_secret: z.ZodNullable<z.ZodString>;
1877
2355
  }, z.core.$strip>;
@@ -2395,12 +2873,59 @@ export declare const hookParams: z.ZodObject<{
2395
2873
  kind: z.ZodString;
2396
2874
  key_expr: z.ZodString;
2397
2875
  }, z.core.$strip>>>;
2398
- condition: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2399
- condition_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2400
- condition_kwargs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2401
- expr: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2402
- expr_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2403
- expr_kwargs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2876
+ condition: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2877
+ content: z.ZodOptional<z.ZodString>;
2878
+ id: z.ZodOptional<z.ZodString>;
2879
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2880
+ }, z.core.$strict>>>;
2881
+ expr: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2882
+ content: z.ZodOptional<z.ZodString>;
2883
+ id: z.ZodOptional<z.ZodString>;
2884
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2885
+ }, z.core.$strict>>>;
2886
+ state_binding: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2887
+ states: z.ZodArray<z.ZodObject<{
2888
+ state: z.ZodString;
2889
+ templates: z.ZodDefault<z.ZodArray<z.ZodString>>;
2890
+ subject_expr: z.ZodObject<{
2891
+ content: z.ZodOptional<z.ZodString>;
2892
+ id: z.ZodOptional<z.ZodString>;
2893
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2894
+ }, z.core.$strict>;
2895
+ scope_expr: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2896
+ content: z.ZodOptional<z.ZodString>;
2897
+ id: z.ZodOptional<z.ZodString>;
2898
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2899
+ }, z.core.$strict>>>;
2900
+ input_injections: z.ZodDefault<z.ZodArray<z.ZodObject<{
2901
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2902
+ jq: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2903
+ content: z.ZodOptional<z.ZodString>;
2904
+ id: z.ZodOptional<z.ZodString>;
2905
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2906
+ }, z.core.$strict>>>;
2907
+ into: z.ZodString;
2908
+ }, z.core.$strip>>>;
2909
+ updates: z.ZodDefault<z.ZodArray<z.ZodObject<{
2910
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2911
+ jq: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2912
+ content: z.ZodOptional<z.ZodString>;
2913
+ id: z.ZodOptional<z.ZodString>;
2914
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2915
+ }, z.core.$strict>>>;
2916
+ adapter: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2917
+ content: z.ZodOptional<z.ZodString>;
2918
+ id: z.ZodOptional<z.ZodString>;
2919
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2920
+ }, z.core.$strict>>>;
2921
+ op_id: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2922
+ content: z.ZodOptional<z.ZodString>;
2923
+ id: z.ZodOptional<z.ZodString>;
2924
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2925
+ }, z.core.$strict>>>;
2926
+ }, z.core.$strip>>>;
2927
+ }, z.core.$strip>>;
2928
+ }, z.core.$strip>>>;
2404
2929
  }, z.core.$strip>;
2405
2930
  export type HookParams = z.infer<typeof hookParams>;
2406
2931
  export declare const hookList: z.ZodObject<{
@@ -2419,12 +2944,59 @@ export declare const hookList: z.ZodObject<{
2419
2944
  kind: z.ZodString;
2420
2945
  key_expr: z.ZodString;
2421
2946
  }, z.core.$strip>>>;
2422
- condition: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2423
- condition_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2424
- condition_kwargs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2425
- expr: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2426
- expr_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2427
- expr_kwargs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2947
+ condition: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2948
+ content: z.ZodOptional<z.ZodString>;
2949
+ id: z.ZodOptional<z.ZodString>;
2950
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2951
+ }, z.core.$strict>>>;
2952
+ expr: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2953
+ content: z.ZodOptional<z.ZodString>;
2954
+ id: z.ZodOptional<z.ZodString>;
2955
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2956
+ }, z.core.$strict>>>;
2957
+ state_binding: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2958
+ states: z.ZodArray<z.ZodObject<{
2959
+ state: z.ZodString;
2960
+ templates: z.ZodDefault<z.ZodArray<z.ZodString>>;
2961
+ subject_expr: z.ZodObject<{
2962
+ content: z.ZodOptional<z.ZodString>;
2963
+ id: z.ZodOptional<z.ZodString>;
2964
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2965
+ }, z.core.$strict>;
2966
+ scope_expr: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2967
+ content: z.ZodOptional<z.ZodString>;
2968
+ id: z.ZodOptional<z.ZodString>;
2969
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2970
+ }, z.core.$strict>>>;
2971
+ input_injections: z.ZodDefault<z.ZodArray<z.ZodObject<{
2972
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2973
+ jq: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2974
+ content: z.ZodOptional<z.ZodString>;
2975
+ id: z.ZodOptional<z.ZodString>;
2976
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2977
+ }, z.core.$strict>>>;
2978
+ into: z.ZodString;
2979
+ }, z.core.$strip>>>;
2980
+ updates: z.ZodDefault<z.ZodArray<z.ZodObject<{
2981
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2982
+ jq: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2983
+ content: z.ZodOptional<z.ZodString>;
2984
+ id: z.ZodOptional<z.ZodString>;
2985
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2986
+ }, z.core.$strict>>>;
2987
+ adapter: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2988
+ content: z.ZodOptional<z.ZodString>;
2989
+ id: z.ZodOptional<z.ZodString>;
2990
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2991
+ }, z.core.$strict>>>;
2992
+ op_id: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2993
+ content: z.ZodOptional<z.ZodString>;
2994
+ id: z.ZodOptional<z.ZodString>;
2995
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2996
+ }, z.core.$strict>>>;
2997
+ }, z.core.$strip>>>;
2998
+ }, z.core.$strip>>;
2999
+ }, z.core.$strip>>>;
2428
3000
  }, z.core.$strip>>;
2429
3001
  total: z.ZodNumber;
2430
3002
  topic_verifiers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -2631,16 +3203,18 @@ export type RoleGrants = z.infer<typeof roleGrants>;
2631
3203
  * read-only base-tier ceiling — the seeded jq `condition` plus `base_tier`
2632
3204
  * (`editor`/`viewer`, or `null` for the reserved `allow_all` admin). Layer 2 is the
2633
3205
  * editable per-tag `grants` map. `allow_all` (admin) carries an empty `grants` map
2634
- * and reaches everything, un-lockable. `condition`/`condition_id`/`condition_kwargs`
2635
- * are the base-tier jq — READ-ONLY here (no raw-jq authoring surface).
3206
+ * and reaches everything, un-lockable. `condition` is the base-tier jq (an authored
3207
+ * templated-text value) — READ-ONLY here (no raw-jq authoring surface).
2636
3208
  */
2637
3209
  export declare const roleBody: z.ZodObject<{
2638
3210
  name: z.ZodString;
2639
3211
  description: z.ZodString;
2640
3212
  scopes: z.ZodArray<z.ZodString>;
2641
- condition: z.ZodNullable<z.ZodString>;
2642
- condition_id: z.ZodNullable<z.ZodString>;
2643
- condition_kwargs: z.ZodNullable<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
3213
+ condition: z.ZodNullable<z.ZodObject<{
3214
+ content: z.ZodOptional<z.ZodString>;
3215
+ id: z.ZodOptional<z.ZodString>;
3216
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3217
+ }, z.core.$strict>>;
2644
3218
  base_tier: z.ZodNullable<z.ZodString>;
2645
3219
  allow_all: z.ZodBoolean;
2646
3220
  grants: z.ZodRecord<z.ZodString, z.ZodEnum<{
@@ -2654,9 +3228,11 @@ export declare const roleList: z.ZodArray<z.ZodObject<{
2654
3228
  name: z.ZodString;
2655
3229
  description: z.ZodString;
2656
3230
  scopes: z.ZodArray<z.ZodString>;
2657
- condition: z.ZodNullable<z.ZodString>;
2658
- condition_id: z.ZodNullable<z.ZodString>;
2659
- condition_kwargs: z.ZodNullable<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
3231
+ condition: z.ZodNullable<z.ZodObject<{
3232
+ content: z.ZodOptional<z.ZodString>;
3233
+ id: z.ZodOptional<z.ZodString>;
3234
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3235
+ }, z.core.$strict>>;
2660
3236
  base_tier: z.ZodNullable<z.ZodString>;
2661
3237
  allow_all: z.ZodBoolean;
2662
3238
  grants: z.ZodRecord<z.ZodString, z.ZodEnum<{
@@ -2681,9 +3257,11 @@ export declare const roleVersion: z.ZodObject<{
2681
3257
  name: z.ZodString;
2682
3258
  description: z.ZodString;
2683
3259
  scopes: z.ZodArray<z.ZodString>;
2684
- condition: z.ZodNullable<z.ZodString>;
2685
- condition_id: z.ZodNullable<z.ZodString>;
2686
- condition_kwargs: z.ZodNullable<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
3260
+ condition: z.ZodNullable<z.ZodObject<{
3261
+ content: z.ZodOptional<z.ZodString>;
3262
+ id: z.ZodOptional<z.ZodString>;
3263
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3264
+ }, z.core.$strict>>;
2687
3265
  base_tier: z.ZodNullable<z.ZodString>;
2688
3266
  allow_all: z.ZodBoolean;
2689
3267
  grants: z.ZodRecord<z.ZodString, z.ZodEnum<{
@@ -2723,9 +3301,11 @@ export declare const roleVersions: z.ZodObject<{
2723
3301
  name: z.ZodString;
2724
3302
  description: z.ZodString;
2725
3303
  scopes: z.ZodArray<z.ZodString>;
2726
- condition: z.ZodNullable<z.ZodString>;
2727
- condition_id: z.ZodNullable<z.ZodString>;
2728
- condition_kwargs: z.ZodNullable<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
3304
+ condition: z.ZodNullable<z.ZodObject<{
3305
+ content: z.ZodOptional<z.ZodString>;
3306
+ id: z.ZodOptional<z.ZodString>;
3307
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3308
+ }, z.core.$strict>>;
2729
3309
  base_tier: z.ZodNullable<z.ZodString>;
2730
3310
  allow_all: z.ZodBoolean;
2731
3311
  grants: z.ZodRecord<z.ZodString, z.ZodEnum<{
@@ -2769,9 +3349,11 @@ export declare const tokensPayload: z.ZodArray<z.ZodObject<{
2769
3349
  description: z.ZodString;
2770
3350
  scopes: z.ZodArray<z.ZodString>;
2771
3351
  policy_data: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
2772
- condition: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2773
- condition_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2774
- condition_kwargs: z.ZodOptional<z.ZodNullable<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
3352
+ condition: z.ZodOptional<z.ZodNullable<z.ZodObject<{
3353
+ content: z.ZodOptional<z.ZodString>;
3354
+ id: z.ZodOptional<z.ZodString>;
3355
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3356
+ }, z.core.$strict>>>;
2775
3357
  }, z.core.$strip>>;
2776
3358
  export type TokensPayload = z.infer<typeof tokensPayload>;
2777
3359
  /** Mint reply `{ api_key, key_fingerprint }` narrowed to the raw `sk-…` key,
@@ -2986,15 +3568,17 @@ export type ValidateConditionResult = z.infer<typeof validateConditionResult>;
2986
3568
  /**
2987
3569
  * The enforced policy shape a version body carries. SECRET-ADJACENT — `condition`
2988
3570
  * can reveal auth logic, so its fixtures are hand-authored, never captured.
2989
- * `condition`/`condition_id` are mutually exclusive at author time; both are
2990
- * nullable here because whichever mode is unused is stored as `null`.
3571
+ * `condition` is an authored templated-text value (inline content or a stored
3572
+ * template id); `null` when the policy carries no condition.
2991
3573
  */
2992
3574
  export declare const policyBody: z.ZodObject<{
2993
3575
  scopes: z.ZodArray<z.ZodString>;
2994
3576
  policy_data: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
2995
- condition: z.ZodNullable<z.ZodString>;
2996
- condition_id: z.ZodNullable<z.ZodString>;
2997
- condition_kwargs: z.ZodNullable<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
3577
+ condition: z.ZodNullable<z.ZodObject<{
3578
+ content: z.ZodOptional<z.ZodString>;
3579
+ id: z.ZodOptional<z.ZodString>;
3580
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3581
+ }, z.core.$strict>>;
2998
3582
  }, z.core.$strip>;
2999
3583
  export type PolicyBody = z.infer<typeof policyBody>;
3000
3584
  /**
@@ -3008,9 +3592,11 @@ export declare const policyVersion: z.ZodObject<{
3008
3592
  body: z.ZodObject<{
3009
3593
  scopes: z.ZodArray<z.ZodString>;
3010
3594
  policy_data: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
3011
- condition: z.ZodNullable<z.ZodString>;
3012
- condition_id: z.ZodNullable<z.ZodString>;
3013
- condition_kwargs: z.ZodNullable<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
3595
+ condition: z.ZodNullable<z.ZodObject<{
3596
+ content: z.ZodOptional<z.ZodString>;
3597
+ id: z.ZodOptional<z.ZodString>;
3598
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3599
+ }, z.core.$strict>>;
3014
3600
  }, z.core.$strip>;
3015
3601
  tags: z.ZodArray<z.ZodString>;
3016
3602
  created_at: z.ZodString;
@@ -3022,9 +3608,11 @@ export declare const policyVersionList: z.ZodArray<z.ZodObject<{
3022
3608
  body: z.ZodObject<{
3023
3609
  scopes: z.ZodArray<z.ZodString>;
3024
3610
  policy_data: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
3025
- condition: z.ZodNullable<z.ZodString>;
3026
- condition_id: z.ZodNullable<z.ZodString>;
3027
- condition_kwargs: z.ZodNullable<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
3611
+ condition: z.ZodNullable<z.ZodObject<{
3612
+ content: z.ZodOptional<z.ZodString>;
3613
+ id: z.ZodOptional<z.ZodString>;
3614
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3615
+ }, z.core.$strict>>;
3028
3616
  }, z.core.$strip>;
3029
3617
  tags: z.ZodArray<z.ZodString>;
3030
3618
  created_at: z.ZodString;
@@ -3960,11 +4548,11 @@ export declare const stateSubject: z.ZodObject<{
3960
4548
  key: z.ZodString;
3961
4549
  }, z.core.$strip>;
3962
4550
  export type StateSubject = z.infer<typeof stateSubject>;
3963
- /** One absolute write-regime rule composed over the mounts: `{path, regime}`, permissive. */
4551
+ /** One absolute write-regime rule composed over the attachments: `{path, regime}`, permissive. */
3964
4552
  export declare const stateRegime: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3965
4553
  /**
3966
4554
  * A declared state served on every read. `schema` is the base JSON Schema;
3967
- * `effective_schema` (the base composed with every mounted module's fragment) and
4555
+ * `effective_schema` (the base composed with every attached template's fragment) and
3968
4556
  * `regimes` (the absolute write-regime rules) are platform-COMPUTED and served on every
3969
4557
  * read — modelled optional so a write body that omits them, or a server yet to compose
3970
4558
  * them, still parses. A drift throws ApiSchemaError.
@@ -4009,21 +4597,21 @@ export declare const stateList: z.ZodArray<z.ZodObject<{
4009
4597
  regimes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
4010
4598
  updated_at: z.ZodDefault<z.ZodNullable<z.ZodString>>;
4011
4599
  }, z.core.$strip>>;
4012
- /** One module mount on a state: where the fragment lands + its param/declaration values. */
4013
- export declare const stateMount: z.ZodObject<{
4014
- module: z.ZodString;
4600
+ /** One template attachment on a state: where the fragment lands + its param/declaration values. */
4601
+ export declare const stateAttachment: z.ZodObject<{
4602
+ template: z.ZodString;
4015
4603
  path: z.ZodArray<z.ZodString>;
4016
4604
  parameters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4017
4605
  declarations: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4018
4606
  }, z.core.$strip>;
4019
- export type StateMount = z.infer<typeof stateMount>;
4020
- export declare const stateMountList: z.ZodArray<z.ZodObject<{
4021
- module: z.ZodString;
4607
+ export type StateAttachment = z.infer<typeof stateAttachment>;
4608
+ export declare const stateAttachmentList: z.ZodArray<z.ZodObject<{
4609
+ template: z.ZodString;
4022
4610
  path: z.ZodArray<z.ZodString>;
4023
4611
  parameters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4024
4612
  declarations: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4025
4613
  }, z.core.$strip>>;
4026
- /** `GET /api/states/{name}` — the declaration (with effective schema + regimes) plus mounts. */
4614
+ /** `GET /api/states/{name}` — the declaration (with effective schema + regimes) plus attachments. */
4027
4615
  export declare const stateDetail: z.ZodObject<{
4028
4616
  name: z.ZodString;
4029
4617
  description: z.ZodDefault<z.ZodString>;
@@ -4033,8 +4621,8 @@ export declare const stateDetail: z.ZodObject<{
4033
4621
  retention_days: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
4034
4622
  effective_schema: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
4035
4623
  regimes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
4036
- mounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
4037
- module: z.ZodString;
4624
+ attachments: z.ZodDefault<z.ZodArray<z.ZodObject<{
4625
+ template: z.ZodString;
4038
4626
  path: z.ZodArray<z.ZodString>;
4039
4627
  parameters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4040
4628
  declarations: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -4054,51 +4642,236 @@ export declare const stateStats: z.ZodObject<{
4054
4642
  consumers: z.ZodDefault<z.ZodNumber>;
4055
4643
  }, z.core.$strip>;
4056
4644
  export type StateStats = z.infer<typeof stateStats>;
4057
- /** The platform half of a state-module document (mirrors StateModuleDocument). */
4058
- export declare const stateModuleDocument: z.ZodObject<{
4059
- kind: z.ZodDefault<z.ZodLiteral<"state-module">>;
4645
+ /**
4646
+ * One template jq: `jq` is a program over the subject's attached subtree, authored as a
4647
+ * templated text (inline `content` or a stored template `id`); its `purpose` is either
4648
+ * `input` (a read-only program feeding a tool argument) or `update` (a program returning
4649
+ * an op batch that mutates the record). `params` are its declared argument names;
4650
+ * `reads`/`writes` are the template-relative record paths an `update` declares, each a
4651
+ * list of key segments; `description` is the human label.
4652
+ */
4653
+ export declare const templateJq: z.ZodObject<{
4654
+ description: z.ZodDefault<z.ZodString>;
4655
+ purpose: z.ZodEnum<{
4656
+ input: "input";
4657
+ update: "update";
4658
+ }>;
4659
+ params: z.ZodDefault<z.ZodArray<z.ZodString>>;
4660
+ reads: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodString>>>;
4661
+ writes: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodString>>>;
4662
+ jq: z.ZodObject<{
4663
+ content: z.ZodOptional<z.ZodString>;
4664
+ id: z.ZodOptional<z.ZodString>;
4665
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4666
+ }, z.core.$strict>;
4667
+ }, z.core.$strip>;
4668
+ export type TemplateJq = z.infer<typeof templateJq>;
4669
+ /**
4670
+ * How a declarations edit settles open records: `orphans` returns the items a record
4671
+ * orphans against the new declarations, `close` builds the op batch that closes one
4672
+ * orphan, `resolutions` names the resolutions a close may name — each a templated-text
4673
+ * jq program (inline `content` or a stored template `id`).
4674
+ */
4675
+ export declare const templateReconcile: z.ZodObject<{
4676
+ orphans: z.ZodObject<{
4677
+ content: z.ZodOptional<z.ZodString>;
4678
+ id: z.ZodOptional<z.ZodString>;
4679
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4680
+ }, z.core.$strict>;
4681
+ close: z.ZodObject<{
4682
+ content: z.ZodOptional<z.ZodString>;
4683
+ id: z.ZodOptional<z.ZodString>;
4684
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4685
+ }, z.core.$strict>;
4686
+ resolutions: z.ZodObject<{
4687
+ content: z.ZodOptional<z.ZodString>;
4688
+ id: z.ZodOptional<z.ZodString>;
4689
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4690
+ }, z.core.$strict>;
4691
+ }, z.core.$strip>;
4692
+ export type TemplateReconcile = z.infer<typeof templateReconcile>;
4693
+ /**
4694
+ * A template's declarations section: `schema` is the JSON schema of the static values an
4695
+ * attachment stores, and `check` is an optional attach-time predicate authored as a
4696
+ * templated text (inline `content` or a stored template `id`), `null` when the template
4697
+ * declares none.
4698
+ */
4699
+ export declare const templateDeclarations: z.ZodObject<{
4700
+ schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
4701
+ check: z.ZodDefault<z.ZodNullable<z.ZodObject<{
4702
+ content: z.ZodOptional<z.ZodString>;
4703
+ id: z.ZodOptional<z.ZodString>;
4704
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4705
+ }, z.core.$strict>>>;
4706
+ }, z.core.$strip>;
4707
+ export type TemplateDeclarations = z.infer<typeof templateDeclarations>;
4708
+ /**
4709
+ * The platform half of a state-template document (mirrors StateTemplateDocument).
4710
+ * `template_jq` maps a name to its definition (each carrying its `purpose`);
4711
+ * `reconcile` is the settle policy; `declarations` is the static-values section — all
4712
+ * optional (`null` when the template declares none).
4713
+ */
4714
+ export declare const stateTemplateDocument: z.ZodObject<{
4715
+ kind: z.ZodDefault<z.ZodLiteral<"state-template">>;
4060
4716
  name: z.ZodString;
4061
4717
  description: z.ZodDefault<z.ZodString>;
4062
4718
  parameters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4063
4719
  schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
4064
4720
  regimes: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
4065
- declarations: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
4721
+ declarations: z.ZodDefault<z.ZodNullable<z.ZodObject<{
4722
+ schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
4723
+ check: z.ZodDefault<z.ZodNullable<z.ZodObject<{
4724
+ content: z.ZodOptional<z.ZodString>;
4725
+ id: z.ZodOptional<z.ZodString>;
4726
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4727
+ }, z.core.$strict>>>;
4728
+ }, z.core.$strip>>>;
4066
4729
  trace: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4730
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
4731
+ description: z.ZodDefault<z.ZodString>;
4732
+ purpose: z.ZodEnum<{
4733
+ input: "input";
4734
+ update: "update";
4735
+ }>;
4736
+ params: z.ZodDefault<z.ZodArray<z.ZodString>>;
4737
+ reads: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodString>>>;
4738
+ writes: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodString>>>;
4739
+ jq: z.ZodObject<{
4740
+ content: z.ZodOptional<z.ZodString>;
4741
+ id: z.ZodOptional<z.ZodString>;
4742
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4743
+ }, z.core.$strict>;
4744
+ }, z.core.$strip>>>>;
4745
+ reconcile: z.ZodDefault<z.ZodNullable<z.ZodObject<{
4746
+ orphans: z.ZodObject<{
4747
+ content: z.ZodOptional<z.ZodString>;
4748
+ id: z.ZodOptional<z.ZodString>;
4749
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4750
+ }, z.core.$strict>;
4751
+ close: z.ZodObject<{
4752
+ content: z.ZodOptional<z.ZodString>;
4753
+ id: z.ZodOptional<z.ZodString>;
4754
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4755
+ }, z.core.$strict>;
4756
+ resolutions: z.ZodObject<{
4757
+ content: z.ZodOptional<z.ZodString>;
4758
+ id: z.ZodOptional<z.ZodString>;
4759
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4760
+ }, z.core.$strict>;
4761
+ }, z.core.$strip>>>;
4067
4762
  }, z.core.$strip>;
4068
- export type StateModuleDocument = z.infer<typeof stateModuleDocument>;
4763
+ export type StateTemplateDocument = z.infer<typeof stateTemplateDocument>;
4069
4764
  /**
4070
- * One row of `GET /api/state-modules`. The module document plus the two derived columns
4071
- * the Modules tab shows: `mounted_on` (how many states mount it — a delete is refused
4072
- * while > 0) and `shipped_default` (a platform-shipped module). ASSUMED derived fields
4073
- * (WP-3 owns the list router); the document fields are verbatim.
4765
+ * One row of `GET /api/state-templates`. The template document plus the two derived columns
4766
+ * the Templates tab shows: `attached_to` (how many states attach it — a delete is refused
4767
+ * while > 0) and `shipped_default` (a platform-shipped template). Both are server-derived
4768
+ * columns; the document fields are verbatim.
4074
4769
  */
4075
- export declare const stateModuleListItem: z.ZodObject<{
4076
- kind: z.ZodDefault<z.ZodLiteral<"state-module">>;
4770
+ export declare const stateTemplateListItem: z.ZodObject<{
4771
+ kind: z.ZodDefault<z.ZodLiteral<"state-template">>;
4077
4772
  name: z.ZodString;
4078
4773
  description: z.ZodDefault<z.ZodString>;
4079
4774
  parameters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4080
4775
  schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
4081
4776
  regimes: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
4082
- declarations: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
4777
+ declarations: z.ZodDefault<z.ZodNullable<z.ZodObject<{
4778
+ schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
4779
+ check: z.ZodDefault<z.ZodNullable<z.ZodObject<{
4780
+ content: z.ZodOptional<z.ZodString>;
4781
+ id: z.ZodOptional<z.ZodString>;
4782
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4783
+ }, z.core.$strict>>>;
4784
+ }, z.core.$strip>>>;
4083
4785
  trace: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4084
- mounted_on: z.ZodDefault<z.ZodNumber>;
4786
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
4787
+ description: z.ZodDefault<z.ZodString>;
4788
+ purpose: z.ZodEnum<{
4789
+ input: "input";
4790
+ update: "update";
4791
+ }>;
4792
+ params: z.ZodDefault<z.ZodArray<z.ZodString>>;
4793
+ reads: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodString>>>;
4794
+ writes: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodString>>>;
4795
+ jq: z.ZodObject<{
4796
+ content: z.ZodOptional<z.ZodString>;
4797
+ id: z.ZodOptional<z.ZodString>;
4798
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4799
+ }, z.core.$strict>;
4800
+ }, z.core.$strip>>>>;
4801
+ reconcile: z.ZodDefault<z.ZodNullable<z.ZodObject<{
4802
+ orphans: z.ZodObject<{
4803
+ content: z.ZodOptional<z.ZodString>;
4804
+ id: z.ZodOptional<z.ZodString>;
4805
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4806
+ }, z.core.$strict>;
4807
+ close: z.ZodObject<{
4808
+ content: z.ZodOptional<z.ZodString>;
4809
+ id: z.ZodOptional<z.ZodString>;
4810
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4811
+ }, z.core.$strict>;
4812
+ resolutions: z.ZodObject<{
4813
+ content: z.ZodOptional<z.ZodString>;
4814
+ id: z.ZodOptional<z.ZodString>;
4815
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4816
+ }, z.core.$strict>;
4817
+ }, z.core.$strip>>>;
4818
+ attached_to: z.ZodDefault<z.ZodNumber>;
4085
4819
  shipped_default: z.ZodDefault<z.ZodBoolean>;
4086
4820
  }, z.core.$strip>;
4087
- export type StateModuleListItem = z.infer<typeof stateModuleListItem>;
4088
- export declare const stateModuleList: z.ZodArray<z.ZodObject<{
4089
- kind: z.ZodDefault<z.ZodLiteral<"state-module">>;
4821
+ export type StateTemplateListItem = z.infer<typeof stateTemplateListItem>;
4822
+ export declare const stateTemplateList: z.ZodArray<z.ZodObject<{
4823
+ kind: z.ZodDefault<z.ZodLiteral<"state-template">>;
4090
4824
  name: z.ZodString;
4091
4825
  description: z.ZodDefault<z.ZodString>;
4092
4826
  parameters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4093
4827
  schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
4094
4828
  regimes: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
4095
- declarations: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
4829
+ declarations: z.ZodDefault<z.ZodNullable<z.ZodObject<{
4830
+ schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
4831
+ check: z.ZodDefault<z.ZodNullable<z.ZodObject<{
4832
+ content: z.ZodOptional<z.ZodString>;
4833
+ id: z.ZodOptional<z.ZodString>;
4834
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4835
+ }, z.core.$strict>>>;
4836
+ }, z.core.$strip>>>;
4096
4837
  trace: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4097
- mounted_on: z.ZodDefault<z.ZodNumber>;
4838
+ template_jq: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
4839
+ description: z.ZodDefault<z.ZodString>;
4840
+ purpose: z.ZodEnum<{
4841
+ input: "input";
4842
+ update: "update";
4843
+ }>;
4844
+ params: z.ZodDefault<z.ZodArray<z.ZodString>>;
4845
+ reads: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodString>>>;
4846
+ writes: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodString>>>;
4847
+ jq: z.ZodObject<{
4848
+ content: z.ZodOptional<z.ZodString>;
4849
+ id: z.ZodOptional<z.ZodString>;
4850
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4851
+ }, z.core.$strict>;
4852
+ }, z.core.$strip>>>>;
4853
+ reconcile: z.ZodDefault<z.ZodNullable<z.ZodObject<{
4854
+ orphans: z.ZodObject<{
4855
+ content: z.ZodOptional<z.ZodString>;
4856
+ id: z.ZodOptional<z.ZodString>;
4857
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4858
+ }, z.core.$strict>;
4859
+ close: z.ZodObject<{
4860
+ content: z.ZodOptional<z.ZodString>;
4861
+ id: z.ZodOptional<z.ZodString>;
4862
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4863
+ }, z.core.$strict>;
4864
+ resolutions: z.ZodObject<{
4865
+ content: z.ZodOptional<z.ZodString>;
4866
+ id: z.ZodOptional<z.ZodString>;
4867
+ kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4868
+ }, z.core.$strict>;
4869
+ }, z.core.$strip>>>;
4870
+ attached_to: z.ZodDefault<z.ZodNumber>;
4098
4871
  shipped_default: z.ZodDefault<z.ZodBoolean>;
4099
4872
  }, z.core.$strip>>;
4100
4873
  /** A read record: the state, its subject, the document + monotonic seq, and any fold. */
4101
- export declare const recordView: z.ZodObject<{
4874
+ export declare const stateRecord: z.ZodObject<{
4102
4875
  state: z.ZodString;
4103
4876
  subject: z.ZodObject<{
4104
4877
  target_kind: z.ZodEnum<{
@@ -4130,7 +4903,7 @@ export declare const recordView: z.ZodObject<{
4130
4903
  key: z.ZodString;
4131
4904
  }, z.core.$strip>>>;
4132
4905
  }, z.core.$strip>;
4133
- export type RecordView = z.infer<typeof recordView>;
4906
+ export type StateRecord = z.infer<typeof stateRecord>;
4134
4907
  /** The outcome of an `apply` (a delta batch): whether it applied + the resulting doc. */
4135
4908
  export declare const applyResult: z.ZodObject<{
4136
4909
  applied: z.ZodBoolean;
@@ -4139,6 +4912,31 @@ export declare const applyResult: z.ZodObject<{
4139
4912
  skipped: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
4140
4913
  }, z.core.$strip>;
4141
4914
  export type ApplyResult = z.infer<typeof applyResult>;
4915
+ /**
4916
+ * `GET …/template-jq/{name}` — the evaluated template jq's `name`, its `purpose`, and
4917
+ * its `value` (the `input` jq's read). GET evaluates ONLY an `input`-purpose jq; a GET
4918
+ * on an `update`-purpose name is refused with 422, so the result's purpose is always
4919
+ * `input`.
4920
+ */
4921
+ export declare const templateJqResult: z.ZodObject<{
4922
+ name: z.ZodString;
4923
+ purpose: z.ZodLiteral<"input">;
4924
+ value: z.ZodUnknown;
4925
+ }, z.core.$strip>;
4926
+ export type TemplateJqResult = z.infer<typeof templateJqResult>;
4927
+ /**
4928
+ * `POST …/template-jq/{name}` — the applied template jq's outcome. The jq lands an op
4929
+ * batch through the same `apply` chokepoint as a delta, so `applied`/`data`/`seq`/`skipped`
4930
+ * carry that outcome.
4931
+ */
4932
+ export declare const templateJqApplyResult: z.ZodObject<{
4933
+ name: z.ZodString;
4934
+ applied: z.ZodBoolean;
4935
+ data: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
4936
+ seq: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
4937
+ skipped: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
4938
+ }, z.core.$strip>;
4939
+ export type TemplateJqApplyResult = z.infer<typeof templateJqApplyResult>;
4142
4940
  /**
4143
4941
  * One paged subject row: the addressed `subject` plus its record's last-write
4144
4942
  * `updated_at` — epoch seconds (the store's `extract(epoch FROM updated_at)`), served
@@ -4291,27 +5089,27 @@ export declare const stateDeleted: z.ZodObject<{
4291
5089
  name: z.ZodString;
4292
5090
  deleted: z.ZodLiteral<true>;
4293
5091
  }, z.core.$strip>;
4294
- /** `PUT /api/states/{name}/mounts/{module}` — the module now mounted on the state. */
4295
- export declare const stateMounted: z.ZodObject<{
4296
- mounted: z.ZodLiteral<true>;
5092
+ /** `PUT /api/states/{name}/attachments/{template}` — the template now attached to the state. */
5093
+ export declare const stateAttached: z.ZodObject<{
5094
+ attached: z.ZodLiteral<true>;
4297
5095
  state: z.ZodString;
4298
- module: z.ZodString;
5096
+ template: z.ZodString;
4299
5097
  }, z.core.$strip>;
4300
- export type StateMounted = z.infer<typeof stateMounted>;
4301
- /** `PATCH /api/states/{name}/mounts/{module}` — the mount whose declarations were rewritten. */
4302
- export declare const stateMountUpdated: z.ZodObject<{
5098
+ export type StateAttached = z.infer<typeof stateAttached>;
5099
+ /** `PATCH /api/states/{name}/attachments/{template}` — the attachment whose declarations were rewritten. */
5100
+ export declare const stateAttachmentUpdated: z.ZodObject<{
4303
5101
  updated: z.ZodLiteral<true>;
4304
5102
  state: z.ZodString;
4305
- module: z.ZodString;
5103
+ template: z.ZodString;
4306
5104
  }, z.core.$strip>;
4307
- export type StateMountUpdated = z.infer<typeof stateMountUpdated>;
4308
- /** `DELETE /api/states/{name}/mounts/{module}` — the module unmounted from the state. */
4309
- export declare const stateUnmounted: z.ZodObject<{
4310
- unmounted: z.ZodLiteral<true>;
5105
+ export type StateAttachmentUpdated = z.infer<typeof stateAttachmentUpdated>;
5106
+ /** `DELETE /api/states/{name}/attachments/{template}` — the template detached from the state. */
5107
+ export declare const stateDetached: z.ZodObject<{
5108
+ detached: z.ZodLiteral<true>;
4311
5109
  state: z.ZodString;
4312
- module: z.ZodString;
5110
+ template: z.ZodString;
4313
5111
  }, z.core.$strip>;
4314
- export type StateUnmounted = z.infer<typeof stateUnmounted>;
5112
+ export type StateDetached = z.infer<typeof stateDetached>;
4315
5113
  /**
4316
5114
  * `POST /api/states/{name}/records/.../fold` — the fold report: the `mode`, the
4317
5115
  * `{kind, key}` of the folded `from` and surviving `into` subjects, whether the fold
@@ -4334,8 +5132,8 @@ export declare const stateFoldReport: z.ZodObject<{
4334
5132
  flattened: z.ZodDefault<z.ZodNumber>;
4335
5133
  }, z.core.$strip>;
4336
5134
  export type StateFoldReport = z.infer<typeof stateFoldReport>;
4337
- /** `DELETE /api/state-modules/{name}` — the removed module document. */
4338
- export declare const stateModuleDeleted: z.ZodObject<{
5135
+ /** `DELETE /api/state-templates/{name}` — the removed template document. */
5136
+ export declare const stateTemplateDeleted: z.ZodObject<{
4339
5137
  name: z.ZodString;
4340
5138
  deleted: z.ZodLiteral<true>;
4341
5139
  }, z.core.$strip>;