@spencerboucher/switchyard 0.12.0 → 0.13.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 (89) hide show
  1. package/README.md +2 -2
  2. package/dist/policies/worker.js +1350 -1276
  3. package/dist/switchyard.mjs +2338 -1651
  4. package/package.json +1 -1
  5. package/web-dist/assets/{AutomationView-BRVq9y-T.js → AutomationView-Cg7yk8nb.js} +2 -2
  6. package/web-dist/assets/{AutomationView-BRVq9y-T.js.map → AutomationView-Cg7yk8nb.js.map} +1 -1
  7. package/web-dist/assets/{Card-BqrWFEYY.js → Card-sHm0eI2Q.js} +2 -2
  8. package/web-dist/assets/{Card-BqrWFEYY.js.map → Card-sHm0eI2Q.js.map} +1 -1
  9. package/web-dist/assets/{Checkbox-DExv3fUO.js → Checkbox-CEvKyfJz.js} +2 -2
  10. package/web-dist/assets/{Checkbox-DExv3fUO.js.map → Checkbox-CEvKyfJz.js.map} +1 -1
  11. package/web-dist/assets/{Copy-BuBbxEQI.js → Copy-BHOLVthK.js} +2 -2
  12. package/web-dist/assets/{Copy-BuBbxEQI.js.map → Copy-BHOLVthK.js.map} +1 -1
  13. package/web-dist/assets/{InteractionCard-0PH6pIkH.js → InteractionCard-B-yhxwKs.js} +3 -3
  14. package/web-dist/assets/{InteractionCard-0PH6pIkH.js.map → InteractionCard-B-yhxwKs.js.map} +1 -1
  15. package/web-dist/assets/{Menu-BJ3Gyh5V.js → Menu-Cyt18mF2.js} +2 -2
  16. package/web-dist/assets/{Menu-BJ3Gyh5V.js.map → Menu-Cyt18mF2.js.map} +1 -1
  17. package/web-dist/assets/Overlay-BPNYBq3V.js +2 -0
  18. package/web-dist/assets/{Overlay-BgqVqKc6.js.map → Overlay-BPNYBq3V.js.map} +1 -1
  19. package/web-dist/assets/{Priority-B2tdgI2D.js → Priority-xSUsxoXm.js} +2 -2
  20. package/web-dist/assets/{Priority-B2tdgI2D.js.map → Priority-xSUsxoXm.js.map} +1 -1
  21. package/web-dist/assets/{SegmentedControl-DzwdZG6q.js → SegmentedControl-DaBwumC0.js} +2 -2
  22. package/web-dist/assets/{SegmentedControl-DzwdZG6q.js.map → SegmentedControl-DaBwumC0.js.map} +1 -1
  23. package/web-dist/assets/{Select-DZ-qJ_AO.js → Select-C5xlhWYb.js} +2 -2
  24. package/web-dist/assets/{Select-DZ-qJ_AO.js.map → Select-C5xlhWYb.js.map} +1 -1
  25. package/web-dist/assets/{Switch-DKiwAXXz.js → Switch-dVcf-7Je.js} +2 -2
  26. package/web-dist/assets/{Switch-DKiwAXXz.js.map → Switch-dVcf-7Je.js.map} +1 -1
  27. package/web-dist/assets/{Tabs-HOeWNnHD.js → Tabs-93APobOB.js} +2 -2
  28. package/web-dist/assets/{Tabs-HOeWNnHD.js.map → Tabs-93APobOB.js.map} +1 -1
  29. package/web-dist/assets/{TextArea-DK1uv3xX.js → TextArea-D8WB5GD8.js} +2 -2
  30. package/web-dist/assets/{TextArea-DK1uv3xX.js.map → TextArea-D8WB5GD8.js.map} +1 -1
  31. package/web-dist/assets/{TextLink-BoFPQuaH.js → TextLink-CrfA8AeH.js} +2 -2
  32. package/web-dist/assets/{TextLink-BoFPQuaH.js.map → TextLink-CrfA8AeH.js.map} +1 -1
  33. package/web-dist/assets/{attention-D1G0KCOr.js → attention-C8rfu6Uw.js} +2 -2
  34. package/web-dist/assets/{attention-D1G0KCOr.js.map → attention-C8rfu6Uw.js.map} +1 -1
  35. package/web-dist/assets/automations-DQxUzi5Q.js +2 -0
  36. package/web-dist/assets/{automations-DUUAfMK8.js.map → automations-DQxUzi5Q.js.map} +1 -1
  37. package/web-dist/assets/board-aS6ooJpx.js +10 -0
  38. package/web-dist/assets/{board-tIuyEKO0.js.map → board-aS6ooJpx.js.map} +1 -1
  39. package/web-dist/assets/code-Zr5DqwWI.js +25 -0
  40. package/web-dist/assets/code-Zr5DqwWI.js.map +1 -0
  41. package/web-dist/assets/{describe-BW5uUuvy.js → describe-w4KmQFfU.js} +2 -2
  42. package/web-dist/assets/{describe-BW5uUuvy.js.map → describe-w4KmQFfU.js.map} +1 -1
  43. package/web-dist/assets/enroll-DPKdD0en.js +2 -0
  44. package/web-dist/assets/{enroll-CL0BGGhd.js.map → enroll-DPKdD0en.js.map} +1 -1
  45. package/web-dist/assets/index-DFNY2EUd.css +2 -0
  46. package/web-dist/assets/index-DPScWz2I.js +11 -0
  47. package/web-dist/assets/index-DPScWz2I.js.map +1 -0
  48. package/web-dist/assets/{more-DNN_mtX8.js → more-CiyGP5GD.js} +2 -2
  49. package/web-dist/assets/{more-DNN_mtX8.js.map → more-CiyGP5GD.js.map} +1 -1
  50. package/web-dist/assets/{policyLogic-BKSj6mhC.js → policyLogic-7OOzM_xa.js} +2 -2
  51. package/web-dist/assets/{policyLogic-BKSj6mhC.js.map → policyLogic-7OOzM_xa.js.map} +1 -1
  52. package/web-dist/assets/{preload-helper-BudhqmWi.js → preload-helper-B2m1UyXR.js} +5 -5
  53. package/web-dist/assets/preload-helper-B2m1UyXR.js.map +1 -0
  54. package/web-dist/assets/queue-BcbJqzTY.js +2 -0
  55. package/web-dist/assets/{queue-k4o-I9uY.js.map → queue-BcbJqzTY.js.map} +1 -1
  56. package/web-dist/assets/{repo-CSQAnBaF.js → repo-BA_bnCvu.js} +2 -2
  57. package/web-dist/assets/{repo-CSQAnBaF.js.map → repo-BA_bnCvu.js.map} +1 -1
  58. package/web-dist/assets/settings-D03MF_Kx.js +7 -0
  59. package/web-dist/assets/{settings-CrYZRJ7E.js.map → settings-D03MF_Kx.js.map} +1 -1
  60. package/web-dist/assets/{shared-DIA598ns.js → shared-Bxc2JM1K.js} +2 -2
  61. package/web-dist/assets/{shared-DIA598ns.js.map → shared-Bxc2JM1K.js.map} +1 -1
  62. package/web-dist/assets/states-DynH8-o6.js +58 -0
  63. package/web-dist/assets/states-DynH8-o6.js.map +1 -0
  64. package/web-dist/assets/terminal-login-C0n8cXqn.js +2 -0
  65. package/web-dist/assets/{terminal-login-M5orrPPe.js.map → terminal-login-C0n8cXqn.js.map} +1 -1
  66. package/web-dist/assets/{useBreakpoint-CA0Mbmvv.js → useBreakpoint-CYDIV-KM.js} +2 -2
  67. package/web-dist/assets/{useBreakpoint-CA0Mbmvv.js.map → useBreakpoint-CYDIV-KM.js.map} +1 -1
  68. package/web-dist/assets/useNow-0tMsLHnB.js +2 -0
  69. package/web-dist/assets/{useNow-Dx0MCCez.js.map → useNow-0tMsLHnB.js.map} +1 -1
  70. package/web-dist/assets/{useResource-BTjwa4tV.js → useResource-DHtFcID5.js} +2 -2
  71. package/web-dist/assets/{useResource-BTjwa4tV.js.map → useResource-DHtFcID5.js.map} +1 -1
  72. package/web-dist/index.html +8 -8
  73. package/web-dist/sw.js +1 -1
  74. package/web-dist/assets/Overlay-BgqVqKc6.js +0 -2
  75. package/web-dist/assets/automations-DUUAfMK8.js +0 -2
  76. package/web-dist/assets/board-tIuyEKO0.js +0 -10
  77. package/web-dist/assets/code-O-DyPB50.js +0 -25
  78. package/web-dist/assets/code-O-DyPB50.js.map +0 -1
  79. package/web-dist/assets/enroll-CL0BGGhd.js +0 -2
  80. package/web-dist/assets/index-D-JHf__5.css +0 -2
  81. package/web-dist/assets/index-K0QOY1Li.js +0 -11
  82. package/web-dist/assets/index-K0QOY1Li.js.map +0 -1
  83. package/web-dist/assets/preload-helper-BudhqmWi.js.map +0 -1
  84. package/web-dist/assets/queue-k4o-I9uY.js +0 -2
  85. package/web-dist/assets/settings-CrYZRJ7E.js +0 -7
  86. package/web-dist/assets/states-C8oEFqek.js +0 -58
  87. package/web-dist/assets/states-C8oEFqek.js.map +0 -1
  88. package/web-dist/assets/terminal-login-M5orrPPe.js +0 -2
  89. package/web-dist/assets/useNow-Dx0MCCez.js +0 -2
@@ -477,28 +477,193 @@ var AgentResultFrame = z3.discriminatedUnion("ok", [
477
477
  ]);
478
478
 
479
479
  // packages/protocol/dist/api.js
480
- import { z as z10 } from "zod";
480
+ import { z as z11 } from "zod";
481
481
 
482
482
  // packages/protocol/dist/entities.js
483
- import { z as z6 } from "zod";
483
+ import { z as z7 } from "zod";
484
484
 
485
- // packages/protocol/dist/github.js
485
+ // packages/protocol/dist/contributions.js
486
+ import { z as z5 } from "zod";
487
+
488
+ // packages/protocol/dist/ui.js
486
489
  import { z as z4 } from "zod";
487
- var Id3 = z4.string().min(1).max(200);
488
- var Instant3 = z4.string().refine((s) => {
490
+ var ToneSchema = z4.enum(["default", "muted", "success", "warning", "danger"]);
491
+ var ShowIfSchema = z4.object({ field: z4.string(), values: z4.array(z4.string()) });
492
+ var OptionSchema = z4.object({
493
+ value: z4.string(),
494
+ label: z4.string(),
495
+ description: z4.string().optional(),
496
+ preview: z4.string().optional()
497
+ });
498
+ var AllowOther = z4.object({ label: z4.string(), placeholder: z4.string().optional() });
499
+ var FieldSchema = z4.discriminatedUnion("kind", [
500
+ z4.object({
501
+ kind: z4.literal("select"),
502
+ name: z4.string(),
503
+ label: z4.string(),
504
+ options: z4.array(OptionSchema),
505
+ allowOther: AllowOther.optional(),
506
+ showIf: ShowIfSchema.optional()
507
+ }),
508
+ z4.object({
509
+ kind: z4.literal("multiselect"),
510
+ name: z4.string(),
511
+ label: z4.string(),
512
+ options: z4.array(OptionSchema),
513
+ allowOther: AllowOther.optional(),
514
+ min: z4.number().int().min(0).optional(),
515
+ max: z4.number().int().min(1).optional(),
516
+ showIf: ShowIfSchema.optional()
517
+ }),
518
+ z4.object({
519
+ kind: z4.literal("text"),
520
+ name: z4.string(),
521
+ label: z4.string(),
522
+ placeholder: z4.string().optional(),
523
+ multiline: z4.boolean().optional(),
524
+ prefill: z4.string().optional(),
525
+ showIf: ShowIfSchema.optional()
526
+ })
527
+ ]);
528
+ var RefSchema = z4.discriminatedUnion("kind", [
529
+ z4.object({ kind: z4.literal("file"), path: z4.string() }),
530
+ z4.object({ kind: z4.literal("session"), sessionId: z4.string() }),
531
+ z4.object({ kind: z4.literal("task"), taskId: z4.string() }),
532
+ z4.object({ kind: z4.literal("native_session"), hostId: z4.string(), sessionFile: z4.string() })
533
+ ]);
534
+ var UINodeSchema = z4.lazy(() => z4.discriminatedUnion("t", [
535
+ z4.object({ t: z4.literal("text"), text: z4.string(), tone: ToneSchema.optional() }),
536
+ z4.object({ t: z4.literal("markdown"), text: z4.string() }),
537
+ z4.object({ t: z4.literal("code"), text: z4.string(), lang: z4.string().optional() }),
538
+ z4.object({ t: z4.literal("diff"), patch: z4.string() }),
539
+ z4.object({
540
+ t: z4.literal("list"),
541
+ items: z4.array(UINodeSchema),
542
+ ordered: z4.boolean().optional()
543
+ }),
544
+ z4.object({
545
+ t: z4.literal("table"),
546
+ columns: z4.array(z4.string()),
547
+ rows: z4.array(z4.array(z4.string()))
548
+ }),
549
+ z4.object({
550
+ t: z4.literal("section"),
551
+ title: z4.string().optional(),
552
+ collapsible: z4.boolean().optional(),
553
+ children: z4.array(UINodeSchema)
554
+ }),
555
+ z4.object({
556
+ t: z4.literal("tabs"),
557
+ tabs: z4.array(z4.object({ id: z4.string(), label: z4.string(), children: z4.array(UINodeSchema) }))
558
+ }),
559
+ z4.object({
560
+ t: z4.literal("progress"),
561
+ label: z4.string(),
562
+ value: z4.number().min(0).max(1).optional(),
563
+ status: z4.enum(["running", "ok", "error"]).optional()
564
+ }),
565
+ z4.object({ t: z4.literal("ref"), ref: RefSchema, label: z4.string() }),
566
+ z4.object({
567
+ t: z4.literal("form"),
568
+ formId: z4.string(),
569
+ fields: z4.array(FieldSchema),
570
+ submitLabel: z4.string(),
571
+ cancelLabel: z4.string().optional()
572
+ }),
573
+ z4.object({
574
+ t: z4.literal("confirm"),
575
+ message: z4.string(),
576
+ confirmLabel: z4.string(),
577
+ cancelLabel: z4.string(),
578
+ destructive: z4.boolean().optional()
579
+ }),
580
+ z4.object({
581
+ t: z4.literal("actions"),
582
+ actions: z4.array(z4.object({
583
+ id: z4.string(),
584
+ label: z4.string(),
585
+ tone: z4.enum(["default", "primary", "danger"]).optional()
586
+ }))
587
+ })
588
+ ]));
589
+ var FormValueSchema = z4.union([
590
+ z4.string(),
591
+ z4.array(z4.string()),
592
+ z4.object({ other: z4.string() })
593
+ ]);
594
+ var InteractionResponseSchema = z4.discriminatedUnion("kind", [
595
+ z4.object({ kind: z4.literal("form"), values: z4.record(z4.string(), FormValueSchema) }),
596
+ z4.object({ kind: z4.literal("confirm"), confirmed: z4.boolean() }),
597
+ z4.object({ kind: z4.literal("action"), actionId: z4.string() }),
598
+ z4.object({ kind: z4.literal("cancel") })
599
+ ]);
600
+
601
+ // packages/protocol/dist/contributions.js
602
+ var ContributionPlacement = z5.enum([
603
+ "sidebar.header",
604
+ "sidebar.footer",
605
+ "session.panel",
606
+ "composer.pill",
607
+ "palette.item",
608
+ "slash.command"
609
+ ]);
610
+ var Id3 = z5.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9._-]{0,79}$/);
611
+ var ActionId = z5.string().min(1).max(200);
612
+ var Keywords = z5.array(z5.string().min(1).max(80)).max(20);
613
+ var Common = {
614
+ placement: ContributionPlacement,
615
+ order: z5.number().int().min(-1e3).max(1e3).optional(),
616
+ actionId: ActionId.optional()
617
+ };
618
+ var ContributionDescriptor = z5.object({
619
+ id: Id3,
620
+ ...Common,
621
+ name: z5.string().regex(/^[a-z][a-z0-9-]{0,39}$/).optional(),
622
+ keywords: Keywords.optional()
623
+ }).strict().superRefine((v, ctx) => {
624
+ if (v.placement === "slash.command" && (!v.name || !v.actionId)) {
625
+ ctx.addIssue({ code: "custom", message: "Slash commands need name and actionId" });
626
+ }
627
+ if (v.placement === "palette.item" && !v.actionId) {
628
+ ctx.addIssue({ code: "custom", message: "Palette items need actionId" });
629
+ }
630
+ if (v.placement !== "slash.command" && v.name !== void 0) {
631
+ ctx.addIssue({ code: "custom", message: "Only slash commands have names" });
632
+ }
633
+ if (v.placement !== "palette.item" && v.keywords !== void 0) {
634
+ ctx.addIssue({ code: "custom", message: "Only palette items have keywords" });
635
+ }
636
+ if (v.placement === "composer.pill" && v.actionId !== void 0) {
637
+ ctx.addIssue({ code: "custom", message: "Composer pills are not interactive" });
638
+ }
639
+ });
640
+ var ContributionInput = z5.object({
641
+ ...Common,
642
+ title: z5.string().min(1).max(100),
643
+ node: z5.unknown(),
644
+ mobileFallback: z5.string().min(1).max(2e3),
645
+ state: z5.unknown().optional(),
646
+ name: z5.string().regex(/^[a-z][a-z0-9-]{0,39}$/).optional(),
647
+ keywords: Keywords.optional()
648
+ }).strict();
649
+
650
+ // packages/protocol/dist/github.js
651
+ import { z as z6 } from "zod";
652
+ var Id4 = z6.string().min(1).max(200);
653
+ var Instant3 = z6.string().refine((s) => {
489
654
  try {
490
655
  return new Date(s).toISOString() === s;
491
656
  } catch {
492
657
  return false;
493
658
  }
494
659
  });
495
- var positive = z4.number().int().safe().positive();
496
- var nonnegative = z4.number().int().safe().nonnegative();
497
- var reason = z4.string().min(1).max(2e3);
498
- var hash = z4.string().regex(/^[0-9a-f]{64}$/);
499
- var actionsId = z4.string().regex(/^[1-9][0-9]{0,19}$/);
660
+ var positive = z6.number().int().safe().positive();
661
+ var nonnegative = z6.number().int().safe().nonnegative();
662
+ var reason = z6.string().min(1).max(2e3);
663
+ var hash = z6.string().regex(/^[0-9a-f]{64}$/);
664
+ var actionsId = z6.string().regex(/^[1-9][0-9]{0,19}$/);
500
665
  var bytes2 = (s) => new TextEncoder().encode(s).length;
