sessionpipe-core 0.9.0 → 0.11.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.
Files changed (56) hide show
  1. package/dist/control.js +180 -13
  2. package/dist/control.js.map +2 -2
  3. package/dist/index.js +2133 -965
  4. package/dist/index.js.map +4 -4
  5. package/dist/schema/v1.d.ts +443 -34
  6. package/dist/schema/v1.d.ts.map +1 -1
  7. package/dist/schema.js +201 -34
  8. package/dist/schema.js.map +2 -2
  9. package/dist/service.js +155 -0
  10. package/dist/service.js.map +7 -0
  11. package/dist/src/adapters/acp-control.d.ts +87 -0
  12. package/dist/src/adapters/acp-control.d.ts.map +1 -0
  13. package/dist/src/adapters/antigravity-control.d.ts +15 -5
  14. package/dist/src/adapters/antigravity-control.d.ts.map +1 -1
  15. package/dist/src/adapters/claude-code-control.d.ts +39 -4
  16. package/dist/src/adapters/claude-code-control.d.ts.map +1 -1
  17. package/dist/src/adapters/claude-code-pool.d.ts +116 -0
  18. package/dist/src/adapters/claude-code-pool.d.ts.map +1 -0
  19. package/dist/src/adapters/claude-code.d.ts +20 -1
  20. package/dist/src/adapters/claude-code.d.ts.map +1 -1
  21. package/dist/src/adapters/claude-shaped.d.ts +3 -0
  22. package/dist/src/adapters/claude-shaped.d.ts.map +1 -1
  23. package/dist/src/adapters/codex-config.d.ts +2 -1
  24. package/dist/src/adapters/codex-config.d.ts.map +1 -1
  25. package/dist/src/adapters/codex-control.d.ts +23 -7
  26. package/dist/src/adapters/codex-control.d.ts.map +1 -1
  27. package/dist/src/adapters/codex.d.ts +9 -0
  28. package/dist/src/adapters/codex.d.ts.map +1 -1
  29. package/dist/src/adapters/gemini-cli.d.ts +3 -0
  30. package/dist/src/adapters/gemini-cli.d.ts.map +1 -1
  31. package/dist/src/adapters/headless.d.ts +4 -1
  32. package/dist/src/adapters/headless.d.ts.map +1 -1
  33. package/dist/src/adapters/index.d.ts +7 -1
  34. package/dist/src/adapters/index.d.ts.map +1 -1
  35. package/dist/src/adapters/types.d.ts +18 -1
  36. package/dist/src/adapters/types.d.ts.map +1 -1
  37. package/dist/src/config.d.ts +6 -0
  38. package/dist/src/config.d.ts.map +1 -1
  39. package/dist/src/control/verify.d.ts +99 -17
  40. package/dist/src/control/verify.d.ts.map +1 -1
  41. package/dist/src/index.d.ts +3 -1
  42. package/dist/src/index.d.ts.map +1 -1
  43. package/dist/src/launched-by.d.ts +12 -0
  44. package/dist/src/launched-by.d.ts.map +1 -0
  45. package/dist/src/paths.d.ts +4 -0
  46. package/dist/src/paths.d.ts.map +1 -1
  47. package/dist/src/privacy/filter.d.ts.map +1 -1
  48. package/dist/src/service/index.d.ts +83 -0
  49. package/dist/src/service/index.d.ts.map +1 -0
  50. package/dist/src/types.d.ts +4 -0
  51. package/dist/src/types.d.ts.map +1 -1
  52. package/dist/src/version.d.ts +39 -0
  53. package/dist/src/version.d.ts.map +1 -0
  54. package/dist/version.js +75 -0
  55. package/dist/version.js.map +7 -0
  56. package/package.json +10 -2
@@ -2,7 +2,7 @@ import { z } from "zod";
2
2
  export declare const PROTOCOL = 1;
3
3
  /** Dotted, lowercase. Unknown types MUST be accepted and stored. */
4
4
  export declare const EventType: z.ZodString;
5
- export declare const KNOWN_TYPES: readonly ["session.started", "session.heartbeat", "session.ended", "session.backfill", "session.forgotten", "turn.started", "turn.ended", "turn.transcript", "turn.progress", "tool.started", "tool.ended", "files.changed", "attention.needed", "attention.cleared", "subagent.started", "subagent.ended", "context.compacted", "native"];
5
+ export declare const KNOWN_TYPES: readonly ["session.started", "session.heartbeat", "session.ended", "session.backfill", "session.forgotten", "turn.started", "turn.ended", "turn.transcript", "turn.progress", "tool.started", "tool.ended", "files.changed", "attention.needed", "attention.cleared", "subagent.started", "subagent.ended", "context.compacted", "limits.observed", "native"];
6
6
  /** The lowest tier that carries each known type. */
7
7
  export declare const TYPE_TIER: Record<(typeof KNOWN_TYPES)[number], 0 | 1 | 2 | 3>;
8
8
  export declare const HARNESS_NAMES: readonly ["claude-code", "codex", "gemini-cli", "antigravity", "devin", "cursor", "copilot-cli", "droid", "kiro", "opencode"];
@@ -32,7 +32,9 @@ export declare const Session: z.ZodObject<{
32
32
  }>>;
33
33
  url: z.ZodOptional<z.ZodURL>;
34
34
  account_id: z.ZodOptional<z.ZodString>;
35
+ attended: z.ZodOptional<z.ZodBoolean>;
35
36
  parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
37
+ launched_by: z.ZodOptional<z.ZodString>;
36
38
  }, z.core.$strip>;
37
39
  export declare const Privacy: z.ZodObject<{
38
40
  rulesets: z.ZodArray<z.ZodString>;
@@ -65,7 +67,9 @@ export declare const Event: z.ZodObject<{
65
67
  }>>;
66
68
  url: z.ZodOptional<z.ZodURL>;
67
69
  account_id: z.ZodOptional<z.ZodString>;
70
+ attended: z.ZodOptional<z.ZodBoolean>;
68
71
  parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
72
+ launched_by: z.ZodOptional<z.ZodString>;
69
73
  }, z.core.$strip>;
