@heynixie/contract 0.82.0 → 0.83.1

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/index.js CHANGED
@@ -182,62 +182,85 @@ var forgettableKinds = [
182
182
  ];
183
183
  // src/contract/contract.ts
184
184
  import { eventIterator as eventIterator2, oc as oc2 } from "@orpc/contract";
185
- import { z as z39 } from "zod";
185
+ import { z as z40 } from "zod";
186
186
 
187
- // src/span/span-schema.ts
187
+ // src/file/code-file-schema.ts
188
+ import { z as z2 } from "zod";
189
+
190
+ // src/contract/thread-schema.ts
188
191
  import { z } from "zod";
189
- var spanSchema = z.object({
190
- end: z.int().nonnegative(),
191
- source: z.enum(["typed", "pasted", "dropped", "unknown"]),
192
- start: z.int().nonnegative()
192
+ var threadSchema = z.string().min(1).max(200);
193
+
194
+ // src/file/code-file-schema.ts
195
+ var codeFileSchema = z2.object({
196
+ file: z2.string().min(1).max(100),
197
+ name: z2.string(),
198
+ bytes: z2.int().nonnegative(),
199
+ mediaType: z2.string(),
200
+ recordedAt: z2.date(),
201
+ thread: threadSchema,
202
+ sequence: z2.int().positive(),
203
+ position: z2.int().nonnegative(),
204
+ isSent: z2.boolean(),
205
+ runFileCount: z2.int().positive(),
206
+ taskID: threadSchema.nullable(),
207
+ taskName: z2.string().nullable()
208
+ });
209
+
210
+ // src/span/span-schema.ts
211
+ import { z as z3 } from "zod";
212
+ var spanSchema = z3.object({
213
+ end: z3.int().nonnegative(),
214
+ source: z3.enum(["typed", "pasted", "dropped", "unknown"]),
215
+ start: z3.int().nonnegative()
193
216
  });
194
217
 
195
218
  // src/contract/approval-contract.ts
196
- import { z as z11 } from "zod";
219
+ import { z as z13 } from "zod";
197
220
 
198
221
  // src/contract/authentication-response-schema.ts
199
- import { z as z3 } from "zod";
222
+ import { z as z5 } from "zod";
200
223
 
201
224
  // src/contract/base64-url-schema.ts
202
- import { z as z2 } from "zod";
203
- var base64URLSchema = z2.string().min(1).max(20000);
225
+ import { z as z4 } from "zod";
226
+ var base64URLSchema = z4.string().min(1).max(20000);
204
227
 
205
228
  // src/contract/authentication-response-schema.ts
206
- var assertionSchema = z3.object({
229
+ var assertionSchema = z5.object({
207
230
  clientDataJSON: base64URLSchema,
208
231
  authenticatorData: base64URLSchema,
209
232
  signature: base64URLSchema,
210
233
  userHandle: base64URLSchema.optional()
211
234
  });
212
- var authenticationResponseSchema = z3.object({
235
+ var authenticationResponseSchema = z5.object({
213
236
  id: base64URLSchema,
214
237
  rawId: base64URLSchema,
215
238
  response: assertionSchema,
216
- authenticatorAttachment: z3.enum(["cross-platform", "platform"]).optional(),
217
- clientExtensionResults: z3.object({}),
218
- type: z3.literal("public-key")
239
+ authenticatorAttachment: z5.enum(["cross-platform", "platform"]).optional(),
240
+ clientExtensionResults: z5.object({}),
241
+ type: z5.literal("public-key")
219
242
  });
220
243
 
221
244
  // src/contract/choice-schema.ts
222
- import { z as z4 } from "zod";
223
- var choiceSchema = z4.enum(["approve", "always_allow", "defer", "decline"]);
245
+ import { z as z6 } from "zod";
246
+ var choiceSchema = z6.enum(["approve", "always_allow", "defer", "decline"]);
224
247
 
225
248
  // src/contract/memory-view-contract.ts
226
- import { z as z8 } from "zod";
249
+ import { z as z10 } from "zod";
227
250
 
228
251
  // src/contract/forget-backup-schema.ts
229
- import { z as z5 } from "zod";
230
- var forgetBackupSchema = z5.discriminatedUnion("state", [
231
- z5.object({ state: z5.literal("off") }),
232
- z5.object({ state: z5.literal("pending") }),
233
- z5.object({ state: z5.literal("failed"), failure: z5.string() }),
234
- z5.object({ state: z5.literal("complete") }),
235
- z5.object({ state: z5.literal("unknown") })
252
+ import { z as z7 } from "zod";
253
+ var forgetBackupSchema = z7.discriminatedUnion("state", [
254
+ z7.object({ state: z7.literal("off") }),
255
+ z7.object({ state: z7.literal("pending") }),
256
+ z7.object({ state: z7.literal("failed"), failure: z7.string() }),
257
+ z7.object({ state: z7.literal("complete") }),
258
+ z7.object({ state: z7.literal("unknown") })
236
259
  ]);
237
260
 
238
261
  // src/contract/memory-export-contract.ts
239
262
  import { eventIterator } from "@orpc/contract";
240
- import { z as z6 } from "zod";
263
+ import { z as z8 } from "zod";
241
264
 
242
265
  // src/contract/reused-id-errors.ts
243
266
  var reusedIDErrors = {
@@ -257,42 +280,42 @@ var signedIn = oc.errors({
257
280
  var checkedExport = signedIn.errors(reusedIDErrors).errors({
258
281
  MEMORY_NOT_STARTED: { message: "The memory store has not started yet", status: 503 }
259
282
  });
260
- var exportEvent = z6.union([
261
- z6.object({ chunk: z6.string() }),
262
- z6.object({ isComplete: z6.literal(true) })
283
+ var exportEvent = z8.union([
284
+ z8.object({ chunk: z8.string() }),
285
+ z8.object({ isComplete: z8.literal(true) })
263
286
  ]);
264
287
  var exportEvents = eventIterator(exportEvent);
265
288
  var memoryExportContract = {
266
- export: checkedExport.input(z6.object({ clientActionID: z6.uuid() })).output(exportEvents)
289
+ export: checkedExport.input(z8.object({ clientActionID: z8.uuid() })).output(exportEvents)
267
290
  };
268
291
 
269
292
  // src/contract/moment-contract.ts
270
- import { z as z7 } from "zod";
293
+ import { z as z9 } from "zod";
271
294
  var momentView = signedIn.errors({
272
295
  MEMORY_NOT_STARTED: { message: "The memory store has not started yet", status: 503 },
273
296
  MOMENT_NOT_FOUND: { message: "No moment has this ID", status: 404 },
274
297
  STALE_VERSION: { message: "The moment has moved past that version", status: 409 }
275
298
  });
276
- var momentIDSchema = z7.string().min(1).max(200);
277
- var momentTargetSchema = z7.object({ momentID: momentIDSchema, version: z7.int().positive() });
278
- var reflectionSchema = z7.object({
279
- model: z7.string(),
280
- text: z7.string().nullable(),
281
- writtenAt: z7.date()
282
- });
283
- var destroyPreviewSchema = z7.object({
284
- keptAt: z7.date(),
285
- keptBy: z7.enum(["owner", "model"]),
286
- kept: z7.object({ records: z7.int().nonnegative() }),
287
- lost: z7.object({ links: z7.int().nonnegative(), texts: z7.int().nonnegative() }),
288
- momentID: z7.string(),
289
- note: z7.string().nullable(),
290
- reflections: z7.array(reflectionSchema),
291
- shortID: z7.string(),
292
- state: z7.enum(["active", "retired"]),
293
- thread: z7.string(),
294
- title: z7.string().nullable(),
295
- version: z7.int().positive()
299
+ var momentIDSchema = z9.string().min(1).max(200);
300
+ var momentTargetSchema = z9.object({ momentID: momentIDSchema, version: z9.int().positive() });
301
+ var reflectionSchema = z9.object({
302
+ model: z9.string(),
303
+ text: z9.string().nullable(),
304
+ writtenAt: z9.date()
305
+ });
306
+ var destroyPreviewSchema = z9.object({
307
+ keptAt: z9.date(),
308
+ keptBy: z9.enum(["owner", "model"]),
309
+ kept: z9.object({ records: z9.int().nonnegative() }),
310
+ lost: z9.object({ links: z9.int().nonnegative(), texts: z9.int().nonnegative() }),
311
+ momentID: z9.string(),
312
+ note: z9.string().nullable(),
313
+ reflections: z9.array(reflectionSchema),
314
+ shortID: z9.string(),
315
+ state: z9.enum(["active", "retired"]),
316
+ thread: z9.string(),
317
+ title: z9.string().nullable(),
318
+ version: z9.int().positive()
296
319
  });
297
320
  var momentKeep = signedIn.errors(reusedIDErrors).errors({
298
321
  MEMORY_NOT_STARTED: { message: "The memory store has not started yet", status: 503 },
@@ -301,90 +324,90 @@ var momentKeep = signedIn.errors(reusedIDErrors).errors({
301
324
  status: 422
302
325
  }
303
326
  });
304
- var titleSchema = z7.string().min(1).max(120).regex(/\S/u);
305
- var keepSchema = z7.object({
306
- clientActionID: z7.uuid(),
307
- firstSequence: z7.int().nonnegative(),
308
- lastSequence: z7.int().nonnegative(),
309
- thread: z7.string().min(1).max(200),
327
+ var titleSchema = z9.string().min(1).max(120).regex(/\S/u);
328
+ var keepSchema = z9.object({
329
+ clientActionID: z9.uuid(),
330
+ firstSequence: z9.int().nonnegative(),
331
+ lastSequence: z9.int().nonnegative(),
332
+ thread: z9.string().min(1).max(200),
310
333
  title: titleSchema
311
334
  });
312
- var momentSummarySchema = z7.object({
313
- editedAt: z7.date().nullable(),
314
- keptAt: z7.date(),
315
- keptBy: z7.enum(["owner", "model"]),
316
- momentID: z7.string(),
317
- shortID: z7.string(),
318
- state: z7.enum(["active", "retired"]),
319
- title: z7.string().nullable()
320
- });
321
- var momentListSchema = z7.object({
322
- before: z7.int().nonnegative().optional(),
323
- includeRetired: z7.boolean(),
324
- query: z7.string().max(500).optional()
325
- });
326
- var linkSchema = z7.object({
327
- itemID: z7.string(),
328
- shortID: z7.string(),
329
- text: z7.string().nullable()
330
- });
331
- var noteSchema = z7.object({ text: z7.string(), writtenAt: z7.date() });
332
- var shownReflectionSchema = reflectionSchema.extend({ reflectionID: z7.string() });
335
+ var momentSummarySchema = z9.object({
336
+ editedAt: z9.date().nullable(),
337
+ keptAt: z9.date(),
338
+ keptBy: z9.enum(["owner", "model"]),
339
+ momentID: z9.string(),
340
+ shortID: z9.string(),
341
+ state: z9.enum(["active", "retired"]),
342
+ title: z9.string().nullable()
343
+ });
344
+ var momentListSchema = z9.object({
345
+ before: z9.int().nonnegative().optional(),
346
+ includeRetired: z9.boolean(),
347
+ query: z9.string().max(500).optional()
348
+ });
349
+ var linkSchema = z9.object({
350
+ itemID: z9.string(),
351
+ shortID: z9.string(),
352
+ text: z9.string().nullable()
353
+ });
354
+ var noteSchema = z9.object({ text: z9.string(), writtenAt: z9.date() });
355
+ var shownReflectionSchema = reflectionSchema.extend({ reflectionID: z9.string() });
333
356
  var momentDetailSchema = momentSummarySchema.extend({
334
- firstSequence: z7.int().nonnegative(),
335
- lastSequence: z7.int().nonnegative(),
336
- links: z7.array(linkSchema),
357
+ firstSequence: z9.int().nonnegative(),
358
+ lastSequence: z9.int().nonnegative(),
359
+ links: z9.array(linkSchema),
337
360
  note: noteSchema.nullable(),
338
- reflections: z7.array(shownReflectionSchema),
339
- thread: z7.string(),
340
- titleBy: z7.enum(["owner", "model"]),
341
- version: z7.int().positive()
342
- });
343
- var spanRecordSchema = z7.object({
344
- isGap: z7.boolean(),
345
- isRemoved: z7.boolean(),
346
- kind: z7.string(),
347
- recordedAt: z7.date(),
348
- sequence: z7.int().nonnegative(),
349
- text: z7.string().nullable(),
350
- tool: z7.string().nullable()
351
- });
352
- var momentChangeSchema = z7.discriminatedUnion("kind", [
353
- z7.object({ kind: z7.literal("title"), title: titleSchema }),
354
- z7.object({
355
- kind: z7.literal("edges"),
356
- firstSequence: z7.int().nonnegative(),
357
- lastSequence: z7.int().nonnegative()
361
+ reflections: z9.array(shownReflectionSchema),
362
+ thread: z9.string(),
363
+ titleBy: z9.enum(["owner", "model"]),
364
+ version: z9.int().positive()
365
+ });
366
+ var spanRecordSchema = z9.object({
367
+ isGap: z9.boolean(),
368
+ isRemoved: z9.boolean(),
369
+ kind: z9.string(),
370
+ recordedAt: z9.date(),
371
+ sequence: z9.int().nonnegative(),
372
+ text: z9.string().nullable(),
373
+ tool: z9.string().nullable()
374
+ });
375
+ var momentChangeSchema = z9.discriminatedUnion("kind", [
376
+ z9.object({ kind: z9.literal("title"), title: titleSchema }),
377
+ z9.object({
378
+ kind: z9.literal("edges"),
379
+ firstSequence: z9.int().nonnegative(),
380
+ lastSequence: z9.int().nonnegative()
358
381
  }),
359
- z7.object({ kind: z7.literal("note"), note: z7.string().min(1).max(4000).regex(/\S/u) }),
360
- z7.object({ kind: z7.literal("reflection_removed"), reflectionID: z7.string().min(1).max(200) })
382
+ z9.object({ kind: z9.literal("note"), note: z9.string().min(1).max(4000).regex(/\S/u) }),
383
+ z9.object({ kind: z9.literal("reflection_removed"), reflectionID: z9.string().min(1).max(200) })
361
384
  ]);
362
385
  var momentChange = momentView.errors(reusedIDErrors);
363
386
  var momentContract = {
364
- keepMoment: momentKeep.input(keepSchema).output(z7.object({ momentID: z7.string(), shortID: z7.string() })),
387
+ keepMoment: momentKeep.input(keepSchema).output(z9.object({ momentID: z9.string(), shortID: z9.string() })),
365
388
  listMoments: signedIn.errors({
366
389
  MEMORY_NOT_STARTED: { message: "The memory store has not started yet", status: 503 }
367
- }).input(momentListSchema).output(z7.object({ moments: z7.array(momentSummarySchema), next: z7.int().nonnegative().nullable() })),
368
- readMoment: momentView.input(z7.object({ momentID: momentIDSchema })).output(momentDetailSchema),
369
- readMomentSpan: momentView.input(z7.object({ momentID: momentIDSchema, after: z7.int().nonnegative().optional() })).output(z7.object({ records: z7.array(spanRecordSchema), next: z7.int().nonnegative().nullable() })),
390
+ }).input(momentListSchema).output(z9.object({ moments: z9.array(momentSummarySchema), next: z9.int().nonnegative().nullable() })),
391
+ readMoment: momentView.input(z9.object({ momentID: momentIDSchema })).output(momentDetailSchema),
392
+ readMomentSpan: momentView.input(z9.object({ momentID: momentIDSchema, after: z9.int().nonnegative().optional() })).output(z9.object({ records: z9.array(spanRecordSchema), next: z9.int().nonnegative().nullable() })),
370
393
  editMoment: momentChange.errors({
371
394
  BAD_SPAN: {
372
395
  message: "The span needs a first and a last record on the thread, in order",
373
396
  status: 422
374
397
  },
375
398
  REFLECTION_NOT_FOUND: { message: "The moment has no reflection with this ID", status: 404 }
376
- }).input(momentTargetSchema.extend({ clientActionID: z7.uuid(), change: momentChangeSchema })).output(z7.object({ momentID: z7.string(), version: z7.int().positive() })),
399
+ }).input(momentTargetSchema.extend({ clientActionID: z9.uuid(), change: momentChangeSchema })).output(z9.object({ momentID: z9.string(), version: z9.int().positive() })),
377
400
  linkMoment: momentChange.errors({
378
401
  MEMORY_ITEM_NOT_FOUND: { message: "No memory item has this ID", status: 404 },
379
402
  ALREADY_LINKED: { message: "The item is already linked to the moment", status: 409 },
380
403
  NOT_LINKED: { message: "The item is not linked to the moment", status: 409 }
381
404
  }).input(momentTargetSchema.extend({
382
- clientActionID: z7.uuid(),
383
- isLinked: z7.boolean(),
384
- itemID: z7.string().min(1).max(200)
385
- })).output(z7.object({ momentID: z7.string(), version: z7.int().positive() })),
405
+ clientActionID: z9.uuid(),
406
+ isLinked: z9.boolean(),
407
+ itemID: z9.string().min(1).max(200)
408
+ })).output(z9.object({ momentID: z9.string(), version: z9.int().positive() })),
386
409
  previewMomentDestroy: momentView.input(momentTargetSchema).output(destroyPreviewSchema),
387
- destroyMoment: momentView.errors(reusedIDErrors).input(momentTargetSchema.extend({ clientActionID: z7.uuid() })).output(z7.object({ momentID: z7.string() }))
410
+ destroyMoment: momentView.errors(reusedIDErrors).input(momentTargetSchema.extend({ clientActionID: z9.uuid() })).output(z9.object({ momentID: z9.string() }))
388
411
  };
389
412
 
390
413
  // src/contract/memory-view-contract.ts
@@ -396,69 +419,69 @@ var memoryChange = memoryView.errors(reusedIDErrors).errors({
396
419
  STALE_VERSION: { message: "The memory item has moved past that version", status: 409 },
397
420
  WRONG_STATE: { message: "The memory item is not in a state that change takes", status: 409 }
398
421
  });
399
- var itemIDSchema = z8.string().min(1).max(200);
400
- var proposalOriginSchema = z8.enum(["owner", "conversation", "task"]);
401
- var originSchema = z8.enum([...proposalOriginSchema.options, "lapse"]);
402
- var sourceSchema = z8.enum(["owner", "owner_data", "untrusted"]);
403
- var subjectSchema = z8.enum(["owner", "self", "shared"]);
404
- var kindSchema = z8.enum(["fact", "self"]);
405
- var memoryItemSchema = z8.object({
406
- changedAt: z8.date(),
407
- createdAt: z8.date(),
408
- forgottenAt: z8.date().nullable(),
409
- isBridge: z8.boolean(),
410
- isPinned: z8.boolean(),
411
- itemID: z8.string(),
422
+ var itemIDSchema = z10.string().min(1).max(200);
423
+ var proposalOriginSchema = z10.enum(["owner", "conversation", "task"]);
424
+ var originSchema = z10.enum([...proposalOriginSchema.options, "lapse"]);
425
+ var sourceSchema = z10.enum(["owner", "owner_data", "untrusted"]);
426
+ var subjectSchema = z10.enum(["owner", "self", "shared"]);
427
+ var kindSchema = z10.enum(["fact", "self"]);
428
+ var memoryItemSchema = z10.object({
429
+ changedAt: z10.date(),
430
+ createdAt: z10.date(),
431
+ forgottenAt: z10.date().nullable(),
432
+ isBridge: z10.boolean(),
433
+ isPinned: z10.boolean(),
434
+ itemID: z10.string(),
412
435
  kind: kindSchema,
413
436
  origin: originSchema,
414
- shortID: z8.string(),
437
+ shortID: z10.string(),
415
438
  source: sourceSchema,
416
- state: z8.enum(["active", "retired", "forgetting", "forgotten"]),
417
- status: z8.enum(["readable", "shredded", "unreadable"]),
439
+ state: z10.enum(["active", "retired", "forgetting", "forgotten"]),
440
+ status: z10.enum(["readable", "shredded", "unreadable"]),
418
441
  subject: subjectSchema,
419
- text: z8.string().optional(),
420
- until: z8.date().nullable(),
421
- version: z8.int().positive()
442
+ text: z10.string().optional(),
443
+ until: z10.date().nullable(),
444
+ version: z10.int().positive()
422
445
  });
423
446
  var memoryMatchSchema = memoryItemSchema.extend({
424
- score: z8.number().optional(),
425
- similarity: z8.number().optional()
426
- });
427
- var evidenceSchema = z8.object({
428
- end: z8.int().nonnegative(),
429
- message: z8.object({
430
- status: z8.enum(["readable", "shredded", "unreadable", "missing"]),
431
- text: z8.string().optional()
447
+ score: z10.number().optional(),
448
+ similarity: z10.number().optional()
449
+ });
450
+ var evidenceSchema = z10.object({
451
+ end: z10.int().nonnegative(),
452
+ message: z10.object({
453
+ status: z10.enum(["readable", "shredded", "unreadable", "missing"]),
454
+ text: z10.string().optional()
432
455
  }).nullable(),
433
- sequence: z8.int().nonnegative(),
434
- start: z8.int().nonnegative()
435
- });
436
- var ownerImageSchema = z8.object({
437
- position: z8.int().nonnegative(),
438
- sequence: z8.int().positive(),
439
- thread: z8.string()
440
- });
441
- var memoryVersionSchema = z8.object({
442
- change: z8.enum(["created", "edited", "retired", "restored", "undone"]),
443
- checkerModel: z8.string().nullable(),
444
- checks: z8.record(z8.string(), z8.unknown()).nullable(),
456
+ sequence: z10.int().nonnegative(),
457
+ start: z10.int().nonnegative()
458
+ });
459
+ var ownerImageSchema = z10.object({
460
+ position: z10.int().nonnegative(),
461
+ sequence: z10.int().positive(),
462
+ thread: z10.string()
463
+ });
464
+ var memoryVersionSchema = z10.object({
465
+ change: z10.enum(["created", "edited", "retired", "restored", "undone"]),
466
+ checkerModel: z10.string().nullable(),
467
+ checks: z10.record(z10.string(), z10.unknown()).nullable(),
445
468
  evidence: evidenceSchema.nullable(),
446
- evidenceQuote: z8.string().nullable(),
469
+ evidenceQuote: z10.string().nullable(),
447
470
  image: ownerImageSchema.nullable(),
448
- isBridge: z8.boolean(),
449
- isRemoved: z8.boolean(),
471
+ isBridge: z10.boolean(),
472
+ isRemoved: z10.boolean(),
450
473
  origin: originSchema,
451
- proposalID: z8.string().nullable(),
452
- recordedAt: z8.date(),
474
+ proposalID: z10.string().nullable(),
475
+ recordedAt: z10.date(),
453
476
  source: sourceSchema,
454
- state: z8.enum(["active", "retired"]),
455
- status: z8.enum(["readable", "shredded", "unreadable"]),
456
- taskID: z8.string().nullable(),
457
- text: z8.string().optional(),
458
- version: z8.int().positive(),
459
- writerModel: z8.string().nullable()
460
- });
461
- var reviewReasonSchema = z8.enum([
477
+ state: z10.enum(["active", "retired"]),
478
+ status: z10.enum(["readable", "shredded", "unreadable"]),
479
+ taskID: z10.string().nullable(),
480
+ text: z10.string().optional(),
481
+ version: z10.int().positive(),
482
+ writerModel: z10.string().nullable()
483
+ });
484
+ var reviewReasonSchema = z10.enum([
462
485
  "no_quote",
463
486
  "quote_not_typed",
464
487
  "quote_in_quoted_block",
@@ -477,70 +500,70 @@ var reviewReasonSchema = z8.enum([
477
500
  "labels",
478
501
  "ask_rule"
479
502
  ]);
480
- var proposalSourceSchema = z8.object({
503
+ var proposalSourceSchema = z10.object({
481
504
  origin: proposalOriginSchema,
482
- proposedAt: z8.date(),
483
- thread: z8.string().nullable()
484
- });
485
- var proposalLabelsSchema = z8.object({
486
- gist: z8.string(),
487
- isLabelOnly: z8.boolean(),
488
- topic: z8.string(),
489
- triggers: z8.array(z8.string())
490
- });
491
- var memoryProposalSchema = z8.object({
492
- actionHash: z8.string(),
493
- createdAt: z8.date(),
505
+ proposedAt: z10.date(),
506
+ thread: z10.string().nullable()
507
+ });
508
+ var proposalLabelsSchema = z10.object({
509
+ gist: z10.string(),
510
+ isLabelOnly: z10.boolean(),
511
+ topic: z10.string(),
512
+ triggers: z10.array(z10.string())
513
+ });
514
+ var memoryProposalSchema = z10.object({
515
+ actionHash: z10.string(),
516
+ createdAt: z10.date(),
494
517
  evidence: evidenceSchema.nullable(),
495
518
  image: ownerImageSchema.nullable(),
496
- isPinned: z8.boolean(),
497
- itemID: z8.string(),
519
+ isPinned: z10.boolean(),
520
+ itemID: z10.string(),
498
521
  kind: kindSchema,
499
522
  labels: proposalLabelsSchema.nullable(),
500
- lapseAt: z8.date(),
523
+ lapseAt: z10.date(),
501
524
  newSubject: subjectSchema.nullable(),
502
- operation: z8.enum(["remember", "retire", "pin"]),
525
+ operation: z10.enum(["remember", "retire", "pin"]),
503
526
  origin: proposalOriginSchema,
504
- proposalID: z8.string(),
505
- quote: z8.string().nullable(),
527
+ proposalID: z10.string(),
528
+ quote: z10.string().nullable(),
506
529
  reason: reviewReasonSchema,
507
530
  source: sourceSchema,
508
- sources: z8.array(proposalSourceSchema),
531
+ sources: z10.array(proposalSourceSchema),
509
532
  subject: subjectSchema,
510
- targetVersion: z8.int().positive().nullable(),
511
- text: z8.string(),
512
- until: z8.date().nullable()
533
+ targetVersion: z10.int().positive().nullable(),
534
+ text: z10.string(),
535
+ until: z10.date().nullable()
513
536
  });
514
- var revisionTargetSchema = z8.object({ itemID: itemIDSchema, version: z8.int().positive() });
515
- var memoryItemDetailSchema = memoryItemSchema.extend({ versions: z8.array(memoryVersionSchema) });
516
- var forgetLossSchema = z8.object({
517
- evidenceMessages: z8.int().nonnegative(),
518
- proposals: z8.int().nonnegative()
537
+ var revisionTargetSchema = z10.object({ itemID: itemIDSchema, version: z10.int().positive() });
538
+ var memoryItemDetailSchema = memoryItemSchema.extend({ versions: z10.array(memoryVersionSchema) });
539
+ var forgetLossSchema = z10.object({
540
+ evidenceMessages: z10.int().nonnegative(),
541
+ proposals: z10.int().nonnegative()
519
542
  });
520
543
  var forgetPreviewSchema = memoryItemDetailSchema.extend({ lost: forgetLossSchema });
521
- var retiredForgetPreviewSchema = z8.object({
522
- hasMore: z8.boolean(),
523
- items: z8.array(memoryItemSchema.extend({ lost: forgetLossSchema }))
544
+ var retiredForgetPreviewSchema = z10.object({
545
+ hasMore: z10.boolean(),
546
+ items: z10.array(memoryItemSchema.extend({ lost: forgetLossSchema }))
524
547
  });
525
- var retiredForgetSchema = z8.object({
526
- clientActionID: z8.uuid(),
527
- targets: z8.array(revisionTargetSchema).min(1).max(100).refine((targets) => new Set(targets.map((target) => target.itemID)).size === targets.length, {
548
+ var retiredForgetSchema = z10.object({
549
+ clientActionID: z10.uuid(),
550
+ targets: z10.array(revisionTargetSchema).min(1).max(100).refine((targets) => new Set(targets.map((target) => target.itemID)).size === targets.length, {
528
551
  message: "Each item appears once"
529
552
  })
530
553
  });
531
- var forgetStatusSchema = z8.object({
532
- deleted: z8.array(z8.string()),
533
- pending: z8.array(z8.string()),
554
+ var forgetStatusSchema = z10.object({
555
+ deleted: z10.array(z10.string()),
556
+ pending: z10.array(z10.string()),
534
557
  backup: forgetBackupSchema
535
558
  });
536
- var versionTargetSchema = z8.object({
537
- clientActionID: z8.uuid(),
559
+ var versionTargetSchema = z10.object({
560
+ clientActionID: z10.uuid(),
538
561
  itemID: itemIDSchema,
539
- version: z8.int().positive()
562
+ version: z10.int().positive()
540
563
  });
541
- var versionResultSchema = z8.object({ itemID: z8.string(), version: z8.int().positive() });
542
- var noticeEntrySchema = z8.object({
543
- change: z8.enum([
564
+ var versionResultSchema = z10.object({ itemID: z10.string(), version: z10.int().positive() });
565
+ var noticeEntrySchema = z10.object({
566
+ change: z10.enum([
544
567
  "created",
545
568
  "edited",
546
569
  "retired",
@@ -551,43 +574,43 @@ var noticeEntrySchema = z8.object({
551
574
  "pinned",
552
575
  "unpinned"
553
576
  ]),
554
- isKept: z8.boolean(),
555
- item: memoryItemSchema.extend({ change: z8.enum(["created", "edited", "retired", "restored", "undone"]) }).nullable(),
556
- itemID: z8.string(),
557
- proposalID: z8.string().nullable(),
558
- sequence: z8.int().nonnegative(),
559
- version: z8.int().positive().nullable()
560
- });
561
- var memoryNoticeSchema = z8.object({
562
- entries: z8.array(noticeEntrySchema),
563
- kind: z8.enum(["turn", "run"]),
564
- messageSequence: z8.int().nonnegative().nullable(),
565
- noticeKey: z8.string(),
566
- proposed: z8.int().nonnegative(),
567
- remembered: z8.int().nonnegative(),
568
- retired: z8.int().nonnegative(),
569
- sequence: z8.int().nonnegative()
577
+ isKept: z10.boolean(),
578
+ item: memoryItemSchema.extend({ change: z10.enum(["created", "edited", "retired", "restored", "undone"]) }).nullable(),
579
+ itemID: z10.string(),
580
+ proposalID: z10.string().nullable(),
581
+ sequence: z10.int().nonnegative(),
582
+ version: z10.int().positive().nullable()
583
+ });
584
+ var memoryNoticeSchema = z10.object({
585
+ entries: z10.array(noticeEntrySchema),
586
+ kind: z10.enum(["turn", "run"]),
587
+ messageSequence: z10.int().nonnegative().nullable(),
588
+ noticeKey: z10.string(),
589
+ proposed: z10.int().nonnegative(),
590
+ remembered: z10.int().nonnegative(),
591
+ retired: z10.int().nonnegative(),
592
+ sequence: z10.int().nonnegative()
570
593
  });
571
594
  var memoryViewContract = {
572
- listItems: memoryView.errors({ INVALID_CURSOR: { message: "No page returned this cursor", status: 400 } }).input(z8.object({
573
- after: z8.string().max(20).optional(),
595
+ listItems: memoryView.errors({ INVALID_CURSOR: { message: "No page returned this cursor", status: 400 } }).input(z10.object({
596
+ after: z10.string().max(20).optional(),
574
597
  kind: kindSchema.optional(),
575
- limit: z8.int().min(1).max(100).optional(),
576
- state: z8.enum(["active", "retired", "forgotten"])
577
- })).output(z8.object({ items: z8.array(memoryItemSchema), next: z8.string().nullable() })),
578
- findItems: memoryView.input(z8.object({ query: z8.string().min(1).max(500) })).output(z8.object({
579
- items: z8.array(memoryMatchSchema),
580
- searchMode: z8.enum(["hybrid", "keyword", "keyword-fallback"])
598
+ limit: z10.int().min(1).max(100).optional(),
599
+ state: z10.enum(["active", "retired", "forgotten"])
600
+ })).output(z10.object({ items: z10.array(memoryItemSchema), next: z10.string().nullable() })),
601
+ findItems: memoryView.input(z10.object({ query: z10.string().min(1).max(500) })).output(z10.object({
602
+ items: z10.array(memoryMatchSchema),
603
+ searchMode: z10.enum(["hybrid", "keyword", "keyword-fallback"])
581
604
  })),
582
- readPinnedCore: memoryView.output(z8.object({
583
- budget: z8.int().nonnegative(),
584
- items: z8.array(memoryItemSchema),
585
- tokens: z8.int().nonnegative()
605
+ readPinnedCore: memoryView.output(z10.object({
606
+ budget: z10.int().nonnegative(),
607
+ items: z10.array(memoryItemSchema),
608
+ tokens: z10.int().nonnegative()
586
609
  })),
587
- readItem: memoryView.errors({ MEMORY_ITEM_NOT_FOUND: { message: "No memory item has this ID", status: 404 } }).input(z8.object({ itemID: itemIDSchema })).output(memoryItemDetailSchema),
610
+ readItem: memoryView.errors({ MEMORY_ITEM_NOT_FOUND: { message: "No memory item has this ID", status: 404 } }).input(z10.object({ itemID: itemIDSchema })).output(memoryItemDetailSchema),
588
611
  retire: memoryChange.input(versionTargetSchema).output(versionResultSchema),
589
612
  restore: memoryChange.input(versionTargetSchema).output(versionResultSchema),
590
- listNotices: memoryView.input(z8.object({ thread: z8.string().min(1).max(200) })).output(z8.object({ notices: z8.array(memoryNoticeSchema) })),
613
+ listNotices: memoryView.input(z10.object({ thread: z10.string().min(1).max(200) })).output(z10.object({ notices: z10.array(memoryNoticeSchema) })),
591
614
  undo: memoryChange.errors({
592
615
  PINNED_CORE_FULL: { message: "The undo takes the pinned core past its budget", status: 409 },
593
616
  VERSION_REMOVED: {
@@ -599,14 +622,14 @@ var memoryViewContract = {
599
622
  previewForget: memoryView.errors({
600
623
  MEMORY_ITEM_NOT_FOUND: { message: "No memory item has this ID", status: 404 },
601
624
  STALE_VERSION: { message: "The memory item has moved past that version", status: 409 }
602
- }).input(z8.object({ itemID: itemIDSchema, version: z8.int().positive() })).output(forgetPreviewSchema),
603
- forget: memoryChange.input(versionTargetSchema).output(z8.object({ itemID: z8.string(), backup: forgetBackupSchema })),
625
+ }).input(z10.object({ itemID: itemIDSchema, version: z10.int().positive() })).output(forgetPreviewSchema),
626
+ forget: memoryChange.input(versionTargetSchema).output(z10.object({ itemID: z10.string(), backup: forgetBackupSchema })),
604
627
  previewForgetRetired: memoryView.output(retiredForgetPreviewSchema),
605
628
  forgetRetired: memoryChange.input(retiredForgetSchema).output(forgetStatusSchema),
606
- readForgetStatus: memoryView.input(z8.object({ itemIDs: z8.array(itemIDSchema).min(1).max(100) })).output(forgetStatusSchema),
629
+ readForgetStatus: memoryView.input(z10.object({ itemIDs: z10.array(itemIDSchema).min(1).max(100) })).output(forgetStatusSchema),
607
630
  pin: memoryChange.errors({
608
631
  PINNED_CORE_FULL: { message: "The pin takes the pinned core past its budget", status: 409 }
609
- }).input(versionTargetSchema.extend({ isPinned: z8.boolean() })).output(z8.object({ isPinned: z8.boolean(), itemID: z8.string() })),
632
+ }).input(versionTargetSchema.extend({ isPinned: z10.boolean() })).output(z10.object({ isPinned: z10.boolean(), itemID: z10.string() })),
610
633
  ...memoryExportContract,
611
634
  ...momentContract
612
635
  };
@@ -617,11 +640,11 @@ var noPasskeyError = {
617
640
  };
618
641
 
619
642
  // src/contract/passkey-failed-error.ts
620
- import { z as z10 } from "zod";
643
+ import { z as z12 } from "zod";
621
644
 
622
645
  // src/contract/passkey-failure-schema.ts
623
- import { z as z9 } from "zod";
624
- var passkeyFailureSchema = z9.enum([
646
+ import { z as z11 } from "zod";
647
+ var passkeyFailureSchema = z11.enum([
625
648
  "unknown_challenge",
626
649
  "binding",
627
650
  "unknown_passkey",
@@ -636,229 +659,229 @@ var passkeyFailedError = {
636
659
  PASSKEY_FAILED: {
637
660
  message: "The passkey check failed",
638
661
  status: 403,
639
- data: z10.object({ reason: passkeyFailureSchema })
662
+ data: z12.object({ reason: passkeyFailureSchema })
640
663
  }
641
664
  };
642
665
 
643
666
  // src/contract/approval-contract.ts
644
- var stateSchema = z11.enum(["pending", "deferred", "approved", "declined", "lapsed", "withdrawn"]);
645
- var hashesSchema = z11.object({ actionHash: z11.string(), ruleHash: z11.string().nullable() });
646
- var versionSchema = z11.int().positive();
647
- var taskSchema = z11.object({ id: z11.string(), name: z11.string() });
648
- var proposalSchema = z11.object({
649
- proposalID: z11.string(),
650
- shortID: z11.string(),
651
- kind: z11.enum(["action", "memory_write", "internal_change"]),
652
- riskClass: z11.enum(["routine", "always_ask", "lifting"]),
653
- actionHash: z11.string(),
654
- ruleHash: z11.string().nullable(),
655
- cause: z11.string(),
667
+ var stateSchema = z13.enum(["pending", "deferred", "approved", "declined", "lapsed", "withdrawn"]);
668
+ var hashesSchema = z13.object({ actionHash: z13.string(), ruleHash: z13.string().nullable() });
669
+ var versionSchema = z13.int().positive();
670
+ var taskSchema = z13.object({ id: z13.string(), name: z13.string() });
671
+ var proposalSchema = z13.object({
672
+ proposalID: z13.string(),
673
+ shortID: z13.string(),
674
+ kind: z13.enum(["action", "memory_write", "internal_change"]),
675
+ riskClass: z13.enum(["routine", "always_ask", "lifting"]),
676
+ actionHash: z13.string(),
677
+ ruleHash: z13.string().nullable(),
678
+ cause: z13.string(),
656
679
  state: stateSchema,
657
- createdAt: z11.date(),
658
- lapsesAt: z11.date(),
659
- deadlineAt: z11.date().nullable(),
660
- deferGeneration: z11.int().nonnegative(),
661
- deferUntil: z11.date().nullable(),
662
- thread: z11.string().nullable(),
663
- taskID: z11.string().nullable(),
664
- sequence: z11.int().positive()
665
- });
666
- var bodySchema = z11.object({
667
- sentence: z11.string(),
668
- fields: z11.record(z11.string(), z11.string()),
669
- ruleSentence: z11.string().nullable(),
670
- approveLabel: z11.string(),
671
- rule: z11.record(z11.string(), z11.unknown()).optional(),
680
+ createdAt: z13.date(),
681
+ lapsesAt: z13.date(),
682
+ deadlineAt: z13.date().nullable(),
683
+ deferGeneration: z13.int().nonnegative(),
684
+ deferUntil: z13.date().nullable(),
685
+ thread: z13.string().nullable(),
686
+ taskID: z13.string().nullable(),
687
+ sequence: z13.int().positive()
688
+ });
689
+ var bodySchema = z13.object({
690
+ sentence: z13.string(),
691
+ fields: z13.record(z13.string(), z13.string()),
692
+ ruleSentence: z13.string().nullable(),
693
+ approveLabel: z13.string(),
694
+ rule: z13.record(z13.string(), z13.unknown()).optional(),
672
695
  memory: memoryProposalSchema.optional()
673
696
  });
674
- var itemSchema = z11.object({
675
- group: z11.enum(["always_ask", "routine", "memory", "deferred"]),
697
+ var itemSchema = z13.object({
698
+ group: z13.enum(["always_ask", "routine", "memory", "deferred"]),
676
699
  proposal: proposalSchema,
677
700
  body: bodySchema,
678
701
  task: taskSchema.nullable(),
679
- choices: z11.array(choiceSchema),
680
- passkeyChoices: z11.array(choiceSchema)
702
+ choices: z13.array(choiceSchema),
703
+ passkeyChoices: z13.array(choiceSchema)
681
704
  });
682
- var unknownReasonSchema = z11.enum([
705
+ var unknownReasonSchema = z13.enum([
683
706
  "inconclusive",
684
707
  "unknown_streak",
685
708
  "no_reconcile",
686
709
  "key_expired",
687
710
  "not_found_ask"
688
711
  ]);
689
- var checkAnswerSchema = z11.enum(["found", "not_found", "inconclusive"]);
690
- var attemptSchema = z11.object({ attempt: z11.int().nonnegative(), at: z11.date() });
691
- var checkSchema = z11.object({ answer: checkAnswerSchema, at: z11.date() });
692
- var unknownOutcomeSchema = z11.object({
693
- actionID: z11.string(),
694
- tool: z11.string(),
695
- sentence: z11.string(),
696
- fields: z11.record(z11.string(), z11.string()),
697
- riskClass: z11.enum(["routine", "always_ask", "lifting"]),
712
+ var checkAnswerSchema = z13.enum(["found", "not_found", "inconclusive"]);
713
+ var attemptSchema = z13.object({ attempt: z13.int().nonnegative(), at: z13.date() });
714
+ var checkSchema = z13.object({ answer: checkAnswerSchema, at: z13.date() });
715
+ var unknownOutcomeSchema = z13.object({
716
+ actionID: z13.string(),
717
+ tool: z13.string(),
718
+ sentence: z13.string(),
719
+ fields: z13.record(z13.string(), z13.string()),
720
+ riskClass: z13.enum(["routine", "always_ask", "lifting"]),
698
721
  reason: unknownReasonSchema,
699
- becameUnknownAt: z11.date(),
700
- attempts: z11.array(attemptSchema),
701
- checks: z11.array(checkSchema)
722
+ becameUnknownAt: z13.date(),
723
+ attempts: z13.array(attemptSchema),
724
+ checks: z13.array(checkSchema)
702
725
  });
703
- var unknownChoiceSchema = z11.enum(["happened", "retry", "drop"]);
704
- var unknownItemSchema = z11.object({
705
- group: z11.literal("unknown_outcome"),
726
+ var unknownChoiceSchema = z13.enum(["happened", "retry", "drop"]);
727
+ var unknownItemSchema = z13.object({
728
+ group: z13.literal("unknown_outcome"),
706
729
  action: unknownOutcomeSchema,
707
730
  task: taskSchema.nullable(),
708
- choices: z11.array(unknownChoiceSchema),
709
- passkeyChoices: z11.array(unknownChoiceSchema)
731
+ choices: z13.array(unknownChoiceSchema),
732
+ passkeyChoices: z13.array(unknownChoiceSchema)
710
733
  });
711
- var callSchema = z11.object({
712
- state: z11.enum(["waiting", "applied", "failed", "unknown"]),
713
- reason: z11.string().nullable()
734
+ var callSchema = z13.object({
735
+ state: z13.enum(["waiting", "applied", "failed", "unknown"]),
736
+ reason: z13.string().nullable()
714
737
  });
715
- var readItemSchema = z11.object({
738
+ var readItemSchema = z13.object({
716
739
  proposal: proposalSchema,
717
740
  body: bodySchema.nullable(),
718
741
  task: taskSchema.nullable(),
719
- choices: z11.array(choiceSchema),
720
- passkeyChoices: z11.array(choiceSchema),
721
- answeredOn: z11.string().nullable(),
722
- isAnsweredHere: z11.boolean(),
742
+ choices: z13.array(choiceSchema),
743
+ passkeyChoices: z13.array(choiceSchema),
744
+ answeredOn: z13.string().nullable(),
745
+ isAnsweredHere: z13.boolean(),
723
746
  call: callSchema.nullable()
724
747
  });
725
- var deferSettingsSchema = z11.object({
726
- defaultMinutes: z11.int().positive(),
727
- eveningAt: z11.string(),
728
- morningAt: z11.string(),
729
- zone: z11.string()
748
+ var deferSettingsSchema = z13.object({
749
+ defaultMinutes: z13.int().positive(),
750
+ eveningAt: z13.string(),
751
+ morningAt: z13.string(),
752
+ zone: z13.string()
730
753
  });
731
- var memoryAnswerSchema = z11.object({
732
- editedText: z11.string().optional(),
733
- revisionOf: z11.object({ itemID: z11.string(), version: versionSchema }).optional(),
734
- ignoreCloseMatch: z11.boolean().optional()
754
+ var memoryAnswerSchema = z13.object({
755
+ editedText: z13.string().optional(),
756
+ revisionOf: z13.object({ itemID: z13.string(), version: versionSchema }).optional(),
757
+ ignoreCloseMatch: z13.boolean().optional()
735
758
  });
736
- var answerSchema = z11.object({
737
- proposalID: z11.string().min(1).max(200),
738
- actionHash: z11.string().min(1),
759
+ var answerSchema = z13.object({
760
+ proposalID: z13.string().min(1).max(200),
761
+ actionHash: z13.string().min(1),
739
762
  choice: choiceSchema,
740
- ruleHash: z11.string().optional(),
741
- deferUntil: z11.date().optional(),
742
- note: z11.string().min(1).max(500).optional(),
743
- clientActionID: z11.uuid(),
763
+ ruleHash: z13.string().optional(),
764
+ deferUntil: z13.date().optional(),
765
+ note: z13.string().min(1).max(500).optional(),
766
+ clientActionID: z13.uuid(),
744
767
  memory: memoryAnswerSchema.optional()
745
768
  });
746
769
  var passkeyAnswerSchema = answerSchema.extend({
747
770
  passkey: authenticationResponseSchema.optional()
748
771
  });
749
- var ruleRefSchema = z11.object({ id: z11.string(), revision: versionSchema });
750
- var closeMatchSchema = z11.object({ itemID: z11.string(), text: z11.string(), version: versionSchema });
751
- var approvedSchema = z11.object({
752
- proposalID: z11.string(),
753
- state: z11.literal("approved"),
772
+ var ruleRefSchema = z13.object({ id: z13.string(), revision: versionSchema });
773
+ var closeMatchSchema = z13.object({ itemID: z13.string(), text: z13.string(), version: versionSchema });
774
+ var approvedSchema = z13.object({
775
+ proposalID: z13.string(),
776
+ state: z13.literal("approved"),
754
777
  rule: ruleRefSchema.optional()
755
778
  });
756
- var closedSchema = z11.object({ proposalID: z11.string(), state: z11.enum(["declined", "deferred"]) });
757
- var closeMatchResultSchema = z11.object({
758
- proposalID: z11.string(),
759
- state: z11.literal("pending"),
779
+ var closedSchema = z13.object({ proposalID: z13.string(), state: z13.enum(["declined", "deferred"]) });
780
+ var closeMatchResultSchema = z13.object({
781
+ proposalID: z13.string(),
782
+ state: z13.literal("pending"),
760
783
  closeMatch: closeMatchSchema
761
784
  });
762
- var resultSchema = z11.discriminatedUnion("state", [
785
+ var resultSchema = z13.discriminatedUnion("state", [
763
786
  approvedSchema,
764
787
  closedSchema,
765
788
  closeMatchResultSchema
766
789
  ]);
767
- var refusedSchema = z11.object({
768
- proposalID: z11.string(),
769
- error: z11.enum(["CONFLICT", "CLOSED", "NOT_ALLOWED", "PASSKEY_REQUIRED"]),
790
+ var refusedSchema = z13.object({
791
+ proposalID: z13.string(),
792
+ error: z13.enum(["CONFLICT", "CLOSED", "NOT_ALLOWED", "PASSKEY_REQUIRED"]),
770
793
  current: hashesSchema.optional(),
771
794
  state: stateSchema.optional(),
772
- reason: z11.string().optional()
795
+ reason: z13.string().optional()
773
796
  });
774
797
  var answerErrors = signedIn.errors(reusedIDErrors).errors({
775
798
  CONFLICT: {
776
799
  message: "The proposal changed since the card showed it",
777
800
  status: 409,
778
- data: z11.object({ current: hashesSchema })
801
+ data: z13.object({ current: hashesSchema })
779
802
  },
780
803
  CLOSED: {
781
804
  message: "The proposal is answered, withdrawn or lapsed",
782
805
  status: 409,
783
- data: z11.object({ state: stateSchema })
806
+ data: z13.object({ state: stateSchema })
784
807
  },
785
808
  NOT_ALLOWED: {
786
809
  message: "The proposal does not take this answer",
787
810
  status: 403,
788
- data: z11.object({ reason: z11.string() })
811
+ data: z13.object({ reason: z13.string() })
789
812
  },
790
813
  PASSKEY_REQUIRED: { message: "This answer needs a passkey check", status: 403 },
791
814
  ...noPasskeyError,
792
815
  ...passkeyFailedError
793
816
  });
794
- var listedSchema = z11.object({
817
+ var listedSchema = z13.object({
795
818
  defer: deferSettingsSchema,
796
- items: z11.array(itemSchema),
797
- unknownOutcomes: z11.array(unknownItemSchema)
819
+ items: z13.array(itemSchema),
820
+ unknownOutcomes: z13.array(unknownItemSchema)
798
821
  });
799
- var unknownAnswerSchema = z11.object({
800
- actionID: z11.string().min(1).max(200),
822
+ var unknownAnswerSchema = z13.object({
823
+ actionID: z13.string().min(1).max(200),
801
824
  choice: unknownChoiceSchema,
802
- clientActionID: z11.uuid(),
825
+ clientActionID: z13.uuid(),
803
826
  passkey: authenticationResponseSchema.optional()
804
827
  });
805
828
  var unknownAnswerErrors = signedIn.errors(reusedIDErrors).errors({
806
829
  NOT_ALLOWED: {
807
830
  message: "The action waits for no answer about its outcome",
808
831
  status: 403,
809
- data: z11.object({ reason: z11.string() })
832
+ data: z13.object({ reason: z13.string() })
810
833
  },
811
834
  PASSKEY_REQUIRED: { message: "This answer needs a passkey check", status: 403 },
812
835
  ...noPasskeyError,
813
836
  ...passkeyFailedError
814
837
  });
815
- var readInputSchema = z11.object({
816
- proposalIDs: z11.array(z11.string().min(1).max(200)).min(1).max(100)
838
+ var readInputSchema = z13.object({
839
+ proposalIDs: z13.array(z13.string().min(1).max(200)).min(1).max(100)
817
840
  });
818
- var batchInputSchema = z11.object({ answers: z11.array(answerSchema).min(1).max(100) });
819
- var batchResultSchema = z11.object({ results: z11.array(z11.union([resultSchema, refusedSchema])) });
841
+ var batchInputSchema = z13.object({ answers: z13.array(answerSchema).min(1).max(100) });
842
+ var batchResultSchema = z13.object({ results: z13.array(z13.union([resultSchema, refusedSchema])) });
820
843
  var approvalContract = {
821
844
  listItems: signedIn.output(listedSchema),
822
- readProposals: signedIn.input(readInputSchema).output(z11.object({ proposals: z11.array(readItemSchema) })),
845
+ readProposals: signedIn.input(readInputSchema).output(z13.object({ proposals: z13.array(readItemSchema) })),
823
846
  answerProposal: answerErrors.input(passkeyAnswerSchema).output(resultSchema),
824
- answerUnknownOutcome: unknownAnswerErrors.input(unknownAnswerSchema).output(z11.object({ actionID: z11.string(), choice: unknownChoiceSchema })),
847
+ answerUnknownOutcome: unknownAnswerErrors.input(unknownAnswerSchema).output(z13.object({ actionID: z13.string(), choice: unknownChoiceSchema })),
825
848
  answerProposals: signedIn.errors(reusedIDErrors).input(batchInputSchema).output(batchResultSchema)
826
849
  };
827
850
 
828
851
  // src/contract/clipped-payload-schema.ts
829
- import { z as z12 } from "zod";
830
- var fieldSchema = z12.enum(["toolCall.input", "toolCall.content", "worker.text", "worker.detail"]);
831
- var pathStepSchema = z12.union([z12.string(), z12.number()]);
832
- var clippedPayloadSchema = z12.object({
852
+ import { z as z14 } from "zod";
853
+ var fieldSchema = z14.enum(["toolCall.input", "toolCall.content", "worker.text", "worker.detail"]);
854
+ var pathStepSchema = z14.union([z14.string(), z14.number()]);
855
+ var clippedPayloadSchema = z14.object({
833
856
  field: fieldSchema,
834
- path: z12.array(pathStepSchema),
835
- bytes: z12.number()
857
+ path: z14.array(pathStepSchema),
858
+ bytes: z14.number()
836
859
  });
837
860
 
838
861
  // src/contract/definition-notice-schema.ts
839
- import { z as z13 } from "zod";
840
- var definitionNoticeSchema = z13.object({
841
- definitionID: z13.string(),
842
- name: z13.string().nullable(),
843
- operation: z13.enum(["add", "change", "remove", "undo"]),
844
- shortID: z13.string(),
845
- changeID: z13.string(),
846
- hasVersion: z13.boolean(),
847
- rendered: z13.string().nullable(),
848
- next: z13.string().nullable(),
849
- state: z13.enum(["in_force", "superseded", "adopted", "retired"]),
850
- isUnreadable: z13.boolean()
862
+ import { z as z15 } from "zod";
863
+ var definitionNoticeSchema = z15.object({
864
+ definitionID: z15.string(),
865
+ name: z15.string().nullable(),
866
+ operation: z15.enum(["add", "change", "remove", "undo"]),
867
+ shortID: z15.string(),
868
+ changeID: z15.string(),
869
+ hasVersion: z15.boolean(),
870
+ rendered: z15.string().nullable(),
871
+ next: z15.string().nullable(),
872
+ state: z15.enum(["in_force", "superseded", "adopted", "retired"]),
873
+ isUnreadable: z15.boolean()
851
874
  });
852
875
 
853
876
  // src/contract/definitions-contract.ts
854
- import { z as z14 } from "zod";
855
- var operationSchema = z14.enum(["add", "change", "remove", "undo"]);
856
- var headSchema = z14.object({
857
- changeID: z14.string(),
858
- shortID: z14.string(),
877
+ import { z as z16 } from "zod";
878
+ var operationSchema = z16.enum(["add", "change", "remove", "undo"]);
879
+ var headSchema = z16.object({
880
+ changeID: z16.string(),
881
+ shortID: z16.string(),
859
882
  operation: operationSchema
860
883
  });
861
- var replacedSchema = z14.object({ head: headSchema });
884
+ var replacedSchema = z16.object({ head: headSchema });
862
885
  var undo = signedIn.errors(reusedIDErrors).errors({
863
886
  NOT_STARTED: { message: "Task definitions are not ready yet", status: 503 },
864
887
  NOT_FOUND: { message: "No change has this ID", status: 404 },
@@ -870,12 +893,12 @@ var undo = signedIn.errors(reusedIDErrors).errors({
870
893
  REPO_MOVED: {
871
894
  message: "The definitions repo changed this definition since",
872
895
  status: 409,
873
- data: z14.object({ seedSequence: z14.int().nonnegative() })
896
+ data: z16.object({ seedSequence: z16.int().nonnegative() })
874
897
  },
875
898
  NOT_IN_FORCE: {
876
899
  message: "The change is no longer in force",
877
900
  status: 409,
878
- data: z14.object({ cause: z14.enum(["one_shot_fired", "one_shot_skipped", "kept_repo"]) })
901
+ data: z16.object({ cause: z16.enum(["one_shot_fired", "one_shot_skipped", "kept_repo"]) })
879
902
  },
880
903
  ONE_SHOT_OVER_REPO: {
881
904
  message: "A one-time trigger cannot go back over a definition in the repo",
@@ -884,10 +907,10 @@ var undo = signedIn.errors(reusedIDErrors).errors({
884
907
  ONE_SHOT_PAST: { message: "The time of that one-time trigger has passed", status: 409 }
885
908
  });
886
909
  var definitionsContract = {
887
- undo: undo.input(z14.object({ clientActionID: z14.uuid(), changeID: z14.string().min(1).max(64) })).output(z14.object({
888
- definitionID: z14.string(),
889
- changeID: z14.string(),
890
- restored: z14.literal("repo").optional()
910
+ undo: undo.input(z16.object({ clientActionID: z16.uuid(), changeID: z16.string().min(1).max(64) })).output(z16.object({
911
+ definitionID: z16.string(),
912
+ changeID: z16.string(),
913
+ restored: z16.literal("repo").optional()
891
914
  }))
892
915
  };
893
916
 
@@ -906,10 +929,10 @@ var imageNotFoundError = {
906
929
  };
907
930
 
908
931
  // src/contract/image-refused-error.ts
909
- import { z as z15 } from "zod";
910
- var imageRefusedDataSchema = z15.object({
911
- position: z15.int().nonnegative().nullable(),
912
- reason: z15.enum(["too_many", "too_large", "unsupported_type"])
932
+ import { z as z17 } from "zod";
933
+ var imageRefusedDataSchema = z17.object({
934
+ position: z17.int().nonnegative().nullable(),
935
+ reason: z17.enum(["too_many", "too_large", "unsupported_type"])
913
936
  });
914
937
  var imageRefusedError = {
915
938
  message: "An image is too large, of a type nixie does not take, or one too many",
@@ -918,14 +941,8 @@ var imageRefusedError = {
918
941
  };
919
942
 
920
943
  // src/contract/listed-task-schema.ts
921
- import { z as z17 } from "zod";
922
-
923
- // src/contract/thread-schema.ts
924
- import { z as z16 } from "zod";
925
- var threadSchema = z16.string().min(1).max(200);
926
-
927
- // src/contract/listed-task-schema.ts
928
- var taskStateSchema = z17.enum([
944
+ import { z as z18 } from "zod";
945
+ var taskStateSchema = z18.enum([
929
946
  "ready",
930
947
  "running",
931
948
  "waiting",
@@ -935,142 +952,142 @@ var taskStateSchema = z17.enum([
935
952
  "failed",
936
953
  "closed"
937
954
  ]);
938
- var listedStateSchema = z17.enum([...taskStateSchema.options, "idle", "finished", "asleep"]);
939
- var runFireSchema = z17.object({
940
- scheduledFor: z17.string(),
941
- firedAt: z17.string(),
942
- isCatchUp: z17.boolean()
943
- });
944
- var taskControlSchema = z17.enum(["pause", "resume", "stop", "restart", "close", "interrupt"]);
945
- var actionCountSchema = z17.int().nonnegative();
946
- var listedTaskSchema = z17.object({
947
- actions: z17.object({
955
+ var listedStateSchema = z18.enum([...taskStateSchema.options, "idle", "finished", "asleep"]);
956
+ var runFireSchema = z18.object({
957
+ scheduledFor: z18.string(),
958
+ firedAt: z18.string(),
959
+ isCatchUp: z18.boolean()
960
+ });
961
+ var taskControlSchema = z18.enum(["pause", "resume", "stop", "restart", "close", "interrupt"]);
962
+ var actionCountSchema = z18.int().nonnegative();
963
+ var listedTaskSchema = z18.object({
964
+ actions: z18.object({
948
965
  cancelled: actionCountSchema,
949
966
  queued: actionCountSchema,
950
967
  started: actionCountSchema
951
968
  }),
952
- brief: z17.string(),
953
- closedBy: z17.enum(["owner", "nixie", "disposable"]).optional(),
954
- controls: z17.array(taskControlSchema),
955
- definitionID: z17.string().optional(),
956
- disposable: z17.boolean().nullable(),
969
+ brief: z18.string(),
970
+ closedBy: z18.enum(["owner", "nixie", "disposable"]).optional(),
971
+ controls: z18.array(taskControlSchema),
972
+ definitionID: z18.string().optional(),
973
+ disposable: z18.boolean().nullable(),
957
974
  fire: runFireSchema.nullable().optional(),
958
- isPauseRequested: z17.boolean(),
959
- isPausedByNixie: z17.boolean(),
960
- isTakingMessages: z17.boolean(),
961
- lastActivityAt: z17.date(),
975
+ isPauseRequested: z18.boolean(),
976
+ isPausedByNixie: z18.boolean(),
977
+ isTakingMessages: z18.boolean(),
978
+ lastActivityAt: z18.date(),
962
979
  listedState: listedStateSchema.optional(),
963
- name: z17.string(),
964
- nextRunAt: z17.string().optional(),
965
- runner: z17.string(),
980
+ name: z18.string(),
981
+ nextRunAt: z18.string().optional(),
982
+ runner: z18.string(),
966
983
  state: taskStateSchema,
967
984
  taskID: threadSchema,
968
- wakeable: z17.boolean().optional(),
985
+ wakeable: z18.boolean().optional(),
969
986
  waitingOn: threadSchema.optional()
970
987
  });
971
988
 
972
989
  // src/contract/passkey-contract.ts
973
- import { z as z25 } from "zod";
990
+ import { z as z26 } from "zod";
974
991
 
975
992
  // src/contract/challenge-for-schema.ts
976
- import { z as z18 } from "zod";
977
- var challengeForSchema = z18.discriminatedUnion("kind", [
978
- z18.object({
979
- kind: z18.literal("answer"),
980
- proposalID: z18.string().min(1).max(200),
981
- actionHash: z18.string().min(1),
993
+ import { z as z19 } from "zod";
994
+ var challengeForSchema = z19.discriminatedUnion("kind", [
995
+ z19.object({
996
+ kind: z19.literal("answer"),
997
+ proposalID: z19.string().min(1).max(200),
998
+ actionHash: z19.string().min(1),
982
999
  choice: choiceSchema,
983
- ruleHash: z18.string().optional()
1000
+ ruleHash: z19.string().optional()
984
1001
  }),
985
- z18.object({
986
- kind: z18.literal("unknown_outcome"),
987
- actionID: z18.string().min(1).max(200),
988
- choice: z18.literal("retry")
1002
+ z19.object({
1003
+ kind: z19.literal("unknown_outcome"),
1004
+ actionID: z19.string().min(1).max(200),
1005
+ choice: z19.literal("retry")
989
1006
  }),
990
- z18.object({ kind: z18.literal("register") }),
991
- z18.object({ kind: z18.literal("revoke"), passkeyID: z18.string().min(1).max(200) })
1007
+ z19.object({ kind: z19.literal("register") }),
1008
+ z19.object({ kind: z19.literal("revoke"), passkeyID: z19.string().min(1).max(200) })
992
1009
  ]);
993
1010
 
994
1011
  // src/contract/creation-options-schema.ts
995
- import { z as z22 } from "zod";
1012
+ import { z as z23 } from "zod";
996
1013
 
997
1014
  // src/contract/credential-descriptor-schema.ts
998
- import { z as z20 } from "zod";
1015
+ import { z as z21 } from "zod";
999
1016
 
1000
1017
  // src/contract/transports-schema.ts
1001
- import { z as z19 } from "zod";
1002
- var transportSchema = z19.string().max(40);
1003
- var transportsSchema = z19.array(transportSchema).max(10);
1018
+ import { z as z20 } from "zod";
1019
+ var transportSchema = z20.string().max(40);
1020
+ var transportsSchema = z20.array(transportSchema).max(10);
1004
1021
 
1005
1022
  // src/contract/credential-descriptor-schema.ts
1006
- var credentialDescriptorSchema = z20.object({
1023
+ var credentialDescriptorSchema = z21.object({
1007
1024
  id: base64URLSchema,
1008
- type: z20.literal("public-key"),
1025
+ type: z21.literal("public-key"),
1009
1026
  transports: transportsSchema.optional()
1010
1027
  });
1011
1028
 
1012
1029
  // src/contract/user-verification-schema.ts
1013
- import { z as z21 } from "zod";
1014
- var userVerificationSchema = z21.enum(["required", "preferred", "discouraged"]);
1030
+ import { z as z22 } from "zod";
1031
+ var userVerificationSchema = z22.enum(["required", "preferred", "discouraged"]);
1015
1032
 
1016
1033
  // src/contract/creation-options-schema.ts
1017
- var userSchema = z22.object({ id: base64URLSchema, name: z22.string(), displayName: z22.string() });
1018
- var parameterSchema = z22.object({ type: z22.literal("public-key"), alg: z22.int() });
1019
- var selectionSchema = z22.object({
1034
+ var userSchema = z23.object({ id: base64URLSchema, name: z23.string(), displayName: z23.string() });
1035
+ var parameterSchema = z23.object({ type: z23.literal("public-key"), alg: z23.int() });
1036
+ var selectionSchema = z23.object({
1020
1037
  residentKey: userVerificationSchema,
1021
- requireResidentKey: z22.boolean(),
1038
+ requireResidentKey: z23.boolean(),
1022
1039
  userVerification: userVerificationSchema
1023
1040
  });
1024
- var creationOptionsSchema = z22.object({
1025
- rp: z22.object({ id: z22.string(), name: z22.string() }),
1041
+ var creationOptionsSchema = z23.object({
1042
+ rp: z23.object({ id: z23.string(), name: z23.string() }),
1026
1043
  user: userSchema,
1027
1044
  challenge: base64URLSchema,
1028
- pubKeyCredParams: z22.array(parameterSchema),
1029
- timeout: z22.int().positive(),
1030
- excludeCredentials: z22.array(credentialDescriptorSchema),
1045
+ pubKeyCredParams: z23.array(parameterSchema),
1046
+ timeout: z23.int().positive(),
1047
+ excludeCredentials: z23.array(credentialDescriptorSchema),
1031
1048
  authenticatorSelection: selectionSchema,
1032
- attestation: z22.enum(["none", "indirect", "direct", "enterprise"])
1049
+ attestation: z23.enum(["none", "indirect", "direct", "enterprise"])
1033
1050
  });
1034
1051
 
1035
1052
  // src/contract/registration-response-schema.ts
1036
- import { z as z23 } from "zod";
1037
- var attestationSchema = z23.object({
1053
+ import { z as z24 } from "zod";
1054
+ var attestationSchema = z24.object({
1038
1055
  clientDataJSON: base64URLSchema,
1039
1056
  attestationObject: base64URLSchema,
1040
1057
  authenticatorData: base64URLSchema.optional(),
1041
1058
  transports: transportsSchema.optional(),
1042
- publicKeyAlgorithm: z23.int().optional(),
1059
+ publicKeyAlgorithm: z24.int().optional(),
1043
1060
  publicKey: base64URLSchema.optional()
1044
1061
  });
1045
- var registrationResponseSchema = z23.object({
1062
+ var registrationResponseSchema = z24.object({
1046
1063
  id: base64URLSchema,
1047
1064
  rawId: base64URLSchema,
1048
1065
  response: attestationSchema,
1049
- authenticatorAttachment: z23.enum(["cross-platform", "platform"]).optional(),
1050
- clientExtensionResults: z23.object({}),
1051
- type: z23.literal("public-key")
1066
+ authenticatorAttachment: z24.enum(["cross-platform", "platform"]).optional(),
1067
+ clientExtensionResults: z24.object({}),
1068
+ type: z24.literal("public-key")
1052
1069
  });
1053
1070
 
1054
1071
  // src/contract/request-options-schema.ts
1055
- import { z as z24 } from "zod";
1056
- var requestOptionsSchema = z24.object({
1072
+ import { z as z25 } from "zod";
1073
+ var requestOptionsSchema = z25.object({
1057
1074
  challenge: base64URLSchema,
1058
- rpId: z24.string(),
1059
- allowCredentials: z24.array(credentialDescriptorSchema),
1075
+ rpId: z25.string(),
1076
+ allowCredentials: z25.array(credentialDescriptorSchema),
1060
1077
  userVerification: userVerificationSchema,
1061
- timeout: z24.int().positive()
1078
+ timeout: z25.int().positive()
1062
1079
  });
1063
1080
 
1064
1081
  // src/contract/passkey-contract.ts
1065
- var clientActionIDSchema = z25.uuid();
1066
- var listedPasskeySchema = z25.object({
1067
- passkeyID: z25.string(),
1068
- label: z25.string(),
1069
- synced: z25.boolean(),
1070
- authorizedBy: z25.string(),
1071
- registeredAt: z25.date(),
1072
- lastUsedAt: z25.date().nullable(),
1073
- revokedAt: z25.date().nullable()
1082
+ var clientActionIDSchema = z26.uuid();
1083
+ var listedPasskeySchema = z26.object({
1084
+ passkeyID: z26.string(),
1085
+ label: z26.string(),
1086
+ synced: z26.boolean(),
1087
+ authorizedBy: z26.string(),
1088
+ registeredAt: z26.date(),
1089
+ lastUsedAt: z26.date().nullable(),
1090
+ revokedAt: z26.date().nullable()
1074
1091
  });
1075
1092
  var registrationErrors = {
1076
1093
  ...passkeyFailedError,
@@ -1082,57 +1099,57 @@ var registrationErrors = {
1082
1099
  ORIGIN_CHANGED: { message: "Live passkeys hold another origin", status: 409 }
1083
1100
  };
1084
1101
  var passkeyContract = {
1085
- challenge: signedIn.errors(noPasskeyError).input(z25.object({ for: challengeForSchema })).output(z25.object({ options: requestOptionsSchema })),
1102
+ challenge: signedIn.errors(noPasskeyError).input(z26.object({ for: challengeForSchema })).output(z26.object({ options: requestOptionsSchema })),
1086
1103
  registrationOptions: signedIn.errors(registrationErrors).errors({
1087
1104
  CODE_REQUIRED: { message: "A host code is required", status: 403 },
1088
1105
  CODE_INVALID: { message: "The host code is unknown, used or lapsed", status: 403 }
1089
- }).input(z25.object({
1090
- code: z25.string().min(1).max(100).optional(),
1106
+ }).input(z26.object({
1107
+ code: z26.string().min(1).max(100).optional(),
1091
1108
  passkey: authenticationResponseSchema.optional()
1092
- })).output(z25.object({ options: creationOptionsSchema })),
1109
+ })).output(z26.object({ options: creationOptionsSchema })),
1093
1110
  register: signedIn.errors(reusedIDErrors).errors({
1094
1111
  REGISTRATION_FAILED: {
1095
1112
  message: "The registration failed",
1096
1113
  status: 400,
1097
- data: z25.object({ reason: z25.string() })
1114
+ data: z26.object({ reason: z26.string() })
1098
1115
  },
1099
1116
  TOO_MANY_PASSKEYS: registrationErrors.TOO_MANY_PASSKEYS,
1100
1117
  ORIGIN_UNSUPPORTED: registrationErrors.ORIGIN_UNSUPPORTED
1101
- }).input(z25.object({
1118
+ }).input(z26.object({
1102
1119
  clientActionID: clientActionIDSchema,
1103
1120
  response: registrationResponseSchema,
1104
- label: z25.string().min(1).max(64).optional()
1105
- })).output(z25.object({ passkeyID: z25.string() })),
1106
- list: signedIn.output(z25.object({ passkeys: z25.array(listedPasskeySchema) })),
1107
- revoke: signedIn.errors(reusedIDErrors).errors(passkeyFailedError).errors({ NOT_FOUND: { message: "No passkey has this ID", status: 404 } }).input(z25.object({
1121
+ label: z26.string().min(1).max(64).optional()
1122
+ })).output(z26.object({ passkeyID: z26.string() })),
1123
+ list: signedIn.output(z26.object({ passkeys: z26.array(listedPasskeySchema) })),
1124
+ revoke: signedIn.errors(reusedIDErrors).errors(passkeyFailedError).errors({ NOT_FOUND: { message: "No passkey has this ID", status: 404 } }).input(z26.object({
1108
1125
  clientActionID: clientActionIDSchema,
1109
- passkeyID: z25.string().min(1).max(200),
1126
+ passkeyID: z26.string().min(1).max(200),
1110
1127
  passkey: authenticationResponseSchema
1111
- })).output(z25.object({ revokedAt: z25.date() }))
1128
+ })).output(z26.object({ revokedAt: z26.date() }))
1112
1129
  };
1113
1130
 
1114
1131
  // src/contract/pause-state-schema.ts
1115
- import { z as z26 } from "zod";
1116
- var pauseCauseSchema = z26.enum(["restore", "owner", "spending"]);
1117
- var pauseStateSchema = z26.object({ cause: pauseCauseSchema, since: z26.date() }).nullable();
1132
+ import { z as z27 } from "zod";
1133
+ var pauseCauseSchema = z27.enum(["restore", "owner", "spending"]);
1134
+ var pauseStateSchema = z27.object({ cause: pauseCauseSchema, since: z27.date() }).nullable();
1118
1135
 
1119
1136
  // src/contract/read-payload-contract.ts
1120
- import { z as z28 } from "zod";
1137
+ import { z as z29 } from "zod";
1121
1138
 
1122
1139
  // src/contract/sequence-schema.ts
1123
- import { z as z27 } from "zod";
1124
- var sequenceSchema = z27.int().nonnegative();
1140
+ import { z as z28 } from "zod";
1141
+ var sequenceSchema = z28.int().nonnegative();
1125
1142
 
1126
1143
  // src/contract/read-payload-contract.ts
1127
- var jsonObjectSchema = z28.record(z28.string(), z28.unknown());
1128
- var readableSchema = z28.object({
1129
- status: z28.literal("readable"),
1130
- toolCall: z28.object({ input: jsonObjectSchema.optional(), content: jsonObjectSchema.optional() }).optional(),
1131
- worker: z28.object({ text: z28.string().optional(), detail: z28.string().optional() }).optional()
1132
- });
1133
- var forgottenSchema = z28.object({ status: z28.literal("forgotten") });
1134
- var unreadableSchema = z28.object({ status: z28.literal("unreadable") });
1135
- var payloadSchema = z28.discriminatedUnion("status", [
1144
+ var jsonObjectSchema = z29.record(z29.string(), z29.unknown());
1145
+ var readableSchema = z29.object({
1146
+ status: z29.literal("readable"),
1147
+ toolCall: z29.object({ input: jsonObjectSchema.optional(), content: jsonObjectSchema.optional() }).optional(),
1148
+ worker: z29.object({ text: z29.string().optional(), detail: z29.string().optional() }).optional()
1149
+ });
1150
+ var forgottenSchema = z29.object({ status: z29.literal("forgotten") });
1151
+ var unreadableSchema = z29.object({ status: z29.literal("unreadable") });
1152
+ var payloadSchema = z29.discriminatedUnion("status", [
1136
1153
  readableSchema,
1137
1154
  forgottenSchema,
1138
1155
  unreadableSchema
@@ -1141,12 +1158,12 @@ var notFoundError = {
1141
1158
  message: "No record on this thread has this sequence",
1142
1159
  status: 404
1143
1160
  };
1144
- var inputSchema = z28.object({ thread: threadSchema, sequence: sequenceSchema });
1161
+ var inputSchema = z29.object({ thread: threadSchema, sequence: sequenceSchema });
1145
1162
  var readPayloadContract = signedIn.errors({ RECORD_NOT_FOUND: notFoundError }).input(inputSchema).output(payloadSchema);
1146
1163
 
1147
1164
  // src/contract/recovery-schema.ts
1148
- import { z as z29 } from "zod";
1149
- var taskStateSchema2 = z29.enum([
1165
+ import { z as z30 } from "zod";
1166
+ var taskStateSchema2 = z30.enum([
1150
1167
  "ready",
1151
1168
  "running",
1152
1169
  "waiting",
@@ -1156,27 +1173,27 @@ var taskStateSchema2 = z29.enum([
1156
1173
  "failed",
1157
1174
  "closed"
1158
1175
  ]);
1159
- var taskToCheckSchema = z29.object({
1160
- taskID: z29.string(),
1161
- name: z29.string(),
1176
+ var taskToCheckSchema = z30.object({
1177
+ taskID: z30.string(),
1178
+ name: z30.string(),
1162
1179
  stateAtBackup: taskStateSchema2,
1163
- wasRunning: z29.boolean(),
1164
- pendingActions: z29.int().nonnegative()
1180
+ wasRunning: z30.boolean(),
1181
+ pendingActions: z30.int().nonnegative()
1165
1182
  });
1166
- var recoverySchema = z29.object({
1167
- restoredAt: z29.date(),
1168
- backupTakenAt: z29.date(),
1169
- toCheck: z29.array(taskToCheckSchema)
1183
+ var recoverySchema = z30.object({
1184
+ restoredAt: z30.date(),
1185
+ backupTakenAt: z30.date(),
1186
+ toCheck: z30.array(taskToCheckSchema)
1170
1187
  }).nullable();
1171
1188
 
1172
1189
  // src/contract/reminders-contract.ts
1173
- import { z as z32 } from "zod";
1190
+ import { z as z33 } from "zod";
1174
1191
 
1175
1192
  // src/contract/trigger-schema.ts
1176
- import { z as z31 } from "zod";
1193
+ import { z as z32 } from "zod";
1177
1194
 
1178
1195
  // src/contract/schedule-schema.ts
1179
- import { z as z30 } from "zod";
1196
+ import { z as z31 } from "zod";
1180
1197
 
1181
1198
  // src/contract/is-time-zone.ts
1182
1199
  function isTimeZone(zone) {
@@ -1188,19 +1205,19 @@ function isTimeZone(zone) {
1188
1205
  }
1189
1206
 
1190
1207
  // src/contract/schedule-schema.ts
1191
- var clockTimeSchema = z30.string().regex(/^(?:[01]\d|2[0-3]):[0-5]\d$/u, "a time is HH:MM, 24-hour");
1192
- var minutesSchema = z30.strictObject({
1193
- minutes: z30.int().min(5).max(1440)
1208
+ var clockTimeSchema = z31.string().regex(/^(?:[01]\d|2[0-3]):[0-5]\d$/u, "a time is HH:MM, 24-hour");
1209
+ var minutesSchema = z31.strictObject({
1210
+ minutes: z31.int().min(5).max(1440)
1194
1211
  });
1195
- var weekdaySchema = z30.enum(["mon", "tue", "wed", "thu", "fri", "sat", "sun"]);
1196
- var scheduleSchema = z30.strictObject({
1197
- every: z30.union([z30.enum(["day", "week", "hour"]), minutesSchema]),
1212
+ var weekdaySchema = z31.enum(["mon", "tue", "wed", "thu", "fri", "sat", "sun"]);
1213
+ var scheduleSchema = z31.strictObject({
1214
+ every: z31.union([z31.enum(["day", "week", "hour"]), minutesSchema]),
1198
1215
  at: clockTimeSchema.optional(),
1199
1216
  on: weekdaySchema.optional(),
1200
- window: z30.strictObject({ from: clockTimeSchema, until: clockTimeSchema }).optional(),
1201
- idleMinutes: z30.int().min(1).max(720).optional(),
1202
- zone: z30.string().refine((zone) => zone === "owner" || isTimeZone(zone), "a zone is owner or an IANA zone").default("owner"),
1203
- catchUp: z30.enum(["once", "skip"]).default("once")
1217
+ window: z31.strictObject({ from: clockTimeSchema, until: clockTimeSchema }).optional(),
1218
+ idleMinutes: z31.int().min(1).max(720).optional(),
1219
+ zone: z31.string().refine((zone) => zone === "owner" || isTimeZone(zone), "a zone is owner or an IANA zone").default("owner"),
1220
+ catchUp: z31.enum(["once", "skip"]).default("once")
1204
1221
  }).superRefine((schedule, context) => {
1205
1222
  const isCalendar = schedule.every === "day" || schedule.every === "week";
1206
1223
  if (isCalendar && schedule.at === undefined && schedule.window === undefined) {
@@ -1227,41 +1244,41 @@ var scheduleSchema = z30.strictObject({
1227
1244
  });
1228
1245
 
1229
1246
  // src/contract/trigger-schema.ts
1230
- var triggerAtSchema = z31.iso.datetime({ offset: true });
1231
- var triggerSchema = z31.union([
1232
- z31.strictObject({ schedule: scheduleSchema }),
1233
- z31.strictObject({ at: triggerAtSchema })
1247
+ var triggerAtSchema = z32.iso.datetime({ offset: true });
1248
+ var triggerSchema = z32.union([
1249
+ z32.strictObject({ schedule: scheduleSchema }),
1250
+ z32.strictObject({ at: triggerAtSchema })
1234
1251
  ]);
1235
1252
 
1236
1253
  // src/contract/reminders-contract.ts
1237
- var listedReminderSchema = z32.object({
1238
- reminder: z32.string(),
1239
- name: z32.string(),
1240
- note: z32.string(),
1254
+ var listedReminderSchema = z33.object({
1255
+ reminder: z33.string(),
1256
+ name: z33.string(),
1257
+ note: z33.string(),
1241
1258
  trigger: triggerSchema,
1242
- rendered: z32.string(),
1243
- state: z32.enum(["active", "fired"]),
1244
- next: z32.string().nullable(),
1245
- recentFires: z32.array(z32.string())
1259
+ rendered: z33.string(),
1260
+ state: z33.enum(["active", "fired"]),
1261
+ next: z33.string().nullable(),
1262
+ recentFires: z33.array(z33.string())
1246
1263
  });
1247
1264
  var remindersContract = {
1248
- list: signedIn.output(z32.object({ reminders: z32.array(listedReminderSchema) })),
1265
+ list: signedIn.output(z33.object({ reminders: z33.array(listedReminderSchema) })),
1249
1266
  cancel: signedIn.errors({
1250
1267
  NOT_FOUND: { message: "No reminder has this ID", status: 404 },
1251
1268
  NOT_ACTIVE: { message: "The reminder already fired or was cancelled", status: 409 }
1252
- }).input(z32.object({ reminder: z32.string().min(1).max(64) })).output(z32.object({ reminder: z32.string() }))
1269
+ }).input(z33.object({ reminder: z33.string().min(1).max(64) })).output(z33.object({ reminder: z33.string() }))
1253
1270
  };
1254
1271
 
1255
1272
  // src/contract/rule-contract.ts
1256
- import { z as z33 } from "zod";
1257
- var ruleIDSchema = z33.string().min(1).max(200);
1258
- var revisionSchema = z33.int().positive();
1259
- var ruleSchema = z33.object({
1260
- ruleID: z33.string(),
1273
+ import { z as z34 } from "zod";
1274
+ var ruleIDSchema = z34.string().min(1).max(200);
1275
+ var revisionSchema = z34.int().positive();
1276
+ var ruleSchema = z34.object({
1277
+ ruleID: z34.string(),
1261
1278
  revision: revisionSchema,
1262
- sentence: z33.string(),
1263
- outcome: z33.enum(["allow", "ask", "deny"]),
1264
- destinations: z33.array(z33.string())
1279
+ sentence: z34.string(),
1280
+ outcome: z34.enum(["allow", "ask", "deny"]),
1281
+ destinations: z34.array(z34.string())
1265
1282
  });
1266
1283
  var notFound = { NOT_FOUND: { message: "No rule has this ID", status: 404 } };
1267
1284
  var ruleChange = signedIn.errors(reusedIDErrors).errors({
@@ -1269,38 +1286,38 @@ var ruleChange = signedIn.errors(reusedIDErrors).errors({
1269
1286
  CONFLICT: {
1270
1287
  message: "The rule changed since the notice showed it",
1271
1288
  status: 409,
1272
- data: z33.object({ revision: revisionSchema })
1289
+ data: z34.object({ revision: revisionSchema })
1273
1290
  },
1274
1291
  NOT_ALLOWED: {
1275
1292
  message: "The rule takes no such change",
1276
1293
  status: 403,
1277
- data: z33.object({ reason: z33.enum(["widens", "empty", "mandate"]) })
1294
+ data: z34.object({ reason: z34.enum(["widens", "empty", "mandate"]) })
1278
1295
  }
1279
1296
  });
1280
- var currentHashSchema = z33.object({ current: z33.object({ actionHash: z33.string() }) });
1281
- var closedStateSchema = z33.object({
1282
- state: z33.enum(["approved", "declined", "lapsed", "withdrawn"])
1283
- });
1284
- var proposalIDSchema = z33.string().min(1).max(64);
1285
- var ruleFormSchema = z33.record(z33.string(), z33.unknown());
1286
- var mandateRuleSchema = z33.object({ ruleID: z33.string(), sentence: z33.string() });
1287
- var mandateSchema = z33.object({
1288
- mandateID: z33.string(),
1289
- title: z33.string().nullable(),
1290
- rules: z33.array(mandateRuleSchema),
1291
- startedAt: z33.date(),
1292
- expires: z33.date()
1293
- });
1294
- var expiryRefusalSchema = z33.discriminatedUnion("reason", [
1295
- z33.object({ reason: z33.literal("expires_past"), now: z33.string() }),
1296
- z33.object({
1297
- reason: z33.literal("expires_beyond_max"),
1298
- maxHours: z33.number(),
1299
- latestExpiry: z33.string()
1297
+ var currentHashSchema = z34.object({ current: z34.object({ actionHash: z34.string() }) });
1298
+ var closedStateSchema = z34.object({
1299
+ state: z34.enum(["approved", "declined", "lapsed", "withdrawn"])
1300
+ });
1301
+ var proposalIDSchema = z34.string().min(1).max(64);
1302
+ var ruleFormSchema = z34.record(z34.string(), z34.unknown());
1303
+ var mandateRuleSchema = z34.object({ ruleID: z34.string(), sentence: z34.string() });
1304
+ var mandateSchema = z34.object({
1305
+ mandateID: z34.string(),
1306
+ title: z34.string().nullable(),
1307
+ rules: z34.array(mandateRuleSchema),
1308
+ startedAt: z34.date(),
1309
+ expires: z34.date()
1310
+ });
1311
+ var expiryRefusalSchema = z34.discriminatedUnion("reason", [
1312
+ z34.object({ reason: z34.literal("expires_past"), now: z34.string() }),
1313
+ z34.object({
1314
+ reason: z34.literal("expires_beyond_max"),
1315
+ maxHours: z34.number(),
1316
+ latestExpiry: z34.string()
1300
1317
  })
1301
1318
  ]);
1302
- var faultsSchema = z33.object({
1303
- faults: z33.array(z33.string()),
1319
+ var faultsSchema = z34.object({
1320
+ faults: z34.array(z34.string()),
1304
1321
  expiry: expiryRefusalSchema.optional()
1305
1322
  });
1306
1323
  var invalid = {
@@ -1310,16 +1327,16 @@ var invalid = {
1310
1327
  data: faultsSchema
1311
1328
  }
1312
1329
  };
1313
- var destinationsSchema = z33.array(z33.string().regex(/^\S+$/u)).max(100);
1330
+ var destinationsSchema = z34.array(z34.string().regex(/^\S+$/u)).max(100);
1314
1331
  var ruleContract = {
1315
- readRule: signedIn.errors(notFound).input(z33.object({ ruleID: ruleIDSchema })).output(ruleSchema),
1316
- removeRule: ruleChange.input(z33.object({ ruleID: ruleIDSchema, revision: revisionSchema, clientActionID: z33.uuid() })).output(z33.object({ ruleID: z33.string() })),
1317
- editRule: ruleChange.input(z33.object({
1332
+ readRule: signedIn.errors(notFound).input(z34.object({ ruleID: ruleIDSchema })).output(ruleSchema),
1333
+ removeRule: ruleChange.input(z34.object({ ruleID: ruleIDSchema, revision: revisionSchema, clientActionID: z34.uuid() })).output(z34.object({ ruleID: z34.string() })),
1334
+ editRule: ruleChange.input(z34.object({
1318
1335
  ruleID: ruleIDSchema,
1319
1336
  revision: revisionSchema,
1320
1337
  destinations: destinationsSchema,
1321
- clientActionID: z33.uuid()
1322
- })).output(z33.object({ ruleID: z33.string(), revision: revisionSchema })),
1338
+ clientActionID: z34.uuid()
1339
+ })).output(z34.object({ ruleID: z34.string(), revision: revisionSchema })),
1323
1340
  editProposedRule: signedIn.errors(reusedIDErrors).errors({
1324
1341
  ...invalid,
1325
1342
  NOT_FOUND: { message: "No proposed rule has this ID", status: 404 },
@@ -1333,56 +1350,56 @@ var ruleContract = {
1333
1350
  status: 409,
1334
1351
  data: closedStateSchema
1335
1352
  }
1336
- }).input(z33.object({
1353
+ }).input(z34.object({
1337
1354
  proposalID: proposalIDSchema,
1338
- actionHash: z33.string(),
1355
+ actionHash: z34.string(),
1339
1356
  rule: ruleFormSchema,
1340
- clientActionID: z33.uuid()
1341
- })).output(z33.object({ proposalID: z33.string() })),
1342
- proposeMandate: signedIn.errors(reusedIDErrors).errors(invalid).input(z33.object({
1343
- title: z33.string(),
1344
- rules: z33.array(ruleFormSchema),
1345
- expires: z33.string().optional(),
1346
- clientActionID: z33.uuid()
1347
- })).output(z33.object({ proposalID: z33.string(), mandateID: z33.string(), expires: z33.date() })),
1348
- listMandates: signedIn.output(z33.object({ mandates: z33.array(mandateSchema) })),
1349
- endMandate: signedIn.errors(reusedIDErrors).errors({ NOT_FOUND: { message: "No mandate has this ID", status: 404 } }).input(z33.object({ mandateID: z33.string().min(1).max(64), clientActionID: z33.uuid() })).output(z33.object({ mandateID: z33.string(), state: z33.enum(["ended", "expired"]) }))
1357
+ clientActionID: z34.uuid()
1358
+ })).output(z34.object({ proposalID: z34.string() })),
1359
+ proposeMandate: signedIn.errors(reusedIDErrors).errors(invalid).input(z34.object({
1360
+ title: z34.string(),
1361
+ rules: z34.array(ruleFormSchema),
1362
+ expires: z34.string().optional(),
1363
+ clientActionID: z34.uuid()
1364
+ })).output(z34.object({ proposalID: z34.string(), mandateID: z34.string(), expires: z34.date() })),
1365
+ listMandates: signedIn.output(z34.object({ mandates: z34.array(mandateSchema) })),
1366
+ endMandate: signedIn.errors(reusedIDErrors).errors({ NOT_FOUND: { message: "No mandate has this ID", status: 404 } }).input(z34.object({ mandateID: z34.string().min(1).max(64), clientActionID: z34.uuid() })).output(z34.object({ mandateID: z34.string(), state: z34.enum(["ended", "expired"]) }))
1350
1367
  };
1351
1368
 
1352
1369
  // src/contract/spend-stop-schema.ts
1353
- import { z as z34 } from "zod";
1354
- var triple = z34.object({ dollars: z34.number(), tokens: z34.number(), turns: z34.number() });
1355
- var spendStopSchema = z34.discriminatedUnion("state", [
1356
- z34.object({ state: z34.literal("clear") }),
1357
- z34.object({ state: z34.literal("unreachable") }),
1358
- z34.object({ state: z34.literal("lost") }),
1359
- z34.object({
1360
- state: z34.literal("tripped"),
1361
- period: z34.enum(["day", "month"]),
1362
- start: z34.string(),
1363
- measure: z34.enum(["dollars", "tokens", "turns"]),
1364
- limit: z34.number(),
1365
- spent: z34.number(),
1366
- at: z34.date(),
1367
- resetsAt: z34.date(),
1368
- canRaise: z34.boolean(),
1370
+ import { z as z35 } from "zod";
1371
+ var triple = z35.object({ dollars: z35.number(), tokens: z35.number(), turns: z35.number() });
1372
+ var spendStopSchema = z35.discriminatedUnion("state", [
1373
+ z35.object({ state: z35.literal("clear") }),
1374
+ z35.object({ state: z35.literal("unreachable") }),
1375
+ z35.object({ state: z35.literal("lost") }),
1376
+ z35.object({
1377
+ state: z35.literal("tripped"),
1378
+ period: z35.enum(["day", "month"]),
1379
+ start: z35.string(),
1380
+ measure: z35.enum(["dollars", "tokens", "turns"]),
1381
+ limit: z35.number(),
1382
+ spent: z35.number(),
1383
+ at: z35.date(),
1384
+ resetsAt: z35.date(),
1385
+ canRaise: z35.boolean(),
1369
1386
  limits: triple,
1370
1387
  used: triple,
1371
1388
  cap: triple
1372
1389
  })
1373
1390
  ]);
1374
- var spendRaiseInputSchema = z34.object({
1375
- start: z34.string().regex(/^\d{4}-\d{2}-\d{2}$/u),
1376
- dollars: z34.number().positive(),
1377
- tokens: z34.int().positive(),
1378
- turns: z34.int().positive()
1379
- });
1380
- var spendRaiseOutputSchema = z34.union([
1381
- z34.object({ state: z34.literal("clear") }),
1382
- z34.object({ state: z34.literal("stopped") }),
1383
- z34.object({ error: z34.literal("above_cap"), cap: triple }),
1384
- z34.object({ error: z34.literal("period_ended") }),
1385
- z34.object({ error: z34.literal("unreachable") })
1391
+ var spendRaiseInputSchema = z35.object({
1392
+ start: z35.string().regex(/^\d{4}-\d{2}-\d{2}$/u),
1393
+ dollars: z35.number().positive(),
1394
+ tokens: z35.int().positive(),
1395
+ turns: z35.int().positive()
1396
+ });
1397
+ var spendRaiseOutputSchema = z35.union([
1398
+ z35.object({ state: z35.literal("clear") }),
1399
+ z35.object({ state: z35.literal("stopped") }),
1400
+ z35.object({ error: z35.literal("above_cap"), cap: triple }),
1401
+ z35.object({ error: z35.literal("period_ended") }),
1402
+ z35.object({ error: z35.literal("unreachable") })
1386
1403
  ]);
1387
1404
  var spendStopStandsError = {
1388
1405
  message: "Model spending is stopped, and nixie resumes when the stop clears",
@@ -1390,226 +1407,226 @@ var spendStopStandsError = {
1390
1407
  };
1391
1408
 
1392
1409
  // src/contract/task-schema.ts
1393
- import { z as z35 } from "zod";
1394
- var taskSchema2 = z35.object({
1395
- error: z35.string().optional(),
1396
- errorLimit: z35.int().positive().optional(),
1397
- errors: z35.int().positive().optional(),
1398
- isWaitingForRetry: z35.boolean().optional(),
1399
- readCursor: z35.int().nonnegative().optional(),
1400
- reason: z35.string().optional(),
1401
- retryAt: z35.date().optional(),
1402
- stepKey: z35.string().optional(),
1403
- taskID: z35.string()
1410
+ import { z as z36 } from "zod";
1411
+ var taskSchema2 = z36.object({
1412
+ error: z36.string().optional(),
1413
+ errorLimit: z36.int().positive().optional(),
1414
+ errors: z36.int().positive().optional(),
1415
+ isWaitingForRetry: z36.boolean().optional(),
1416
+ readCursor: z36.int().nonnegative().optional(),
1417
+ reason: z36.string().optional(),
1418
+ retryAt: z36.date().optional(),
1419
+ stepKey: z36.string().optional(),
1420
+ taskID: z36.string()
1404
1421
  });
1405
1422
 
1406
1423
  // src/contract/tool-call-schema.ts
1407
- import { z as z36 } from "zod";
1408
- var jsonObjectSchema2 = z36.record(z36.string(), z36.unknown());
1409
- var toolCallSchema = z36.object({
1410
- callID: z36.string(),
1424
+ import { z as z37 } from "zod";
1425
+ var jsonObjectSchema2 = z37.record(z37.string(), z37.unknown());
1426
+ var toolCallSchema = z37.object({
1427
+ callID: z37.string(),
1411
1428
  content: jsonObjectSchema2.optional(),
1412
1429
  input: jsonObjectSchema2.optional(),
1413
- outcome: z36.string().optional(),
1414
- runID: z36.string().optional(),
1415
- tool: z36.string().optional()
1430
+ outcome: z37.string().optional(),
1431
+ runID: z37.string().optional(),
1432
+ tool: z37.string().optional()
1416
1433
  });
1417
1434
 
1418
1435
  // src/contract/view-contract.ts
1419
- import { z as z37 } from "zod";
1420
- var skipReasonSchema = z37.enum([
1436
+ import { z as z38 } from "zod";
1437
+ var skipReasonSchema = z38.enum([
1421
1438
  "too_late",
1422
1439
  "catch_up_off",
1423
1440
  "window_closed",
1424
1441
  "still_running",
1425
1442
  "task_held"
1426
1443
  ]);
1427
- var endedRunSchema = z37.object({
1428
- runID: z37.string(),
1444
+ var endedRunSchema = z38.object({
1445
+ runID: z38.string(),
1429
1446
  taskID: threadSchema,
1430
- definitionID: z37.string().nullable(),
1431
- startedAt: z37.date(),
1432
- endedAt: z37.date(),
1447
+ definitionID: z38.string().nullable(),
1448
+ startedAt: z38.date(),
1449
+ endedAt: z38.date(),
1433
1450
  sequence: sequenceSchema,
1434
- cause: z37.string(),
1435
- endedBy: z37.string(),
1436
- carriesRunID: z37.string().nullable(),
1437
- reportID: z37.string(),
1438
- delivery: z37.enum(["wake", "next_turn", "kept"]),
1451
+ cause: z38.string(),
1452
+ endedBy: z38.string(),
1453
+ carriesRunID: z38.string().nullable(),
1454
+ reportID: z38.string(),
1455
+ delivery: z38.enum(["wake", "next_turn", "kept"]),
1439
1456
  fire: runFireSchema.nullable(),
1440
- used: z37.object({ turns: z37.number(), dollars: z37.number() })
1441
- });
1442
- var reportEntrySchema = z37.object({
1443
- definitionID: z37.string(),
1444
- name: z37.string(),
1445
- kind: z37.enum(["late", "skipped"]),
1446
- scheduledFor: z37.string(),
1447
- firedAt: z37.string().nullable(),
1448
- lateBySeconds: z37.number().nullable(),
1457
+ used: z38.object({ turns: z38.number(), dollars: z38.number() })
1458
+ });
1459
+ var reportEntrySchema = z38.object({
1460
+ definitionID: z38.string(),
1461
+ name: z38.string(),
1462
+ kind: z38.enum(["late", "skipped"]),
1463
+ scheduledFor: z38.string(),
1464
+ firedAt: z38.string().nullable(),
1465
+ lateBySeconds: z38.number().nullable(),
1449
1466
  reason: skipReasonSchema.nullable(),
1450
1467
  sequence: sequenceSchema
1451
1468
  });
1452
- var listedDefinitionSchema = z37.object({
1453
- definitionID: z37.string(),
1454
- name: z37.string(),
1455
- enabled: z37.boolean(),
1469
+ var listedDefinitionSchema = z38.object({
1470
+ definitionID: z38.string(),
1471
+ name: z38.string(),
1472
+ enabled: z38.boolean(),
1456
1473
  trigger: triggerSchema.nullable(),
1457
- rendered: z37.string().nullable(),
1458
- next: z37.string().nullable(),
1459
- tools: z37.array(z37.string()),
1460
- origin: z37.enum(["definitions", "nixie"]),
1461
- createdBy: z37.object({
1474
+ rendered: z38.string().nullable(),
1475
+ next: z38.string().nullable(),
1476
+ tools: z38.array(z38.string()),
1477
+ origin: z38.enum(["definitions", "nixie"]),
1478
+ createdBy: z38.object({
1462
1479
  sequence: sequenceSchema,
1463
- kind: z37.enum(["definition.changed", "definitions_seeded"])
1480
+ kind: z38.enum(["definition.changed", "definitions_seeded"])
1464
1481
  }),
1465
1482
  taskID: threadSchema.nullable(),
1466
- isUnreadable: z37.boolean()
1483
+ isUnreadable: z38.boolean()
1467
1484
  });
1468
1485
  var viewContract = {
1469
1486
  tasks: {
1470
- listEnded: signedIn.input(z37.object({
1471
- limit: z37.int().min(1).max(100),
1487
+ listEnded: signedIn.input(z38.object({
1488
+ limit: z38.int().min(1).max(100),
1472
1489
  before: sequenceSchema.optional(),
1473
- definitionID: z37.string().min(1).max(200).optional()
1474
- })).output(z37.object({
1475
- tasks: z37.array(listedTaskSchema),
1476
- runs: z37.array(endedRunSchema),
1490
+ definitionID: z38.string().min(1).max(200).optional()
1491
+ })).output(z38.object({
1492
+ tasks: z38.array(listedTaskSchema),
1493
+ runs: z38.array(endedRunSchema),
1477
1494
  next: sequenceSchema.nullable()
1478
1495
  }))
1479
1496
  },
1480
1497
  triggers: {
1481
- report: signedIn.input(z37.object({
1482
- since: z37.string().regex(/^\d{4}-\d{2}-\d{2}$/u),
1483
- definitionID: z37.string().min(1).max(200).optional()
1484
- })).output(z37.object({ entries: z37.array(reportEntrySchema) }))
1498
+ report: signedIn.input(z38.object({
1499
+ since: z38.string().regex(/^\d{4}-\d{2}-\d{2}$/u),
1500
+ definitionID: z38.string().min(1).max(200).optional()
1501
+ })).output(z38.object({ entries: z38.array(reportEntrySchema) }))
1485
1502
  },
1486
1503
  definitions: {
1487
- listTasks: signedIn.output(z37.object({ definitions: z37.array(listedDefinitionSchema) }))
1504
+ listTasks: signedIn.output(z38.object({ definitions: z38.array(listedDefinitionSchema) }))
1488
1505
  }
1489
1506
  };
1490
1507
 
1491
1508
  // src/contract/worker-view-schema.ts
1492
- import { z as z38 } from "zod";
1493
- var usedSchema = z38.object({
1494
- minutes: z38.number(),
1495
- turns: z38.number(),
1496
- tokens: z38.number(),
1497
- dollars: z38.number()
1498
- });
1499
- var startedSchema = z38.object({
1500
- phase: z38.literal("started"),
1501
- workerRunID: z38.string(),
1502
- shortID: z38.string(),
1503
- callID: z38.string(),
1504
- model: z38.string(),
1505
- tools: z38.array(z38.string()),
1509
+ import { z as z39 } from "zod";
1510
+ var usedSchema = z39.object({
1511
+ minutes: z39.number(),
1512
+ turns: z39.number(),
1513
+ tokens: z39.number(),
1514
+ dollars: z39.number()
1515
+ });
1516
+ var startedSchema = z39.object({
1517
+ phase: z39.literal("started"),
1518
+ workerRunID: z39.string(),
1519
+ shortID: z39.string(),
1520
+ callID: z39.string(),
1521
+ model: z39.string(),
1522
+ tools: z39.array(z39.string()),
1506
1523
  limits: usedSchema,
1507
- isTaskLimit: z38.boolean()
1508
- });
1509
- var turnSchema = z38.object({
1510
- phase: z38.literal("turn"),
1511
- workerRunID: z38.string(),
1512
- callID: z38.string(),
1513
- turn: z38.number(),
1514
- tokens: z38.number(),
1515
- dollars: z38.number(),
1516
- text: z38.string().optional()
1517
- });
1518
- var endedSchema = z38.object({
1519
- phase: z38.literal("ended"),
1520
- workerRunID: z38.string(),
1521
- callID: z38.string(),
1522
- outcome: z38.string(),
1523
- limit: z38.string().optional(),
1524
+ isTaskLimit: z39.boolean()
1525
+ });
1526
+ var turnSchema = z39.object({
1527
+ phase: z39.literal("turn"),
1528
+ workerRunID: z39.string(),
1529
+ callID: z39.string(),
1530
+ turn: z39.number(),
1531
+ tokens: z39.number(),
1532
+ dollars: z39.number(),
1533
+ text: z39.string().optional()
1534
+ });
1535
+ var endedSchema = z39.object({
1536
+ phase: z39.literal("ended"),
1537
+ workerRunID: z39.string(),
1538
+ callID: z39.string(),
1539
+ outcome: z39.string(),
1540
+ limit: z39.string().optional(),
1524
1541
  used: usedSchema,
1525
- detail: z38.string().optional()
1542
+ detail: z39.string().optional()
1526
1543
  });
1527
- var workerViewSchema = z38.discriminatedUnion("phase", [
1544
+ var workerViewSchema = z39.discriminatedUnion("phase", [
1528
1545
  startedSchema,
1529
1546
  turnSchema,
1530
1547
  endedSchema
1531
1548
  ]);
1532
1549
 
1533
1550
  // src/contract/contract.ts
1534
- var clientActionIDSchema2 = z39.uuid();
1535
- var imageSchema = z39.object({ mediaType: z39.enum(imageLimits.mediaTypes) });
1536
- var imageFilesSchema = z39.array(z39.file());
1537
- var imageRefSchema = z39.object({
1538
- position: z39.int().nonnegative(),
1551
+ var clientActionIDSchema2 = z40.uuid();
1552
+ var imageSchema = z40.object({ mediaType: z40.enum(imageLimits.mediaTypes) });
1553
+ var imageFilesSchema = z40.array(z40.file());
1554
+ var imageRefSchema = z40.object({
1555
+ position: z40.int().nonnegative(),
1539
1556
  sequence: sequenceSchema,
1540
1557
  thread: threadSchema
1541
1558
  });
1542
- var versionRefSchema = z39.object({
1543
- itemID: z39.string().min(1).max(200),
1544
- version: z39.int().nonnegative()
1559
+ var versionRefSchema = z40.object({
1560
+ itemID: z40.string().min(1).max(200),
1561
+ version: z40.int().nonnegative()
1545
1562
  });
1546
- var recallItemSchema = versionRefSchema.extend({ score: z39.number().optional() });
1547
- var recallSchema = z39.object({ items: z39.array(recallItemSchema) });
1548
- var tokenCountSchema = z39.int().nonnegative();
1549
- var contextSchema = z39.object({ size: tokenCountSchema, window: z39.int().positive() });
1550
- var compactionSchema = z39.object({
1563
+ var recallItemSchema = versionRefSchema.extend({ score: z40.number().optional() });
1564
+ var recallSchema = z40.object({ items: z40.array(recallItemSchema) });
1565
+ var tokenCountSchema = z40.int().nonnegative();
1566
+ var contextSchema = z40.object({ size: tokenCountSchema, window: z40.int().positive() });
1567
+ var compactionSchema = z40.object({
1551
1568
  postTokens: tokenCountSchema.optional(),
1552
1569
  preTokens: tokenCountSchema,
1553
- trigger: z39.enum(["manual", "auto"])
1570
+ trigger: z40.enum(["manual", "auto"])
1554
1571
  });
1555
- var summarySchema = z39.object({
1572
+ var summarySchema = z40.object({
1556
1573
  contextSize: tokenCountSchema.optional(),
1557
1574
  summaryTokens: tokenCountSchema,
1558
- text: z39.string().optional(),
1559
- trigger: z39.enum(["threshold", "overflow"])
1575
+ text: z40.string().optional(),
1576
+ trigger: z40.enum(["threshold", "overflow"])
1560
1577
  });
1561
- var compactionFailureSchema = z39.object({ failures: z39.int().positive() });
1578
+ var compactionFailureSchema = z40.object({ failures: z40.int().positive() });
1562
1579
  var versionTextSchema = versionRefSchema.extend({
1563
- status: z39.enum(["readable", "shredded", "unreadable", "missing"]),
1564
- text: z39.string().optional()
1580
+ status: z40.enum(["readable", "shredded", "unreadable", "missing"]),
1581
+ text: z40.string().optional()
1565
1582
  });
1566
- var listedActionSchema = z39.object({ actionID: z39.string(), tool: z39.string() });
1567
- var taskMessageSchema = z39.object({
1583
+ var listedActionSchema = z40.object({ actionID: z40.string(), tool: z40.string() });
1584
+ var taskMessageSchema = z40.object({
1568
1585
  from: threadSchema,
1569
- fromName: z39.string(),
1570
- hop: z39.int().nonnegative(),
1571
- kind: z39.string(),
1572
- messageID: z39.string(),
1573
- replyTo: z39.string().optional(),
1574
- text: z39.string().optional(),
1586
+ fromName: z40.string(),
1587
+ hop: z40.int().nonnegative(),
1588
+ kind: z40.string(),
1589
+ messageID: z40.string(),
1590
+ replyTo: z40.string().optional(),
1591
+ text: z40.string().optional(),
1575
1592
  to: threadSchema,
1576
- woke: z39.boolean()
1593
+ woke: z40.boolean()
1577
1594
  });
1578
- var exchangeNoticeSchema = z39.object({
1579
- link: z39.object({ label: z39.string(), messageID: z39.string(), taskID: threadSchema }),
1580
- text: z39.string()
1595
+ var exchangeNoticeSchema = z40.object({
1596
+ link: z40.object({ label: z40.string(), messageID: z40.string(), taskID: threadSchema }),
1597
+ text: z40.string()
1581
1598
  });
1582
- var reminderSchema = z39.object({
1583
- name: z39.string().nullable(),
1584
- note: z39.string(),
1585
- scheduledFor: z39.iso.datetime({ offset: true }),
1586
- lateBySeconds: z39.number().nullable()
1599
+ var reminderSchema = z40.object({
1600
+ name: z40.string().nullable(),
1601
+ note: z40.string(),
1602
+ scheduledFor: z40.iso.datetime({ offset: true }),
1603
+ lateBySeconds: z40.number().nullable()
1587
1604
  });
1588
- var recordSchema = z39.object({
1589
- clipped: z39.array(clippedPayloadSchema).optional(),
1605
+ var recordSchema = z40.object({
1606
+ clipped: z40.array(clippedPayloadSchema).optional(),
1590
1607
  compaction: compactionSchema.optional(),
1591
1608
  exchangeNotice: exchangeNoticeSchema.optional(),
1592
1609
  reminder: reminderSchema.optional(),
1593
1610
  compactionFailure: compactionFailureSchema.optional(),
1594
- forget: z39.object({ sequence: sequenceSchema }).optional(),
1611
+ forget: z40.object({ sequence: sequenceSchema }).optional(),
1595
1612
  context: contextSchema.optional(),
1596
1613
  definitionNotice: definitionNoticeSchema.optional(),
1597
- isRemoved: z39.literal(true).optional(),
1598
- isSilentTurn: z39.literal(true).optional(),
1599
- kind: z39.string(),
1600
- message: z39.object({
1601
- clientMessageId: z39.uuid().optional(),
1602
- images: z39.array(imageSchema).optional(),
1603
- spans: z39.array(spanSchema).optional(),
1604
- text: z39.string()
1614
+ isRemoved: z40.literal(true).optional(),
1615
+ isSilentTurn: z40.literal(true).optional(),
1616
+ kind: z40.string(),
1617
+ message: z40.object({
1618
+ clientMessageId: z40.uuid().optional(),
1619
+ images: z40.array(imageSchema).optional(),
1620
+ spans: z40.array(spanSchema).optional(),
1621
+ text: z40.string()
1605
1622
  }).optional(),
1606
- moment: z39.object({ momentID: z39.string(), shortID: z39.string(), title: z39.string().optional() }).optional(),
1607
- proposal: z39.object({ proposalID: z39.string(), shortID: z39.string() }).optional(),
1623
+ moment: z40.object({ momentID: z40.string(), shortID: z40.string(), title: z40.string().optional() }).optional(),
1624
+ proposal: z40.object({ proposalID: z40.string(), shortID: z40.string() }).optional(),
1608
1625
  recall: recallSchema.optional(),
1609
- recordedAt: z39.date(),
1610
- removal: z39.object({ kind: z39.string(), sequence: sequenceSchema, callSequence: sequenceSchema.optional() }).optional(),
1626
+ recordedAt: z40.date(),
1627
+ removal: z40.object({ kind: z40.string(), sequence: sequenceSchema, callSequence: sequenceSchema.optional() }).optional(),
1611
1628
  sequence: sequenceSchema,
1612
- stop: z39.object({ cancelledActions: z39.array(listedActionSchema) }).optional(),
1629
+ stop: z40.object({ cancelledActions: z40.array(listedActionSchema) }).optional(),
1613
1630
  summary: summarySchema.optional(),
1614
1631
  thread: threadSchema,
1615
1632
  task: taskSchema2.optional(),
@@ -1617,23 +1634,23 @@ var recordSchema = z39.object({
1617
1634
  toolCall: toolCallSchema.optional(),
1618
1635
  worker: workerViewSchema.optional()
1619
1636
  });
1620
- var writerErrorSchema = z39.object({ at: z39.date(), code: z39.string(), message: z39.string().nullable() }).nullable();
1621
- var sessionSchema = z39.object({
1622
- createdAt: z39.date(),
1623
- current: z39.boolean(),
1624
- deviceName: z39.string(),
1625
- lastUsedAt: z39.date(),
1626
- sessionID: z39.uuid()
1637
+ var writerErrorSchema = z40.object({ at: z40.date(), code: z40.string(), message: z40.string().nullable() }).nullable();
1638
+ var sessionSchema = z40.object({
1639
+ createdAt: z40.date(),
1640
+ current: z40.boolean(),
1641
+ deviceName: z40.string(),
1642
+ lastUsedAt: z40.date(),
1643
+ sessionID: z40.uuid()
1627
1644
  });
1628
1645
  var checkedAction = signedIn.errors(reusedIDErrors);
1629
- var forgetPreviewItemSchema = z39.object({ itemID: z39.string(), text: z39.string() });
1630
- var recordForgetPreviewSchema = z39.object({
1646
+ var forgetPreviewItemSchema = z40.object({ itemID: z40.string(), text: z40.string() });
1647
+ var recordForgetPreviewSchema = z40.object({
1631
1648
  momentCount: actionCountSchema,
1632
- memoryItems: z39.array(forgetPreviewItemSchema)
1649
+ memoryItems: z40.array(forgetPreviewItemSchema)
1633
1650
  });
1634
- var controlledTaskSchema = z39.object({
1635
- controlledAt: z39.date(),
1636
- isPauseRequested: z39.boolean(),
1651
+ var controlledTaskSchema = z40.object({
1652
+ controlledAt: z40.date(),
1653
+ isPauseRequested: z40.boolean(),
1637
1654
  state: taskStateSchema,
1638
1655
  taskID: threadSchema
1639
1656
  });
@@ -1642,68 +1659,68 @@ var taskControl = checkedAction.errors({
1642
1659
  TASK_STATE_REFUSED: {
1643
1660
  message: "The task is in a state that does not take this control",
1644
1661
  status: 409,
1645
- data: z39.object({ isPauseRequested: z39.boolean(), state: taskStateSchema })
1662
+ data: z40.object({ isPauseRequested: z40.boolean(), state: taskStateSchema })
1646
1663
  },
1647
1664
  RUNNER_LACKS_CONTROL: {
1648
1665
  message: "The runner of the task does not take this control",
1649
1666
  status: 409
1650
1667
  }
1651
- }).input(z39.object({ clientActionID: clientActionIDSchema2, taskID: threadSchema })).output(controlledTaskSchema);
1652
- var markedTaskSchema = z39.object({
1653
- changedAt: z39.date(),
1654
- disposable: z39.boolean(),
1668
+ }).input(z40.object({ clientActionID: clientActionIDSchema2, taskID: threadSchema })).output(controlledTaskSchema);
1669
+ var markedTaskSchema = z40.object({
1670
+ changedAt: z40.date(),
1671
+ disposable: z40.boolean(),
1655
1672
  taskID: threadSchema
1656
1673
  });
1657
- var nixieControl = checkedAction.input(z39.object({ clientActionID: clientActionIDSchema2 })).output(z39.object({ paused: pauseStateSchema }));
1674
+ var nixieControl = checkedAction.input(z40.object({ clientActionID: clientActionIDSchema2 })).output(z40.object({ paused: pauseStateSchema }));
1658
1675
  var spendStopErrors = { SPEND_STOP_STANDS: spendStopStandsError };
1659
- var backupNoticeSchema = z39.object({
1660
- cause: z39.enum(["failed", "missing"]),
1661
- sequence: z39.int().positive(),
1662
- raisedAt: z39.date()
1676
+ var backupNoticeSchema = z40.object({
1677
+ cause: z40.enum(["failed", "missing"]),
1678
+ sequence: z40.int().positive(),
1679
+ raisedAt: z40.date()
1663
1680
  });
1664
- var followRecords = signedIn.input(z39.object({
1681
+ var followRecords = signedIn.input(z40.object({
1665
1682
  afterSequence: sequenceSchema,
1666
- clipPayloads: z39.boolean().optional(),
1683
+ clipPayloads: z40.boolean().optional(),
1667
1684
  thread: threadSchema.optional()
1668
- })).output(eventIterator2(z39.object({ record: recordSchema })));
1685
+ })).output(eventIterator2(z40.object({ record: recordSchema })));
1669
1686
  var contract = {
1670
1687
  conversation: {
1671
- read: signedIn.errors({ THREAD_NOT_FOUND: { message: "No thread has this ID", status: 404 } }).input(z39.object({
1688
+ read: signedIn.errors({ THREAD_NOT_FOUND: { message: "No thread has this ID", status: 404 } }).input(z40.object({
1672
1689
  beforeSequence: sequenceSchema.optional(),
1673
- clipPayloads: z39.boolean().optional(),
1674
- limit: z39.int().min(1).max(200).optional(),
1690
+ clipPayloads: z40.boolean().optional(),
1691
+ limit: z40.int().min(1).max(200).optional(),
1675
1692
  thread: threadSchema
1676
- })).output(z39.object({
1677
- hasEarlier: z39.boolean(),
1693
+ })).output(z40.object({
1694
+ hasEarlier: z40.boolean(),
1678
1695
  readAtSequence: sequenceSchema,
1679
- records: z39.array(recordSchema),
1696
+ records: z40.array(recordSchema),
1680
1697
  lastStepEnd: recordSchema.nullable().optional()
1681
1698
  })),
1682
1699
  send: checkedAction.errors({
1683
1700
  IMAGE_REFUSED: imageRefusedError,
1684
1701
  THREAD_NOT_FOUND: { message: "No thread has this ID", status: 404 }
1685
- }).input(z39.object({
1702
+ }).input(z40.object({
1686
1703
  clientMessageId: clientActionIDSchema2,
1687
1704
  images: imageFilesSchema.optional(),
1688
- spans: z39.array(spanSchema).max(1e5),
1689
- text: z39.string().min(1).max(1e5),
1705
+ spans: z40.array(spanSchema).max(1e5),
1706
+ text: z40.string().min(1).max(1e5),
1690
1707
  thread: threadSchema,
1691
- timeZone: z39.string().min(1).max(100).optional(),
1692
- writtenAt: z39.iso.datetime().optional()
1693
- })).output(z39.object({ duplicate: z39.boolean(), sequence: sequenceSchema })),
1708
+ timeZone: z40.string().min(1).max(100).optional(),
1709
+ writtenAt: z40.iso.datetime().optional()
1710
+ })).output(z40.object({ duplicate: z40.boolean(), sequence: sequenceSchema })),
1694
1711
  retry: checkedAction.errors({
1695
1712
  NOTHING_TO_RETRY: {
1696
1713
  message: "The last turn of the conversation did not fail, or it runs again already",
1697
1714
  status: 409
1698
1715
  }
1699
- }).input(z39.object({ clientActionID: clientActionIDSchema2 })).output(z39.object({ retriedAt: z39.date() })),
1700
- readImage: signedIn.errors({ IMAGE_NOT_FOUND: imageNotFoundError }).input(imageRefSchema).output(z39.file()),
1716
+ }).input(z40.object({ clientActionID: clientActionIDSchema2 })).output(z40.object({ retriedAt: z40.date() })),
1717
+ readImage: signedIn.errors({ IMAGE_NOT_FOUND: imageNotFoundError }).input(imageRefSchema).output(z40.file()),
1701
1718
  previewForget: signedIn.errors({
1702
1719
  RECORD_NOT_FOUND: {
1703
1720
  message: "No record on this thread with its own text that a forget removes has this sequence",
1704
1721
  status: 404
1705
1722
  }
1706
- }).input(z39.object({ thread: threadSchema, sequence: sequenceSchema })).output(recordForgetPreviewSchema),
1723
+ }).input(z40.object({ thread: threadSchema, sequence: sequenceSchema })).output(recordForgetPreviewSchema),
1707
1724
  forget: checkedAction.errors({
1708
1725
  RECORD_NOT_FOUND: {
1709
1726
  message: "No record on this thread with its own text that a forget removes has this sequence",
@@ -1713,23 +1730,23 @@ var contract = {
1713
1730
  message: "The queued action has not run yet. Cancel it, or wait for it to run.",
1714
1731
  status: 409
1715
1732
  }
1716
- }).input(z39.object({
1733
+ }).input(z40.object({
1717
1734
  clientActionID: clientActionIDSchema2,
1718
1735
  sequence: sequenceSchema,
1719
1736
  thread: threadSchema
1720
- })).output(z39.object({ forgottenAt: z39.date(), backup: forgetBackupSchema }))
1737
+ })).output(z40.object({ forgottenAt: z40.date(), backup: forgetBackupSchema }))
1721
1738
  },
1722
1739
  tasks: {
1723
- list: signedIn.input(z39.object({
1724
- definitionID: z39.string().min(1).max(200).optional(),
1725
- states: z39.array(listedStateSchema).min(1).max(11).refine((states) => new Set(states).size === states.length, {
1740
+ list: signedIn.input(z40.object({
1741
+ definitionID: z40.string().min(1).max(200).optional(),
1742
+ states: z40.array(listedStateSchema).min(1).max(11).refine((states) => new Set(states).size === states.length, {
1726
1743
  message: "Each state may appear once"
1727
1744
  }).optional()
1728
- }).optional()).output(z39.object({ readAtSequence: sequenceSchema, tasks: z39.array(listedTaskSchema) })),
1729
- read: signedIn.errors({ TASK_NOT_FOUND: { message: "No task has this ID", status: 404 } }).input(z39.object({ taskID: threadSchema })).output(listedTaskSchema),
1730
- readActions: signedIn.errors({ TASK_NOT_FOUND: { message: "No task has this ID", status: 404 } }).input(z39.object({ taskID: threadSchema })).output(z39.object({
1731
- queued: z39.array(listedActionSchema),
1732
- started: z39.array(listedActionSchema)
1745
+ }).optional()).output(z40.object({ readAtSequence: sequenceSchema, tasks: z40.array(listedTaskSchema) })),
1746
+ read: signedIn.errors({ TASK_NOT_FOUND: { message: "No task has this ID", status: 404 } }).input(z40.object({ taskID: threadSchema })).output(listedTaskSchema),
1747
+ readActions: signedIn.errors({ TASK_NOT_FOUND: { message: "No task has this ID", status: 404 } }).input(z40.object({ taskID: threadSchema })).output(z40.object({
1748
+ queued: z40.array(listedActionSchema),
1749
+ started: z40.array(listedActionSchema)
1733
1750
  })),
1734
1751
  pause: taskControl,
1735
1752
  resume: taskControl.errors(spendStopErrors),
@@ -1749,26 +1766,26 @@ var contract = {
1749
1766
  TASK_STATE_REFUSED: {
1750
1767
  message: "The task is in a state that does not take this change",
1751
1768
  status: 409,
1752
- data: z39.object({ state: taskStateSchema })
1769
+ data: z40.object({ state: taskStateSchema })
1753
1770
  }
1754
- }).input(z39.object({
1771
+ }).input(z40.object({
1755
1772
  clientActionID: clientActionIDSchema2,
1756
- disposable: z39.boolean(),
1773
+ disposable: z40.boolean(),
1757
1774
  taskID: threadSchema
1758
1775
  })).output(markedTaskSchema),
1759
1776
  ...viewContract.tasks
1760
1777
  },
1761
1778
  memory: {
1762
- readVersions: signedIn.input(z39.object({ versions: z39.array(versionRefSchema).min(1).max(100) })).output(z39.object({ versions: z39.array(versionTextSchema) })),
1763
- writerStatus: signedIn.route({ deprecated: true }).output(z39.object({
1764
- isEnabled: z39.boolean(),
1765
- backlog: z39.int().nonnegative(),
1766
- batches: z39.int().nonnegative(),
1779
+ readVersions: signedIn.input(z40.object({ versions: z40.array(versionRefSchema).min(1).max(100) })).output(z40.object({ versions: z40.array(versionTextSchema) })),
1780
+ writerStatus: signedIn.route({ deprecated: true }).output(z40.object({
1781
+ isEnabled: z40.boolean(),
1782
+ backlog: z40.int().nonnegative(),
1783
+ batches: z40.int().nonnegative(),
1767
1784
  cursor: sequenceSchema,
1768
- failures: z39.int().nonnegative(),
1769
- isCatchingUp: z39.boolean(),
1785
+ failures: z40.int().nonnegative(),
1786
+ isCatchingUp: z40.boolean(),
1770
1787
  lastError: writerErrorSchema,
1771
- retryAt: z39.date().nullable()
1788
+ retryAt: z40.date().nullable()
1772
1789
  })),
1773
1790
  ...memoryViewContract
1774
1791
  },
@@ -1776,10 +1793,17 @@ var contract = {
1776
1793
  read: signedIn.errors({
1777
1794
  FILE_NOT_FOUND: { message: "No code-run file has this ID", status: 404 },
1778
1795
  FILE_FORGOTTEN: { message: "A forget made this file unreadable", status: 410 }
1779
- }).input(z39.object({ file: z39.string().min(1).max(100) })).output(z39.file())
1796
+ }).input(z40.object({ file: z40.string().min(1).max(100) })).output(z40.file()),
1797
+ list: signedIn.input(z40.object({
1798
+ cursor: z40.string().max(100).regex(/^\d+:\d+$/u).optional(),
1799
+ kind: z40.enum(["image", "other"]).optional()
1800
+ })).output(z40.object({
1801
+ files: z40.array(codeFileSchema).max(30),
1802
+ nextCursor: z40.string().nullable()
1803
+ }))
1780
1804
  },
1781
1805
  nixie: {
1782
- read: signedIn.output(z39.object({ paused: pauseStateSchema })),
1806
+ read: signedIn.output(z40.object({ paused: pauseStateSchema })),
1783
1807
  pause: nixieControl,
1784
1808
  resume: nixieControl.errors(spendStopErrors)
1785
1809
  },
@@ -1788,10 +1812,10 @@ var contract = {
1788
1812
  raise: signedIn.input(spendRaiseInputSchema).output(spendRaiseOutputSchema)
1789
1813
  },
1790
1814
  recovery: {
1791
- read: signedIn.output(z39.object({ recovery: recoverySchema }))
1815
+ read: signedIn.output(z40.object({ recovery: recoverySchema }))
1792
1816
  },
1793
1817
  backups: {
1794
- readNotice: signedIn.output(z39.object({ notice: backupNoticeSchema.nullable() }))
1818
+ readNotice: signedIn.output(z40.object({ notice: backupNoticeSchema.nullable() }))
1795
1819
  },
1796
1820
  triggers: viewContract.triggers,
1797
1821
  reminders: remindersContract,
@@ -1812,28 +1836,28 @@ var contract = {
1812
1836
  message: "The enrolment code is unknown, used or lapsed",
1813
1837
  status: 400
1814
1838
  }
1815
- }).input(z39.object({
1839
+ }).input(z40.object({
1816
1840
  clientActionID: clientActionIDSchema2,
1817
- code: z39.string().min(1).max(100),
1818
- deviceName: z39.string().min(1).max(100),
1819
- tokenDelivery: z39.enum(["cookie", "bearer"])
1820
- })).output(z39.object({ sessionID: z39.uuid(), token: z39.string().optional() })),
1821
- issueCode: checkedAction.input(z39.object({ clientActionID: clientActionIDSchema2 })).output(z39.object({ code: z39.string(), expiresAt: z39.date() })),
1822
- list: signedIn.output(z39.object({ sessions: z39.array(sessionSchema) })),
1823
- revoke: checkedAction.errors({ SESSION_NOT_FOUND: { message: "No session has this ID", status: 404 } }).input(z39.object({ clientActionID: clientActionIDSchema2, sessionID: z39.uuid() })).output(z39.object({ revokedAt: z39.date() }))
1841
+ code: z40.string().min(1).max(100),
1842
+ deviceName: z40.string().min(1).max(100),
1843
+ tokenDelivery: z40.enum(["cookie", "bearer"])
1844
+ })).output(z40.object({ sessionID: z40.uuid(), token: z40.string().optional() })),
1845
+ issueCode: checkedAction.input(z40.object({ clientActionID: clientActionIDSchema2 })).output(z40.object({ code: z40.string(), expiresAt: z40.date() })),
1846
+ list: signedIn.output(z40.object({ sessions: z40.array(sessionSchema) })),
1847
+ revoke: checkedAction.errors({ SESSION_NOT_FOUND: { message: "No session has this ID", status: 404 } }).input(z40.object({ clientActionID: clientActionIDSchema2, sessionID: z40.uuid() })).output(z40.object({ revokedAt: z40.date() }))
1824
1848
  }
1825
1849
  };
1826
1850
  // src/contract/host-contract.ts
1827
1851
  import { oc as oc8 } from "@orpc/contract";
1828
- import { z as z50 } from "zod";
1852
+ import { z as z51 } from "zod";
1829
1853
 
1830
1854
  // src/contract/action-proposal-schema.ts
1831
- import { z as z40 } from "zod";
1832
- var actionProposalSchema = z40.object({
1833
- proposalID: z40.string(),
1834
- tool: z40.string(),
1835
- effects: z40.array(z40.string()),
1836
- cause: z40.enum([
1855
+ import { z as z41 } from "zod";
1856
+ var actionProposalSchema = z41.object({
1857
+ proposalID: z41.string(),
1858
+ tool: z41.string(),
1859
+ effects: z41.array(z41.string()),
1860
+ cause: z41.enum([
1837
1861
  "outside_steering",
1838
1862
  "always_ask",
1839
1863
  "ask_rule",
@@ -1841,22 +1865,22 @@ var actionProposalSchema = z40.object({
1841
1865
  "direct_request",
1842
1866
  "repeat"
1843
1867
  ]),
1844
- sentence: z40.string(),
1845
- destinations: z40.array(z40.string()),
1846
- createdAt: z40.date(),
1847
- lapseAt: z40.date()
1868
+ sentence: z41.string(),
1869
+ destinations: z41.array(z41.string()),
1870
+ createdAt: z41.date(),
1871
+ lapseAt: z41.date()
1848
1872
  });
1849
1873
 
1850
1874
  // src/contract/forgotten-items-schema.ts
1851
- import { z as z41 } from "zod";
1852
- var forgottenItemsSchema = z41.object({
1853
- itemIDs: z41.array(z41.string()),
1875
+ import { z as z42 } from "zod";
1876
+ var forgottenItemsSchema = z42.object({
1877
+ itemIDs: z42.array(z42.string()),
1854
1878
  backup: forgetBackupSchema
1855
1879
  });
1856
1880
 
1857
1881
  // src/contract/host-backups-contract.ts
1858
1882
  import { oc as oc3 } from "@orpc/contract";
1859
- import { z as z42 } from "zod";
1883
+ import { z as z43 } from "zod";
1860
1884
  var hostBackupsContract = {
1861
1885
  stage: oc3.errors({
1862
1886
  BACKUP_SET_WAITING: {
@@ -1875,107 +1899,107 @@ var hostBackupsContract = {
1875
1899
  message: "nixie is paused after a restore and stages no backup set until you read `nixie recovery` and run `nixie resume`",
1876
1900
  status: 409
1877
1901
  }
1878
- }).output(z42.object({
1879
- sequence: z42.int().positive(),
1880
- kind: z42.enum(["scheduled", "forget"]),
1881
- stagedAt: z42.date()
1902
+ }).output(z43.object({
1903
+ sequence: z43.int().positive(),
1904
+ kind: z43.enum(["scheduled", "forget"]),
1905
+ stagedAt: z43.date()
1882
1906
  }))
1883
1907
  };
1884
1908
 
1885
1909
  // src/contract/host-budgets-contract.ts
1886
1910
  import { oc as oc4 } from "@orpc/contract";
1887
- import { z as z43 } from "zod";
1911
+ import { z as z44 } from "zod";
1888
1912
  var budgets = oc4.errors({
1889
1913
  BUDGETS_NOT_CONFIGURED: { message: "the server holds no budgets", status: 409 }
1890
1914
  });
1891
- var budgetStatusSchema = z43.object({
1892
- budgetID: z43.string(),
1893
- counts: z43.string(),
1894
- limitMicros: z43.number(),
1895
- period: z43.enum(["day", "week", "month"]),
1896
- spentMicros: z43.number(),
1897
- resetsAt: z43.date(),
1898
- source: z43.enum(["definitions", "built_in"])
1899
- });
1900
- var budgetChargeSchema = z43.object({
1901
- chargeID: z43.string(),
1902
- amountMicros: z43.number(),
1903
- for: z43.object({ kind: z43.string(), id: z43.string() }),
1904
- isCredited: z43.boolean()
1915
+ var budgetStatusSchema = z44.object({
1916
+ budgetID: z44.string(),
1917
+ counts: z44.string(),
1918
+ limitMicros: z44.number(),
1919
+ period: z44.enum(["day", "week", "month"]),
1920
+ spentMicros: z44.number(),
1921
+ resetsAt: z44.date(),
1922
+ source: z44.enum(["definitions", "built_in"])
1923
+ });
1924
+ var budgetChargeSchema = z44.object({
1925
+ chargeID: z44.string(),
1926
+ amountMicros: z44.number(),
1927
+ for: z44.object({ kind: z44.string(), id: z44.string() }),
1928
+ isCredited: z44.boolean()
1905
1929
  });
1906
1930
  var hostBudgetsContract = {
1907
- list: budgets.output(z43.array(budgetStatusSchema)),
1908
- ledger: budgets.errors({ NOT_FOUND: { message: "no budget has that ID", status: 404 } }).input(z43.strictObject({ budgetID: z43.string().min(1) })).output(z43.object({
1909
- budgetID: z43.string(),
1910
- periodStart: z43.string(),
1911
- resetsAt: z43.date(),
1912
- spentMicros: z43.number(),
1913
- charges: z43.array(budgetChargeSchema)
1931
+ list: budgets.output(z44.array(budgetStatusSchema)),
1932
+ ledger: budgets.errors({ NOT_FOUND: { message: "no budget has that ID", status: 404 } }).input(z44.strictObject({ budgetID: z44.string().min(1) })).output(z44.object({
1933
+ budgetID: z44.string(),
1934
+ periodStart: z44.string(),
1935
+ resetsAt: z44.date(),
1936
+ spentMicros: z44.number(),
1937
+ charges: z44.array(budgetChargeSchema)
1914
1938
  }))
1915
1939
  };
1916
1940
 
1917
1941
  // src/contract/host-mandates-contract.ts
1918
1942
  import { oc as oc5 } from "@orpc/contract";
1919
- import { z as z44 } from "zod";
1943
+ import { z as z45 } from "zod";
1920
1944
  var mandates = oc5.errors({
1921
1945
  NOT_FOUND: { message: "no mandate has that ID", status: 404 }
1922
1946
  });
1923
- var hostMandateRuleSchema = z44.object({ ruleID: z44.string(), sentence: z44.string() });
1924
- var hostMandateSchema = z44.object({
1925
- mandateID: z44.string(),
1926
- title: z44.string().nullable(),
1927
- rules: z44.array(hostMandateRuleSchema),
1928
- startedAt: z44.date(),
1929
- expires: z44.date()
1947
+ var hostMandateRuleSchema = z45.object({ ruleID: z45.string(), sentence: z45.string() });
1948
+ var hostMandateSchema = z45.object({
1949
+ mandateID: z45.string(),
1950
+ title: z45.string().nullable(),
1951
+ rules: z45.array(hostMandateRuleSchema),
1952
+ startedAt: z45.date(),
1953
+ expires: z45.date()
1930
1954
  });
1931
1955
  var hostMandatesContract = {
1932
- list: mandates.output(z44.array(hostMandateSchema)),
1933
- end: mandates.input(z44.strictObject({ mandateID: z44.string().min(1) })).output(z44.object({ mandateID: z44.string(), state: z44.enum(["ended", "expired"]) }))
1956
+ list: mandates.output(z45.array(hostMandateSchema)),
1957
+ end: mandates.input(z45.strictObject({ mandateID: z45.string().min(1) })).output(z45.object({ mandateID: z45.string(), state: z45.enum(["ended", "expired"]) }))
1934
1958
  };
1935
1959
 
1936
1960
  // src/contract/host-passkey-contract.ts
1937
1961
  import { oc as oc6 } from "@orpc/contract";
1938
- import { z as z45 } from "zod";
1939
- var hostPasskeySchema = z45.object({
1940
- passkeyID: z45.string(),
1941
- label: z45.string(),
1942
- synced: z45.boolean(),
1943
- origin: z45.string(),
1944
- registeredBy: z45.string(),
1945
- authorizedBy: z45.string(),
1946
- registeredAt: z45.date(),
1947
- lastUsedAt: z45.date().nullable(),
1948
- revokedAt: z45.date().nullable()
1962
+ import { z as z46 } from "zod";
1963
+ var hostPasskeySchema = z46.object({
1964
+ passkeyID: z46.string(),
1965
+ label: z46.string(),
1966
+ synced: z46.boolean(),
1967
+ origin: z46.string(),
1968
+ registeredBy: z46.string(),
1969
+ authorizedBy: z46.string(),
1970
+ registeredAt: z46.date(),
1971
+ lastUsedAt: z46.date().nullable(),
1972
+ revokedAt: z46.date().nullable()
1949
1973
  });
1950
1974
  var hostPasskeyContract = {
1951
- issueCode: oc6.output(z45.object({ code: z45.string(), expiresAt: z45.date() })),
1952
- list: oc6.output(z45.array(hostPasskeySchema)),
1975
+ issueCode: oc6.output(z46.object({ code: z46.string(), expiresAt: z46.date() })),
1976
+ list: oc6.output(z46.array(hostPasskeySchema)),
1953
1977
  revoke: oc6.errors({
1954
1978
  PASSKEY_NOT_FOUND: { message: "no passkey has that ID", status: 404 }
1955
- }).input(z45.strictObject({ passkeyID: z45.string().min(1) })).output(z45.object({ passkeyID: z45.string(), revokedAt: z45.date() }))
1979
+ }).input(z46.strictObject({ passkeyID: z46.string().min(1) })).output(z46.object({ passkeyID: z46.string(), revokedAt: z46.date() }))
1956
1980
  };
1957
1981
 
1958
1982
  // src/contract/known-contact-schema.ts
1959
- import { z as z46 } from "zod";
1960
- var knownContactSchema = z46.object({
1961
- contactID: z46.string(),
1962
- name: z46.string().nullable(),
1963
- destination: z46.string().nullable(),
1964
- markedAt: z46.date()
1983
+ import { z as z47 } from "zod";
1984
+ var knownContactSchema = z47.object({
1985
+ contactID: z47.string(),
1986
+ name: z47.string().nullable(),
1987
+ destination: z47.string().nullable(),
1988
+ markedAt: z47.date()
1965
1989
  });
1966
1990
 
1967
1991
  // src/contract/turn-inputs-contract.ts
1968
1992
  import { oc as oc7 } from "@orpc/contract";
1969
- import { z as z49 } from "zod";
1993
+ import { z as z50 } from "zod";
1970
1994
 
1971
1995
  // src/contract/input-miss-schema.ts
1972
- import { z as z47 } from "zod";
1973
- var inputMissSchema = z47.object({
1974
- missID: z47.string(),
1975
- captureID: z47.string().nullable(),
1976
- taskID: z47.string(),
1977
- stepRunID: z47.string(),
1978
- reason: z47.enum([
1996
+ import { z as z48 } from "zod";
1997
+ var inputMissSchema = z48.object({
1998
+ missID: z48.string(),
1999
+ captureID: z48.string().nullable(),
2000
+ taskID: z48.string(),
2001
+ stepRunID: z48.string(),
2002
+ reason: z48.enum([
1979
2003
  "queue_full",
1980
2004
  "spool_full",
1981
2005
  "spool_write_failed",
@@ -1987,45 +2011,45 @@ var inputMissSchema = z47.object({
1987
2011
  "intake_failed",
1988
2012
  "holds_own_value"
1989
2013
  ]),
1990
- count: z47.int().positive(),
1991
- writer: z47.string().nullable(),
1992
- counter: z47.int().nullable(),
1993
- createdAt: z47.date()
2014
+ count: z48.int().positive(),
2015
+ writer: z48.string().nullable(),
2016
+ counter: z48.int().nullable(),
2017
+ createdAt: z48.date()
1994
2018
  });
1995
2019
 
1996
2020
  // src/contract/logged-input-schema.ts
1997
- import { z as z48 } from "zod";
1998
- var loggedInputSchema = z48.object({
1999
- inputID: z48.string(),
2000
- captureID: z48.string(),
2001
- taskID: z48.string(),
2002
- stepRunID: z48.string(),
2003
- writer: z48.string(),
2004
- counter: z48.int(),
2005
- role: z48.string(),
2006
- profile: z48.string(),
2007
- model: z48.string(),
2008
- harness: z48.string(),
2009
- api: z48.string(),
2010
- endpoint: z48.string(),
2011
- route: z48.string(),
2012
- isRewritten: z48.boolean(),
2013
- upstreamStatus: z48.int(),
2014
- bytes: z48.int(),
2015
- intakeSequence: z48.int(),
2016
- receivedAt: z48.date(),
2017
- takenAt: z48.date(),
2018
- state: z48.enum(["writing", "stored", "missing", "removed"]),
2019
- removedCause: z48.enum(["retention_days", "retention_bytes", "forget", "dropped", "restore", "reset"]).nullable()
2021
+ import { z as z49 } from "zod";
2022
+ var loggedInputSchema = z49.object({
2023
+ inputID: z49.string(),
2024
+ captureID: z49.string(),
2025
+ taskID: z49.string(),
2026
+ stepRunID: z49.string(),
2027
+ writer: z49.string(),
2028
+ counter: z49.int(),
2029
+ role: z49.string(),
2030
+ profile: z49.string(),
2031
+ model: z49.string(),
2032
+ harness: z49.string(),
2033
+ api: z49.string(),
2034
+ endpoint: z49.string(),
2035
+ route: z49.string(),
2036
+ isRewritten: z49.boolean(),
2037
+ upstreamStatus: z49.int(),
2038
+ bytes: z49.int(),
2039
+ intakeSequence: z49.int(),
2040
+ receivedAt: z49.date(),
2041
+ takenAt: z49.date(),
2042
+ state: z49.enum(["writing", "stored", "missing", "removed"]),
2043
+ removedCause: z49.enum(["retention_days", "retention_bytes", "forget", "dropped", "restore", "reset"]).nullable()
2020
2044
  });
2021
2045
 
2022
2046
  // src/contract/turn-inputs-contract.ts
2023
- var turnInputOn = z49.strictObject({
2024
- state: z49.literal("on"),
2025
- forMs: z49.int().positive().nullable()
2047
+ var turnInputOn = z50.strictObject({
2048
+ state: z50.literal("on"),
2049
+ forMs: z50.int().positive().nullable()
2026
2050
  });
2027
- var turnInputOff = z49.strictObject({ state: z49.literal("off"), drop: z49.boolean() });
2028
- var turnInputSetSchema = z49.discriminatedUnion("state", [turnInputOn, turnInputOff]);
2051
+ var turnInputOff = z50.strictObject({ state: z50.literal("off"), drop: z50.boolean() });
2052
+ var turnInputSetSchema = z50.discriminatedUnion("state", [turnInputOn, turnInputOff]);
2029
2053
  var turnInputs = oc7.errors({
2030
2054
  NOT_FOUND: { message: "no logged request has that ID", status: 404 },
2031
2055
  REMOVED: { message: "that request is removed or its body is missing", status: 410 },
@@ -2035,27 +2059,27 @@ var turnInputs = oc7.errors({
2035
2059
  },
2036
2060
  NOT_CONFIGURED: { message: "the turn-input log is not configured", status: 409 }
2037
2061
  });
2038
- var listedInputsSchema = z49.object({
2039
- inputs: z49.array(loggedInputSchema),
2040
- misses: z49.array(inputMissSchema)
2062
+ var listedInputsSchema = z50.object({
2063
+ inputs: z50.array(loggedInputSchema),
2064
+ misses: z50.array(inputMissSchema)
2041
2065
  });
2042
2066
  var turnInputsContract = {
2043
- list: turnInputs.input(z49.strictObject({ limit: z49.int().positive().max(500).default(50) })).output(listedInputsSchema),
2044
- open: turnInputs.input(z49.strictObject({ inputID: z49.string().min(1) })).output(z49.object({ inputID: z49.string(), body: z49.base64() })),
2045
- set: turnInputs.input(turnInputSetSchema).output(z49.object({ state: z49.enum(["on", "off"]), until: z49.number().nullable() }))
2067
+ list: turnInputs.input(z50.strictObject({ limit: z50.int().positive().max(500).default(50) })).output(listedInputsSchema),
2068
+ open: turnInputs.input(z50.strictObject({ inputID: z50.string().min(1) })).output(z50.object({ inputID: z50.string(), body: z50.base64() })),
2069
+ set: turnInputs.input(turnInputSetSchema).output(z50.object({ state: z50.enum(["on", "off"]), until: z50.number().nullable() }))
2046
2070
  };
2047
2071
 
2048
2072
  // src/contract/host-contract.ts
2049
- var versionRefSchema2 = z50.object({ itemID: z50.string(), version: z50.int().positive() });
2050
- var versionTargetSchema2 = z50.strictObject({
2051
- itemID: z50.string().min(1),
2052
- version: z50.int().positive()
2053
- });
2054
- var itemTextSchema = z50.string().max(2000).regex(/\S/u);
2055
- var proposalOriginSchema2 = z50.enum(["owner", "conversation", "task"]);
2056
- var memoryOriginSchema = z50.enum([...proposalOriginSchema2.options, "lapse"]);
2057
- var contentSourceSchema = z50.enum(["owner", "owner_data", "untrusted"]);
2058
- var reviewReasonSchema2 = z50.enum([
2073
+ var versionRefSchema2 = z51.object({ itemID: z51.string(), version: z51.int().positive() });
2074
+ var versionTargetSchema2 = z51.strictObject({
2075
+ itemID: z51.string().min(1),
2076
+ version: z51.int().positive()
2077
+ });
2078
+ var itemTextSchema = z51.string().max(2000).regex(/\S/u);
2079
+ var proposalOriginSchema2 = z51.enum(["owner", "conversation", "task"]);
2080
+ var memoryOriginSchema = z51.enum([...proposalOriginSchema2.options, "lapse"]);
2081
+ var contentSourceSchema = z51.enum(["owner", "owner_data", "untrusted"]);
2082
+ var reviewReasonSchema2 = z51.enum([
2059
2083
  "no_quote",
2060
2084
  "quote_not_typed",
2061
2085
  "quote_in_quoted_block",
@@ -2074,68 +2098,68 @@ var reviewReasonSchema2 = z50.enum([
2074
2098
  "labels",
2075
2099
  "ask_rule"
2076
2100
  ]);
2077
- var proposalSourceSchema2 = z50.object({
2101
+ var proposalSourceSchema2 = z51.object({
2078
2102
  origin: proposalOriginSchema2,
2079
- thread: z50.string().nullable(),
2080
- proposedAt: z50.date()
2081
- });
2082
- var pendingProposalSchema = z50.object({
2083
- proposalID: z50.string(),
2084
- operation: z50.enum(["remember", "retire", "pin"]),
2085
- itemID: z50.string(),
2086
- targetVersion: z50.int().nullable(),
2087
- isPinned: z50.boolean(),
2088
- subject: z50.enum(["owner", "self", "shared"]),
2089
- newSubject: z50.enum(["owner", "self", "shared"]).nullable(),
2090
- kind: z50.enum(["fact", "self"]),
2103
+ thread: z51.string().nullable(),
2104
+ proposedAt: z51.date()
2105
+ });
2106
+ var pendingProposalSchema = z51.object({
2107
+ proposalID: z51.string(),
2108
+ operation: z51.enum(["remember", "retire", "pin"]),
2109
+ itemID: z51.string(),
2110
+ targetVersion: z51.int().nullable(),
2111
+ isPinned: z51.boolean(),
2112
+ subject: z51.enum(["owner", "self", "shared"]),
2113
+ newSubject: z51.enum(["owner", "self", "shared"]).nullable(),
2114
+ kind: z51.enum(["fact", "self"]),
2091
2115
  reason: reviewReasonSchema2,
2092
- actionHash: z50.string(),
2116
+ actionHash: z51.string(),
2093
2117
  origin: proposalOriginSchema2,
2094
2118
  source: contentSourceSchema,
2095
- createdAt: z50.date(),
2096
- lapseAt: z50.date(),
2097
- sources: z50.array(proposalSourceSchema2),
2098
- text: z50.string(),
2099
- quote: z50.string().nullable()
2100
- });
2101
- var closeMatchSchema2 = z50.object({ itemID: z50.string(), version: z50.int(), text: z50.string() });
2102
- var approvalResultSchema = z50.discriminatedUnion("status", [
2103
- z50.object({ status: z50.literal("applied"), itemID: z50.string(), version: z50.int() }),
2104
- z50.object({ status: z50.literal("close_match"), item: closeMatchSchema2 })
2119
+ createdAt: z51.date(),
2120
+ lapseAt: z51.date(),
2121
+ sources: z51.array(proposalSourceSchema2),
2122
+ text: z51.string(),
2123
+ quote: z51.string().nullable()
2124
+ });
2125
+ var closeMatchSchema2 = z51.object({ itemID: z51.string(), version: z51.int(), text: z51.string() });
2126
+ var approvalResultSchema = z51.discriminatedUnion("status", [
2127
+ z51.object({ status: z51.literal("applied"), itemID: z51.string(), version: z51.int() }),
2128
+ z51.object({ status: z51.literal("close_match"), item: closeMatchSchema2 })
2105
2129
  ]);
2106
- var historyVersionSchema = z50.object({
2107
- version: z50.int(),
2108
- change: z50.enum(["created", "edited", "retired", "restored", "undone"]),
2109
- state: z50.enum(["active", "retired"]),
2130
+ var historyVersionSchema = z51.object({
2131
+ version: z51.int(),
2132
+ change: z51.enum(["created", "edited", "retired", "restored", "undone"]),
2133
+ state: z51.enum(["active", "retired"]),
2110
2134
  origin: memoryOriginSchema,
2111
2135
  source: contentSourceSchema,
2112
- recordedAt: z50.date(),
2113
- isRemoved: z50.boolean(),
2114
- isBridge: z50.boolean(),
2115
- status: z50.enum(["readable", "shredded", "unreadable"]),
2116
- text: z50.string().nullable()
2117
- });
2118
- var itemHistorySchema = z50.object({
2119
- itemID: z50.string(),
2120
- subject: z50.enum(["owner", "self", "shared"]),
2121
- kind: z50.enum(["fact", "self"]),
2122
- state: z50.enum(["active", "retired", "forgetting", "forgotten"]),
2123
- versions: z50.array(historyVersionSchema)
2124
- });
2125
- var proposalAnswerSchema = z50.strictObject({
2126
- proposalID: z50.string().min(1),
2127
- actionHash: z50.string().min(1)
2128
- });
2129
- var hostSessionSchema = z50.object({
2130
- sessionID: z50.string(),
2131
- deviceName: z50.string(),
2132
- createdAt: z50.date(),
2133
- lastUsedAt: z50.date()
2134
- });
2135
- var subjectCountSchema = z50.object({
2136
- owner: z50.int().nonnegative(),
2137
- shared: z50.int().nonnegative(),
2138
- self: z50.int().nonnegative()
2136
+ recordedAt: z51.date(),
2137
+ isRemoved: z51.boolean(),
2138
+ isBridge: z51.boolean(),
2139
+ status: z51.enum(["readable", "shredded", "unreadable"]),
2140
+ text: z51.string().nullable()
2141
+ });
2142
+ var itemHistorySchema = z51.object({
2143
+ itemID: z51.string(),
2144
+ subject: z51.enum(["owner", "self", "shared"]),
2145
+ kind: z51.enum(["fact", "self"]),
2146
+ state: z51.enum(["active", "retired", "forgetting", "forgotten"]),
2147
+ versions: z51.array(historyVersionSchema)
2148
+ });
2149
+ var proposalAnswerSchema = z51.strictObject({
2150
+ proposalID: z51.string().min(1),
2151
+ actionHash: z51.string().min(1)
2152
+ });
2153
+ var hostSessionSchema = z51.object({
2154
+ sessionID: z51.string(),
2155
+ deviceName: z51.string(),
2156
+ createdAt: z51.date(),
2157
+ lastUsedAt: z51.date()
2158
+ });
2159
+ var subjectCountSchema = z51.object({
2160
+ owner: z51.int().nonnegative(),
2161
+ shared: z51.int().nonnegative(),
2162
+ self: z51.int().nonnegative()
2139
2163
  });
2140
2164
  var memory = oc8.errors({
2141
2165
  MEMORY_NOT_STARTED: { message: "the memory store has not started yet", status: 503 },
@@ -2150,28 +2174,28 @@ var memory = oc8.errors({
2150
2174
  PIN_EDIT: { message: "a pin takes no edited text", status: 400 },
2151
2175
  SELF_NOTE_REFUSED: { message: "a self-note never takes that change", status: 409 }
2152
2176
  });
2153
- var skillFileSchema = z50.object({ path: z50.string(), text: z50.string() });
2154
- var pendingSkillProposalSchema = z50.object({
2155
- proposalID: z50.string(),
2156
- name: z50.string(),
2157
- skillHash: z50.string(),
2158
- baseHash: z50.string().nullable(),
2159
- files: z50.array(skillFileSchema),
2160
- inForce: z50.object({
2161
- skillHash: z50.string(),
2162
- origin: z50.enum(["definitions", "vendored", "nixie"]),
2163
- files: z50.array(skillFileSchema)
2177
+ var skillFileSchema = z51.object({ path: z51.string(), text: z51.string() });
2178
+ var pendingSkillProposalSchema = z51.object({
2179
+ proposalID: z51.string(),
2180
+ name: z51.string(),
2181
+ skillHash: z51.string(),
2182
+ baseHash: z51.string().nullable(),
2183
+ files: z51.array(skillFileSchema),
2184
+ inForce: z51.object({
2185
+ skillHash: z51.string(),
2186
+ origin: z51.enum(["definitions", "vendored", "nixie"]),
2187
+ files: z51.array(skillFileSchema)
2164
2188
  }).nullable(),
2165
- untypedToken: z50.object({ kind: z50.string(), raw: z50.string() }).nullable(),
2166
- thread: z50.string().nullable(),
2167
- provenance: z50.object({ runID: z50.string(), callID: z50.string(), profile: z50.string() }),
2168
- createdAt: z50.date(),
2169
- lapseAt: z50.date(),
2170
- isStale: z50.boolean()
2189
+ untypedToken: z51.object({ kind: z51.string(), raw: z51.string() }).nullable(),
2190
+ thread: z51.string().nullable(),
2191
+ provenance: z51.object({ runID: z51.string(), callID: z51.string(), profile: z51.string() }),
2192
+ createdAt: z51.date(),
2193
+ lapseAt: z51.date(),
2194
+ isStale: z51.boolean()
2171
2195
  });
2172
- var skillAnswerSchema = z50.strictObject({
2173
- proposalID: z50.string().min(1),
2174
- skillHash: z50.string().min(1)
2196
+ var skillAnswerSchema = z51.strictObject({
2197
+ proposalID: z51.string().min(1),
2198
+ skillHash: z51.string().min(1)
2175
2199
  });
2176
2200
  var skills = oc8.errors({
2177
2201
  NOT_FOUND: { message: "nothing has that ID", status: 404 },
@@ -2181,38 +2205,38 @@ var skills = oc8.errors({
2181
2205
  SKILL_CHECK: { message: "the files fail the seed checks", status: 400 },
2182
2206
  WRONG_STATE: { message: "the skill nixie wrote is no longer in force", status: 409 }
2183
2207
  });
2184
- var definitionsSkillSchema = z50.object({ skillHash: z50.string(), origin: z50.enum(["definitions", "vendored"]) }).nullable();
2185
- var writtenSkillSchema = z50.object({
2186
- approvalID: z50.string(),
2187
- proposalID: z50.string(),
2188
- name: z50.string(),
2189
- skillHash: z50.string(),
2208
+ var definitionsSkillSchema = z51.object({ skillHash: z51.string(), origin: z51.enum(["definitions", "vendored"]) }).nullable();
2209
+ var writtenSkillSchema = z51.object({
2210
+ approvalID: z51.string(),
2211
+ proposalID: z51.string(),
2212
+ name: z51.string(),
2213
+ skillHash: z51.string(),
2190
2214
  base: definitionsSkillSchema,
2191
2215
  definitions: definitionsSkillSchema,
2192
- isConflict: z50.boolean(),
2193
- pullRequestURL: z50.url().nullable(),
2194
- approvedAt: z50.date()
2195
- });
2196
- var promptPartFileSchema = z50.object({ path: z50.string(), text: z50.string() });
2197
- var promptEntrySchema = z50.record(z50.string(), z50.string());
2198
- var pendingPromptProposalSchema = z50.object({
2199
- proposalID: z50.string(),
2200
- promptID: z50.string(),
2201
- proposalHash: z50.string(),
2202
- baseHash: z50.string().nullable(),
2216
+ isConflict: z51.boolean(),
2217
+ pullRequestURL: z51.url().nullable(),
2218
+ approvedAt: z51.date()
2219
+ });
2220
+ var promptPartFileSchema = z51.object({ path: z51.string(), text: z51.string() });
2221
+ var promptEntrySchema = z51.record(z51.string(), z51.string());
2222
+ var pendingPromptProposalSchema = z51.object({
2223
+ proposalID: z51.string(),
2224
+ promptID: z51.string(),
2225
+ proposalHash: z51.string(),
2226
+ baseHash: z51.string().nullable(),
2203
2227
  entry: promptEntrySchema,
2204
- files: z50.array(promptPartFileSchema),
2205
- reason: z50.string(),
2206
- inForce: z50.object({ parts: promptEntrySchema, template: z50.string().nullable() }).nullable(),
2207
- thread: z50.string().nullable(),
2208
- provenance: z50.object({ runID: z50.string(), callID: z50.string(), profile: z50.string() }),
2209
- createdAt: z50.date(),
2210
- lapseAt: z50.date(),
2211
- isStale: z50.boolean()
2212
- });
2213
- var promptAnswerSchema = z50.strictObject({
2214
- proposalID: z50.string().min(1),
2215
- proposalHash: z50.string().min(1)
2228
+ files: z51.array(promptPartFileSchema),
2229
+ reason: z51.string(),
2230
+ inForce: z51.object({ parts: promptEntrySchema, template: z51.string().nullable() }).nullable(),
2231
+ thread: z51.string().nullable(),
2232
+ provenance: z51.object({ runID: z51.string(), callID: z51.string(), profile: z51.string() }),
2233
+ createdAt: z51.date(),
2234
+ lapseAt: z51.date(),
2235
+ isStale: z51.boolean()
2236
+ });
2237
+ var promptAnswerSchema = z51.strictObject({
2238
+ proposalID: z51.string().min(1),
2239
+ proposalHash: z51.string().min(1)
2216
2240
  });
2217
2241
  var prompts = oc8.errors({
2218
2242
  NOT_FOUND: { message: "nothing has that ID", status: 404 },
@@ -2221,49 +2245,49 @@ var prompts = oc8.errors({
2221
2245
  STALE_BASE: { message: "the override in force moved past the proposal", status: 409 },
2222
2246
  PROMPT_CHECK: { message: "the override fails the definitions checks", status: 400 }
2223
2247
  });
2224
- var ruleVersionSchema = z50.object({ ruleHash: z50.string(), sentence: z50.string() }).nullable();
2225
- var ruleInForceSchema = z50.object({
2226
- ruleID: z50.string(),
2227
- revision: z50.int().positive(),
2228
- ruleHash: z50.string(),
2229
- sentence: z50.string(),
2230
- origin: z50.enum(["definitions", "nixie"]),
2231
- changeID: z50.string().nullable(),
2232
- lastFiredAt: z50.date().nullable()
2233
- });
2234
- var ruleConflictSchema = z50.object({
2235
- ruleID: z50.string(),
2236
- changeID: z50.string(),
2248
+ var ruleVersionSchema = z51.object({ ruleHash: z51.string(), sentence: z51.string() }).nullable();
2249
+ var ruleInForceSchema = z51.object({
2250
+ ruleID: z51.string(),
2251
+ revision: z51.int().positive(),
2252
+ ruleHash: z51.string(),
2253
+ sentence: z51.string(),
2254
+ origin: z51.enum(["definitions", "nixie"]),
2255
+ changeID: z51.string().nullable(),
2256
+ lastFiredAt: z51.date().nullable()
2257
+ });
2258
+ var ruleConflictSchema = z51.object({
2259
+ ruleID: z51.string(),
2260
+ changeID: z51.string(),
2237
2261
  nixie: ruleVersionSchema,
2238
2262
  repo: ruleVersionSchema,
2239
2263
  base: ruleVersionSchema,
2240
- changedBy: z50.enum(["owner", "nixie"]),
2241
- reason: z50.string(),
2242
- changedAt: z50.date()
2264
+ changedBy: z51.enum(["owner", "nixie"]),
2265
+ reason: z51.string(),
2266
+ changedAt: z51.date()
2243
2267
  });
2244
- var ruleProposalChangeSchema = z50.object({
2245
- ruleID: z50.string(),
2268
+ var ruleProposalChangeSchema = z51.object({
2269
+ ruleID: z51.string(),
2246
2270
  before: ruleVersionSchema,
2247
2271
  after: ruleVersionSchema
2248
2272
  });
2249
- var effectChangeSchema = z50.object({
2250
- tool: z50.string(),
2251
- remove: z50.array(z50.string()),
2252
- sentence: z50.string()
2273
+ var effectChangeSchema = z51.object({
2274
+ tool: z51.string(),
2275
+ remove: z51.array(z51.string()),
2276
+ sentence: z51.string()
2253
2277
  });
2254
- var pendingRuleProposalSchema = z50.object({
2255
- proposalID: z50.string(),
2256
- changes: z50.array(ruleProposalChangeSchema),
2257
- effectChanges: z50.array(effectChangeSchema),
2258
- createdAt: z50.date(),
2259
- lapseAt: z50.date()
2278
+ var pendingRuleProposalSchema = z51.object({
2279
+ proposalID: z51.string(),
2280
+ changes: z51.array(ruleProposalChangeSchema),
2281
+ effectChanges: z51.array(effectChangeSchema),
2282
+ createdAt: z51.date(),
2283
+ lapseAt: z51.date()
2260
2284
  });
2261
- var ruleProposalAnswerSchema = z50.strictObject({ proposalID: z50.string().min(1) });
2285
+ var ruleProposalAnswerSchema = z51.strictObject({ proposalID: z51.string().min(1) });
2262
2286
  var ruleProposalRejectionSchema = ruleProposalAnswerSchema.extend({
2263
- reason: z50.string().max(500).regex(/\S/u)
2287
+ reason: z51.string().max(500).regex(/\S/u)
2264
2288
  });
2265
2289
  var actionRejectionSchema = ruleProposalAnswerSchema.extend({
2266
- reason: z50.string().max(500).regex(/\S/u).optional()
2290
+ reason: z51.string().max(500).regex(/\S/u).optional()
2267
2291
  });
2268
2292
  var ruleProposalErrors = {
2269
2293
  NOT_FOUND: { message: "nothing has that ID", status: 404 },
@@ -2277,7 +2301,7 @@ var definitions = oc8.errors({
2277
2301
  var contacts = oc8.errors({
2278
2302
  NOT_FOUND: { message: "no known contact has that ID", status: 404 }
2279
2303
  });
2280
- var hostTaskStateSchema = z50.enum([
2304
+ var hostTaskStateSchema = z51.enum([
2281
2305
  "ready",
2282
2306
  "running",
2283
2307
  "waiting",
@@ -2298,39 +2322,39 @@ var taskControl2 = oc8.errors({
2298
2322
  message: "the runner of the task does not take this control",
2299
2323
  status: 409
2300
2324
  }
2301
- }).input(z50.strictObject({ taskID: z50.string().min(1) })).output(z50.object({
2302
- taskID: z50.string(),
2325
+ }).input(z51.strictObject({ taskID: z51.string().min(1) })).output(z51.object({
2326
+ taskID: z51.string(),
2303
2327
  state: hostTaskStateSchema,
2304
- isPauseRequested: z50.boolean()
2328
+ isPauseRequested: z51.boolean()
2305
2329
  }));
2306
2330
  var hostContract = {
2307
- reset: oc8.output(z50.object({
2308
- resetAt: z50.date(),
2309
- lastSequence: z50.int().nonnegative(),
2310
- keptSessions: z50.int().nonnegative()
2331
+ reset: oc8.output(z51.object({
2332
+ resetAt: z51.date(),
2333
+ lastSequence: z51.int().nonnegative(),
2334
+ keptSessions: z51.int().nonnegative()
2311
2335
  })),
2312
- resetConversations: oc8.output(z50.object({
2313
- resetAt: z50.date(),
2314
- lastSequence: z50.int().nonnegative(),
2315
- shreddedRecords: z50.int().nonnegative(),
2336
+ resetConversations: oc8.output(z51.object({
2337
+ resetAt: z51.date(),
2338
+ lastSequence: z51.int().nonnegative(),
2339
+ shreddedRecords: z51.int().nonnegative(),
2316
2340
  backup: forgetBackupSchema
2317
2341
  })),
2318
2342
  nixie: {
2319
- pause: oc8.output(z50.object({ paused: pauseStateSchema })),
2320
- resume: oc8.errors(spendStopErrors2).output(z50.object({ paused: pauseStateSchema }))
2343
+ pause: oc8.output(z51.object({ paused: pauseStateSchema })),
2344
+ resume: oc8.errors(spendStopErrors2).output(z51.object({ paused: pauseStateSchema }))
2321
2345
  },
2322
2346
  spend: {
2323
2347
  raise: oc8.errors({
2324
2348
  SPEND_NOT_CONFIGURED: { message: "the config sets no spendStop", status: 409 }
2325
- }).input(z50.strictObject({ turns: z50.int().positive() })).output(z50.object({
2326
- start: z50.string(),
2327
- dollars: z50.number(),
2328
- tokens: z50.number(),
2329
- turns: z50.number()
2349
+ }).input(z51.strictObject({ turns: z51.int().positive() })).output(z51.object({
2350
+ start: z51.string(),
2351
+ dollars: z51.number(),
2352
+ tokens: z51.number(),
2353
+ turns: z51.number()
2330
2354
  }))
2331
2355
  },
2332
2356
  recovery: {
2333
- read: oc8.output(z50.object({ recovery: recoverySchema }))
2357
+ read: oc8.output(z51.object({ recovery: recoverySchema }))
2334
2358
  },
2335
2359
  backups: hostBackupsContract,
2336
2360
  tasks: {
@@ -2350,110 +2374,110 @@ var hostContract = {
2350
2374
  TASK_NOT_FOUND: { message: "no task has that ID", status: 404 },
2351
2375
  TASK_NOT_AT_LIMIT: { message: "the task is not paused at its limit", status: 409 },
2352
2376
  LIMIT_NOT_RAISED: { message: "the new limits are not above the old ones", status: 409 }
2353
- }).input(z50.strictObject({
2354
- taskID: z50.string().min(1),
2355
- turns: z50.int().positive().optional(),
2356
- dollars: z50.number().positive().optional()
2377
+ }).input(z51.strictObject({
2378
+ taskID: z51.string().min(1),
2379
+ turns: z51.int().positive().optional(),
2380
+ dollars: z51.number().positive().optional()
2357
2381
  }).refine((input) => input.turns !== undefined || input.dollars !== undefined, {
2358
2382
  message: "a raise sets turns, dollars or both"
2359
- })).output(z50.object({
2360
- taskID: z50.string(),
2383
+ })).output(z51.object({
2384
+ taskID: z51.string(),
2361
2385
  state: hostTaskStateSchema,
2362
- isPauseRequested: z50.boolean(),
2363
- turns: z50.int().positive(),
2364
- dollars: z50.number().positive()
2386
+ isPauseRequested: z51.boolean(),
2387
+ turns: z51.int().positive(),
2388
+ dollars: z51.number().positive()
2365
2389
  }))
2366
2390
  },
2367
2391
  sessions: {
2368
- issueCode: oc8.output(z50.object({ code: z50.string(), expiresAt: z50.date() })),
2369
- list: oc8.output(z50.array(hostSessionSchema)),
2392
+ issueCode: oc8.output(z51.object({ code: z51.string(), expiresAt: z51.date() })),
2393
+ list: oc8.output(z51.array(hostSessionSchema)),
2370
2394
  label: oc8.errors({
2371
2395
  SESSION_NOT_FOUND: {
2372
2396
  message: "no device session that is still signed in has that ID",
2373
2397
  status: 404
2374
2398
  },
2375
2399
  LABEL_INVALID: { message: "a label holds 1 to 100 characters besides spaces", status: 400 }
2376
- }).input(z50.strictObject({ sessionID: z50.string().min(1), label: z50.string() })).output(z50.object({ sessionID: z50.string(), label: z50.string() }))
2400
+ }).input(z51.strictObject({ sessionID: z51.string().min(1), label: z51.string() })).output(z51.object({ sessionID: z51.string(), label: z51.string() }))
2377
2401
  },
2378
2402
  passkeys: hostPasskeyContract,
2379
2403
  memory: {
2380
2404
  proposals: {
2381
- list: memory.output(z50.array(pendingProposalSchema)),
2405
+ list: memory.output(z51.array(pendingProposalSchema)),
2382
2406
  approve: memory.input(proposalAnswerSchema.extend({
2383
2407
  revisionOf: versionTargetSchema2.optional(),
2384
- ignoreCloseMatch: z50.boolean().optional(),
2408
+ ignoreCloseMatch: z51.boolean().optional(),
2385
2409
  editedText: itemTextSchema.optional()
2386
2410
  })).output(approvalResultSchema),
2387
- reject: memory.input(proposalAnswerSchema.extend({ reason: z50.string().max(500).regex(/\S/u).optional() })).output(z50.object({ proposalID: z50.string() }))
2411
+ reject: memory.input(proposalAnswerSchema.extend({ reason: z51.string().max(500).regex(/\S/u).optional() })).output(z51.object({ proposalID: z51.string() }))
2388
2412
  },
2389
- subjects: memory.output(z50.object({ items: subjectCountSchema, proposals: subjectCountSchema })),
2413
+ subjects: memory.output(z51.object({ items: subjectCountSchema, proposals: subjectCountSchema })),
2390
2414
  items: {
2391
- read: memory.input(z50.strictObject({ itemID: z50.string().min(1) })).output(itemHistorySchema),
2415
+ read: memory.input(z51.strictObject({ itemID: z51.string().min(1) })).output(itemHistorySchema),
2392
2416
  edit: memory.input(versionTargetSchema2.extend({ text: itemTextSchema })).output(versionRefSchema2),
2393
2417
  retire: memory.input(versionTargetSchema2).output(versionRefSchema2),
2394
2418
  restore: memory.input(versionTargetSchema2).output(versionRefSchema2),
2395
- forget: memory.input(versionTargetSchema2).output(z50.object({ itemID: z50.string(), backup: forgetBackupSchema })),
2419
+ forget: memory.input(versionTargetSchema2).output(z51.object({ itemID: z51.string(), backup: forgetBackupSchema })),
2396
2420
  forgetAll: memory.output(forgottenItemsSchema),
2397
- pin: memory.input(z50.strictObject({ itemID: z50.string().min(1), isPinned: z50.boolean() })).output(z50.object({ itemID: z50.string(), isPinned: z50.boolean() }))
2421
+ pin: memory.input(z51.strictObject({ itemID: z51.string().min(1), isPinned: z51.boolean() })).output(z51.object({ itemID: z51.string(), isPinned: z51.boolean() }))
2398
2422
  }
2399
2423
  },
2400
2424
  skills: {
2401
2425
  proposals: {
2402
- list: skills.output(z50.array(pendingSkillProposalSchema)),
2403
- approve: skills.input(skillAnswerSchema.extend({ files: z50.array(skillFileSchema).min(1).optional() })).output(z50.object({ proposalID: z50.string(), approvalID: z50.string(), skillHash: z50.string() })),
2404
- reject: skills.input(skillAnswerSchema.extend({ reason: z50.string().max(500).regex(/\S/u) })).output(z50.object({ proposalID: z50.string() }))
2426
+ list: skills.output(z51.array(pendingSkillProposalSchema)),
2427
+ approve: skills.input(skillAnswerSchema.extend({ files: z51.array(skillFileSchema).min(1).optional() })).output(z51.object({ proposalID: z51.string(), approvalID: z51.string(), skillHash: z51.string() })),
2428
+ reject: skills.input(skillAnswerSchema.extend({ reason: z51.string().max(500).regex(/\S/u) })).output(z51.object({ proposalID: z51.string() }))
2405
2429
  },
2406
2430
  written: {
2407
- list: skills.output(z50.array(writtenSkillSchema)),
2408
- resolve: skills.input(z50.strictObject({
2409
- approvalID: z50.string().min(1),
2410
- keep: z50.enum(["nixie", "definitions"])
2411
- })).output(z50.object({ approvalID: z50.string(), keep: z50.enum(["nixie", "definitions"]) }))
2431
+ list: skills.output(z51.array(writtenSkillSchema)),
2432
+ resolve: skills.input(z51.strictObject({
2433
+ approvalID: z51.string().min(1),
2434
+ keep: z51.enum(["nixie", "definitions"])
2435
+ })).output(z51.object({ approvalID: z51.string(), keep: z51.enum(["nixie", "definitions"]) }))
2412
2436
  }
2413
2437
  },
2414
2438
  rules: {
2415
- list: rules.output(z50.array(ruleInForceSchema)),
2416
- conflicts: rules.output(z50.array(ruleConflictSchema)),
2417
- resolve: rules.input(z50.strictObject({ ruleID: z50.string().min(1), keep: z50.enum(["nixie", "repo"]) })).output(z50.object({ ruleID: z50.string(), changeID: z50.string(), keep: z50.enum(["nixie", "repo"]) })),
2439
+ list: rules.output(z51.array(ruleInForceSchema)),
2440
+ conflicts: rules.output(z51.array(ruleConflictSchema)),
2441
+ resolve: rules.input(z51.strictObject({ ruleID: z51.string().min(1), keep: z51.enum(["nixie", "repo"]) })).output(z51.object({ ruleID: z51.string(), changeID: z51.string(), keep: z51.enum(["nixie", "repo"]) })),
2418
2442
  proposals: {
2419
- list: rules.output(z50.array(pendingRuleProposalSchema)),
2420
- approve: rules.input(ruleProposalAnswerSchema).output(z50.object({ proposalID: z50.string() })),
2421
- reject: rules.input(ruleProposalRejectionSchema).output(z50.object({ proposalID: z50.string() }))
2443
+ list: rules.output(z51.array(pendingRuleProposalSchema)),
2444
+ approve: rules.input(ruleProposalAnswerSchema).output(z51.object({ proposalID: z51.string() })),
2445
+ reject: rules.input(ruleProposalRejectionSchema).output(z51.object({ proposalID: z51.string() }))
2422
2446
  }
2423
2447
  },
2424
2448
  definitions: {
2425
- resolve: definitions.input(z50.strictObject({ definitionID: z50.string().min(1), keep: z50.enum(["nixie", "repo"]) })).output(z50.object({
2426
- definitionID: z50.string(),
2427
- changeID: z50.string(),
2428
- keep: z50.enum(["nixie", "repo"])
2449
+ resolve: definitions.input(z51.strictObject({ definitionID: z51.string().min(1), keep: z51.enum(["nixie", "repo"]) })).output(z51.object({
2450
+ definitionID: z51.string(),
2451
+ changeID: z51.string(),
2452
+ keep: z51.enum(["nixie", "repo"])
2429
2453
  }))
2430
2454
  },
2431
2455
  actions: {
2432
2456
  proposals: {
2433
- list: rules.output(z50.array(actionProposalSchema)),
2434
- approve: rules.input(ruleProposalAnswerSchema).output(z50.object({ proposalID: z50.string() })),
2435
- reject: rules.input(actionRejectionSchema).output(z50.object({ proposalID: z50.string() }))
2457
+ list: rules.output(z51.array(actionProposalSchema)),
2458
+ approve: rules.input(ruleProposalAnswerSchema).output(z51.object({ proposalID: z51.string() })),
2459
+ reject: rules.input(actionRejectionSchema).output(z51.object({ proposalID: z51.string() }))
2436
2460
  }
2437
2461
  },
2438
2462
  mandates: hostMandatesContract,
2439
2463
  budgets: hostBudgetsContract,
2440
2464
  contacts: {
2441
- list: contacts.output(z50.array(knownContactSchema)),
2442
- markKnown: contacts.input(z50.strictObject({
2443
- destination: z50.string().min(1).max(500),
2444
- name: z50.string().min(1).max(200).optional()
2445
- })).output(z50.object({ contact: knownContactSchema, isNew: z50.boolean() })),
2446
- unmark: contacts.input(z50.strictObject({ contactID: z50.string().min(1) })).output(z50.object({ contactID: z50.string() }))
2465
+ list: contacts.output(z51.array(knownContactSchema)),
2466
+ markKnown: contacts.input(z51.strictObject({
2467
+ destination: z51.string().min(1).max(500),
2468
+ name: z51.string().min(1).max(200).optional()
2469
+ })).output(z51.object({ contact: knownContactSchema, isNew: z51.boolean() })),
2470
+ unmark: contacts.input(z51.strictObject({ contactID: z51.string().min(1) })).output(z51.object({ contactID: z51.string() }))
2447
2471
  },
2448
2472
  turnInputs: turnInputsContract,
2449
2473
  prompts: {
2450
2474
  proposals: {
2451
- list: prompts.output(z50.array(pendingPromptProposalSchema)),
2475
+ list: prompts.output(z51.array(pendingPromptProposalSchema)),
2452
2476
  approve: prompts.input(promptAnswerSchema.extend({
2453
2477
  entry: promptEntrySchema.optional(),
2454
- files: z50.array(promptPartFileSchema).optional()
2455
- })).output(z50.object({ proposalID: z50.string(), approvalID: z50.string(), proposalHash: z50.string() })),
2456
- reject: prompts.input(promptAnswerSchema.extend({ reason: z50.string().max(500).regex(/\S/u) })).output(z50.object({ proposalID: z50.string() }))
2478
+ files: z51.array(promptPartFileSchema).optional()
2479
+ })).output(z51.object({ proposalID: z51.string(), approvalID: z51.string(), proposalHash: z51.string() })),
2480
+ reject: prompts.input(promptAnswerSchema.extend({ reason: z51.string().max(500).regex(/\S/u) })).output(z51.object({ proposalID: z51.string() }))
2457
2481
  }
2458
2482
  }
2459
2483
  };
@@ -2562,25 +2586,25 @@ function renderSessionCookie(token) {
2562
2586
  return `${sessionCookieName}=${token ?? ""}; Path=/; HttpOnly; Secure; SameSite=Lax; Max-Age=${maxAgeS}`;
2563
2587
  }
2564
2588
  // src/file/file-send-input-schema.ts
2565
- import { z as z51 } from "zod";
2566
- var fileSendInputSchema = z51.object({
2567
- file: z51.string().min(1).max(100),
2568
- caption: z51.string().min(1).max(1000).optional()
2589
+ import { z as z52 } from "zod";
2590
+ var fileSendInputSchema = z52.object({
2591
+ file: z52.string().min(1).max(100),
2592
+ caption: z52.string().min(1).max(1000).optional()
2569
2593
  });
2570
2594
  // src/file/file-send-result-schema.ts
2571
- import { z as z52 } from "zod";
2572
- var fileSendResultSchema = z52.object({
2573
- file: z52.string(),
2574
- name: z52.string(),
2575
- bytes: z52.int().nonnegative(),
2576
- mediaType: z52.string()
2595
+ import { z as z53 } from "zod";
2596
+ var fileSendResultSchema = z53.object({
2597
+ file: z53.string(),
2598
+ name: z53.string(),
2599
+ bytes: z53.int().nonnegative(),
2600
+ mediaType: z53.string()
2577
2601
  });
2578
2602
  // src/message/task-message-input-schema.ts
2579
- import { z as z54 } from "zod";
2603
+ import { z as z55 } from "zod";
2580
2604
 
2581
2605
  // src/message/task-message-kind-schema.ts
2582
- import { z as z53 } from "zod";
2583
- var taskMessageKindSchema = z53.enum([
2606
+ import { z as z54 } from "zod";
2607
+ var taskMessageKindSchema = z54.enum([
2584
2608
  "progress",
2585
2609
  "question",
2586
2610
  "request",
@@ -2590,21 +2614,21 @@ var taskMessageKindSchema = z53.enum([
2590
2614
  ]);
2591
2615
 
2592
2616
  // src/message/task-message-input-schema.ts
2593
- var taskMessageInputSchema = z54.object({
2594
- to: z54.string(),
2617
+ var taskMessageInputSchema = z55.object({
2618
+ to: z55.string(),
2595
2619
  kind: taskMessageKindSchema,
2596
- body: z54.string(),
2597
- replyTo: z54.string().optional(),
2598
- onBehalfOf: z54.string().array().optional(),
2599
- wake: z54.boolean().optional()
2620
+ body: z55.string(),
2621
+ replyTo: z55.string().optional(),
2622
+ onBehalfOf: z55.string().array().optional(),
2623
+ wake: z55.boolean().optional()
2600
2624
  });
2601
2625
  // src/message/task-message-result-schema.ts
2602
- import { z as z55 } from "zod";
2603
- var taskMessageResultSchema = z55.object({
2604
- messageID: z55.string(),
2605
- woke: z55.boolean(),
2606
- hop: z55.int().nonnegative(),
2607
- note: z55.string().optional()
2626
+ import { z as z56 } from "zod";
2627
+ var taskMessageResultSchema = z56.object({
2628
+ messageID: z56.string(),
2629
+ woke: z56.boolean(),
2630
+ hop: z56.int().nonnegative(),
2631
+ note: z56.string().optional()
2608
2632
  });
2609
2633
  export {
2610
2634
  buildPendingInput,