501
- var displayUrl = z4.string().max(4096).refine((s) => {
666
+ var displayUrl = z6.string().max(4096).refine((s) => {
502
667
  try {
503
668
  const u = new URL(s);
504
669
  return ["http:", "https:"].includes(u.protocol) && !u.username && !u.password;
@@ -514,14 +679,14 @@ var githubUrl = displayUrl.refine((s) => {
514
679
  return false;
515
680
  }
516
681
  });
517
- var GitHubRepository = z4.string().regex(/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?\/(?!\.{1,2}$)[A-Za-z0-9_.-]{1,100}$/);
682
+ var GitHubRepository = z6.string().regex(/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?\/(?!\.{1,2}$)[A-Za-z0-9_.-]{1,100}$/);
518
683
  var issuePath = /^[hH][tT][tT][pP][sS]:\/\/[gG][iI][tT][hH][uU][bB]\.[cC][oO][mM]\/([^/]+)\/([^/]+)\/issues\/([1-9][0-9]*)$/;
519
- var GitHubIssueUrl = z4.string().trim().transform((raw, ctx) => {
684
+ var GitHubIssueUrl = z6.string().trim().transform((raw, ctx) => {
520
685
  const match = issuePath.exec(raw);
521
686
  const number = match ? Number(match[3]) : NaN;
522
687
  if (!match || !GitHubRepository.safeParse(`${match[1]}/${match[2]}`).success || !Number.isSafeInteger(number)) {
523
688
  ctx.addIssue({ code: "custom", message: "Invalid GitHub issue URL" });
524
- return z4.NEVER;
689
+ return z6.NEVER;
525
690
  }
526
691
  return `https://github.com/${match[1]}/${match[2]}/issues/${number}`;
527
692
  });
@@ -534,7 +699,7 @@ function issuePrompt(url) {
534
699
 
535
700
  Read it with \`gh issue view ${url}\`.`;
536
701
  }
537
- var GitHubIssueIdentity = z4.object({
702
+ var GitHubIssueIdentity = z6.object({
538
703
  repository: GitHubRepository,
539
704
  number: positive,
540
705
  url: GitHubIssueUrl
@@ -542,11 +707,11 @@ var GitHubIssueIdentity = z4.object({
542
707
  const parts = issueParts(v.url);
543
708
  return v.repository === parts.repository && v.number === parts.number;
544
709
  });
545
- var GitHubIssue = z4.object({
710
+ var GitHubIssue = z6.object({
546
711
  repository: GitHubRepository,
547
712
  number: positive,
548
713
  url: GitHubIssueUrl,
549
- launchPrompt: z4.string()
714
+ launchPrompt: z6.string()
550
715
  }).strict().refine((v) => {
551
716
  const parts = issueParts(v.url);
552
717
  return v.repository === parts.repository && v.number === parts.number && v.launchPrompt === issuePrompt(v.url);
@@ -555,7 +720,7 @@ function githubIssueFromUrl(raw) {
555
720
  const url = GitHubIssueUrl.parse(raw);
556
721
  return { ...issueParts(url), url, launchPrompt: issuePrompt(url) };
557
722
  }
558
- var GitHubSha = z4.string().regex(/^[0-9a-f]{40}$/);
723
+ var GitHubSha = z6.string().regex(/^[0-9a-f]{40}$/);
559
724
  var prUrl = githubUrl.refine((s) => {
560
725
  try {
561
726
  const u = new URL(s);
@@ -572,57 +737,57 @@ function matchesPr(url, repository, number) {
572
737
  return false;
573
738
  }
574
739
  }
575
- var HostGitHub = z4.object({ available: z4.boolean(), reason: reason.nullable() }).strict().refine((v) => v.available === (v.reason === null));
576
- var GitHubCheck = z4.object({
740
+ var HostGitHub = z6.object({ available: z6.boolean(), reason: reason.nullable() }).strict().refine((v) => v.available === (v.reason === null));
741
+ var GitHubCheck = z6.object({
577
742
  id: hash,
578
- name: z4.string().min(1).max(300),
579
- state: z4.string().min(1).max(100),
580
- bucket: z4.enum(["pass", "fail", "pending", "skipping", "cancel", "unknown"]),
743
+ name: z6.string().min(1).max(300),
744
+ state: z6.string().min(1).max(100),
745
+ bucket: z6.enum(["pass", "fail", "pending", "skipping", "cancel", "unknown"]),
581
746
  link: displayUrl.nullable(),
582
- workflow: z4.string().max(300).nullable(),
583
- event: z4.string().max(100).nullable(),
747
+ workflow: z6.string().max(300).nullable(),
748
+ event: z6.string().max(100).nullable(),
584
749
  startedAt: Instant3.nullable(),
585
750
  completedAt: Instant3.nullable(),
586
- description: z4.string().max(2e3).nullable(),
587
- actionsJob: z4.object({ runId: actionsId, jobId: actionsId, attempt: positive }).strict().nullable()
751
+ description: z6.string().max(2e3).nullable(),
752
+ actionsJob: z6.object({ runId: actionsId, jobId: actionsId, attempt: positive }).strict().nullable()
588
753
  }).strict();
589
- var GitHubComment = z4.object({
590
- id: Id3,
591
- author: z4.string().min(1).max(200).nullable(),
592
- body: z4.string().refine((v) => [...v].length <= 8e3),
593
- bodyTruncated: z4.boolean(),
754
+ var GitHubComment = z6.object({
755
+ id: Id4,
756
+ author: z6.string().min(1).max(200).nullable(),
757
+ body: z6.string().refine((v) => [...v].length <= 8e3),
758
+ bodyTruncated: z6.boolean(),
594
759
  url: githubUrl,
595
760
  createdAt: Instant3.nullable()
596
761
  }).strict();
597
- var GitHubThread = z4.object({
598
- id: Id3,
599
- isResolved: z4.literal(false),
600
- isOutdated: z4.boolean(),
601
- path: z4.string().max(8192).nullable(),
762
+ var GitHubThread = z6.object({
763
+ id: Id4,
764
+ isResolved: z6.literal(false),
765
+ isOutdated: z6.boolean(),
766
+ path: z6.string().max(8192).nullable(),
602
767
  line: positive.nullable(),
603
768
  startLine: positive.nullable(),
604
- side: z4.enum(["LEFT", "RIGHT"]).nullable(),
605
- comments: z4.array(GitHubComment).max(10),
606
- commentsComplete: z4.boolean()
769
+ side: z6.enum(["LEFT", "RIGHT"]).nullable(),
770
+ comments: z6.array(GitHubComment).max(10),
771
+ commentsComplete: z6.boolean()
607
772
  }).strict();
608
- var GitHubPullRequest = z4.object({
609
- nodeId: z4.string().min(1).optional(),
773
+ var GitHubPullRequest = z6.object({
774
+ nodeId: z6.string().min(1).optional(),
610
775
  number: positive,
611
776
  url: prUrl,
612
- title: z4.string().min(1).max(1e3),
613
- state: z4.enum(["OPEN", "CLOSED", "MERGED"]),
614
- isDraft: z4.boolean(),
615
- headRefName: z4.string().min(1).max(255),
777
+ title: z6.string().min(1).max(1e3),
778
+ state: z6.enum(["OPEN", "CLOSED", "MERGED"]),
779
+ isDraft: z6.boolean(),
780
+ headRefName: z6.string().min(1).max(255),
616
781
  headRefOid: GitHubSha,
617
782
  headRepository: GitHubRepository.nullable(),
618
- baseRefName: z4.string().min(1).max(255),
619
- mergeable: z4.string().min(1).max(100),
620
- mergeStateStatus: z4.string().min(1).max(100),
621
- reviewDecision: z4.enum(["APPROVED", "REVIEW_REQUIRED", "CHANGES_REQUESTED"]).nullable(),
622
- mergeQueueEnabled: z4.boolean(),
623
- inMergeQueue: z4.boolean(),
624
- autoMergeEnabled: z4.boolean(),
625
- squashMergeAllowed: z4.boolean()
783
+ baseRefName: z6.string().min(1).max(255),
784
+ mergeable: z6.string().min(1).max(100),
785
+ mergeStateStatus: z6.string().min(1).max(100),
786
+ reviewDecision: z6.enum(["APPROVED", "REVIEW_REQUIRED", "CHANGES_REQUESTED"]).nullable(),
787
+ mergeQueueEnabled: z6.boolean(),
788
+ inMergeQueue: z6.boolean(),
789
+ autoMergeEnabled: z6.boolean(),
790
+ squashMergeAllowed: z6.boolean()
626
791
  }).strict().refine((v) => {
627
792
  try {
628
793
  return new URL(v.url).pathname.endsWith(`/pull/${v.number}`);
@@ -630,20 +795,20 @@ var GitHubPullRequest = z4.object({
630
795
  return false;
631
796
  }
632
797
  });
633
- var WorkspaceGitHub = z4.object({
798
+ var WorkspaceGitHub = z6.object({
634
799
  repository: GitHubRepository.nullable(),
635
800
  headRepository: GitHubRepository.nullable(),
636
- branch: z4.string().min(1).max(255).nullable(),
801
+ branch: z6.string().min(1).max(255).nullable(),
637
802
  fetchedAt: Instant3.nullable(),
638
803
  attemptedAt: Instant3,
639
- status: z4.enum(["ready", "unavailable", "error", "ambiguous"]),
804
+ status: z6.enum(["ready", "unavailable", "error", "ambiguous"]),
640
805
  reason: reason.nullable(),
641
806
  pullRequest: GitHubPullRequest.nullable(),
642
- checks: z4.array(GitHubCheck).max(500),
643
- checksComplete: z4.boolean(),
644
- threads: z4.array(GitHubThread).max(500),
645
- threadsComplete: z4.boolean(),
646
- truncated: z4.boolean()
807
+ checks: z6.array(GitHubCheck).max(500),
808
+ checksComplete: z6.boolean(),
809
+ threads: z6.array(GitHubThread).max(500),
810
+ threadsComplete: z6.boolean(),
811
+ truncated: z6.boolean()
647
812
  }).strict().refine((v) => {
648
813
  if (bytes2(JSON.stringify(v)) > 512 * 1024 || new Set(v.checks.map((c) => c.id)).size !== v.checks.length)
649
814
  return false;
@@ -655,8 +820,8 @@ var WorkspaceGitHub = z4.object({
655
820
  return v.reason !== null && !v.checksComplete && !v.threadsComplete;
656
821
  return v.reason === null && v.fetchedAt !== null && v.repository !== null && v.headRepository !== null && v.branch !== null && (v.pullRequest !== null || v.checks.length === 0 && v.threads.length === 0 && v.checksComplete && v.threadsComplete);
657
822
  });
658
- var GitHubViewResult = z4.object({ github: HostGitHub, snapshot: WorkspaceGitHub }).strict();
659
- var GitHubViewResponse = z4.object({ github: HostGitHub.nullable(), snapshot: WorkspaceGitHub.nullable() }).strict();
823
+ var GitHubViewResult = z6.object({ github: HostGitHub, snapshot: WorkspaceGitHub }).strict();
824
+ var GitHubViewResponse = z6.object({ github: HostGitHub.nullable(), snapshot: WorkspaceGitHub.nullable() }).strict();
660
825
  function lineCount(s) {
661
826
  if (!s)
662
827
  return 0;
@@ -665,14 +830,14 @@ function lineCount(s) {
665
830
  lines.pop();
666
831
  return lines.length;
667
832
  }
668
- var GitHubJobLog = z4.object({
833
+ var GitHubJobLog = z6.object({
669
834
  checkId: hash,
670
- name: z4.string().min(1).max(300),
835
+ name: z6.string().min(1).max(300),
671
836
  url: displayUrl.nullable(),
672
837
  runId: actionsId.nullable(),
673
838
  jobId: actionsId.nullable(),
674
839
  attempt: positive.nullable(),
675
- status: z4.enum([
840
+ status: z6.enum([
676
841
  "available",
677
842
  "unmapped",
678
843
  "incomplete",
@@ -681,26 +846,26 @@ var GitHubJobLog = z4.object({
681
846
  "timeout",
682
847
  "error"
683
848
  ]),
684
- outputTail: z4.string().nullable(),
849
+ outputTail: z6.string().nullable(),
685
850
  lineCount: nonnegative.max(150),
686
- truncated: z4.boolean(),
851
+ truncated: z6.boolean(),
687
852
  reason: reason.nullable()
688
853
  }).strict().refine((v) => v.status === "available" ? v.runId !== null && v.jobId !== null && v.attempt !== null && v.outputTail !== null && bytes2(v.outputTail) <= 65536 && lineCount(v.outputTail) === v.lineCount && v.reason === null : v.outputTail === null && v.lineCount === 0 && v.reason !== null);
689
- var GitHubLogs = z4.object({
854
+ var GitHubLogs = z6.object({
690
855
  github: HostGitHub,
691
856
  repository: GitHubRepository,
692
857
  number: positive,
693
858
  headOid: GitHubSha,
694
859
  fetchedAt: Instant3,
695
- status: z4.enum(["ready", "unavailable", "error"]),
860
+ status: z6.enum(["ready", "unavailable", "error"]),
696
861
  reason: reason.nullable(),
697
- jobs: z4.array(GitHubJobLog).max(10),
698
- complete: z4.boolean(),
699
- truncated: z4.boolean(),
862
+ jobs: z6.array(GitHubJobLog).max(10),
863
+ complete: z6.boolean(),
864
+ truncated: z6.boolean(),
700
865
  omittedJobs: nonnegative.nullable()
701
866
  }).strict().refine((v) => bytes2(JSON.stringify(v)) <= 1024 * 1024 && (v.status === "ready" ? v.github.available && v.reason === null && (!v.complete || v.omittedJobs === 0 && v.jobs.every((j) => j.status === "available")) : v.reason !== null && v.jobs.length === 0 && !v.complete));
702
- var GitHubLogsRequest = z4.object({ expectedHeadOid: GitHubSha }).strict();
703
- var GitHubMergeRequest = z4.object({ expectedHeadOid: GitHubSha }).strict();
867
+ var GitHubLogsRequest = z6.object({ expectedHeadOid: GitHubSha }).strict();
868
+ var GitHubMergeRequest = z6.object({ expectedHeadOid: GitHubSha }).strict();
704
869
  var mergeFields = {
705
870
  github: HostGitHub,
706
871
  repository: GitHubRepository,
@@ -708,330 +873,217 @@ var mergeFields = {
708
873
  url: prUrl,
709
874
  expectedHeadOid: GitHubSha
710
875
  };
711
- var GitHubMergeResult = z4.discriminatedUnion("status", [
712
- z4.object({
713
- status: z4.literal("merged"),
876
+ var GitHubMergeResult = z6.discriminatedUnion("status", [
877
+ z6.object({
878
+ status: z6.literal("merged"),
714
879
  ...mergeFields,
715
880
  mergeCommitOid: GitHubSha.nullable(),
716
881
  confirmedAt: Instant3
717
882
  }).strict(),
718
- z4.object({
719
- status: z4.literal("outcome_unknown"),
883
+ z6.object({
884
+ status: z6.literal("outcome_unknown"),
720
885
  ...mergeFields,
721
886
  reason,
722
887
  attemptedAt: Instant3
723
888
  }).strict()
724
889
  ]).refine((v) => matchesPr(v.url, v.repository, v.number));
725
- var path = z4.string().min(1).max(8192);
726
- var GitHubHostViewRequest = z4.object({ path }).strict();
727
- var GitHubHostLogsRequest = z4.object({ path, repository: GitHubRepository, number: positive, expectedHeadOid: GitHubSha }).strict();
890
+ var path = z6.string().min(1).max(8192);
891
+ var GitHubHostViewRequest = z6.object({ path }).strict();
892
+ var GitHubHostLogsRequest = z6.object({ path, repository: GitHubRepository, number: positive, expectedHeadOid: GitHubSha }).strict();
728
893
  var GitHubHostMergeRequest = GitHubHostLogsRequest.extend({
729
- expectedPullRequestNodeId: z4.string().min(1)
894
+ expectedPullRequestNodeId: z6.string().min(1)
730
895
  });
731
896
 
732
- // packages/protocol/dist/ui.js
733
- import { z as z5 } from "zod";
734
- var ToneSchema = z5.enum(["default", "muted", "success", "warning", "danger"]);
735
- var ShowIfSchema = z5.object({ field: z5.string(), values: z5.array(z5.string()) });
736
- var OptionSchema = z5.object({
737
- value: z5.string(),
738
- label: z5.string(),
739
- description: z5.string().optional(),
740
- preview: z5.string().optional()
741
- });
742
- var AllowOther = z5.object({ label: z5.string(), placeholder: z5.string().optional() });
743
- var FieldSchema = z5.discriminatedUnion("kind", [
744
- z5.object({
745
- kind: z5.literal("select"),
746
- name: z5.string(),
747
- label: z5.string(),
748
- options: z5.array(OptionSchema),
749
- allowOther: AllowOther.optional(),
750
- showIf: ShowIfSchema.optional()
751
- }),
752
- z5.object({
753
- kind: z5.literal("multiselect"),
754
- name: z5.string(),
755
- label: z5.string(),
756
- options: z5.array(OptionSchema),
757
- allowOther: AllowOther.optional(),
758
- min: z5.number().int().min(0).optional(),
759
- max: z5.number().int().min(1).optional(),
760
- showIf: ShowIfSchema.optional()
761
- }),
762
- z5.object({
763
- kind: z5.literal("text"),
764
- name: z5.string(),
765
- label: z5.string(),
766
- placeholder: z5.string().optional(),
767
- multiline: z5.boolean().optional(),
768
- prefill: z5.string().optional(),
769
- showIf: ShowIfSchema.optional()
770
- })
771
- ]);
772
- var RefSchema = z5.discriminatedUnion("kind", [
773
- z5.object({ kind: z5.literal("file"), path: z5.string() }),
774
- z5.object({ kind: z5.literal("session"), sessionId: z5.string() }),
775
- z5.object({ kind: z5.literal("task"), taskId: z5.string() }),
776
- z5.object({ kind: z5.literal("native_session"), hostId: z5.string(), sessionFile: z5.string() })
777
- ]);
778
- var UINodeSchema = z5.lazy(() => z5.discriminatedUnion("t", [
779
- z5.object({ t: z5.literal("text"), text: z5.string(), tone: ToneSchema.optional() }),
780
- z5.object({ t: z5.literal("markdown"), text: z5.string() }),
781
- z5.object({ t: z5.literal("code"), text: z5.string(), lang: z5.string().optional() }),
782
- z5.object({ t: z5.literal("diff"), patch: z5.string() }),
783
- z5.object({
784
- t: z5.literal("list"),
785
- items: z5.array(UINodeSchema),
786
- ordered: z5.boolean().optional()
787
- }),
788
- z5.object({
789
- t: z5.literal("table"),
790
- columns: z5.array(z5.string()),
791
- rows: z5.array(z5.array(z5.string()))
792
- }),
793
- z5.object({
794
- t: z5.literal("section"),
795
- title: z5.string().optional(),
796
- collapsible: z5.boolean().optional(),
797
- children: z5.array(UINodeSchema)
798
- }),
799
- z5.object({
800
- t: z5.literal("tabs"),
801
- tabs: z5.array(z5.object({ id: z5.string(), label: z5.string(), children: z5.array(UINodeSchema) }))
802
- }),
803
- z5.object({
804
- t: z5.literal("progress"),
805
- label: z5.string(),
806
- value: z5.number().min(0).max(1).optional(),
807
- status: z5.enum(["running", "ok", "error"]).optional()
808
- }),
809
- z5.object({ t: z5.literal("ref"), ref: RefSchema, label: z5.string() }),
810
- z5.object({
811
- t: z5.literal("form"),
812
- formId: z5.string(),
813
- fields: z5.array(FieldSchema),
814
- submitLabel: z5.string(),
815
- cancelLabel: z5.string().optional()
816
- }),
817
- z5.object({
818
- t: z5.literal("confirm"),
819
- message: z5.string(),
820
- confirmLabel: z5.string(),
821
- cancelLabel: z5.string(),
822
- destructive: z5.boolean().optional()
823
- }),
824
- z5.object({
825
- t: z5.literal("actions"),
826
- actions: z5.array(z5.object({
827
- id: z5.string(),
828
- label: z5.string(),
829
- tone: z5.enum(["default", "primary", "danger"]).optional()
830
- }))
831
- })
832
- ]));
833
- var FormValueSchema = z5.union([
834
- z5.string(),
835
- z5.array(z5.string()),
836
- z5.object({ other: z5.string() })
837
- ]);
838
- var InteractionResponseSchema = z5.discriminatedUnion("kind", [
839
- z5.object({ kind: z5.literal("form"), values: z5.record(z5.string(), FormValueSchema) }),
840
- z5.object({ kind: z5.literal("confirm"), confirmed: z5.boolean() }),
841
- z5.object({ kind: z5.literal("action"), actionId: z5.string() }),
842
- z5.object({ kind: z5.literal("cancel") })
843
- ]);
844
-
845
897
  // packages/protocol/dist/entities.js
846
- var Iso = z6.string();
847
- var Id4 = z6.string();
848
- var Connectivity = z6.enum(["connected", "reconnecting", "unreachable"]);
849
- var ControlMode = z6.enum(["automation", "human"]);
850
- var Platform = z6.enum(["darwin", "linux"]);
851
- var DeviceKind = z6.enum(["browser", "pwa", "terminal", "cli"]);
852
- var DiagnosticLevel = z6.enum(["info", "warning", "error"]);
898
+ var Iso = z7.string();
899
+ var Id5 = z7.string();
900
+ var Connectivity = z7.enum(["connected", "reconnecting", "unreachable"]);
901
+ var ControlMode = z7.enum(["automation", "human"]);
902
+ var Platform = z7.enum(["darwin", "linux"]);
903
+ var DeviceKind = z7.enum(["browser", "pwa", "terminal", "cli"]);
904
+ var DiagnosticLevel = z7.enum(["info", "warning", "error"]);
853
905
  var DEFAULT_WORKTREE_DIR = ".worktrees";
854
- var CoreCapabilities = z6.object({
855
- prompt: z6.boolean(),
856
- steer: z6.boolean(),
857
- followUp: z6.boolean(),
858
- abort: z6.boolean(),
859
- resume: z6.boolean(),
860
- rename: z6.boolean(),
861
- importInactive: z6.boolean(),
862
- extensionDialogs: z6.boolean(),
863
- customUi: z6.boolean(),
864
- widgetsText: z6.boolean(),
865
- widgetsComponent: z6.boolean(),
866
- tokenAccounting: z6.boolean(),
867
- costAccounting: z6.boolean()
906
+ var CoreCapabilities = z7.object({
907
+ prompt: z7.boolean(),
908
+ steer: z7.boolean(),
909
+ followUp: z7.boolean(),
910
+ abort: z7.boolean(),
911
+ resume: z7.boolean(),
912
+ rename: z7.boolean(),
913
+ importInactive: z7.boolean(),
914
+ extensionDialogs: z7.boolean(),
915
+ customUi: z7.boolean(),
916
+ widgetsText: z7.boolean(),
917
+ widgetsComponent: z7.boolean(),
918
+ tokenAccounting: z7.boolean(),
919
+ costAccounting: z7.boolean()
868
920
  });
869
921
  var CAPABILITY_KEYS = CoreCapabilities.keyof().options;
870
922
  var RuntimeCapabilities = CoreCapabilities.extend({
871
923
  /** The host runs sessions as interactive Pi in a terminal that clients can attach to. */
872
- terminal: z6.boolean().optional(),
924
+ terminal: z7.boolean().optional(),
873
925
  /** The host answers session.models, session.commands, session.setModel, session.setThinking and session.compact. */
874
- sessionControls: z6.boolean().optional(),
926
+ sessionControls: z7.boolean().optional(),
875
927
  /** The host answers session.navigate for terminal sessions. */
876
- treeNavigation: z6.boolean().optional(),
877
- agentRequests: z6.boolean().optional(),
878
- messageDelivery: z6.boolean().optional(),
879
- policies: z6.boolean().optional(),
880
- unsupported: z6.array(z6.object({ capability: z6.string(), reason: z6.string() }))
881
- });
882
- var ProjectScan = z6.object({
883
- state: z6.enum(["running", "done", "failed"]),
928
+ treeNavigation: z7.boolean().optional(),
929
+ agentRequests: z7.boolean().optional(),
930
+ messageDelivery: z7.boolean().optional(),
931
+ policies: z7.boolean().optional(),
932
+ unsupported: z7.array(z7.object({ capability: z7.string(), reason: z7.string() }))
933
+ });
934
+ var ProjectScan = z7.object({
935
+ state: z7.enum(["running", "done", "failed"]),
884
936
  startedAt: Iso,
885
937
  finishedAt: Iso.nullable(),
886
938
  /** Repositories found across all folders. */
887
- repositories: z6.number().int(),
939
+ repositories: z7.number().int(),
888
940
  /** New projects created by this scan. */
889
- projectsCreated: z6.number().int(),
941
+ projectsCreated: z7.number().int(),
890
942
  /** New checkouts (including the ones of new projects). */
891
- checkoutsAdded: z6.number().int(),
943
+ checkoutsAdded: z7.number().int(),
892
944
  /** "<folder>: <message>" per folder that failed; for state "failed", the reason last. */
893
- errors: z6.array(z6.string())
945
+ errors: z7.array(z7.string())
894
946
  });
895
- var UsageWindow = z6.object({
896
- id: z6.enum(["five_hour", "weekly"]),
897
- usedPct: z6.number(),
947
+ var UsageWindow = z7.object({
948
+ id: z7.enum(["five_hour", "weekly"]),
949
+ usedPct: z7.number(),
898
950
  resetsAt: Iso.nullable()
899
951
  });
900
- var ProviderUsage = z6.object({
901
- provider: z6.enum(["anthropic", "openai-codex"]),
902
- status: z6.enum(["available", "expired", "rejected", "error"]),
903
- message: z6.string().nullable(),
904
- windows: z6.array(UsageWindow),
952
+ var ProviderUsage = z7.object({
953
+ provider: z7.enum(["anthropic", "openai-codex"]),
954
+ status: z7.enum(["available", "expired", "rejected", "error"]),
955
+ message: z7.string().nullable(),
956
+ windows: z7.array(UsageWindow),
905
957
  fetchedAt: Iso
906
958
  });
907
- var Host = z6.object({
908
- id: Id4,
909
- name: z6.string(),
959
+ var Host = z7.object({
960
+ id: Id5,
961
+ name: z7.string(),
910
962
  platform: Platform,
911
- agentVersion: z6.string(),
912
- piVersion: z6.string().nullable(),
913
- piCompatible: z6.boolean(),
963
+ agentVersion: z7.string(),
964
+ piVersion: z7.string().nullable(),
965
+ piCompatible: z7.boolean(),
914
966
  capabilities: RuntimeCapabilities.nullable(),
915
967
  connectivity: Connectivity,
916
968
  lastSeenAt: Iso.nullable(),
917
969
  revokedAt: Iso.nullable(),
918
970
  createdAt: Iso,
919
971
  /** Folders on the host whose git repositories become projects (absolute or ~/...). */
920
- projectFolders: z6.array(z6.string()).optional(),
972
+ projectFolders: z7.array(z7.string()).optional(),
921
973
  projectScan: ProjectScan.nullable().optional(),
922
974
  /** Subscription limits (host-reported, refreshed every few minutes). */
923
- usage: z6.array(ProviderUsage).optional(),
975
+ usage: z7.array(ProviderUsage).optional(),
924
976
  github: HostGitHub.optional()
925
977
  });
926
- var WorktreeDir = z6.string().min(1).refine((d) => !d.startsWith("/") && !d.includes("\\"), "must be a relative path").refine((d) => !d.split("/").includes(".."), "must stay inside the repository").refine((d) => d.split("/").every((s) => s.length > 0 && s !== "."), "must be a plain relative path");
927
- var Project = z6.object({
928
- id: Id4,
929
- name: z6.string().min(1),
930
- repoIdentity: z6.string(),
931
- defaultProfileId: Id4.nullable(),
932
- defaultHostId: Id4.nullable(),
933
- maxConcurrentRuns: z6.number().int().min(1).max(32),
934
- automationEnabled: z6.boolean(),
935
- setupCommand: z6.string().nullable(),
936
- checks: z6.array(z6.string()),
937
- workspaceSharing: z6.enum(["single_writer", "shared"]),
978
+ var WorktreeDir = z7.string().min(1).refine((d) => !d.startsWith("/") && !d.includes("\\"), "must be a relative path").refine((d) => !d.split("/").includes(".."), "must stay inside the repository").refine((d) => d.split("/").every((s) => s.length > 0 && s !== "."), "must be a plain relative path");
979
+ var Project = z7.object({
980
+ id: Id5,
981
+ name: z7.string().min(1),
982
+ repoIdentity: z7.string(),
983
+ defaultProfileId: Id5.nullable(),
984
+ defaultHostId: Id5.nullable(),
985
+ maxConcurrentRuns: z7.number().int().min(1).max(32),
986
+ automationEnabled: z7.boolean(),
987
+ setupCommand: z7.string().nullable(),
988
+ checks: z7.array(z7.string()),
989
+ workspaceSharing: z7.enum(["single_writer", "shared"]),
938
990
  worktreeDir: WorktreeDir.default(DEFAULT_WORKTREE_DIR),
939
991
  createdAt: Iso,
940
992
  updatedAt: Iso
941
993
  });
942
- var Checkout = z6.object({
943
- id: Id4,
944
- projectId: Id4,
945
- hostId: Id4,
946
- path: z6.string(),
947
- commonDir: z6.string(),
948
- defaultBranch: z6.string(),
994
+ var Checkout = z7.object({
995
+ id: Id5,
996
+ projectId: Id5,
997
+ hostId: Id5,
998
+ path: z7.string(),
999
+ commonDir: z7.string(),
1000
+ defaultBranch: z7.string(),
949
1001
  createdAt: Iso
950
1002
  });
951
- var GitState = z6.object({
952
- dirty: z6.boolean(),
953
- changedFiles: z6.number().int(),
954
- ahead: z6.number().int(),
955
- behind: z6.number().int(),
956
- unmerged: z6.boolean()
957
- });
958
- var Workspace = z6.object({
959
- id: Id4,
960
- checkoutId: Id4,
961
- projectId: Id4,
962
- hostId: Id4,
963
- path: z6.string(),
964
- branch: z6.string().nullable(),
965
- baseBranch: z6.string().nullable(),
966
- provenance: z6.enum(["managed", "discovered", "main"]),
1003
+ var GitState = z7.object({
1004
+ dirty: z7.boolean(),
1005
+ changedFiles: z7.number().int(),
1006
+ ahead: z7.number().int(),
1007
+ behind: z7.number().int(),
1008
+ unmerged: z7.boolean()
1009
+ });
1010
+ var Workspace = z7.object({
1011
+ id: Id5,
1012
+ checkoutId: Id5,
1013
+ projectId: Id5,
1014
+ hostId: Id5,
1015
+ path: z7.string(),
1016
+ branch: z7.string().nullable(),
1017
+ baseBranch: z7.string().nullable(),
1018
+ provenance: z7.enum(["managed", "discovered", "main"]),
967
1019
  git: GitState,
968
- setup: z6.object({
969
- state: z6.enum(["none", "running", "succeeded", "failed"]),
970
- log: z6.string()
1020
+ setup: z7.object({
1021
+ state: z7.enum(["none", "running", "succeeded", "failed"]),
1022
+ log: z7.string()
971
1023
  }),
972
1024
  archivedAt: Iso.nullable(),
973
1025
  updatedAt: Iso,
974
1026
  github: WorkspaceGitHub.optional()
975
1027
  });
976
- var ThinkingLevel = z6.enum(["off", "minimal", "low", "medium", "high", "xhigh", "max"]);
977
- var SessionModel = z6.object({
978
- provider: z6.string(),
979
- id: z6.string(),
980
- name: z6.string().nullable(),
981
- contextWindow: z6.number().nullable(),
982
- reasoning: z6.boolean(),
1028
+ var ThinkingLevel = z7.enum(["off", "minimal", "low", "medium", "high", "xhigh", "max"]);
1029
+ var SessionModel = z7.object({
1030
+ provider: z7.string(),
1031
+ id: z7.string(),
1032
+ name: z7.string().nullable(),
1033
+ contextWindow: z7.number().nullable(),
1034
+ reasoning: z7.boolean(),
983
1035
  /** In Pi's scoped (favorite) model list; set only when Pi has one. */
984
- scoped: z6.boolean().optional(),
1036
+ scoped: z7.boolean().optional(),
985
1037
  /** Effort levels this model accepts, in Pi's order; ["off"] without reasoning. */
986
- thinkingLevels: z6.array(ThinkingLevel),
1038
+ thinkingLevels: z7.array(ThinkingLevel),
987
1039
  /** Prompt-cache lifetimes in seconds from Pi's model metadata. */
988
- promptCache: z6.object({ short: z6.number().optional(), long: z6.number().optional() }).nullable().optional()
1040
+ promptCache: z7.object({ short: z7.number().optional(), long: z7.number().optional() }).nullable().optional()
989
1041
  });
990
- var SlashCommand = z6.object({
991
- name: z6.string().min(1),
992
- description: z6.string().nullable(),
993
- source: z6.enum(["extension", "prompt", "skill"]),
994
- argumentHint: z6.string().nullable().optional()
1042
+ var SlashCommand = z7.object({
1043
+ name: z7.string().min(1),
1044
+ description: z7.string().nullable(),
1045
+ source: z7.enum(["extension", "prompt", "skill"]),
1046
+ argumentHint: z7.string().nullable().optional()
995
1047
  });
996
- var ContextUsage = z6.object({
1048
+ var ContextUsage = z7.object({
997
1049
  /** Estimated tokens in context; null right after compaction until the next reply. */
998
- tokens: z6.number().nullable(),
999
- window: z6.number(),
1000
- percent: z6.number().nullable()
1050
+ tokens: z7.number().nullable(),
1051
+ window: z7.number(),
1052
+ percent: z7.number().nullable()
1001
1053
  });
1002
1054
  var FORBIDDEN_EXTRA_ARGS = ["--mode", "--fork", "--no-session", "-e", "--extension"];
1003
- var ExtraArg = z6.string().refine((a) => a.startsWith("--") || !a.startsWith("-"), "extra args must be long flags").refine((a) => !FORBIDDEN_EXTRA_ARGS.includes(a.split("=")[0]) && !a.startsWith("--session"), "this flag is managed by Switchyard");
1004
- var Profile = z6.object({
1005
- id: Id4,
1006
- name: z6.string().min(1),
1007
- provider: z6.string().nullable(),
1008
- model: z6.string().nullable(),
1055
+ var ExtraArg = z7.string().refine((a) => a.startsWith("--") || !a.startsWith("-"), "extra args must be long flags").refine((a) => !FORBIDDEN_EXTRA_ARGS.includes(a.split("=")[0]) && !a.startsWith("--session"), "this flag is managed by Switchyard");
1056
+ var Profile = z7.object({
1057
+ id: Id5,
1058
+ name: z7.string().min(1),
1059
+ provider: z7.string().nullable(),
1060
+ model: z7.string().nullable(),
1009
1061
  thinking: ThinkingLevel.nullable(),
1010
- projectTrust: z6.enum(["ask", "approve", "ignore"]),
1011
- extraArgs: z6.array(ExtraArg),
1062
+ projectTrust: z7.enum(["ask", "approve", "ignore"]),
1063
+ extraArgs: z7.array(ExtraArg),
1012
1064
  /** "vanilla": --no-extensions --no-skills --no-prompt-templates. Undefined means "all". */
1013
- resources: z6.enum(["all", "vanilla"]).optional()
1065
+ resources: z7.enum(["all", "vanilla"]).optional()
1014
1066
  });
1015
- var ViewClient = z6.object({
1067
+ var ViewClient = z7.object({
1016
1068
  /** `${kind}:${name}@${machine}` */
1017
- id: z6.string().min(1),
1018
- kind: z6.enum(["herdr", "tmux"]),
1019
- name: z6.string().min(1),
1020
- machine: z6.string().min(1),
1069
+ id: z7.string().min(1),
1070
+ kind: z7.enum(["herdr", "tmux"]),
1071
+ name: z7.string().min(1),
1072
+ machine: z7.string().min(1),
1021
1073
  lastSeenAt: Iso
1022
1074
  });
1023
- var View = z6.object({
1024
- id: Id4,
1025
- name: z6.string().min(1).max(60),
1026
- mode: z6.enum(["all", "pinned"]),
1027
- projectIds: z6.array(z6.string()).nullable(),
1028
- hostIds: z6.array(z6.string()).nullable(),
1029
- sessionIds: z6.array(z6.string()),
1030
- clients: z6.array(ViewClient),
1075
+ var View = z7.object({
1076
+ id: Id5,
1077
+ name: z7.string().min(1).max(60),
1078
+ mode: z7.enum(["all", "pinned"]),
1079
+ projectIds: z7.array(z7.string()).nullable(),
1080
+ hostIds: z7.array(z7.string()).nullable(),
1081
+ sessionIds: z7.array(z7.string()),
1082
+ clients: z7.array(ViewClient),
1031
1083
  createdAt: Iso,
1032
1084
  updatedAt: Iso
1033
1085
  });
1034
- var RuntimeState = z6.enum([
1086
+ var RuntimeState = z7.enum([
1035
1087
  "starting",
1036
1088
  "idle",
1037
1089
  "running",
@@ -1040,141 +1092,141 @@ var RuntimeState = z6.enum([
1040
1092
  "failed",
1041
1093
  "stopped"
1042
1094
  ]);
1043
- var NativeHandle = z6.object({ sessionId: z6.string(), sessionFile: z6.string() });
1044
- var SessionStats = z6.object({
1045
- tokens: z6.number().nullable(),
1046
- costUsd: z6.number().nullable(),
1095
+ var NativeHandle = z7.object({ sessionId: z7.string(), sessionFile: z7.string() });
1096
+ var SessionStats = z7.object({
1097
+ tokens: z7.number().nullable(),
1098
+ costUsd: z7.number().nullable(),
1047
1099
  /** Completed usage, refreshed for this exact settlement; absent on older hosts or failure. */
1048
1100
  watermark: CompletedUsageWatermark.optional(),
1049
1101
  context: ContextUsage.nullable().optional()
1050
1102
  });
1051
- var PromptCacheInfo = z6.object({
1103
+ var PromptCacheInfo = z7.object({
1052
1104
  at: Iso,
1053
- provider: z6.string(),
1054
- model: z6.string(),
1055
- cacheRead: z6.number(),
1056
- cacheWrite: z6.number(),
1057
- cacheWrite1h: z6.number()
1058
- });
1059
- var Session = z6.object({
1060
- id: Id4,
1061
- title: z6.string(),
1062
- subtitle: z6.string().nullable(),
1063
- hostId: Id4,
1064
- workspaceId: Id4.nullable(),
1065
- projectId: Id4.nullable(),
1066
- cwd: z6.string(),
1105
+ provider: z7.string(),
1106
+ model: z7.string(),
1107
+ cacheRead: z7.number(),
1108
+ cacheWrite: z7.number(),
1109
+ cacheWrite1h: z7.number()
1110
+ });
1111
+ var Session = z7.object({
1112
+ id: Id5,
1113
+ title: z7.string(),
1114
+ subtitle: z7.string().nullable(),
1115
+ hostId: Id5,
1116
+ workspaceId: Id5.nullable(),
1117
+ projectId: Id5.nullable(),
1118
+ cwd: z7.string(),
1067
1119
  nativeHandle: NativeHandle.nullable(),
1068
1120
  profileSnapshot: Profile,
1069
1121
  runtime: RuntimeState,
1070
- runtimeDetail: z6.string().nullable(),
1122
+ runtimeDetail: z7.string().nullable(),
1071
1123
  connectivity: Connectivity,
1072
- runId: Id4.nullable(),
1073
- taskId: Id4.nullable(),
1074
- provenance: z6.enum(["created", "imported", "subagent"]),
1075
- readOnly: z6.boolean(),
1124
+ runId: Id5.nullable(),
1125
+ taskId: Id5.nullable(),
1126
+ provenance: z7.enum(["created", "imported", "subagent"]),
1127
+ readOnly: z7.boolean(),
1076
1128
  lastActivityAt: Iso,
1077
1129
  archivedAt: Iso.nullable(),
1078
- queue: z6.object({ steering: z6.array(z6.string()), followUp: z6.array(z6.string()) }),
1130
+ queue: z7.object({ steering: z7.array(z7.string()), followUp: z7.array(z7.string()) }),
1079
1131
  stats: SessionStats.nullable(),
1080
1132
  /** The live model (host-owned; last known when stopped). */
1081
1133
  model: SessionModel.nullable().optional(),
1082
1134
  /** The live effort (Pi's thinking level). */
1083
1135
  thinking: ThinkingLevel.nullable().optional(),
1084
1136
  /** Pi is compacting the context. */
1085
- compacting: z6.boolean().optional(),
1086
- lastAssistantText: z6.string().nullable(),
1137
+ compacting: z7.boolean().optional(),
1138
+ lastAssistantText: z7.string().nullable(),
1087
1139
  createdAt: Iso,
1088
1140
  /** A live terminal session: `switchyard tui` can attach to its Pi terminal. */
1089
- terminal: z6.boolean().optional(),
1141
+ terminal: z7.boolean().optional(),
1090
1142
  /** Set when the session finished or failed with nobody viewing it; cleared when viewed (coordinator-owned). */
1091
1143
  unreadSince: Iso.nullable().optional(),
1092
1144
  /** Bumped when the transcript is rebuilt (rewind); clients drop cached copies (coordinator-owned). */
1093
- transcriptEpoch: z6.number().int().min(0).optional(),
1094
- bridge: z6.object({
1095
- version: z6.literal(1),
1096
- runtimeId: Id4,
1097
- nativeSessionId: Id4,
1145
+ transcriptEpoch: z7.number().int().min(0).optional(),
1146
+ bridge: z7.object({
1147
+ version: z7.literal(1),
1148
+ runtimeId: Id5,
1149
+ nativeSessionId: Id5,
1098
1150
  /** Host-generated local-controller identity, not Pi's private binding credential. */
1099
- controllerEpoch: Id4.optional(),
1100
- agentTools: z6.boolean(),
1101
- messageDelivery: z6.boolean(),
1102
- policyState: z6.enum(["initializing", "active", "unsupported", "lost"]),
1103
- policyPhases: z6.array(PolicyPhase)
1151
+ controllerEpoch: Id5.optional(),
1152
+ agentTools: z7.boolean(),
1153
+ messageDelivery: z7.boolean(),
1154
+ policyState: z7.enum(["initializing", "active", "unsupported", "lost"]),
1155
+ policyPhases: z7.array(PolicyPhase)
1104
1156
  }).optional(),
1105
1157
  /** Last assistant message's cache usage (host-owned). */
1106
1158
  promptCache: PromptCacheInfo.nullable().optional(),
1107
1159
  /** Warn before the prompt cache expires; non-null means on (coordinator-owned). */
1108
- cacheAlert: z6.object({ ttlSec: z6.number().int().min(60).max(86400).nullable(), warnedFor: Iso.nullable() }).nullable().optional()
1109
- });
1110
- var ContinuationPolicy = z6.discriminatedUnion("enabled", [
1111
- z6.object({ enabled: z6.literal(false) }),
1112
- z6.object({
1113
- enabled: z6.literal(true),
1114
- objective: z6.string().min(1),
1115
- maxContinuations: z6.number().int().min(1).max(50),
1116
- maxElapsedMinutes: z6.number().int().min(1).max(1440),
1117
- maxTokens: z6.number().int().positive().nullable(),
1118
- maxCostUsd: z6.number().positive().nullable()
1160
+ cacheAlert: z7.object({ ttlSec: z7.number().int().min(60).max(86400).nullable(), warnedFor: Iso.nullable() }).nullable().optional()
1161
+ });
1162
+ var ContinuationPolicy = z7.discriminatedUnion("enabled", [
1163
+ z7.object({ enabled: z7.literal(false) }),
1164
+ z7.object({
1165
+ enabled: z7.literal(true),
1166
+ objective: z7.string().min(1),
1167
+ maxContinuations: z7.number().int().min(1).max(50),
1168
+ maxElapsedMinutes: z7.number().int().min(1).max(1440),
1169
+ maxTokens: z7.number().int().positive().nullable(),
1170
+ maxCostUsd: z7.number().positive().nullable()
1119
1171
  })
1120
1172
  ]);
1121
- var CompletionPolicy = z6.object({
1122
- checks: z6.array(z6.string()).nullable(),
1123
- requireHumanReview: z6.boolean()
1124
- });
1125
- var WorkspacePolicy = z6.discriminatedUnion("mode", [
1126
- z6.object({
1127
- mode: z6.literal("new_worktree"),
1128
- branch: z6.string().nullable(),
1129
- base: z6.string().nullable()
1173
+ var CompletionPolicy = z7.object({
1174
+ checks: z7.array(z7.string()).nullable(),
1175
+ requireHumanReview: z7.boolean()
1176
+ });
1177
+ var WorkspacePolicy = z7.discriminatedUnion("mode", [
1178
+ z7.object({
1179
+ mode: z7.literal("new_worktree"),
1180
+ branch: z7.string().nullable(),
1181
+ base: z7.string().nullable()
1130
1182
  }),
1131
- z6.object({ mode: z6.literal("existing"), workspaceId: Id4 })
1183
+ z7.object({ mode: z7.literal("existing"), workspaceId: Id5 })
1132
1184
  ]);
1133
- var TaskPolicy = z6.object({
1134
- hostId: Id4.nullable(),
1135
- profileId: Id4.nullable(),
1185
+ var TaskPolicy = z7.object({
1186
+ hostId: Id5.nullable(),
1187
+ profileId: Id5.nullable(),
1136
1188
  workspace: WorkspacePolicy,
1137
1189
  continuation: ContinuationPolicy,
1138
1190
  completion: CompletionPolicy
1139
1191
  });
1140
- var TaskState = z6.enum(["backlog", "ready", "in_progress", "review", "done", "canceled"]);
1141
- var Priority = z6.union([z6.literal(0), z6.literal(1), z6.literal(2), z6.literal(3)]);
1142
- var TaskOrigin = z6.discriminatedUnion("kind", [
1143
- z6.object({ kind: z6.literal("manual") }),
1144
- z6.object({
1145
- kind: z6.literal("automation"),
1146
- automationId: Id4,
1147
- occurrenceId: Id4,
1148
- routine: z6.boolean()
1192
+ var TaskState = z7.enum(["backlog", "ready", "in_progress", "review", "done", "canceled"]);
1193
+ var Priority = z7.union([z7.literal(0), z7.literal(1), z7.literal(2), z7.literal(3)]);
1194
+ var TaskOrigin = z7.discriminatedUnion("kind", [
1195
+ z7.object({ kind: z7.literal("manual") }),
1196
+ z7.object({
1197
+ kind: z7.literal("automation"),
1198
+ automationId: Id5,
1199
+ occurrenceId: Id5,
1200
+ routine: z7.boolean()
1149
1201
  })
1150
1202
  ]);
1151
- var Task = z6.object({
1152
- id: Id4,
1153
- projectId: Id4,
1154
- title: z6.string().min(1),
1155
- objective: z6.string(),
1156
- acceptanceCriteria: z6.array(z6.string()),
1157
- dependencies: z6.array(Id4),
1203
+ var Task = z7.object({
1204
+ id: Id5,
1205
+ projectId: Id5,
1206
+ title: z7.string().min(1),
1207
+ objective: z7.string(),
1208
+ acceptanceCriteria: z7.array(z7.string()),
1209
+ dependencies: z7.array(Id5),
1158
1210
  priority: Priority,
1159
- position: z6.number(),
1211
+ position: z7.number(),
1160
1212
  state: TaskState,
1161
- blocked: z6.object({ reason: z6.string() }).nullable(),
1213
+ blocked: z7.object({ reason: z7.string() }).nullable(),
1162
1214
  notBefore: Iso.nullable(),
1163
1215
  policy: TaskPolicy,
1164
1216
  origin: TaskOrigin,
1165
- groupingKey: z6.string().nullable(),
1166
- parentTaskId: Id4.nullable().optional(),
1167
- agentOrigin: z6.object({ sessionId: Id4, toolCallId: Id4 }).optional(),
1217
+ groupingKey: z7.string().nullable(),
1218
+ parentTaskId: Id5.nullable().optional(),
1219
+ agentOrigin: z7.object({ sessionId: Id5, toolCallId: Id5 }).optional(),
1168
1220
  githubIssue: GitHubIssue.optional(),
1169
- currentRunId: Id4.nullable(),
1170
- sessionId: Id4.nullable(),
1171
- review: z6.object({ feedback: z6.array(z6.string()), changesRequested: z6.boolean() }),
1172
- hiddenFromBoard: z6.boolean(),
1221
+ currentRunId: Id5.nullable(),
1222
+ sessionId: Id5.nullable(),
1223
+ review: z7.object({ feedback: z7.array(z7.string()), changesRequested: z7.boolean() }),
1224
+ hiddenFromBoard: z7.boolean(),
1173
1225
  lastActivityAt: Iso,
1174
1226
  createdAt: Iso,
1175
1227
  updatedAt: Iso
1176
1228
  });
1177
- var RunState = z6.enum([
1229
+ var RunState = z7.enum([
1178
1230
  "queued",
1179
1231
  "dispatching",
1180
1232
  "uncertain",
@@ -1186,79 +1238,79 @@ var RunState = z6.enum([
1186
1238
  "interrupted",
1187
1239
  "canceled"
1188
1240
  ]);
1189
- var CheckResult = z6.object({
1190
- command: z6.string(),
1191
- exitCode: z6.number().int().nullable(),
1192
- outputTail: z6.string()
1193
- });
1194
- var Run = z6.object({
1195
- id: Id4,
1196
- taskId: Id4,
1197
- sessionId: Id4.nullable(),
1198
- hostId: Id4.nullable(),
1199
- dispatchKey: z6.string(),
1200
- attempt: z6.number().int().min(1),
1241
+ var CheckResult = z7.object({
1242
+ command: z7.string(),
1243
+ exitCode: z7.number().int().nullable(),
1244
+ outputTail: z7.string()
1245
+ });
1246
+ var Run = z7.object({
1247
+ id: Id5,
1248
+ taskId: Id5,
1249
+ sessionId: Id5.nullable(),
1250
+ hostId: Id5.nullable(),
1251
+ dispatchKey: z7.string(),
1252
+ attempt: z7.number().int().min(1),
1201
1253
  state: RunState,
1202
1254
  controlMode: ControlMode,
1203
- controlRevision: z6.number().int().min(1),
1204
- continuationsUsed: z6.number().int().min(0),
1205
- infraRetries: z6.number().int().min(0),
1255
+ controlRevision: z7.number().int().min(1),
1256
+ continuationsUsed: z7.number().int().min(0),
1257
+ infraRetries: z7.number().int().min(0),
1206
1258
  nextAttemptAt: Iso.nullable(),
1207
1259
  startedAt: Iso.nullable(),
1208
1260
  endedAt: Iso.nullable(),
1209
- outcome: z6.object({
1210
- kind: z6.enum(["review", "failed", "blocked", "no_change", "canceled"]),
1211
- summary: z6.string()
1261
+ outcome: z7.object({
1262
+ kind: z7.enum(["review", "failed", "blocked", "no_change", "canceled"]),
1263
+ summary: z7.string()
1212
1264
  }).nullable(),
1213
1265
  limits: ContinuationPolicy,
1214
- usage: z6.object({
1215
- tokens: z6.number().nullable(),
1216
- costUsd: z6.number().nullable(),
1217
- accounting: z6.enum(["available", "unavailable"]),
1218
- note: z6.string().nullable()
1266
+ usage: z7.object({
1267
+ tokens: z7.number().nullable(),
1268
+ costUsd: z7.number().nullable(),
1269
+ accounting: z7.enum(["available", "unavailable"]),
1270
+ note: z7.string().nullable()
1219
1271
  }),
1220
- checks: z6.array(CheckResult),
1272
+ checks: z7.array(CheckResult),
1221
1273
  createdAt: Iso,
1222
1274
  updatedAt: Iso
1223
1275
  });
1224
- var Trigger = z6.discriminatedUnion("kind", [
1225
- z6.object({ kind: z6.literal("manual") }),
1226
- z6.object({ kind: z6.literal("once"), at: Iso }),
1227
- z6.object({ kind: z6.literal("cron"), expr: z6.string().min(1), timezone: z6.string().min(1) }),
1228
- z6.object({ kind: z6.literal("webhook") }),
1229
- z6.object({ kind: z6.literal("dependency"), taskId: Id4 })
1276
+ var Trigger = z7.discriminatedUnion("kind", [
1277
+ z7.object({ kind: z7.literal("manual") }),
1278
+ z7.object({ kind: z7.literal("once"), at: Iso }),
1279
+ z7.object({ kind: z7.literal("cron"), expr: z7.string().min(1), timezone: z7.string().min(1) }),
1280
+ z7.object({ kind: z7.literal("webhook") }),
1281
+ z7.object({ kind: z7.literal("dependency"), taskId: Id5 })
1230
1282
  ]);
1231
- var TaskTemplate = z6.object({
1232
- title: z6.string().min(1),
1233
- objective: z6.string(),
1234
- acceptanceCriteria: z6.array(z6.string()),
1283
+ var TaskTemplate = z7.object({
1284
+ title: z7.string().min(1),
1285
+ objective: z7.string(),
1286
+ acceptanceCriteria: z7.array(z7.string()),
1235
1287
  priority: Priority
1236
1288
  });
1237
- var Automation = z6.object({
1238
- id: Id4,
1239
- name: z6.string().min(1),
1240
- enabled: z6.boolean(),
1241
- projectId: Id4,
1289
+ var Automation = z7.object({
1290
+ id: Id5,
1291
+ name: z7.string().min(1),
1292
+ enabled: z7.boolean(),
1293
+ projectId: Id5,
1242
1294
  trigger: Trigger,
1243
- filters: z6.array(z6.object({ path: z6.string(), equals: z6.string() })),
1295
+ filters: z7.array(z7.object({ path: z7.string(), equals: z7.string() })),
1244
1296
  template: TaskTemplate,
1245
- hostId: Id4.nullable(),
1246
- profileId: Id4.nullable(),
1247
- mode: z6.enum(["fresh", "continue", "watch"]),
1248
- groupingKey: z6.string().nullable(),
1249
- overlap: z6.enum(["skip", "queue_one", "append"]),
1250
- missed: z6.enum(["skip", "run_once"]),
1297
+ hostId: Id5.nullable(),
1298
+ profileId: Id5.nullable(),
1299
+ mode: z7.enum(["fresh", "continue", "watch"]),
1300
+ groupingKey: z7.string().nullable(),
1301
+ overlap: z7.enum(["skip", "queue_one", "append"]),
1302
+ missed: z7.enum(["skip", "run_once"]),
1251
1303
  continuation: ContinuationPolicy,
1252
1304
  completion: CompletionPolicy,
1253
1305
  nextAt: Iso.nullable(),
1254
1306
  lastEvaluatedAt: Iso.nullable(),
1255
- lastOutcome: z6.string().nullable(),
1256
- failureCount: z6.number().int().min(0),
1257
- webhookTokenSet: z6.boolean(),
1307
+ lastOutcome: z7.string().nullable(),
1308
+ failureCount: z7.number().int().min(0),
1309
+ webhookTokenSet: z7.boolean(),
1258
1310
  createdAt: Iso,
1259
1311
  updatedAt: Iso
1260
1312
  });
1261
- var OccurrenceState = z6.enum([
1313
+ var OccurrenceState = z7.enum([
1262
1314
  "fired",
1263
1315
  "skipped_overlap",
1264
1316
  "skipped_missed",
@@ -1267,39 +1319,39 @@ var OccurrenceState = z6.enum([
1267
1319
  "failed",
1268
1320
  "filtered"
1269
1321
  ]);
1270
- var Occurrence = z6.object({
1271
- id: Id4,
1272
- automationId: Id4,
1273
- key: z6.string(),
1322
+ var Occurrence = z7.object({
1323
+ id: Id5,
1324
+ automationId: Id5,
1325
+ key: z7.string(),
1274
1326
  scheduledFor: Iso.nullable(),
1275
1327
  state: OccurrenceState,
1276
- taskId: Id4.nullable(),
1277
- reason: z6.string().nullable(),
1278
- outcome: z6.string().nullable(),
1328
+ taskId: Id5.nullable(),
1329
+ reason: z7.string().nullable(),
1330
+ outcome: z7.string().nullable(),
1279
1331
  createdAt: Iso
1280
1332
  });
1281
- var InteractionState = z6.preprocess((v) => v === "cancelled" ? "canceled" : v, z6.enum(["pending", "resolved", "expired", "canceled", "unsupported"]));
1282
- var Interaction = z6.object({
1283
- id: Id4,
1284
- sessionId: Id4,
1285
- revision: z6.number().int().min(1),
1286
- source: z6.discriminatedUnion("kind", [
1287
- z6.object({
1288
- kind: z6.literal("extension_ui"),
1289
- method: z6.enum(["select", "confirm", "input", "editor"]),
1290
- piRequestIds: z6.array(z6.string())
1333
+ var InteractionState = z7.preprocess((v) => v === "cancelled" ? "canceled" : v, z7.enum(["pending", "resolved", "expired", "canceled", "unsupported"]));
1334
+ var Interaction = z7.object({
1335
+ id: Id5,
1336
+ sessionId: Id5,
1337
+ revision: z7.number().int().min(1),
1338
+ source: z7.discriminatedUnion("kind", [
1339
+ z7.object({
1340
+ kind: z7.literal("extension_ui"),
1341
+ method: z7.enum(["select", "confirm", "input", "editor"]),
1342
+ piRequestIds: z7.array(z7.string())
1291
1343
  }),
1292
- z6.object({ kind: z6.literal("unsupported_custom"), title: z6.string().nullable() })
1344
+ z7.object({ kind: z7.literal("unsupported_custom"), title: z7.string().nullable() })
1293
1345
  ]),
1294
- adapterId: z6.string().nullable(),
1346
+ adapterId: z7.string().nullable(),
1295
1347
  permission: PolicyPermission.optional(),
1296
- title: z6.string(),
1348
+ title: z7.string(),
1297
1349
  presentation: UINodeSchema,
1298
1350
  state: InteractionState,
1299
- resolution: z6.object({ by: z6.string(), summary: z6.string(), at: Iso }).nullable(),
1351
+ resolution: z7.object({ by: z7.string(), summary: z7.string(), at: Iso }).nullable(),
1300
1352
  createdAt: Iso
1301
1353
  });
1302
- var AttentionReason = z6.enum([
1354
+ var AttentionReason = z7.enum([
1303
1355
  "needs_input",
1304
1356
  "failed",
1305
1357
  "ready_for_review",
@@ -1307,195 +1359,203 @@ var AttentionReason = z6.enum([
1307
1359
  "host_unreachable",
1308
1360
  "cache_expiring"
1309
1361
  ]);
1310
- var AttentionItem = z6.object({
1311
- id: Id4,
1312
- sessionId: Id4.nullable(),
1313
- taskId: Id4.nullable(),
1314
- projectId: Id4.nullable(),
1362
+ var AttentionItem = z7.object({
1363
+ id: Id5,
1364
+ sessionId: Id5.nullable(),
1365
+ taskId: Id5.nullable(),
1366
+ projectId: Id5.nullable(),
1315
1367
  reason: AttentionReason,
1316
- severity: z6.enum(["info", "warning", "critical"]),
1317
- summary: z6.string(),
1318
- interactionId: Id4.nullable(),
1319
- deepLink: z6.string(),
1368
+ severity: z7.enum(["info", "warning", "critical"]),
1369
+ summary: z7.string(),
1370
+ interactionId: Id5.nullable(),
1371
+ deepLink: z7.string(),
1320
1372
  acknowledgedAt: Iso.nullable(),
1321
1373
  resolvedAt: Iso.nullable(),
1322
1374
  createdAt: Iso
1323
1375
  });
1324
- var Device = z6.object({
1325
- id: Id4,
1326
- name: z6.string(),
1376
+ var Device = z7.object({
1377
+ id: Id5,
1378
+ name: z7.string(),
1327
1379
  kind: DeviceKind,
1328
1380
  createdAt: Iso,
1329
1381
  lastSeenAt: Iso.nullable(),
1330
1382
  revokedAt: Iso.nullable(),
1331
- push: z6.object({
1332
- subscribed: z6.boolean(),
1333
- permission: z6.enum(["granted", "denied", "default", "unknown"])
1383
+ push: z7.object({
1384
+ subscribed: z7.boolean(),
1385
+ permission: z7.enum(["granted", "denied", "default", "unknown"])
1334
1386
  }),
1335
- preferredMobile: z6.boolean(),
1336
- enrolledVia: z6.enum(["enrollment", "passkey", "oidc", "admin", "approval"]).default("enrollment")
1337
- });
1338
- var ToolItemData = z6.object({
1339
- toolCallId: z6.string(),
1340
- name: z6.string(),
1341
- status: z6.enum(["running", "ok", "error"]),
1342
- args: z6.unknown(),
1343
- summary: z6.string(),
1344
- output: z6.string(),
1387
+ preferredMobile: z7.boolean(),
1388
+ enrolledVia: z7.enum(["enrollment", "passkey", "oidc", "admin", "approval"]).default("enrollment")
1389
+ });
1390
+ var ToolItemData = z7.object({
1391
+ toolCallId: z7.string(),
1392
+ name: z7.string(),
1393
+ status: z7.enum(["running", "ok", "error"]),
1394
+ args: z7.unknown(),
1395
+ summary: z7.string(),
1396
+ output: z7.string(),
1345
1397
  startedAt: Iso,
1346
- durationMs: z6.number().nullable(),
1398
+ durationMs: z7.number().nullable(),
1347
1399
  card: UINodeSchema.nullable(),
1348
- adapterId: z6.string().nullable()
1400
+ adapterId: z7.string().nullable()
1349
1401
  });
1350
- var TranscriptItem = z6.discriminatedUnion("kind", [
1351
- z6.object({
1352
- id: Id4,
1353
- sessionId: Id4,
1354
- order: z6.number().int(),
1402
+ var TranscriptItem = z7.discriminatedUnion("kind", [
1403
+ z7.object({
1404
+ id: Id5,
1405
+ sessionId: Id5,
1406
+ order: z7.number().int(),
1355
1407
  at: Iso,
1356
- kind: z6.literal("user"),
1357
- data: z6.object({
1358
- text: z6.string(),
1359
- images: z6.number().int().optional(),
1408
+ kind: z7.literal("user"),
1409
+ data: z7.object({
1410
+ text: z7.string(),
1411
+ images: z7.number().int().optional(),
1360
1412
  /** Pi session entry id, for rewind and fork from this message. */
1361
- entryId: z6.string().optional()
1413
+ entryId: z7.string().optional()
1362
1414
  })
1363
1415
  }),
1364
- z6.object({
1365
- id: Id4,
1366
- sessionId: Id4,
1367
- order: z6.number().int(),
1416
+ z7.object({
1417
+ id: Id5,
1418
+ sessionId: Id5,
1419
+ order: z7.number().int(),
1368
1420
  at: Iso,
1369
- kind: z6.literal("assistant"),
1370
- data: z6.object({ text: z6.string(), streaming: z6.boolean().optional() })
1421
+ kind: z7.literal("assistant"),
1422
+ data: z7.object({ text: z7.string(), streaming: z7.boolean().optional() })
1371
1423
  }),
1372
- z6.object({
1373
- id: Id4,
1374
- sessionId: Id4,
1375
- order: z6.number().int(),
1424
+ z7.object({
1425
+ id: Id5,
1426
+ sessionId: Id5,
1427
+ order: z7.number().int(),
1376
1428
  at: Iso,
1377
- kind: z6.literal("thinking"),
1378
- data: z6.object({ text: z6.string() })
1429
+ kind: z7.literal("thinking"),
1430
+ data: z7.object({ text: z7.string() })
1379
1431
  }),
1380
- z6.object({
1381
- id: Id4,
1382
- sessionId: Id4,
1383
- order: z6.number().int(),
1432
+ z7.object({
1433
+ id: Id5,
1434
+ sessionId: Id5,
1435
+ order: z7.number().int(),
1384
1436
  at: Iso,
1385
- kind: z6.literal("tool"),
1437
+ kind: z7.literal("tool"),
1386
1438
  data: ToolItemData
1387
1439
  }),
1388
- z6.object({
1389
- id: Id4,
1390
- sessionId: Id4,
1391
- order: z6.number().int(),
1440
+ z7.object({
1441
+ id: Id5,
1442
+ sessionId: Id5,
1443
+ order: z7.number().int(),
1392
1444
  at: Iso,
1393
- kind: z6.literal("notice"),
1394
- data: z6.object({ level: DiagnosticLevel, text: z6.string() })
1445
+ kind: z7.literal("notice"),
1446
+ data: z7.object({
1447
+ level: DiagnosticLevel,
1448
+ text: z7.string(),
1449
+ customType: z7.string().min(1).max(200).optional(),
1450
+ card: UINodeSchema.optional(),
1451
+ adapterId: z7.string().optional()
1452
+ }).refine((data) => !data.card || !!data.adapterId, "Card requires adapterId")
1395
1453
  }),
1396
- z6.object({
1397
- id: Id4,
1398
- sessionId: Id4,
1399
- order: z6.number().int(),
1454
+ z7.object({
1455
+ id: Id5,
1456
+ sessionId: Id5,
1457
+ order: z7.number().int(),
1400
1458
  at: Iso,
1401
- kind: z6.literal("interaction"),
1402
- data: z6.object({ interactionId: Id4 })
1459
+ kind: z7.literal("interaction"),
1460
+ data: z7.object({ interactionId: Id5 })
1403
1461
  }),
1404
- z6.object({
1405
- id: Id4,
1406
- sessionId: Id4,
1407
- order: z6.number().int(),
1462
+ z7.object({
1463
+ id: Id5,
1464
+ sessionId: Id5,
1465
+ order: z7.number().int(),
1408
1466
  at: Iso,
1409
- kind: z6.literal("subagent"),
1410
- data: z6.object({
1411
- runId: z6.string(),
1412
- label: z6.string(),
1413
- status: z6.string(),
1414
- sessionFile: z6.string().nullable(),
1415
- linkedSessionId: Id4.nullable()
1467
+ kind: z7.literal("subagent"),
1468
+ data: z7.object({
1469
+ runId: z7.string(),
1470
+ label: z7.string(),
1471
+ status: z7.string(),
1472
+ sessionFile: z7.string().nullable(),
1473
+ linkedSessionId: Id5.nullable()
1416
1474
  })
1417
1475
  }),
1418
- z6.object({
1419
- id: Id4,
1420
- sessionId: Id4,
1421
- order: z6.number().int(),
1476
+ z7.object({
1477
+ id: Id5,
1478
+ sessionId: Id5,
1479
+ order: z7.number().int(),
1422
1480
  at: Iso,
1423
- kind: z6.literal("system"),
1424
- data: z6.object({ text: z6.string(), suggestion: z6.boolean().optional() })
1481
+ kind: z7.literal("system"),
1482
+ data: z7.object({ text: z7.string(), suggestion: z7.boolean().optional() })
1425
1483
  })
1426
1484
  ]);
1427
- var Panel = z6.object({
1428
- sessionId: Id4,
1429
- adapterId: z6.string(),
1430
- slot: z6.string(),
1431
- title: z6.string(),
1485
+ var Panel = z7.object({
1486
+ sessionId: Id5,
1487
+ adapterId: z7.string(),
1488
+ slot: z7.string(),
1489
+ title: z7.string(),
1432
1490
  node: UINodeSchema.nullable(),
1433
- webRenderer: z6.boolean(),
1434
- mobileFallback: z6.string().nullable(),
1491
+ webRenderer: z7.boolean(),
1492
+ mobileFallback: z7.string().nullable(),
1493
+ contribution: ContributionDescriptor.optional(),
1494
+ state: z7.unknown().optional(),
1435
1495
  updatedAt: Iso
1436
1496
  });
1437
- var Diagnostic = z6.object({
1438
- sessionId: Id4.nullable(),
1439
- adapterId: z6.string().nullable(),
1497
+ var Diagnostic = z7.object({
1498
+ sessionId: Id5.nullable(),
1499
+ adapterId: z7.string().nullable(),
1440
1500
  level: DiagnosticLevel,
1441
- message: z6.string(),
1501
+ message: z7.string(),
1442
1502
  at: Iso
1443
1503
  });
1444
- var AdapterInfo = z6.object({
1445
- id: z6.string(),
1446
- version: z6.string(),
1447
- tier: z6.enum(["project", "owner", "plugin", "bundled"]),
1448
- target: z6.object({
1449
- extension: z6.string(),
1450
- versionRange: z6.string(),
1451
- testedVersions: z6.array(z6.string())
1504
+ var AdapterInfo = z7.object({
1505
+ id: z7.string(),
1506
+ version: z7.string(),
1507
+ tier: z7.enum(["project", "owner", "plugin", "bundled"]),
1508
+ target: z7.object({
1509
+ extension: z7.string(),
1510
+ versionRange: z7.string(),
1511
+ testedVersions: z7.array(z7.string())
1452
1512
  }),
1453
- capabilities: z6.array(z6.string()),
1454
- webRenderer: z6.boolean(),
1455
- status: z6.enum(["active", "disabled", "error"]),
1456
- detail: z6.string().nullable()
1457
- });
1458
- var Passkey = z6.object({
1459
- id: z6.string(),
1460
- name: z6.string(),
1513
+ capabilities: z7.array(z7.string()),
1514
+ webRenderer: z7.boolean(),
1515
+ status: z7.enum(["active", "disabled", "error"]),
1516
+ detail: z7.string().nullable()
1517
+ });
1518
+ var Passkey = z7.object({
1519
+ id: z7.string(),
1520
+ name: z7.string(),
1461
1521
  createdAt: Iso,
1462
1522
  lastUsedAt: Iso.nullable(),
1463
- transports: z6.array(z6.string())
1523
+ transports: z7.array(z7.string())
1464
1524
  });
1465
1525
 
1466
1526
  // packages/protocol/dist/host-wire.js
1467
- import { z as z9 } from "zod";
1527
+ import { z as z10 } from "zod";
1468
1528
 
1469
1529
  // packages/protocol/dist/events.js
1470
- import { z as z7 } from "zod";
1530
+ import { z as z8 } from "zod";
1471
1531
  var EventDataSchemas = {
1472
1532
  "host.updated": Host,
1473
1533
  "project.updated": Project,
1474
- "project.deleted": z7.object({ id: z7.string() }),
1534
+ "project.deleted": z8.object({ id: z8.string() }),
1475
1535
  "checkout.updated": Checkout,
1476
1536
  "workspace.updated": Workspace,
1477
- "workspace.deleted": z7.object({ id: z7.string() }),
1537
+ "workspace.deleted": z8.object({ id: z8.string() }),
1478
1538
  "profile.updated": Profile,
1479
- "profile.deleted": z7.object({ id: z7.string() }),
1539
+ "profile.deleted": z8.object({ id: z8.string() }),
1480
1540
  "view.updated": View,
1481
- "view.deleted": z7.object({ id: z7.string() }),
1541
+ "view.deleted": z8.object({ id: z8.string() }),
1482
1542
  "session.updated": Session,
1483
1543
  "transcript.item": TranscriptItem,
1484
- "transcript.reset": z7.object({ sessionId: z7.string(), epoch: z7.number().int() }),
1544
+ "transcript.reset": z8.object({ sessionId: z8.string(), epoch: z8.number().int() }),
1485
1545
  "interaction.updated": Interaction,
1486
1546
  "panel.updated": Panel,
1487
- "adapters.updated": z7.object({ hostId: z7.string(), adapters: z7.array(AdapterInfo) }),
1547
+ "adapters.updated": z8.object({ hostId: z8.string(), adapters: z8.array(AdapterInfo) }),
1488
1548
  diagnostic: Diagnostic,
1489
1549
  "task.updated": Task,
1490
- "task.deleted": z7.object({ id: z7.string() }),
1550
+ "task.deleted": z8.object({ id: z8.string() }),
1491
1551
  "run.updated": Run,
1492
1552
  "automation.updated": Automation,
1493
- "automation.deleted": z7.object({ id: z7.string() }),
1553
+ "automation.deleted": z8.object({ id: z8.string() }),
1494
1554
  "occurrence.created": Occurrence,
1495
1555
  "occurrence.updated": Occurrence,
1496
1556
  "attention.updated": AttentionItem,
1497
1557
  "device.updated": Device,
1498
- "settings.updated": z7.object({ dispatchPaused: z7.boolean() })
1558
+ "settings.updated": z8.object({ dispatchPaused: z8.boolean() })
1499
1559
  };
1500
1560
  var EVENT_TYPES = Object.keys(EventDataSchemas);
1501
1561
  var LEGACY_EVENT_TYPES = {
@@ -1505,19 +1565,19 @@ function canonicalEventType(type) {
1505
1565
  return LEGACY_EVENT_TYPES[type] ?? type;
1506
1566
  }
1507
1567
  var canonical = (v) => typeof v === "string" ? canonicalEventType(v) : v;
1508
- var EventTypeSchema = z7.preprocess(canonical, z7.enum(EVENT_TYPES));
1509
- var EventScope = z7.object({
1510
- hostId: z7.string().optional(),
1511
- sessionId: z7.string().optional(),
1512
- taskId: z7.string().optional(),
1513
- projectId: z7.string().optional()
1568
+ var EventTypeSchema = z8.preprocess(canonical, z8.enum(EVENT_TYPES));
1569
+ var EventScope = z8.object({
1570
+ hostId: z8.string().optional(),
1571
+ sessionId: z8.string().optional(),
1572
+ taskId: z8.string().optional(),
1573
+ projectId: z8.string().optional()
1514
1574
  });
1515
1575
  var EventEnvelope = EventScope.extend({
1516
- seq: z7.number().int(),
1517
- id: z7.string(),
1576
+ seq: z8.number().int(),
1577
+ id: z8.string(),
1518
1578
  type: EventTypeSchema,
1519
- at: z7.string(),
1520
- data: z7.unknown()
1579
+ at: z8.string(),
1580
+ data: z8.unknown()
1521
1581
  });
1522
1582
  var HOST_EVENT_TYPES = [
1523
1583
  "session.updated",
@@ -1530,318 +1590,318 @@ var HOST_EVENT_TYPES = [
1530
1590
  "workspace.deleted"
1531
1591
  ];
1532
1592
  var HostEvent = EventScope.extend({
1533
- eventId: z7.string(),
1534
- type: z7.preprocess(canonical, z7.enum(HOST_EVENT_TYPES)),
1535
- at: z7.string(),
1536
- data: z7.unknown()
1537
- });
1538
- var StreamDelta = z7.object({
1539
- sessionId: z7.string(),
1540
- itemId: z7.string(),
1541
- kind: z7.enum(["text", "thinking", "tool_args", "tool_output"]),
1542
- delta: z7.string(),
1543
- order: z7.number().int().optional()
1593
+ eventId: z8.string(),
1594
+ type: z8.preprocess(canonical, z8.enum(HOST_EVENT_TYPES)),
1595
+ at: z8.string(),
1596
+ data: z8.unknown()
1597
+ });
1598
+ var StreamDelta = z8.object({
1599
+ sessionId: z8.string(),
1600
+ itemId: z8.string(),
1601
+ kind: z8.enum(["text", "thinking", "tool_args", "tool_output"]),
1602
+ delta: z8.string(),
1603
+ order: z8.number().int().optional()
1544
1604
  });
1545
1605
 
1546
1606
  // packages/protocol/dist/terminal-wire.js
1547
- import { z as z8 } from "zod";
1548
- var Cols = z8.number().int().min(10).max(1e3);
1549
- var Rows = z8.number().int().min(5).max(500);
1550
- var TermViewerToServer = z8.discriminatedUnion("t", [
1551
- z8.object({ t: z8.literal("in"), d: z8.string() }),
1552
- z8.object({ t: z8.literal("resize"), cols: Cols, rows: Rows }),
1553
- z8.object({ t: z8.literal("claim") })
1607
+ import { z as z9 } from "zod";
1608
+ var Cols = z9.number().int().min(10).max(1e3);
1609
+ var Rows = z9.number().int().min(5).max(500);
1610
+ var TermViewerToServer = z9.discriminatedUnion("t", [
1611
+ z9.object({ t: z9.literal("in"), d: z9.string() }),
1612
+ z9.object({ t: z9.literal("resize"), cols: Cols, rows: Rows }),
1613
+ z9.object({ t: z9.literal("claim") })
1554
1614
  ]);
1555
- var TermServerToViewer = z8.discriminatedUnion("t", [
1556
- z8.object({ t: z8.literal("out"), d: z8.string() }),
1557
- z8.object({ t: z8.literal("closed"), reason: z8.string() }),
1558
- z8.object({ t: z8.literal("size"), cols: Cols, rows: Rows, owner: z8.boolean() })
1615
+ var TermServerToViewer = z9.discriminatedUnion("t", [
1616
+ z9.object({ t: z9.literal("out"), d: z9.string() }),
1617
+ z9.object({ t: z9.literal("closed"), reason: z9.string() }),
1618
+ z9.object({ t: z9.literal("size"), cols: Cols, rows: Rows, owner: z9.boolean() })
1559
1619
  ]);
1560
- var TermCoordinatorMsg = z8.discriminatedUnion("t", [
1561
- z8.object({
1562
- t: z8.literal("open"),
1563
- sessionId: z8.string(),
1620
+ var TermCoordinatorMsg = z9.discriminatedUnion("t", [
1621
+ z9.object({
1622
+ t: z9.literal("open"),
1623
+ sessionId: z9.string(),
1564
1624
  cols: Cols,
1565
1625
  rows: Rows,
1566
- passive: z8.boolean().optional()
1626
+ passive: z9.boolean().optional()
1567
1627
  }),
1568
- z8.object({ t: z8.literal("claim") }),
1569
- z8.object({ t: z8.literal("in"), d: z8.string() }),
1570
- z8.object({ t: z8.literal("resize"), cols: Cols, rows: Rows }),
1571
- z8.object({ t: z8.literal("close") })
1628
+ z9.object({ t: z9.literal("claim") }),
1629
+ z9.object({ t: z9.literal("in"), d: z9.string() }),
1630
+ z9.object({ t: z9.literal("resize"), cols: Cols, rows: Rows }),
1631
+ z9.object({ t: z9.literal("close") })
1572
1632
  ]);
1573
1633
 
1574
1634
  // packages/protocol/dist/host-wire.js
1575
- var Origin = z9.enum(["human", "automation"]);
1576
- var HostCommand = z9.discriminatedUnion("type", [
1577
- z9.object({
1578
- type: z9.literal("session.start"),
1579
- sessionId: z9.string(),
1580
- title: z9.string(),
1581
- workspacePath: z9.string(),
1582
- projectId: z9.string().nullable(),
1635
+ var Origin = z10.enum(["human", "automation"]);
1636
+ var HostCommand = z10.discriminatedUnion("type", [
1637
+ z10.object({
1638
+ type: z10.literal("session.start"),
1639
+ sessionId: z10.string(),
1640
+ title: z10.string(),
1641
+ workspacePath: z10.string(),
1642
+ projectId: z10.string().nullable(),
1583
1643
  profile: Profile,
1584
1644
  nativeHandle: NativeHandle.nullable(),
1585
- initialPrompt: z9.string().nullable(),
1586
- dispatchKey: z9.string().nullable(),
1587
- controlRevision: z9.number().int(),
1645
+ initialPrompt: z10.string().nullable(),
1646
+ dispatchKey: z10.string().nullable(),
1647
+ controlRevision: z10.number().int(),
1588
1648
  controlMode: ControlMode,
1589
1649
  origin: Origin,
1590
- readOnly: z9.boolean().default(false),
1591
- policyRequired: z9.boolean().optional()
1650
+ readOnly: z10.boolean().default(false),
1651
+ policyRequired: z10.boolean().optional()
1592
1652
  }),
1593
- z9.object({
1594
- type: z9.literal("session.deliverMessage"),
1595
- sessionId: z9.string(),
1596
- messageId: z9.string(),
1597
- payload: z9.object({
1598
- deliveryId: z9.string(),
1599
- kind: z9.enum(["message", "completion"]),
1600
- text: z9.string()
1653
+ z10.object({
1654
+ type: z10.literal("session.deliverMessage"),
1655
+ sessionId: z10.string(),
1656
+ messageId: z10.string(),
1657
+ payload: z10.object({
1658
+ deliveryId: z10.string(),
1659
+ kind: z10.enum(["message", "completion"]),
1660
+ text: z10.string()
1601
1661
  }),
1602
- mode: z9.enum(["steer", "queue"]),
1603
- holdUntil: z9.string()
1662
+ mode: z10.enum(["steer", "queue"]),
1663
+ holdUntil: z10.string()
1604
1664
  }),
1605
- HostPolicySampleRequest.extend({ type: z9.literal("session.classifyPolicySample") }),
1606
- z9.object({
1607
- type: z9.literal("session.messageStatus"),
1608
- sessionId: z9.string(),
1609
- messageIds: z9.array(z9.string().min(1)).min(1).max(100)
1665
+ HostPolicySampleRequest.extend({ type: z10.literal("session.classifyPolicySample") }),
1666
+ z10.object({
1667
+ type: z10.literal("session.messageStatus"),
1668
+ sessionId: z10.string(),
1669
+ messageIds: z10.array(z10.string().min(1)).min(1).max(100)
1610
1670
  }),
1611
- z9.object({
1612
- type: z9.literal("session.prompt"),
1613
- sessionId: z9.string(),
1614
- text: z9.string(),
1615
- images: z9.array(z9.object({ mimeType: z9.string(), data: z9.string() })).default([]),
1616
- mode: z9.enum(["prompt", "steer", "followUp"]),
1671
+ z10.object({
1672
+ type: z10.literal("session.prompt"),
1673
+ sessionId: z10.string(),
1674
+ text: z10.string(),
1675
+ images: z10.array(z10.object({ mimeType: z10.string(), data: z10.string() })).default([]),
1676
+ mode: z10.enum(["prompt", "steer", "followUp"]),
1617
1677
  origin: Origin,
1618
- controlRevision: z9.number().int()
1678
+ controlRevision: z10.number().int()
1619
1679
  }),
1620
- z9.object({ type: z9.literal("session.abort"), sessionId: z9.string(), clearQueue: z9.boolean() }),
1621
- z9.object({ type: z9.literal("session.stop"), sessionId: z9.string() }),
1622
- z9.object({
1623
- type: z9.literal("session.answer"),
1624
- sessionId: z9.string(),
1625
- interactionId: z9.string(),
1626
- revision: z9.number().int(),
1680
+ z10.object({ type: z10.literal("session.abort"), sessionId: z10.string(), clearQueue: z10.boolean() }),
1681
+ z10.object({ type: z10.literal("session.stop"), sessionId: z10.string() }),
1682
+ z10.object({
1683
+ type: z10.literal("session.answer"),
1684
+ sessionId: z10.string(),
1685
+ interactionId: z10.string(),
1686
+ revision: z10.number().int(),
1627
1687
  response: InteractionResponseSchema,
1628
- deviceId: z9.string()
1688
+ deviceId: z10.string()
1629
1689
  }),
1630
- z9.object({
1631
- type: z9.literal("session.adapterAction"),
1632
- sessionId: z9.string(),
1633
- adapterId: z9.string(),
1634
- actionId: z9.string(),
1635
- payload: z9.unknown()
1690
+ z10.object({
1691
+ type: z10.literal("session.adapterAction"),
1692
+ sessionId: z10.string(),
1693
+ adapterId: z10.string(),
1694
+ actionId: z10.string(),
1695
+ payload: z10.unknown()
1636
1696
  }),
1637
- z9.object({
1638
- type: z9.literal("session.setControl"),
1639
- sessionId: z9.string(),
1640
- controlRevision: z9.number().int(),
1697
+ z10.object({
1698
+ type: z10.literal("session.setControl"),
1699
+ sessionId: z10.string(),
1700
+ controlRevision: z10.number().int(),
1641
1701
  mode: ControlMode
1642
1702
  }),
1643
- z9.object({ type: z9.literal("session.rename"), sessionId: z9.string(), title: z9.string() }),
1644
- z9.object({ type: z9.literal("session.importable") }),
1645
- z9.object({ type: z9.literal("session.readNative"), sessionFile: z9.string() }),
1646
- z9.object({ type: z9.literal("session.snapshot"), sessionId: z9.string() }),
1647
- z9.object({ type: z9.literal("session.models"), sessionId: z9.string() }),
1648
- z9.object({ type: z9.literal("session.commands"), sessionId: z9.string() }),
1649
- z9.object({
1650
- type: z9.literal("session.complete"),
1651
- sessionId: z9.string(),
1652
- text: z9.string().max(500)
1703
+ z10.object({ type: z10.literal("session.rename"), sessionId: z10.string(), title: z10.string() }),
1704
+ z10.object({ type: z10.literal("session.importable") }),
1705
+ z10.object({ type: z10.literal("session.readNative"), sessionFile: z10.string() }),
1706
+ z10.object({ type: z10.literal("session.snapshot"), sessionId: z10.string() }),
1707
+ z10.object({ type: z10.literal("session.models"), sessionId: z10.string() }),
1708
+ z10.object({ type: z10.literal("session.commands"), sessionId: z10.string() }),
1709
+ z10.object({
1710
+ type: z10.literal("session.complete"),
1711
+ sessionId: z10.string(),
1712
+ text: z10.string().max(500)
1653
1713
  }),
1654
- z9.object({ type: z9.literal("session.tree"), sessionId: z9.string() }),
1655
- z9.object({
1656
- type: z9.literal("session.branch"),
1657
- sessionId: z9.string(),
1658
- entryId: z9.string().nullable(),
1659
- fork: z9.boolean()
1714
+ z10.object({ type: z10.literal("session.tree"), sessionId: z10.string() }),
1715
+ z10.object({
1716
+ type: z10.literal("session.branch"),
1717
+ sessionId: z10.string(),
1718
+ entryId: z10.string().nullable(),
1719
+ fork: z10.boolean()
1660
1720
  }),
1661
- z9.object({
1662
- type: z9.literal("session.navigate"),
1663
- sessionId: z9.string(),
1664
- entryId: z9.string(),
1665
- summarize: z9.boolean(),
1666
- instructions: z9.string().max(2e3).nullable()
1721
+ z10.object({
1722
+ type: z10.literal("session.navigate"),
1723
+ sessionId: z10.string(),
1724
+ entryId: z10.string(),
1725
+ summarize: z10.boolean(),
1726
+ instructions: z10.string().max(2e3).nullable()
1667
1727
  }),
1668
- z9.object({ type: z9.literal("session.reload"), sessionId: z9.string() }),
1669
- z9.object({ type: z9.literal("session.export"), sessionId: z9.string() }),
1670
- z9.object({
1671
- type: z9.literal("session.setModel"),
1672
- sessionId: z9.string(),
1673
- provider: z9.string().min(1),
1674
- modelId: z9.string().min(1)
1728
+ z10.object({ type: z10.literal("session.reload"), sessionId: z10.string() }),
1729
+ z10.object({ type: z10.literal("session.export"), sessionId: z10.string() }),
1730
+ z10.object({
1731
+ type: z10.literal("session.setModel"),
1732
+ sessionId: z10.string(),
1733
+ provider: z10.string().min(1),
1734
+ modelId: z10.string().min(1)
1675
1735
  }),
1676
- z9.object({ type: z9.literal("session.setThinking"), sessionId: z9.string(), level: ThinkingLevel }),
1677
- z9.object({
1678
- type: z9.literal("session.compact"),
1679
- sessionId: z9.string(),
1680
- instructions: z9.string().nullable()
1736
+ z10.object({ type: z10.literal("session.setThinking"), sessionId: z10.string(), level: ThinkingLevel }),
1737
+ z10.object({
1738
+ type: z10.literal("session.compact"),
1739
+ sessionId: z10.string(),
1740
+ instructions: z10.string().nullable()
1681
1741
  }),
1682
- z9.object({ type: z9.literal("checkout.inspect"), path: z9.string() }),
1683
- z9.object({ type: z9.literal("projects.scan"), folder: z9.string().min(1) }),
1684
- z9.object({
1685
- type: z9.literal("projects.suggest"),
1686
- days: z9.number().int().min(1).max(365).default(30)
1742
+ z10.object({ type: z10.literal("checkout.inspect"), path: z10.string() }),
1743
+ z10.object({ type: z10.literal("projects.scan"), folder: z10.string().min(1) }),
1744
+ z10.object({
1745
+ type: z10.literal("projects.suggest"),
1746
+ days: z10.number().int().min(1).max(365).default(30)
1687
1747
  }),
1688
- z9.object({
1689
- type: z9.literal("workspace.discover"),
1690
- checkoutPath: z9.string(),
1691
- worktreeDir: z9.string().default(DEFAULT_WORKTREE_DIR)
1748
+ z10.object({
1749
+ type: z10.literal("workspace.discover"),
1750
+ checkoutPath: z10.string(),
1751
+ worktreeDir: z10.string().default(DEFAULT_WORKTREE_DIR)
1692
1752
  }),
1693
- z9.object({
1694
- type: z9.literal("workspace.create"),
1695
- checkoutPath: z9.string(),
1696
- branch: z9.string(),
1697
- base: z9.string(),
1698
- setupCommand: z9.string().nullable(),
1699
- worktreeDir: z9.string().default(DEFAULT_WORKTREE_DIR)
1753
+ z10.object({
1754
+ type: z10.literal("workspace.create"),
1755
+ checkoutPath: z10.string(),
1756
+ branch: z10.string(),
1757
+ base: z10.string(),
1758
+ setupCommand: z10.string().nullable(),
1759
+ worktreeDir: z10.string().default(DEFAULT_WORKTREE_DIR)
1700
1760
  }),
1701
- z9.object({ type: z9.literal("workspace.status"), path: z9.string(), base: z9.string().nullable() }),
1702
- z9.object({
1703
- type: z9.literal("workspace.remove"),
1704
- path: z9.string(),
1705
- checkoutPath: z9.string(),
1706
- base: z9.string().nullable(),
1707
- force: z9.object({ dirty: z9.boolean(), unmerged: z9.boolean() })
1761
+ z10.object({ type: z10.literal("workspace.status"), path: z10.string(), base: z10.string().nullable() }),
1762
+ z10.object({
1763
+ type: z10.literal("workspace.remove"),
1764
+ path: z10.string(),
1765
+ checkoutPath: z10.string(),
1766
+ base: z10.string().nullable(),
1767
+ force: z10.object({ dirty: z10.boolean(), unmerged: z10.boolean() })
1708
1768
  }),
1709
- z9.object({
1710
- type: z9.literal("workspace.diff"),
1711
- path: z9.string(),
1712
- base: z9.string().nullable(),
1713
- file: z9.string().nullable()
1769
+ z10.object({
1770
+ type: z10.literal("workspace.diff"),
1771
+ path: z10.string(),
1772
+ base: z10.string().nullable(),
1773
+ file: z10.string().nullable()
1714
1774
  }),
1715
- z9.object({ type: z9.literal("workspace.files"), path: z9.string(), dir: z9.string() }),
1716
- z9.object({ type: z9.literal("workspace.readFile"), path: z9.string(), file: z9.string() }),
1717
- GitHubHostViewRequest.extend({ type: z9.literal("workspace.prView") }),
1718
- GitHubHostLogsRequest.extend({ type: z9.literal("workspace.prFailedLogs") }),
1719
- GitHubHostMergeRequest.extend({ type: z9.literal("workspace.prMerge") }),
1720
- z9.object({
1721
- type: z9.literal("dispatch.start"),
1722
- dispatchKey: z9.string(),
1723
- runId: z9.string(),
1724
- taskId: z9.string(),
1725
- sessionId: z9.string(),
1726
- projectId: z9.string(),
1727
- title: z9.string(),
1728
- workspace: z9.union([
1729
- z9.object({ path: z9.string() }),
1730
- z9.object({
1731
- createFrom: z9.object({
1732
- checkoutPath: z9.string(),
1733
- branch: z9.string(),
1734
- base: z9.string(),
1735
- setupCommand: z9.string().nullable(),
1736
- worktreeDir: z9.string().default(DEFAULT_WORKTREE_DIR)
1775
+ z10.object({ type: z10.literal("workspace.files"), path: z10.string(), dir: z10.string() }),
1776
+ z10.object({ type: z10.literal("workspace.readFile"), path: z10.string(), file: z10.string() }),
1777
+ GitHubHostViewRequest.extend({ type: z10.literal("workspace.prView") }),
1778
+ GitHubHostLogsRequest.extend({ type: z10.literal("workspace.prFailedLogs") }),
1779
+ GitHubHostMergeRequest.extend({ type: z10.literal("workspace.prMerge") }),
1780
+ z10.object({
1781
+ type: z10.literal("dispatch.start"),
1782
+ dispatchKey: z10.string(),
1783
+ runId: z10.string(),
1784
+ taskId: z10.string(),
1785
+ sessionId: z10.string(),
1786
+ projectId: z10.string(),
1787
+ title: z10.string(),
1788
+ workspace: z10.union([
1789
+ z10.object({ path: z10.string() }),
1790
+ z10.object({
1791
+ createFrom: z10.object({
1792
+ checkoutPath: z10.string(),
1793
+ branch: z10.string(),
1794
+ base: z10.string(),
1795
+ setupCommand: z10.string().nullable(),
1796
+ worktreeDir: z10.string().default(DEFAULT_WORKTREE_DIR)
1737
1797
  })
1738
1798
  })
1739
1799
  ]),
1740
1800
  nativeHandle: NativeHandle.nullable(),
1741
1801
  profile: Profile,
1742
- prompt: z9.string(),
1802
+ prompt: z10.string(),
1743
1803
  /** The launch's own revision; a takeover always carries a newer one. */
1744
- controlRevision: z9.number().int(),
1804
+ controlRevision: z10.number().int(),
1745
1805
  controlMode: ControlMode.default("automation"),
1746
- policyRequired: z9.boolean().optional()
1806
+ policyRequired: z10.boolean().optional()
1747
1807
  }),
1748
- z9.object({ type: z9.literal("dispatch.reconcile"), dispatchKey: z9.string() }),
1749
- z9.object({
1750
- type: z9.literal("checks.run"),
1751
- sessionId: z9.string(),
1752
- path: z9.string(),
1753
- commands: z9.array(z9.string())
1808
+ z10.object({ type: z10.literal("dispatch.reconcile"), dispatchKey: z10.string() }),
1809
+ z10.object({
1810
+ type: z10.literal("checks.run"),
1811
+ sessionId: z10.string(),
1812
+ path: z10.string(),
1813
+ commands: z10.array(z10.string())
1754
1814
  })
1755
1815
  ]);
1756
- var ImportableSession = z9.object({
1757
- sessionFile: z9.string(),
1758
- sessionId: z9.string(),
1759
- cwd: z9.string(),
1760
- name: z9.string().nullable(),
1761
- mtime: z9.string(),
1762
- inactive: z9.boolean()
1763
- });
1764
- var DiscoveredWorktree = z9.object({
1765
- path: z9.string(),
1766
- head: z9.string().nullable(),
1767
- branch: z9.string().nullable(),
1768
- bare: z9.boolean(),
1769
- detached: z9.boolean(),
1770
- locked: z9.boolean(),
1771
- prunable: z9.boolean(),
1772
- provenance: z9.enum(["managed", "discovered", "main"]),
1816
+ var ImportableSession = z10.object({
1817
+ sessionFile: z10.string(),
1818
+ sessionId: z10.string(),
1819
+ cwd: z10.string(),
1820
+ name: z10.string().nullable(),
1821
+ mtime: z10.string(),
1822
+ inactive: z10.boolean()
1823
+ });
1824
+ var DiscoveredWorktree = z10.object({
1825
+ path: z10.string(),
1826
+ head: z10.string().nullable(),
1827
+ branch: z10.string().nullable(),
1828
+ bare: z10.boolean(),
1829
+ detached: z10.boolean(),
1830
+ locked: z10.boolean(),
1831
+ prunable: z10.boolean(),
1832
+ provenance: z10.enum(["managed", "discovered", "main"]),
1773
1833
  git: GitState.nullable()
1774
1834
  });
1775
- var CheckoutInfo = z9.object({
1776
- root: z9.string(),
1777
- commonDir: z9.string(),
1778
- repoIdentity: z9.string(),
1779
- defaultBranch: z9.string()
1835
+ var CheckoutInfo = z10.object({
1836
+ root: z10.string(),
1837
+ commonDir: z10.string(),
1838
+ repoIdentity: z10.string(),
1839
+ defaultBranch: z10.string()
1780
1840
  });
1781
- var ScannedRepository = CheckoutInfo.extend({ name: z9.string() });
1782
- var ProjectFolderScan = z9.object({
1841
+ var ScannedRepository = CheckoutInfo.extend({ name: z10.string() });
1842
+ var ProjectFolderScan = z10.object({
1783
1843
  /** The folder, ~ expanded and realpath'd. */
1784
- folder: z9.string(),
1785
- repositories: z9.array(ScannedRepository)
1786
- });
1787
- var ProjectSuggestion = z9.object({
1788
- rootPath: z9.string(),
1789
- sessionCount: z9.number().int(),
1790
- lastActivityAt: z9.string()
1791
- });
1792
- var ProjectSuggestions = z9.object({ suggestions: z9.array(ProjectSuggestion) });
1793
- var DiffFile = z9.object({
1794
- path: z9.string(),
1795
- oldPath: z9.string().nullable(),
1796
- added: z9.number().int(),
1797
- deleted: z9.number().int(),
1798
- status: z9.enum(["added", "modified", "deleted", "renamed", "untracked", "binary"])
1799
- });
1800
- var DiffResult = z9.object({
1801
- base: z9.string(),
1802
- files: z9.array(DiffFile),
1803
- patch: z9.string().nullable()
1804
- });
1805
- var FileEntry = z9.object({
1806
- name: z9.string(),
1807
- path: z9.string(),
1808
- kind: z9.enum(["file", "dir", "symlink"]),
1809
- size: z9.number().int().nullable()
1810
- });
1811
- var ReconcileResult = z9.union([
1812
- z9.object({ known: z9.literal(false) }),
1813
- z9.object({
1814
- known: z9.literal(true),
1815
- sessionId: z9.string().nullable(),
1816
- state: z9.enum(["accepted", "workspace_ready", "started", "failed"]),
1844
+ folder: z10.string(),
1845
+ repositories: z10.array(ScannedRepository)
1846
+ });
1847
+ var ProjectSuggestion = z10.object({
1848
+ rootPath: z10.string(),
1849
+ sessionCount: z10.number().int(),
1850
+ lastActivityAt: z10.string()
1851
+ });
1852
+ var ProjectSuggestions = z10.object({ suggestions: z10.array(ProjectSuggestion) });
1853
+ var DiffFile = z10.object({
1854
+ path: z10.string(),
1855
+ oldPath: z10.string().nullable(),
1856
+ added: z10.number().int(),
1857
+ deleted: z10.number().int(),
1858
+ status: z10.enum(["added", "modified", "deleted", "renamed", "untracked", "binary"])
1859
+ });
1860
+ var DiffResult = z10.object({
1861
+ base: z10.string(),
1862
+ files: z10.array(DiffFile),
1863
+ patch: z10.string().nullable()
1864
+ });
1865
+ var FileEntry = z10.object({
1866
+ name: z10.string(),
1867
+ path: z10.string(),
1868
+ kind: z10.enum(["file", "dir", "symlink"]),
1869
+ size: z10.number().int().nullable()
1870
+ });
1871
+ var ReconcileResult = z10.union([
1872
+ z10.object({ known: z10.literal(false) }),
1873
+ z10.object({
1874
+ known: z10.literal(true),
1875
+ sessionId: z10.string().nullable(),
1876
+ state: z10.enum(["accepted", "workspace_ready", "started", "failed"]),
1817
1877
  runtime: RuntimeState.nullable(),
1818
- workspacePath: z9.string().nullable(),
1878
+ workspacePath: z10.string().nullable(),
1819
1879
  nativeHandle: NativeHandle.nullable(),
1820
- error: z9.string().nullable(),
1880
+ error: z10.string().nullable(),
1821
1881
  /** `{started: "unknown"}` when the host restarted after Pi may have been spawned. */
1822
- errorDetails: z9.record(z9.string(), z9.unknown()).nullable().default(null)
1882
+ errorDetails: z10.record(z10.string(), z10.unknown()).nullable().default(null)
1823
1883
  })
1824
1884
  ]);
1825
- var DispatchStartResult = z9.object({
1826
- sessionId: z9.string(),
1827
- workspacePath: z9.string(),
1885
+ var DispatchStartResult = z10.object({
1886
+ sessionId: z10.string(),
1887
+ workspacePath: z10.string(),
1828
1888
  nativeHandle: NativeHandle.nullable(),
1829
- reused: z9.boolean(),
1889
+ reused: z10.boolean(),
1830
1890
  /** Why the launch prompt was not delivered to Pi (the session itself started), if it was not. */
1831
- promptError: z9.string().nullable().optional()
1891
+ promptError: z10.string().nullable().optional()
1832
1892
  });
1833
- var AnswerResult = z9.object({
1834
- status: z9.enum(["answered", "already_answered"]),
1893
+ var AnswerResult = z10.object({
1894
+ status: z10.enum(["answered", "already_answered"]),
1835
1895
  interaction: Interaction
1836
1896
  });
1837
- var SnapshotResult = z9.object({
1838
- partial: z9.array(TranscriptItem),
1839
- pendingInteractions: z9.array(Interaction)
1897
+ var SnapshotResult = z10.object({
1898
+ partial: z10.array(TranscriptItem),
1899
+ pendingInteractions: z10.array(Interaction)
1840
1900
  });
1841
- var ChecksResult = z9.object({ results: z9.array(CheckResult) });
1842
- var Receipt = z9.union([
1843
- z9.object({ commandId: z9.string(), ok: z9.literal(true), result: z9.unknown() }),
1844
- z9.object({ commandId: z9.string(), ok: z9.literal(false), error: ErrorBody })
1901
+ var ChecksResult = z10.object({ results: z10.array(CheckResult) });
1902
+ var Receipt = z10.union([
1903
+ z10.object({ commandId: z10.string(), ok: z10.literal(true), result: z10.unknown() }),
1904
+ z10.object({ commandId: z10.string(), ok: z10.literal(false), error: ErrorBody })
1845
1905
  ]);
1846
1906
  var HostAgentRequestFrame = AgentRequestFrame.safeExtend({
1847
1907
  policyContext: HostToolPolicyContext.optional()
@@ -1860,278 +1920,278 @@ var HostAgentRequestFrame = AgentRequestFrame.safeExtend({
1860
1920
  }
1861
1921
  ctx.addIssue({ code: "custom", message: "Host agent frame exceeds 128 KiB or is not JSON." });
1862
1922
  });
1863
- var HostToCoordinator = z9.discriminatedUnion("type", [
1864
- z9.object({
1865
- type: z9.literal("hello"),
1866
- hostId: z9.string(),
1867
- credential: z9.string(),
1868
- name: z9.string(),
1869
- agentVersion: z9.string(),
1870
- piVersion: z9.string().nullable(),
1871
- piCompatible: z9.boolean(),
1923
+ var HostToCoordinator = z10.discriminatedUnion("type", [
1924
+ z10.object({
1925
+ type: z10.literal("hello"),
1926
+ hostId: z10.string(),
1927
+ credential: z10.string(),
1928
+ name: z10.string(),
1929
+ agentVersion: z10.string(),
1930
+ piVersion: z10.string().nullable(),
1931
+ piCompatible: z10.boolean(),
1872
1932
  platform: Platform,
1873
1933
  capabilities: RuntimeCapabilities.nullable(),
1874
1934
  github: HostGitHub.optional(),
1875
- protocolVersion: z9.number().int(),
1876
- features: z9.array(z9.string()).optional()
1935
+ protocolVersion: z10.number().int(),
1936
+ features: z10.array(z10.string()).optional()
1877
1937
  }),
1878
1938
  HostAgentRequestFrame,
1879
- z9.object({ type: z9.literal("event"), hostSeq: z9.number().int(), event: HostEvent }),
1880
- z9.object({ type: z9.literal("stream"), delta: StreamDelta }),
1881
- z9.object({ type: z9.literal("receipt"), receipt: Receipt }),
1882
- z9.object({ type: z9.literal("pong") }),
1883
- z9.object({ type: z9.literal("usage"), usage: z9.array(ProviderUsage) }),
1884
- z9.object({ type: z9.literal("term"), streamId: z9.string(), msg: TermServerToViewer })
1939
+ z10.object({ type: z10.literal("event"), hostSeq: z10.number().int(), event: HostEvent }),
1940
+ z10.object({ type: z10.literal("stream"), delta: StreamDelta }),
1941
+ z10.object({ type: z10.literal("receipt"), receipt: Receipt }),
1942
+ z10.object({ type: z10.literal("pong") }),
1943
+ z10.object({ type: z10.literal("usage"), usage: z10.array(ProviderUsage) }),
1944
+ z10.object({ type: z10.literal("term"), streamId: z10.string(), msg: TermServerToViewer })
1885
1945
  ]);
1886
- var CoordinatorToHost = z9.discriminatedUnion("type", [
1887
- z9.object({
1888
- type: z9.literal("welcome"),
1889
- coordinatorVersion: z9.string(),
1890
- ackedHostSeq: z9.number().int(),
1891
- features: z9.array(z9.string()).optional()
1946
+ var CoordinatorToHost = z10.discriminatedUnion("type", [
1947
+ z10.object({
1948
+ type: z10.literal("welcome"),
1949
+ coordinatorVersion: z10.string(),
1950
+ ackedHostSeq: z10.number().int(),
1951
+ features: z10.array(z10.string()).optional()
1892
1952
  }),
1893
1953
  AgentResultFrame,
1894
- z9.object({ type: z9.literal("ack"), hostSeq: z9.number().int() }),
1895
- z9.object({ type: z9.literal("command"), commandId: z9.string(), command: HostCommand }),
1896
- z9.object({ type: z9.literal("ping") }),
1897
- z9.object({ type: z9.literal("reject"), error: ErrorBody }),
1898
- z9.object({ type: z9.literal("term"), streamId: z9.string(), msg: TermCoordinatorMsg })
1954
+ z10.object({ type: z10.literal("ack"), hostSeq: z10.number().int() }),
1955
+ z10.object({ type: z10.literal("command"), commandId: z10.string(), command: HostCommand }),
1956
+ z10.object({ type: z10.literal("ping") }),
1957
+ z10.object({ type: z10.literal("reject"), error: ErrorBody }),
1958
+ z10.object({ type: z10.literal("term"), streamId: z10.string(), msg: TermCoordinatorMsg })
1899
1959
  ]);
1900
1960
 
1901
1961
  // packages/protocol/dist/api.js
1902
- var EnrollRequest = z10.object({
1903
- token: z10.string().min(1),
1904
- name: z10.string().min(1).max(80),
1962
+ var EnrollRequest = z11.object({
1963
+ token: z11.string().min(1),
1964
+ name: z11.string().min(1).max(80),
1905
1965
  kind: DeviceKind
1906
1966
  });
1907
- var EnrollResponse = z10.object({ deviceId: z10.string(), credential: z10.string() });
1908
- var CreateEnrollmentRequest = z10.object({ kind: z10.enum(["device", "host"]) });
1909
- var CreateEnrollmentResponse = z10.object({
1910
- token: z10.string(),
1911
- url: z10.string(),
1912
- expiresAt: z10.string(),
1913
- qrSvg: z10.string(),
1914
- command: z10.string().nullable()
1967
+ var EnrollResponse = z11.object({ deviceId: z11.string(), credential: z11.string() });
1968
+ var CreateEnrollmentRequest = z11.object({ kind: z11.enum(["device", "host"]) });
1969
+ var CreateEnrollmentResponse = z11.object({
1970
+ token: z11.string(),
1971
+ url: z11.string(),
1972
+ expiresAt: z11.string(),
1973
+ qrSvg: z11.string(),
1974
+ command: z11.string().nullable()
1915
1975
  });
1916
- var HostEnrollRequest = z10.union([
1917
- z10.object({
1918
- token: z10.string().min(1),
1919
- name: z10.string().min(1).max(80),
1976
+ var HostEnrollRequest = z11.union([
1977
+ z11.object({
1978
+ token: z11.string().min(1),
1979
+ name: z11.string().min(1).max(80),
1920
1980
  platform: Platform
1921
1981
  }),
1922
- z10.object({
1923
- secret: z10.string().min(1),
1924
- name: z10.string().min(1).max(80),
1982
+ z11.object({
1983
+ secret: z11.string().min(1),
1984
+ name: z11.string().min(1).max(80),
1925
1985
  platform: Platform
1926
1986
  })
1927
1987
  ]);
1928
- var HostEnrollResponse = z10.object({ hostId: z10.string(), credential: z10.string() });
1929
- var CreateProjectRequest = z10.object({
1930
- name: z10.string().min(1),
1931
- hostId: z10.string(),
1932
- path: z10.string().min(1),
1933
- defaultProfileId: z10.string().nullable().optional(),
1934
- setupCommand: z10.string().nullable().optional(),
1935
- checks: z10.array(z10.string()).optional(),
1936
- maxConcurrentRuns: z10.number().int().min(1).max(32).optional(),
1988
+ var HostEnrollResponse = z11.object({ hostId: z11.string(), credential: z11.string() });
1989
+ var CreateProjectRequest = z11.object({
1990
+ name: z11.string().min(1),
1991
+ hostId: z11.string(),
1992
+ path: z11.string().min(1),
1993
+ defaultProfileId: z11.string().nullable().optional(),
1994
+ setupCommand: z11.string().nullable().optional(),
1995
+ checks: z11.array(z11.string()).optional(),
1996
+ maxConcurrentRuns: z11.number().int().min(1).max(32).optional(),
1937
1997
  worktreeDir: WorktreeDir.optional()
1938
1998
  });
1939
- var UpdateProjectRequest = z10.object({
1940
- name: z10.string().min(1).optional(),
1941
- defaultProfileId: z10.string().nullable().optional(),
1942
- defaultHostId: z10.string().nullable().optional(),
1943
- maxConcurrentRuns: z10.number().int().min(1).max(32).optional(),
1944
- automationEnabled: z10.boolean().optional(),
1945
- setupCommand: z10.string().nullable().optional(),
1946
- checks: z10.array(z10.string()).optional(),
1947
- workspaceSharing: z10.enum(["single_writer", "shared"]).optional(),
1999
+ var UpdateProjectRequest = z11.object({
2000
+ name: z11.string().min(1).optional(),
2001
+ defaultProfileId: z11.string().nullable().optional(),
2002
+ defaultHostId: z11.string().nullable().optional(),
2003
+ maxConcurrentRuns: z11.number().int().min(1).max(32).optional(),
2004
+ automationEnabled: z11.boolean().optional(),
2005
+ setupCommand: z11.string().nullable().optional(),
2006
+ checks: z11.array(z11.string()).optional(),
2007
+ workspaceSharing: z11.enum(["single_writer", "shared"]).optional(),
1948
2008
  worktreeDir: WorktreeDir.optional()
1949
2009
  });
1950
- var AddCheckoutRequest = z10.object({ hostId: z10.string(), path: z10.string().min(1) });
2010
+ var AddCheckoutRequest = z11.object({ hostId: z11.string(), path: z11.string().min(1) });
1951
2011
  function isProjectFolderPath(s) {
1952
2012
  if (s.includes("\0"))
1953
2013
  return false;
1954
2014
  return s === "~" || s.startsWith("~/") || s.startsWith("/");
1955
2015
  }
1956
- var ProjectFolder = z10.string().trim().min(1).max(1024).refine(isProjectFolderPath, "must be an absolute path or start with ~/");
1957
- var UpdateHostRequest = z10.object({
1958
- projectFolders: z10.array(ProjectFolder).max(20).optional()
2016
+ var ProjectFolder = z11.string().trim().min(1).max(1024).refine(isProjectFolderPath, "must be an absolute path or start with ~/");
2017
+ var UpdateHostRequest = z11.object({
2018
+ projectFolders: z11.array(ProjectFolder).max(20).optional()
1959
2019
  });
1960
2020
  var ProjectScanResult = ProjectScan.extend({
1961
- added: z10.array(z10.object({
1962
- projectId: z10.string(),
1963
- name: z10.string(),
1964
- path: z10.string(),
1965
- newProject: z10.boolean()
2021
+ added: z11.array(z11.object({
2022
+ projectId: z11.string(),
2023
+ name: z11.string(),
2024
+ path: z11.string(),
2025
+ newProject: z11.boolean()
1966
2026
  }))
1967
2027
  });
1968
- var ProfileInput = z10.object({
1969
- name: z10.string().min(1),
1970
- provider: z10.string().nullable().default(null),
1971
- model: z10.string().nullable().default(null),
2028
+ var ProfileInput = z11.object({
2029
+ name: z11.string().min(1),
2030
+ provider: z11.string().nullable().default(null),
2031
+ model: z11.string().nullable().default(null),
1972
2032
  thinking: ThinkingLevel.nullable().default(null),
1973
- projectTrust: z10.enum(["ask", "approve", "ignore"]).default("ask"),
1974
- extraArgs: z10.array(ExtraArg).default([]),
1975
- resources: z10.enum(["all", "vanilla"]).default("all")
1976
- });
1977
- var CreateWorkspaceRequest = z10.object({
1978
- checkoutId: z10.string(),
1979
- branch: z10.string().min(1),
1980
- base: z10.string().nullable().optional()
1981
- });
1982
- var RemoveWorkspaceRequest = z10.object({
1983
- force: z10.object({ dirty: z10.boolean(), unmerged: z10.boolean() }).default({ dirty: false, unmerged: false })
1984
- });
1985
- var CreateSessionRequest = z10.object({
1986
- projectId: z10.string(),
1987
- workspace: z10.union([
1988
- z10.object({ existingId: z10.string() }),
1989
- z10.object({
1990
- checkoutId: z10.string(),
1991
- newBranch: z10.string().min(1),
1992
- base: z10.string().nullable().optional()
2033
+ projectTrust: z11.enum(["ask", "approve", "ignore"]).default("ask"),
2034
+ extraArgs: z11.array(ExtraArg).default([]),
2035
+ resources: z11.enum(["all", "vanilla"]).default("all")
2036
+ });
2037
+ var CreateWorkspaceRequest = z11.object({
2038
+ checkoutId: z11.string(),
2039
+ branch: z11.string().min(1),
2040
+ base: z11.string().nullable().optional()
2041
+ });
2042
+ var RemoveWorkspaceRequest = z11.object({
2043
+ force: z11.object({ dirty: z11.boolean(), unmerged: z11.boolean() }).default({ dirty: false, unmerged: false })
2044
+ });
2045
+ var CreateSessionRequest = z11.object({
2046
+ projectId: z11.string(),
2047
+ workspace: z11.union([
2048
+ z11.object({ existingId: z11.string() }),
2049
+ z11.object({
2050
+ checkoutId: z11.string(),
2051
+ newBranch: z11.string().min(1),
2052
+ base: z11.string().nullable().optional()
1993
2053
  })
1994
2054
  ]),
1995
- profileId: z10.string().nullable().optional(),
1996
- prompt: z10.string().default(""),
1997
- title: z10.string().optional(),
1998
- viewId: z10.string().optional()
1999
- });
2000
- var PromptRequest = z10.object({
2001
- text: z10.string().min(1),
2002
- mode: z10.enum(["prompt", "steer", "followUp"]).default("prompt"),
2003
- images: z10.array(z10.object({ mimeType: z10.string(), data: z10.string() })).default([]),
2004
- clientMessageId: z10.string().optional()
2005
- });
2006
- var CacheAlertRequest = z10.object({
2007
- enabled: z10.boolean(),
2008
- ttlSec: z10.number().int().min(60).max(86400).nullable().default(null)
2009
- });
2010
- var RenameRequest = z10.object({ title: z10.string().min(1).max(200) });
2011
- var SetModelRequest = z10.object({
2012
- provider: z10.string().min(1),
2013
- modelId: z10.string().min(1)
2014
- });
2015
- var SetThinkingRequest = z10.object({ level: ThinkingLevel });
2016
- var CompactRequest = z10.object({ instructions: z10.string().max(4e3).optional() });
2017
- var SessionModelsResult = z10.object({ models: z10.array(SessionModel) });
2018
- var SessionCommandsResult = z10.object({ commands: z10.array(SlashCommand) });
2019
- var CompleteRequest = z10.object({ text: z10.string().min(1).max(500) });
2020
- var CompletionItem = z10.object({
2021
- value: z10.string(),
2022
- label: z10.string(),
2023
- description: z10.string().nullable()
2024
- });
2025
- var SessionCompleteResult = z10.object({
2026
- items: z10.array(CompletionItem).max(50),
2027
- prefix: z10.string()
2028
- });
2029
- var TreeRow = z10.object({
2030
- entryId: z10.string(),
2031
- parentId: z10.string().nullable(),
2032
- depth: z10.number().int(),
2033
- role: z10.enum(["user", "assistant"]),
2034
- text: z10.string(),
2035
- activeBranch: z10.boolean(),
2036
- leaf: z10.boolean(),
2037
- label: z10.string().nullable(),
2038
- at: z10.string().nullable()
2039
- });
2040
- var SessionTreeResult = z10.object({ rows: z10.array(TreeRow) });
2041
- var BranchRequest = z10.object({
2042
- entryId: z10.string().nullable(),
2043
- fork: z10.boolean().default(false)
2044
- });
2045
- var HostBranchResult = z10.object({
2046
- sessionFile: z10.string().nullable(),
2047
- prefill: z10.string().nullable()
2048
- });
2049
- var TranscriptPage = z10.object({
2050
- items: z10.array(TranscriptItem),
2051
- hasMore: z10.boolean(),
2052
- epoch: z10.number().int().optional(),
2053
- rev: z10.number().int().optional(),
2054
- delta: z10.boolean().optional(),
2055
- reset: z10.boolean().optional()
2056
- });
2057
- var NavigateRequest = z10.object({
2058
- entryId: z10.string().min(1),
2059
- summarize: z10.boolean().default(false),
2060
- instructions: z10.string().max(2e3).nullable().default(null)
2061
- });
2062
- var HostNavigateResult = z10.object({
2063
- items: z10.array(TranscriptItem),
2064
- prefill: z10.string().nullable()
2065
- });
2066
- var NavigateResult = z10.object({
2067
- prefill: z10.string().nullable(),
2068
- epoch: z10.number().int()
2069
- });
2070
- var BranchResult = z10.object({
2055
+ profileId: z11.string().nullable().optional(),
2056
+ prompt: z11.string().default(""),
2057
+ title: z11.string().optional(),
2058
+ viewId: z11.string().optional()
2059
+ });
2060
+ var PromptRequest = z11.object({
2061
+ text: z11.string().min(1),
2062
+ mode: z11.enum(["prompt", "steer", "followUp"]).default("prompt"),
2063
+ images: z11.array(z11.object({ mimeType: z11.string(), data: z11.string() })).default([]),
2064
+ clientMessageId: z11.string().optional()
2065
+ });
2066
+ var CacheAlertRequest = z11.object({
2067
+ enabled: z11.boolean(),
2068
+ ttlSec: z11.number().int().min(60).max(86400).nullable().default(null)
2069
+ });
2070
+ var RenameRequest = z11.object({ title: z11.string().min(1).max(200) });
2071
+ var SetModelRequest = z11.object({
2072
+ provider: z11.string().min(1),
2073
+ modelId: z11.string().min(1)
2074
+ });
2075
+ var SetThinkingRequest = z11.object({ level: ThinkingLevel });
2076
+ var CompactRequest = z11.object({ instructions: z11.string().max(4e3).optional() });
2077
+ var SessionModelsResult = z11.object({ models: z11.array(SessionModel) });
2078
+ var SessionCommandsResult = z11.object({ commands: z11.array(SlashCommand) });
2079
+ var CompleteRequest = z11.object({ text: z11.string().min(1).max(500) });
2080
+ var CompletionItem = z11.object({
2081
+ value: z11.string(),
2082
+ label: z11.string(),
2083
+ description: z11.string().nullable()
2084
+ });
2085
+ var SessionCompleteResult = z11.object({
2086
+ items: z11.array(CompletionItem).max(50),
2087
+ prefix: z11.string()
2088
+ });
2089
+ var TreeRow = z11.object({
2090
+ entryId: z11.string(),
2091
+ parentId: z11.string().nullable(),
2092
+ depth: z11.number().int(),
2093
+ role: z11.enum(["user", "assistant"]),
2094
+ text: z11.string(),
2095
+ activeBranch: z11.boolean(),
2096
+ leaf: z11.boolean(),
2097
+ label: z11.string().nullable(),
2098
+ at: z11.string().nullable()
2099
+ });
2100
+ var SessionTreeResult = z11.object({ rows: z11.array(TreeRow) });
2101
+ var BranchRequest = z11.object({
2102
+ entryId: z11.string().nullable(),
2103
+ fork: z11.boolean().default(false)
2104
+ });
2105
+ var HostBranchResult = z11.object({
2106
+ sessionFile: z11.string().nullable(),
2107
+ prefill: z11.string().nullable()
2108
+ });
2109
+ var TranscriptPage = z11.object({
2110
+ items: z11.array(TranscriptItem),
2111
+ hasMore: z11.boolean(),
2112
+ epoch: z11.number().int().optional(),
2113
+ rev: z11.number().int().optional(),
2114
+ delta: z11.boolean().optional(),
2115
+ reset: z11.boolean().optional()
2116
+ });
2117
+ var NavigateRequest = z11.object({
2118
+ entryId: z11.string().min(1),
2119
+ summarize: z11.boolean().default(false),
2120
+ instructions: z11.string().max(2e3).nullable().default(null)
2121
+ });
2122
+ var HostNavigateResult = z11.object({
2123
+ items: z11.array(TranscriptItem),
2124
+ prefill: z11.string().nullable()
2125
+ });
2126
+ var NavigateResult = z11.object({
2127
+ prefill: z11.string().nullable(),
2128
+ epoch: z11.number().int()
2129
+ });
2130
+ var BranchResult = z11.object({
2071
2131
  session: Session.nullable(),
2072
- prefill: z10.string().nullable()
2132
+ prefill: z11.string().nullable()
2073
2133
  });
2074
- var SessionExportResult = z10.object({ fileName: z10.string(), content: z10.string() });
2075
- var CommandViewAction = z10.object({
2076
- label: z10.string().min(1).max(80),
2077
- command: z10.string().startsWith("/").max(500),
2078
- tone: z10.enum(["default", "primary", "danger"]).optional()
2134
+ var SessionExportResult = z11.object({ fileName: z11.string(), content: z11.string() });
2135
+ var CommandViewAction = z11.object({
2136
+ label: z11.string().min(1).max(80),
2137
+ command: z11.string().startsWith("/").max(500),
2138
+ tone: z11.enum(["default", "primary", "danger"]).optional()
2079
2139
  });
2080
- var CommandView = z10.object({
2081
- title: z10.string().min(1).max(200),
2140
+ var CommandView = z11.object({
2141
+ title: z11.string().min(1).max(200),
2082
2142
  body: UINodeSchema,
2083
- actions: z10.array(CommandViewAction).max(30).default([])
2143
+ actions: z11.array(CommandViewAction).max(30).default([])
2084
2144
  });
2085
- var ModelStateResult = z10.object({
2145
+ var ModelStateResult = z11.object({
2086
2146
  model: SessionModel.nullable(),
2087
2147
  thinking: ThinkingLevel.nullable()
2088
2148
  });
2089
- var ImportSessionRequest = z10.object({
2090
- hostId: z10.string(),
2091
- sessionFile: z10.string(),
2092
- projectId: z10.string().nullable().optional()
2149
+ var ImportSessionRequest = z11.object({
2150
+ hostId: z11.string(),
2151
+ sessionFile: z11.string(),
2152
+ projectId: z11.string().nullable().optional()
2093
2153
  });
2094
- var AnswerRequest = z10.object({
2095
- revision: z10.number().int(),
2154
+ var AnswerRequest = z11.object({
2155
+ revision: z11.number().int(),
2096
2156
  response: InteractionResponseSchema
2097
2157
  });
2098
- var AdapterActionRequest = z10.object({
2099
- adapterId: z10.string(),
2100
- actionId: z10.string(),
2101
- payload: z10.unknown().optional()
2102
- });
2103
- var TaskPolicyPatch = z10.object({
2104
- hostId: z10.string().nullable().optional(),
2105
- profileId: z10.string().nullable().optional(),
2106
- workspace: z10.object({
2107
- mode: z10.enum(["new_worktree", "existing"]).optional(),
2108
- branch: z10.string().nullable().optional(),
2109
- base: z10.string().nullable().optional(),
2110
- workspaceId: z10.string().optional()
2158
+ var AdapterActionRequest = z11.object({
2159
+ adapterId: z11.string(),
2160
+ actionId: z11.string(),
2161
+ payload: z11.unknown().optional()
2162
+ });
2163
+ var TaskPolicyPatch = z11.object({
2164
+ hostId: z11.string().nullable().optional(),
2165
+ profileId: z11.string().nullable().optional(),
2166
+ workspace: z11.object({
2167
+ mode: z11.enum(["new_worktree", "existing"]).optional(),
2168
+ branch: z11.string().nullable().optional(),
2169
+ base: z11.string().nullable().optional(),
2170
+ workspaceId: z11.string().optional()
2111
2171
  }).optional(),
2112
- continuation: z10.object({
2113
- enabled: z10.boolean().optional(),
2114
- objective: z10.string().min(1).optional(),
2115
- maxContinuations: z10.number().int().min(1).max(50).optional(),
2116
- maxElapsedMinutes: z10.number().int().min(1).max(1440).optional(),
2117
- maxTokens: z10.number().int().positive().nullable().optional(),
2118
- maxCostUsd: z10.number().positive().nullable().optional()
2172
+ continuation: z11.object({
2173
+ enabled: z11.boolean().optional(),
2174
+ objective: z11.string().min(1).optional(),
2175
+ maxContinuations: z11.number().int().min(1).max(50).optional(),
2176
+ maxElapsedMinutes: z11.number().int().min(1).max(1440).optional(),
2177
+ maxTokens: z11.number().int().positive().nullable().optional(),
2178
+ maxCostUsd: z11.number().positive().nullable().optional()
2119
2179
  }).optional(),
2120
2180
  completion: CompletionPolicy.partial().optional()
2121
2181
  });
2122
- var CreateTaskRequest = z10.object({
2123
- projectId: z10.string(),
2124
- title: z10.string().max(300).optional(),
2182
+ var CreateTaskRequest = z11.object({
2183
+ projectId: z11.string(),
2184
+ title: z11.string().max(300).optional(),
2125
2185
  githubIssueUrl: GitHubIssueUrl.optional(),
2126
- githubIssue: z10.never().optional(),
2127
- launchPrompt: z10.never().optional(),
2128
- objective: z10.string().default(""),
2129
- acceptanceCriteria: z10.array(z10.string()).default([]),
2130
- dependencies: z10.array(z10.string()).default([]),
2131
- parentTaskId: z10.string().nullable().optional(),
2186
+ githubIssue: z11.never().optional(),
2187
+ launchPrompt: z11.never().optional(),
2188
+ objective: z11.string().default(""),
2189
+ acceptanceCriteria: z11.array(z11.string()).default([]),
2190
+ dependencies: z11.array(z11.string()).default([]),
2191
+ parentTaskId: z11.string().nullable().optional(),
2132
2192
  priority: Priority.default(2),
2133
- state: z10.enum(["backlog", "ready"]).default("backlog"),
2134
- notBefore: z10.string().nullable().optional(),
2193
+ state: z11.enum(["backlog", "ready"]).default("backlog"),
2194
+ notBefore: z11.string().nullable().optional(),
2135
2195
  policy: TaskPolicyPatch.optional()
2136
2196
  }).superRefine((v, ctx) => {
2137
2197
  if (v.githubIssueUrl === void 0) {
@@ -2169,32 +2229,32 @@ var CreateTaskRequest = z10.object({
2169
2229
  const issue = githubIssueFromUrl(v.githubIssueUrl);
2170
2230
  return { ...v, title: v.title?.trim() || `${issue.repository} #${issue.number}` };
2171
2231
  });
2172
- var UpdateTaskRequest = z10.object({
2173
- githubIssueUrl: z10.never().optional(),
2174
- githubIssue: z10.never().optional(),
2175
- launchPrompt: z10.never().optional(),
2176
- title: z10.string().min(1).max(300).optional(),
2177
- objective: z10.string().optional(),
2178
- acceptanceCriteria: z10.array(z10.string()).optional(),
2179
- dependencies: z10.array(z10.string()).optional(),
2180
- parentTaskId: z10.string().nullable().optional(),
2232
+ var UpdateTaskRequest = z11.object({
2233
+ githubIssueUrl: z11.never().optional(),
2234
+ githubIssue: z11.never().optional(),
2235
+ launchPrompt: z11.never().optional(),
2236
+ title: z11.string().min(1).max(300).optional(),
2237
+ objective: z11.string().optional(),
2238
+ acceptanceCriteria: z11.array(z11.string()).optional(),
2239
+ dependencies: z11.array(z11.string()).optional(),
2240
+ parentTaskId: z11.string().nullable().optional(),
2181
2241
  priority: Priority.optional(),
2182
- position: z10.number().optional(),
2183
- notBefore: z10.string().nullable().optional(),
2242
+ position: z11.number().optional(),
2243
+ notBefore: z11.string().nullable().optional(),
2184
2244
  policy: TaskPolicyPatch.optional()
2185
2245
  });
2186
- var MoveTaskRequest = z10.object({
2246
+ var MoveTaskRequest = z11.object({
2187
2247
  to: TaskState,
2188
- confirm: z10.boolean().optional(),
2189
- onRunning: z10.enum(["pause", "stop"]).optional(),
2190
- position: z10.number().optional()
2248
+ confirm: z11.boolean().optional(),
2249
+ onRunning: z11.enum(["pause", "stop"]).optional(),
2250
+ position: z11.number().optional()
2191
2251
  });
2192
- var RequestChangesRequest = z10.object({ feedback: z10.array(z10.string().min(1)).min(1) });
2193
- var Eligibility = z10.union([
2194
- z10.object({ eligible: z10.literal(true), hostId: z10.string(), hostName: z10.string() }),
2195
- z10.object({
2196
- eligible: z10.literal(false),
2197
- wait: z10.enum([
2252
+ var RequestChangesRequest = z11.object({ feedback: z11.array(z11.string().min(1)).min(1) });
2253
+ var Eligibility = z11.union([
2254
+ z11.object({ eligible: z11.literal(true), hostId: z11.string(), hostName: z11.string() }),
2255
+ z11.object({
2256
+ eligible: z11.literal(false),
2257
+ wait: z11.enum([
2198
2258
  "dependency",
2199
2259
  "host_offline",
2200
2260
  "project_limit",
@@ -2207,145 +2267,145 @@ var Eligibility = z10.union([
2207
2267
  "already_dispatched",
2208
2268
  "retry_backoff"
2209
2269
  ]),
2210
- message: z10.string()
2270
+ message: z11.string()
2211
2271
  })
2212
2272
  ]);
2213
- var NowResponse = z10.object({
2214
- running: z10.array(z10.object({ taskId: z10.string(), runId: z10.string(), sessionId: z10.string().nullable() })),
2215
- queued: z10.array(z10.object({ taskId: z10.string(), eligibility: Eligibility })),
2216
- dispatchPaused: z10.boolean()
2217
- });
2218
- var AutomationInput = z10.object({
2219
- name: z10.string().min(1),
2220
- enabled: z10.boolean().default(true),
2221
- projectId: z10.string(),
2273
+ var NowResponse = z11.object({
2274
+ running: z11.array(z11.object({ taskId: z11.string(), runId: z11.string(), sessionId: z11.string().nullable() })),
2275
+ queued: z11.array(z11.object({ taskId: z11.string(), eligibility: Eligibility })),
2276
+ dispatchPaused: z11.boolean()
2277
+ });
2278
+ var AutomationInput = z11.object({
2279
+ name: z11.string().min(1),
2280
+ enabled: z11.boolean().default(true),
2281
+ projectId: z11.string(),
2222
2282
  trigger: Trigger,
2223
- filters: z10.array(z10.object({ path: z10.string(), equals: z10.string() })).default([]),
2283
+ filters: z11.array(z11.object({ path: z11.string(), equals: z11.string() })).default([]),
2224
2284
  template: TaskTemplate,
2225
- hostId: z10.string().nullable().default(null),
2226
- profileId: z10.string().nullable().default(null),
2227
- mode: z10.enum(["fresh", "continue", "watch"]).default("fresh"),
2228
- groupingKey: z10.string().nullable().default(null),
2229
- overlap: z10.enum(["skip", "queue_one", "append"]).default("skip"),
2230
- missed: z10.enum(["skip", "run_once"]).default("skip"),
2285
+ hostId: z11.string().nullable().default(null),
2286
+ profileId: z11.string().nullable().default(null),
2287
+ mode: z11.enum(["fresh", "continue", "watch"]).default("fresh"),
2288
+ groupingKey: z11.string().nullable().default(null),
2289
+ overlap: z11.enum(["skip", "queue_one", "append"]).default("skip"),
2290
+ missed: z11.enum(["skip", "run_once"]).default("skip"),
2231
2291
  continuation: ContinuationPolicy.default({ enabled: false }),
2232
2292
  completion: CompletionPolicy.default({ checks: null, requireHumanReview: true })
2233
2293
  });
2234
- var AutomationView = Automation.extend({ summary: z10.string() });
2235
- var AutomationPreview = z10.object({
2236
- summary: z10.string(),
2294
+ var AutomationView = Automation.extend({ summary: z11.string() });
2295
+ var AutomationPreview = z11.object({
2296
+ summary: z11.string(),
2237
2297
  task: TaskTemplate,
2238
- next: z10.array(z10.string())
2239
- });
2240
- var WebhookTokenResponse = z10.object({ token: z10.string(), url: z10.string() });
2241
- var PushSubscriptionRequest = z10.object({
2242
- endpoint: z10.string().url(),
2243
- keys: z10.object({ p256dh: z10.string(), auth: z10.string() }),
2244
- permission: z10.enum(["granted", "denied", "default", "unknown"]).default("granted")
2245
- });
2246
- var NotificationSettings = z10.object({
2247
- quietHours: z10.object({
2248
- start: z10.string().regex(/^\d{2}:\d{2}$/),
2249
- end: z10.string().regex(/^\d{2}:\d{2}$/),
2250
- timezone: z10.string()
2298
+ next: z11.array(z11.string())
2299
+ });
2300
+ var WebhookTokenResponse = z11.object({ token: z11.string(), url: z11.string() });
2301
+ var PushSubscriptionRequest = z11.object({
2302
+ endpoint: z11.string().url(),
2303
+ keys: z11.object({ p256dh: z11.string(), auth: z11.string() }),
2304
+ permission: z11.enum(["granted", "denied", "default", "unknown"]).default("granted")
2305
+ });
2306
+ var NotificationSettings = z11.object({
2307
+ quietHours: z11.object({
2308
+ start: z11.string().regex(/^\d{2}:\d{2}$/),
2309
+ end: z11.string().regex(/^\d{2}:\d{2}$/),
2310
+ timezone: z11.string()
2251
2311
  }).nullable(),
2252
- privatePreviews: z10.boolean(),
2253
- preferredDeviceId: z10.string().nullable()
2312
+ privatePreviews: z11.boolean(),
2313
+ preferredDeviceId: z11.string().nullable()
2254
2314
  });
2255
- var PushPayload = z10.union([
2256
- z10.object({
2257
- type: z10.literal("show"),
2258
- title: z10.string(),
2259
- body: z10.string(),
2260
- tag: z10.string(),
2261
- url: z10.string(),
2262
- renotify: z10.boolean()
2315
+ var PushPayload = z11.union([
2316
+ z11.object({
2317
+ type: z11.literal("show"),
2318
+ title: z11.string(),
2319
+ body: z11.string(),
2320
+ tag: z11.string(),
2321
+ url: z11.string(),
2322
+ renotify: z11.boolean()
2263
2323
  }),
2264
- z10.object({ type: z10.literal("clear"), tag: z10.string() })
2324
+ z11.object({ type: z11.literal("clear"), tag: z11.string() })
2265
2325
  ]);
2266
- var SetupState = z10.object({
2267
- passkey: z10.object({
2268
- available: z10.boolean(),
2269
- registered: z10.boolean(),
2270
- reason: z10.string().nullable()
2326
+ var SetupState = z11.object({
2327
+ passkey: z11.object({
2328
+ available: z11.boolean(),
2329
+ registered: z11.boolean(),
2330
+ reason: z11.string().nullable()
2271
2331
  }),
2272
- oidc: z10.object({ label: z10.string() }).nullable()
2332
+ oidc: z11.object({ label: z11.string() }).nullable()
2273
2333
  });
2274
- var PasskeyRegisterOptionsResponse = z10.object({
2275
- challengeId: z10.string(),
2276
- options: z10.unknown()
2334
+ var PasskeyRegisterOptionsResponse = z11.object({
2335
+ challengeId: z11.string(),
2336
+ options: z11.unknown()
2277
2337
  });
2278
- var PasskeyRegisterVerifyRequest = z10.object({
2279
- challengeId: z10.string(),
2280
- name: z10.string().min(1).max(80),
2281
- response: z10.unknown()
2338
+ var PasskeyRegisterVerifyRequest = z11.object({
2339
+ challengeId: z11.string(),
2340
+ name: z11.string().min(1).max(80),
2341
+ response: z11.unknown()
2282
2342
  });
2283
- var PasskeySignInOptionsResponse = z10.object({
2284
- challengeId: z10.string(),
2285
- options: z10.unknown()
2343
+ var PasskeySignInOptionsResponse = z11.object({
2344
+ challengeId: z11.string(),
2345
+ options: z11.unknown()
2286
2346
  });
2287
- var PasskeySignInVerifyRequest = z10.object({
2288
- challengeId: z10.string(),
2289
- response: z10.unknown(),
2290
- deviceName: z10.string().min(1).max(80),
2347
+ var PasskeySignInVerifyRequest = z11.object({
2348
+ challengeId: z11.string(),
2349
+ response: z11.unknown(),
2350
+ deviceName: z11.string().min(1).max(80),
2291
2351
  kind: DeviceKind.extract(["browser", "pwa"])
2292
2352
  });
2293
- var OidcBeginRequest = z10.object({
2294
- deviceName: z10.string().min(1).max(80),
2353
+ var OidcBeginRequest = z11.object({
2354
+ deviceName: z11.string().min(1).max(80),
2295
2355
  kind: DeviceKind.extract(["browser", "pwa"]),
2296
- next: z10.string().default("/"),
2297
- handoff: z10.boolean().default(false)
2298
- });
2299
- var OidcBeginResponse = z10.object({
2300
- authorizeUrl: z10.string(),
2301
- flowId: z10.string().nullable(),
2302
- pollToken: z10.string().nullable()
2303
- });
2304
- var OidcClaimRequest = z10.object({ flowId: z10.string(), pollToken: z10.string() });
2305
- var OidcClaimResponse = z10.union([
2306
- z10.object({ status: z10.literal("pending") }),
2307
- z10.object({ status: z10.literal("done"), deviceId: z10.string() })
2356
+ next: z11.string().default("/"),
2357
+ handoff: z11.boolean().default(false)
2358
+ });
2359
+ var OidcBeginResponse = z11.object({
2360
+ authorizeUrl: z11.string(),
2361
+ flowId: z11.string().nullable(),
2362
+ pollToken: z11.string().nullable()
2363
+ });
2364
+ var OidcClaimRequest = z11.object({ flowId: z11.string(), pollToken: z11.string() });
2365
+ var OidcClaimResponse = z11.union([
2366
+ z11.object({ status: z11.literal("pending") }),
2367
+ z11.object({ status: z11.literal("done"), deviceId: z11.string() })
2308
2368
  ]);
2309
- var TerminalLoginStartRequest = z10.object({ name: z10.string().min(1).max(80) });
2310
- var TerminalLoginStartResponse = z10.object({
2311
- userCode: z10.string(),
2312
- pollToken: z10.string(),
2313
- verifyUrl: z10.string(),
2314
- expiresAt: z10.string(),
2315
- intervalMs: z10.number().int()
2316
- });
2317
- var TerminalLoginClaimRequest = z10.object({
2318
- userCode: z10.string().min(1),
2319
- pollToken: z10.string().min(1)
2320
- });
2321
- var TerminalLoginClaimResponse = z10.union([
2322
- z10.object({ status: z10.literal("pending") }),
2323
- z10.object({ status: z10.literal("denied") }),
2324
- z10.object({ status: z10.literal("done"), deviceId: z10.string(), credential: z10.string() })
2369
+ var TerminalLoginStartRequest = z11.object({ name: z11.string().min(1).max(80) });
2370
+ var TerminalLoginStartResponse = z11.object({
2371
+ userCode: z11.string(),
2372
+ pollToken: z11.string(),
2373
+ verifyUrl: z11.string(),
2374
+ expiresAt: z11.string(),
2375
+ intervalMs: z11.number().int()
2376
+ });
2377
+ var TerminalLoginClaimRequest = z11.object({
2378
+ userCode: z11.string().min(1),
2379
+ pollToken: z11.string().min(1)
2380
+ });
2381
+ var TerminalLoginClaimResponse = z11.union([
2382
+ z11.object({ status: z11.literal("pending") }),
2383
+ z11.object({ status: z11.literal("denied") }),
2384
+ z11.object({ status: z11.literal("done"), deviceId: z11.string(), credential: z11.string() })
2325
2385
  ]);
2326
- var TerminalLoginRequest = z10.object({
2327
- userCode: z10.string(),
2328
- name: z10.string(),
2329
- requestedFrom: z10.string(),
2330
- createdAt: z10.string(),
2331
- expiresAt: z10.string(),
2332
- status: z10.enum(["pending", "approved", "denied"])
2333
- });
2334
- var AuthMethods = z10.object({
2335
- passkeys: z10.array(Passkey),
2336
- passkeyAvailability: z10.object({ available: z10.boolean(), reason: z10.string().nullable() }),
2337
- oidc: z10.object({
2338
- issuer: z10.string(),
2339
- label: z10.string(),
2340
- ownerMatch: z10.string(),
2341
- status: z10.enum(["ready", "error"]),
2342
- error: z10.string().nullable()
2386
+ var TerminalLoginRequest = z11.object({
2387
+ userCode: z11.string(),
2388
+ name: z11.string(),
2389
+ requestedFrom: z11.string(),
2390
+ createdAt: z11.string(),
2391
+ expiresAt: z11.string(),
2392
+ status: z11.enum(["pending", "approved", "denied"])
2393
+ });
2394
+ var AuthMethods = z11.object({
2395
+ passkeys: z11.array(Passkey),
2396
+ passkeyAvailability: z11.object({ available: z11.boolean(), reason: z11.string().nullable() }),
2397
+ oidc: z11.object({
2398
+ issuer: z11.string(),
2399
+ label: z11.string(),
2400
+ ownerMatch: z11.string(),
2401
+ status: z11.enum(["ready", "error"]),
2402
+ error: z11.string().nullable()
2343
2403
  }).nullable()
2344
2404
  });
2345
- var MeResponse = z10.object({
2405
+ var MeResponse = z11.object({
2346
2406
  device: Device,
2347
- admin: z10.boolean(),
2348
- publicUrl: z10.string()
2407
+ admin: z11.boolean(),
2408
+ publicUrl: z11.string()
2349
2409
  });
2350
2410
  var ViewInput = View.pick({
2351
2411
  name: true,
@@ -2359,51 +2419,65 @@ var ViewInput = View.pick({
2359
2419
  });
2360
2420
  var ViewPatch = ViewInput.partial();
2361
2421
  var ViewClientReport = ViewClient.omit({ lastSeenAt: true });
2362
- var ProjectSuggestionsResponse = z10.object({
2363
- suggestions: z10.array(ProjectSuggestion.extend({ name: z10.string(), preselected: z10.boolean() }))
2422
+ var ProjectSuggestionsResponse = z11.object({
2423
+ suggestions: z11.array(ProjectSuggestion.extend({ name: z11.string(), preselected: z11.boolean() }))
2364
2424
  });
2365
2425
 
2366
2426
  // packages/protocol/dist/client-wire.js
2367
- import { z as z11 } from "zod";
2368
- var SyncState = z11.object({
2369
- hosts: z11.array(Host),
2370
- projects: z11.array(Project),
2371
- checkouts: z11.array(Checkout),
2372
- workspaces: z11.array(Workspace),
2373
- profiles: z11.array(Profile),
2374
- views: z11.array(View),
2375
- sessions: z11.array(Session),
2376
- tasks: z11.array(Task),
2377
- runs: z11.array(Run),
2378
- automations: z11.array(Automation),
2379
- attention: z11.array(AttentionItem),
2380
- interactions: z11.array(Interaction),
2381
- panels: z11.array(Panel),
2382
- devices: z11.array(Device),
2383
- adapters: z11.record(z11.string(), z11.array(AdapterInfo)),
2384
- dispatchPaused: z11.boolean()
2385
- });
2386
- var Presence = z11.object({
2387
- foreground: z11.boolean(),
2388
- interactedAt: z11.string().nullable(),
2389
- viewing: z11.object({ sessionId: z11.string() }).nullable()
2390
- });
2391
- var ClientToServer = z11.discriminatedUnion("type", [
2392
- z11.object({ type: z11.literal("hello"), cursor: z11.number().int().nullable() }),
2393
- z11.object({ type: z11.literal("presence"), presence: Presence }),
2394
- z11.object({ type: z11.literal("ping") })
2427
+ import { z as z12 } from "zod";
2428
+ var SyncState = z12.object({
2429
+ hosts: z12.array(Host),
2430
+ projects: z12.array(Project),
2431
+ checkouts: z12.array(Checkout),
2432
+ workspaces: z12.array(Workspace),
2433
+ profiles: z12.array(Profile),
2434
+ views: z12.array(View),
2435
+ sessions: z12.array(Session),
2436
+ tasks: z12.array(Task),
2437
+ runs: z12.array(Run),
2438
+ automations: z12.array(Automation),
2439
+ attention: z12.array(AttentionItem),
2440
+ interactions: z12.array(Interaction),
2441
+ panels: z12.array(Panel),
2442
+ devices: z12.array(Device),
2443
+ adapters: z12.record(z12.string(), z12.array(AdapterInfo)),
2444
+ dispatchPaused: z12.boolean()
2445
+ });
2446
+ var Presence = z12.object({
2447
+ foreground: z12.boolean(),
2448
+ interactedAt: z12.string().nullable(),
2449
+ viewing: z12.object({ sessionId: z12.string() }).nullable()
2450
+ });
2451
+ var CLIENT_CAPABILITIES = ["adapter.slots.v1", "timeline.cards.v1"];
2452
+ var ClientToServer = z12.discriminatedUnion("type", [
2453
+ z12.object({
2454
+ type: z12.literal("hello"),
2455
+ cursor: z12.number().int().nullable(),
2456
+ capabilities: z12.array(z12.string().min(1).max(80)).max(32).optional(),
2457
+ projectionId: z12.string().max(256).nullable().optional()
2458
+ }),
2459
+ z12.object({ type: z12.literal("presence"), presence: Presence }),
2460
+ z12.object({ type: z12.literal("ping") })
2395
2461
  ]);
2396
- var ServerToClient = z11.discriminatedUnion("type", [
2397
- z11.object({
2398
- type: z11.literal("replay"),
2399
- seq: z11.number().int(),
2400
- events: z11.array(EventEnvelope)
2462
+ var ServerToClient = z12.discriminatedUnion("type", [
2463
+ z12.object({
2464
+ type: z12.literal("replay"),
2465
+ seq: z12.number().int(),
2466
+ events: z12.array(EventEnvelope),
2467
+ capabilities: z12.array(z12.enum(CLIENT_CAPABILITIES)).optional(),
2468
+ projectionId: z12.string().optional()
2469
+ }),
2470
+ z12.object({
2471
+ type: z12.literal("snapshot"),
2472
+ seq: z12.number().int(),
2473
+ state: SyncState,
2474
+ capabilities: z12.array(z12.enum(CLIENT_CAPABILITIES)).optional(),
2475
+ projectionId: z12.string().optional()
2401
2476
  }),
2402
- z11.object({ type: z11.literal("snapshot"), seq: z11.number().int(), state: SyncState }),
2403
- z11.object({ type: z11.literal("event"), event: EventEnvelope }),
2404
- z11.object({ type: z11.literal("stream"), delta: StreamDelta }),
2405
- z11.object({ type: z11.literal("pong") }),
2406
- z11.object({ type: z11.literal("force_logout"), reason: z11.string() })
2477
+ z12.object({ type: z12.literal("event"), event: EventEnvelope }),
2478
+ z12.object({ type: z12.literal("stream"), delta: StreamDelta }),
2479
+ z12.object({ type: z12.literal("pong") }),
2480
+ z12.object({ type: z12.literal("force_logout"), reason: z12.string() })
2407
2481
  ]);
2408
2482
 
2409
2483
  // packages/protocol/dist/ids.js
@@ -2414,17 +2488,17 @@ var ulid = monotonicFactory();
2414
2488
  var CLIENT_OPEN_MS = 10 * 6e4;
2415
2489
 
2416
2490
  // packages/protocol/dist/web-bridge.js
2417
- import { z as z12 } from "zod";
2491
+ import { z as z13 } from "zod";
2418
2492
  var FRAME_MAX_HEIGHT = 4e3;
2419
- var FrameToParentMessageSchema = z12.discriminatedUnion("type", [
2420
- z12.object({
2421
- type: z12.literal("action"),
2422
- actionId: z12.string().min(1).max(200),
2423
- payload: z12.unknown().optional()
2493
+ var FrameToParentMessageSchema = z13.discriminatedUnion("type", [
2494
+ z13.object({
2495
+ type: z13.literal("action"),
2496
+ actionId: z13.string().min(1).max(200),
2497
+ payload: z13.unknown().optional()
2424
2498
  }),
2425
- z12.object({
2426
- type: z12.literal("resize"),
2427
- height: z12.number().finite().min(0).max(FRAME_MAX_HEIGHT)
2499
+ z13.object({
2500
+ type: z13.literal("resize"),
2501
+ height: z13.number().finite().min(0).max(FRAME_MAX_HEIGHT)
2428
2502
  })
2429
2503
  ]);
2430
2504