70
74
  privacy: z.ZodObject<{
71
75
  rulesets: z.ZodArray<z.ZodString>;
@@ -80,6 +84,14 @@ export declare const AttentionKind: z.ZodEnum<{
80
84
  permission: "permission";
81
85
  question: "question";
82
86
  }>;
87
+ /** One usage window of an account: `id` is the harness's own name for it (`five_hour`,
88
+ * `seven_day`, `primary` …); `used_percent` passes 100 once a spend limit is exceeded. */
89
+ export declare const LimitWindow: z.ZodObject<{
90
+ id: z.ZodString;
91
+ used_percent: z.ZodNumber;
92
+ resets_at: z.ZodOptional<z.ZodISODateTime>;
93
+ window_minutes: z.ZodOptional<z.ZodInt>;
94
+ }, z.core.$loose>;
83
95
  export declare const EventData: z.ZodObject<{
84
96
  "session.started": z.ZodObject<{
85
97
  source: z.ZodEnum<{
@@ -109,6 +121,8 @@ export declare const EventData: z.ZodObject<{
109
121
  "turn.started": z.ZodObject<{
110
122
  turn_id: z.ZodOptional<z.ZodString>;
111
123
  prompt_chars: z.ZodOptional<z.ZodInt>;
124
+ submitted_by: z.ZodOptional<z.ZodString>;
125
+ injected: z.ZodOptional<z.ZodBoolean>;
112
126
  }, z.core.$loose>;
113
127
  "turn.ended": z.ZodObject<{
114
128
  turn_id: z.ZodOptional<z.ZodString>;
@@ -119,6 +133,7 @@ export declare const EventData: z.ZodObject<{
119
133
  }>;
120
134
  error: z.ZodOptional<z.ZodString>;
121
135
  ms: z.ZodOptional<z.ZodInt>;
136
+ background: z.ZodOptional<z.ZodInt>;
122
137
  }, z.core.$loose>;
123
138
  "turn.transcript": z.ZodObject<{
124
139
  turn: z.ZodInt;
@@ -188,6 +203,16 @@ export declare const EventData: z.ZodObject<{
188
203
  manual: "manual";
189
204
  }>;
190
205
  }, z.core.$loose>;
206
+ "limits.observed": z.ZodObject<{
207
+ windows: z.ZodArray<z.ZodObject<{
208
+ id: z.ZodString;
209
+ used_percent: z.ZodNumber;
210
+ resets_at: z.ZodOptional<z.ZodISODateTime>;
211
+ window_minutes: z.ZodOptional<z.ZodInt>;
212
+ }, z.core.$loose>>;
213
+ plan: z.ZodOptional<z.ZodString>;
214
+ account_id: z.ZodOptional<z.ZodString>;
215
+ }, z.core.$loose>;
191
216
  native: z.ZodObject<{}, z.core.$loose>;
192
217
  }, z.core.$strip>;
193
218
  export declare const Batch: z.ZodObject<{
@@ -218,7 +243,9 @@ export declare const Batch: z.ZodObject<{
218
243
  }>>;
219
244
  url: z.ZodOptional<z.ZodURL>;
220
245
  account_id: z.ZodOptional<z.ZodString>;
246
+ attended: z.ZodOptional<z.ZodBoolean>;
221
247
  parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
248
+ launched_by: z.ZodOptional<z.ZodString>;
222
249
  }, z.core.$strip>;
223
250
  privacy: z.ZodObject<{
224
251
  rulesets: z.ZodArray<z.ZodString>;
@@ -255,9 +282,30 @@ export declare const ControlKind: z.ZodEnum<{
255
282
  cancel: "cancel";
256
283
  "key.add": "key.add";
257
284
  "permission.answer": "permission.answer";
285
+ pool: "pool";
258
286
  prompt: "prompt";
259
287
  start: "start";
260
288
  }>;
289
+ /** What a `pool` command asks of the machine's account pool (CONTROL.md §6 `pool`). */
290
+ export declare const PoolAction: z.ZodEnum<{
291
+ disable: "disable";
292
+ enable: "enable";
293
+ "login.begin": "login.begin";
294
+ "login.complete": "login.complete";
295
+ off: "off";
296
+ on: "on";
297
+ order: "order";
298
+ refresh: "refresh";
299
+ remove: "remove";
300
+ }>;
301
+ /** A pooled account's id: what `session.account_id` and `limits.observed.account_id`
302
+ * carry for it (Claude Code: the account UUID), or a pending sign-in's id. */
303
+ export declare const PoolAccountId: z.ZodString;
304
+ /** The kinds of key a machine or a receiver handles (CONTROL.md §2). Absent: passkeys only. */
305
+ export declare const KeyTypes: z.ZodArray<z.ZodEnum<{
306
+ device: "device";
307
+ passkey: "passkey";
308
+ }>>;
261
309
  export declare const DeliveryMode: z.ZodEnum<{
262
310
  api: "api";
263
311
  fork: "fork";
@@ -266,6 +314,26 @@ export declare const DeliveryMode: z.ZodEnum<{
266
314
  turn: "turn";
267
315
  waiter: "waiter";
268
316
  }>;
317
+ /** How much a started session may do without anyone approving it (CONTROL.md §3.1),
318
+ * narrowest first. Closed: nothing is wider than `auto`. */
319
+ export declare const StartPermission: z.ZodEnum<{
320
+ auto: "auto";
321
+ edits: "edits";
322
+ read: "read";
323
+ safe: "safe";
324
+ }>;
325
+ /** What a start ran with, or gets by default: a level, or `inherit` (no permission flag,
326
+ * the harness's own default) on a machine the person put in inherit mode. Never a
327
+ * command's `permission`. */
328
+ export declare const RunLevel: z.ZodEnum<{
329
+ auto: "auto";
330
+ edits: "edits";
331
+ inherit: "inherit";
332
+ read: "read";
333
+ safe: "safe";
334
+ }>;
335
+ /** A model id as the harness names it, passed as one argument: never a leading dash. */
336
+ export declare const ModelId: z.ZodString;
269
337
  /** A file attached to a `start` (CONTROL.md §3.1). The bytes wait on the receiver
270
338
  * (`GET {control}/files/{sha256}`); the signed hash is what the machine checks.
271
339
  * Beyond this shape the verifier also checks: the name's length after NFC, names
@@ -286,6 +354,7 @@ export declare const ControlCommand: z.ZodObject<{
286
354
  cancel: "cancel";
287
355
  "key.add": "key.add";
288
356
  "permission.answer": "permission.answer";
357
+ pool: "pool";
289
358
  prompt: "prompt";
290
359
  start: "start";
291
360
  }>;
@@ -298,11 +367,18 @@ export declare const ControlCommand: z.ZodObject<{
298
367
  }>>;
299
368
  note: z.ZodOptional<z.ZodString>;
300
369
  cwd: z.ZodOptional<z.ZodString>;
301
- key: z.ZodOptional<z.ZodObject<{
370
+ key: z.ZodOptional<z.ZodLazy<z.ZodXor<readonly [z.ZodObject<{
302
371
  id: z.ZodString;
303
372
  alg: z.ZodUnion<readonly [z.ZodLiteral<-7>, z.ZodLiteral<-257>]>;
304
373
  spki: z.ZodString;
305
- }, z.core.$strip>>;
374
+ }, z.core.$strict>, z.ZodObject<{
375
+ id: z.ZodString;
376
+ alg: z.ZodLiteral<-7>;
377
+ spki: z.ZodString;
378
+ type: z.ZodLiteral<"device">;
379
+ store: z.ZodLiteral<"hardware">;
380
+ uv: z.ZodLiteral<"each-use">;
381
+ }, z.core.$strict>]>>>;
306
382
  name: z.ZodOptional<z.ZodString>;
307
383
  files: z.ZodOptional<z.ZodArray<z.ZodObject<{
308
384
  name: z.ZodString;
@@ -310,6 +386,27 @@ export declare const ControlCommand: z.ZodObject<{
310
386
  size: z.ZodInt;
311
387
  sha256: z.ZodString;
312
388
  }, z.core.$strip>>>;
389
+ permission: z.ZodOptional<z.ZodEnum<{
390
+ auto: "auto";
391
+ edits: "edits";
392
+ read: "read";
393
+ safe: "safe";
394
+ }>>;
395
+ model: z.ZodOptional<z.ZodString>;
396
+ pool_action: z.ZodOptional<z.ZodEnum<{
397
+ disable: "disable";
398
+ enable: "enable";
399
+ "login.begin": "login.begin";
400
+ "login.complete": "login.complete";
401
+ off: "off";
402
+ on: "on";
403
+ order: "order";
404
+ refresh: "refresh";
405
+ remove: "remove";
406
+ }>>;
407
+ pool_account: z.ZodOptional<z.ZodString>;
408
+ pool_order: z.ZodOptional<z.ZodArray<z.ZodString>>;
409
+ pool_code: z.ZodOptional<z.ZodString>;
313
410
  nonce: z.ZodString;
314
411
  iat: z.ZodInt;
315
412
  }, z.core.$strip>;
@@ -329,30 +426,55 @@ export declare const ControlAssertion: z.ZodObject<{
329
426
  cd: z.ZodString;
330
427
  sig: z.ZodString;
331
428
  }, z.core.$strip>;
332
- /** A key enrolled on a machine: a passkey's credential id, COSE alg, SPKI. */
333
- export declare const ControlKey: z.ZodObject<{
429
+ /** A device key's signature (CONTROL.md §3.2): its id and 64 bytes r‖s over
430
+ * `sessionpipe.device.v1⏎<purpose>⏎<rp id>⏎<challenge>`. Nothing else. The shape
431
+ * only, like an assertion's: the machine reads the key from its own record and checks
432
+ * the rest (a 43-character id, exactly 64 bytes), so a carrier never decides a kind. */
433
+ export declare const ControlDeviceSignature: z.ZodObject<{
434
+ cred: z.ZodString;
435
+ sig: z.ZodString;
436
+ }, z.core.$strict>;
437
+ /** A key enrolled on a machine, closed: a passkey (credential id, COSE alg, SPKI), or a
438
+ * device key an app holds in hardware (CONTROL.md §2 "Device keys"), which names
439
+ * itself by its SPKI's SHA-256 and says how it is held. A machine refuses any other
440
+ * field or value, so a kind added later is refused by every machine that predates it. */
441
+ export declare const ControlKey: z.ZodXor<readonly [z.ZodObject<{
334
442
  id: z.ZodString;
335
443
  alg: z.ZodUnion<readonly [z.ZodLiteral<-7>, z.ZodLiteral<-257>]>;
336
444
  spki: z.ZodString;
337
- }, z.core.$strip>;
445
+ }, z.core.$strict>, z.ZodObject<{
446
+ id: z.ZodString;
447
+ alg: z.ZodLiteral<-7>;
448
+ spki: z.ZodString;
449
+ type: z.ZodLiteral<"device">;
450
+ store: z.ZodLiteral<"hardware">;
451
+ uv: z.ZodLiteral<"each-use">;
452
+ }, z.core.$strict>]>;
338
453
  /** One message as a receiver carries it: its own envelope around the signed bytes. */
339
454
  export declare const ControlMessage: z.ZodObject<{
340
455
  id: z.ZodString;
341
456
  cmd: z.ZodString;
342
457
  csig: z.ZodOptional<z.ZodNullable<z.ZodString>>;
343
- grant: z.ZodOptional<z.ZodNullable<z.ZodObject<{
458
+ grant: z.ZodOptional<z.ZodNullable<z.ZodXor<readonly [z.ZodObject<{
344
459
  cred: z.ZodString;
345
460
  ad: z.ZodString;
346
461
  cd: z.ZodString;
347
462
  sig: z.ZodString;
348
463
  str: z.ZodString;
349
- }, z.core.$strip>>>;
350
- confirm: z.ZodOptional<z.ZodNullable<z.ZodObject<{
464
+ }, z.core.$strip>, z.ZodObject<{
465
+ cred: z.ZodString;
466
+ sig: z.ZodString;
467
+ str: z.ZodString;
468
+ }, z.core.$strict>]>>>;
469
+ confirm: z.ZodOptional<z.ZodNullable<z.ZodXor<readonly [z.ZodObject<{
351
470
  cred: z.ZodString;
352
471
  ad: z.ZodString;
353
472
  cd: z.ZodString;
354
473
  sig: z.ZodString;
355
- }, z.core.$strip>>>;
474
+ }, z.core.$strip>, z.ZodObject<{
475
+ cred: z.ZodString;
476
+ sig: z.ZodString;
477
+ }, z.core.$strict>]>>>;
356
478
  at: z.ZodISODateTime;
357
479
  expires_at: z.ZodISODateTime;
358
480
  }, z.core.$strip>;
@@ -361,19 +483,26 @@ export declare const ControlPoll: z.ZodObject<{
361
483
  id: z.ZodString;
362
484
  cmd: z.ZodString;
363
485
  csig: z.ZodOptional<z.ZodNullable<z.ZodString>>;
364
- grant: z.ZodOptional<z.ZodNullable<z.ZodObject<{
486
+ grant: z.ZodOptional<z.ZodNullable<z.ZodXor<readonly [z.ZodObject<{
365
487
  cred: z.ZodString;
366
488
  ad: z.ZodString;
367
489
  cd: z.ZodString;
368
490
  sig: z.ZodString;
369
491
  str: z.ZodString;
370
- }, z.core.$strip>>>;
371
- confirm: z.ZodOptional<z.ZodNullable<z.ZodObject<{
492
+ }, z.core.$strip>, z.ZodObject<{
493
+ cred: z.ZodString;
494
+ sig: z.ZodString;
495
+ str: z.ZodString;
496
+ }, z.core.$strict>]>>>;
497
+ confirm: z.ZodOptional<z.ZodNullable<z.ZodXor<readonly [z.ZodObject<{
372
498
  cred: z.ZodString;
373
499
  ad: z.ZodString;
374
500
  cd: z.ZodString;
375
501
  sig: z.ZodString;
376
- }, z.core.$strip>>>;
502
+ }, z.core.$strip>, z.ZodObject<{
503
+ cred: z.ZodString;
504
+ sig: z.ZodString;
505
+ }, z.core.$strict>]>>>;
377
506
  at: z.ZodISODateTime;
378
507
  expires_at: z.ZodISODateTime;
379
508
  }, z.core.$strip>>;
@@ -417,6 +546,16 @@ export declare const ControlAck: z.ZodObject<{
417
546
  detail: z.ZodOptional<z.ZodString>;
418
547
  reply: z.ZodOptional<z.ZodString>;
419
548
  seq: z.ZodOptional<z.ZodInt>;
549
+ applied: z.ZodOptional<z.ZodObject<{
550
+ permission: z.ZodOptional<z.ZodEnum<{
551
+ auto: "auto";
552
+ edits: "edits";
553
+ inherit: "inherit";
554
+ read: "read";
555
+ safe: "safe";
556
+ }>>;
557
+ model: z.ZodOptional<z.ZodString>;
558
+ }, z.core.$strict>>;
420
559
  }, z.core.$strip>>;
421
560
  }, z.core.$strip>;
422
561
  /** A harness account signed in on the machine: the id `session.account_id` carries,
@@ -426,6 +565,7 @@ export declare const HarnessAccount: z.ZodObject<{
426
565
  harness: z.ZodString;
427
566
  id: z.ZodString;
428
567
  email: z.ZodOptional<z.ZodString>;
568
+ name: z.ZodOptional<z.ZodString>;
429
569
  }, z.core.$strip>;
430
570
  /** `POST {control}/pair`, sent with the person's sink token from their own terminal —
431
571
  * or, where the receiver declares `control.open_pairing`, with no token and a
@@ -447,14 +587,20 @@ export declare const ControlPairStart: z.ZodObject<{
447
587
  folders: z.ZodOptional<z.ZodArray<z.ZodString>>;
448
588
  mode: z.ZodOptional<z.ZodEnum<{
449
589
  auto: "auto";
590
+ inherit: "inherit";
450
591
  safe: "safe";
451
592
  }>>;
452
593
  accounts: z.ZodOptional<z.ZodArray<z.ZodObject<{
453
594
  harness: z.ZodString;
454
595
  id: z.ZodString;
455
596
  email: z.ZodOptional<z.ZodString>;
597
+ name: z.ZodOptional<z.ZodString>;
456
598
  }, z.core.$strip>>>;
457
599
  files: z.ZodOptional<z.ZodBoolean>;
600
+ key_types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
601
+ device: "device";
602
+ passkey: "passkey";
603
+ }>>>;
458
604
  }, z.core.$strip>;
459
605
  /** The receiver's answer: where the person confirms, and the digits both screens show. */
460
606
  export declare const ControlPairStarted: z.ZodObject<{
@@ -472,21 +618,83 @@ export declare const ControlPaired: z.ZodObject<{
472
618
  paired: "paired";
473
619
  pending: "pending";
474
620
  }>;
475
- key: z.ZodOptional<z.ZodObject<{
621
+ key: z.ZodOptional<z.ZodXor<readonly [z.ZodObject<{
476
622
  id: z.ZodString;
477
623
  alg: z.ZodUnion<readonly [z.ZodLiteral<-7>, z.ZodLiteral<-257>]>;
478
624
  spki: z.ZodString;
479
- }, z.core.$strip>>;
480
- proof: z.ZodOptional<z.ZodObject<{
625
+ }, z.core.$strict>, z.ZodObject<{
626
+ id: z.ZodString;
627
+ alg: z.ZodLiteral<-7>;
628
+ spki: z.ZodString;
629
+ type: z.ZodLiteral<"device">;
630
+ store: z.ZodLiteral<"hardware">;
631
+ uv: z.ZodLiteral<"each-use">;
632
+ }, z.core.$strict>]>>;
633
+ proof: z.ZodOptional<z.ZodXor<readonly [z.ZodObject<{
481
634
  cred: z.ZodString;
482
635
  ad: z.ZodString;
483
636
  cd: z.ZodString;
484
637
  sig: z.ZodString;
485
- }, z.core.$strip>>;
638
+ }, z.core.$strip>, z.ZodObject<{
639
+ cred: z.ZodString;
640
+ sig: z.ZodString;
641
+ }, z.core.$strict>]>>;
486
642
  token: z.ZodOptional<z.ZodString>;
487
643
  sink_token: z.ZodOptional<z.ZodString>;
488
644
  account: z.ZodOptional<z.ZodString>;
489
645
  }, z.core.$strip>;
646
+ /** One account in the machine's pool, as its hello lists it (CONTROL.md §2 `pool`).
647
+ * `id` is the string `session.account_id` and `limits.observed.account_id` carry, so
648
+ * a receiver joins the three without a map. The email travels only here. */
649
+ export declare const PoolAccount: z.ZodObject<{
650
+ id: z.ZodString;
651
+ email: z.ZodOptional<z.ZodString>;
652
+ label: z.ZodOptional<z.ZodString>;
653
+ enabled: z.ZodBoolean;
654
+ status: z.ZodEnum<{
655
+ disabled: "disabled";
656
+ error: "error";
657
+ limited: "limited";
658
+ ready: "ready";
659
+ }>;
660
+ current: z.ZodOptional<z.ZodBoolean>;
661
+ until: z.ZodOptional<z.ZodISODateTime>;
662
+ windows: z.ZodOptional<z.ZodArray<z.ZodObject<{
663
+ id: z.ZodString;
664
+ used_percent: z.ZodNumber;
665
+ resets_at: z.ZodOptional<z.ZodISODateTime>;
666
+ window_minutes: z.ZodOptional<z.ZodInt>;
667
+ }, z.core.$loose>>>;
668
+ limited_by: z.ZodOptional<z.ZodString>;
669
+ }, z.core.$strip>;
670
+ /** The machine's account pool (CONTROL.md §2 `pool`): present in EVERY hello of a daemon
671
+ * that knows the pool (`on: false`, `accounts: []` when nothing is set up), so a
672
+ * receiver tells "no pool" from "an old daemon"; `accounts` in the machine's order. */
673
+ export declare const ControlHelloPool: z.ZodObject<{
674
+ on: z.ZodBoolean;
675
+ harness: z.ZodString;
676
+ accounts: z.ZodArray<z.ZodObject<{
677
+ id: z.ZodString;
678
+ email: z.ZodOptional<z.ZodString>;
679
+ label: z.ZodOptional<z.ZodString>;
680
+ enabled: z.ZodBoolean;
681
+ status: z.ZodEnum<{
682
+ disabled: "disabled";
683
+ error: "error";
684
+ limited: "limited";
685
+ ready: "ready";
686
+ }>;
687
+ current: z.ZodOptional<z.ZodBoolean>;
688
+ until: z.ZodOptional<z.ZodISODateTime>;
689
+ windows: z.ZodOptional<z.ZodArray<z.ZodObject<{
690
+ id: z.ZodString;
691
+ used_percent: z.ZodNumber;
692
+ resets_at: z.ZodOptional<z.ZodISODateTime>;
693
+ window_minutes: z.ZodOptional<z.ZodInt>;
694
+ }, z.core.$loose>>>;
695
+ limited_by: z.ZodOptional<z.ZodString>;
696
+ }, z.core.$strip>>;
697
+ }, z.core.$strip>;
490
698
  /** `POST {control}/hello`: what the machine can do right now. */
491
699
  export declare const ControlHello: z.ZodObject<{
492
700
  name: z.ZodString;
@@ -505,14 +713,63 @@ export declare const ControlHello: z.ZodObject<{
505
713
  folders: z.ZodOptional<z.ZodArray<z.ZodString>>;
506
714
  mode: z.ZodOptional<z.ZodEnum<{
507
715
  auto: "auto";
716
+ inherit: "inherit";
508
717
  safe: "safe";
509
718
  }>>;
510
719
  accounts: z.ZodOptional<z.ZodArray<z.ZodObject<{
511
720
  harness: z.ZodString;
512
721
  id: z.ZodString;
513
722
  email: z.ZodOptional<z.ZodString>;
723
+ name: z.ZodOptional<z.ZodString>;
514
724
  }, z.core.$strip>>>;
515
725
  files: z.ZodOptional<z.ZodBoolean>;
726
+ prompt_files: z.ZodOptional<z.ZodBoolean>;
727
+ start: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
728
+ permissions: z.ZodArray<z.ZodEnum<{
729
+ auto: "auto";
730
+ edits: "edits";
731
+ read: "read";
732
+ safe: "safe";
733
+ }>>;
734
+ permission: z.ZodEnum<{
735
+ auto: "auto";
736
+ edits: "edits";
737
+ inherit: "inherit";
738
+ read: "read";
739
+ safe: "safe";
740
+ }>;
741
+ models: z.ZodOptional<z.ZodArray<z.ZodString>>;
742
+ any_model: z.ZodOptional<z.ZodBoolean>;
743
+ }, z.core.$strip>>>;
744
+ key_types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
745
+ device: "device";
746
+ passkey: "passkey";
747
+ }>>>;
748
+ pool: z.ZodOptional<z.ZodObject<{
749
+ on: z.ZodBoolean;
750
+ harness: z.ZodString;
751
+ accounts: z.ZodArray<z.ZodObject<{
752
+ id: z.ZodString;
753
+ email: z.ZodOptional<z.ZodString>;
754
+ label: z.ZodOptional<z.ZodString>;
755
+ enabled: z.ZodBoolean;
756
+ status: z.ZodEnum<{
757
+ disabled: "disabled";
758
+ error: "error";
759
+ limited: "limited";
760
+ ready: "ready";
761
+ }>;
762
+ current: z.ZodOptional<z.ZodBoolean>;
763
+ until: z.ZodOptional<z.ZodISODateTime>;
764
+ windows: z.ZodOptional<z.ZodArray<z.ZodObject<{
765
+ id: z.ZodString;
766
+ used_percent: z.ZodNumber;
767
+ resets_at: z.ZodOptional<z.ZodISODateTime>;
768
+ window_minutes: z.ZodOptional<z.ZodInt>;
769
+ }, z.core.$loose>>>;
770
+ limited_by: z.ZodOptional<z.ZodString>;
771
+ }, z.core.$strip>>;
772
+ }, z.core.$strip>>;
516
773
  }, z.core.$strip>;
517
774
  export declare const WellKnown: z.ZodObject<{
518
775
  protocol: z.ZodArray<z.ZodInt>;
@@ -537,8 +794,13 @@ export declare const WellKnown: z.ZodObject<{
537
794
  signing: z.ZodObject<{
538
795
  rp_id: z.ZodString;
539
796
  algs: z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<-7>, z.ZodLiteral<-257>]>>;
797
+ key_types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
798
+ device: "device";
799
+ passkey: "passkey";
800
+ }>>>;
540
801
  }, z.core.$strip>;
541
802
  files: z.ZodOptional<z.ZodBoolean>;
803
+ inherit: z.ZodOptional<z.ZodBoolean>;
542
804
  }, z.core.$strip>>;
543
805
  }, z.core.$strip>;
544
806
  /** What `npm run schemas` writes to schemas/v1/<name>.json. */
@@ -570,7 +832,9 @@ export declare const SCHEMAS: {
570
832
  }>>;
571
833
  url: z.ZodOptional<z.ZodURL>;
572
834
  account_id: z.ZodOptional<z.ZodString>;
835
+ attended: z.ZodOptional<z.ZodBoolean>;
573
836
  parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
837
+ launched_by: z.ZodOptional<z.ZodString>;
574
838
  }, z.core.$strip>;
575
839
  privacy: z.ZodObject<{
576
840
  rulesets: z.ZodArray<z.ZodString>;
@@ -607,6 +871,8 @@ export declare const SCHEMAS: {
607
871
  "turn.started": z.ZodObject<{
608
872
  turn_id: z.ZodOptional<z.ZodString>;
609
873
  prompt_chars: z.ZodOptional<z.ZodInt>;
874
+ submitted_by: z.ZodOptional<z.ZodString>;
875
+ injected: z.ZodOptional<z.ZodBoolean>;
610
876
  }, z.core.$loose>;
611
877
  "turn.ended": z.ZodObject<{
612
878
  turn_id: z.ZodOptional<z.ZodString>;
@@ -617,6 +883,7 @@ export declare const SCHEMAS: {
617
883
  }>;
618
884
  error: z.ZodOptional<z.ZodString>;
619
885
  ms: z.ZodOptional<z.ZodInt>;
886
+ background: z.ZodOptional<z.ZodInt>;
620
887
  }, z.core.$loose>;
621
888
  "turn.transcript": z.ZodObject<{
622
889
  turn: z.ZodInt;
@@ -686,6 +953,16 @@ export declare const SCHEMAS: {
686
953
  manual: "manual";
687
954
  }>;
688
955
  }, z.core.$loose>;
956
+ "limits.observed": z.ZodObject<{
957
+ windows: z.ZodArray<z.ZodObject<{
958
+ id: z.ZodString;
959
+ used_percent: z.ZodNumber;
960
+ resets_at: z.ZodOptional<z.ZodISODateTime>;
961
+ window_minutes: z.ZodOptional<z.ZodInt>;
962
+ }, z.core.$loose>>;
963
+ plan: z.ZodOptional<z.ZodString>;
964
+ account_id: z.ZodOptional<z.ZodString>;
965
+ }, z.core.$loose>;
689
966
  native: z.ZodObject<{}, z.core.$loose>;
690
967
  }, z.core.$strip>;
691
968
  readonly batch: z.ZodObject<{
@@ -716,7 +993,9 @@ export declare const SCHEMAS: {
716
993
  }>>;
717
994
  url: z.ZodOptional<z.ZodURL>;
718
995
  account_id: z.ZodOptional<z.ZodString>;
996
+ attended: z.ZodOptional<z.ZodBoolean>;
719
997
  parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
998
+ launched_by: z.ZodOptional<z.ZodString>;
720
999
  }, z.core.$strip>;
721
1000
  privacy: z.ZodObject<{
722
1001
  rulesets: z.ZodArray<z.ZodString>;
@@ -762,27 +1041,39 @@ export declare const SCHEMAS: {
762
1041
  signing: z.ZodObject<{
763
1042
  rp_id: z.ZodString;
764
1043
  algs: z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<-7>, z.ZodLiteral<-257>]>>;
1044
+ key_types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1045
+ device: "device";
1046
+ passkey: "passkey";
1047
+ }>>>;
765
1048
  }, z.core.$strip>;
766
1049
  files: z.ZodOptional<z.ZodBoolean>;
1050
+ inherit: z.ZodOptional<z.ZodBoolean>;
767
1051
  }, z.core.$strip>>;
768
1052
  }, z.core.$strip>;
