@heynixie/contract 0.72.0 → 0.74.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -153,11 +153,11 @@ var forgettableKinds = [
153
153
  "action.outcome",
154
154
  "action.queued",
155
155
  "action.retry_scheduled",
156
- "memory.writer_failed",
157
156
  "model.compaction_failed",
158
157
  "model.reply",
159
158
  "model.session_summarized",
160
159
  "owner_message",
160
+ "passkey.registered",
161
161
  "policy.action_answered",
162
162
  "policy.action_proposed",
163
163
  "policy.contact_marked_known",
@@ -177,7 +177,7 @@ var forgettableKinds = [
177
177
  ];
178
178
  // src/contract/contract.ts
179
179
  import { eventIterator as eventIterator2, oc as oc2 } from "@orpc/contract";
180
- import { z as z13 } from "zod";
180
+ import { z as z26 } from "zod";
181
181
 
182
182
  // src/span/span-schema.ts
183
183
  import { z } from "zod";
@@ -188,24 +188,51 @@ var spanSchema = z.object({
188
188
  });
189
189
 
190
190
  // src/contract/approval-contract.ts
191
- import { z as z6 } from "zod";
191
+ import { z as z11 } from "zod";
192
+
193
+ // src/contract/authentication-response-schema.ts
194
+ import { z as z3 } from "zod";
195
+
196
+ // src/contract/base64-url-schema.ts
197
+ import { z as z2 } from "zod";
198
+ var base64URLSchema = z2.string().min(1).max(20000);
199
+
200
+ // src/contract/authentication-response-schema.ts
201
+ var assertionSchema = z3.object({
202
+ clientDataJSON: base64URLSchema,
203
+ authenticatorData: base64URLSchema,
204
+ signature: base64URLSchema,
205
+ userHandle: base64URLSchema.optional()
206
+ });
207
+ var authenticationResponseSchema = z3.object({
208
+ id: base64URLSchema,
209
+ rawId: base64URLSchema,
210
+ response: assertionSchema,
211
+ authenticatorAttachment: z3.enum(["cross-platform", "platform"]).optional(),
212
+ clientExtensionResults: z3.object({}),
213
+ type: z3.literal("public-key")
214
+ });
215
+
216
+ // src/contract/choice-schema.ts
217
+ import { z as z4 } from "zod";
218
+ var choiceSchema = z4.enum(["approve", "always_allow", "defer", "decline"]);
192
219
 
193
220
  // src/contract/memory-view-contract.ts
194
- import { z as z5 } from "zod";
221
+ import { z as z8 } from "zod";
195
222
 
196
223
  // src/contract/forget-backup-schema.ts
197
- import { z as z2 } from "zod";
198
- var forgetBackupSchema = z2.discriminatedUnion("state", [
199
- z2.object({ state: z2.literal("off") }),
200
- z2.object({ state: z2.literal("pending") }),
201
- z2.object({ state: z2.literal("failed"), failure: z2.string() }),
202
- z2.object({ state: z2.literal("complete") }),
203
- z2.object({ state: z2.literal("unknown") })
224
+ import { z as z5 } from "zod";
225
+ var forgetBackupSchema = z5.discriminatedUnion("state", [
226
+ z5.object({ state: z5.literal("off") }),
227
+ z5.object({ state: z5.literal("pending") }),
228
+ z5.object({ state: z5.literal("failed"), failure: z5.string() }),
229
+ z5.object({ state: z5.literal("complete") }),
230
+ z5.object({ state: z5.literal("unknown") })
204
231
  ]);
205
232
 
206
233
  // src/contract/memory-export-contract.ts
207
234
  import { eventIterator } from "@orpc/contract";
208
- import { z as z3 } from "zod";
235
+ import { z as z6 } from "zod";
209
236
 
210
237
  // src/contract/reused-id-errors.ts
211
238
  var reusedIDErrors = {
@@ -225,42 +252,42 @@ var signedIn = oc.errors({
225
252
  var checkedExport = signedIn.errors(reusedIDErrors).errors({
226
253
  MEMORY_NOT_STARTED: { message: "The memory store has not started yet", status: 503 }
227
254
  });
228
- var exportEvent = z3.union([
229
- z3.object({ chunk: z3.string() }),
230
- z3.object({ isComplete: z3.literal(true) })
255
+ var exportEvent = z6.union([
256
+ z6.object({ chunk: z6.string() }),
257
+ z6.object({ isComplete: z6.literal(true) })
231
258
  ]);
232
259
  var exportEvents = eventIterator(exportEvent);
233
260
  var memoryExportContract = {
234
- export: checkedExport.input(z3.object({ clientActionID: z3.uuid() })).output(exportEvents)
261
+ export: checkedExport.input(z6.object({ clientActionID: z6.uuid() })).output(exportEvents)
235
262
  };
236
263
 
237
264
  // src/contract/moment-contract.ts
238
- import { z as z4 } from "zod";
265
+ import { z as z7 } from "zod";
239
266
  var momentView = signedIn.errors({
240
267
  MEMORY_NOT_STARTED: { message: "The memory store has not started yet", status: 503 },
241
268
  MOMENT_NOT_FOUND: { message: "No moment has this ID", status: 404 },
242
269
  STALE_VERSION: { message: "The moment has moved past that version", status: 409 }
243
270
  });
244
- var momentIDSchema = z4.string().min(1).max(200);
245
- var momentTargetSchema = z4.object({ momentID: momentIDSchema, version: z4.int().positive() });
246
- var reflectionSchema = z4.object({
247
- model: z4.string(),
248
- text: z4.string().nullable(),
249
- writtenAt: z4.date()
250
- });
251
- var destroyPreviewSchema = z4.object({
252
- keptAt: z4.date(),
253
- keptBy: z4.enum(["owner", "model"]),
254
- kept: z4.object({ records: z4.int().nonnegative() }),
255
- lost: z4.object({ links: z4.int().nonnegative(), texts: z4.int().nonnegative() }),
256
- momentID: z4.string(),
257
- note: z4.string().nullable(),
258
- reflections: z4.array(reflectionSchema),
259
- shortID: z4.string(),
260
- state: z4.enum(["active", "retired"]),
261
- thread: z4.string(),
262
- title: z4.string().nullable(),
263
- version: z4.int().positive()
271
+ var momentIDSchema = z7.string().min(1).max(200);
272
+ var momentTargetSchema = z7.object({ momentID: momentIDSchema, version: z7.int().positive() });
273
+ var reflectionSchema = z7.object({
274
+ model: z7.string(),
275
+ text: z7.string().nullable(),
276
+ writtenAt: z7.date()
277
+ });
278
+ var destroyPreviewSchema = z7.object({
279
+ keptAt: z7.date(),
280
+ keptBy: z7.enum(["owner", "model"]),
281
+ kept: z7.object({ records: z7.int().nonnegative() }),
282
+ lost: z7.object({ links: z7.int().nonnegative(), texts: z7.int().nonnegative() }),
283
+ momentID: z7.string(),
284
+ note: z7.string().nullable(),
285
+ reflections: z7.array(reflectionSchema),
286
+ shortID: z7.string(),
287
+ state: z7.enum(["active", "retired"]),
288
+ thread: z7.string(),
289
+ title: z7.string().nullable(),
290
+ version: z7.int().positive()
264
291
  });
265
292
  var momentKeep = signedIn.errors(reusedIDErrors).errors({
266
293
  MEMORY_NOT_STARTED: { message: "The memory store has not started yet", status: 503 },
@@ -269,90 +296,90 @@ var momentKeep = signedIn.errors(reusedIDErrors).errors({
269
296
  status: 422
270
297
  }
271
298
  });
272
- var titleSchema = z4.string().min(1).max(120).regex(/\S/u);
273
- var keepSchema = z4.object({
274
- clientActionID: z4.uuid(),
275
- firstSequence: z4.int().nonnegative(),
276
- lastSequence: z4.int().nonnegative(),
277
- thread: z4.string().min(1).max(200),
299
+ var titleSchema = z7.string().min(1).max(120).regex(/\S/u);
300
+ var keepSchema = z7.object({
301
+ clientActionID: z7.uuid(),
302
+ firstSequence: z7.int().nonnegative(),
303
+ lastSequence: z7.int().nonnegative(),
304
+ thread: z7.string().min(1).max(200),
278
305
  title: titleSchema
279
306
  });
280
- var momentSummarySchema = z4.object({
281
- editedAt: z4.date().nullable(),
282
- keptAt: z4.date(),
283
- keptBy: z4.enum(["owner", "model"]),
284
- momentID: z4.string(),
285
- shortID: z4.string(),
286
- state: z4.enum(["active", "retired"]),
287
- title: z4.string().nullable()
288
- });
289
- var momentListSchema = z4.object({
290
- before: z4.int().nonnegative().optional(),
291
- includeRetired: z4.boolean(),
292
- query: z4.string().max(500).optional()
293
- });
294
- var linkSchema = z4.object({
295
- itemID: z4.string(),
296
- shortID: z4.string(),
297
- text: z4.string().nullable()
298
- });
299
- var noteSchema = z4.object({ text: z4.string(), writtenAt: z4.date() });
300
- var shownReflectionSchema = reflectionSchema.extend({ reflectionID: z4.string() });
307
+ var momentSummarySchema = z7.object({
308
+ editedAt: z7.date().nullable(),
309
+ keptAt: z7.date(),
310
+ keptBy: z7.enum(["owner", "model"]),
311
+ momentID: z7.string(),
312
+ shortID: z7.string(),
313
+ state: z7.enum(["active", "retired"]),
314
+ title: z7.string().nullable()
315
+ });
316
+ var momentListSchema = z7.object({
317
+ before: z7.int().nonnegative().optional(),
318
+ includeRetired: z7.boolean(),
319
+ query: z7.string().max(500).optional()
320
+ });
321
+ var linkSchema = z7.object({
322
+ itemID: z7.string(),
323
+ shortID: z7.string(),
324
+ text: z7.string().nullable()
325
+ });
326
+ var noteSchema = z7.object({ text: z7.string(), writtenAt: z7.date() });
327
+ var shownReflectionSchema = reflectionSchema.extend({ reflectionID: z7.string() });
301
328
  var momentDetailSchema = momentSummarySchema.extend({
302
- firstSequence: z4.int().nonnegative(),
303
- lastSequence: z4.int().nonnegative(),
304
- links: z4.array(linkSchema),
329
+ firstSequence: z7.int().nonnegative(),
330
+ lastSequence: z7.int().nonnegative(),
331
+ links: z7.array(linkSchema),
305
332
  note: noteSchema.nullable(),
306
- reflections: z4.array(shownReflectionSchema),
307
- thread: z4.string(),
308
- titleBy: z4.enum(["owner", "model"]),
309
- version: z4.int().positive()
310
- });
311
- var spanRecordSchema = z4.object({
312
- isGap: z4.boolean(),
313
- isRemoved: z4.boolean(),
314
- kind: z4.string(),
315
- recordedAt: z4.date(),
316
- sequence: z4.int().nonnegative(),
317
- text: z4.string().nullable(),
318
- tool: z4.string().nullable()
319
- });
320
- var momentChangeSchema = z4.discriminatedUnion("kind", [
321
- z4.object({ kind: z4.literal("title"), title: titleSchema }),
322
- z4.object({
323
- kind: z4.literal("edges"),
324
- firstSequence: z4.int().nonnegative(),
325
- lastSequence: z4.int().nonnegative()
333
+ reflections: z7.array(shownReflectionSchema),
334
+ thread: z7.string(),
335
+ titleBy: z7.enum(["owner", "model"]),
336
+ version: z7.int().positive()
337
+ });
338
+ var spanRecordSchema = z7.object({
339
+ isGap: z7.boolean(),
340
+ isRemoved: z7.boolean(),
341
+ kind: z7.string(),
342
+ recordedAt: z7.date(),
343
+ sequence: z7.int().nonnegative(),
344
+ text: z7.string().nullable(),
345
+ tool: z7.string().nullable()
346
+ });
347
+ var momentChangeSchema = z7.discriminatedUnion("kind", [
348
+ z7.object({ kind: z7.literal("title"), title: titleSchema }),
349
+ z7.object({
350
+ kind: z7.literal("edges"),
351
+ firstSequence: z7.int().nonnegative(),
352
+ lastSequence: z7.int().nonnegative()
326
353
  }),
327
- z4.object({ kind: z4.literal("note"), note: z4.string().min(1).max(4000).regex(/\S/u) }),
328
- z4.object({ kind: z4.literal("reflection_removed"), reflectionID: z4.string().min(1).max(200) })
354
+ z7.object({ kind: z7.literal("note"), note: z7.string().min(1).max(4000).regex(/\S/u) }),
355
+ z7.object({ kind: z7.literal("reflection_removed"), reflectionID: z7.string().min(1).max(200) })
329
356
  ]);
330
357
  var momentChange = momentView.errors(reusedIDErrors);
331
358
  var momentContract = {
332
- keepMoment: momentKeep.input(keepSchema).output(z4.object({ momentID: z4.string(), shortID: z4.string() })),
359
+ keepMoment: momentKeep.input(keepSchema).output(z7.object({ momentID: z7.string(), shortID: z7.string() })),
333
360
  listMoments: signedIn.errors({
334
361
  MEMORY_NOT_STARTED: { message: "The memory store has not started yet", status: 503 }
335
- }).input(momentListSchema).output(z4.object({ moments: z4.array(momentSummarySchema), next: z4.int().nonnegative().nullable() })),
336
- readMoment: momentView.input(z4.object({ momentID: momentIDSchema })).output(momentDetailSchema),
337
- readMomentSpan: momentView.input(z4.object({ momentID: momentIDSchema, after: z4.int().nonnegative().optional() })).output(z4.object({ records: z4.array(spanRecordSchema), next: z4.int().nonnegative().nullable() })),
362
+ }).input(momentListSchema).output(z7.object({ moments: z7.array(momentSummarySchema), next: z7.int().nonnegative().nullable() })),
363
+ readMoment: momentView.input(z7.object({ momentID: momentIDSchema })).output(momentDetailSchema),
364
+ readMomentSpan: momentView.input(z7.object({ momentID: momentIDSchema, after: z7.int().nonnegative().optional() })).output(z7.object({ records: z7.array(spanRecordSchema), next: z7.int().nonnegative().nullable() })),
338
365
  editMoment: momentChange.errors({
339
366
  BAD_SPAN: {
340
367
  message: "The span needs a first and a last record on the thread, in order",
341
368
  status: 422
342
369
  },
343
370
  REFLECTION_NOT_FOUND: { message: "The moment has no reflection with this ID", status: 404 }
344
- }).input(momentTargetSchema.extend({ clientActionID: z4.uuid(), change: momentChangeSchema })).output(z4.object({ momentID: z4.string(), version: z4.int().positive() })),
371
+ }).input(momentTargetSchema.extend({ clientActionID: z7.uuid(), change: momentChangeSchema })).output(z7.object({ momentID: z7.string(), version: z7.int().positive() })),
345
372
  linkMoment: momentChange.errors({
346
373
  MEMORY_ITEM_NOT_FOUND: { message: "No memory item has this ID", status: 404 },
347
374
  ALREADY_LINKED: { message: "The item is already linked to the moment", status: 409 },
348
375
  NOT_LINKED: { message: "The item is not linked to the moment", status: 409 }
349
376
  }).input(momentTargetSchema.extend({
350
- clientActionID: z4.uuid(),
351
- isLinked: z4.boolean(),
352
- itemID: z4.string().min(1).max(200)
353
- })).output(z4.object({ momentID: z4.string(), version: z4.int().positive() })),
377
+ clientActionID: z7.uuid(),
378
+ isLinked: z7.boolean(),
379
+ itemID: z7.string().min(1).max(200)
380
+ })).output(z7.object({ momentID: z7.string(), version: z7.int().positive() })),
354
381
  previewMomentDestroy: momentView.input(momentTargetSchema).output(destroyPreviewSchema),
355
- destroyMoment: momentView.errors(reusedIDErrors).input(momentTargetSchema.extend({ clientActionID: z4.uuid() })).output(z4.object({ momentID: z4.string() }))
382
+ destroyMoment: momentView.errors(reusedIDErrors).input(momentTargetSchema.extend({ clientActionID: z7.uuid() })).output(z7.object({ momentID: z7.string() }))
356
383
  };
357
384
 
358
385
  // src/contract/memory-view-contract.ts
@@ -364,67 +391,67 @@ var memoryChange = memoryView.errors(reusedIDErrors).errors({
364
391
  STALE_VERSION: { message: "The memory item has moved past that version", status: 409 },
365
392
  WRONG_STATE: { message: "The memory item is not in a state that change takes", status: 409 }
366
393
  });
367
- var itemIDSchema = z5.string().min(1).max(200);
368
- var proposalOriginSchema = z5.enum(["owner", "conversation", "task", "memory_writer"]);
369
- var originSchema = z5.enum([...proposalOriginSchema.options, "lapse"]);
370
- var sourceSchema = z5.enum(["owner", "owner_data", "untrusted"]);
371
- var subjectSchema = z5.enum(["owner", "self", "shared"]);
372
- var kindSchema = z5.enum(["fact", "self"]);
373
- var memoryItemSchema = z5.object({
374
- changedAt: z5.date(),
375
- createdAt: z5.date(),
376
- forgottenAt: z5.date().nullable(),
377
- isPinned: z5.boolean(),
378
- isSensitive: z5.boolean(),
379
- itemID: z5.string(),
394
+ var itemIDSchema = z8.string().min(1).max(200);
395
+ var proposalOriginSchema = z8.enum(["owner", "conversation", "task"]);
396
+ var originSchema = z8.enum([...proposalOriginSchema.options, "lapse"]);
397
+ var sourceSchema = z8.enum(["owner", "owner_data", "untrusted"]);
398
+ var subjectSchema = z8.enum(["owner", "self", "shared"]);
399
+ var kindSchema = z8.enum(["fact", "self"]);
400
+ var memoryItemSchema = z8.object({
401
+ changedAt: z8.date(),
402
+ createdAt: z8.date(),
403
+ forgottenAt: z8.date().nullable(),
404
+ isPinned: z8.boolean(),
405
+ isSensitive: z8.boolean(),
406
+ itemID: z8.string(),
380
407
  kind: kindSchema,
381
408
  origin: originSchema,
382
- shortID: z5.string(),
409
+ shortID: z8.string(),
383
410
  source: sourceSchema,
384
- state: z5.enum(["active", "retired", "forgetting", "forgotten"]),
385
- status: z5.enum(["readable", "shredded", "unreadable"]),
411
+ state: z8.enum(["active", "retired", "forgetting", "forgotten"]),
412
+ status: z8.enum(["readable", "shredded", "unreadable"]),
386
413
  subject: subjectSchema,
387
- text: z5.string().optional(),
388
- until: z5.date().nullable(),
389
- version: z5.int().positive()
414
+ text: z8.string().optional(),
415
+ until: z8.date().nullable(),
416
+ version: z8.int().positive()
390
417
  });
391
418
  var memoryMatchSchema = memoryItemSchema.extend({
392
- score: z5.number().optional(),
393
- similarity: z5.number().optional()
394
- });
395
- var evidenceSchema = z5.object({
396
- end: z5.int().nonnegative(),
397
- message: z5.object({
398
- status: z5.enum(["readable", "shredded", "unreadable", "missing"]),
399
- text: z5.string().optional()
419
+ score: z8.number().optional(),
420
+ similarity: z8.number().optional()
421
+ });
422
+ var evidenceSchema = z8.object({
423
+ end: z8.int().nonnegative(),
424
+ message: z8.object({
425
+ status: z8.enum(["readable", "shredded", "unreadable", "missing"]),
426
+ text: z8.string().optional()
400
427
  }).nullable(),
401
- sequence: z5.int().nonnegative(),
402
- start: z5.int().nonnegative()
403
- });
404
- var ownerImageSchema = z5.object({
405
- position: z5.int().nonnegative(),
406
- sequence: z5.int().positive(),
407
- thread: z5.string()
408
- });
409
- var memoryVersionSchema = z5.object({
410
- change: z5.enum(["created", "edited", "retired", "restored", "undone"]),
411
- checkerModel: z5.string().nullable(),
412
- checks: z5.record(z5.string(), z5.unknown()).nullable(),
428
+ sequence: z8.int().nonnegative(),
429
+ start: z8.int().nonnegative()
430
+ });
431
+ var ownerImageSchema = z8.object({
432
+ position: z8.int().nonnegative(),
433
+ sequence: z8.int().positive(),
434
+ thread: z8.string()
435
+ });
436
+ var memoryVersionSchema = z8.object({
437
+ change: z8.enum(["created", "edited", "retired", "restored", "undone"]),
438
+ checkerModel: z8.string().nullable(),
439
+ checks: z8.record(z8.string(), z8.unknown()).nullable(),
413
440
  evidence: evidenceSchema.nullable(),
414
- evidenceQuote: z5.string().nullable(),
441
+ evidenceQuote: z8.string().nullable(),
415
442
  image: ownerImageSchema.nullable(),
416
443
  origin: originSchema,
417
- proposalID: z5.string().nullable(),
418
- recordedAt: z5.date(),
444
+ proposalID: z8.string().nullable(),
445
+ recordedAt: z8.date(),
419
446
  source: sourceSchema,
420
- state: z5.enum(["active", "retired"]),
421
- status: z5.enum(["readable", "shredded", "unreadable"]),
422
- taskID: z5.string().nullable(),
423
- text: z5.string().optional(),
424
- version: z5.int().positive(),
425
- writerModel: z5.string().nullable()
426
- });
427
- var reviewReasonSchema = z5.enum([
447
+ state: z8.enum(["active", "retired"]),
448
+ status: z8.enum(["readable", "shredded", "unreadable"]),
449
+ taskID: z8.string().nullable(),
450
+ text: z8.string().optional(),
451
+ version: z8.int().positive(),
452
+ writerModel: z8.string().nullable()
453
+ });
454
+ var reviewReasonSchema = z8.enum([
428
455
  "no_quote",
429
456
  "quote_not_typed",
430
457
  "quote_in_quoted_block",
@@ -443,101 +470,101 @@ var reviewReasonSchema = z5.enum([
443
470
  "subject_change",
444
471
  "ask_rule"
445
472
  ]);
446
- var proposalSourceSchema = z5.object({
473
+ var proposalSourceSchema = z8.object({
447
474
  origin: proposalOriginSchema,
448
- proposedAt: z5.date(),
449
- thread: z5.string().nullable()
475
+ proposedAt: z8.date(),
476
+ thread: z8.string().nullable()
450
477
  });
451
- var memoryProposalSchema = z5.object({
452
- actionHash: z5.string(),
453
- createdAt: z5.date(),
478
+ var memoryProposalSchema = z8.object({
479
+ actionHash: z8.string(),
480
+ createdAt: z8.date(),
454
481
  evidence: evidenceSchema.nullable(),
455
482
  image: ownerImageSchema.nullable(),
456
- isPinned: z5.boolean(),
457
- isSensitive: z5.boolean(),
458
- itemID: z5.string(),
483
+ isPinned: z8.boolean(),
484
+ isSensitive: z8.boolean(),
485
+ itemID: z8.string(),
459
486
  kind: kindSchema,
460
- lapseAt: z5.date(),
487
+ lapseAt: z8.date(),
461
488
  newSubject: subjectSchema.nullable(),
462
- operation: z5.enum(["remember", "retire", "pin"]),
489
+ operation: z8.enum(["remember", "retire", "pin"]),
463
490
  origin: proposalOriginSchema,
464
- proposalID: z5.string(),
465
- quote: z5.string().nullable(),
491
+ proposalID: z8.string(),
492
+ quote: z8.string().nullable(),
466
493
  reason: reviewReasonSchema,
467
494
  source: sourceSchema,
468
- sources: z5.array(proposalSourceSchema),
495
+ sources: z8.array(proposalSourceSchema),
469
496
  subject: subjectSchema,
470
- targetVersion: z5.int().positive().nullable(),
471
- text: z5.string(),
472
- until: z5.date().nullable()
497
+ targetVersion: z8.int().positive().nullable(),
498
+ text: z8.string(),
499
+ until: z8.date().nullable()
473
500
  });
474
- var revisionTargetSchema = z5.object({ itemID: itemIDSchema, version: z5.int().positive() });
475
- var memoryItemDetailSchema = memoryItemSchema.extend({ versions: z5.array(memoryVersionSchema) });
476
- var forgetLossSchema = z5.object({
477
- evidenceMessages: z5.int().nonnegative(),
478
- proposals: z5.int().nonnegative()
501
+ var revisionTargetSchema = z8.object({ itemID: itemIDSchema, version: z8.int().positive() });
502
+ var memoryItemDetailSchema = memoryItemSchema.extend({ versions: z8.array(memoryVersionSchema) });
503
+ var forgetLossSchema = z8.object({
504
+ evidenceMessages: z8.int().nonnegative(),
505
+ proposals: z8.int().nonnegative()
479
506
  });
480
507
  var forgetPreviewSchema = memoryItemDetailSchema.extend({ lost: forgetLossSchema });
481
- var retiredForgetPreviewSchema = z5.object({
482
- hasMore: z5.boolean(),
483
- items: z5.array(memoryItemSchema.extend({ lost: forgetLossSchema }))
508
+ var retiredForgetPreviewSchema = z8.object({
509
+ hasMore: z8.boolean(),
510
+ items: z8.array(memoryItemSchema.extend({ lost: forgetLossSchema }))
484
511
  });
485
- var retiredForgetSchema = z5.object({
486
- clientActionID: z5.uuid(),
487
- targets: z5.array(revisionTargetSchema).min(1).max(100).refine((targets) => new Set(targets.map((target) => target.itemID)).size === targets.length, {
512
+ var retiredForgetSchema = z8.object({
513
+ clientActionID: z8.uuid(),
514
+ targets: z8.array(revisionTargetSchema).min(1).max(100).refine((targets) => new Set(targets.map((target) => target.itemID)).size === targets.length, {
488
515
  message: "Each item appears once"
489
516
  })
490
517
  });
491
- var forgetStatusSchema = z5.object({
492
- deleted: z5.array(z5.string()),
493
- pending: z5.array(z5.string()),
518
+ var forgetStatusSchema = z8.object({
519
+ deleted: z8.array(z8.string()),
520
+ pending: z8.array(z8.string()),
494
521
  backup: forgetBackupSchema
495
522
  });
496
- var versionTargetSchema = z5.object({
497
- clientActionID: z5.uuid(),
523
+ var versionTargetSchema = z8.object({
524
+ clientActionID: z8.uuid(),
498
525
  itemID: itemIDSchema,
499
- version: z5.int().positive()
500
- });
501
- var versionResultSchema = z5.object({ itemID: z5.string(), version: z5.int().positive() });
502
- var noticeEntrySchema = z5.object({
503
- change: z5.enum(["created", "edited", "retired", "restored", "undone", "proposed"]),
504
- isKept: z5.boolean(),
505
- item: memoryItemSchema.extend({ change: z5.enum(["created", "edited", "retired", "restored", "undone"]) }).nullable(),
506
- itemID: z5.string(),
507
- proposalID: z5.string().nullable(),
508
- sequence: z5.int().nonnegative(),
509
- version: z5.int().positive().nullable()
510
- });
511
- var memoryNoticeSchema = z5.object({
512
- entries: z5.array(noticeEntrySchema),
513
- kind: z5.enum(["turn", "batch", "catch_up", "run"]),
514
- messageSequence: z5.int().nonnegative().nullable(),
515
- noticeKey: z5.string(),
516
- proposed: z5.int().nonnegative(),
517
- remembered: z5.int().nonnegative(),
518
- retired: z5.int().nonnegative(),
519
- sequence: z5.int().nonnegative()
526
+ version: z8.int().positive()
527
+ });
528
+ var versionResultSchema = z8.object({ itemID: z8.string(), version: z8.int().positive() });
529
+ var noticeEntrySchema = z8.object({
530
+ change: z8.enum(["created", "edited", "retired", "restored", "undone", "proposed"]),
531
+ isKept: z8.boolean(),
532
+ item: memoryItemSchema.extend({ change: z8.enum(["created", "edited", "retired", "restored", "undone"]) }).nullable(),
533
+ itemID: z8.string(),
534
+ proposalID: z8.string().nullable(),
535
+ sequence: z8.int().nonnegative(),
536
+ version: z8.int().positive().nullable()
537
+ });
538
+ var memoryNoticeSchema = z8.object({
539
+ entries: z8.array(noticeEntrySchema),
540
+ kind: z8.enum(["turn", "run"]),
541
+ messageSequence: z8.int().nonnegative().nullable(),
542
+ noticeKey: z8.string(),
543
+ proposed: z8.int().nonnegative(),
544
+ remembered: z8.int().nonnegative(),
545
+ retired: z8.int().nonnegative(),
546
+ sequence: z8.int().nonnegative()
520
547
  });
521
548
  var memoryViewContract = {
522
- listItems: memoryView.errors({ INVALID_CURSOR: { message: "No page returned this cursor", status: 400 } }).input(z5.object({
523
- after: z5.string().max(20).optional(),
549
+ listItems: memoryView.errors({ INVALID_CURSOR: { message: "No page returned this cursor", status: 400 } }).input(z8.object({
550
+ after: z8.string().max(20).optional(),
524
551
  kind: kindSchema.optional(),
525
- limit: z5.int().min(1).max(100).optional(),
526
- state: z5.enum(["active", "retired", "forgotten"])
527
- })).output(z5.object({ items: z5.array(memoryItemSchema), next: z5.string().nullable() })),
528
- findItems: memoryView.input(z5.object({ query: z5.string().min(1).max(500) })).output(z5.object({
529
- items: z5.array(memoryMatchSchema),
530
- searchMode: z5.enum(["hybrid", "keyword", "keyword-fallback"])
552
+ limit: z8.int().min(1).max(100).optional(),
553
+ state: z8.enum(["active", "retired", "forgotten"])
554
+ })).output(z8.object({ items: z8.array(memoryItemSchema), next: z8.string().nullable() })),
555
+ findItems: memoryView.input(z8.object({ query: z8.string().min(1).max(500) })).output(z8.object({
556
+ items: z8.array(memoryMatchSchema),
557
+ searchMode: z8.enum(["hybrid", "keyword", "keyword-fallback"])
531
558
  })),
532
- readPinnedCore: memoryView.output(z5.object({
533
- budget: z5.int().nonnegative(),
534
- items: z5.array(memoryItemSchema),
535
- tokens: z5.int().nonnegative()
559
+ readPinnedCore: memoryView.output(z8.object({
560
+ budget: z8.int().nonnegative(),
561
+ items: z8.array(memoryItemSchema),
562
+ tokens: z8.int().nonnegative()
536
563
  })),
537
- readItem: memoryView.errors({ MEMORY_ITEM_NOT_FOUND: { message: "No memory item has this ID", status: 404 } }).input(z5.object({ itemID: itemIDSchema })).output(memoryItemDetailSchema),
564
+ readItem: memoryView.errors({ MEMORY_ITEM_NOT_FOUND: { message: "No memory item has this ID", status: 404 } }).input(z8.object({ itemID: itemIDSchema })).output(memoryItemDetailSchema),
538
565
  retire: memoryChange.input(versionTargetSchema).output(versionResultSchema),
539
566
  restore: memoryChange.input(versionTargetSchema).output(versionResultSchema),
540
- listNotices: memoryView.input(z5.object({ thread: z5.string().min(1).max(200) })).output(z5.object({ notices: z5.array(memoryNoticeSchema) })),
567
+ listNotices: memoryView.input(z8.object({ thread: z8.string().min(1).max(200) })).output(z8.object({ notices: z8.array(memoryNoticeSchema) })),
541
568
  undo: memoryChange.errors({
542
569
  PINNED_CORE_FULL: { message: "The undo takes the pinned core past its budget", status: 409 }
543
570
  }).input(versionTargetSchema).output(versionResultSchema),
@@ -545,138 +572,174 @@ var memoryViewContract = {
545
572
  previewForget: memoryView.errors({
546
573
  MEMORY_ITEM_NOT_FOUND: { message: "No memory item has this ID", status: 404 },
547
574
  STALE_VERSION: { message: "The memory item has moved past that version", status: 409 }
548
- }).input(z5.object({ itemID: itemIDSchema, version: z5.int().positive() })).output(forgetPreviewSchema),
549
- forget: memoryChange.input(versionTargetSchema).output(z5.object({ itemID: z5.string(), backup: forgetBackupSchema })),
575
+ }).input(z8.object({ itemID: itemIDSchema, version: z8.int().positive() })).output(forgetPreviewSchema),
576
+ forget: memoryChange.input(versionTargetSchema).output(z8.object({ itemID: z8.string(), backup: forgetBackupSchema })),
550
577
  previewForgetRetired: memoryView.output(retiredForgetPreviewSchema),
551
578
  forgetRetired: memoryChange.input(retiredForgetSchema).output(forgetStatusSchema),
552
- readForgetStatus: memoryView.input(z5.object({ itemIDs: z5.array(itemIDSchema).min(1).max(100) })).output(forgetStatusSchema),
579
+ readForgetStatus: memoryView.input(z8.object({ itemIDs: z8.array(itemIDSchema).min(1).max(100) })).output(forgetStatusSchema),
553
580
  pin: memoryChange.errors({
554
581
  PINNED_CORE_FULL: { message: "The pin takes the pinned core past its budget", status: 409 }
555
- }).input(versionTargetSchema.extend({ isPinned: z5.boolean() })).output(z5.object({ isPinned: z5.boolean(), itemID: z5.string() })),
556
- markSensitive: memoryChange.input(z5.object({ clientActionID: z5.uuid(), isSensitive: z5.boolean(), itemID: itemIDSchema })).output(z5.object({ isSensitive: z5.boolean(), itemID: z5.string() })),
582
+ }).input(versionTargetSchema.extend({ isPinned: z8.boolean() })).output(z8.object({ isPinned: z8.boolean(), itemID: z8.string() })),
583
+ markSensitive: memoryChange.input(z8.object({ clientActionID: z8.uuid(), isSensitive: z8.boolean(), itemID: itemIDSchema })).output(z8.object({ isSensitive: z8.boolean(), itemID: z8.string() })),
557
584
  ...memoryExportContract,
558
585
  ...momentContract
559
586
  };
560
587
 
588
+ // src/contract/no-passkey-error.ts
589
+ var noPasskeyError = {
590
+ NO_PASSKEY: { message: "No passkey is registered", status: 403 }
591
+ };
592
+
593
+ // src/contract/passkey-failed-error.ts
594
+ import { z as z10 } from "zod";
595
+
596
+ // src/contract/passkey-failure-schema.ts
597
+ import { z as z9 } from "zod";
598
+ var passkeyFailureSchema = z9.enum([
599
+ "unknown_challenge",
600
+ "binding",
601
+ "unknown_passkey",
602
+ "origin",
603
+ "no_user_verification",
604
+ "signature",
605
+ "counter"
606
+ ]);
607
+
608
+ // src/contract/passkey-failed-error.ts
609
+ var passkeyFailedError = {
610
+ PASSKEY_FAILED: {
611
+ message: "The passkey check failed",
612
+ status: 403,
613
+ data: z10.object({ reason: passkeyFailureSchema })
614
+ }
615
+ };
616
+
561
617
  // src/contract/approval-contract.ts
562
- var choiceSchema = z6.enum(["approve", "always_allow", "defer", "decline"]);
563
- var stateSchema = z6.enum(["pending", "deferred", "approved", "declined", "lapsed", "withdrawn"]);
564
- var hashesSchema = z6.object({ actionHash: z6.string(), ruleHash: z6.string().nullable() });
565
- var versionSchema = z6.int().positive();
566
- var taskSchema = z6.object({ id: z6.string(), name: z6.string() });
567
- var proposalSchema = z6.object({
568
- proposalID: z6.string(),
569
- shortID: z6.string(),
570
- kind: z6.enum(["action", "memory_write", "internal_change"]),
571
- riskClass: z6.enum(["routine", "always_ask", "lifting"]),
572
- actionHash: z6.string(),
573
- ruleHash: z6.string().nullable(),
574
- cause: z6.string(),
618
+ var stateSchema = z11.enum(["pending", "deferred", "approved", "declined", "lapsed", "withdrawn"]);
619
+ var hashesSchema = z11.object({ actionHash: z11.string(), ruleHash: z11.string().nullable() });
620
+ var versionSchema = z11.int().positive();
621
+ var taskSchema = z11.object({ id: z11.string(), name: z11.string() });
622
+ var proposalSchema = z11.object({
623
+ proposalID: z11.string(),
624
+ shortID: z11.string(),
625
+ kind: z11.enum(["action", "memory_write", "internal_change"]),
626
+ riskClass: z11.enum(["routine", "always_ask", "lifting"]),
627
+ actionHash: z11.string(),
628
+ ruleHash: z11.string().nullable(),
629
+ cause: z11.string(),
575
630
  state: stateSchema,
576
- createdAt: z6.date(),
577
- lapsesAt: z6.date(),
578
- deadlineAt: z6.date().nullable(),
579
- deferGeneration: z6.int().nonnegative(),
580
- deferUntil: z6.date().nullable(),
581
- thread: z6.string().nullable(),
582
- taskID: z6.string().nullable(),
583
- sequence: z6.int().positive()
584
- });
585
- var bodySchema = z6.object({
586
- sentence: z6.string(),
587
- fields: z6.record(z6.string(), z6.string()),
588
- ruleSentence: z6.string().nullable(),
589
- approveLabel: z6.string(),
631
+ createdAt: z11.date(),
632
+ lapsesAt: z11.date(),
633
+ deadlineAt: z11.date().nullable(),
634
+ deferGeneration: z11.int().nonnegative(),
635
+ deferUntil: z11.date().nullable(),
636
+ thread: z11.string().nullable(),
637
+ taskID: z11.string().nullable(),
638
+ sequence: z11.int().positive()
639
+ });
640
+ var bodySchema = z11.object({
641
+ sentence: z11.string(),
642
+ fields: z11.record(z11.string(), z11.string()),
643
+ ruleSentence: z11.string().nullable(),
644
+ approveLabel: z11.string(),
590
645
  memory: memoryProposalSchema.optional()
591
646
  });
592
- var itemSchema = z6.object({
593
- group: z6.enum(["always_ask", "routine", "memory", "deferred"]),
647
+ var itemSchema = z11.object({
648
+ group: z11.enum(["always_ask", "routine", "memory", "deferred"]),
594
649
  proposal: proposalSchema,
595
650
  body: bodySchema,
596
651
  task: taskSchema.nullable(),
597
- choices: z6.array(choiceSchema)
652
+ choices: z11.array(choiceSchema),
653
+ passkeyChoices: z11.array(choiceSchema)
598
654
  });
599
- var readItemSchema = z6.object({
655
+ var readItemSchema = z11.object({
600
656
  proposal: proposalSchema,
601
657
  body: bodySchema.nullable(),
602
658
  task: taskSchema.nullable(),
603
- choices: z6.array(choiceSchema),
604
- answeredOn: z6.string().nullable(),
605
- isAnsweredHere: z6.boolean()
606
- });
607
- var deferSettingsSchema = z6.object({
608
- defaultMinutes: z6.int().positive(),
609
- eveningAt: z6.string(),
610
- morningAt: z6.string(),
611
- zone: z6.string()
612
- });
613
- var memoryAnswerSchema = z6.object({
614
- editedText: z6.string().optional(),
615
- revisionOf: z6.object({ itemID: z6.string(), version: versionSchema }).optional(),
616
- ignoreCloseMatch: z6.boolean().optional()
617
- });
618
- var answerSchema = z6.object({
619
- proposalID: z6.string().min(1).max(200),
620
- actionHash: z6.string().min(1),
659
+ choices: z11.array(choiceSchema),
660
+ passkeyChoices: z11.array(choiceSchema),
661
+ answeredOn: z11.string().nullable(),
662
+ isAnsweredHere: z11.boolean()
663
+ });
664
+ var deferSettingsSchema = z11.object({
665
+ defaultMinutes: z11.int().positive(),
666
+ eveningAt: z11.string(),
667
+ morningAt: z11.string(),
668
+ zone: z11.string()
669
+ });
670
+ var memoryAnswerSchema = z11.object({
671
+ editedText: z11.string().optional(),
672
+ revisionOf: z11.object({ itemID: z11.string(), version: versionSchema }).optional(),
673
+ ignoreCloseMatch: z11.boolean().optional()
674
+ });
675
+ var answerSchema = z11.object({
676
+ proposalID: z11.string().min(1).max(200),
677
+ actionHash: z11.string().min(1),
621
678
  choice: choiceSchema,
622
- ruleHash: z6.string().optional(),
623
- deferUntil: z6.date().optional(),
624
- note: z6.string().min(1).max(500).optional(),
625
- clientActionID: z6.uuid(),
679
+ ruleHash: z11.string().optional(),
680
+ deferUntil: z11.date().optional(),
681
+ note: z11.string().min(1).max(500).optional(),
682
+ clientActionID: z11.uuid(),
626
683
  memory: memoryAnswerSchema.optional()
627
684
  });
628
- var ruleRefSchema = z6.object({ id: z6.string(), revision: versionSchema });
629
- var closeMatchSchema = z6.object({ itemID: z6.string(), text: z6.string(), version: versionSchema });
630
- var approvedSchema = z6.object({
631
- proposalID: z6.string(),
632
- state: z6.literal("approved"),
685
+ var passkeyAnswerSchema = answerSchema.extend({
686
+ passkey: authenticationResponseSchema.optional()
687
+ });
688
+ var ruleRefSchema = z11.object({ id: z11.string(), revision: versionSchema });
689
+ var closeMatchSchema = z11.object({ itemID: z11.string(), text: z11.string(), version: versionSchema });
690
+ var approvedSchema = z11.object({
691
+ proposalID: z11.string(),
692
+ state: z11.literal("approved"),
633
693
  rule: ruleRefSchema.optional()
634
694
  });
635
- var closedSchema = z6.object({ proposalID: z6.string(), state: z6.enum(["declined", "deferred"]) });
636
- var closeMatchResultSchema = z6.object({
637
- proposalID: z6.string(),
638
- state: z6.literal("pending"),
695
+ var closedSchema = z11.object({ proposalID: z11.string(), state: z11.enum(["declined", "deferred"]) });
696
+ var closeMatchResultSchema = z11.object({
697
+ proposalID: z11.string(),
698
+ state: z11.literal("pending"),
639
699
  closeMatch: closeMatchSchema
640
700
  });
641
- var resultSchema = z6.discriminatedUnion("state", [
701
+ var resultSchema = z11.discriminatedUnion("state", [
642
702
  approvedSchema,
643
703
  closedSchema,
644
704
  closeMatchResultSchema
645
705
  ]);
646
- var refusedSchema = z6.object({
647
- proposalID: z6.string(),
648
- error: z6.enum(["CONFLICT", "CLOSED", "NOT_ALLOWED"]),
706
+ var refusedSchema = z11.object({
707
+ proposalID: z11.string(),
708
+ error: z11.enum(["CONFLICT", "CLOSED", "NOT_ALLOWED", "PASSKEY_REQUIRED"]),
649
709
  current: hashesSchema.optional(),
650
710
  state: stateSchema.optional(),
651
- reason: z6.string().optional()
711
+ reason: z11.string().optional()
652
712
  });
653
713
  var answerErrors = signedIn.errors(reusedIDErrors).errors({
654
714
  CONFLICT: {
655
715
  message: "The proposal changed since the card showed it",
656
716
  status: 409,
657
- data: z6.object({ current: hashesSchema })
717
+ data: z11.object({ current: hashesSchema })
658
718
  },
659
719
  CLOSED: {
660
720
  message: "The proposal is answered, withdrawn or lapsed",
661
721
  status: 409,
662
- data: z6.object({ state: stateSchema })
722
+ data: z11.object({ state: stateSchema })
663
723
  },
664
724
  NOT_ALLOWED: {
665
725
  message: "The proposal does not take this answer",
666
726
  status: 403,
667
- data: z6.object({ reason: z6.string() })
668
- }
727
+ data: z11.object({ reason: z11.string() })
728
+ },
729
+ PASSKEY_REQUIRED: { message: "This answer needs a passkey check", status: 403 },
730
+ ...noPasskeyError,
731
+ ...passkeyFailedError
669
732
  });
670
- var listedSchema = z6.object({ defer: deferSettingsSchema, items: z6.array(itemSchema) });
671
- var readInputSchema = z6.object({
672
- proposalIDs: z6.array(z6.string().min(1).max(200)).min(1).max(100)
733
+ var listedSchema = z11.object({ defer: deferSettingsSchema, items: z11.array(itemSchema) });
734
+ var readInputSchema = z11.object({
735
+ proposalIDs: z11.array(z11.string().min(1).max(200)).min(1).max(100)
673
736
  });
674
- var batchInputSchema = z6.object({ answers: z6.array(answerSchema).min(1).max(100) });
675
- var batchResultSchema = z6.object({ results: z6.array(z6.union([resultSchema, refusedSchema])) });
737
+ var batchInputSchema = z11.object({ answers: z11.array(answerSchema).min(1).max(100) });
738
+ var batchResultSchema = z11.object({ results: z11.array(z11.union([resultSchema, refusedSchema])) });
676
739
  var approvalContract = {
677
740
  listItems: signedIn.output(listedSchema),
678
- readProposals: signedIn.input(readInputSchema).output(z6.object({ proposals: z6.array(readItemSchema) })),
679
- answerProposal: answerErrors.input(answerSchema).output(resultSchema),
741
+ readProposals: signedIn.input(readInputSchema).output(z11.object({ proposals: z11.array(readItemSchema) })),
742
+ answerProposal: answerErrors.input(passkeyAnswerSchema).output(resultSchema),
680
743
  answerProposals: signedIn.errors(reusedIDErrors).input(batchInputSchema).output(batchResultSchema)
681
744
  };
682
745
 
@@ -695,10 +758,10 @@ var imageNotFoundError = {
695
758
  };
696
759
 
697
760
  // src/contract/image-refused-error.ts
698
- import { z as z7 } from "zod";
699
- var imageRefusedDataSchema = z7.object({
700
- position: z7.int().nonnegative().nullable(),
701
- reason: z7.enum(["too_many", "too_large", "unsupported_type"])
761
+ import { z as z12 } from "zod";
762
+ var imageRefusedDataSchema = z12.object({
763
+ position: z12.int().nonnegative().nullable(),
764
+ reason: z12.enum(["too_many", "too_large", "unsupported_type"])
702
765
  });
703
766
  var imageRefusedError = {
704
767
  message: "An image is too large, of a type nixie does not take, or one too many",
@@ -706,14 +769,151 @@ var imageRefusedError = {
706
769
  data: imageRefusedDataSchema
707
770
  };
708
771
 
772
+ // src/contract/passkey-contract.ts
773
+ import { z as z20 } from "zod";
774
+
775
+ // src/contract/challenge-for-schema.ts
776
+ import { z as z13 } from "zod";
777
+ var challengeForSchema = z13.discriminatedUnion("kind", [
778
+ z13.object({
779
+ kind: z13.literal("answer"),
780
+ proposalID: z13.string().min(1).max(200),
781
+ actionHash: z13.string().min(1),
782
+ choice: choiceSchema,
783
+ ruleHash: z13.string().optional()
784
+ }),
785
+ z13.object({ kind: z13.literal("register") }),
786
+ z13.object({ kind: z13.literal("revoke"), passkeyID: z13.string().min(1).max(200) })
787
+ ]);
788
+
789
+ // src/contract/creation-options-schema.ts
790
+ import { z as z17 } from "zod";
791
+
792
+ // src/contract/credential-descriptor-schema.ts
793
+ import { z as z15 } from "zod";
794
+
795
+ // src/contract/transports-schema.ts
796
+ import { z as z14 } from "zod";
797
+ var transportSchema = z14.string().max(40);
798
+ var transportsSchema = z14.array(transportSchema).max(10);
799
+
800
+ // src/contract/credential-descriptor-schema.ts
801
+ var credentialDescriptorSchema = z15.object({
802
+ id: base64URLSchema,
803
+ type: z15.literal("public-key"),
804
+ transports: transportsSchema.optional()
805
+ });
806
+
807
+ // src/contract/user-verification-schema.ts
808
+ import { z as z16 } from "zod";
809
+ var userVerificationSchema = z16.enum(["required", "preferred", "discouraged"]);
810
+
811
+ // src/contract/creation-options-schema.ts
812
+ var userSchema = z17.object({ id: base64URLSchema, name: z17.string(), displayName: z17.string() });
813
+ var parameterSchema = z17.object({ type: z17.literal("public-key"), alg: z17.int() });
814
+ var selectionSchema = z17.object({
815
+ residentKey: userVerificationSchema,
816
+ requireResidentKey: z17.boolean(),
817
+ userVerification: userVerificationSchema
818
+ });
819
+ var creationOptionsSchema = z17.object({
820
+ rp: z17.object({ id: z17.string(), name: z17.string() }),
821
+ user: userSchema,
822
+ challenge: base64URLSchema,
823
+ pubKeyCredParams: z17.array(parameterSchema),
824
+ timeout: z17.int().positive(),
825
+ excludeCredentials: z17.array(credentialDescriptorSchema),
826
+ authenticatorSelection: selectionSchema,
827
+ attestation: z17.enum(["none", "indirect", "direct", "enterprise"])
828
+ });
829
+
830
+ // src/contract/registration-response-schema.ts
831
+ import { z as z18 } from "zod";
832
+ var attestationSchema = z18.object({
833
+ clientDataJSON: base64URLSchema,
834
+ attestationObject: base64URLSchema,
835
+ authenticatorData: base64URLSchema.optional(),
836
+ transports: transportsSchema.optional(),
837
+ publicKeyAlgorithm: z18.int().optional(),
838
+ publicKey: base64URLSchema.optional()
839
+ });
840
+ var registrationResponseSchema = z18.object({
841
+ id: base64URLSchema,
842
+ rawId: base64URLSchema,
843
+ response: attestationSchema,
844
+ authenticatorAttachment: z18.enum(["cross-platform", "platform"]).optional(),
845
+ clientExtensionResults: z18.object({}),
846
+ type: z18.literal("public-key")
847
+ });
848
+
849
+ // src/contract/request-options-schema.ts
850
+ import { z as z19 } from "zod";
851
+ var requestOptionsSchema = z19.object({
852
+ challenge: base64URLSchema,
853
+ rpId: z19.string(),
854
+ allowCredentials: z19.array(credentialDescriptorSchema),
855
+ userVerification: userVerificationSchema,
856
+ timeout: z19.int().positive()
857
+ });
858
+
859
+ // src/contract/passkey-contract.ts
860
+ var clientActionIDSchema = z20.uuid();
861
+ var listedPasskeySchema = z20.object({
862
+ passkeyID: z20.string(),
863
+ label: z20.string(),
864
+ synced: z20.boolean(),
865
+ authorizedBy: z20.string(),
866
+ registeredAt: z20.date(),
867
+ lastUsedAt: z20.date().nullable(),
868
+ revokedAt: z20.date().nullable()
869
+ });
870
+ var registrationErrors = {
871
+ ...passkeyFailedError,
872
+ TOO_MANY_PASSKEYS: { message: "Ten passkeys are live already", status: 409 },
873
+ ORIGIN_UNSUPPORTED: {
874
+ message: "A passkey needs an https origin with a domain name",
875
+ status: 400
876
+ },
877
+ ORIGIN_CHANGED: { message: "Live passkeys hold another origin", status: 409 }
878
+ };
879
+ var passkeyContract = {
880
+ challenge: signedIn.errors(noPasskeyError).input(z20.object({ for: challengeForSchema })).output(z20.object({ options: requestOptionsSchema })),
881
+ registrationOptions: signedIn.errors(registrationErrors).errors({
882
+ CODE_REQUIRED: { message: "A host code is required", status: 403 },
883
+ CODE_INVALID: { message: "The host code is unknown, used or lapsed", status: 403 }
884
+ }).input(z20.object({
885
+ code: z20.string().min(1).max(100).optional(),
886
+ passkey: authenticationResponseSchema.optional()
887
+ })).output(z20.object({ options: creationOptionsSchema })),
888
+ register: signedIn.errors(reusedIDErrors).errors({
889
+ REGISTRATION_FAILED: {
890
+ message: "The registration failed",
891
+ status: 400,
892
+ data: z20.object({ reason: z20.string() })
893
+ },
894
+ TOO_MANY_PASSKEYS: registrationErrors.TOO_MANY_PASSKEYS,
895
+ ORIGIN_UNSUPPORTED: registrationErrors.ORIGIN_UNSUPPORTED
896
+ }).input(z20.object({
897
+ clientActionID: clientActionIDSchema,
898
+ response: registrationResponseSchema,
899
+ label: z20.string().min(1).max(64).optional()
900
+ })).output(z20.object({ passkeyID: z20.string() })),
901
+ list: signedIn.output(z20.object({ passkeys: z20.array(listedPasskeySchema) })),
902
+ revoke: signedIn.errors(reusedIDErrors).errors(passkeyFailedError).errors({ NOT_FOUND: { message: "No passkey has this ID", status: 404 } }).input(z20.object({
903
+ clientActionID: clientActionIDSchema,
904
+ passkeyID: z20.string().min(1).max(200),
905
+ passkey: authenticationResponseSchema
906
+ })).output(z20.object({ revokedAt: z20.date() }))
907
+ };
908
+
709
909
  // src/contract/pause-state-schema.ts
710
- import { z as z8 } from "zod";
711
- var pauseCauseSchema = z8.enum(["restore", "owner", "spending"]);
712
- var pauseStateSchema = z8.object({ cause: pauseCauseSchema, since: z8.date() }).nullable();
910
+ import { z as z21 } from "zod";
911
+ var pauseCauseSchema = z21.enum(["restore", "owner", "spending"]);
912
+ var pauseStateSchema = z21.object({ cause: pauseCauseSchema, since: z21.date() }).nullable();
713
913
 
714
914
  // src/contract/recovery-schema.ts
715
- import { z as z9 } from "zod";
716
- var taskStateSchema = z9.enum([
915
+ import { z as z22 } from "zod";
916
+ var taskStateSchema = z22.enum([
717
917
  "ready",
718
918
  "running",
719
919
  "waiting",
@@ -723,29 +923,29 @@ var taskStateSchema = z9.enum([
723
923
  "failed",
724
924
  "closed"
725
925
  ]);
726
- var taskToCheckSchema = z9.object({
727
- taskID: z9.string(),
728
- name: z9.string(),
926
+ var taskToCheckSchema = z22.object({
927
+ taskID: z22.string(),
928
+ name: z22.string(),
729
929
  stateAtBackup: taskStateSchema,
730
- wasRunning: z9.boolean(),
731
- pendingActions: z9.int().nonnegative()
930
+ wasRunning: z22.boolean(),
931
+ pendingActions: z22.int().nonnegative()
732
932
  });
733
- var recoverySchema = z9.object({
734
- restoredAt: z9.date(),
735
- backupTakenAt: z9.date(),
736
- toCheck: z9.array(taskToCheckSchema)
933
+ var recoverySchema = z22.object({
934
+ restoredAt: z22.date(),
935
+ backupTakenAt: z22.date(),
936
+ toCheck: z22.array(taskToCheckSchema)
737
937
  }).nullable();
738
938
 
739
939
  // src/contract/rule-contract.ts
740
- import { z as z10 } from "zod";
741
- var ruleIDSchema = z10.string().min(1).max(200);
742
- var revisionSchema = z10.int().positive();
743
- var ruleSchema = z10.object({
744
- ruleID: z10.string(),
940
+ import { z as z23 } from "zod";
941
+ var ruleIDSchema = z23.string().min(1).max(200);
942
+ var revisionSchema = z23.int().positive();
943
+ var ruleSchema = z23.object({
944
+ ruleID: z23.string(),
745
945
  revision: revisionSchema,
746
- sentence: z10.string(),
747
- outcome: z10.enum(["allow", "ask", "deny"]),
748
- destinations: z10.array(z10.string())
946
+ sentence: z23.string(),
947
+ outcome: z23.enum(["allow", "ask", "deny"]),
948
+ destinations: z23.array(z23.string())
749
949
  });
750
950
  var notFound = { NOT_FOUND: { message: "No rule has this ID", status: 404 } };
751
951
  var ruleChange = signedIn.errors(reusedIDErrors).errors({
@@ -753,157 +953,157 @@ var ruleChange = signedIn.errors(reusedIDErrors).errors({
753
953
  CONFLICT: {
754
954
  message: "The rule changed since the notice showed it",
755
955
  status: 409,
756
- data: z10.object({ revision: revisionSchema })
956
+ data: z23.object({ revision: revisionSchema })
757
957
  },
758
958
  NOT_ALLOWED: {
759
959
  message: "The rule takes no such change",
760
960
  status: 403,
761
- data: z10.object({ reason: z10.enum(["widens", "empty"]) })
961
+ data: z23.object({ reason: z23.enum(["widens", "empty"]) })
762
962
  }
763
963
  });
764
- var destinationsSchema = z10.array(z10.string().regex(/^\S+$/u)).max(100);
964
+ var destinationsSchema = z23.array(z23.string().regex(/^\S+$/u)).max(100);
765
965
  var ruleContract = {
766
- readRule: signedIn.errors(notFound).input(z10.object({ ruleID: ruleIDSchema })).output(ruleSchema),
767
- removeRule: ruleChange.input(z10.object({ ruleID: ruleIDSchema, revision: revisionSchema, clientActionID: z10.uuid() })).output(z10.object({ ruleID: z10.string() })),
768
- editRule: ruleChange.input(z10.object({
966
+ readRule: signedIn.errors(notFound).input(z23.object({ ruleID: ruleIDSchema })).output(ruleSchema),
967
+ removeRule: ruleChange.input(z23.object({ ruleID: ruleIDSchema, revision: revisionSchema, clientActionID: z23.uuid() })).output(z23.object({ ruleID: z23.string() })),
968
+ editRule: ruleChange.input(z23.object({
769
969
  ruleID: ruleIDSchema,
770
970
  revision: revisionSchema,
771
971
  destinations: destinationsSchema,
772
- clientActionID: z10.uuid()
773
- })).output(z10.object({ ruleID: z10.string(), revision: revisionSchema }))
972
+ clientActionID: z23.uuid()
973
+ })).output(z23.object({ ruleID: z23.string(), revision: revisionSchema }))
774
974
  };
775
975
 
776
976
  // src/contract/task-schema.ts
777
- import { z as z11 } from "zod";
778
- var taskSchema2 = z11.object({
779
- error: z11.string().optional(),
780
- errorLimit: z11.int().positive().optional(),
781
- errors: z11.int().positive().optional(),
782
- isWaitingForRetry: z11.boolean().optional(),
783
- readCursor: z11.int().nonnegative().optional(),
784
- reason: z11.string().optional(),
785
- retryAt: z11.date().optional(),
786
- stepKey: z11.string().optional(),
787
- taskID: z11.string()
977
+ import { z as z24 } from "zod";
978
+ var taskSchema2 = z24.object({
979
+ error: z24.string().optional(),
980
+ errorLimit: z24.int().positive().optional(),
981
+ errors: z24.int().positive().optional(),
982
+ isWaitingForRetry: z24.boolean().optional(),
983
+ readCursor: z24.int().nonnegative().optional(),
984
+ reason: z24.string().optional(),
985
+ retryAt: z24.date().optional(),
986
+ stepKey: z24.string().optional(),
987
+ taskID: z24.string()
788
988
  });
789
989
 
790
990
  // src/contract/tool-call-schema.ts
791
- import { z as z12 } from "zod";
792
- var jsonObjectSchema = z12.record(z12.string(), z12.unknown());
793
- var toolCallSchema = z12.object({
794
- callID: z12.string(),
991
+ import { z as z25 } from "zod";
992
+ var jsonObjectSchema = z25.record(z25.string(), z25.unknown());
993
+ var toolCallSchema = z25.object({
994
+ callID: z25.string(),
795
995
  content: jsonObjectSchema.optional(),
796
996
  input: jsonObjectSchema.optional(),
797
- outcome: z12.string().optional(),
798
- tool: z12.string().optional()
997
+ outcome: z25.string().optional(),
998
+ tool: z25.string().optional()
799
999
  });
800
1000
 
801
1001
  // src/contract/contract.ts
802
- var clientActionIDSchema = z13.uuid();
803
- var sequenceSchema = z13.int().nonnegative();
804
- var threadSchema = z13.string().min(1).max(200);
805
- var imageSchema = z13.object({ mediaType: z13.enum(imageLimits.mediaTypes) });
806
- var imageFilesSchema = z13.array(z13.file());
807
- var imageRefSchema = z13.object({
808
- position: z13.int().nonnegative(),
1002
+ var clientActionIDSchema2 = z26.uuid();
1003
+ var sequenceSchema = z26.int().nonnegative();
1004
+ var threadSchema = z26.string().min(1).max(200);
1005
+ var imageSchema = z26.object({ mediaType: z26.enum(imageLimits.mediaTypes) });
1006
+ var imageFilesSchema = z26.array(z26.file());
1007
+ var imageRefSchema = z26.object({
1008
+ position: z26.int().nonnegative(),
809
1009
  sequence: sequenceSchema,
810
1010
  thread: threadSchema
811
1011
  });
812
- var versionRefSchema = z13.object({
813
- itemID: z13.string().min(1).max(200),
814
- version: z13.int().nonnegative()
1012
+ var versionRefSchema = z26.object({
1013
+ itemID: z26.string().min(1).max(200),
1014
+ version: z26.int().nonnegative()
815
1015
  });
816
- var recallItemSchema = versionRefSchema.extend({ score: z13.number().optional() });
817
- var recallSchema = z13.object({ items: z13.array(recallItemSchema) });
1016
+ var recallItemSchema = versionRefSchema.extend({ score: z26.number().optional() });
1017
+ var recallSchema = z26.object({ items: z26.array(recallItemSchema) });
818
1018
  var ratingItemSchema = versionRefSchema.extend({
819
- hasNote: z13.boolean(),
820
- verdict: z13.enum(["helpful", "noise", "misleading"])
1019
+ hasNote: z26.boolean(),
1020
+ verdict: z26.enum(["helpful", "noise", "misleading"])
821
1021
  });
822
- var ratingSchema = z13.object({
823
- items: z13.array(ratingItemSchema),
824
- ratedBy: z13.string().optional(),
1022
+ var ratingSchema = z26.object({
1023
+ items: z26.array(ratingItemSchema),
1024
+ ratedBy: z26.string().optional(),
825
1025
  recalledSequence: sequenceSchema
826
1026
  });
827
- var tokenCountSchema = z13.int().nonnegative();
828
- var contextSchema = z13.object({ size: tokenCountSchema, window: z13.int().positive() });
829
- var compactionSchema = z13.object({
1027
+ var tokenCountSchema = z26.int().nonnegative();
1028
+ var contextSchema = z26.object({ size: tokenCountSchema, window: z26.int().positive() });
1029
+ var compactionSchema = z26.object({
830
1030
  postTokens: tokenCountSchema.optional(),
831
1031
  preTokens: tokenCountSchema,
832
- trigger: z13.enum(["manual", "auto"])
1032
+ trigger: z26.enum(["manual", "auto"])
833
1033
  });
834
- var summarySchema = z13.object({
1034
+ var summarySchema = z26.object({
835
1035
  contextSize: tokenCountSchema.optional(),
836
1036
  summaryTokens: tokenCountSchema,
837
- text: z13.string().optional(),
838
- trigger: z13.enum(["threshold", "overflow"])
1037
+ text: z26.string().optional(),
1038
+ trigger: z26.enum(["threshold", "overflow"])
839
1039
  });
840
- var compactionFailureSchema = z13.object({ failures: z13.int().positive() });
841
- var ratingNoteRefSchema = z13.object({
842
- itemID: z13.string().min(1).max(200),
1040
+ var compactionFailureSchema = z26.object({ failures: z26.int().positive() });
1041
+ var ratingNoteRefSchema = z26.object({
1042
+ itemID: z26.string().min(1).max(200),
843
1043
  sequence: sequenceSchema
844
1044
  });
845
1045
  var ratingNoteSchema = ratingNoteRefSchema.extend({
846
- status: z13.enum(["readable", "shredded", "unreadable", "missing"]),
847
- text: z13.string().optional()
1046
+ status: z26.enum(["readable", "shredded", "unreadable", "missing"]),
1047
+ text: z26.string().optional()
848
1048
  });
849
1049
  var versionTextSchema = versionRefSchema.extend({
850
- status: z13.enum(["readable", "shredded", "unreadable", "missing"]),
851
- text: z13.string().optional()
1050
+ status: z26.enum(["readable", "shredded", "unreadable", "missing"]),
1051
+ text: z26.string().optional()
852
1052
  });
853
- var listedActionSchema = z13.object({ actionID: z13.string(), tool: z13.string() });
854
- var taskMessageSchema = z13.object({
1053
+ var listedActionSchema = z26.object({ actionID: z26.string(), tool: z26.string() });
1054
+ var taskMessageSchema = z26.object({
855
1055
  from: threadSchema,
856
- fromName: z13.string(),
857
- hop: z13.int().nonnegative(),
858
- kind: z13.string(),
859
- messageID: z13.string(),
860
- replyTo: z13.string().optional(),
861
- text: z13.string().optional(),
1056
+ fromName: z26.string(),
1057
+ hop: z26.int().nonnegative(),
1058
+ kind: z26.string(),
1059
+ messageID: z26.string(),
1060
+ replyTo: z26.string().optional(),
1061
+ text: z26.string().optional(),
862
1062
  to: threadSchema,
863
- woke: z13.boolean()
1063
+ woke: z26.boolean()
864
1064
  });
865
- var exchangeNoticeSchema = z13.object({
866
- link: z13.object({ label: z13.string(), messageID: z13.string(), taskID: threadSchema }),
867
- text: z13.string()
1065
+ var exchangeNoticeSchema = z26.object({
1066
+ link: z26.object({ label: z26.string(), messageID: z26.string(), taskID: threadSchema }),
1067
+ text: z26.string()
868
1068
  });
869
- var recordSchema = z13.object({
1069
+ var recordSchema = z26.object({
870
1070
  compaction: compactionSchema.optional(),
871
1071
  exchangeNotice: exchangeNoticeSchema.optional(),
872
1072
  compactionFailure: compactionFailureSchema.optional(),
873
- forget: z13.object({ sequence: sequenceSchema }).optional(),
1073
+ forget: z26.object({ sequence: sequenceSchema }).optional(),
874
1074
  context: contextSchema.optional(),
875
- isRemoved: z13.literal(true).optional(),
876
- isSilentTurn: z13.literal(true).optional(),
877
- kind: z13.string(),
878
- message: z13.object({
879
- clientMessageId: z13.uuid().optional(),
880
- images: z13.array(imageSchema).optional(),
881
- spans: z13.array(spanSchema).optional(),
882
- text: z13.string()
1075
+ isRemoved: z26.literal(true).optional(),
1076
+ isSilentTurn: z26.literal(true).optional(),
1077
+ kind: z26.string(),
1078
+ message: z26.object({
1079
+ clientMessageId: z26.uuid().optional(),
1080
+ images: z26.array(imageSchema).optional(),
1081
+ spans: z26.array(spanSchema).optional(),
1082
+ text: z26.string()
883
1083
  }).optional(),
884
- moment: z13.object({ momentID: z13.string(), shortID: z13.string(), title: z13.string().optional() }).optional(),
1084
+ moment: z26.object({ momentID: z26.string(), shortID: z26.string(), title: z26.string().optional() }).optional(),
885
1085
  rating: ratingSchema.optional(),
886
- proposal: z13.object({ proposalID: z13.string(), shortID: z13.string() }).optional(),
1086
+ proposal: z26.object({ proposalID: z26.string(), shortID: z26.string() }).optional(),
887
1087
  recall: recallSchema.optional(),
888
- recordedAt: z13.date(),
1088
+ recordedAt: z26.date(),
889
1089
  sequence: sequenceSchema,
890
- stop: z13.object({ cancelledActions: z13.array(listedActionSchema) }).optional(),
1090
+ stop: z26.object({ cancelledActions: z26.array(listedActionSchema) }).optional(),
891
1091
  summary: summarySchema.optional(),
892
1092
  thread: threadSchema,
893
1093
  task: taskSchema2.optional(),
894
1094
  taskMessage: taskMessageSchema.optional(),
895
1095
  toolCall: toolCallSchema.optional()
896
1096
  });
897
- var writerErrorSchema = z13.object({ at: z13.date(), code: z13.string(), message: z13.string().nullable() }).nullable();
898
- var sessionSchema = z13.object({
899
- createdAt: z13.date(),
900
- current: z13.boolean(),
901
- deviceName: z13.string(),
902
- lastUsedAt: z13.date(),
903
- sessionID: z13.uuid()
1097
+ var writerErrorSchema = z26.object({ at: z26.date(), code: z26.string(), message: z26.string().nullable() }).nullable();
1098
+ var sessionSchema = z26.object({
1099
+ createdAt: z26.date(),
1100
+ current: z26.boolean(),
1101
+ deviceName: z26.string(),
1102
+ lastUsedAt: z26.date(),
1103
+ sessionID: z26.uuid()
904
1104
  });
905
1105
  var checkedAction = signedIn.errors(reusedIDErrors);
906
- var taskStateSchema2 = z13.enum([
1106
+ var taskStateSchema2 = z26.enum([
907
1107
  "ready",
908
1108
  "running",
909
1109
  "waiting",
@@ -913,33 +1113,33 @@ var taskStateSchema2 = z13.enum([
913
1113
  "failed",
914
1114
  "closed"
915
1115
  ]);
916
- var taskControlSchema = z13.enum(["pause", "resume", "stop", "restart", "close", "interrupt"]);
917
- var actionCountSchema = z13.int().nonnegative();
918
- var forgetPreviewItemSchema = z13.object({ itemID: z13.string(), text: z13.string() });
919
- var recordForgetPreviewSchema = z13.object({
1116
+ var taskControlSchema = z26.enum(["pause", "resume", "stop", "restart", "close", "interrupt"]);
1117
+ var actionCountSchema = z26.int().nonnegative();
1118
+ var forgetPreviewItemSchema = z26.object({ itemID: z26.string(), text: z26.string() });
1119
+ var recordForgetPreviewSchema = z26.object({
920
1120
  momentCount: actionCountSchema,
921
- memoryItems: z13.array(forgetPreviewItemSchema)
1121
+ memoryItems: z26.array(forgetPreviewItemSchema)
922
1122
  });
923
- var listedTaskSchema = z13.object({
924
- actions: z13.object({
1123
+ var listedTaskSchema = z26.object({
1124
+ actions: z26.object({
925
1125
  cancelled: actionCountSchema,
926
1126
  queued: actionCountSchema,
927
1127
  started: actionCountSchema
928
1128
  }),
929
- brief: z13.string(),
930
- controls: z13.array(taskControlSchema),
931
- isPauseRequested: z13.boolean(),
932
- isPausedByNixie: z13.boolean(),
933
- isTakingMessages: z13.boolean(),
934
- lastActivityAt: z13.date(),
935
- name: z13.string(),
1129
+ brief: z26.string(),
1130
+ controls: z26.array(taskControlSchema),
1131
+ isPauseRequested: z26.boolean(),
1132
+ isPausedByNixie: z26.boolean(),
1133
+ isTakingMessages: z26.boolean(),
1134
+ lastActivityAt: z26.date(),
1135
+ name: z26.string(),
936
1136
  state: taskStateSchema2,
937
1137
  taskID: threadSchema,
938
1138
  waitingOn: threadSchema.optional()
939
1139
  });
940
- var controlledTaskSchema = z13.object({
941
- controlledAt: z13.date(),
942
- isPauseRequested: z13.boolean(),
1140
+ var controlledTaskSchema = z26.object({
1141
+ controlledAt: z26.date(),
1142
+ isPauseRequested: z26.boolean(),
943
1143
  state: taskStateSchema2,
944
1144
  taskID: threadSchema
945
1145
  });
@@ -948,53 +1148,53 @@ var taskControl = checkedAction.errors({
948
1148
  TASK_STATE_REFUSED: {
949
1149
  message: "The task is in a state that does not take this control",
950
1150
  status: 409,
951
- data: z13.object({ isPauseRequested: z13.boolean(), state: taskStateSchema2 })
1151
+ data: z26.object({ isPauseRequested: z26.boolean(), state: taskStateSchema2 })
952
1152
  }
953
- }).input(z13.object({ clientActionID: clientActionIDSchema, taskID: threadSchema })).output(controlledTaskSchema);
954
- var nixieControl = checkedAction.input(z13.object({ clientActionID: clientActionIDSchema })).output(z13.object({ paused: pauseStateSchema }));
955
- var backupNoticeSchema = z13.object({
956
- cause: z13.enum(["failed", "missing"]),
957
- sequence: z13.int().positive(),
958
- raisedAt: z13.date()
959
- });
960
- var followRecords = signedIn.input(z13.object({ afterSequence: sequenceSchema, thread: threadSchema.optional() })).output(eventIterator2(z13.object({ record: recordSchema })));
1153
+ }).input(z26.object({ clientActionID: clientActionIDSchema2, taskID: threadSchema })).output(controlledTaskSchema);
1154
+ var nixieControl = checkedAction.input(z26.object({ clientActionID: clientActionIDSchema2 })).output(z26.object({ paused: pauseStateSchema }));
1155
+ var backupNoticeSchema = z26.object({
1156
+ cause: z26.enum(["failed", "missing"]),
1157
+ sequence: z26.int().positive(),
1158
+ raisedAt: z26.date()
1159
+ });
1160
+ var followRecords = signedIn.input(z26.object({ afterSequence: sequenceSchema, thread: threadSchema.optional() })).output(eventIterator2(z26.object({ record: recordSchema })));
961
1161
  var contract = {
962
1162
  conversation: {
963
- read: signedIn.errors({ THREAD_NOT_FOUND: { message: "No thread has this ID", status: 404 } }).input(z13.object({
1163
+ read: signedIn.errors({ THREAD_NOT_FOUND: { message: "No thread has this ID", status: 404 } }).input(z26.object({
964
1164
  beforeSequence: sequenceSchema.optional(),
965
- limit: z13.int().min(1).max(200).optional(),
1165
+ limit: z26.int().min(1).max(200).optional(),
966
1166
  thread: threadSchema
967
- })).output(z13.object({
968
- hasEarlier: z13.boolean(),
1167
+ })).output(z26.object({
1168
+ hasEarlier: z26.boolean(),
969
1169
  readAtSequence: sequenceSchema,
970
- records: z13.array(recordSchema),
1170
+ records: z26.array(recordSchema),
971
1171
  lastStepEnd: recordSchema.nullable().optional()
972
1172
  })),
973
1173
  send: checkedAction.errors({
974
1174
  IMAGE_REFUSED: imageRefusedError,
975
1175
  THREAD_NOT_FOUND: { message: "No thread has this ID", status: 404 }
976
- }).input(z13.object({
977
- clientMessageId: clientActionIDSchema,
1176
+ }).input(z26.object({
1177
+ clientMessageId: clientActionIDSchema2,
978
1178
  images: imageFilesSchema.optional(),
979
- spans: z13.array(spanSchema).max(1e5),
980
- text: z13.string().min(1).max(1e5),
1179
+ spans: z26.array(spanSchema).max(1e5),
1180
+ text: z26.string().min(1).max(1e5),
981
1181
  thread: threadSchema,
982
- timeZone: z13.string().min(1).max(100).optional(),
983
- writtenAt: z13.iso.datetime().optional()
984
- })).output(z13.object({ duplicate: z13.boolean(), sequence: sequenceSchema })),
1182
+ timeZone: z26.string().min(1).max(100).optional(),
1183
+ writtenAt: z26.iso.datetime().optional()
1184
+ })).output(z26.object({ duplicate: z26.boolean(), sequence: sequenceSchema })),
985
1185
  retry: checkedAction.errors({
986
1186
  NOTHING_TO_RETRY: {
987
1187
  message: "The last turn of the conversation did not fail, or it runs again already",
988
1188
  status: 409
989
1189
  }
990
- }).input(z13.object({ clientActionID: clientActionIDSchema })).output(z13.object({ retriedAt: z13.date() })),
991
- readImage: signedIn.errors({ IMAGE_NOT_FOUND: imageNotFoundError }).input(imageRefSchema).output(z13.file()),
1190
+ }).input(z26.object({ clientActionID: clientActionIDSchema2 })).output(z26.object({ retriedAt: z26.date() })),
1191
+ readImage: signedIn.errors({ IMAGE_NOT_FOUND: imageNotFoundError }).input(imageRefSchema).output(z26.file()),
992
1192
  previewForget: signedIn.errors({
993
1193
  RECORD_NOT_FOUND: {
994
1194
  message: "No record on this thread with its own text that a forget removes has this sequence",
995
1195
  status: 404
996
1196
  }
997
- }).input(z13.object({ thread: threadSchema, sequence: sequenceSchema })).output(recordForgetPreviewSchema),
1197
+ }).input(z26.object({ thread: threadSchema, sequence: sequenceSchema })).output(recordForgetPreviewSchema),
998
1198
  forget: checkedAction.errors({
999
1199
  RECORD_NOT_FOUND: {
1000
1200
  message: "No record on this thread with its own text that a forget removes has this sequence",
@@ -1004,18 +1204,18 @@ var contract = {
1004
1204
  message: "The queued action has not run yet. Cancel it, or wait for it to run.",
1005
1205
  status: 409
1006
1206
  }
1007
- }).input(z13.object({
1008
- clientActionID: clientActionIDSchema,
1207
+ }).input(z26.object({
1208
+ clientActionID: clientActionIDSchema2,
1009
1209
  sequence: sequenceSchema,
1010
1210
  thread: threadSchema
1011
- })).output(z13.object({ forgottenAt: z13.date(), backup: forgetBackupSchema }))
1211
+ })).output(z26.object({ forgottenAt: z26.date(), backup: forgetBackupSchema }))
1012
1212
  },
1013
1213
  tasks: {
1014
- list: signedIn.output(z13.object({ readAtSequence: sequenceSchema, tasks: z13.array(listedTaskSchema) })),
1015
- read: signedIn.errors({ TASK_NOT_FOUND: { message: "No task has this ID", status: 404 } }).input(z13.object({ taskID: threadSchema })).output(listedTaskSchema),
1016
- readActions: signedIn.errors({ TASK_NOT_FOUND: { message: "No task has this ID", status: 404 } }).input(z13.object({ taskID: threadSchema })).output(z13.object({
1017
- queued: z13.array(listedActionSchema),
1018
- started: z13.array(listedActionSchema)
1214
+ list: signedIn.output(z26.object({ readAtSequence: sequenceSchema, tasks: z26.array(listedTaskSchema) })),
1215
+ read: signedIn.errors({ TASK_NOT_FOUND: { message: "No task has this ID", status: 404 } }).input(z26.object({ taskID: threadSchema })).output(listedTaskSchema),
1216
+ readActions: signedIn.errors({ TASK_NOT_FOUND: { message: "No task has this ID", status: 404 } }).input(z26.object({ taskID: threadSchema })).output(z26.object({
1217
+ queued: z26.array(listedActionSchema),
1218
+ started: z26.array(listedActionSchema)
1019
1219
  })),
1020
1220
  pause: taskControl,
1021
1221
  resume: taskControl,
@@ -1027,34 +1227,34 @@ var contract = {
1027
1227
  interrupt: taskControl
1028
1228
  },
1029
1229
  memory: {
1030
- readVersions: signedIn.input(z13.object({ versions: z13.array(versionRefSchema).min(1).max(100) })).output(z13.object({ versions: z13.array(versionTextSchema) })),
1031
- readRatingNotes: signedIn.input(z13.object({ notes: z13.array(ratingNoteRefSchema).min(1).max(100) })).output(z13.object({ notes: z13.array(ratingNoteSchema) })),
1032
- writerStatus: signedIn.output(z13.object({
1033
- isEnabled: z13.boolean(),
1034
- backlog: z13.int().nonnegative(),
1035
- batches: z13.int().nonnegative(),
1230
+ readVersions: signedIn.input(z26.object({ versions: z26.array(versionRefSchema).min(1).max(100) })).output(z26.object({ versions: z26.array(versionTextSchema) })),
1231
+ readRatingNotes: signedIn.input(z26.object({ notes: z26.array(ratingNoteRefSchema).min(1).max(100) })).output(z26.object({ notes: z26.array(ratingNoteSchema) })),
1232
+ writerStatus: signedIn.route({ deprecated: true }).output(z26.object({
1233
+ isEnabled: z26.boolean(),
1234
+ backlog: z26.int().nonnegative(),
1235
+ batches: z26.int().nonnegative(),
1036
1236
  cursor: sequenceSchema,
1037
- failures: z13.int().nonnegative(),
1038
- isCatchingUp: z13.boolean(),
1237
+ failures: z26.int().nonnegative(),
1238
+ isCatchingUp: z26.boolean(),
1039
1239
  lastError: writerErrorSchema,
1040
- retryAt: z13.date().nullable()
1240
+ retryAt: z26.date().nullable()
1041
1241
  })),
1042
- consolidatorStatus: signedIn.output(z13.object({ isEnabled: z13.boolean() })),
1043
1242
  ...memoryViewContract
1044
1243
  },
1045
1244
  nixie: {
1046
- read: signedIn.output(z13.object({ paused: pauseStateSchema })),
1245
+ read: signedIn.output(z26.object({ paused: pauseStateSchema })),
1047
1246
  pause: nixieControl,
1048
1247
  resume: nixieControl
1049
1248
  },
1050
1249
  recovery: {
1051
- read: signedIn.output(z13.object({ recovery: recoverySchema }))
1250
+ read: signedIn.output(z26.object({ recovery: recoverySchema }))
1052
1251
  },
1053
1252
  backups: {
1054
- readNotice: signedIn.output(z13.object({ notice: backupNoticeSchema.nullable() }))
1253
+ readNotice: signedIn.output(z26.object({ notice: backupNoticeSchema.nullable() }))
1055
1254
  },
1056
1255
  rules: ruleContract,
1057
1256
  approvals: approvalContract,
1257
+ passkeys: passkeyContract,
1058
1258
  log: {
1059
1259
  follow: followRecords.route({ deprecated: true })
1060
1260
  },
@@ -1067,28 +1267,28 @@ var contract = {
1067
1267
  message: "The enrolment code is unknown, used or lapsed",
1068
1268
  status: 400
1069
1269
  }
1070
- }).input(z13.object({
1071
- clientActionID: clientActionIDSchema,
1072
- code: z13.string().min(1).max(100),
1073
- deviceName: z13.string().min(1).max(100),
1074
- tokenDelivery: z13.enum(["cookie", "bearer"])
1075
- })).output(z13.object({ sessionID: z13.uuid(), token: z13.string().optional() })),
1076
- issueCode: checkedAction.input(z13.object({ clientActionID: clientActionIDSchema })).output(z13.object({ code: z13.string(), expiresAt: z13.date() })),
1077
- list: signedIn.output(z13.object({ sessions: z13.array(sessionSchema) })),
1078
- revoke: checkedAction.errors({ SESSION_NOT_FOUND: { message: "No session has this ID", status: 404 } }).input(z13.object({ clientActionID: clientActionIDSchema, sessionID: z13.uuid() })).output(z13.object({ revokedAt: z13.date() }))
1270
+ }).input(z26.object({
1271
+ clientActionID: clientActionIDSchema2,
1272
+ code: z26.string().min(1).max(100),
1273
+ deviceName: z26.string().min(1).max(100),
1274
+ tokenDelivery: z26.enum(["cookie", "bearer"])
1275
+ })).output(z26.object({ sessionID: z26.uuid(), token: z26.string().optional() })),
1276
+ issueCode: checkedAction.input(z26.object({ clientActionID: clientActionIDSchema2 })).output(z26.object({ code: z26.string(), expiresAt: z26.date() })),
1277
+ list: signedIn.output(z26.object({ sessions: z26.array(sessionSchema) })),
1278
+ revoke: checkedAction.errors({ SESSION_NOT_FOUND: { message: "No session has this ID", status: 404 } }).input(z26.object({ clientActionID: clientActionIDSchema2, sessionID: z26.uuid() })).output(z26.object({ revokedAt: z26.date() }))
1079
1279
  }
1080
1280
  };
1081
1281
  // src/contract/host-contract.ts
1082
- import { oc as oc4 } from "@orpc/contract";
1083
- import { z as z19 } from "zod";
1282
+ import { oc as oc5 } from "@orpc/contract";
1283
+ import { z as z33 } from "zod";
1084
1284
 
1085
1285
  // src/contract/action-proposal-schema.ts
1086
- import { z as z14 } from "zod";
1087
- var actionProposalSchema = z14.object({
1088
- proposalID: z14.string(),
1089
- tool: z14.string(),
1090
- effects: z14.array(z14.string()),
1091
- cause: z14.enum([
1286
+ import { z as z27 } from "zod";
1287
+ var actionProposalSchema = z27.object({
1288
+ proposalID: z27.string(),
1289
+ tool: z27.string(),
1290
+ effects: z27.array(z27.string()),
1291
+ cause: z27.enum([
1092
1292
  "outside_steering",
1093
1293
  "always_ask",
1094
1294
  "ask_rule",
@@ -1096,33 +1296,55 @@ var actionProposalSchema = z14.object({
1096
1296
  "direct_request",
1097
1297
  "repeat"
1098
1298
  ]),
1099
- sentence: z14.string(),
1100
- destinations: z14.array(z14.string()),
1101
- createdAt: z14.date(),
1102
- lapseAt: z14.date()
1299
+ sentence: z27.string(),
1300
+ destinations: z27.array(z27.string()),
1301
+ createdAt: z27.date(),
1302
+ lapseAt: z27.date()
1103
1303
  });
1104
1304
 
1305
+ // src/contract/host-passkey-contract.ts
1306
+ import { oc as oc3 } from "@orpc/contract";
1307
+ import { z as z28 } from "zod";
1308
+ var hostPasskeySchema = z28.object({
1309
+ passkeyID: z28.string(),
1310
+ label: z28.string(),
1311
+ synced: z28.boolean(),
1312
+ origin: z28.string(),
1313
+ registeredBy: z28.string(),
1314
+ authorizedBy: z28.string(),
1315
+ registeredAt: z28.date(),
1316
+ lastUsedAt: z28.date().nullable(),
1317
+ revokedAt: z28.date().nullable()
1318
+ });
1319
+ var hostPasskeyContract = {
1320
+ issueCode: oc3.output(z28.object({ code: z28.string(), expiresAt: z28.date() })),
1321
+ list: oc3.output(z28.array(hostPasskeySchema)),
1322
+ revoke: oc3.errors({
1323
+ PASSKEY_NOT_FOUND: { message: "no passkey has that ID", status: 404 }
1324
+ }).input(z28.strictObject({ passkeyID: z28.string().min(1) })).output(z28.object({ passkeyID: z28.string(), revokedAt: z28.date() }))
1325
+ };
1326
+
1105
1327
  // src/contract/known-contact-schema.ts
1106
- import { z as z15 } from "zod";
1107
- var knownContactSchema = z15.object({
1108
- contactID: z15.string(),
1109
- name: z15.string().nullable(),
1110
- destination: z15.string().nullable(),
1111
- markedAt: z15.date()
1328
+ import { z as z29 } from "zod";
1329
+ var knownContactSchema = z29.object({
1330
+ contactID: z29.string(),
1331
+ name: z29.string().nullable(),
1332
+ destination: z29.string().nullable(),
1333
+ markedAt: z29.date()
1112
1334
  });
1113
1335
 
1114
1336
  // src/contract/turn-inputs-contract.ts
1115
- import { oc as oc3 } from "@orpc/contract";
1116
- import { z as z18 } from "zod";
1337
+ import { oc as oc4 } from "@orpc/contract";
1338
+ import { z as z32 } from "zod";
1117
1339
 
1118
1340
  // src/contract/input-miss-schema.ts
1119
- import { z as z16 } from "zod";
1120
- var inputMissSchema = z16.object({
1121
- missID: z16.string(),
1122
- captureID: z16.string().nullable(),
1123
- taskID: z16.string(),
1124
- stepRunID: z16.string(),
1125
- reason: z16.enum([
1341
+ import { z as z30 } from "zod";
1342
+ var inputMissSchema = z30.object({
1343
+ missID: z30.string(),
1344
+ captureID: z30.string().nullable(),
1345
+ taskID: z30.string(),
1346
+ stepRunID: z30.string(),
1347
+ reason: z30.enum([
1126
1348
  "queue_full",
1127
1349
  "spool_full",
1128
1350
  "spool_write_failed",
@@ -1134,46 +1356,46 @@ var inputMissSchema = z16.object({
1134
1356
  "intake_failed",
1135
1357
  "holds_own_value"
1136
1358
  ]),
1137
- count: z16.int().positive(),
1138
- writer: z16.string().nullable(),
1139
- counter: z16.int().nullable(),
1140
- createdAt: z16.date()
1359
+ count: z30.int().positive(),
1360
+ writer: z30.string().nullable(),
1361
+ counter: z30.int().nullable(),
1362
+ createdAt: z30.date()
1141
1363
  });
1142
1364
 
1143
1365
  // src/contract/logged-input-schema.ts
1144
- import { z as z17 } from "zod";
1145
- var loggedInputSchema = z17.object({
1146
- inputID: z17.string(),
1147
- captureID: z17.string(),
1148
- taskID: z17.string(),
1149
- stepRunID: z17.string(),
1150
- writer: z17.string(),
1151
- counter: z17.int(),
1152
- role: z17.string(),
1153
- profile: z17.string(),
1154
- model: z17.string(),
1155
- harness: z17.string(),
1156
- api: z17.string(),
1157
- endpoint: z17.string(),
1158
- route: z17.string(),
1159
- isRewritten: z17.boolean(),
1160
- upstreamStatus: z17.int(),
1161
- bytes: z17.int(),
1162
- intakeSequence: z17.int(),
1163
- receivedAt: z17.date(),
1164
- takenAt: z17.date(),
1165
- state: z17.enum(["writing", "stored", "missing", "removed"]),
1166
- removedCause: z17.enum(["retention_days", "retention_bytes", "forget", "dropped", "restore", "reset"]).nullable()
1366
+ import { z as z31 } from "zod";
1367
+ var loggedInputSchema = z31.object({
1368
+ inputID: z31.string(),
1369
+ captureID: z31.string(),
1370
+ taskID: z31.string(),
1371
+ stepRunID: z31.string(),
1372
+ writer: z31.string(),
1373
+ counter: z31.int(),
1374
+ role: z31.string(),
1375
+ profile: z31.string(),
1376
+ model: z31.string(),
1377
+ harness: z31.string(),
1378
+ api: z31.string(),
1379
+ endpoint: z31.string(),
1380
+ route: z31.string(),
1381
+ isRewritten: z31.boolean(),
1382
+ upstreamStatus: z31.int(),
1383
+ bytes: z31.int(),
1384
+ intakeSequence: z31.int(),
1385
+ receivedAt: z31.date(),
1386
+ takenAt: z31.date(),
1387
+ state: z31.enum(["writing", "stored", "missing", "removed"]),
1388
+ removedCause: z31.enum(["retention_days", "retention_bytes", "forget", "dropped", "restore", "reset"]).nullable()
1167
1389
  });
1168
1390
 
1169
1391
  // src/contract/turn-inputs-contract.ts
1170
- var turnInputOn = z18.strictObject({
1171
- state: z18.literal("on"),
1172
- forMs: z18.int().positive().nullable()
1392
+ var turnInputOn = z32.strictObject({
1393
+ state: z32.literal("on"),
1394
+ forMs: z32.int().positive().nullable()
1173
1395
  });
1174
- var turnInputOff = z18.strictObject({ state: z18.literal("off"), drop: z18.boolean() });
1175
- var turnInputSetSchema = z18.discriminatedUnion("state", [turnInputOn, turnInputOff]);
1176
- var turnInputs = oc3.errors({
1396
+ var turnInputOff = z32.strictObject({ state: z32.literal("off"), drop: z32.boolean() });
1397
+ var turnInputSetSchema = z32.discriminatedUnion("state", [turnInputOn, turnInputOff]);
1398
+ var turnInputs = oc4.errors({
1177
1399
  NOT_FOUND: { message: "no logged request has that ID", status: 404 },
1178
1400
  REMOVED: { message: "that request is removed or its body is missing", status: 410 },
1179
1401
  OPEN_NOT_RECORDED: {
@@ -1182,27 +1404,27 @@ var turnInputs = oc3.errors({
1182
1404
  },
1183
1405
  NOT_CONFIGURED: { message: "the turn-input log is not configured", status: 409 }
1184
1406
  });
1185
- var listedInputsSchema = z18.object({
1186
- inputs: z18.array(loggedInputSchema),
1187
- misses: z18.array(inputMissSchema)
1407
+ var listedInputsSchema = z32.object({
1408
+ inputs: z32.array(loggedInputSchema),
1409
+ misses: z32.array(inputMissSchema)
1188
1410
  });
1189
1411
  var turnInputsContract = {
1190
- list: turnInputs.input(z18.strictObject({ limit: z18.int().positive().max(500).default(50) })).output(listedInputsSchema),
1191
- open: turnInputs.input(z18.strictObject({ inputID: z18.string().min(1) })).output(z18.object({ inputID: z18.string(), body: z18.base64() })),
1192
- set: turnInputs.input(turnInputSetSchema).output(z18.object({ state: z18.enum(["on", "off"]), until: z18.number().nullable() }))
1412
+ list: turnInputs.input(z32.strictObject({ limit: z32.int().positive().max(500).default(50) })).output(listedInputsSchema),
1413
+ open: turnInputs.input(z32.strictObject({ inputID: z32.string().min(1) })).output(z32.object({ inputID: z32.string(), body: z32.base64() })),
1414
+ set: turnInputs.input(turnInputSetSchema).output(z32.object({ state: z32.enum(["on", "off"]), until: z32.number().nullable() }))
1193
1415
  };
1194
1416
 
1195
1417
  // src/contract/host-contract.ts
1196
- var versionRefSchema2 = z19.object({ itemID: z19.string(), version: z19.int().positive() });
1197
- var versionTargetSchema2 = z19.strictObject({
1198
- itemID: z19.string().min(1),
1199
- version: z19.int().positive()
1200
- });
1201
- var itemTextSchema = z19.string().max(2000).regex(/\S/u);
1202
- var proposalOriginSchema2 = z19.enum(["owner", "conversation", "task", "memory_writer"]);
1203
- var memoryOriginSchema = z19.enum([...proposalOriginSchema2.options, "lapse"]);
1204
- var contentSourceSchema = z19.enum(["owner", "owner_data", "untrusted"]);
1205
- var reviewReasonSchema2 = z19.enum([
1418
+ var versionRefSchema2 = z33.object({ itemID: z33.string(), version: z33.int().positive() });
1419
+ var versionTargetSchema2 = z33.strictObject({
1420
+ itemID: z33.string().min(1),
1421
+ version: z33.int().positive()
1422
+ });
1423
+ var itemTextSchema = z33.string().max(2000).regex(/\S/u);
1424
+ var proposalOriginSchema2 = z33.enum(["owner", "conversation", "task"]);
1425
+ var memoryOriginSchema = z33.enum([...proposalOriginSchema2.options, "lapse"]);
1426
+ var contentSourceSchema = z33.enum(["owner", "owner_data", "untrusted"]);
1427
+ var reviewReasonSchema2 = z33.enum([
1206
1428
  "no_quote",
1207
1429
  "quote_not_typed",
1208
1430
  "quote_in_quoted_block",
@@ -1221,107 +1443,69 @@ var reviewReasonSchema2 = z19.enum([
1221
1443
  "subject_change",
1222
1444
  "ask_rule"
1223
1445
  ]);
1224
- var proposalSourceSchema2 = z19.object({
1446
+ var proposalSourceSchema2 = z33.object({
1225
1447
  origin: proposalOriginSchema2,
1226
- thread: z19.string().nullable(),
1227
- proposedAt: z19.date()
1228
- });
1229
- var pendingProposalSchema = z19.object({
1230
- proposalID: z19.string(),
1231
- operation: z19.enum(["remember", "retire", "pin"]),
1232
- itemID: z19.string(),
1233
- targetVersion: z19.int().nullable(),
1234
- isPinned: z19.boolean(),
1235
- subject: z19.enum(["owner", "self", "shared"]),
1236
- newSubject: z19.enum(["owner", "self", "shared"]).nullable(),
1237
- isSensitive: z19.boolean(),
1238
- kind: z19.enum(["fact", "self"]),
1448
+ thread: z33.string().nullable(),
1449
+ proposedAt: z33.date()
1450
+ });
1451
+ var pendingProposalSchema = z33.object({
1452
+ proposalID: z33.string(),
1453
+ operation: z33.enum(["remember", "retire", "pin"]),
1454
+ itemID: z33.string(),
1455
+ targetVersion: z33.int().nullable(),
1456
+ isPinned: z33.boolean(),
1457
+ subject: z33.enum(["owner", "self", "shared"]),
1458
+ newSubject: z33.enum(["owner", "self", "shared"]).nullable(),
1459
+ isSensitive: z33.boolean(),
1460
+ kind: z33.enum(["fact", "self"]),
1239
1461
  reason: reviewReasonSchema2,
1240
- actionHash: z19.string(),
1462
+ actionHash: z33.string(),
1241
1463
  origin: proposalOriginSchema2,
1242
1464
  source: contentSourceSchema,
1243
- createdAt: z19.date(),
1244
- lapseAt: z19.date(),
1245
- sources: z19.array(proposalSourceSchema2),
1246
- text: z19.string(),
1247
- quote: z19.string().nullable()
1248
- });
1249
- var closeMatchSchema2 = z19.object({ itemID: z19.string(), version: z19.int(), text: z19.string() });
1250
- var approvalResultSchema = z19.discriminatedUnion("status", [
1251
- z19.object({ status: z19.literal("applied"), itemID: z19.string(), version: z19.int() }),
1252
- z19.object({ status: z19.literal("close_match"), item: closeMatchSchema2 })
1465
+ createdAt: z33.date(),
1466
+ lapseAt: z33.date(),
1467
+ sources: z33.array(proposalSourceSchema2),
1468
+ text: z33.string(),
1469
+ quote: z33.string().nullable()
1470
+ });
1471
+ var closeMatchSchema2 = z33.object({ itemID: z33.string(), version: z33.int(), text: z33.string() });
1472
+ var approvalResultSchema = z33.discriminatedUnion("status", [
1473
+ z33.object({ status: z33.literal("applied"), itemID: z33.string(), version: z33.int() }),
1474
+ z33.object({ status: z33.literal("close_match"), item: closeMatchSchema2 })
1253
1475
  ]);
1254
- var historyVersionSchema = z19.object({
1255
- version: z19.int(),
1256
- change: z19.enum(["created", "edited", "retired", "restored", "undone"]),
1257
- state: z19.enum(["active", "retired"]),
1476
+ var historyVersionSchema = z33.object({
1477
+ version: z33.int(),
1478
+ change: z33.enum(["created", "edited", "retired", "restored", "undone"]),
1479
+ state: z33.enum(["active", "retired"]),
1258
1480
  origin: memoryOriginSchema,
1259
1481
  source: contentSourceSchema,
1260
- recordedAt: z19.date(),
1261
- status: z19.enum(["readable", "shredded", "unreadable"]),
1262
- text: z19.string().nullable()
1263
- });
1264
- var itemHistorySchema = z19.object({
1265
- itemID: z19.string(),
1266
- subject: z19.enum(["owner", "self", "shared"]),
1267
- kind: z19.enum(["fact", "self"]),
1268
- state: z19.enum(["active", "retired", "forgetting", "forgotten"]),
1269
- versions: z19.array(historyVersionSchema)
1270
- });
1271
- var changeInputSchema = z19.object({
1272
- itemID: z19.string(),
1273
- version: z19.int(),
1274
- text: z19.string().nullable(),
1275
- isCurrent: z19.boolean()
1276
- });
1277
- var changeCommentSchema = z19.object({ text: z19.string(), at: z19.date() });
1278
- var consolidationChangeSchema = z19.object({
1279
- changeID: z19.string(),
1280
- shortID: z19.string(),
1281
- kind: z19.enum(["merge", "rewrite", "retire"]),
1282
- inputs: z19.array(changeInputSchema),
1283
- text: z19.string().nullable(),
1284
- reason: z19.string(),
1285
- source: contentSourceSchema,
1286
- actionHash: z19.string(),
1287
- lapseAt: z19.date(),
1288
- comment: changeCommentSchema.nullable()
1289
- });
1290
- var consolidationDiffSchema = z19.object({
1291
- diffID: z19.string(),
1292
- model: z19.string().nullable(),
1293
- createdAt: z19.date(),
1294
- changes: z19.array(consolidationChangeSchema),
1295
- summary: z19.string().nullable()
1296
- });
1297
- var changeOutcomeSchema = z19.discriminatedUnion("status", [
1298
- z19.object({
1299
- changeID: z19.string(),
1300
- status: z19.literal("applied"),
1301
- versions: z19.array(versionRefSchema2)
1302
- }),
1303
- z19.object({ changeID: z19.string(), status: z19.literal("refused"), code: z19.string() })
1304
- ]);
1305
- var changeAnswerSchema = z19.strictObject({
1306
- changeID: z19.string().min(1),
1307
- actionHash: z19.string().min(1)
1308
- });
1309
- var proposalAnswerSchema = z19.strictObject({
1310
- proposalID: z19.string().min(1),
1311
- actionHash: z19.string().min(1)
1312
- });
1313
- var hostSessionSchema = z19.object({
1314
- sessionID: z19.string(),
1315
- deviceName: z19.string(),
1316
- createdAt: z19.date(),
1317
- lastUsedAt: z19.date()
1318
- });
1319
- var subjectCountSchema = z19.object({
1320
- owner: z19.int().nonnegative(),
1321
- shared: z19.int().nonnegative(),
1322
- self: z19.int().nonnegative()
1323
- });
1324
- var memory = oc4.errors({
1482
+ recordedAt: z33.date(),
1483
+ status: z33.enum(["readable", "shredded", "unreadable"]),
1484
+ text: z33.string().nullable()
1485
+ });
1486
+ var itemHistorySchema = z33.object({
1487
+ itemID: z33.string(),
1488
+ subject: z33.enum(["owner", "self", "shared"]),
1489
+ kind: z33.enum(["fact", "self"]),
1490
+ state: z33.enum(["active", "retired", "forgetting", "forgotten"]),
1491
+ versions: z33.array(historyVersionSchema)
1492
+ });
1493
+ var proposalAnswerSchema = z33.strictObject({
1494
+ proposalID: z33.string().min(1),
1495
+ actionHash: z33.string().min(1)
1496
+ });
1497
+ var hostSessionSchema = z33.object({
1498
+ sessionID: z33.string(),
1499
+ deviceName: z33.string(),
1500
+ createdAt: z33.date(),
1501
+ lastUsedAt: z33.date()
1502
+ });
1503
+ var subjectCountSchema = z33.object({
1504
+ owner: z33.int().nonnegative(),
1505
+ shared: z33.int().nonnegative(),
1506
+ self: z33.int().nonnegative()
1507
+ });
1508
+ var memory = oc5.errors({
1325
1509
  MEMORY_NOT_STARTED: { message: "the memory store has not started yet", status: 503 },
1326
1510
  NOT_FOUND: { message: "nothing has that ID", status: 404 },
1327
1511
  PROPOSAL_HASH: { message: "the action hash names another proposal", status: 409 },
@@ -1334,30 +1518,30 @@ var memory = oc4.errors({
1334
1518
  PIN_EDIT: { message: "a pin takes no edited text", status: 400 },
1335
1519
  SELF_NOTE_REFUSED: { message: "a self-note never takes that change", status: 409 }
1336
1520
  });
1337
- var skillFileSchema = z19.object({ path: z19.string(), text: z19.string() });
1338
- var pendingSkillProposalSchema = z19.object({
1339
- proposalID: z19.string(),
1340
- name: z19.string(),
1341
- skillHash: z19.string(),
1342
- baseHash: z19.string().nullable(),
1343
- files: z19.array(skillFileSchema),
1344
- inForce: z19.object({
1345
- skillHash: z19.string(),
1346
- origin: z19.enum(["definitions", "vendored", "nixie"]),
1347
- files: z19.array(skillFileSchema)
1521
+ var skillFileSchema = z33.object({ path: z33.string(), text: z33.string() });
1522
+ var pendingSkillProposalSchema = z33.object({
1523
+ proposalID: z33.string(),
1524
+ name: z33.string(),
1525
+ skillHash: z33.string(),
1526
+ baseHash: z33.string().nullable(),
1527
+ files: z33.array(skillFileSchema),
1528
+ inForce: z33.object({
1529
+ skillHash: z33.string(),
1530
+ origin: z33.enum(["definitions", "vendored", "nixie"]),
1531
+ files: z33.array(skillFileSchema)
1348
1532
  }).nullable(),
1349
- untypedToken: z19.object({ kind: z19.string(), raw: z19.string() }).nullable(),
1350
- thread: z19.string().nullable(),
1351
- provenance: z19.object({ runID: z19.string(), callID: z19.string(), profile: z19.string() }),
1352
- createdAt: z19.date(),
1353
- lapseAt: z19.date(),
1354
- isStale: z19.boolean()
1355
- });
1356
- var skillAnswerSchema = z19.strictObject({
1357
- proposalID: z19.string().min(1),
1358
- skillHash: z19.string().min(1)
1359
- });
1360
- var skills = oc4.errors({
1533
+ untypedToken: z33.object({ kind: z33.string(), raw: z33.string() }).nullable(),
1534
+ thread: z33.string().nullable(),
1535
+ provenance: z33.object({ runID: z33.string(), callID: z33.string(), profile: z33.string() }),
1536
+ createdAt: z33.date(),
1537
+ lapseAt: z33.date(),
1538
+ isStale: z33.boolean()
1539
+ });
1540
+ var skillAnswerSchema = z33.strictObject({
1541
+ proposalID: z33.string().min(1),
1542
+ skillHash: z33.string().min(1)
1543
+ });
1544
+ var skills = oc5.errors({
1361
1545
  NOT_FOUND: { message: "nothing has that ID", status: 404 },
1362
1546
  PROPOSAL_HASH: { message: "the skill hash names other files", status: 409 },
1363
1547
  PROPOSAL_CLOSED: { message: "the proposal is answered or lapsed", status: 409 },
@@ -1365,103 +1549,103 @@ var skills = oc4.errors({
1365
1549
  SKILL_CHECK: { message: "the files fail the seed checks", status: 400 },
1366
1550
  WRONG_STATE: { message: "the skill nixie wrote is no longer in force", status: 409 }
1367
1551
  });
1368
- var definitionsSkillSchema = z19.object({ skillHash: z19.string(), origin: z19.enum(["definitions", "vendored"]) }).nullable();
1369
- var writtenSkillSchema = z19.object({
1370
- approvalID: z19.string(),
1371
- proposalID: z19.string(),
1372
- name: z19.string(),
1373
- skillHash: z19.string(),
1552
+ var definitionsSkillSchema = z33.object({ skillHash: z33.string(), origin: z33.enum(["definitions", "vendored"]) }).nullable();
1553
+ var writtenSkillSchema = z33.object({
1554
+ approvalID: z33.string(),
1555
+ proposalID: z33.string(),
1556
+ name: z33.string(),
1557
+ skillHash: z33.string(),
1374
1558
  base: definitionsSkillSchema,
1375
1559
  definitions: definitionsSkillSchema,
1376
- isConflict: z19.boolean(),
1377
- pullRequestURL: z19.url().nullable(),
1378
- approvedAt: z19.date()
1379
- });
1380
- var promptPartFileSchema = z19.object({ path: z19.string(), text: z19.string() });
1381
- var promptEntrySchema = z19.record(z19.string(), z19.string());
1382
- var pendingPromptProposalSchema = z19.object({
1383
- proposalID: z19.string(),
1384
- promptID: z19.string(),
1385
- proposalHash: z19.string(),
1386
- baseHash: z19.string().nullable(),
1560
+ isConflict: z33.boolean(),
1561
+ pullRequestURL: z33.url().nullable(),
1562
+ approvedAt: z33.date()
1563
+ });
1564
+ var promptPartFileSchema = z33.object({ path: z33.string(), text: z33.string() });
1565
+ var promptEntrySchema = z33.record(z33.string(), z33.string());
1566
+ var pendingPromptProposalSchema = z33.object({
1567
+ proposalID: z33.string(),
1568
+ promptID: z33.string(),
1569
+ proposalHash: z33.string(),
1570
+ baseHash: z33.string().nullable(),
1387
1571
  entry: promptEntrySchema,
1388
- files: z19.array(promptPartFileSchema),
1389
- reason: z19.string(),
1390
- inForce: z19.object({ parts: promptEntrySchema, template: z19.string().nullable() }).nullable(),
1391
- thread: z19.string().nullable(),
1392
- provenance: z19.object({ runID: z19.string(), callID: z19.string(), profile: z19.string() }),
1393
- createdAt: z19.date(),
1394
- lapseAt: z19.date(),
1395
- isStale: z19.boolean()
1396
- });
1397
- var promptAnswerSchema = z19.strictObject({
1398
- proposalID: z19.string().min(1),
1399
- proposalHash: z19.string().min(1)
1400
- });
1401
- var prompts = oc4.errors({
1572
+ files: z33.array(promptPartFileSchema),
1573
+ reason: z33.string(),
1574
+ inForce: z33.object({ parts: promptEntrySchema, template: z33.string().nullable() }).nullable(),
1575
+ thread: z33.string().nullable(),
1576
+ provenance: z33.object({ runID: z33.string(), callID: z33.string(), profile: z33.string() }),
1577
+ createdAt: z33.date(),
1578
+ lapseAt: z33.date(),
1579
+ isStale: z33.boolean()
1580
+ });
1581
+ var promptAnswerSchema = z33.strictObject({
1582
+ proposalID: z33.string().min(1),
1583
+ proposalHash: z33.string().min(1)
1584
+ });
1585
+ var prompts = oc5.errors({
1402
1586
  NOT_FOUND: { message: "nothing has that ID", status: 404 },
1403
1587
  PROPOSAL_HASH: { message: "the proposal hash names another override", status: 409 },
1404
1588
  PROPOSAL_CLOSED: { message: "the proposal is answered or lapsed", status: 409 },
1405
1589
  STALE_BASE: { message: "the override in force moved past the proposal", status: 409 },
1406
1590
  PROMPT_CHECK: { message: "the override fails the definitions checks", status: 400 }
1407
1591
  });
1408
- var ruleVersionSchema = z19.object({ ruleHash: z19.string(), sentence: z19.string() }).nullable();
1409
- var ruleInForceSchema = z19.object({
1410
- ruleID: z19.string(),
1411
- revision: z19.int().positive(),
1412
- ruleHash: z19.string(),
1413
- sentence: z19.string(),
1414
- origin: z19.enum(["definitions", "nixie"]),
1415
- changeID: z19.string().nullable(),
1416
- lastFiredAt: z19.date().nullable()
1417
- });
1418
- var ruleConflictSchema = z19.object({
1419
- ruleID: z19.string(),
1420
- changeID: z19.string(),
1592
+ var ruleVersionSchema = z33.object({ ruleHash: z33.string(), sentence: z33.string() }).nullable();
1593
+ var ruleInForceSchema = z33.object({
1594
+ ruleID: z33.string(),
1595
+ revision: z33.int().positive(),
1596
+ ruleHash: z33.string(),
1597
+ sentence: z33.string(),
1598
+ origin: z33.enum(["definitions", "nixie"]),
1599
+ changeID: z33.string().nullable(),
1600
+ lastFiredAt: z33.date().nullable()
1601
+ });
1602
+ var ruleConflictSchema = z33.object({
1603
+ ruleID: z33.string(),
1604
+ changeID: z33.string(),
1421
1605
  nixie: ruleVersionSchema,
1422
1606
  repo: ruleVersionSchema,
1423
1607
  base: ruleVersionSchema,
1424
- changedBy: z19.enum(["owner", "nixie"]),
1425
- reason: z19.string(),
1426
- changedAt: z19.date()
1608
+ changedBy: z33.enum(["owner", "nixie"]),
1609
+ reason: z33.string(),
1610
+ changedAt: z33.date()
1427
1611
  });
1428
- var ruleProposalChangeSchema = z19.object({
1429
- ruleID: z19.string(),
1612
+ var ruleProposalChangeSchema = z33.object({
1613
+ ruleID: z33.string(),
1430
1614
  before: ruleVersionSchema,
1431
1615
  after: ruleVersionSchema
1432
1616
  });
1433
- var effectChangeSchema = z19.object({
1434
- tool: z19.string(),
1435
- remove: z19.array(z19.string()),
1436
- sentence: z19.string()
1617
+ var effectChangeSchema = z33.object({
1618
+ tool: z33.string(),
1619
+ remove: z33.array(z33.string()),
1620
+ sentence: z33.string()
1437
1621
  });
1438
- var pendingRuleProposalSchema = z19.object({
1439
- proposalID: z19.string(),
1440
- changes: z19.array(ruleProposalChangeSchema),
1441
- effectChanges: z19.array(effectChangeSchema),
1442
- createdAt: z19.date(),
1443
- lapseAt: z19.date()
1622
+ var pendingRuleProposalSchema = z33.object({
1623
+ proposalID: z33.string(),
1624
+ changes: z33.array(ruleProposalChangeSchema),
1625
+ effectChanges: z33.array(effectChangeSchema),
1626
+ createdAt: z33.date(),
1627
+ lapseAt: z33.date()
1444
1628
  });
1445
- var ruleProposalAnswerSchema = z19.strictObject({ proposalID: z19.string().min(1) });
1629
+ var ruleProposalAnswerSchema = z33.strictObject({ proposalID: z33.string().min(1) });
1446
1630
  var ruleProposalRejectionSchema = ruleProposalAnswerSchema.extend({
1447
- reason: z19.string().max(500).regex(/\S/u)
1631
+ reason: z33.string().max(500).regex(/\S/u)
1448
1632
  });
1449
1633
  var actionRejectionSchema = ruleProposalAnswerSchema.extend({
1450
- reason: z19.string().max(500).regex(/\S/u).optional()
1634
+ reason: z33.string().max(500).regex(/\S/u).optional()
1451
1635
  });
1452
1636
  var ruleProposalErrors = {
1453
1637
  NOT_FOUND: { message: "nothing has that ID", status: 404 },
1454
1638
  PROPOSAL_CLOSED: { message: "the proposal is answered, withdrawn or lapsed", status: 409 }
1455
1639
  };
1456
- var rules = oc4.errors(ruleProposalErrors);
1457
- var contacts = oc4.errors({
1640
+ var rules = oc5.errors(ruleProposalErrors);
1641
+ var contacts = oc5.errors({
1458
1642
  NOT_FOUND: { message: "no known contact has that ID", status: 404 }
1459
1643
  });
1460
- var forgottenItemsSchema = z19.object({
1461
- itemIDs: z19.array(z19.string()),
1644
+ var forgottenItemsSchema = z33.object({
1645
+ itemIDs: z33.array(z33.string()),
1462
1646
  backup: forgetBackupSchema
1463
1647
  });
1464
- var hostTaskStateSchema = z19.enum([
1648
+ var hostTaskStateSchema = z33.enum([
1465
1649
  "ready",
1466
1650
  "running",
1467
1651
  "waiting",
@@ -1471,35 +1655,35 @@ var hostTaskStateSchema = z19.enum([
1471
1655
  "failed",
1472
1656
  "closed"
1473
1657
  ]);
1474
- var taskControl2 = oc4.errors({
1658
+ var taskControl2 = oc5.errors({
1475
1659
  TASK_NOT_FOUND: { message: "no task has that ID", status: 404 },
1476
1660
  TASK_STATE_REFUSED: {
1477
1661
  message: "the task is in a state that does not take this control",
1478
1662
  status: 409
1479
1663
  }
1480
- }).input(z19.strictObject({ taskID: z19.string().min(1) })).output(z19.object({
1481
- taskID: z19.string(),
1664
+ }).input(z33.strictObject({ taskID: z33.string().min(1) })).output(z33.object({
1665
+ taskID: z33.string(),
1482
1666
  state: hostTaskStateSchema,
1483
- isPauseRequested: z19.boolean()
1667
+ isPauseRequested: z33.boolean()
1484
1668
  }));
1485
1669
  var hostContract = {
1486
- reset: oc4.output(z19.object({
1487
- resetAt: z19.date(),
1488
- lastSequence: z19.int().nonnegative(),
1489
- keptSessions: z19.int().nonnegative()
1670
+ reset: oc5.output(z33.object({
1671
+ resetAt: z33.date(),
1672
+ lastSequence: z33.int().nonnegative(),
1673
+ keptSessions: z33.int().nonnegative()
1490
1674
  })),
1491
- resetConversations: oc4.output(z19.object({
1492
- resetAt: z19.date(),
1493
- lastSequence: z19.int().nonnegative(),
1494
- shreddedRecords: z19.int().nonnegative(),
1675
+ resetConversations: oc5.output(z33.object({
1676
+ resetAt: z33.date(),
1677
+ lastSequence: z33.int().nonnegative(),
1678
+ shreddedRecords: z33.int().nonnegative(),
1495
1679
  backup: forgetBackupSchema
1496
1680
  })),
1497
1681
  nixie: {
1498
- pause: oc4.output(z19.object({ paused: pauseStateSchema })),
1499
- resume: oc4.output(z19.object({ paused: pauseStateSchema }))
1682
+ pause: oc5.output(z33.object({ paused: pauseStateSchema })),
1683
+ resume: oc5.output(z33.object({ paused: pauseStateSchema }))
1500
1684
  },
1501
1685
  recovery: {
1502
- read: oc4.output(z19.object({ recovery: recoverySchema }))
1686
+ read: oc5.output(z33.object({ recovery: recoverySchema }))
1503
1687
  },
1504
1688
  tasks: {
1505
1689
  pause: taskControl2,
@@ -1510,109 +1694,105 @@ var hostContract = {
1510
1694
  CONVERSATION_NEVER_CLOSES: { message: "the conversation is never closed", status: 409 }
1511
1695
  }),
1512
1696
  interrupt: taskControl2,
1513
- raise: oc4.errors({
1697
+ raise: oc5.errors({
1514
1698
  TASK_NOT_FOUND: { message: "no task has that ID", status: 404 },
1515
1699
  TASK_NOT_AT_LIMIT: { message: "the task is not paused at its limit", status: 409 },
1516
1700
  LIMIT_NOT_RAISED: { message: "the new limits are not above the old ones", status: 409 }
1517
- }).input(z19.strictObject({
1518
- taskID: z19.string().min(1),
1519
- turns: z19.int().positive().optional(),
1520
- dollars: z19.number().positive().optional()
1701
+ }).input(z33.strictObject({
1702
+ taskID: z33.string().min(1),
1703
+ turns: z33.int().positive().optional(),
1704
+ dollars: z33.number().positive().optional()
1521
1705
  }).refine((input) => input.turns !== undefined || input.dollars !== undefined, {
1522
1706
  message: "a raise sets turns, dollars or both"
1523
- })).output(z19.object({
1524
- taskID: z19.string(),
1707
+ })).output(z33.object({
1708
+ taskID: z33.string(),
1525
1709
  state: hostTaskStateSchema,
1526
- isPauseRequested: z19.boolean(),
1527
- turns: z19.int().positive(),
1528
- dollars: z19.number().positive()
1710
+ isPauseRequested: z33.boolean(),
1711
+ turns: z33.int().positive(),
1712
+ dollars: z33.number().positive()
1529
1713
  }))
1530
1714
  },
1531
1715
  sessions: {
1532
- issueCode: oc4.output(z19.object({ code: z19.string(), expiresAt: z19.date() })),
1533
- list: oc4.output(z19.array(hostSessionSchema)),
1534
- label: oc4.errors({
1716
+ issueCode: oc5.output(z33.object({ code: z33.string(), expiresAt: z33.date() })),
1717
+ list: oc5.output(z33.array(hostSessionSchema)),
1718
+ label: oc5.errors({
1535
1719
  SESSION_NOT_FOUND: {
1536
1720
  message: "no device session that is still signed in has that ID",
1537
1721
  status: 404
1538
1722
  },
1539
1723
  LABEL_INVALID: { message: "a label holds 1 to 100 characters besides spaces", status: 400 }
1540
- }).input(z19.strictObject({ sessionID: z19.string().min(1), label: z19.string() })).output(z19.object({ sessionID: z19.string(), label: z19.string() }))
1724
+ }).input(z33.strictObject({ sessionID: z33.string().min(1), label: z33.string() })).output(z33.object({ sessionID: z33.string(), label: z33.string() }))
1541
1725
  },
1726
+ passkeys: hostPasskeyContract,
1542
1727
  memory: {
1543
1728
  proposals: {
1544
- list: memory.output(z19.array(pendingProposalSchema)),
1729
+ list: memory.output(z33.array(pendingProposalSchema)),
1545
1730
  approve: memory.input(proposalAnswerSchema.extend({
1546
1731
  revisionOf: versionTargetSchema2.optional(),
1547
- ignoreCloseMatch: z19.boolean().optional(),
1732
+ ignoreCloseMatch: z33.boolean().optional(),
1548
1733
  editedText: itemTextSchema.optional()
1549
1734
  })).output(approvalResultSchema),
1550
- reject: memory.input(proposalAnswerSchema.extend({ reason: z19.string().max(500).regex(/\S/u).optional() })).output(z19.object({ proposalID: z19.string() }))
1735
+ reject: memory.input(proposalAnswerSchema.extend({ reason: z33.string().max(500).regex(/\S/u).optional() })).output(z33.object({ proposalID: z33.string() }))
1551
1736
  },
1552
- subjects: memory.output(z19.object({ items: subjectCountSchema, proposals: subjectCountSchema })),
1737
+ subjects: memory.output(z33.object({ items: subjectCountSchema, proposals: subjectCountSchema })),
1553
1738
  items: {
1554
- read: memory.input(z19.strictObject({ itemID: z19.string().min(1) })).output(itemHistorySchema),
1739
+ read: memory.input(z33.strictObject({ itemID: z33.string().min(1) })).output(itemHistorySchema),
1555
1740
  edit: memory.input(versionTargetSchema2.extend({ text: itemTextSchema })).output(versionRefSchema2),
1556
1741
  retire: memory.input(versionTargetSchema2).output(versionRefSchema2),
1557
1742
  restore: memory.input(versionTargetSchema2).output(versionRefSchema2),
1558
- forget: memory.input(versionTargetSchema2).output(z19.object({ itemID: z19.string(), backup: forgetBackupSchema })),
1743
+ forget: memory.input(versionTargetSchema2).output(z33.object({ itemID: z33.string(), backup: forgetBackupSchema })),
1559
1744
  forgetAll: memory.output(forgottenItemsSchema),
1560
- pin: memory.input(z19.strictObject({ itemID: z19.string().min(1), isPinned: z19.boolean() })).output(z19.object({ itemID: z19.string(), isPinned: z19.boolean() }))
1561
- },
1562
- consolidation: {
1563
- read: memory.output(consolidationDiffSchema.nullable()),
1564
- approve: memory.input(z19.strictObject({ answers: z19.array(changeAnswerSchema).min(1).max(30) })).output(z19.object({ outcomes: z19.array(changeOutcomeSchema) })),
1565
- reject: memory.input(changeAnswerSchema).output(z19.object({ changeID: z19.string() }))
1745
+ pin: memory.input(z33.strictObject({ itemID: z33.string().min(1), isPinned: z33.boolean() })).output(z33.object({ itemID: z33.string(), isPinned: z33.boolean() }))
1566
1746
  }
1567
1747
  },
1568
1748
  skills: {
1569
1749
  proposals: {
1570
- list: skills.output(z19.array(pendingSkillProposalSchema)),
1571
- approve: skills.input(skillAnswerSchema.extend({ files: z19.array(skillFileSchema).min(1).optional() })).output(z19.object({ proposalID: z19.string(), approvalID: z19.string(), skillHash: z19.string() })),
1572
- reject: skills.input(skillAnswerSchema.extend({ reason: z19.string().max(500).regex(/\S/u) })).output(z19.object({ proposalID: z19.string() }))
1750
+ list: skills.output(z33.array(pendingSkillProposalSchema)),
1751
+ approve: skills.input(skillAnswerSchema.extend({ files: z33.array(skillFileSchema).min(1).optional() })).output(z33.object({ proposalID: z33.string(), approvalID: z33.string(), skillHash: z33.string() })),
1752
+ reject: skills.input(skillAnswerSchema.extend({ reason: z33.string().max(500).regex(/\S/u) })).output(z33.object({ proposalID: z33.string() }))
1573
1753
  },
1574
1754
  written: {
1575
- list: skills.output(z19.array(writtenSkillSchema)),
1576
- resolve: skills.input(z19.strictObject({
1577
- approvalID: z19.string().min(1),
1578
- keep: z19.enum(["nixie", "definitions"])
1579
- })).output(z19.object({ approvalID: z19.string(), keep: z19.enum(["nixie", "definitions"]) }))
1755
+ list: skills.output(z33.array(writtenSkillSchema)),
1756
+ resolve: skills.input(z33.strictObject({
1757
+ approvalID: z33.string().min(1),
1758
+ keep: z33.enum(["nixie", "definitions"])
1759
+ })).output(z33.object({ approvalID: z33.string(), keep: z33.enum(["nixie", "definitions"]) }))
1580
1760
  }
1581
1761
  },
1582
1762
  rules: {
1583
- list: rules.output(z19.array(ruleInForceSchema)),
1584
- conflicts: rules.output(z19.array(ruleConflictSchema)),
1585
- resolve: rules.input(z19.strictObject({ ruleID: z19.string().min(1), keep: z19.enum(["nixie", "repo"]) })).output(z19.object({ ruleID: z19.string(), changeID: z19.string(), keep: z19.enum(["nixie", "repo"]) })),
1763
+ list: rules.output(z33.array(ruleInForceSchema)),
1764
+ conflicts: rules.output(z33.array(ruleConflictSchema)),
1765
+ resolve: rules.input(z33.strictObject({ ruleID: z33.string().min(1), keep: z33.enum(["nixie", "repo"]) })).output(z33.object({ ruleID: z33.string(), changeID: z33.string(), keep: z33.enum(["nixie", "repo"]) })),
1586
1766
  proposals: {
1587
- list: rules.output(z19.array(pendingRuleProposalSchema)),
1588
- approve: rules.input(ruleProposalAnswerSchema).output(z19.object({ proposalID: z19.string() })),
1589
- reject: rules.input(ruleProposalRejectionSchema).output(z19.object({ proposalID: z19.string() }))
1767
+ list: rules.output(z33.array(pendingRuleProposalSchema)),
1768
+ approve: rules.input(ruleProposalAnswerSchema).output(z33.object({ proposalID: z33.string() })),
1769
+ reject: rules.input(ruleProposalRejectionSchema).output(z33.object({ proposalID: z33.string() }))
1590
1770
  }
1591
1771
  },
1592
1772
  actions: {
1593
1773
  proposals: {
1594
- list: rules.output(z19.array(actionProposalSchema)),
1595
- approve: rules.input(ruleProposalAnswerSchema).output(z19.object({ proposalID: z19.string() })),
1596
- reject: rules.input(actionRejectionSchema).output(z19.object({ proposalID: z19.string() }))
1774
+ list: rules.output(z33.array(actionProposalSchema)),
1775
+ approve: rules.input(ruleProposalAnswerSchema).output(z33.object({ proposalID: z33.string() })),
1776
+ reject: rules.input(actionRejectionSchema).output(z33.object({ proposalID: z33.string() }))
1597
1777
  }
1598
1778
  },
1599
1779
  contacts: {
1600
- list: contacts.output(z19.array(knownContactSchema)),
1601
- markKnown: contacts.input(z19.strictObject({
1602
- destination: z19.string().min(1).max(500),
1603
- name: z19.string().min(1).max(200).optional()
1604
- })).output(z19.object({ contact: knownContactSchema, isNew: z19.boolean() })),
1605
- unmark: contacts.input(z19.strictObject({ contactID: z19.string().min(1) })).output(z19.object({ contactID: z19.string() }))
1780
+ list: contacts.output(z33.array(knownContactSchema)),
1781
+ markKnown: contacts.input(z33.strictObject({
1782
+ destination: z33.string().min(1).max(500),
1783
+ name: z33.string().min(1).max(200).optional()
1784
+ })).output(z33.object({ contact: knownContactSchema, isNew: z33.boolean() })),
1785
+ unmark: contacts.input(z33.strictObject({ contactID: z33.string().min(1) })).output(z33.object({ contactID: z33.string() }))
1606
1786
  },
1607
1787
  turnInputs: turnInputsContract,
1608
1788
  prompts: {
1609
1789
  proposals: {
1610
- list: prompts.output(z19.array(pendingPromptProposalSchema)),
1790
+ list: prompts.output(z33.array(pendingPromptProposalSchema)),
1611
1791
  approve: prompts.input(promptAnswerSchema.extend({
1612
1792
  entry: promptEntrySchema.optional(),
1613
- files: z19.array(promptPartFileSchema).optional()
1614
- })).output(z19.object({ proposalID: z19.string(), approvalID: z19.string(), proposalHash: z19.string() })),
1615
- reject: prompts.input(promptAnswerSchema.extend({ reason: z19.string().max(500).regex(/\S/u) })).output(z19.object({ proposalID: z19.string() }))
1793
+ files: z33.array(promptPartFileSchema).optional()
1794
+ })).output(z33.object({ proposalID: z33.string(), approvalID: z33.string(), proposalHash: z33.string() })),
1795
+ reject: prompts.input(promptAnswerSchema.extend({ reason: z33.string().max(500).regex(/\S/u) })).output(z33.object({ proposalID: z33.string() }))
1616
1796
  }
1617
1797
  }
1618
1798
  };
@@ -1634,11 +1814,11 @@ function renderSessionCookie(token) {
1634
1814
  return `${sessionCookieName}=${token ?? ""}; Path=/; HttpOnly; Secure; SameSite=Lax; Max-Age=${maxAgeS}`;
1635
1815
  }
1636
1816
  // src/message/task-message-input-schema.ts
1637
- import { z as z21 } from "zod";
1817
+ import { z as z35 } from "zod";
1638
1818
 
1639
1819
  // src/message/task-message-kind-schema.ts
1640
- import { z as z20 } from "zod";
1641
- var taskMessageKindSchema = z20.enum([
1820
+ import { z as z34 } from "zod";
1821
+ var taskMessageKindSchema = z34.enum([
1642
1822
  "progress",
1643
1823
  "question",
1644
1824
  "request",
@@ -1648,21 +1828,21 @@ var taskMessageKindSchema = z20.enum([
1648
1828
  ]);
1649
1829
 
1650
1830
  // src/message/task-message-input-schema.ts
1651
- var taskMessageInputSchema = z21.object({
1652
- to: z21.string(),
1831
+ var taskMessageInputSchema = z35.object({
1832
+ to: z35.string(),
1653
1833
  kind: taskMessageKindSchema,
1654
- body: z21.string(),
1655
- replyTo: z21.string().optional(),
1656
- onBehalfOf: z21.string().array().optional(),
1657
- wake: z21.boolean().optional()
1834
+ body: z35.string(),
1835
+ replyTo: z35.string().optional(),
1836
+ onBehalfOf: z35.string().array().optional(),
1837
+ wake: z35.boolean().optional()
1658
1838
  });
1659
1839
  // src/message/task-message-result-schema.ts
1660
- import { z as z22 } from "zod";
1661
- var taskMessageResultSchema = z22.object({
1662
- messageID: z22.string(),
1663
- woke: z22.boolean(),
1664
- hop: z22.int().nonnegative(),
1665
- note: z22.string().optional()
1840
+ import { z as z36 } from "zod";
1841
+ var taskMessageResultSchema = z36.object({
1842
+ messageID: z36.string(),
1843
+ woke: z36.boolean(),
1844
+ hop: z36.int().nonnegative(),
1845
+ note: z36.string().optional()
1666
1846
  });
1667
1847
  export {
1668
1848
  buildPendingInput,