769
1053
  readonly control: z.ZodObject<{
770
1054
  id: z.ZodString;
771
1055
  cmd: z.ZodString;
772
1056
  csig: z.ZodOptional<z.ZodNullable<z.ZodString>>;
773
- grant: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1057
+ grant: z.ZodOptional<z.ZodNullable<z.ZodXor<readonly [z.ZodObject<{
774
1058
  cred: z.ZodString;
775
1059
  ad: z.ZodString;
776
1060
  cd: z.ZodString;
777
1061
  sig: z.ZodString;
778
1062
  str: z.ZodString;
779
- }, z.core.$strip>>>;
780
- confirm: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1063
+ }, z.core.$strip>, z.ZodObject<{
1064
+ cred: z.ZodString;
1065
+ sig: z.ZodString;
1066
+ str: z.ZodString;
1067
+ }, z.core.$strict>]>>>;
1068
+ confirm: z.ZodOptional<z.ZodNullable<z.ZodXor<readonly [z.ZodObject<{
781
1069
  cred: z.ZodString;
782
1070
  ad: z.ZodString;
783
1071
  cd: z.ZodString;
784
1072
  sig: z.ZodString;
785
- }, z.core.$strip>>>;
1073
+ }, z.core.$strip>, z.ZodObject<{
1074
+ cred: z.ZodString;
1075
+ sig: z.ZodString;
1076
+ }, z.core.$strict>]>>>;
786
1077
  at: z.ZodISODateTime;
787
1078
  expires_at: z.ZodISODateTime;
788
1079
  }, z.core.$strip>;
@@ -794,6 +1085,7 @@ export declare const SCHEMAS: {
794
1085
  cancel: "cancel";
795
1086
  "key.add": "key.add";
796
1087
  "permission.answer": "permission.answer";
1088
+ pool: "pool";
797
1089
  prompt: "prompt";
798
1090
  start: "start";
799
1091
  }>;
@@ -806,11 +1098,18 @@ export declare const SCHEMAS: {
806
1098
  }>>;
807
1099
  note: z.ZodOptional<z.ZodString>;
808
1100
  cwd: z.ZodOptional<z.ZodString>;
809
- key: z.ZodOptional<z.ZodObject<{
1101
+ key: z.ZodOptional<z.ZodLazy<z.ZodXor<readonly [z.ZodObject<{
810
1102
  id: z.ZodString;
811
1103
  alg: z.ZodUnion<readonly [z.ZodLiteral<-7>, z.ZodLiteral<-257>]>;
812
1104
  spki: z.ZodString;
813
- }, z.core.$strip>>;
1105
+ }, z.core.$strict>, z.ZodObject<{
1106
+ id: z.ZodString;
1107
+ alg: z.ZodLiteral<-7>;
1108
+ spki: z.ZodString;
1109
+ type: z.ZodLiteral<"device">;
1110
+ store: z.ZodLiteral<"hardware">;
1111
+ uv: z.ZodLiteral<"each-use">;
1112
+ }, z.core.$strict>]>>>;
814
1113
  name: z.ZodOptional<z.ZodString>;
815
1114
  files: z.ZodOptional<z.ZodArray<z.ZodObject<{
816
1115
  name: z.ZodString;
@@ -818,6 +1117,27 @@ export declare const SCHEMAS: {
818
1117
  size: z.ZodInt;
819
1118
  sha256: z.ZodString;
820
1119
  }, z.core.$strip>>>;
1120
+ permission: z.ZodOptional<z.ZodEnum<{
1121
+ auto: "auto";
1122
+ edits: "edits";
1123
+ read: "read";
1124
+ safe: "safe";
1125
+ }>>;
1126
+ model: z.ZodOptional<z.ZodString>;
1127
+ pool_action: z.ZodOptional<z.ZodEnum<{
1128
+ disable: "disable";
1129
+ enable: "enable";
1130
+ "login.begin": "login.begin";
1131
+ "login.complete": "login.complete";
1132
+ off: "off";
1133
+ on: "on";
1134
+ order: "order";
1135
+ refresh: "refresh";
1136
+ remove: "remove";
1137
+ }>>;
1138
+ pool_account: z.ZodOptional<z.ZodString>;
1139
+ pool_order: z.ZodOptional<z.ZodArray<z.ZodString>>;
1140
+ pool_code: z.ZodOptional<z.ZodString>;
821
1141
  nonce: z.ZodString;
822
1142
  iat: z.ZodInt;
823
1143
  }, z.core.$strip>;
@@ -829,29 +1149,43 @@ export declare const SCHEMAS: {
829
1149
  exp: z.ZodInt;
830
1150
  rp: z.ZodString;
831
1151
  }, z.core.$strip>;
832
- readonly "control-key": z.ZodObject<{
1152
+ readonly "control-key": z.ZodXor<readonly [z.ZodObject<{
833
1153
  id: z.ZodString;
834
1154
  alg: z.ZodUnion<readonly [z.ZodLiteral<-7>, z.ZodLiteral<-257>]>;
835
1155
  spki: z.ZodString;
836
- }, z.core.$strip>;
1156
+ }, z.core.$strict>, z.ZodObject<{
1157
+ id: z.ZodString;
1158
+ alg: z.ZodLiteral<-7>;
1159
+ spki: z.ZodString;
1160
+ type: z.ZodLiteral<"device">;
1161
+ store: z.ZodLiteral<"hardware">;
1162
+ uv: z.ZodLiteral<"each-use">;
1163
+ }, z.core.$strict>]>;
837
1164
  readonly "control-poll": z.ZodObject<{
838
1165
  messages: z.ZodArray<z.ZodObject<{
839
1166
  id: z.ZodString;
840
1167
  cmd: z.ZodString;
841
1168
  csig: z.ZodOptional<z.ZodNullable<z.ZodString>>;
842
- grant: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1169
+ grant: z.ZodOptional<z.ZodNullable<z.ZodXor<readonly [z.ZodObject<{
843
1170
  cred: z.ZodString;
844
1171
  ad: z.ZodString;
845
1172
  cd: z.ZodString;
846
1173
  sig: z.ZodString;
847
1174
  str: z.ZodString;
848
- }, z.core.$strip>>>;
849
- confirm: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1175
+ }, z.core.$strip>, z.ZodObject<{
1176
+ cred: z.ZodString;
1177
+ sig: z.ZodString;
1178
+ str: z.ZodString;
1179
+ }, z.core.$strict>]>>>;
1180
+ confirm: z.ZodOptional<z.ZodNullable<z.ZodXor<readonly [z.ZodObject<{
850
1181
  cred: z.ZodString;
851
1182
  ad: z.ZodString;
852
1183
  cd: z.ZodString;
853
1184
  sig: z.ZodString;
854
- }, z.core.$strip>>>;
1185
+ }, z.core.$strip>, z.ZodObject<{
1186
+ cred: z.ZodString;
1187
+ sig: z.ZodString;
1188
+ }, z.core.$strict>]>>>;
855
1189
  at: z.ZodISODateTime;
856
1190
  expires_at: z.ZodISODateTime;
857
1191
  }, z.core.$strip>>;
@@ -882,6 +1216,16 @@ export declare const SCHEMAS: {
882
1216
  detail: z.ZodOptional<z.ZodString>;
883
1217
  reply: z.ZodOptional<z.ZodString>;
884
1218
  seq: z.ZodOptional<z.ZodInt>;
1219
+ applied: z.ZodOptional<z.ZodObject<{
1220
+ permission: z.ZodOptional<z.ZodEnum<{
1221
+ auto: "auto";
1222
+ edits: "edits";
1223
+ inherit: "inherit";
1224
+ read: "read";
1225
+ safe: "safe";
1226
+ }>>;
1227
+ model: z.ZodOptional<z.ZodString>;
1228
+ }, z.core.$strict>>;
885
1229
  }, z.core.$strip>>;
886
1230
  }, z.core.$strip>;
887
1231
  readonly "control-pair": z.ZodObject<{
@@ -901,14 +1245,20 @@ export declare const SCHEMAS: {
901
1245
  folders: z.ZodOptional<z.ZodArray<z.ZodString>>;
902
1246
  mode: z.ZodOptional<z.ZodEnum<{
903
1247
  auto: "auto";
1248
+ inherit: "inherit";
904
1249
  safe: "safe";
905
1250
  }>>;
906
1251
  accounts: z.ZodOptional<z.ZodArray<z.ZodObject<{
907
1252
  harness: z.ZodString;
908
1253
  id: z.ZodString;
909
1254
  email: z.ZodOptional<z.ZodString>;
1255
+ name: z.ZodOptional<z.ZodString>;
910
1256
  }, z.core.$strip>>>;
911
1257
  files: z.ZodOptional<z.ZodBoolean>;
1258
+ key_types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1259
+ device: "device";
1260
+ passkey: "passkey";
1261
+ }>>>;
912
1262
  }, z.core.$strip>;
913
1263
  readonly "control-pair-started": z.ZodObject<{
914
1264
  machine: z.ZodString;
@@ -923,17 +1273,27 @@ export declare const SCHEMAS: {
923
1273
  paired: "paired";
924
1274
  pending: "pending";
925
1275
  }>;
926
- key: z.ZodOptional<z.ZodObject<{
1276
+ key: z.ZodOptional<z.ZodXor<readonly [z.ZodObject<{
927
1277
  id: z.ZodString;
928
1278
  alg: z.ZodUnion<readonly [z.ZodLiteral<-7>, z.ZodLiteral<-257>]>;
929
1279
  spki: z.ZodString;
930
- }, z.core.$strip>>;
931
- proof: z.ZodOptional<z.ZodObject<{
1280
+ }, z.core.$strict>, z.ZodObject<{
1281
+ id: z.ZodString;
1282
+ alg: z.ZodLiteral<-7>;
1283
+ spki: z.ZodString;
1284
+ type: z.ZodLiteral<"device">;
1285
+ store: z.ZodLiteral<"hardware">;
1286
+ uv: z.ZodLiteral<"each-use">;
1287
+ }, z.core.$strict>]>>;
1288
+ proof: z.ZodOptional<z.ZodXor<readonly [z.ZodObject<{
932
1289
  cred: z.ZodString;
933
1290
  ad: z.ZodString;
934
1291
  cd: z.ZodString;
935
1292
  sig: z.ZodString;
936
- }, z.core.$strip>>;
1293
+ }, z.core.$strip>, z.ZodObject<{
1294
+ cred: z.ZodString;
1295
+ sig: z.ZodString;
1296
+ }, z.core.$strict>]>>;
937
1297
  token: z.ZodOptional<z.ZodString>;
938
1298
  sink_token: z.ZodOptional<z.ZodString>;
939
1299
  account: z.ZodOptional<z.ZodString>;
@@ -955,14 +1315,63 @@ export declare const SCHEMAS: {
955
1315
  folders: z.ZodOptional<z.ZodArray<z.ZodString>>;
956
1316
  mode: z.ZodOptional<z.ZodEnum<{
957
1317
  auto: "auto";
1318
+ inherit: "inherit";
958
1319
  safe: "safe";
959
1320
  }>>;
960
1321
  accounts: z.ZodOptional<z.ZodArray<z.ZodObject<{
961
1322
  harness: z.ZodString;
962
1323
  id: z.ZodString;
963
1324
  email: z.ZodOptional<z.ZodString>;
1325
+ name: z.ZodOptional<z.ZodString>;
964
1326
  }, z.core.$strip>>>;
965
1327
  files: z.ZodOptional<z.ZodBoolean>;
1328
+ prompt_files: z.ZodOptional<z.ZodBoolean>;
1329
+ start: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1330
+ permissions: z.ZodArray<z.ZodEnum<{
1331
+ auto: "auto";
1332
+ edits: "edits";
1333
+ read: "read";
1334
+ safe: "safe";
1335
+ }>>;
1336
+ permission: z.ZodEnum<{
1337
+ auto: "auto";
1338
+ edits: "edits";
1339
+ inherit: "inherit";
1340
+ read: "read";
1341
+ safe: "safe";
1342
+ }>;
1343
+ models: z.ZodOptional<z.ZodArray<z.ZodString>>;
1344
+ any_model: z.ZodOptional<z.ZodBoolean>;
1345
+ }, z.core.$strip>>>;
1346
+ key_types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1347
+ device: "device";
1348
+ passkey: "passkey";
1349
+ }>>>;
1350
+ pool: z.ZodOptional<z.ZodObject<{
1351
+ on: z.ZodBoolean;
1352
+ harness: z.ZodString;
1353
+ accounts: z.ZodArray<z.ZodObject<{
1354
+ id: z.ZodString;
1355
+ email: z.ZodOptional<z.ZodString>;
1356
+ label: z.ZodOptional<z.ZodString>;
1357
+ enabled: z.ZodBoolean;
1358
+ status: z.ZodEnum<{
1359
+ disabled: "disabled";
1360
+ error: "error";
1361
+ limited: "limited";
1362
+ ready: "ready";
1363
+ }>;
1364
+ current: z.ZodOptional<z.ZodBoolean>;
1365
+ until: z.ZodOptional<z.ZodISODateTime>;
1366
+ windows: z.ZodOptional<z.ZodArray<z.ZodObject<{
1367
+ id: z.ZodString;
1368
+ used_percent: z.ZodNumber;
1369
+ resets_at: z.ZodOptional<z.ZodISODateTime>;
1370
+ window_minutes: z.ZodOptional<z.ZodInt>;
1371
+ }, z.core.$loose>>>;
1372
+ limited_by: z.ZodOptional<z.ZodString>;
1373
+ }, z.core.$strip>>;
1374
+ }, z.core.$strip>>;
966
1375
  }, z.core.$strip>;
967
1376
  };
968
1377
  //# sourceMappingURL=v1.d.ts.map