@spencerboucher/switchyard 0.14.0 → 0.16.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 (101) hide show
  1. package/README.md +1 -1
  2. package/dist/bridge/enroll.js +55 -0
  3. package/dist/bridge/socket-paths.js +57 -0
  4. package/dist/bridge/state-dir.js +17 -0
  5. package/dist/bridge/switchyard-terminal.js +213 -19
  6. package/dist/policies/worker.js +1497 -1332
  7. package/dist/switchyard.mjs +3345 -1851
  8. package/package.json +1 -1
  9. package/web-dist/assets/AutomationView-D8xBiO8V.js +2 -0
  10. package/web-dist/assets/{AutomationView-CcxKiLxM.js.map → AutomationView-D8xBiO8V.js.map} +1 -1
  11. package/web-dist/assets/InteractionCard-DebpdBi7.js +4 -0
  12. package/web-dist/assets/{InteractionCard-Bd4Cr_Zi.js.map → InteractionCard-DebpdBi7.js.map} +1 -1
  13. package/web-dist/assets/{Overlay-QSBH5woa.js → Overlay-Dlhi9c84.js} +2 -2
  14. package/web-dist/assets/{Overlay-QSBH5woa.js.map → Overlay-Dlhi9c84.js.map} +1 -1
  15. package/web-dist/assets/{Priority-PUuNGK2s.js → Priority-C5Glky7C.js} +2 -2
  16. package/web-dist/assets/{Priority-PUuNGK2s.js.map → Priority-C5Glky7C.js.map} +1 -1
  17. package/web-dist/assets/Select-aZSSgs66.js +2 -0
  18. package/web-dist/assets/{Select-CpWLZnId.js.map → Select-aZSSgs66.js.map} +1 -1
  19. package/web-dist/assets/{Tabs-BplxI0Eb.js → Tabs-BtcfgH4N.js} +5 -5
  20. package/web-dist/assets/{Tabs-BplxI0Eb.js.map → Tabs-BtcfgH4N.js.map} +1 -1
  21. package/web-dist/assets/{UINodeRenderer-Bxq4kPwg.js → UINodeRenderer-C6UI3QVH.js} +2 -2
  22. package/web-dist/assets/{UINodeRenderer-Bxq4kPwg.js.map → UINodeRenderer-C6UI3QVH.js.map} +1 -1
  23. package/web-dist/assets/ViewSelect-z38PW0fi.js +2 -0
  24. package/web-dist/assets/ViewSelect-z38PW0fi.js.map +1 -0
  25. package/web-dist/assets/attention-D6MFVno_.js +2 -0
  26. package/web-dist/assets/{attention-BwQ0PjVB.js.map → attention-D6MFVno_.js.map} +1 -1
  27. package/web-dist/assets/auth-Dp9eZwp6.js +2 -0
  28. package/web-dist/assets/auth-Dp9eZwp6.js.map +1 -0
  29. package/web-dist/assets/automations-D7SN92MH.js +2 -0
  30. package/web-dist/assets/{automations-BSV9KuSH.js.map → automations-D7SN92MH.js.map} +1 -1
  31. package/web-dist/assets/board-dkcdNQmy.js +10 -0
  32. package/web-dist/assets/board-dkcdNQmy.js.map +1 -0
  33. package/web-dist/assets/code-CFjMSo7b.js +25 -0
  34. package/web-dist/assets/code-CFjMSo7b.js.map +1 -0
  35. package/web-dist/assets/{describe-Nw-EGTvb.js → describe-DzuCgJir.js} +2 -2
  36. package/web-dist/assets/{describe-Nw-EGTvb.js.map → describe-DzuCgJir.js.map} +1 -1
  37. package/web-dist/assets/enroll-BTCRpn9h.js +2 -0
  38. package/web-dist/assets/{enroll-2bd2qhh1.js.map → enroll-BTCRpn9h.js.map} +1 -1
  39. package/web-dist/assets/index-B1pFvZNV.css +2 -0
  40. package/web-dist/assets/index-BWi8eZxK.js +23 -0
  41. package/web-dist/assets/index-BWi8eZxK.js.map +1 -0
  42. package/web-dist/assets/more-KjCC48BM.js +2 -0
  43. package/web-dist/assets/{more-tcGYFcpM.js.map → more-KjCC48BM.js.map} +1 -1
  44. package/web-dist/assets/{policyLogic-4ByNprLE.js → policyLogic-nylxViIk.js} +2 -2
  45. package/web-dist/assets/{policyLogic-4ByNprLE.js.map → policyLogic-nylxViIk.js.map} +1 -1
  46. package/web-dist/assets/{queue-BH_AgQ1C.js → queue-BE-I-CIR.js} +2 -2
  47. package/web-dist/assets/{queue-BH_AgQ1C.js.map → queue-BE-I-CIR.js.map} +1 -1
  48. package/web-dist/assets/{repo-Pn-s_Ggk.js → repo-DvbQh_v5.js} +2 -2
  49. package/web-dist/assets/{repo-Pn-s_Ggk.js.map → repo-DvbQh_v5.js.map} +1 -1
  50. package/web-dist/assets/selection-DKEV1Jcg.js +2 -0
  51. package/web-dist/assets/selection-DKEV1Jcg.js.map +1 -0
  52. package/web-dist/assets/settings-CfHCWzlJ.js +12 -0
  53. package/web-dist/assets/settings-CfHCWzlJ.js.map +1 -0
  54. package/web-dist/assets/states-DOYtBI1P.js +58 -0
  55. package/web-dist/assets/states-DOYtBI1P.js.map +1 -0
  56. package/web-dist/assets/terminal-login-BFVSosBA.js +2 -0
  57. package/web-dist/assets/{terminal-login-BSJdzvzq.js.map → terminal-login-BFVSosBA.js.map} +1 -1
  58. package/web-dist/assets/useNow-kkVAYV7Y.js +2 -0
  59. package/web-dist/assets/useNow-kkVAYV7Y.js.map +1 -0
  60. package/web-dist/assets/{useResource-Bzqxz-K_.js → useResource-CiJX4Lk_.js} +2 -2
  61. package/web-dist/assets/{useResource-Bzqxz-K_.js.map → useResource-CiJX4Lk_.js.map} +1 -1
  62. package/web-dist/index.html +5 -10
  63. package/web-dist/sw.js +1 -1
  64. package/web-dist/sw.js.map +1 -1
  65. package/web-dist/assets/AutomationView-CcxKiLxM.js +0 -2
  66. package/web-dist/assets/InteractionCard-Bd4Cr_Zi.js +0 -4
  67. package/web-dist/assets/Menu-CDIEOsaM.js +0 -2
  68. package/web-dist/assets/Menu-CDIEOsaM.js.map +0 -1
  69. package/web-dist/assets/Select-CpWLZnId.js +0 -2
  70. package/web-dist/assets/TextArea-BQPdfjO_.js +0 -2
  71. package/web-dist/assets/TextArea-BQPdfjO_.js.map +0 -1
  72. package/web-dist/assets/attention-BwQ0PjVB.js +0 -2
  73. package/web-dist/assets/automations-BSV9KuSH.js +0 -2
  74. package/web-dist/assets/board-C8N8_GS0.js +0 -10
  75. package/web-dist/assets/board-C8N8_GS0.js.map +0 -1
  76. package/web-dist/assets/code-BmxcCLin.js +0 -25
  77. package/web-dist/assets/code-BmxcCLin.js.map +0 -1
  78. package/web-dist/assets/drafts-CbBiiFKw.js +0 -13
  79. package/web-dist/assets/drafts-CbBiiFKw.js.map +0 -1
  80. package/web-dist/assets/enroll-2bd2qhh1.js +0 -2
  81. package/web-dist/assets/index-5cSRL594.js +0 -11
  82. package/web-dist/assets/index-5cSRL594.js.map +0 -1
  83. package/web-dist/assets/index-f4tQ91xN.css +0 -2
  84. package/web-dist/assets/key-round-DIA3lje5.js +0 -2
  85. package/web-dist/assets/key-round-DIA3lje5.js.map +0 -1
  86. package/web-dist/assets/more-tcGYFcpM.js +0 -2
  87. package/web-dist/assets/pencil-BtK08_f_.js +0 -2
  88. package/web-dist/assets/pencil-BtK08_f_.js.map +0 -1
  89. package/web-dist/assets/preload-helper-dybNq0aL.js +0 -3
  90. package/web-dist/assets/preload-helper-dybNq0aL.js.map +0 -1
  91. package/web-dist/assets/presence-BnGwJNSq.js +0 -2
  92. package/web-dist/assets/presence-BnGwJNSq.js.map +0 -1
  93. package/web-dist/assets/registry-D8Ph1G2W.js +0 -2
  94. package/web-dist/assets/registry-D8Ph1G2W.js.map +0 -1
  95. package/web-dist/assets/settings-DjBmhTW8.js +0 -9
  96. package/web-dist/assets/settings-DjBmhTW8.js.map +0 -1
  97. package/web-dist/assets/states-f12WE0Zx.js +0 -58
  98. package/web-dist/assets/states-f12WE0Zx.js.map +0 -1
  99. package/web-dist/assets/terminal-login-BSJdzvzq.js +0 -2
  100. package/web-dist/assets/useNow-Cul-GfCg.js +0 -2
  101. package/web-dist/assets/useNow-Cul-GfCg.js.map +0 -1
@@ -3,7 +3,7 @@ import { parentPort } from "node:worker_threads";
3
3
  import { Environment } from "@marcbachmann/cel-js";
4
4
 
5
5
  // packages/protocol/dist/adapter-preview.js
6
- import { z as z7 } from "zod";
6
+ import { z as z8 } from "zod";
7
7
 
8
8
  // packages/protocol/dist/contributions.js
9
9
  import { z as z3 } from "zod";
@@ -353,7 +353,7 @@ function contributionSlot(id) {
353
353
  }
354
354
 
355
355
  // packages/protocol/dist/entities.js
356
- import { z as z6 } from "zod";
356
+ import { z as z7 } from "zod";
357
357
 
358
358
  // packages/protocol/dist/github.js
359
359
  import { z as z4 } from "zod";
@@ -903,198 +903,346 @@ var PolicyTestRequest = z5.object({
903
903
  request: PolicyRequestContext.nullable()
904
904
  }).strict().refine((v) => v.phase === "tool_call" ? v.tool !== null && v.request === null : v.tool === null && v.request !== null);
905
905
 
906
- // packages/protocol/dist/entities.js
906
+ // packages/protocol/dist/trackers.js
907
+ import { z as z6 } from "zod";
907
908
  var Iso = z6.string();
908
- var Id4 = z6.string();
909
- var Connectivity = z6.enum(["connected", "reconnecting", "unreachable"]);
910
- var ControlMode = z6.enum(["automation", "human"]);
911
- var Platform = z6.enum(["darwin", "linux"]);
912
- var DeviceKind = z6.enum(["browser", "pwa", "terminal", "cli"]);
913
- var DiagnosticLevel = z6.enum(["info", "warning", "error"]);
909
+ var Id4 = z6.string().min(1);
910
+ var GitHubLogin = z6.string().regex(/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})$/);
911
+ var TrackerStatusOption = z6.object({
912
+ id: z6.string().min(1),
913
+ name: z6.string().min(1).max(200)
914
+ });
915
+ var TrackerBoard = z6.object({
916
+ projectNumber: z6.number().int().positive(),
917
+ statusField: z6.string().min(1).max(100).default("Status"),
918
+ /** Column to move a card to once its worktree exists (write-back). */
919
+ onStart: z6.string().min(1).max(200).nullable().default(null),
920
+ /** Column to move a card to once a pull request is open (write-back). */
921
+ onReview: z6.string().min(1).max(200).nullable().default(null)
922
+ });
923
+ var Tracker = z6.object({
924
+ id: Id4,
925
+ name: z6.string().min(1).max(60),
926
+ provider: z6.literal("github"),
927
+ hostId: Id4,
928
+ owner: GitHubLogin,
929
+ repositories: z6.array(GitHubRepository).min(1).max(50).nullable(),
930
+ /** Repositories outside `owner` that belong to this tracker too (never limited by `repositories`). */
931
+ extraRepositories: z6.array(GitHubRepository).max(20).optional(),
932
+ board: TrackerBoard.nullable(),
933
+ writeBack: z6.boolean(),
934
+ moveShared: z6.boolean(),
935
+ enabled: z6.boolean(),
936
+ /** The host's `gh` user, from the last sync. */
937
+ login: z6.string().nullable(),
938
+ lastSyncedAt: Iso.nullable(),
939
+ lastError: z6.string().max(2e3).nullable(),
940
+ createdAt: Iso,
941
+ updatedAt: Iso
942
+ });
943
+ var TrackerInput = z6.object({
944
+ name: Tracker.shape.name,
945
+ hostId: Id4,
946
+ owner: GitHubLogin,
947
+ repositories: Tracker.shape.repositories.default(null),
948
+ extraRepositories: z6.array(GitHubRepository).max(20).default([]),
949
+ board: TrackerBoard.nullable().default(null),
950
+ writeBack: z6.boolean().default(false),
951
+ moveShared: z6.boolean().default(true),
952
+ enabled: z6.boolean().default(true)
953
+ });
954
+ var TrackerPatch = z6.object({
955
+ name: Tracker.shape.name.optional(),
956
+ hostId: Id4.optional(),
957
+ owner: GitHubLogin.optional(),
958
+ repositories: Tracker.shape.repositories.optional(),
959
+ extraRepositories: z6.array(GitHubRepository).max(20).optional(),
960
+ board: TrackerBoard.nullable().optional(),
961
+ writeBack: z6.boolean().optional(),
962
+ moveShared: z6.boolean().optional(),
963
+ enabled: z6.boolean().optional()
964
+ });
965
+ var TrackerItemBoard = z6.object({
966
+ projectId: z6.string().min(1),
967
+ projectItemId: z6.string().min(1),
968
+ fieldId: z6.string().min(1),
969
+ status: z6.string().nullable(),
970
+ statusOptionId: z6.string().nullable(),
971
+ options: z6.array(TrackerStatusOption).max(50)
972
+ });
973
+ var TrackerPullRequest = z6.object({
974
+ number: z6.number().int().positive(),
975
+ state: z6.enum(["OPEN", "CLOSED", "MERGED"]),
976
+ url: z6.string().url(),
977
+ headRefName: z6.string().min(1).max(255)
978
+ });
979
+ var TrackerItem = z6.object({
980
+ itemId: z6.string().min(1),
981
+ repository: GitHubRepository,
982
+ number: z6.number().int().positive(),
983
+ title: z6.string().min(1).max(1e3),
984
+ url: GitHubIssueUrl,
985
+ assignees: z6.array(z6.string()).max(20),
986
+ branches: z6.array(z6.string().min(1).max(255)).max(10),
987
+ pullRequest: TrackerPullRequest.nullable(),
988
+ board: TrackerItemBoard.nullable()
989
+ });
990
+ var TrackerSyncResult = z6.object({
991
+ login: z6.string().min(1),
992
+ items: z6.array(TrackerItem).max(200),
993
+ truncated: z6.boolean()
994
+ });
995
+ var TaskTracker = z6.object({
996
+ trackerId: Id4,
997
+ itemId: z6.string().min(1),
998
+ repository: GitHubRepository,
999
+ number: z6.number().int().positive(),
1000
+ assignees: z6.array(z6.string()).max(20),
1001
+ branch: z6.string().nullable(),
1002
+ workspaceId: Id4.nullable(),
1003
+ pullRequest: TrackerPullRequest.nullable(),
1004
+ board: TrackerItemBoard.nullable()
1005
+ });
1006
+ var TrackerSetStatusResult = z6.discriminatedUnion("status", [
1007
+ z6.object({ status: z6.literal("moved") }),
1008
+ z6.object({
1009
+ status: z6.literal("skipped"),
1010
+ reason: z6.enum(["not_assigned", "shared", "stale"])
1011
+ })
1012
+ ]);
1013
+ var TrackerStatusRequest = z6.object({ status: z6.string().min(1).max(200) });
1014
+ var TrackerHostSyncRequest = z6.object({
1015
+ owner: GitHubLogin,
1016
+ repositories: z6.array(GitHubRepository).nullable(),
1017
+ board: z6.object({ projectNumber: z6.number().int().positive(), statusField: z6.string().min(1) }).nullable()
1018
+ });
1019
+ var TrackerHostPrepareBranchRequest = z6.object({
1020
+ checkoutPath: z6.string().min(1),
1021
+ branch: z6.string().min(1).max(255)
1022
+ });
1023
+ var TrackerHostStartIssueRequest = z6.object({
1024
+ checkoutPath: z6.string().min(1),
1025
+ repository: GitHubRepository,
1026
+ number: z6.number().int().positive(),
1027
+ branch: z6.string().min(1).max(255),
1028
+ base: z6.string().min(1)
1029
+ });
1030
+ var TrackerHostSetStatusRequest = z6.object({
1031
+ projectId: z6.string().min(1),
1032
+ projectItemId: z6.string().min(1),
1033
+ fieldId: z6.string().min(1),
1034
+ statusField: z6.string().min(1),
1035
+ optionId: z6.string().min(1),
1036
+ expectedOptionId: z6.string().nullable(),
1037
+ login: z6.string().min(1),
1038
+ allowShared: z6.boolean()
1039
+ });
1040
+
1041
+ // packages/protocol/dist/entities.js
1042
+ var Iso2 = z7.string();
1043
+ var Id5 = z7.string();
1044
+ var Connectivity = z7.enum(["connected", "reconnecting", "unreachable"]);
1045
+ var ControlMode = z7.enum(["automation", "human"]);
1046
+ var Platform = z7.enum(["darwin", "linux"]);
1047
+ var DeviceKind = z7.enum(["browser", "pwa", "terminal", "cli"]);
1048
+ var DiagnosticLevel = z7.enum(["info", "warning", "error"]);
914
1049
  var DEFAULT_WORKTREE_DIR = ".worktrees";
915
- var CoreCapabilities = z6.object({
916
- prompt: z6.boolean(),
917
- steer: z6.boolean(),
918
- followUp: z6.boolean(),
919
- abort: z6.boolean(),
920
- resume: z6.boolean(),
921
- rename: z6.boolean(),
922
- importInactive: z6.boolean(),
923
- extensionDialogs: z6.boolean(),
924
- customUi: z6.boolean(),
925
- widgetsText: z6.boolean(),
926
- widgetsComponent: z6.boolean(),
927
- tokenAccounting: z6.boolean(),
928
- costAccounting: z6.boolean()
1050
+ var CoreCapabilities = z7.object({
1051
+ prompt: z7.boolean(),
1052
+ steer: z7.boolean(),
1053
+ followUp: z7.boolean(),
1054
+ abort: z7.boolean(),
1055
+ resume: z7.boolean(),
1056
+ rename: z7.boolean(),
1057
+ importInactive: z7.boolean(),
1058
+ extensionDialogs: z7.boolean(),
1059
+ customUi: z7.boolean(),
1060
+ widgetsText: z7.boolean(),
1061
+ widgetsComponent: z7.boolean(),
1062
+ tokenAccounting: z7.boolean(),
1063
+ costAccounting: z7.boolean()
929
1064
  });
930
1065
  var CAPABILITY_KEYS = CoreCapabilities.keyof().options;
931
1066
  var RuntimeCapabilities = CoreCapabilities.extend({
932
1067
  /** The host runs sessions as interactive Pi in a terminal that clients can attach to. */
933
- terminal: z6.boolean().optional(),
1068
+ terminal: z7.boolean().optional(),
934
1069
  /** The host answers session.models, session.commands, session.setModel, session.setThinking and session.compact. */
935
- sessionControls: z6.boolean().optional(),
1070
+ sessionControls: z7.boolean().optional(),
936
1071
  /** The host answers session.navigate for terminal sessions. */
937
- treeNavigation: z6.boolean().optional(),
938
- agentRequests: z6.boolean().optional(),
939
- messageDelivery: z6.boolean().optional(),
940
- policies: z6.boolean().optional(),
1072
+ treeNavigation: z7.boolean().optional(),
1073
+ agentRequests: z7.boolean().optional(),
1074
+ messageDelivery: z7.boolean().optional(),
1075
+ policies: z7.boolean().optional(),
941
1076
  /** Session-scoped adapter inspection and safe reload. */
942
- adapterDevelopment: z6.boolean().optional(),
943
- unsupported: z6.array(z6.object({ capability: z6.string(), reason: z6.string() }))
1077
+ adapterDevelopment: z7.boolean().optional(),
1078
+ unsupported: z7.array(z7.object({ capability: z7.string(), reason: z7.string() }))
944
1079
  });
945
- var ProjectScan = z6.object({
946
- state: z6.enum(["running", "done", "failed"]),
947
- startedAt: Iso,
948
- finishedAt: Iso.nullable(),
1080
+ var ProjectScan = z7.object({
1081
+ state: z7.enum(["running", "done", "failed"]),
1082
+ startedAt: Iso2,
1083
+ finishedAt: Iso2.nullable(),
949
1084
  /** Repositories found across all folders. */
950
- repositories: z6.number().int(),
1085
+ repositories: z7.number().int(),
951
1086
  /** New projects created by this scan. */
952
- projectsCreated: z6.number().int(),
1087
+ projectsCreated: z7.number().int(),
953
1088
  /** New checkouts (including the ones of new projects). */
954
- checkoutsAdded: z6.number().int(),
1089
+ checkoutsAdded: z7.number().int(),
955
1090
  /** "<folder>: <message>" per folder that failed; for state "failed", the reason last. */
956
- errors: z6.array(z6.string())
957
- });
958
- var UsageWindow = z6.object({
959
- id: z6.enum(["five_hour", "weekly"]),
960
- usedPct: z6.number(),
961
- resetsAt: Iso.nullable()
962
- });
963
- var ProviderUsage = z6.object({
964
- provider: z6.enum(["anthropic", "openai-codex"]),
965
- status: z6.enum(["available", "expired", "rejected", "error"]),
966
- message: z6.string().nullable(),
967
- windows: z6.array(UsageWindow),
968
- fetchedAt: Iso
969
- });
970
- var Host = z6.object({
971
- id: Id4,
972
- name: z6.string(),
1091
+ errors: z7.array(z7.string())
1092
+ });
1093
+ var UsageWindow = z7.object({
1094
+ id: z7.enum(["five_hour", "weekly"]),
1095
+ usedPct: z7.number(),
1096
+ resetsAt: Iso2.nullable()
1097
+ });
1098
+ var ProviderUsage = z7.object({
1099
+ provider: z7.enum(["anthropic", "openai-codex"]),
1100
+ status: z7.enum(["available", "expired", "rejected", "error"]),
1101
+ message: z7.string().nullable(),
1102
+ windows: z7.array(UsageWindow),
1103
+ fetchedAt: Iso2
1104
+ });
1105
+ var Host = z7.object({
1106
+ id: Id5,
1107
+ name: z7.string(),
973
1108
  platform: Platform,
974
- agentVersion: z6.string(),
975
- piVersion: z6.string().nullable(),
976
- piCompatible: z6.boolean(),
1109
+ agentVersion: z7.string(),
1110
+ piVersion: z7.string().nullable(),
1111
+ piCompatible: z7.boolean(),
977
1112
  capabilities: RuntimeCapabilities.nullable(),
978
1113
  connectivity: Connectivity,
979
- lastSeenAt: Iso.nullable(),
980
- revokedAt: Iso.nullable(),
981
- createdAt: Iso,
1114
+ lastSeenAt: Iso2.nullable(),
1115
+ revokedAt: Iso2.nullable(),
1116
+ createdAt: Iso2,
982
1117
  /** Folders on the host whose git repositories become projects (absolute or ~/...). */
983
- projectFolders: z6.array(z6.string()).optional(),
1118
+ projectFolders: z7.array(z7.string()).optional(),
984
1119
  projectScan: ProjectScan.nullable().optional(),
985
1120
  /** Subscription limits (host-reported, refreshed every few minutes). */
986
- usage: z6.array(ProviderUsage).optional(),
1121
+ usage: z7.array(ProviderUsage).optional(),
987
1122
  github: HostGitHub.optional()
988
1123
  });
989
- 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");
990
- var Project = z6.object({
991
- id: Id4,
992
- name: z6.string().min(1),
993
- repoIdentity: z6.string(),
994
- defaultProfileId: Id4.nullable(),
995
- defaultHostId: Id4.nullable(),
996
- maxConcurrentRuns: z6.number().int().min(1).max(32),
997
- automationEnabled: z6.boolean(),
998
- setupCommand: z6.string().nullable(),
999
- checks: z6.array(z6.string()),
1000
- workspaceSharing: z6.enum(["single_writer", "shared"]),
1124
+ 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");
1125
+ var Project = z7.object({
1126
+ id: Id5,
1127
+ name: z7.string().min(1),
1128
+ repoIdentity: z7.string(),
1129
+ defaultProfileId: Id5.nullable(),
1130
+ defaultHostId: Id5.nullable(),
1131
+ maxConcurrentRuns: z7.number().int().min(1).max(32),
1132
+ automationEnabled: z7.boolean(),
1133
+ setupCommand: z7.string().nullable(),
1134
+ checks: z7.array(z7.string()),
1135
+ workspaceSharing: z7.enum(["single_writer", "shared"]),
1001
1136
  worktreeDir: WorktreeDir.default(DEFAULT_WORKTREE_DIR),
1002
- createdAt: Iso,
1003
- updatedAt: Iso
1004
- });
1005
- var Checkout = z6.object({
1006
- id: Id4,
1007
- projectId: Id4,
1008
- hostId: Id4,
1009
- path: z6.string(),
1010
- commonDir: z6.string(),
1011
- defaultBranch: z6.string(),
1012
- createdAt: Iso
1013
- });
1014
- var GitState = z6.object({
1015
- dirty: z6.boolean(),
1016
- changedFiles: z6.number().int(),
1017
- ahead: z6.number().int(),
1018
- behind: z6.number().int(),
1019
- unmerged: z6.boolean()
1020
- });
1021
- var Workspace = z6.object({
1022
- id: Id4,
1023
- checkoutId: Id4,
1024
- projectId: Id4,
1025
- hostId: Id4,
1026
- path: z6.string(),
1027
- branch: z6.string().nullable(),
1028
- baseBranch: z6.string().nullable(),
1029
- provenance: z6.enum(["managed", "discovered", "main"]),
1137
+ /** Start one session in every non-main worktree the first time it appears without one. */
1138
+ ensureSessions: z7.boolean().default(false),
1139
+ /** Archive sessions and remove a worktree (and its local branch) once its PR has merged. */
1140
+ removeLanded: z7.boolean().default(false),
1141
+ createdAt: Iso2,
1142
+ updatedAt: Iso2
1143
+ });
1144
+ var Checkout = z7.object({
1145
+ id: Id5,
1146
+ projectId: Id5,
1147
+ hostId: Id5,
1148
+ path: z7.string(),
1149
+ commonDir: z7.string(),
1150
+ defaultBranch: z7.string(),
1151
+ createdAt: Iso2
1152
+ });
1153
+ var GitState = z7.object({
1154
+ dirty: z7.boolean(),
1155
+ changedFiles: z7.number().int(),
1156
+ ahead: z7.number().int(),
1157
+ behind: z7.number().int(),
1158
+ unmerged: z7.boolean(),
1159
+ /** HEAD commit; absent from older hosts. */
1160
+ head: z7.string().regex(/^[0-9a-f]{40}$/).optional()
1161
+ });
1162
+ var Workspace = z7.object({
1163
+ id: Id5,
1164
+ checkoutId: Id5,
1165
+ projectId: Id5,
1166
+ hostId: Id5,
1167
+ path: z7.string(),
1168
+ branch: z7.string().nullable(),
1169
+ baseBranch: z7.string().nullable(),
1170
+ provenance: z7.enum(["managed", "discovered", "main"]),
1030
1171
  git: GitState,
1031
- setup: z6.object({
1032
- state: z6.enum(["none", "running", "succeeded", "failed"]),
1033
- log: z6.string()
1172
+ setup: z7.object({
1173
+ state: z7.enum(["none", "running", "succeeded", "failed"]),
1174
+ log: z7.string()
1034
1175
  }),
1035
- archivedAt: Iso.nullable(),
1036
- updatedAt: Iso,
1176
+ archivedAt: Iso2.nullable(),
1177
+ updatedAt: Iso2,
1037
1178
  github: WorkspaceGitHub.optional()
1038
1179
  });
1039
- var ThinkingLevel = z6.enum(["off", "minimal", "low", "medium", "high", "xhigh", "max"]);
1040
- var SessionModel = z6.object({
1041
- provider: z6.string(),
1042
- id: z6.string(),
1043
- name: z6.string().nullable(),
1044
- contextWindow: z6.number().nullable(),
1045
- reasoning: z6.boolean(),
1180
+ var ThinkingLevel = z7.enum(["off", "minimal", "low", "medium", "high", "xhigh", "max"]);
1181
+ var SessionModel = z7.object({
1182
+ provider: z7.string(),
1183
+ id: z7.string(),
1184
+ name: z7.string().nullable(),
1185
+ contextWindow: z7.number().nullable(),
1186
+ reasoning: z7.boolean(),
1046
1187
  /** In Pi's scoped (favorite) model list; set only when Pi has one. */
1047
- scoped: z6.boolean().optional(),
1188
+ scoped: z7.boolean().optional(),
1048
1189
  /** Effort levels this model accepts, in Pi's order; ["off"] without reasoning. */
1049
- thinkingLevels: z6.array(ThinkingLevel),
1190
+ thinkingLevels: z7.array(ThinkingLevel),
1050
1191
  /** Prompt-cache lifetimes in seconds from Pi's model metadata. */
1051
- promptCache: z6.object({ short: z6.number().optional(), long: z6.number().optional() }).nullable().optional()
1192
+ promptCache: z7.object({ short: z7.number().optional(), long: z7.number().optional() }).nullable().optional()
1052
1193
  });
1053
- var SlashCommand = z6.object({
1054
- name: z6.string().min(1),
1055
- description: z6.string().nullable(),
1056
- source: z6.enum(["extension", "prompt", "skill"]),
1057
- argumentHint: z6.string().nullable().optional()
1194
+ var SlashCommand = z7.object({
1195
+ name: z7.string().min(1),
1196
+ description: z7.string().nullable(),
1197
+ source: z7.enum(["extension", "prompt", "skill"]),
1198
+ argumentHint: z7.string().nullable().optional()
1058
1199
  });
1059
- var ContextUsage = z6.object({
1200
+ var ContextUsage = z7.object({
1060
1201
  /** Estimated tokens in context; null right after compaction until the next reply. */
1061
- tokens: z6.number().nullable(),
1062
- window: z6.number(),
1063
- percent: z6.number().nullable()
1202
+ tokens: z7.number().nullable(),
1203
+ window: z7.number(),
1204
+ percent: z7.number().nullable()
1064
1205
  });
1065
1206
  var FORBIDDEN_EXTRA_ARGS = ["--mode", "--fork", "--no-session", "-e", "--extension"];
1066
- 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");
1067
- var Profile = z6.object({
1068
- id: Id4,
1069
- name: z6.string().min(1),
1070
- provider: z6.string().nullable(),
1071
- model: z6.string().nullable(),
1207
+ 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");
1208
+ var Profile = z7.object({
1209
+ id: Id5,
1210
+ name: z7.string().min(1),
1211
+ provider: z7.string().nullable(),
1212
+ model: z7.string().nullable(),
1072
1213
  thinking: ThinkingLevel.nullable(),
1073
- projectTrust: z6.enum(["ask", "approve", "ignore"]),
1074
- extraArgs: z6.array(ExtraArg),
1214
+ projectTrust: z7.enum(["ask", "approve", "ignore"]),
1215
+ extraArgs: z7.array(ExtraArg),
1075
1216
  /** "vanilla": --no-extensions --no-skills --no-prompt-templates. Undefined means "all". */
1076
- resources: z6.enum(["all", "vanilla"]).optional()
1217
+ resources: z7.enum(["all", "vanilla"]).optional()
1077
1218
  });
1078
- var ViewClient = z6.object({
1219
+ var ViewClient = z7.object({
1079
1220
  /** `${kind}:${name}@${machine}` */
1080
- id: z6.string().min(1),
1081
- kind: z6.enum(["herdr", "tmux"]),
1082
- name: z6.string().min(1),
1083
- machine: z6.string().min(1),
1084
- lastSeenAt: Iso
1085
- });
1086
- var View = z6.object({
1087
- id: Id4,
1088
- name: z6.string().min(1).max(60),
1089
- mode: z6.enum(["all", "pinned"]),
1090
- projectIds: z6.array(z6.string()).nullable(),
1091
- hostIds: z6.array(z6.string()).nullable(),
1092
- sessionIds: z6.array(z6.string()),
1093
- clients: z6.array(ViewClient),
1094
- createdAt: Iso,
1095
- updatedAt: Iso
1221
+ id: z7.string().min(1),
1222
+ kind: z7.enum(["herdr", "tmux"]),
1223
+ name: z7.string().min(1),
1224
+ machine: z7.string().min(1),
1225
+ lastSeenAt: Iso2
1226
+ });
1227
+ var View = z7.object({
1228
+ id: Id5,
1229
+ name: z7.string().min(1).max(60),
1230
+ mode: z7.enum(["all", "pinned"]),
1231
+ projectIds: z7.array(z7.string()).nullable(),
1232
+ hostIds: z7.array(z7.string()).nullable(),
1233
+ sessionIds: z7.array(z7.string()),
1234
+ clients: z7.array(ViewClient),
1235
+ /** A tracker keeps this view's projects (see docs/trackers.md). */
1236
+ trackerId: z7.string().nullable().optional(),
1237
+ /**
1238
+ * A client as membership authority: sessions enrolled from this client (`ViewClient` id,
1239
+ * `herdr:<session>@<machine>`) are pinned here when they first appear.
1240
+ */
1241
+ clientId: z7.string().min(1).max(200).nullable().optional(),
1242
+ createdAt: Iso2,
1243
+ updatedAt: Iso2
1096
1244
  });
1097
- var RuntimeState = z6.enum([
1245
+ var RuntimeState = z7.enum([
1098
1246
  "starting",
1099
1247
  "idle",
1100
1248
  "running",
@@ -1103,143 +1251,150 @@ var RuntimeState = z6.enum([
1103
1251
  "failed",
1104
1252
  "stopped"
1105
1253
  ]);
1106
- var NativeHandle = z6.object({ sessionId: z6.string(), sessionFile: z6.string() });
1107
- var SessionStats = z6.object({
1108
- tokens: z6.number().nullable(),
1109
- costUsd: z6.number().nullable(),
1254
+ var NativeHandle = z7.object({ sessionId: z7.string(), sessionFile: z7.string() });
1255
+ var SessionStats = z7.object({
1256
+ tokens: z7.number().nullable(),
1257
+ costUsd: z7.number().nullable(),
1110
1258
  /** Completed usage, refreshed for this exact settlement; absent on older hosts or failure. */
1111
1259
  watermark: CompletedUsageWatermark.optional(),
1112
1260
  context: ContextUsage.nullable().optional()
1113
1261
  });
1114
- var PromptCacheInfo = z6.object({
1115
- at: Iso,
1116
- provider: z6.string(),
1117
- model: z6.string(),
1118
- cacheRead: z6.number(),
1119
- cacheWrite: z6.number(),
1120
- cacheWrite1h: z6.number()
1121
- });
1122
- var Session = z6.object({
1123
- id: Id4,
1124
- title: z6.string(),
1125
- subtitle: z6.string().nullable(),
1126
- hostId: Id4,
1127
- workspaceId: Id4.nullable(),
1128
- projectId: Id4.nullable(),
1129
- cwd: z6.string(),
1262
+ var PromptCacheInfo = z7.object({
1263
+ at: Iso2,
1264
+ provider: z7.string(),
1265
+ model: z7.string(),
1266
+ cacheRead: z7.number(),
1267
+ cacheWrite: z7.number(),
1268
+ cacheWrite1h: z7.number()
1269
+ });
1270
+ var Session = z7.object({
1271
+ id: Id5,
1272
+ title: z7.string(),
1273
+ subtitle: z7.string().nullable(),
1274
+ hostId: Id5,
1275
+ workspaceId: Id5.nullable(),
1276
+ projectId: Id5.nullable(),
1277
+ cwd: z7.string(),
1130
1278
  nativeHandle: NativeHandle.nullable(),
1131
1279
  profileSnapshot: Profile,
1132
1280
  runtime: RuntimeState,
1133
- runtimeDetail: z6.string().nullable(),
1281
+ runtimeDetail: z7.string().nullable(),
1134
1282
  connectivity: Connectivity,
1135
- runId: Id4.nullable(),
1136
- taskId: Id4.nullable(),
1137
- provenance: z6.enum(["created", "imported", "subagent"]),
1138
- readOnly: z6.boolean(),
1139
- lastActivityAt: Iso,
1140
- archivedAt: Iso.nullable(),
1141
- queue: z6.object({ steering: z6.array(z6.string()), followUp: z6.array(z6.string()) }),
1283
+ runId: Id5.nullable(),
1284
+ taskId: Id5.nullable(),
1285
+ provenance: z7.enum(["created", "imported", "subagent"]),
1286
+ readOnly: z7.boolean(),
1287
+ lastActivityAt: Iso2,
1288
+ archivedAt: Iso2.nullable(),
1289
+ queue: z7.object({ steering: z7.array(z7.string()), followUp: z7.array(z7.string()) }),
1142
1290
  stats: SessionStats.nullable(),
1143
1291
  /** The live model (host-owned; last known when stopped). */
1144
1292
  model: SessionModel.nullable().optional(),
1145
1293
  /** The live effort (Pi's thinking level). */
1146
1294
  thinking: ThinkingLevel.nullable().optional(),
1147
1295
  /** Pi is compacting the context. */
1148
- compacting: z6.boolean().optional(),
1149
- lastAssistantText: z6.string().nullable(),
1150
- createdAt: Iso,
1296
+ compacting: z7.boolean().optional(),
1297
+ lastAssistantText: z7.string().nullable(),
1298
+ createdAt: Iso2,
1151
1299
  /** A live terminal session: `switchyard tui` can attach to its Pi terminal. */
1152
- terminal: z6.boolean().optional(),
1300
+ terminal: z7.boolean().optional(),
1301
+ /**
1302
+ * A Pi the user started in their own terminal and enrolled (`client`: the herdr session it runs
1303
+ * in, when known). Switchyard never shows or closes that terminal.
1304
+ */
1305
+ external: z7.object({ client: z7.string().min(1).max(200).nullable() }).nullable().optional(),
1153
1306
  /** Set when the session finished or failed with nobody viewing it; cleared when viewed (coordinator-owned). */
1154
- unreadSince: Iso.nullable().optional(),
1307
+ unreadSince: Iso2.nullable().optional(),
1155
1308
  /** Identity of the adapter presentation currently installed on the host. */
1156
- adapterGeneration: z6.string().uuid().optional(),
1309
+ adapterGeneration: z7.string().uuid().optional(),
1157
1310
  /** Bumped when the transcript is rebuilt (rewind); clients drop cached copies (coordinator-owned). */
1158
- transcriptEpoch: z6.number().int().min(0).optional(),
1159
- bridge: z6.object({
1160
- version: z6.literal(1),
1161
- runtimeId: Id4,
1162
- nativeSessionId: Id4,
1311
+ transcriptEpoch: z7.number().int().min(0).optional(),
1312
+ bridge: z7.object({
1313
+ version: z7.literal(1),
1314
+ runtimeId: Id5,
1315
+ nativeSessionId: Id5,
1163
1316
  /** Host-generated local-controller identity, not Pi's private binding credential. */
1164
- controllerEpoch: Id4.optional(),
1165
- agentTools: z6.boolean(),
1166
- messageDelivery: z6.boolean(),
1167
- policyState: z6.enum(["initializing", "active", "unsupported", "lost"]),
1168
- policyPhases: z6.array(PolicyPhase)
1317
+ controllerEpoch: Id5.optional(),
1318
+ agentTools: z7.boolean(),
1319
+ messageDelivery: z7.boolean(),
1320
+ policyState: z7.enum(["initializing", "active", "unsupported", "lost"]),
1321
+ policyPhases: z7.array(PolicyPhase)
1169
1322
  }).optional(),
1170
1323
  /** Last assistant message's cache usage (host-owned). */
1171
1324
  promptCache: PromptCacheInfo.nullable().optional(),
1172
1325
  /** Warn before the prompt cache expires; non-null means on (coordinator-owned). */
1173
- cacheAlert: z6.object({ ttlSec: z6.number().int().min(60).max(86400).nullable(), warnedFor: Iso.nullable() }).nullable().optional()
1326
+ cacheAlert: z7.object({ ttlSec: z7.number().int().min(60).max(86400).nullable(), warnedFor: Iso2.nullable() }).nullable().optional()
1174
1327
  });
1175
- var ContinuationPolicy = z6.discriminatedUnion("enabled", [
1176
- z6.object({ enabled: z6.literal(false) }),
1177
- z6.object({
1178
- enabled: z6.literal(true),
1179
- objective: z6.string().min(1),
1180
- maxContinuations: z6.number().int().min(1).max(50),
1181
- maxElapsedMinutes: z6.number().int().min(1).max(1440),
1182
- maxTokens: z6.number().int().positive().nullable(),
1183
- maxCostUsd: z6.number().positive().nullable()
1328
+ var ContinuationPolicy = z7.discriminatedUnion("enabled", [
1329
+ z7.object({ enabled: z7.literal(false) }),
1330
+ z7.object({
1331
+ enabled: z7.literal(true),
1332
+ objective: z7.string().min(1),
1333
+ maxContinuations: z7.number().int().min(1).max(50),
1334
+ maxElapsedMinutes: z7.number().int().min(1).max(1440),
1335
+ maxTokens: z7.number().int().positive().nullable(),
1336
+ maxCostUsd: z7.number().positive().nullable()
1184
1337
  })
1185
1338
  ]);
1186
- var CompletionPolicy = z6.object({
1187
- checks: z6.array(z6.string()).nullable(),
1188
- requireHumanReview: z6.boolean()
1339
+ var CompletionPolicy = z7.object({
1340
+ checks: z7.array(z7.string()).nullable(),
1341
+ requireHumanReview: z7.boolean()
1189
1342
  });
1190
- var WorkspacePolicy = z6.discriminatedUnion("mode", [
1191
- z6.object({
1192
- mode: z6.literal("new_worktree"),
1193
- branch: z6.string().nullable(),
1194
- base: z6.string().nullable()
1343
+ var WorkspacePolicy = z7.discriminatedUnion("mode", [
1344
+ z7.object({
1345
+ mode: z7.literal("new_worktree"),
1346
+ branch: z7.string().nullable(),
1347
+ base: z7.string().nullable()
1195
1348
  }),
1196
- z6.object({ mode: z6.literal("existing"), workspaceId: Id4 })
1349
+ z7.object({ mode: z7.literal("existing"), workspaceId: Id5 })
1197
1350
  ]);
1198
- var TaskPolicy = z6.object({
1199
- hostId: Id4.nullable(),
1200
- profileId: Id4.nullable(),
1351
+ var TaskPolicy = z7.object({
1352
+ hostId: Id5.nullable(),
1353
+ profileId: Id5.nullable(),
1201
1354
  workspace: WorkspacePolicy,
1202
1355
  continuation: ContinuationPolicy,
1203
1356
  completion: CompletionPolicy
1204
1357
  });
1205
- var TaskState = z6.enum(["backlog", "ready", "in_progress", "review", "done", "canceled"]);
1206
- var Priority = z6.union([z6.literal(0), z6.literal(1), z6.literal(2), z6.literal(3)]);
1207
- var TaskOrigin = z6.discriminatedUnion("kind", [
1208
- z6.object({ kind: z6.literal("manual") }),
1209
- z6.object({
1210
- kind: z6.literal("automation"),
1211
- automationId: Id4,
1212
- occurrenceId: Id4,
1213
- routine: z6.boolean()
1358
+ var TaskState = z7.enum(["backlog", "ready", "in_progress", "review", "done", "canceled"]);
1359
+ var Priority = z7.union([z7.literal(0), z7.literal(1), z7.literal(2), z7.literal(3)]);
1360
+ var TaskOrigin = z7.discriminatedUnion("kind", [
1361
+ z7.object({ kind: z7.literal("manual") }),
1362
+ z7.object({
1363
+ kind: z7.literal("automation"),
1364
+ automationId: Id5,
1365
+ occurrenceId: Id5,
1366
+ routine: z7.boolean()
1214
1367
  })
1215
1368
  ]);
1216
- var Task = z6.object({
1217
- id: Id4,
1218
- projectId: Id4,
1219
- title: z6.string().min(1),
1220
- objective: z6.string(),
1221
- acceptanceCriteria: z6.array(z6.string()),
1222
- dependencies: z6.array(Id4),
1369
+ var Task = z7.object({
1370
+ id: Id5,
1371
+ projectId: Id5,
1372
+ title: z7.string().min(1),
1373
+ objective: z7.string(),
1374
+ acceptanceCriteria: z7.array(z7.string()),
1375
+ dependencies: z7.array(Id5),
1223
1376
  priority: Priority,
1224
- position: z6.number(),
1377
+ position: z7.number(),
1225
1378
  state: TaskState,
1226
- blocked: z6.object({ reason: z6.string() }).nullable(),
1227
- notBefore: Iso.nullable(),
1379
+ blocked: z7.object({ reason: z7.string() }).nullable(),
1380
+ notBefore: Iso2.nullable(),
1228
1381
  policy: TaskPolicy,
1229
1382
  origin: TaskOrigin,
1230
- groupingKey: z6.string().nullable(),
1231
- parentTaskId: Id4.nullable().optional(),
1232
- agentOrigin: z6.object({ sessionId: Id4, toolCallId: Id4 }).optional(),
1383
+ groupingKey: z7.string().nullable(),
1384
+ parentTaskId: Id5.nullable().optional(),
1385
+ agentOrigin: z7.object({ sessionId: Id5, toolCallId: Id5 }).optional(),
1233
1386
  githubIssue: GitHubIssue.optional(),
1234
- currentRunId: Id4.nullable(),
1235
- sessionId: Id4.nullable(),
1236
- review: z6.object({ feedback: z6.array(z6.string()), changesRequested: z6.boolean() }),
1237
- hiddenFromBoard: z6.boolean(),
1238
- lastActivityAt: Iso,
1239
- createdAt: Iso,
1240
- updatedAt: Iso
1241
- });
1242
- var RunState = z6.enum([
1387
+ /** Set while a tracker owns this task (server-owned). */
1388
+ tracker: TaskTracker.optional(),
1389
+ currentRunId: Id5.nullable(),
1390
+ sessionId: Id5.nullable(),
1391
+ review: z7.object({ feedback: z7.array(z7.string()), changesRequested: z7.boolean() }),
1392
+ hiddenFromBoard: z7.boolean(),
1393
+ lastActivityAt: Iso2,
1394
+ createdAt: Iso2,
1395
+ updatedAt: Iso2
1396
+ });
1397
+ var RunState = z7.enum([
1243
1398
  "queued",
1244
1399
  "dispatching",
1245
1400
  "uncertain",
@@ -1251,79 +1406,79 @@ var RunState = z6.enum([
1251
1406
  "interrupted",
1252
1407
  "canceled"
1253
1408
  ]);
1254
- var CheckResult = z6.object({
1255
- command: z6.string(),
1256
- exitCode: z6.number().int().nullable(),
1257
- outputTail: z6.string()
1258
- });
1259
- var Run = z6.object({
1260
- id: Id4,
1261
- taskId: Id4,
1262
- sessionId: Id4.nullable(),
1263
- hostId: Id4.nullable(),
1264
- dispatchKey: z6.string(),
1265
- attempt: z6.number().int().min(1),
1409
+ var CheckResult = z7.object({
1410
+ command: z7.string(),
1411
+ exitCode: z7.number().int().nullable(),
1412
+ outputTail: z7.string()
1413
+ });
1414
+ var Run = z7.object({
1415
+ id: Id5,
1416
+ taskId: Id5,
1417
+ sessionId: Id5.nullable(),
1418
+ hostId: Id5.nullable(),
1419
+ dispatchKey: z7.string(),
1420
+ attempt: z7.number().int().min(1),
1266
1421
  state: RunState,
1267
1422
  controlMode: ControlMode,
1268
- controlRevision: z6.number().int().min(1),
1269
- continuationsUsed: z6.number().int().min(0),
1270
- infraRetries: z6.number().int().min(0),
1271
- nextAttemptAt: Iso.nullable(),
1272
- startedAt: Iso.nullable(),
1273
- endedAt: Iso.nullable(),
1274
- outcome: z6.object({
1275
- kind: z6.enum(["review", "failed", "blocked", "no_change", "canceled"]),
1276
- summary: z6.string()
1423
+ controlRevision: z7.number().int().min(1),
1424
+ continuationsUsed: z7.number().int().min(0),
1425
+ infraRetries: z7.number().int().min(0),
1426
+ nextAttemptAt: Iso2.nullable(),
1427
+ startedAt: Iso2.nullable(),
1428
+ endedAt: Iso2.nullable(),
1429
+ outcome: z7.object({
1430
+ kind: z7.enum(["review", "failed", "blocked", "no_change", "canceled"]),
1431
+ summary: z7.string()
1277
1432
  }).nullable(),
1278
1433
  limits: ContinuationPolicy,
1279
- usage: z6.object({
1280
- tokens: z6.number().nullable(),
1281
- costUsd: z6.number().nullable(),
1282
- accounting: z6.enum(["available", "unavailable"]),
1283
- note: z6.string().nullable()
1434
+ usage: z7.object({
1435
+ tokens: z7.number().nullable(),
1436
+ costUsd: z7.number().nullable(),
1437
+ accounting: z7.enum(["available", "unavailable"]),
1438
+ note: z7.string().nullable()
1284
1439
  }),
1285
- checks: z6.array(CheckResult),
1286
- createdAt: Iso,
1287
- updatedAt: Iso
1288
- });
1289
- var Trigger = z6.discriminatedUnion("kind", [
1290
- z6.object({ kind: z6.literal("manual") }),
1291
- z6.object({ kind: z6.literal("once"), at: Iso }),
1292
- z6.object({ kind: z6.literal("cron"), expr: z6.string().min(1), timezone: z6.string().min(1) }),
1293
- z6.object({ kind: z6.literal("webhook") }),
1294
- z6.object({ kind: z6.literal("dependency"), taskId: Id4 })
1440
+ checks: z7.array(CheckResult),
1441
+ createdAt: Iso2,
1442
+ updatedAt: Iso2
1443
+ });
1444
+ var Trigger = z7.discriminatedUnion("kind", [
1445
+ z7.object({ kind: z7.literal("manual") }),
1446
+ z7.object({ kind: z7.literal("once"), at: Iso2 }),
1447
+ z7.object({ kind: z7.literal("cron"), expr: z7.string().min(1), timezone: z7.string().min(1) }),
1448
+ z7.object({ kind: z7.literal("webhook") }),
1449
+ z7.object({ kind: z7.literal("dependency"), taskId: Id5 })
1295
1450
  ]);
1296
- var TaskTemplate = z6.object({
1297
- title: z6.string().min(1),
1298
- objective: z6.string(),
1299
- acceptanceCriteria: z6.array(z6.string()),
1451
+ var TaskTemplate = z7.object({
1452
+ title: z7.string().min(1),
1453
+ objective: z7.string(),
1454
+ acceptanceCriteria: z7.array(z7.string()),
1300
1455
  priority: Priority
1301
1456
  });
1302
- var Automation = z6.object({
1303
- id: Id4,
1304
- name: z6.string().min(1),
1305
- enabled: z6.boolean(),
1306
- projectId: Id4,
1457
+ var Automation = z7.object({
1458
+ id: Id5,
1459
+ name: z7.string().min(1),
1460
+ enabled: z7.boolean(),
1461
+ projectId: Id5,
1307
1462
  trigger: Trigger,
1308
- filters: z6.array(z6.object({ path: z6.string(), equals: z6.string() })),
1463
+ filters: z7.array(z7.object({ path: z7.string(), equals: z7.string() })),
1309
1464
  template: TaskTemplate,
1310
- hostId: Id4.nullable(),
1311
- profileId: Id4.nullable(),
1312
- mode: z6.enum(["fresh", "continue", "watch"]),
1313
- groupingKey: z6.string().nullable(),
1314
- overlap: z6.enum(["skip", "queue_one", "append"]),
1315
- missed: z6.enum(["skip", "run_once"]),
1465
+ hostId: Id5.nullable(),
1466
+ profileId: Id5.nullable(),
1467
+ mode: z7.enum(["fresh", "continue", "watch"]),
1468
+ groupingKey: z7.string().nullable(),
1469
+ overlap: z7.enum(["skip", "queue_one", "append"]),
1470
+ missed: z7.enum(["skip", "run_once"]),
1316
1471
  continuation: ContinuationPolicy,
1317
1472
  completion: CompletionPolicy,
1318
- nextAt: Iso.nullable(),
1319
- lastEvaluatedAt: Iso.nullable(),
1320
- lastOutcome: z6.string().nullable(),
1321
- failureCount: z6.number().int().min(0),
1322
- webhookTokenSet: z6.boolean(),
1323
- createdAt: Iso,
1324
- updatedAt: Iso
1325
- });
1326
- var OccurrenceState = z6.enum([
1473
+ nextAt: Iso2.nullable(),
1474
+ lastEvaluatedAt: Iso2.nullable(),
1475
+ lastOutcome: z7.string().nullable(),
1476
+ failureCount: z7.number().int().min(0),
1477
+ webhookTokenSet: z7.boolean(),
1478
+ createdAt: Iso2,
1479
+ updatedAt: Iso2
1480
+ });
1481
+ var OccurrenceState = z7.enum([
1327
1482
  "fired",
1328
1483
  "skipped_overlap",
1329
1484
  "skipped_missed",
@@ -1332,39 +1487,39 @@ var OccurrenceState = z6.enum([
1332
1487
  "failed",
1333
1488
  "filtered"
1334
1489
  ]);
1335
- var Occurrence = z6.object({
1336
- id: Id4,
1337
- automationId: Id4,
1338
- key: z6.string(),
1339
- scheduledFor: Iso.nullable(),
1490
+ var Occurrence = z7.object({
1491
+ id: Id5,
1492
+ automationId: Id5,
1493
+ key: z7.string(),
1494
+ scheduledFor: Iso2.nullable(),
1340
1495
  state: OccurrenceState,
1341
- taskId: Id4.nullable(),
1342
- reason: z6.string().nullable(),
1343
- outcome: z6.string().nullable(),
1344
- createdAt: Iso
1345
- });
1346
- var InteractionState = z6.preprocess((v) => v === "cancelled" ? "canceled" : v, z6.enum(["pending", "resolved", "expired", "canceled", "unsupported"]));
1347
- var Interaction = z6.object({
1348
- id: Id4,
1349
- sessionId: Id4,
1350
- revision: z6.number().int().min(1),
1351
- source: z6.discriminatedUnion("kind", [
1352
- z6.object({
1353
- kind: z6.literal("extension_ui"),
1354
- method: z6.enum(["select", "confirm", "input", "editor"]),
1355
- piRequestIds: z6.array(z6.string())
1496
+ taskId: Id5.nullable(),
1497
+ reason: z7.string().nullable(),
1498
+ outcome: z7.string().nullable(),
1499
+ createdAt: Iso2
1500
+ });
1501
+ var InteractionState = z7.preprocess((v) => v === "cancelled" ? "canceled" : v, z7.enum(["pending", "resolved", "expired", "canceled", "unsupported"]));
1502
+ var Interaction = z7.object({
1503
+ id: Id5,
1504
+ sessionId: Id5,
1505
+ revision: z7.number().int().min(1),
1506
+ source: z7.discriminatedUnion("kind", [
1507
+ z7.object({
1508
+ kind: z7.literal("extension_ui"),
1509
+ method: z7.enum(["select", "confirm", "input", "editor"]),
1510
+ piRequestIds: z7.array(z7.string())
1356
1511
  }),
1357
- z6.object({ kind: z6.literal("unsupported_custom"), title: z6.string().nullable() })
1512
+ z7.object({ kind: z7.literal("unsupported_custom"), title: z7.string().nullable() })
1358
1513
  ]),
1359
- adapterId: z6.string().nullable(),
1514
+ adapterId: z7.string().nullable(),
1360
1515
  permission: PolicyPermission.optional(),
1361
- title: z6.string(),
1516
+ title: z7.string(),
1362
1517
  presentation: UINodeSchema,
1363
1518
  state: InteractionState,
1364
- resolution: z6.object({ by: z6.string(), summary: z6.string(), at: Iso }).nullable(),
1365
- createdAt: Iso
1519
+ resolution: z7.object({ by: z7.string(), summary: z7.string(), at: Iso2 }).nullable(),
1520
+ createdAt: Iso2
1366
1521
  });
1367
- var AttentionReason = z6.enum([
1522
+ var AttentionReason = z7.enum([
1368
1523
  "needs_input",
1369
1524
  "failed",
1370
1525
  "ready_for_review",
@@ -1372,171 +1527,171 @@ var AttentionReason = z6.enum([
1372
1527
  "host_unreachable",
1373
1528
  "cache_expiring"
1374
1529
  ]);
1375
- var AttentionItem = z6.object({
1376
- id: Id4,
1377
- sessionId: Id4.nullable(),
1378
- taskId: Id4.nullable(),
1379
- projectId: Id4.nullable(),
1530
+ var AttentionItem = z7.object({
1531
+ id: Id5,
1532
+ sessionId: Id5.nullable(),
1533
+ taskId: Id5.nullable(),
1534
+ projectId: Id5.nullable(),
1380
1535
  reason: AttentionReason,
1381
- severity: z6.enum(["info", "warning", "critical"]),
1382
- summary: z6.string(),
1383
- interactionId: Id4.nullable(),
1384
- deepLink: z6.string(),
1385
- acknowledgedAt: Iso.nullable(),
1386
- resolvedAt: Iso.nullable(),
1387
- createdAt: Iso
1388
- });
1389
- var Device = z6.object({
1390
- id: Id4,
1391
- name: z6.string(),
1536
+ severity: z7.enum(["info", "warning", "critical"]),
1537
+ summary: z7.string(),
1538
+ interactionId: Id5.nullable(),
1539
+ deepLink: z7.string(),
1540
+ acknowledgedAt: Iso2.nullable(),
1541
+ resolvedAt: Iso2.nullable(),
1542
+ createdAt: Iso2
1543
+ });
1544
+ var Device = z7.object({
1545
+ id: Id5,
1546
+ name: z7.string(),
1392
1547
  kind: DeviceKind,
1393
- createdAt: Iso,
1394
- lastSeenAt: Iso.nullable(),
1395
- revokedAt: Iso.nullable(),
1396
- push: z6.object({
1397
- subscribed: z6.boolean(),
1398
- permission: z6.enum(["granted", "denied", "default", "unknown"])
1548
+ createdAt: Iso2,
1549
+ lastSeenAt: Iso2.nullable(),
1550
+ revokedAt: Iso2.nullable(),
1551
+ push: z7.object({
1552
+ subscribed: z7.boolean(),
1553
+ permission: z7.enum(["granted", "denied", "default", "unknown"])
1399
1554
  }),
1400
- preferredMobile: z6.boolean(),
1401
- enrolledVia: z6.enum(["enrollment", "passkey", "oidc", "admin", "approval"]).default("enrollment")
1402
- });
1403
- var ToolItemData = z6.object({
1404
- toolCallId: z6.string(),
1405
- name: z6.string(),
1406
- status: z6.enum(["running", "ok", "error"]),
1407
- args: z6.unknown(),
1408
- summary: z6.string(),
1409
- output: z6.string(),
1410
- startedAt: Iso,
1411
- durationMs: z6.number().nullable(),
1555
+ preferredMobile: z7.boolean(),
1556
+ enrolledVia: z7.enum(["enrollment", "passkey", "oidc", "admin", "approval"]).default("enrollment")
1557
+ });
1558
+ var ToolItemData = z7.object({
1559
+ toolCallId: z7.string(),
1560
+ name: z7.string(),
1561
+ status: z7.enum(["running", "ok", "error"]),
1562
+ args: z7.unknown(),
1563
+ summary: z7.string(),
1564
+ output: z7.string(),
1565
+ startedAt: Iso2,
1566
+ durationMs: z7.number().nullable(),
1412
1567
  card: UINodeSchema.nullable(),
1413
- adapterId: z6.string().nullable(),
1414
- adapterGeneration: z6.string().uuid().optional()
1568
+ adapterId: z7.string().nullable(),
1569
+ adapterGeneration: z7.string().uuid().optional()
1415
1570
  });
1416
- var TranscriptItem = z6.discriminatedUnion("kind", [
1417
- z6.object({
1418
- id: Id4,
1419
- sessionId: Id4,
1420
- order: z6.number().int(),
1421
- at: Iso,
1422
- kind: z6.literal("user"),
1423
- data: z6.object({
1424
- text: z6.string(),
1425
- images: z6.number().int().optional(),
1571
+ var TranscriptItem = z7.discriminatedUnion("kind", [
1572
+ z7.object({
1573
+ id: Id5,
1574
+ sessionId: Id5,
1575
+ order: z7.number().int(),
1576
+ at: Iso2,
1577
+ kind: z7.literal("user"),
1578
+ data: z7.object({
1579
+ text: z7.string(),
1580
+ images: z7.number().int().optional(),
1426
1581
  /** Pi session entry id, for rewind and fork from this message. */
1427
- entryId: z6.string().optional()
1582
+ entryId: z7.string().optional()
1428
1583
  })
1429
1584
  }),
1430
- z6.object({
1431
- id: Id4,
1432
- sessionId: Id4,
1433
- order: z6.number().int(),
1434
- at: Iso,
1435
- kind: z6.literal("assistant"),
1436
- data: z6.object({ text: z6.string(), streaming: z6.boolean().optional() })
1585
+ z7.object({
1586
+ id: Id5,
1587
+ sessionId: Id5,
1588
+ order: z7.number().int(),
1589
+ at: Iso2,
1590
+ kind: z7.literal("assistant"),
1591
+ data: z7.object({ text: z7.string(), streaming: z7.boolean().optional() })
1437
1592
  }),
1438
- z6.object({
1439
- id: Id4,
1440
- sessionId: Id4,
1441
- order: z6.number().int(),
1442
- at: Iso,
1443
- kind: z6.literal("thinking"),
1444
- data: z6.object({ text: z6.string() })
1593
+ z7.object({
1594
+ id: Id5,
1595
+ sessionId: Id5,
1596
+ order: z7.number().int(),
1597
+ at: Iso2,
1598
+ kind: z7.literal("thinking"),
1599
+ data: z7.object({ text: z7.string() })
1445
1600
  }),
1446
- z6.object({
1447
- id: Id4,
1448
- sessionId: Id4,
1449
- order: z6.number().int(),
1450
- at: Iso,
1451
- kind: z6.literal("tool"),
1601
+ z7.object({
1602
+ id: Id5,
1603
+ sessionId: Id5,
1604
+ order: z7.number().int(),
1605
+ at: Iso2,
1606
+ kind: z7.literal("tool"),
1452
1607
  data: ToolItemData
1453
1608
  }),
1454
- z6.object({
1455
- id: Id4,
1456
- sessionId: Id4,
1457
- order: z6.number().int(),
1458
- at: Iso,
1459
- kind: z6.literal("notice"),
1460
- data: z6.object({
1609
+ z7.object({
1610
+ id: Id5,
1611
+ sessionId: Id5,
1612
+ order: z7.number().int(),
1613
+ at: Iso2,
1614
+ kind: z7.literal("notice"),
1615
+ data: z7.object({
1461
1616
  level: DiagnosticLevel,
1462
- text: z6.string(),
1463
- customType: z6.string().min(1).max(200).optional(),
1617
+ text: z7.string(),
1618
+ customType: z7.string().min(1).max(200).optional(),
1464
1619
  card: UINodeSchema.optional(),
1465
- adapterId: z6.string().optional(),
1466
- adapterGeneration: z6.string().uuid().optional()
1620
+ adapterId: z7.string().optional(),
1621
+ adapterGeneration: z7.string().uuid().optional()
1467
1622
  }).refine((data) => !data.card || !!data.adapterId, "Card requires adapterId")
1468
1623
  }),
1469
- z6.object({
1470
- id: Id4,
1471
- sessionId: Id4,
1472
- order: z6.number().int(),
1473
- at: Iso,
1474
- kind: z6.literal("interaction"),
1475
- data: z6.object({ interactionId: Id4 })
1624
+ z7.object({
1625
+ id: Id5,
1626
+ sessionId: Id5,
1627
+ order: z7.number().int(),
1628
+ at: Iso2,
1629
+ kind: z7.literal("interaction"),
1630
+ data: z7.object({ interactionId: Id5 })
1476
1631
  }),
1477
- z6.object({
1478
- id: Id4,
1479
- sessionId: Id4,
1480
- order: z6.number().int(),
1481
- at: Iso,
1482
- kind: z6.literal("subagent"),
1483
- data: z6.object({
1484
- runId: z6.string(),
1485
- label: z6.string(),
1486
- status: z6.string(),
1487
- sessionFile: z6.string().nullable(),
1488
- linkedSessionId: Id4.nullable()
1632
+ z7.object({
1633
+ id: Id5,
1634
+ sessionId: Id5,
1635
+ order: z7.number().int(),
1636
+ at: Iso2,
1637
+ kind: z7.literal("subagent"),
1638
+ data: z7.object({
1639
+ runId: z7.string(),
1640
+ label: z7.string(),
1641
+ status: z7.string(),
1642
+ sessionFile: z7.string().nullable(),
1643
+ linkedSessionId: Id5.nullable()
1489
1644
  })
1490
1645
  }),
1491
- z6.object({
1492
- id: Id4,
1493
- sessionId: Id4,
1494
- order: z6.number().int(),
1495
- at: Iso,
1496
- kind: z6.literal("system"),
1497
- data: z6.object({ text: z6.string(), suggestion: z6.boolean().optional() })
1646
+ z7.object({
1647
+ id: Id5,
1648
+ sessionId: Id5,
1649
+ order: z7.number().int(),
1650
+ at: Iso2,
1651
+ kind: z7.literal("system"),
1652
+ data: z7.object({ text: z7.string(), suggestion: z7.boolean().optional() })
1498
1653
  })
1499
1654
  ]);
1500
- var Panel = z6.object({
1501
- sessionId: Id4,
1502
- adapterId: z6.string(),
1503
- slot: z6.string(),
1504
- title: z6.string(),
1655
+ var Panel = z7.object({
1656
+ sessionId: Id5,
1657
+ adapterId: z7.string(),
1658
+ slot: z7.string(),
1659
+ title: z7.string(),
1505
1660
  node: UINodeSchema.nullable(),
1506
- webRenderer: z6.boolean(),
1507
- mobileFallback: z6.string().nullable(),
1661
+ webRenderer: z7.boolean(),
1662
+ mobileFallback: z7.string().nullable(),
1508
1663
  contribution: ContributionDescriptor.optional(),
1509
- state: z6.unknown().optional(),
1510
- adapterGeneration: z6.string().uuid().optional(),
1511
- updatedAt: Iso
1664
+ state: z7.unknown().optional(),
1665
+ adapterGeneration: z7.string().uuid().optional(),
1666
+ updatedAt: Iso2
1512
1667
  });
1513
- var Diagnostic = z6.object({
1514
- sessionId: Id4.nullable(),
1515
- adapterId: z6.string().nullable(),
1668
+ var Diagnostic = z7.object({
1669
+ sessionId: Id5.nullable(),
1670
+ adapterId: z7.string().nullable(),
1516
1671
  level: DiagnosticLevel,
1517
- message: z6.string(),
1518
- at: Iso
1519
- });
1520
- var AdapterInfo = z6.object({
1521
- id: z6.string(),
1522
- version: z6.string(),
1523
- tier: z6.enum(["project", "owner", "plugin", "bundled"]),
1524
- target: z6.object({
1525
- extension: z6.string(),
1526
- versionRange: z6.string(),
1527
- testedVersions: z6.array(z6.string())
1672
+ message: z7.string(),
1673
+ at: Iso2
1674
+ });
1675
+ var AdapterInfo = z7.object({
1676
+ id: z7.string(),
1677
+ version: z7.string(),
1678
+ tier: z7.enum(["project", "owner", "plugin", "bundled"]),
1679
+ target: z7.object({
1680
+ extension: z7.string(),
1681
+ versionRange: z7.string(),
1682
+ testedVersions: z7.array(z7.string())
1528
1683
  }),
1529
- capabilities: z6.array(z6.string()),
1530
- webRenderer: z6.boolean(),
1531
- status: z6.enum(["active", "disabled", "error"]),
1532
- detail: z6.string().nullable()
1533
- });
1534
- var Passkey = z6.object({
1535
- id: z6.string(),
1536
- name: z6.string(),
1537
- createdAt: Iso,
1538
- lastUsedAt: Iso.nullable(),
1539
- transports: z6.array(z6.string())
1684
+ capabilities: z7.array(z7.string()),
1685
+ webRenderer: z7.boolean(),
1686
+ status: z7.enum(["active", "disabled", "error"]),
1687
+ detail: z7.string().nullable()
1688
+ });
1689
+ var Passkey = z7.object({
1690
+ id: z7.string(),
1691
+ name: z7.string(),
1692
+ createdAt: Iso2,
1693
+ lastUsedAt: Iso2.nullable(),
1694
+ transports: z7.array(z7.string())
1540
1695
  });
1541
1696
 
1542
1697
  // packages/protocol/dist/adapter-preview.js
@@ -1549,92 +1704,92 @@ function bounded(input, ctx) {
1549
1704
  return input;
1550
1705
  } catch (error) {
1551
1706
  ctx.addIssue({ code: "custom", message: error.message });
1552
- return z7.NEVER;
1707
+ return z8.NEVER;
1553
1708
  }
1554
1709
  }
1555
- var Id5 = z7.string().min(1).max(200);
1556
- var Text2 = z7.string().max(64 * 1024);
1557
- var Tool = { toolCallId: Id5, name: Id5, args: z7.unknown() };
1558
- var DialogCommon = { id: Id5, title: Text2 };
1559
- var AdapterPreviewPiUiRequestSchema = z7.discriminatedUnion("method", [
1560
- z7.object({
1710
+ var Id6 = z8.string().min(1).max(200);
1711
+ var Text2 = z8.string().max(64 * 1024);
1712
+ var Tool = { toolCallId: Id6, name: Id6, args: z8.unknown() };
1713
+ var DialogCommon = { id: Id6, title: Text2 };
1714
+ var AdapterPreviewPiUiRequestSchema = z8.discriminatedUnion("method", [
1715
+ z8.object({
1561
1716
  ...DialogCommon,
1562
- method: z7.literal("select"),
1563
- options: z7.array(Text2).max(200),
1564
- timeout: z7.number().nonnegative().optional()
1717
+ method: z8.literal("select"),
1718
+ options: z8.array(Text2).max(200),
1719
+ timeout: z8.number().nonnegative().optional()
1565
1720
  }).strict(),
1566
- z7.object({
1721
+ z8.object({
1567
1722
  ...DialogCommon,
1568
- method: z7.literal("confirm"),
1723
+ method: z8.literal("confirm"),
1569
1724
  message: Text2,
1570
- timeout: z7.number().nonnegative().optional()
1725
+ timeout: z8.number().nonnegative().optional()
1571
1726
  }).strict(),
1572
- z7.object({
1727
+ z8.object({
1573
1728
  ...DialogCommon,
1574
- method: z7.literal("input"),
1729
+ method: z8.literal("input"),
1575
1730
  placeholder: Text2.optional(),
1576
- timeout: z7.number().nonnegative().optional()
1731
+ timeout: z8.number().nonnegative().optional()
1577
1732
  }).strict(),
1578
- z7.object({ ...DialogCommon, method: z7.literal("editor"), prefill: Text2.optional() }).strict()
1733
+ z8.object({ ...DialogCommon, method: z8.literal("editor"), prefill: Text2.optional() }).strict()
1579
1734
  ]);
1580
- var AdapterPreviewStepSchema = z7.discriminatedUnion("kind", [
1581
- z7.object({ kind: z7.literal("restore") }).strict(),
1582
- z7.object({ kind: z7.literal("toolStart"), data: z7.object(Tool).strict() }).strict(),
1583
- z7.object({
1584
- kind: z7.literal("toolUpdate"),
1585
- data: z7.object({ ...Tool, partialResult: z7.unknown(), details: z7.unknown().optional() }).strict()
1735
+ var AdapterPreviewStepSchema = z8.discriminatedUnion("kind", [
1736
+ z8.object({ kind: z8.literal("restore") }).strict(),
1737
+ z8.object({ kind: z8.literal("toolStart"), data: z8.object(Tool).strict() }).strict(),
1738
+ z8.object({
1739
+ kind: z8.literal("toolUpdate"),
1740
+ data: z8.object({ ...Tool, partialResult: z8.unknown(), details: z8.unknown().optional() }).strict()
1586
1741
  }).strict(),
1587
- z7.object({
1588
- kind: z7.literal("toolEnd"),
1589
- data: z7.object({
1742
+ z8.object({
1743
+ kind: z8.literal("toolEnd"),
1744
+ data: z8.object({
1590
1745
  ...Tool,
1591
- result: z7.unknown(),
1592
- isError: z7.boolean(),
1593
- details: z7.unknown().optional()
1746
+ result: z8.unknown(),
1747
+ isError: z8.boolean(),
1748
+ details: z8.unknown().optional()
1594
1749
  }).strict()
1595
1750
  }).strict(),
1596
- z7.object({
1597
- kind: z7.literal("status"),
1598
- data: z7.object({ key: Id5, text: Text2.optional() }).strict()
1751
+ z8.object({
1752
+ kind: z8.literal("status"),
1753
+ data: z8.object({ key: Id6, text: Text2.optional() }).strict()
1599
1754
  }).strict(),
1600
- z7.object({
1601
- kind: z7.literal("widget"),
1602
- data: z7.object({ key: Id5, lines: z7.array(Text2).max(200).optional() }).strict()
1755
+ z8.object({
1756
+ kind: z8.literal("widget"),
1757
+ data: z8.object({ key: Id6, lines: z8.array(Text2).max(200).optional() }).strict()
1603
1758
  }).strict(),
1604
- z7.object({ kind: z7.literal("dialog"), data: AdapterPreviewPiUiRequestSchema }).strict(),
1605
- z7.object({
1606
- kind: z7.literal("answer"),
1607
- data: z7.object({ requestId: Id5, response: InteractionResponseSchema }).strict()
1759
+ z8.object({ kind: z8.literal("dialog"), data: AdapterPreviewPiUiRequestSchema }).strict(),
1760
+ z8.object({
1761
+ kind: z8.literal("answer"),
1762
+ data: z8.object({ requestId: Id6, response: InteractionResponseSchema }).strict()
1608
1763
  }).strict(),
1609
- z7.object({
1610
- kind: z7.literal("customMessage"),
1611
- data: z7.object({
1612
- customType: Id5,
1613
- content: z7.unknown(),
1614
- display: z7.boolean().optional(),
1615
- details: z7.unknown().optional()
1764
+ z8.object({
1765
+ kind: z8.literal("customMessage"),
1766
+ data: z8.object({
1767
+ customType: Id6,
1768
+ content: z8.unknown(),
1769
+ display: z8.boolean().optional(),
1770
+ details: z8.unknown().optional()
1616
1771
  }).strict()
1617
1772
  }).strict(),
1618
- z7.object({
1619
- kind: z7.literal("action"),
1620
- data: z7.object({ actionId: Id5, payload: z7.unknown() }).strict()
1773
+ z8.object({
1774
+ kind: z8.literal("action"),
1775
+ data: z8.object({ actionId: Id6, payload: z8.unknown() }).strict()
1621
1776
  }).strict()
1622
1777
  ]);
1623
- var AdapterPreviewFixtureSchema = z7.unknown().transform(bounded).pipe(z7.object({
1624
- version: z7.literal(1),
1625
- name: z7.string().min(1).max(200),
1626
- initialState: z7.record(z7.string(), z7.record(z7.string(), z7.unknown())).optional(),
1627
- steps: z7.array(AdapterPreviewStepSchema).max(ADAPTER_PREVIEW_MAX_STEPS)
1778
+ var AdapterPreviewFixtureSchema = z8.unknown().transform(bounded).pipe(z8.object({
1779
+ version: z8.literal(1),
1780
+ name: z8.string().min(1).max(200),
1781
+ initialState: z8.record(z8.string(), z8.record(z8.string(), z8.unknown())).optional(),
1782
+ steps: z8.array(AdapterPreviewStepSchema).max(ADAPTER_PREVIEW_MAX_STEPS)
1628
1783
  }).strict());
1629
- var PortableNode = z7.unknown().transform((input, ctx) => {
1784
+ var PortableNode = z8.unknown().transform((input, ctx) => {
1630
1785
  try {
1631
1786
  return validateUINode(input);
1632
1787
  } catch (error) {
1633
1788
  ctx.addIssue({ code: "custom", message: error.message });
1634
- return z7.NEVER;
1789
+ return z8.NEVER;
1635
1790
  }
1636
1791
  });
1637
- var PreviewPanel = Panel.extend({ webRenderer: z7.literal(false) }).superRefine((panel, ctx) => {
1792
+ var PreviewPanel = Panel.extend({ webRenderer: z8.literal(false) }).superRefine((panel, ctx) => {
1638
1793
  try {
1639
1794
  if (panel.sessionId !== ADAPTER_PREVIEW_SESSION_ID)
1640
1795
  throw new Error("Preview panels must use the fake preview session");
@@ -1656,13 +1811,13 @@ var PreviewPanel = Panel.extend({ webRenderer: z7.literal(false) }).superRefine(
1656
1811
  ctx.addIssue({ code: "custom", message: error.message });
1657
1812
  }
1658
1813
  });
1659
- var AdapterPreviewSchema = z7.unknown().transform(bounded).pipe(z7.object({
1660
- version: z7.literal(1),
1661
- name: z7.string().min(1).max(200),
1662
- adapter: z7.object({ id: Id5, version: Id5 }).strict(),
1663
- steps: z7.array(z7.object({
1664
- index: z7.number().int().min(0).max(ADAPTER_PREVIEW_MAX_STEPS - 1),
1665
- kind: z7.enum([
1814
+ var AdapterPreviewSchema = z8.unknown().transform(bounded).pipe(z8.object({
1815
+ version: z8.literal(1),
1816
+ name: z8.string().min(1).max(200),
1817
+ adapter: z8.object({ id: Id6, version: Id6 }).strict(),
1818
+ steps: z8.array(z8.object({
1819
+ index: z8.number().int().min(0).max(ADAPTER_PREVIEW_MAX_STEPS - 1),
1820
+ kind: z8.enum([
1666
1821
  "restore",
1667
1822
  "toolStart",
1668
1823
  "toolUpdate",
@@ -1674,24 +1829,24 @@ var AdapterPreviewSchema = z7.unknown().transform(bounded).pipe(z7.object({
1674
1829
  "customMessage",
1675
1830
  "action"
1676
1831
  ]),
1677
- ok: z7.boolean(),
1678
- error: z7.string().max(4e3).nullable()
1832
+ ok: z8.boolean(),
1833
+ error: z8.string().max(4e3).nullable()
1679
1834
  }).strict()).max(ADAPTER_PREVIEW_MAX_STEPS),
1680
- panels: z7.array(PreviewPanel).max(256),
1681
- interactions: z7.array(z7.object({
1835
+ panels: z8.array(PreviewPanel).max(256),
1836
+ interactions: z8.array(z8.object({
1682
1837
  request: AdapterPreviewPiUiRequestSchema,
1683
1838
  presentation: PortableNode,
1684
- state: z7.enum(["pending", "resolved"])
1839
+ state: z8.enum(["pending", "resolved"])
1685
1840
  }).strict()).max(ADAPTER_PREVIEW_MAX_STEPS),
1686
- cards: z7.array(z7.unknown().transform((input, ctx) => {
1841
+ cards: z8.array(z8.unknown().transform((input, ctx) => {
1687
1842
  try {
1688
1843
  return validateContributionCard(input);
1689
1844
  } catch (error) {
1690
1845
  ctx.addIssue({ code: "custom", message: error.message });
1691
- return z7.NEVER;
1846
+ return z8.NEVER;
1692
1847
  }
1693
1848
  })).max(ADAPTER_PREVIEW_MAX_STEPS * 3),
1694
- diagnostics: z7.array(Diagnostic.extend({ message: z7.string().max(4e3) }).refine((d) => d.sessionId === null || d.sessionId === ADAPTER_PREVIEW_SESSION_ID, "Preview diagnostics must use the fake preview session")).max(200)
1849
+ diagnostics: z8.array(Diagnostic.extend({ message: z8.string().max(4e3) }).refine((d) => d.sessionId === null || d.sessionId === ADAPTER_PREVIEW_SESSION_ID, "Preview diagnostics must use the fake preview session")).max(200)
1695
1850
  }).strict().superRefine((preview, ctx) => {
1696
1851
  const slots = /* @__PURE__ */ new Set();
1697
1852
  let contributions = 0;
@@ -1720,39 +1875,39 @@ var AdapterPreviewSchema = z7.unknown().transform(bounded).pipe(z7.object({
1720
1875
  }));
1721
1876
 
1722
1877
  // packages/protocol/dist/adapters.js
1723
- import { z as z8 } from "zod";
1724
- var Path = z8.string().max(4096);
1878
+ import { z as z9 } from "zod";
1879
+ var Path = z9.string().max(4096);
1725
1880
  var SessionAdapterInfo = AdapterInfo.extend({
1726
- runtimeStatus: z8.enum(["active", "disabled", "unavailable"]),
1727
- runtimeDetail: z8.string().max(4e3).nullable(),
1728
- provenance: z8.object({
1729
- scope: z8.enum(["user", "project", "explicit"]),
1881
+ runtimeStatus: z9.enum(["active", "disabled", "unavailable"]),
1882
+ runtimeDetail: z9.string().max(4e3).nullable(),
1883
+ provenance: z9.object({
1884
+ scope: z9.enum(["user", "project", "explicit"]),
1730
1885
  source: Path.nullable(),
1731
1886
  packageDir: Path.nullable(),
1732
1887
  manifestPath: Path.nullable(),
1733
- targetVersion: z8.string().nullable(),
1734
- entrypoints: z8.array(Path).max(128),
1735
- evidence: z8.enum(["runtime-reported", "package-level", "explicit"])
1888
+ targetVersion: z9.string().nullable(),
1889
+ entrypoints: z9.array(Path).max(128),
1890
+ evidence: z9.enum(["runtime-reported", "package-level", "explicit"])
1736
1891
  })
1737
1892
  });
1738
- var SessionAdaptersResult = z8.object({
1739
- generation: z8.string().uuid().nullable(),
1740
- runtimeId: z8.string().nullable(),
1741
- reloadable: z8.boolean(),
1742
- blockedReason: z8.string().nullable(),
1743
- adapters: z8.array(SessionAdapterInfo).max(256),
1744
- diagnostics: z8.array(Diagnostic).max(100)
1893
+ var SessionAdaptersResult = z9.object({
1894
+ generation: z9.string().uuid().nullable(),
1895
+ runtimeId: z9.string().nullable(),
1896
+ reloadable: z9.boolean(),
1897
+ blockedReason: z9.string().nullable(),
1898
+ adapters: z9.array(SessionAdapterInfo).max(256),
1899
+ diagnostics: z9.array(Diagnostic).max(100)
1745
1900
  });
1746
1901
 
1747
1902
  // packages/protocol/dist/agent-wire.js
1748
- import { z as z9 } from "zod";
1749
- var Id6 = z9.string().min(1).max(200);
1750
- var Instant3 = z9.string().refine((value) => {
1903
+ import { z as z10 } from "zod";
1904
+ var Id7 = z10.string().min(1).max(200);
1905
+ var Instant3 = z10.string().refine((value) => {
1751
1906
  const date = new Date(value);
1752
1907
  return Number.isFinite(date.getTime()) && date.toISOString() === value;
1753
1908
  }, "Expected canonical UTC timestamp");
1754
1909
  var AGENT_FRAME_MAX_BYTES = 128 * 1024;
1755
- var AgentMethod = z9.enum([
1910
+ var AgentMethod = z10.enum([
1756
1911
  "session.bind",
1757
1912
  "task.create",
1758
1913
  "message.send",
@@ -1762,34 +1917,34 @@ var AgentMethod = z9.enum([
1762
1917
  "policy.status",
1763
1918
  "policy.cancel"
1764
1919
  ]);
1765
- var AgentToolMethod = z9.enum(["task.create", "message.send", "inbox.read"]);
1766
- var RequestHash = z9.string().regex(/^[a-f0-9]{64}$/);
1767
- var AgentReceiptPeekRequest = z9.object({ method: AgentToolMethod, args: z9.record(z9.string(), z9.json()) }).strict();
1768
- var AgentReceiptPeekResult = z9.discriminatedUnion("found", [
1769
- z9.object({ found: z9.literal(false) }).strict(),
1770
- z9.object({ found: z9.literal(true), requestHash: RequestHash }).strict()
1920
+ var AgentToolMethod = z10.enum(["task.create", "message.send", "inbox.read"]);
1921
+ var RequestHash = z10.string().regex(/^[a-f0-9]{64}$/);
1922
+ var AgentReceiptPeekRequest = z10.object({ method: AgentToolMethod, args: z10.record(z10.string(), z10.json()) }).strict();
1923
+ var AgentReceiptPeekResult = z10.discriminatedUnion("found", [
1924
+ z10.object({ found: z10.literal(false) }).strict(),
1925
+ z10.object({ found: z10.literal(true), requestHash: RequestHash }).strict()
1771
1926
  ]);
1772
- var AgentReceiptReplay = z9.object({ requestHash: RequestHash }).strict();
1773
- var CreateAgentTask = z9.object({
1774
- objective: z9.string().min(1).max(16e3),
1775
- acceptance: z9.array(z9.string().min(1).max(2e3)).max(100).default([]),
1776
- dependencies: z9.array(Id6).max(100).default([]),
1777
- parentTaskId: Id6.nullable().optional(),
1778
- hostId: Id6.optional(),
1779
- profileId: Id6.optional(),
1780
- notifyOnFinish: z9.boolean().default(true)
1781
- });
1782
- var SendAgentMessage = z9.object({
1783
- sessionId: Id6,
1784
- body: z9.string().min(1).max(16e3),
1785
- mode: z9.enum(["steer", "queue"]),
1786
- replyTo: Id6.optional()
1787
- });
1788
- var ReadAgentInbox = z9.object({
1789
- after: z9.number().int().nonnegative().default(0),
1790
- limit: z9.number().int().min(1).max(100).default(20)
1791
- });
1792
- var DeliveryState = z9.enum([
1927
+ var AgentReceiptReplay = z10.object({ requestHash: RequestHash }).strict();
1928
+ var CreateAgentTask = z10.object({
1929
+ objective: z10.string().min(1).max(16e3),
1930
+ acceptance: z10.array(z10.string().min(1).max(2e3)).max(100).default([]),
1931
+ dependencies: z10.array(Id7).max(100).default([]),
1932
+ parentTaskId: Id7.nullable().optional(),
1933
+ hostId: Id7.optional(),
1934
+ profileId: Id7.optional(),
1935
+ notifyOnFinish: z10.boolean().default(true)
1936
+ });
1937
+ var SendAgentMessage = z10.object({
1938
+ sessionId: Id7,
1939
+ body: z10.string().min(1).max(16e3),
1940
+ mode: z10.enum(["steer", "queue"]),
1941
+ replyTo: Id7.optional()
1942
+ });
1943
+ var ReadAgentInbox = z10.object({
1944
+ after: z10.number().int().nonnegative().default(0),
1945
+ limit: z10.number().int().min(1).max(100).default(20)
1946
+ });
1947
+ var DeliveryState = z10.enum([
1793
1948
  "pending",
1794
1949
  "held",
1795
1950
  "deferred",
@@ -1800,46 +1955,46 @@ var DeliveryState = z9.enum([
1800
1955
  "failed"
1801
1956
  ]);
1802
1957
  var AgentMessageFields = {
1803
- seq: z9.number().int().positive(),
1804
- id: Id6,
1805
- recipientSessionId: Id6,
1806
- replyTo: Id6.nullable(),
1807
- chainId: Id6,
1808
- depth: z9.number().int().min(0).max(4),
1809
- body: z9.unknown(),
1810
- requestedMode: z9.enum(["steer", "queue"]),
1958
+ seq: z10.number().int().positive(),
1959
+ id: Id7,
1960
+ recipientSessionId: Id7,
1961
+ replyTo: Id7.nullable(),
1962
+ chainId: Id7,
1963
+ depth: z10.number().int().min(0).max(4),
1964
+ body: z10.unknown(),
1965
+ requestedMode: z10.enum(["steer", "queue"]),
1811
1966
  deliveryState: DeliveryState,
1812
- holdUntil: z9.string(),
1813
- readAt: z9.string().nullable(),
1814
- createdAt: z9.string()
1967
+ holdUntil: z10.string(),
1968
+ readAt: z10.string().nullable(),
1969
+ createdAt: z10.string()
1815
1970
  };
1816
- var AgentMessage = z9.discriminatedUnion("kind", [
1817
- z9.object({ ...AgentMessageFields, kind: z9.literal("message"), senderSessionId: Id6 }),
1818
- z9.object({
1971
+ var AgentMessage = z10.discriminatedUnion("kind", [
1972
+ z10.object({ ...AgentMessageFields, kind: z10.literal("message"), senderSessionId: Id7 }),
1973
+ z10.object({
1819
1974
  ...AgentMessageFields,
1820
- kind: z9.literal("completion"),
1821
- senderSessionId: Id6.nullable()
1975
+ kind: z10.literal("completion"),
1976
+ senderSessionId: Id7.nullable()
1822
1977
  })
1823
1978
  ]);
1824
- var AgentInbox = z9.object({
1825
- messages: z9.array(AgentMessage),
1826
- nextAfter: z9.number().int().nonnegative(),
1827
- hasMore: z9.boolean()
1828
- });
1829
- var AgentToolPolicyWait = PolicyEvaluation.options[2].omit({ verdict: true }).extend({ type: z9.literal("policy.required") }).strict();
1830
- var AgentRequestFrame = z9.object({
1831
- type: z9.literal("agent.request"),
1832
- requestId: Id6,
1833
- sessionId: Id6,
1834
- nativeSessionId: Id6,
1835
- runtimeId: Id6,
1836
- context: z9.object({ humanInputId: Id6.nullable(), causalMessageId: Id6.nullable() }).strict(),
1837
- toolCallId: Id6.optional(),
1979
+ var AgentInbox = z10.object({
1980
+ messages: z10.array(AgentMessage),
1981
+ nextAfter: z10.number().int().nonnegative(),
1982
+ hasMore: z10.boolean()
1983
+ });
1984
+ var AgentToolPolicyWait = PolicyEvaluation.options[2].omit({ verdict: true }).extend({ type: z10.literal("policy.required") }).strict();
1985
+ var AgentRequestFrame = z10.object({
1986
+ type: z10.literal("agent.request"),
1987
+ requestId: Id7,
1988
+ sessionId: Id7,
1989
+ nativeSessionId: Id7,
1990
+ runtimeId: Id7,
1991
+ context: z10.object({ humanInputId: Id7.nullable(), causalMessageId: Id7.nullable() }).strict(),
1992
+ toolCallId: Id7.optional(),
1838
1993
  receiptReplay: AgentReceiptReplay.optional(),
1839
1994
  // Tool-method ingress requires this separately; legacy/non-tool frames remain compatible.
1840
1995
  deadlineAt: Instant3.optional(),
1841
1996
  method: AgentMethod,
1842
- args: z9.unknown()
1997
+ args: z10.unknown()
1843
1998
  }).strict().superRefine((frame, ctx) => {
1844
1999
  if (frame.method === "receipt.peek") {
1845
2000
  if (!frame.toolCallId) {
@@ -1858,59 +2013,59 @@ var AgentRequestFrame = z9.object({
1858
2013
  });
1859
2014
  }
1860
2015
  });
1861
- var AgentResultFrame = z9.discriminatedUnion("ok", [
1862
- z9.object({
1863
- type: z9.literal("agent.result"),
1864
- requestId: Id6,
1865
- runtimeId: Id6,
1866
- ok: z9.literal(true),
1867
- result: z9.unknown()
2016
+ var AgentResultFrame = z10.discriminatedUnion("ok", [
2017
+ z10.object({
2018
+ type: z10.literal("agent.result"),
2019
+ requestId: Id7,
2020
+ runtimeId: Id7,
2021
+ ok: z10.literal(true),
2022
+ result: z10.unknown()
1868
2023
  }),
1869
- z9.object({
1870
- type: z9.literal("agent.result"),
1871
- requestId: Id6,
1872
- runtimeId: Id6,
1873
- ok: z9.literal(false),
2024
+ z10.object({
2025
+ type: z10.literal("agent.result"),
2026
+ requestId: Id7,
2027
+ runtimeId: Id7,
2028
+ ok: z10.literal(false),
1874
2029
  error: ErrorBody
1875
2030
  })
1876
2031
  ]);
1877
2032
 
1878
2033
  // packages/protocol/dist/api.js
1879
- import { z as z13 } from "zod";
2034
+ import { z as z14 } from "zod";
1880
2035
 
1881
2036
  // packages/protocol/dist/host-wire.js
1882
- import { z as z12 } from "zod";
2037
+ import { z as z13 } from "zod";
1883
2038
 
1884
2039
  // packages/protocol/dist/events.js
1885
- import { z as z10 } from "zod";
2040
+ import { z as z11 } from "zod";
1886
2041
  var EventDataSchemas = {
1887
2042
  "host.updated": Host,
1888
2043
  "project.updated": Project,
1889
- "project.deleted": z10.object({ id: z10.string() }),
2044
+ "project.deleted": z11.object({ id: z11.string() }),
1890
2045
  "checkout.updated": Checkout,
1891
2046
  "workspace.updated": Workspace,
1892
- "workspace.deleted": z10.object({ id: z10.string() }),
2047
+ "workspace.deleted": z11.object({ id: z11.string() }),
1893
2048
  "profile.updated": Profile,
1894
- "profile.deleted": z10.object({ id: z10.string() }),
2049
+ "profile.deleted": z11.object({ id: z11.string() }),
1895
2050
  "view.updated": View,
1896
- "view.deleted": z10.object({ id: z10.string() }),
2051
+ "view.deleted": z11.object({ id: z11.string() }),
1897
2052
  "session.updated": Session,
1898
2053
  "transcript.item": TranscriptItem,
1899
- "transcript.reset": z10.object({ sessionId: z10.string(), epoch: z10.number().int() }),
2054
+ "transcript.reset": z11.object({ sessionId: z11.string(), epoch: z11.number().int() }),
1900
2055
  "interaction.updated": Interaction,
1901
2056
  "panel.updated": Panel,
1902
- "adapters.updated": z10.object({ hostId: z10.string(), adapters: z10.array(AdapterInfo) }),
2057
+ "adapters.updated": z11.object({ hostId: z11.string(), adapters: z11.array(AdapterInfo) }),
1903
2058
  diagnostic: Diagnostic,
1904
2059
  "task.updated": Task,
1905
- "task.deleted": z10.object({ id: z10.string() }),
2060
+ "task.deleted": z11.object({ id: z11.string() }),
1906
2061
  "run.updated": Run,
1907
2062
  "automation.updated": Automation,
1908
- "automation.deleted": z10.object({ id: z10.string() }),
2063
+ "automation.deleted": z11.object({ id: z11.string() }),
1909
2064
  "occurrence.created": Occurrence,
1910
2065
  "occurrence.updated": Occurrence,
1911
2066
  "attention.updated": AttentionItem,
1912
2067
  "device.updated": Device,
1913
- "settings.updated": z10.object({ dispatchPaused: z10.boolean() })
2068
+ "settings.updated": z11.object({ dispatchPaused: z11.boolean() })
1914
2069
  };
1915
2070
  var EVENT_TYPES = Object.keys(EventDataSchemas);
1916
2071
  var LEGACY_EVENT_TYPES = {
@@ -1920,19 +2075,19 @@ function canonicalEventType(type) {
1920
2075
  return LEGACY_EVENT_TYPES[type] ?? type;
1921
2076
  }
1922
2077
  var canonical = (v) => typeof v === "string" ? canonicalEventType(v) : v;
1923
- var EventTypeSchema = z10.preprocess(canonical, z10.enum(EVENT_TYPES));
1924
- var EventScope = z10.object({
1925
- hostId: z10.string().optional(),
1926
- sessionId: z10.string().optional(),
1927
- taskId: z10.string().optional(),
1928
- projectId: z10.string().optional()
2078
+ var EventTypeSchema = z11.preprocess(canonical, z11.enum(EVENT_TYPES));
2079
+ var EventScope = z11.object({
2080
+ hostId: z11.string().optional(),
2081
+ sessionId: z11.string().optional(),
2082
+ taskId: z11.string().optional(),
2083
+ projectId: z11.string().optional()
1929
2084
  });
1930
2085
  var EventEnvelope = EventScope.extend({
1931
- seq: z10.number().int(),
1932
- id: z10.string(),
2086
+ seq: z11.number().int(),
2087
+ id: z11.string(),
1933
2088
  type: EventTypeSchema,
1934
- at: z10.string(),
1935
- data: z10.unknown()
2089
+ at: z11.string(),
2090
+ data: z11.unknown()
1936
2091
  });
1937
2092
  var HOST_EVENT_TYPES = [
1938
2093
  "session.updated",
@@ -1945,321 +2100,327 @@ var HOST_EVENT_TYPES = [
1945
2100
  "workspace.deleted"
1946
2101
  ];
1947
2102
  var HostEvent = EventScope.extend({
1948
- eventId: z10.string(),
1949
- type: z10.preprocess(canonical, z10.enum(HOST_EVENT_TYPES)),
1950
- at: z10.string(),
1951
- data: z10.unknown()
1952
- });
1953
- var StreamDelta = z10.object({
1954
- sessionId: z10.string(),
1955
- itemId: z10.string(),
1956
- kind: z10.enum(["text", "thinking", "tool_args", "tool_output"]),
1957
- delta: z10.string(),
1958
- order: z10.number().int().optional()
2103
+ eventId: z11.string(),
2104
+ type: z11.preprocess(canonical, z11.enum(HOST_EVENT_TYPES)),
2105
+ at: z11.string(),
2106
+ data: z11.unknown()
2107
+ });
2108
+ var StreamDelta = z11.object({
2109
+ sessionId: z11.string(),
2110
+ itemId: z11.string(),
2111
+ kind: z11.enum(["text", "thinking", "tool_args", "tool_output"]),
2112
+ delta: z11.string(),
2113
+ order: z11.number().int().optional()
1959
2114
  });
1960
2115
 
1961
2116
  // packages/protocol/dist/terminal-wire.js
1962
- import { z as z11 } from "zod";
1963
- var Cols = z11.number().int().min(10).max(1e3);
1964
- var Rows = z11.number().int().min(5).max(500);
1965
- var TermViewerToServer = z11.discriminatedUnion("t", [
1966
- z11.object({ t: z11.literal("in"), d: z11.string() }),
1967
- z11.object({ t: z11.literal("resize"), cols: Cols, rows: Rows }),
1968
- z11.object({ t: z11.literal("claim") })
2117
+ import { z as z12 } from "zod";
2118
+ var Cols = z12.number().int().min(10).max(1e3);
2119
+ var Rows = z12.number().int().min(5).max(500);
2120
+ var TermViewerToServer = z12.discriminatedUnion("t", [
2121
+ z12.object({ t: z12.literal("in"), d: z12.string() }),
2122
+ z12.object({ t: z12.literal("resize"), cols: Cols, rows: Rows }),
2123
+ z12.object({ t: z12.literal("claim") })
1969
2124
  ]);
1970
- var TermServerToViewer = z11.discriminatedUnion("t", [
1971
- z11.object({ t: z11.literal("out"), d: z11.string() }),
1972
- z11.object({ t: z11.literal("closed"), reason: z11.string() }),
1973
- z11.object({ t: z11.literal("size"), cols: Cols, rows: Rows, owner: z11.boolean() })
2125
+ var TermServerToViewer = z12.discriminatedUnion("t", [
2126
+ z12.object({ t: z12.literal("out"), d: z12.string() }),
2127
+ z12.object({ t: z12.literal("closed"), reason: z12.string() }),
2128
+ z12.object({ t: z12.literal("size"), cols: Cols, rows: Rows, owner: z12.boolean() })
1974
2129
  ]);
1975
- var TermCoordinatorMsg = z11.discriminatedUnion("t", [
1976
- z11.object({
1977
- t: z11.literal("open"),
1978
- sessionId: z11.string(),
2130
+ var TermCoordinatorMsg = z12.discriminatedUnion("t", [
2131
+ z12.object({
2132
+ t: z12.literal("open"),
2133
+ sessionId: z12.string(),
1979
2134
  cols: Cols,
1980
2135
  rows: Rows,
1981
- passive: z11.boolean().optional()
2136
+ passive: z12.boolean().optional()
1982
2137
  }),
1983
- z11.object({ t: z11.literal("claim") }),
1984
- z11.object({ t: z11.literal("in"), d: z11.string() }),
1985
- z11.object({ t: z11.literal("resize"), cols: Cols, rows: Rows }),
1986
- z11.object({ t: z11.literal("close") })
2138
+ z12.object({ t: z12.literal("claim") }),
2139
+ z12.object({ t: z12.literal("in"), d: z12.string() }),
2140
+ z12.object({ t: z12.literal("resize"), cols: Cols, rows: Rows }),
2141
+ z12.object({ t: z12.literal("close") })
1987
2142
  ]);
1988
2143
 
1989
2144
  // packages/protocol/dist/host-wire.js
1990
- var Origin = z12.enum(["human", "automation"]);
1991
- var HostCommand = z12.discriminatedUnion("type", [
1992
- z12.object({
1993
- type: z12.literal("session.start"),
1994
- sessionId: z12.string(),
1995
- title: z12.string(),
1996
- workspacePath: z12.string(),
1997
- projectId: z12.string().nullable(),
2145
+ var Origin = z13.enum(["human", "automation"]);
2146
+ var HostCommand = z13.discriminatedUnion("type", [
2147
+ z13.object({
2148
+ type: z13.literal("session.start"),
2149
+ sessionId: z13.string(),
2150
+ title: z13.string(),
2151
+ workspacePath: z13.string(),
2152
+ projectId: z13.string().nullable(),
1998
2153
  profile: Profile,
1999
2154
  nativeHandle: NativeHandle.nullable(),
2000
- initialPrompt: z12.string().nullable(),
2001
- dispatchKey: z12.string().nullable(),
2002
- controlRevision: z12.number().int(),
2155
+ initialPrompt: z13.string().nullable(),
2156
+ dispatchKey: z13.string().nullable(),
2157
+ controlRevision: z13.number().int(),
2003
2158
  controlMode: ControlMode,
2004
2159
  origin: Origin,
2005
- readOnly: z12.boolean().default(false),
2006
- policyRequired: z12.boolean().optional()
2160
+ readOnly: z13.boolean().default(false),
2161
+ policyRequired: z13.boolean().optional()
2007
2162
  }),
2008
- z12.object({
2009
- type: z12.literal("session.deliverMessage"),
2010
- sessionId: z12.string(),
2011
- messageId: z12.string(),
2012
- payload: z12.object({
2013
- deliveryId: z12.string(),
2014
- kind: z12.enum(["message", "completion"]),
2015
- text: z12.string()
2163
+ z13.object({
2164
+ type: z13.literal("session.deliverMessage"),
2165
+ sessionId: z13.string(),
2166
+ messageId: z13.string(),
2167
+ payload: z13.object({
2168
+ deliveryId: z13.string(),
2169
+ kind: z13.enum(["message", "completion"]),
2170
+ text: z13.string()
2016
2171
  }),
2017
- mode: z12.enum(["steer", "queue"]),
2018
- holdUntil: z12.string()
2172
+ mode: z13.enum(["steer", "queue"]),
2173
+ holdUntil: z13.string()
2019
2174
  }),
2020
- HostPolicySampleRequest.extend({ type: z12.literal("session.classifyPolicySample") }),
2021
- z12.object({
2022
- type: z12.literal("session.messageStatus"),
2023
- sessionId: z12.string(),
2024
- messageIds: z12.array(z12.string().min(1)).min(1).max(100)
2175
+ HostPolicySampleRequest.extend({ type: z13.literal("session.classifyPolicySample") }),
2176
+ z13.object({
2177
+ type: z13.literal("session.messageStatus"),
2178
+ sessionId: z13.string(),
2179
+ messageIds: z13.array(z13.string().min(1)).min(1).max(100)
2025
2180
  }),
2026
- z12.object({
2027
- type: z12.literal("session.prompt"),
2028
- sessionId: z12.string(),
2029
- text: z12.string(),
2030
- images: z12.array(z12.object({ mimeType: z12.string(), data: z12.string() })).default([]),
2031
- mode: z12.enum(["prompt", "steer", "followUp"]),
2181
+ z13.object({
2182
+ type: z13.literal("session.prompt"),
2183
+ sessionId: z13.string(),
2184
+ text: z13.string(),
2185
+ images: z13.array(z13.object({ mimeType: z13.string(), data: z13.string() })).default([]),
2186
+ mode: z13.enum(["prompt", "steer", "followUp"]),
2032
2187
  origin: Origin,
2033
- controlRevision: z12.number().int()
2188
+ controlRevision: z13.number().int()
2034
2189
  }),
2035
- z12.object({ type: z12.literal("session.abort"), sessionId: z12.string(), clearQueue: z12.boolean() }),
2036
- z12.object({ type: z12.literal("session.stop"), sessionId: z12.string() }),
2037
- z12.object({
2038
- type: z12.literal("session.answer"),
2039
- sessionId: z12.string(),
2040
- interactionId: z12.string(),
2041
- revision: z12.number().int(),
2190
+ z13.object({ type: z13.literal("session.abort"), sessionId: z13.string(), clearQueue: z13.boolean() }),
2191
+ z13.object({ type: z13.literal("session.stop"), sessionId: z13.string() }),
2192
+ z13.object({
2193
+ type: z13.literal("session.answer"),
2194
+ sessionId: z13.string(),
2195
+ interactionId: z13.string(),
2196
+ revision: z13.number().int(),
2042
2197
  response: InteractionResponseSchema,
2043
- deviceId: z12.string()
2198
+ deviceId: z13.string()
2044
2199
  }),
2045
- z12.object({
2046
- type: z12.literal("session.adapterAction"),
2047
- sessionId: z12.string(),
2048
- generation: z12.string().uuid().optional(),
2049
- adapterId: z12.string(),
2050
- actionId: z12.string(),
2051
- payload: z12.unknown()
2200
+ z13.object({
2201
+ type: z13.literal("session.adapterAction"),
2202
+ sessionId: z13.string(),
2203
+ generation: z13.string().uuid().optional(),
2204
+ adapterId: z13.string(),
2205
+ actionId: z13.string(),
2206
+ payload: z13.unknown()
2052
2207
  }),
2053
- z12.object({
2054
- type: z12.literal("session.setControl"),
2055
- sessionId: z12.string(),
2056
- controlRevision: z12.number().int(),
2208
+ z13.object({
2209
+ type: z13.literal("session.setControl"),
2210
+ sessionId: z13.string(),
2211
+ controlRevision: z13.number().int(),
2057
2212
  mode: ControlMode
2058
2213
  }),
2059
- z12.object({ type: z12.literal("session.rename"), sessionId: z12.string(), title: z12.string() }),
2060
- z12.object({ type: z12.literal("session.importable") }),
2061
- z12.object({ type: z12.literal("session.readNative"), sessionFile: z12.string() }),
2062
- z12.object({ type: z12.literal("session.snapshot"), sessionId: z12.string() }),
2063
- z12.object({ type: z12.literal("session.models"), sessionId: z12.string() }),
2064
- z12.object({ type: z12.literal("session.commands"), sessionId: z12.string() }),
2065
- z12.object({
2066
- type: z12.literal("session.complete"),
2067
- sessionId: z12.string(),
2068
- text: z12.string().max(500)
2214
+ z13.object({ type: z13.literal("session.rename"), sessionId: z13.string(), title: z13.string() }),
2215
+ z13.object({ type: z13.literal("session.importable") }),
2216
+ z13.object({ type: z13.literal("session.readNative"), sessionFile: z13.string() }),
2217
+ z13.object({ type: z13.literal("session.snapshot"), sessionId: z13.string() }),
2218
+ z13.object({ type: z13.literal("session.models"), sessionId: z13.string() }),
2219
+ z13.object({ type: z13.literal("session.commands"), sessionId: z13.string() }),
2220
+ z13.object({
2221
+ type: z13.literal("session.complete"),
2222
+ sessionId: z13.string(),
2223
+ text: z13.string().max(500)
2069
2224
  }),
2070
- z12.object({ type: z12.literal("session.tree"), sessionId: z12.string() }),
2071
- z12.object({
2072
- type: z12.literal("session.branch"),
2073
- sessionId: z12.string(),
2074
- entryId: z12.string().nullable(),
2075
- fork: z12.boolean()
2225
+ z13.object({ type: z13.literal("session.tree"), sessionId: z13.string() }),
2226
+ z13.object({
2227
+ type: z13.literal("session.branch"),
2228
+ sessionId: z13.string(),
2229
+ entryId: z13.string().nullable(),
2230
+ fork: z13.boolean()
2076
2231
  }),
2077
- z12.object({
2078
- type: z12.literal("session.navigate"),
2079
- sessionId: z12.string(),
2080
- entryId: z12.string(),
2081
- summarize: z12.boolean(),
2082
- instructions: z12.string().max(2e3).nullable()
2232
+ z13.object({
2233
+ type: z13.literal("session.navigate"),
2234
+ sessionId: z13.string(),
2235
+ entryId: z13.string(),
2236
+ summarize: z13.boolean(),
2237
+ instructions: z13.string().max(2e3).nullable()
2083
2238
  }),
2084
- z12.object({ type: z12.literal("session.reload"), sessionId: z12.string() }),
2085
- z12.object({ type: z12.literal("session.adapters"), sessionId: z12.string() }),
2086
- z12.object({ type: z12.literal("session.reloadAdapters"), sessionId: z12.string() }),
2087
- z12.object({ type: z12.literal("session.export"), sessionId: z12.string() }),
2088
- z12.object({
2089
- type: z12.literal("session.setModel"),
2090
- sessionId: z12.string(),
2091
- provider: z12.string().min(1),
2092
- modelId: z12.string().min(1)
2239
+ z13.object({ type: z13.literal("session.reload"), sessionId: z13.string() }),
2240
+ z13.object({ type: z13.literal("session.adapters"), sessionId: z13.string() }),
2241
+ z13.object({ type: z13.literal("session.reloadAdapters"), sessionId: z13.string() }),
2242
+ z13.object({ type: z13.literal("session.export"), sessionId: z13.string() }),
2243
+ z13.object({
2244
+ type: z13.literal("session.setModel"),
2245
+ sessionId: z13.string(),
2246
+ provider: z13.string().min(1),
2247
+ modelId: z13.string().min(1)
2093
2248
  }),
2094
- z12.object({ type: z12.literal("session.setThinking"), sessionId: z12.string(), level: ThinkingLevel }),
2095
- z12.object({
2096
- type: z12.literal("session.compact"),
2097
- sessionId: z12.string(),
2098
- instructions: z12.string().nullable()
2249
+ z13.object({ type: z13.literal("session.setThinking"), sessionId: z13.string(), level: ThinkingLevel }),
2250
+ z13.object({
2251
+ type: z13.literal("session.compact"),
2252
+ sessionId: z13.string(),
2253
+ instructions: z13.string().nullable()
2099
2254
  }),
2100
- z12.object({ type: z12.literal("checkout.inspect"), path: z12.string() }),
2101
- z12.object({ type: z12.literal("projects.scan"), folder: z12.string().min(1) }),
2102
- z12.object({
2103
- type: z12.literal("projects.suggest"),
2104
- days: z12.number().int().min(1).max(365).default(30)
2255
+ z13.object({ type: z13.literal("checkout.inspect"), path: z13.string() }),
2256
+ z13.object({ type: z13.literal("projects.scan"), folder: z13.string().min(1) }),
2257
+ z13.object({
2258
+ type: z13.literal("projects.suggest"),
2259
+ days: z13.number().int().min(1).max(365).default(30)
2105
2260
  }),
2106
- z12.object({
2107
- type: z12.literal("workspace.discover"),
2108
- checkoutPath: z12.string(),
2109
- worktreeDir: z12.string().default(DEFAULT_WORKTREE_DIR)
2261
+ z13.object({
2262
+ type: z13.literal("workspace.discover"),
2263
+ checkoutPath: z13.string(),
2264
+ worktreeDir: z13.string().default(DEFAULT_WORKTREE_DIR)
2110
2265
  }),
2111
- z12.object({
2112
- type: z12.literal("workspace.create"),
2113
- checkoutPath: z12.string(),
2114
- branch: z12.string(),
2115
- base: z12.string(),
2116
- setupCommand: z12.string().nullable(),
2117
- worktreeDir: z12.string().default(DEFAULT_WORKTREE_DIR)
2266
+ z13.object({
2267
+ type: z13.literal("workspace.create"),
2268
+ checkoutPath: z13.string(),
2269
+ branch: z13.string(),
2270
+ base: z13.string(),
2271
+ setupCommand: z13.string().nullable(),
2272
+ worktreeDir: z13.string().default(DEFAULT_WORKTREE_DIR)
2118
2273
  }),
2119
- z12.object({ type: z12.literal("workspace.status"), path: z12.string(), base: z12.string().nullable() }),
2120
- z12.object({
2121
- type: z12.literal("workspace.remove"),
2122
- path: z12.string(),
2123
- checkoutPath: z12.string(),
2124
- base: z12.string().nullable(),
2125
- force: z12.object({ dirty: z12.boolean(), unmerged: z12.boolean() })
2274
+ z13.object({ type: z13.literal("workspace.status"), path: z13.string(), base: z13.string().nullable() }),
2275
+ z13.object({
2276
+ type: z13.literal("workspace.remove"),
2277
+ path: z13.string(),
2278
+ checkoutPath: z13.string(),
2279
+ base: z13.string().nullable(),
2280
+ force: z13.object({ dirty: z13.boolean(), unmerged: z13.boolean() }),
2281
+ /** Also delete the worktree's local branch (hosts before trackers ignore it). */
2282
+ deleteBranch: z13.boolean().optional()
2126
2283
  }),
2127
- z12.object({
2128
- type: z12.literal("workspace.diff"),
2129
- path: z12.string(),
2130
- base: z12.string().nullable(),
2131
- file: z12.string().nullable()
2284
+ z13.object({
2285
+ type: z13.literal("workspace.diff"),
2286
+ path: z13.string(),
2287
+ base: z13.string().nullable(),
2288
+ file: z13.string().nullable()
2132
2289
  }),
2133
- z12.object({ type: z12.literal("workspace.files"), path: z12.string(), dir: z12.string() }),
2134
- z12.object({ type: z12.literal("workspace.readFile"), path: z12.string(), file: z12.string() }),
2135
- GitHubHostViewRequest.extend({ type: z12.literal("workspace.prView") }),
2136
- GitHubHostLogsRequest.extend({ type: z12.literal("workspace.prFailedLogs") }),
2137
- GitHubHostMergeRequest.extend({ type: z12.literal("workspace.prMerge") }),
2138
- z12.object({
2139
- type: z12.literal("dispatch.start"),
2140
- dispatchKey: z12.string(),
2141
- runId: z12.string(),
2142
- taskId: z12.string(),
2143
- sessionId: z12.string(),
2144
- projectId: z12.string(),
2145
- title: z12.string(),
2146
- workspace: z12.union([
2147
- z12.object({ path: z12.string() }),
2148
- z12.object({
2149
- createFrom: z12.object({
2150
- checkoutPath: z12.string(),
2151
- branch: z12.string(),
2152
- base: z12.string(),
2153
- setupCommand: z12.string().nullable(),
2154
- worktreeDir: z12.string().default(DEFAULT_WORKTREE_DIR)
2290
+ z13.object({ type: z13.literal("workspace.files"), path: z13.string(), dir: z13.string() }),
2291
+ z13.object({ type: z13.literal("workspace.readFile"), path: z13.string(), file: z13.string() }),
2292
+ GitHubHostViewRequest.extend({ type: z13.literal("workspace.prView") }),
2293
+ GitHubHostLogsRequest.extend({ type: z13.literal("workspace.prFailedLogs") }),
2294
+ GitHubHostMergeRequest.extend({ type: z13.literal("workspace.prMerge") }),
2295
+ TrackerHostSyncRequest.extend({ type: z13.literal("tracker.sync") }),
2296
+ TrackerHostPrepareBranchRequest.extend({ type: z13.literal("tracker.prepareBranch") }),
2297
+ TrackerHostStartIssueRequest.extend({ type: z13.literal("tracker.startIssue") }),
2298
+ TrackerHostSetStatusRequest.extend({ type: z13.literal("tracker.setStatus") }),
2299
+ z13.object({
2300
+ type: z13.literal("dispatch.start"),
2301
+ dispatchKey: z13.string(),
2302
+ runId: z13.string(),
2303
+ taskId: z13.string(),
2304
+ sessionId: z13.string(),
2305
+ projectId: z13.string(),
2306
+ title: z13.string(),
2307
+ workspace: z13.union([
2308
+ z13.object({ path: z13.string() }),
2309
+ z13.object({
2310
+ createFrom: z13.object({
2311
+ checkoutPath: z13.string(),
2312
+ branch: z13.string(),
2313
+ base: z13.string(),
2314
+ setupCommand: z13.string().nullable(),
2315
+ worktreeDir: z13.string().default(DEFAULT_WORKTREE_DIR)
2155
2316
  })
2156
2317
  })
2157
2318
  ]),
2158
2319
  nativeHandle: NativeHandle.nullable(),
2159
2320
  profile: Profile,
2160
- prompt: z12.string(),
2321
+ prompt: z13.string(),
2161
2322
  /** The launch's own revision; a takeover always carries a newer one. */
2162
- controlRevision: z12.number().int(),
2323
+ controlRevision: z13.number().int(),
2163
2324
  controlMode: ControlMode.default("automation"),
2164
- policyRequired: z12.boolean().optional()
2325
+ policyRequired: z13.boolean().optional()
2165
2326
  }),
2166
- z12.object({ type: z12.literal("dispatch.reconcile"), dispatchKey: z12.string() }),
2167
- z12.object({
2168
- type: z12.literal("checks.run"),
2169
- sessionId: z12.string(),
2170
- path: z12.string(),
2171
- commands: z12.array(z12.string())
2327
+ z13.object({ type: z13.literal("dispatch.reconcile"), dispatchKey: z13.string() }),
2328
+ z13.object({
2329
+ type: z13.literal("checks.run"),
2330
+ sessionId: z13.string(),
2331
+ path: z13.string(),
2332
+ commands: z13.array(z13.string())
2172
2333
  })
2173
2334
  ]);
2174
- var ImportableSession = z12.object({
2175
- sessionFile: z12.string(),
2176
- sessionId: z12.string(),
2177
- cwd: z12.string(),
2178
- name: z12.string().nullable(),
2179
- mtime: z12.string(),
2180
- inactive: z12.boolean()
2181
- });
2182
- var DiscoveredWorktree = z12.object({
2183
- path: z12.string(),
2184
- head: z12.string().nullable(),
2185
- branch: z12.string().nullable(),
2186
- bare: z12.boolean(),
2187
- detached: z12.boolean(),
2188
- locked: z12.boolean(),
2189
- prunable: z12.boolean(),
2190
- provenance: z12.enum(["managed", "discovered", "main"]),
2335
+ var ImportableSession = z13.object({
2336
+ sessionFile: z13.string(),
2337
+ sessionId: z13.string(),
2338
+ cwd: z13.string(),
2339
+ name: z13.string().nullable(),
2340
+ mtime: z13.string(),
2341
+ inactive: z13.boolean()
2342
+ });
2343
+ var DiscoveredWorktree = z13.object({
2344
+ path: z13.string(),
2345
+ head: z13.string().nullable(),
2346
+ branch: z13.string().nullable(),
2347
+ bare: z13.boolean(),
2348
+ detached: z13.boolean(),
2349
+ locked: z13.boolean(),
2350
+ prunable: z13.boolean(),
2351
+ provenance: z13.enum(["managed", "discovered", "main"]),
2191
2352
  git: GitState.nullable()
2192
2353
  });
2193
- var CheckoutInfo = z12.object({
2194
- root: z12.string(),
2195
- commonDir: z12.string(),
2196
- repoIdentity: z12.string(),
2197
- defaultBranch: z12.string()
2354
+ var CheckoutInfo = z13.object({
2355
+ root: z13.string(),
2356
+ commonDir: z13.string(),
2357
+ repoIdentity: z13.string(),
2358
+ defaultBranch: z13.string()
2198
2359
  });
2199
- var ScannedRepository = CheckoutInfo.extend({ name: z12.string() });
2200
- var ProjectFolderScan = z12.object({
2360
+ var ScannedRepository = CheckoutInfo.extend({ name: z13.string() });
2361
+ var ProjectFolderScan = z13.object({
2201
2362
  /** The folder, ~ expanded and realpath'd. */
2202
- folder: z12.string(),
2203
- repositories: z12.array(ScannedRepository)
2204
- });
2205
- var ProjectSuggestion = z12.object({
2206
- rootPath: z12.string(),
2207
- sessionCount: z12.number().int(),
2208
- lastActivityAt: z12.string()
2209
- });
2210
- var ProjectSuggestions = z12.object({ suggestions: z12.array(ProjectSuggestion) });
2211
- var DiffFile = z12.object({
2212
- path: z12.string(),
2213
- oldPath: z12.string().nullable(),
2214
- added: z12.number().int(),
2215
- deleted: z12.number().int(),
2216
- status: z12.enum(["added", "modified", "deleted", "renamed", "untracked", "binary"])
2217
- });
2218
- var DiffResult = z12.object({
2219
- base: z12.string(),
2220
- files: z12.array(DiffFile),
2221
- patch: z12.string().nullable()
2222
- });
2223
- var FileEntry = z12.object({
2224
- name: z12.string(),
2225
- path: z12.string(),
2226
- kind: z12.enum(["file", "dir", "symlink"]),
2227
- size: z12.number().int().nullable()
2228
- });
2229
- var ReconcileResult = z12.union([
2230
- z12.object({ known: z12.literal(false) }),
2231
- z12.object({
2232
- known: z12.literal(true),
2233
- sessionId: z12.string().nullable(),
2234
- state: z12.enum(["accepted", "workspace_ready", "started", "failed"]),
2363
+ folder: z13.string(),
2364
+ repositories: z13.array(ScannedRepository)
2365
+ });
2366
+ var ProjectSuggestion = z13.object({
2367
+ rootPath: z13.string(),
2368
+ sessionCount: z13.number().int(),
2369
+ lastActivityAt: z13.string()
2370
+ });
2371
+ var ProjectSuggestions = z13.object({ suggestions: z13.array(ProjectSuggestion) });
2372
+ var DiffFile = z13.object({
2373
+ path: z13.string(),
2374
+ oldPath: z13.string().nullable(),
2375
+ added: z13.number().int(),
2376
+ deleted: z13.number().int(),
2377
+ status: z13.enum(["added", "modified", "deleted", "renamed", "untracked", "binary"])
2378
+ });
2379
+ var DiffResult = z13.object({
2380
+ base: z13.string(),
2381
+ files: z13.array(DiffFile),
2382
+ patch: z13.string().nullable()
2383
+ });
2384
+ var FileEntry = z13.object({
2385
+ name: z13.string(),
2386
+ path: z13.string(),
2387
+ kind: z13.enum(["file", "dir", "symlink"]),
2388
+ size: z13.number().int().nullable()
2389
+ });
2390
+ var ReconcileResult = z13.union([
2391
+ z13.object({ known: z13.literal(false) }),
2392
+ z13.object({
2393
+ known: z13.literal(true),
2394
+ sessionId: z13.string().nullable(),
2395
+ state: z13.enum(["accepted", "workspace_ready", "started", "failed"]),
2235
2396
  runtime: RuntimeState.nullable(),
2236
- workspacePath: z12.string().nullable(),
2397
+ workspacePath: z13.string().nullable(),
2237
2398
  nativeHandle: NativeHandle.nullable(),
2238
- error: z12.string().nullable(),
2399
+ error: z13.string().nullable(),
2239
2400
  /** `{started: "unknown"}` when the host restarted after Pi may have been spawned. */
2240
- errorDetails: z12.record(z12.string(), z12.unknown()).nullable().default(null)
2401
+ errorDetails: z13.record(z13.string(), z13.unknown()).nullable().default(null)
2241
2402
  })
2242
2403
  ]);
2243
- var DispatchStartResult = z12.object({
2244
- sessionId: z12.string(),
2245
- workspacePath: z12.string(),
2404
+ var DispatchStartResult = z13.object({
2405
+ sessionId: z13.string(),
2406
+ workspacePath: z13.string(),
2246
2407
  nativeHandle: NativeHandle.nullable(),
2247
- reused: z12.boolean(),
2408
+ reused: z13.boolean(),
2248
2409
  /** Why the launch prompt was not delivered to Pi (the session itself started), if it was not. */
2249
- promptError: z12.string().nullable().optional()
2410
+ promptError: z13.string().nullable().optional()
2250
2411
  });
2251
- var AnswerResult = z12.object({
2252
- status: z12.enum(["answered", "already_answered"]),
2412
+ var AnswerResult = z13.object({
2413
+ status: z13.enum(["answered", "already_answered"]),
2253
2414
  interaction: Interaction
2254
2415
  });
2255
- var SnapshotResult = z12.object({
2256
- partial: z12.array(TranscriptItem),
2257
- pendingInteractions: z12.array(Interaction)
2416
+ var SnapshotResult = z13.object({
2417
+ partial: z13.array(TranscriptItem),
2418
+ pendingInteractions: z13.array(Interaction)
2258
2419
  });
2259
- var ChecksResult = z12.object({ results: z12.array(CheckResult) });
2260
- var Receipt = z12.union([
2261
- z12.object({ commandId: z12.string(), ok: z12.literal(true), result: z12.unknown() }),
2262
- z12.object({ commandId: z12.string(), ok: z12.literal(false), error: ErrorBody })
2420
+ var ChecksResult = z13.object({ results: z13.array(CheckResult) });
2421
+ var Receipt = z13.union([
2422
+ z13.object({ commandId: z13.string(), ok: z13.literal(true), result: z13.unknown() }),
2423
+ z13.object({ commandId: z13.string(), ok: z13.literal(false), error: ErrorBody })
2263
2424
  ]);
2264
2425
  var HostAgentRequestFrame = AgentRequestFrame.safeExtend({
2265
2426
  policyContext: HostToolPolicyContext.optional()
@@ -2278,279 +2439,281 @@ var HostAgentRequestFrame = AgentRequestFrame.safeExtend({
2278
2439
  }
2279
2440
  ctx.addIssue({ code: "custom", message: "Host agent frame exceeds 128 KiB or is not JSON." });
2280
2441
  });
2281
- var HostToCoordinator = z12.discriminatedUnion("type", [
2282
- z12.object({
2283
- type: z12.literal("hello"),
2284
- hostId: z12.string(),
2285
- credential: z12.string(),
2286
- name: z12.string(),
2287
- agentVersion: z12.string(),
2288
- piVersion: z12.string().nullable(),
2289
- piCompatible: z12.boolean(),
2442
+ var HostToCoordinator = z13.discriminatedUnion("type", [
2443
+ z13.object({
2444
+ type: z13.literal("hello"),
2445
+ hostId: z13.string(),
2446
+ credential: z13.string(),
2447
+ name: z13.string(),
2448
+ agentVersion: z13.string(),
2449
+ piVersion: z13.string().nullable(),
2450
+ piCompatible: z13.boolean(),
2290
2451
  platform: Platform,
2291
2452
  capabilities: RuntimeCapabilities.nullable(),
2292
2453
  github: HostGitHub.optional(),
2293
- protocolVersion: z12.number().int(),
2294
- features: z12.array(z12.string()).optional()
2454
+ protocolVersion: z13.number().int(),
2455
+ features: z13.array(z13.string()).optional()
2295
2456
  }),
2296
2457
  HostAgentRequestFrame,
2297
- z12.object({ type: z12.literal("event"), hostSeq: z12.number().int(), event: HostEvent }),
2298
- z12.object({ type: z12.literal("stream"), delta: StreamDelta }),
2299
- z12.object({ type: z12.literal("receipt"), receipt: Receipt }),
2300
- z12.object({ type: z12.literal("pong") }),
2301
- z12.object({ type: z12.literal("usage"), usage: z12.array(ProviderUsage) }),
2302
- z12.object({ type: z12.literal("term"), streamId: z12.string(), msg: TermServerToViewer })
2458
+ z13.object({ type: z13.literal("event"), hostSeq: z13.number().int(), event: HostEvent }),
2459
+ z13.object({ type: z13.literal("stream"), delta: StreamDelta }),
2460
+ z13.object({ type: z13.literal("receipt"), receipt: Receipt }),
2461
+ z13.object({ type: z13.literal("pong") }),
2462
+ z13.object({ type: z13.literal("usage"), usage: z13.array(ProviderUsage) }),
2463
+ z13.object({ type: z13.literal("term"), streamId: z13.string(), msg: TermServerToViewer })
2303
2464
  ]);
2304
- var CoordinatorToHost = z12.discriminatedUnion("type", [
2305
- z12.object({
2306
- type: z12.literal("welcome"),
2307
- coordinatorVersion: z12.string(),
2308
- ackedHostSeq: z12.number().int(),
2309
- features: z12.array(z12.string()).optional()
2465
+ var CoordinatorToHost = z13.discriminatedUnion("type", [
2466
+ z13.object({
2467
+ type: z13.literal("welcome"),
2468
+ coordinatorVersion: z13.string(),
2469
+ ackedHostSeq: z13.number().int(),
2470
+ features: z13.array(z13.string()).optional()
2310
2471
  }),
2311
2472
  AgentResultFrame,
2312
- z12.object({ type: z12.literal("ack"), hostSeq: z12.number().int() }),
2313
- z12.object({ type: z12.literal("command"), commandId: z12.string(), command: HostCommand }),
2314
- z12.object({ type: z12.literal("ping") }),
2315
- z12.object({ type: z12.literal("reject"), error: ErrorBody }),
2316
- z12.object({ type: z12.literal("term"), streamId: z12.string(), msg: TermCoordinatorMsg })
2473
+ z13.object({ type: z13.literal("ack"), hostSeq: z13.number().int() }),
2474
+ z13.object({ type: z13.literal("command"), commandId: z13.string(), command: HostCommand }),
2475
+ z13.object({ type: z13.literal("ping") }),
2476
+ z13.object({ type: z13.literal("reject"), error: ErrorBody }),
2477
+ z13.object({ type: z13.literal("term"), streamId: z13.string(), msg: TermCoordinatorMsg })
2317
2478
  ]);
2318
2479
 
2319
2480
  // packages/protocol/dist/api.js
2320
- var EnrollRequest = z13.object({
2321
- token: z13.string().min(1),
2322
- name: z13.string().min(1).max(80),
2481
+ var EnrollRequest = z14.object({
2482
+ token: z14.string().min(1),
2483
+ name: z14.string().min(1).max(80),
2323
2484
  kind: DeviceKind
2324
2485
  });
2325
- var EnrollResponse = z13.object({ deviceId: z13.string(), credential: z13.string() });
2326
- var CreateEnrollmentRequest = z13.object({ kind: z13.enum(["device", "host"]) });
2327
- var CreateEnrollmentResponse = z13.object({
2328
- token: z13.string(),
2329
- url: z13.string(),
2330
- expiresAt: z13.string(),
2331
- qrSvg: z13.string(),
2332
- command: z13.string().nullable()
2486
+ var EnrollResponse = z14.object({ deviceId: z14.string(), credential: z14.string() });
2487
+ var CreateEnrollmentRequest = z14.object({ kind: z14.enum(["device", "host"]) });
2488
+ var CreateEnrollmentResponse = z14.object({
2489
+ token: z14.string(),
2490
+ url: z14.string(),
2491
+ expiresAt: z14.string(),
2492
+ qrSvg: z14.string(),
2493
+ command: z14.string().nullable()
2333
2494
  });
2334
- var HostEnrollRequest = z13.union([
2335
- z13.object({
2336
- token: z13.string().min(1),
2337
- name: z13.string().min(1).max(80),
2495
+ var HostEnrollRequest = z14.union([
2496
+ z14.object({
2497
+ token: z14.string().min(1),
2498
+ name: z14.string().min(1).max(80),
2338
2499
  platform: Platform
2339
2500
  }),
2340
- z13.object({
2341
- secret: z13.string().min(1),
2342
- name: z13.string().min(1).max(80),
2501
+ z14.object({
2502
+ secret: z14.string().min(1),
2503
+ name: z14.string().min(1).max(80),
2343
2504
  platform: Platform
2344
2505
  })
2345
2506
  ]);
2346
- var HostEnrollResponse = z13.object({ hostId: z13.string(), credential: z13.string() });
2347
- var CreateProjectRequest = z13.object({
2348
- name: z13.string().min(1),
2349
- hostId: z13.string(),
2350
- path: z13.string().min(1),
2351
- defaultProfileId: z13.string().nullable().optional(),
2352
- setupCommand: z13.string().nullable().optional(),
2353
- checks: z13.array(z13.string()).optional(),
2354
- maxConcurrentRuns: z13.number().int().min(1).max(32).optional(),
2507
+ var HostEnrollResponse = z14.object({ hostId: z14.string(), credential: z14.string() });
2508
+ var CreateProjectRequest = z14.object({
2509
+ name: z14.string().min(1),
2510
+ hostId: z14.string(),
2511
+ path: z14.string().min(1),
2512
+ defaultProfileId: z14.string().nullable().optional(),
2513
+ setupCommand: z14.string().nullable().optional(),
2514
+ checks: z14.array(z14.string()).optional(),
2515
+ maxConcurrentRuns: z14.number().int().min(1).max(32).optional(),
2355
2516
  worktreeDir: WorktreeDir.optional()
2356
2517
  });
2357
- var UpdateProjectRequest = z13.object({
2358
- name: z13.string().min(1).optional(),
2359
- defaultProfileId: z13.string().nullable().optional(),
2360
- defaultHostId: z13.string().nullable().optional(),
2361
- maxConcurrentRuns: z13.number().int().min(1).max(32).optional(),
2362
- automationEnabled: z13.boolean().optional(),
2363
- setupCommand: z13.string().nullable().optional(),
2364
- checks: z13.array(z13.string()).optional(),
2365
- workspaceSharing: z13.enum(["single_writer", "shared"]).optional(),
2366
- worktreeDir: WorktreeDir.optional()
2367
- });
2368
- var AddCheckoutRequest = z13.object({ hostId: z13.string(), path: z13.string().min(1) });
2518
+ var UpdateProjectRequest = z14.object({
2519
+ name: z14.string().min(1).optional(),
2520
+ defaultProfileId: z14.string().nullable().optional(),
2521
+ defaultHostId: z14.string().nullable().optional(),
2522
+ maxConcurrentRuns: z14.number().int().min(1).max(32).optional(),
2523
+ automationEnabled: z14.boolean().optional(),
2524
+ setupCommand: z14.string().nullable().optional(),
2525
+ checks: z14.array(z14.string()).optional(),
2526
+ workspaceSharing: z14.enum(["single_writer", "shared"]).optional(),
2527
+ worktreeDir: WorktreeDir.optional(),
2528
+ ensureSessions: z14.boolean().optional(),
2529
+ removeLanded: z14.boolean().optional()
2530
+ });
2531
+ var AddCheckoutRequest = z14.object({ hostId: z14.string(), path: z14.string().min(1) });
2369
2532
  function isProjectFolderPath(s) {
2370
2533
  if (s.includes("\0"))
2371
2534
  return false;
2372
2535
  return s === "~" || s.startsWith("~/") || s.startsWith("/");
2373
2536
  }
2374
- var ProjectFolder = z13.string().trim().min(1).max(1024).refine(isProjectFolderPath, "must be an absolute path or start with ~/");
2375
- var UpdateHostRequest = z13.object({
2376
- projectFolders: z13.array(ProjectFolder).max(20).optional()
2537
+ var ProjectFolder = z14.string().trim().min(1).max(1024).refine(isProjectFolderPath, "must be an absolute path or start with ~/");
2538
+ var UpdateHostRequest = z14.object({
2539
+ projectFolders: z14.array(ProjectFolder).max(20).optional()
2377
2540
  });
2378
2541
  var ProjectScanResult = ProjectScan.extend({
2379
- added: z13.array(z13.object({
2380
- projectId: z13.string(),
2381
- name: z13.string(),
2382
- path: z13.string(),
2383
- newProject: z13.boolean()
2542
+ added: z14.array(z14.object({
2543
+ projectId: z14.string(),
2544
+ name: z14.string(),
2545
+ path: z14.string(),
2546
+ newProject: z14.boolean()
2384
2547
  }))
2385
2548
  });
2386
- var ProfileInput = z13.object({
2387
- name: z13.string().min(1),
2388
- provider: z13.string().nullable().default(null),
2389
- model: z13.string().nullable().default(null),
2549
+ var ProfileInput = z14.object({
2550
+ name: z14.string().min(1),
2551
+ provider: z14.string().nullable().default(null),
2552
+ model: z14.string().nullable().default(null),
2390
2553
  thinking: ThinkingLevel.nullable().default(null),
2391
- projectTrust: z13.enum(["ask", "approve", "ignore"]).default("ask"),
2392
- extraArgs: z13.array(ExtraArg).default([]),
2393
- resources: z13.enum(["all", "vanilla"]).default("all")
2394
- });
2395
- var CreateWorkspaceRequest = z13.object({
2396
- checkoutId: z13.string(),
2397
- branch: z13.string().min(1),
2398
- base: z13.string().nullable().optional()
2399
- });
2400
- var RemoveWorkspaceRequest = z13.object({
2401
- force: z13.object({ dirty: z13.boolean(), unmerged: z13.boolean() }).default({ dirty: false, unmerged: false })
2402
- });
2403
- var CreateSessionRequest = z13.object({
2404
- projectId: z13.string(),
2405
- workspace: z13.union([
2406
- z13.object({ existingId: z13.string() }),
2407
- z13.object({
2408
- checkoutId: z13.string(),
2409
- newBranch: z13.string().min(1),
2410
- base: z13.string().nullable().optional()
2554
+ projectTrust: z14.enum(["ask", "approve", "ignore"]).default("ask"),
2555
+ extraArgs: z14.array(ExtraArg).default([]),
2556
+ resources: z14.enum(["all", "vanilla"]).default("all")
2557
+ });
2558
+ var CreateWorkspaceRequest = z14.object({
2559
+ checkoutId: z14.string(),
2560
+ branch: z14.string().min(1),
2561
+ base: z14.string().nullable().optional()
2562
+ });
2563
+ var RemoveWorkspaceRequest = z14.object({
2564
+ force: z14.object({ dirty: z14.boolean(), unmerged: z14.boolean() }).default({ dirty: false, unmerged: false })
2565
+ });
2566
+ var CreateSessionRequest = z14.object({
2567
+ projectId: z14.string(),
2568
+ workspace: z14.union([
2569
+ z14.object({ existingId: z14.string() }),
2570
+ z14.object({
2571
+ checkoutId: z14.string(),
2572
+ newBranch: z14.string().min(1),
2573
+ base: z14.string().nullable().optional()
2411
2574
  })
2412
2575
  ]),
2413
- profileId: z13.string().nullable().optional(),
2414
- prompt: z13.string().default(""),
2415
- title: z13.string().optional(),
2416
- viewId: z13.string().optional()
2417
- });
2418
- var PromptRequest = z13.object({
2419
- text: z13.string().min(1),
2420
- mode: z13.enum(["prompt", "steer", "followUp"]).default("prompt"),
2421
- images: z13.array(z13.object({ mimeType: z13.string(), data: z13.string() })).default([]),
2422
- clientMessageId: z13.string().optional()
2423
- });
2424
- var CacheAlertRequest = z13.object({
2425
- enabled: z13.boolean(),
2426
- ttlSec: z13.number().int().min(60).max(86400).nullable().default(null)
2427
- });
2428
- var RenameRequest = z13.object({ title: z13.string().min(1).max(200) });
2429
- var SetModelRequest = z13.object({
2430
- provider: z13.string().min(1),
2431
- modelId: z13.string().min(1)
2432
- });
2433
- var SetThinkingRequest = z13.object({ level: ThinkingLevel });
2434
- var CompactRequest = z13.object({ instructions: z13.string().max(4e3).optional() });
2435
- var SessionModelsResult = z13.object({ models: z13.array(SessionModel) });
2436
- var SessionCommandsResult = z13.object({ commands: z13.array(SlashCommand) });
2437
- var CompleteRequest = z13.object({ text: z13.string().min(1).max(500) });
2438
- var CompletionItem = z13.object({
2439
- value: z13.string(),
2440
- label: z13.string(),
2441
- description: z13.string().nullable()
2442
- });
2443
- var SessionCompleteResult = z13.object({
2444
- items: z13.array(CompletionItem).max(50),
2445
- prefix: z13.string()
2446
- });
2447
- var TreeRow = z13.object({
2448
- entryId: z13.string(),
2449
- parentId: z13.string().nullable(),
2450
- depth: z13.number().int(),
2451
- role: z13.enum(["user", "assistant"]),
2452
- text: z13.string(),
2453
- activeBranch: z13.boolean(),
2454
- leaf: z13.boolean(),
2455
- label: z13.string().nullable(),
2456
- at: z13.string().nullable()
2457
- });
2458
- var SessionTreeResult = z13.object({ rows: z13.array(TreeRow) });
2459
- var BranchRequest = z13.object({
2460
- entryId: z13.string().nullable(),
2461
- fork: z13.boolean().default(false)
2462
- });
2463
- var HostBranchResult = z13.object({
2464
- sessionFile: z13.string().nullable(),
2465
- prefill: z13.string().nullable()
2466
- });
2467
- var TranscriptPage = z13.object({
2468
- items: z13.array(TranscriptItem),
2469
- hasMore: z13.boolean(),
2470
- epoch: z13.number().int().optional(),
2471
- rev: z13.number().int().optional(),
2472
- delta: z13.boolean().optional(),
2473
- reset: z13.boolean().optional()
2474
- });
2475
- var NavigateRequest = z13.object({
2476
- entryId: z13.string().min(1),
2477
- summarize: z13.boolean().default(false),
2478
- instructions: z13.string().max(2e3).nullable().default(null)
2479
- });
2480
- var HostNavigateResult = z13.object({
2481
- items: z13.array(TranscriptItem),
2482
- prefill: z13.string().nullable()
2483
- });
2484
- var NavigateResult = z13.object({
2485
- prefill: z13.string().nullable(),
2486
- epoch: z13.number().int()
2487
- });
2488
- var BranchResult = z13.object({
2576
+ profileId: z14.string().nullable().optional(),
2577
+ prompt: z14.string().default(""),
2578
+ title: z14.string().optional(),
2579
+ viewId: z14.string().optional()
2580
+ });
2581
+ var PromptRequest = z14.object({
2582
+ text: z14.string().min(1),
2583
+ mode: z14.enum(["prompt", "steer", "followUp"]).default("prompt"),
2584
+ images: z14.array(z14.object({ mimeType: z14.string(), data: z14.string() })).default([]),
2585
+ clientMessageId: z14.string().optional()
2586
+ });
2587
+ var CacheAlertRequest = z14.object({
2588
+ enabled: z14.boolean(),
2589
+ ttlSec: z14.number().int().min(60).max(86400).nullable().default(null)
2590
+ });
2591
+ var RenameRequest = z14.object({ title: z14.string().min(1).max(200) });
2592
+ var SetModelRequest = z14.object({
2593
+ provider: z14.string().min(1),
2594
+ modelId: z14.string().min(1)
2595
+ });
2596
+ var SetThinkingRequest = z14.object({ level: ThinkingLevel });
2597
+ var CompactRequest = z14.object({ instructions: z14.string().max(4e3).optional() });
2598
+ var SessionModelsResult = z14.object({ models: z14.array(SessionModel) });
2599
+ var SessionCommandsResult = z14.object({ commands: z14.array(SlashCommand) });
2600
+ var CompleteRequest = z14.object({ text: z14.string().min(1).max(500) });
2601
+ var CompletionItem = z14.object({
2602
+ value: z14.string(),
2603
+ label: z14.string(),
2604
+ description: z14.string().nullable()
2605
+ });
2606
+ var SessionCompleteResult = z14.object({
2607
+ items: z14.array(CompletionItem).max(50),
2608
+ prefix: z14.string()
2609
+ });
2610
+ var TreeRow = z14.object({
2611
+ entryId: z14.string(),
2612
+ parentId: z14.string().nullable(),
2613
+ depth: z14.number().int(),
2614
+ role: z14.enum(["user", "assistant"]),
2615
+ text: z14.string(),
2616
+ activeBranch: z14.boolean(),
2617
+ leaf: z14.boolean(),
2618
+ label: z14.string().nullable(),
2619
+ at: z14.string().nullable()
2620
+ });
2621
+ var SessionTreeResult = z14.object({ rows: z14.array(TreeRow) });
2622
+ var BranchRequest = z14.object({
2623
+ entryId: z14.string().nullable(),
2624
+ fork: z14.boolean().default(false)
2625
+ });
2626
+ var HostBranchResult = z14.object({
2627
+ sessionFile: z14.string().nullable(),
2628
+ prefill: z14.string().nullable()
2629
+ });
2630
+ var TranscriptPage = z14.object({
2631
+ items: z14.array(TranscriptItem),
2632
+ hasMore: z14.boolean(),
2633
+ epoch: z14.number().int().optional(),
2634
+ rev: z14.number().int().optional(),
2635
+ delta: z14.boolean().optional(),
2636
+ reset: z14.boolean().optional()
2637
+ });
2638
+ var NavigateRequest = z14.object({
2639
+ entryId: z14.string().min(1),
2640
+ summarize: z14.boolean().default(false),
2641
+ instructions: z14.string().max(2e3).nullable().default(null)
2642
+ });
2643
+ var HostNavigateResult = z14.object({
2644
+ items: z14.array(TranscriptItem),
2645
+ prefill: z14.string().nullable()
2646
+ });
2647
+ var NavigateResult = z14.object({
2648
+ prefill: z14.string().nullable(),
2649
+ epoch: z14.number().int()
2650
+ });
2651
+ var BranchResult = z14.object({
2489
2652
  session: Session.nullable(),
2490
- prefill: z13.string().nullable()
2653
+ prefill: z14.string().nullable()
2491
2654
  });
2492
- var SessionExportResult = z13.object({ fileName: z13.string(), content: z13.string() });
2493
- var CommandViewAction = z13.object({
2494
- label: z13.string().min(1).max(80),
2495
- command: z13.string().startsWith("/").max(500),
2496
- tone: z13.enum(["default", "primary", "danger"]).optional()
2655
+ var SessionExportResult = z14.object({ fileName: z14.string(), content: z14.string() });
2656
+ var CommandViewAction = z14.object({
2657
+ label: z14.string().min(1).max(80),
2658
+ command: z14.string().startsWith("/").max(500),
2659
+ tone: z14.enum(["default", "primary", "danger"]).optional()
2497
2660
  });
2498
- var CommandView = z13.object({
2499
- title: z13.string().min(1).max(200),
2661
+ var CommandView = z14.object({
2662
+ title: z14.string().min(1).max(200),
2500
2663
  body: UINodeSchema,
2501
- actions: z13.array(CommandViewAction).max(30).default([])
2664
+ actions: z14.array(CommandViewAction).max(30).default([])
2502
2665
  });
2503
- var ModelStateResult = z13.object({
2666
+ var ModelStateResult = z14.object({
2504
2667
  model: SessionModel.nullable(),
2505
2668
  thinking: ThinkingLevel.nullable()
2506
2669
  });
2507
- var ImportSessionRequest = z13.object({
2508
- hostId: z13.string(),
2509
- sessionFile: z13.string(),
2510
- projectId: z13.string().nullable().optional()
2670
+ var ImportSessionRequest = z14.object({
2671
+ hostId: z14.string(),
2672
+ sessionFile: z14.string(),
2673
+ projectId: z14.string().nullable().optional()
2511
2674
  });
2512
- var AnswerRequest = z13.object({
2513
- revision: z13.number().int(),
2675
+ var AnswerRequest = z14.object({
2676
+ revision: z14.number().int(),
2514
2677
  response: InteractionResponseSchema
2515
2678
  });
2516
- var AdapterActionRequest = z13.object({
2517
- generation: z13.string().uuid().optional(),
2518
- adapterId: z13.string(),
2519
- actionId: z13.string(),
2520
- payload: z13.unknown().optional()
2521
- });
2522
- var TaskPolicyPatch = z13.object({
2523
- hostId: z13.string().nullable().optional(),
2524
- profileId: z13.string().nullable().optional(),
2525
- workspace: z13.object({
2526
- mode: z13.enum(["new_worktree", "existing"]).optional(),
2527
- branch: z13.string().nullable().optional(),
2528
- base: z13.string().nullable().optional(),
2529
- workspaceId: z13.string().optional()
2679
+ var AdapterActionRequest = z14.object({
2680
+ generation: z14.string().uuid().optional(),
2681
+ adapterId: z14.string(),
2682
+ actionId: z14.string(),
2683
+ payload: z14.unknown().optional()
2684
+ });
2685
+ var TaskPolicyPatch = z14.object({
2686
+ hostId: z14.string().nullable().optional(),
2687
+ profileId: z14.string().nullable().optional(),
2688
+ workspace: z14.object({
2689
+ mode: z14.enum(["new_worktree", "existing"]).optional(),
2690
+ branch: z14.string().nullable().optional(),
2691
+ base: z14.string().nullable().optional(),
2692
+ workspaceId: z14.string().optional()
2530
2693
  }).optional(),
2531
- continuation: z13.object({
2532
- enabled: z13.boolean().optional(),
2533
- objective: z13.string().min(1).optional(),
2534
- maxContinuations: z13.number().int().min(1).max(50).optional(),
2535
- maxElapsedMinutes: z13.number().int().min(1).max(1440).optional(),
2536
- maxTokens: z13.number().int().positive().nullable().optional(),
2537
- maxCostUsd: z13.number().positive().nullable().optional()
2694
+ continuation: z14.object({
2695
+ enabled: z14.boolean().optional(),
2696
+ objective: z14.string().min(1).optional(),
2697
+ maxContinuations: z14.number().int().min(1).max(50).optional(),
2698
+ maxElapsedMinutes: z14.number().int().min(1).max(1440).optional(),
2699
+ maxTokens: z14.number().int().positive().nullable().optional(),
2700
+ maxCostUsd: z14.number().positive().nullable().optional()
2538
2701
  }).optional(),
2539
2702
  completion: CompletionPolicy.partial().optional()
2540
2703
  });
2541
- var CreateTaskRequest = z13.object({
2542
- projectId: z13.string(),
2543
- title: z13.string().max(300).optional(),
2704
+ var CreateTaskRequest = z14.object({
2705
+ projectId: z14.string(),
2706
+ title: z14.string().max(300).optional(),
2544
2707
  githubIssueUrl: GitHubIssueUrl.optional(),
2545
- githubIssue: z13.never().optional(),
2546
- launchPrompt: z13.never().optional(),
2547
- objective: z13.string().default(""),
2548
- acceptanceCriteria: z13.array(z13.string()).default([]),
2549
- dependencies: z13.array(z13.string()).default([]),
2550
- parentTaskId: z13.string().nullable().optional(),
2708
+ githubIssue: z14.never().optional(),
2709
+ launchPrompt: z14.never().optional(),
2710
+ objective: z14.string().default(""),
2711
+ acceptanceCriteria: z14.array(z14.string()).default([]),
2712
+ dependencies: z14.array(z14.string()).default([]),
2713
+ parentTaskId: z14.string().nullable().optional(),
2551
2714
  priority: Priority.default(2),
2552
- state: z13.enum(["backlog", "ready"]).default("backlog"),
2553
- notBefore: z13.string().nullable().optional(),
2715
+ state: z14.enum(["backlog", "ready"]).default("backlog"),
2716
+ notBefore: z14.string().nullable().optional(),
2554
2717
  policy: TaskPolicyPatch.optional()
2555
2718
  }).superRefine((v, ctx) => {
2556
2719
  if (v.githubIssueUrl === void 0) {
@@ -2588,32 +2751,33 @@ var CreateTaskRequest = z13.object({
2588
2751
  const issue = githubIssueFromUrl(v.githubIssueUrl);
2589
2752
  return { ...v, title: v.title?.trim() || `${issue.repository} #${issue.number}` };
2590
2753
  });
2591
- var UpdateTaskRequest = z13.object({
2592
- githubIssueUrl: z13.never().optional(),
2593
- githubIssue: z13.never().optional(),
2594
- launchPrompt: z13.never().optional(),
2595
- title: z13.string().min(1).max(300).optional(),
2596
- objective: z13.string().optional(),
2597
- acceptanceCriteria: z13.array(z13.string()).optional(),
2598
- dependencies: z13.array(z13.string()).optional(),
2599
- parentTaskId: z13.string().nullable().optional(),
2754
+ var UpdateTaskRequest = z14.object({
2755
+ githubIssueUrl: z14.never().optional(),
2756
+ githubIssue: z14.never().optional(),
2757
+ launchPrompt: z14.never().optional(),
2758
+ tracker: z14.never().optional(),
2759
+ title: z14.string().min(1).max(300).optional(),
2760
+ objective: z14.string().optional(),
2761
+ acceptanceCriteria: z14.array(z14.string()).optional(),
2762
+ dependencies: z14.array(z14.string()).optional(),
2763
+ parentTaskId: z14.string().nullable().optional(),
2600
2764
  priority: Priority.optional(),
2601
- position: z13.number().optional(),
2602
- notBefore: z13.string().nullable().optional(),
2765
+ position: z14.number().optional(),
2766
+ notBefore: z14.string().nullable().optional(),
2603
2767
  policy: TaskPolicyPatch.optional()
2604
2768
  });
2605
- var MoveTaskRequest = z13.object({
2769
+ var MoveTaskRequest = z14.object({
2606
2770
  to: TaskState,
2607
- confirm: z13.boolean().optional(),
2608
- onRunning: z13.enum(["pause", "stop"]).optional(),
2609
- position: z13.number().optional()
2771
+ confirm: z14.boolean().optional(),
2772
+ onRunning: z14.enum(["pause", "stop"]).optional(),
2773
+ position: z14.number().optional()
2610
2774
  });
2611
- var RequestChangesRequest = z13.object({ feedback: z13.array(z13.string().min(1)).min(1) });
2612
- var Eligibility = z13.union([
2613
- z13.object({ eligible: z13.literal(true), hostId: z13.string(), hostName: z13.string() }),
2614
- z13.object({
2615
- eligible: z13.literal(false),
2616
- wait: z13.enum([
2775
+ var RequestChangesRequest = z14.object({ feedback: z14.array(z14.string().min(1)).min(1) });
2776
+ var Eligibility = z14.union([
2777
+ z14.object({ eligible: z14.literal(true), hostId: z14.string(), hostName: z14.string() }),
2778
+ z14.object({
2779
+ eligible: z14.literal(false),
2780
+ wait: z14.enum([
2617
2781
  "dependency",
2618
2782
  "host_offline",
2619
2783
  "project_limit",
@@ -2626,151 +2790,152 @@ var Eligibility = z13.union([
2626
2790
  "already_dispatched",
2627
2791
  "retry_backoff"
2628
2792
  ]),
2629
- message: z13.string()
2793
+ message: z14.string()
2630
2794
  })
2631
2795
  ]);
2632
- var NowResponse = z13.object({
2633
- running: z13.array(z13.object({ taskId: z13.string(), runId: z13.string(), sessionId: z13.string().nullable() })),
2634
- queued: z13.array(z13.object({ taskId: z13.string(), eligibility: Eligibility })),
2635
- dispatchPaused: z13.boolean()
2636
- });
2637
- var AutomationInput = z13.object({
2638
- name: z13.string().min(1),
2639
- enabled: z13.boolean().default(true),
2640
- projectId: z13.string(),
2796
+ var NowResponse = z14.object({
2797
+ running: z14.array(z14.object({ taskId: z14.string(), runId: z14.string(), sessionId: z14.string().nullable() })),
2798
+ queued: z14.array(z14.object({ taskId: z14.string(), eligibility: Eligibility })),
2799
+ dispatchPaused: z14.boolean()
2800
+ });
2801
+ var AutomationInput = z14.object({
2802
+ name: z14.string().min(1),
2803
+ enabled: z14.boolean().default(true),
2804
+ projectId: z14.string(),
2641
2805
  trigger: Trigger,
2642
- filters: z13.array(z13.object({ path: z13.string(), equals: z13.string() })).default([]),
2806
+ filters: z14.array(z14.object({ path: z14.string(), equals: z14.string() })).default([]),
2643
2807
  template: TaskTemplate,
2644
- hostId: z13.string().nullable().default(null),
2645
- profileId: z13.string().nullable().default(null),
2646
- mode: z13.enum(["fresh", "continue", "watch"]).default("fresh"),
2647
- groupingKey: z13.string().nullable().default(null),
2648
- overlap: z13.enum(["skip", "queue_one", "append"]).default("skip"),
2649
- missed: z13.enum(["skip", "run_once"]).default("skip"),
2808
+ hostId: z14.string().nullable().default(null),
2809
+ profileId: z14.string().nullable().default(null),
2810
+ mode: z14.enum(["fresh", "continue", "watch"]).default("fresh"),
2811
+ groupingKey: z14.string().nullable().default(null),
2812
+ overlap: z14.enum(["skip", "queue_one", "append"]).default("skip"),
2813
+ missed: z14.enum(["skip", "run_once"]).default("skip"),
2650
2814
  continuation: ContinuationPolicy.default({ enabled: false }),
2651
2815
  completion: CompletionPolicy.default({ checks: null, requireHumanReview: true })
2652
2816
  });
2653
- var AutomationView = Automation.extend({ summary: z13.string() });
2654
- var AutomationPreview = z13.object({
2655
- summary: z13.string(),
2817
+ var AutomationView = Automation.extend({ summary: z14.string() });
2818
+ var AutomationPreview = z14.object({
2819
+ summary: z14.string(),
2656
2820
  task: TaskTemplate,
2657
- next: z13.array(z13.string())
2658
- });
2659
- var WebhookTokenResponse = z13.object({ token: z13.string(), url: z13.string() });
2660
- var PushSubscriptionRequest = z13.object({
2661
- endpoint: z13.string().url(),
2662
- keys: z13.object({ p256dh: z13.string(), auth: z13.string() }),
2663
- permission: z13.enum(["granted", "denied", "default", "unknown"]).default("granted")
2664
- });
2665
- var NotificationSettings = z13.object({
2666
- quietHours: z13.object({
2667
- start: z13.string().regex(/^\d{2}:\d{2}$/),
2668
- end: z13.string().regex(/^\d{2}:\d{2}$/),
2669
- timezone: z13.string()
2821
+ next: z14.array(z14.string())
2822
+ });
2823
+ var WebhookTokenResponse = z14.object({ token: z14.string(), url: z14.string() });
2824
+ var PushSubscriptionRequest = z14.object({
2825
+ endpoint: z14.string().url(),
2826
+ keys: z14.object({ p256dh: z14.string(), auth: z14.string() }),
2827
+ permission: z14.enum(["granted", "denied", "default", "unknown"]).default("granted")
2828
+ });
2829
+ var NotificationSettings = z14.object({
2830
+ quietHours: z14.object({
2831
+ start: z14.string().regex(/^\d{2}:\d{2}$/),
2832
+ end: z14.string().regex(/^\d{2}:\d{2}$/),
2833
+ timezone: z14.string()
2670
2834
  }).nullable(),
2671
- privatePreviews: z13.boolean(),
2672
- preferredDeviceId: z13.string().nullable()
2835
+ privatePreviews: z14.boolean(),
2836
+ preferredDeviceId: z14.string().nullable()
2673
2837
  });
2674
- var PushPayload = z13.union([
2675
- z13.object({
2676
- type: z13.literal("show"),
2677
- title: z13.string(),
2678
- body: z13.string(),
2679
- tag: z13.string(),
2680
- url: z13.string(),
2681
- renotify: z13.boolean()
2838
+ var PushPayload = z14.union([
2839
+ z14.object({
2840
+ type: z14.literal("show"),
2841
+ title: z14.string(),
2842
+ body: z14.string(),
2843
+ tag: z14.string(),
2844
+ url: z14.string(),
2845
+ renotify: z14.boolean()
2682
2846
  }),
2683
- z13.object({ type: z13.literal("clear"), tag: z13.string() })
2847
+ z14.object({ type: z14.literal("clear"), tag: z14.string() })
2684
2848
  ]);
2685
- var SetupState = z13.object({
2686
- passkey: z13.object({
2687
- available: z13.boolean(),
2688
- registered: z13.boolean(),
2689
- reason: z13.string().nullable()
2849
+ var SetupState = z14.object({
2850
+ passkey: z14.object({
2851
+ available: z14.boolean(),
2852
+ registered: z14.boolean(),
2853
+ reason: z14.string().nullable()
2690
2854
  }),
2691
- oidc: z13.object({ label: z13.string() }).nullable()
2855
+ oidc: z14.object({ label: z14.string() }).nullable()
2692
2856
  });
2693
- var PasskeyRegisterOptionsResponse = z13.object({
2694
- challengeId: z13.string(),
2695
- options: z13.unknown()
2857
+ var PasskeyRegisterOptionsResponse = z14.object({
2858
+ challengeId: z14.string(),
2859
+ options: z14.unknown()
2696
2860
  });
2697
- var PasskeyRegisterVerifyRequest = z13.object({
2698
- challengeId: z13.string(),
2699
- name: z13.string().min(1).max(80),
2700
- response: z13.unknown()
2861
+ var PasskeyRegisterVerifyRequest = z14.object({
2862
+ challengeId: z14.string(),
2863
+ name: z14.string().min(1).max(80),
2864
+ response: z14.unknown()
2701
2865
  });
2702
- var PasskeySignInOptionsResponse = z13.object({
2703
- challengeId: z13.string(),
2704
- options: z13.unknown()
2866
+ var PasskeySignInOptionsResponse = z14.object({
2867
+ challengeId: z14.string(),
2868
+ options: z14.unknown()
2705
2869
  });
2706
- var PasskeySignInVerifyRequest = z13.object({
2707
- challengeId: z13.string(),
2708
- response: z13.unknown(),
2709
- deviceName: z13.string().min(1).max(80),
2870
+ var PasskeySignInVerifyRequest = z14.object({
2871
+ challengeId: z14.string(),
2872
+ response: z14.unknown(),
2873
+ deviceName: z14.string().min(1).max(80),
2710
2874
  kind: DeviceKind.extract(["browser", "pwa"])
2711
2875
  });
2712
- var OidcBeginRequest = z13.object({
2713
- deviceName: z13.string().min(1).max(80),
2876
+ var OidcBeginRequest = z14.object({
2877
+ deviceName: z14.string().min(1).max(80),
2714
2878
  kind: DeviceKind.extract(["browser", "pwa"]),
2715
- next: z13.string().default("/"),
2716
- handoff: z13.boolean().default(false)
2717
- });
2718
- var OidcBeginResponse = z13.object({
2719
- authorizeUrl: z13.string(),
2720
- flowId: z13.string().nullable(),
2721
- pollToken: z13.string().nullable()
2722
- });
2723
- var OidcClaimRequest = z13.object({ flowId: z13.string(), pollToken: z13.string() });
2724
- var OidcClaimResponse = z13.union([
2725
- z13.object({ status: z13.literal("pending") }),
2726
- z13.object({ status: z13.literal("done"), deviceId: z13.string() })
2879
+ next: z14.string().default("/"),
2880
+ handoff: z14.boolean().default(false)
2881
+ });
2882
+ var OidcBeginResponse = z14.object({
2883
+ authorizeUrl: z14.string(),
2884
+ flowId: z14.string().nullable(),
2885
+ pollToken: z14.string().nullable()
2886
+ });
2887
+ var OidcClaimRequest = z14.object({ flowId: z14.string(), pollToken: z14.string() });
2888
+ var OidcClaimResponse = z14.union([
2889
+ z14.object({ status: z14.literal("pending") }),
2890
+ z14.object({ status: z14.literal("done"), deviceId: z14.string() })
2727
2891
  ]);
2728
- var TerminalLoginStartRequest = z13.object({ name: z13.string().min(1).max(80) });
2729
- var TerminalLoginStartResponse = z13.object({
2730
- userCode: z13.string(),
2731
- pollToken: z13.string(),
2732
- verifyUrl: z13.string(),
2733
- expiresAt: z13.string(),
2734
- intervalMs: z13.number().int()
2735
- });
2736
- var TerminalLoginClaimRequest = z13.object({
2737
- userCode: z13.string().min(1),
2738
- pollToken: z13.string().min(1)
2739
- });
2740
- var TerminalLoginClaimResponse = z13.union([
2741
- z13.object({ status: z13.literal("pending") }),
2742
- z13.object({ status: z13.literal("denied") }),
2743
- z13.object({ status: z13.literal("done"), deviceId: z13.string(), credential: z13.string() })
2892
+ var TerminalLoginStartRequest = z14.object({ name: z14.string().min(1).max(80) });
2893
+ var TerminalLoginStartResponse = z14.object({
2894
+ userCode: z14.string(),
2895
+ pollToken: z14.string(),
2896
+ verifyUrl: z14.string(),
2897
+ expiresAt: z14.string(),
2898
+ intervalMs: z14.number().int()
2899
+ });
2900
+ var TerminalLoginClaimRequest = z14.object({
2901
+ userCode: z14.string().min(1),
2902
+ pollToken: z14.string().min(1)
2903
+ });
2904
+ var TerminalLoginClaimResponse = z14.union([
2905
+ z14.object({ status: z14.literal("pending") }),
2906
+ z14.object({ status: z14.literal("denied") }),
2907
+ z14.object({ status: z14.literal("done"), deviceId: z14.string(), credential: z14.string() })
2744
2908
  ]);
2745
- var TerminalLoginRequest = z13.object({
2746
- userCode: z13.string(),
2747
- name: z13.string(),
2748
- requestedFrom: z13.string(),
2749
- createdAt: z13.string(),
2750
- expiresAt: z13.string(),
2751
- status: z13.enum(["pending", "approved", "denied"])
2752
- });
2753
- var AuthMethods = z13.object({
2754
- passkeys: z13.array(Passkey),
2755
- passkeyAvailability: z13.object({ available: z13.boolean(), reason: z13.string().nullable() }),
2756
- oidc: z13.object({
2757
- issuer: z13.string(),
2758
- label: z13.string(),
2759
- ownerMatch: z13.string(),
2760
- status: z13.enum(["ready", "error"]),
2761
- error: z13.string().nullable()
2909
+ var TerminalLoginRequest = z14.object({
2910
+ userCode: z14.string(),
2911
+ name: z14.string(),
2912
+ requestedFrom: z14.string(),
2913
+ createdAt: z14.string(),
2914
+ expiresAt: z14.string(),
2915
+ status: z14.enum(["pending", "approved", "denied"])
2916
+ });
2917
+ var AuthMethods = z14.object({
2918
+ passkeys: z14.array(Passkey),
2919
+ passkeyAvailability: z14.object({ available: z14.boolean(), reason: z14.string().nullable() }),
2920
+ oidc: z14.object({
2921
+ issuer: z14.string(),
2922
+ label: z14.string(),
2923
+ ownerMatch: z14.string(),
2924
+ status: z14.enum(["ready", "error"]),
2925
+ error: z14.string().nullable()
2762
2926
  }).nullable()
2763
2927
  });
2764
- var MeResponse = z13.object({
2928
+ var MeResponse = z14.object({
2765
2929
  device: Device,
2766
- admin: z13.boolean(),
2767
- publicUrl: z13.string()
2930
+ admin: z14.boolean(),
2931
+ publicUrl: z14.string()
2768
2932
  });
2769
2933
  var ViewInput = View.pick({
2770
2934
  name: true,
2771
2935
  mode: true,
2772
2936
  projectIds: true,
2773
- hostIds: true
2937
+ hostIds: true,
2938
+ clientId: true
2774
2939
  }).partial({
2775
2940
  mode: true,
2776
2941
  projectIds: true,
@@ -2778,65 +2943,65 @@ var ViewInput = View.pick({
2778
2943
  });
2779
2944
  var ViewPatch = ViewInput.partial();
2780
2945
  var ViewClientReport = ViewClient.omit({ lastSeenAt: true });
2781
- var ProjectSuggestionsResponse = z13.object({
2782
- suggestions: z13.array(ProjectSuggestion.extend({ name: z13.string(), preselected: z13.boolean() }))
2946
+ var ProjectSuggestionsResponse = z14.object({
2947
+ suggestions: z14.array(ProjectSuggestion.extend({ name: z14.string(), preselected: z14.boolean() }))
2783
2948
  });
2784
2949
 
2785
2950
  // packages/protocol/dist/client-wire.js
2786
- import { z as z14 } from "zod";
2787
- var SyncState = z14.object({
2788
- hosts: z14.array(Host),
2789
- projects: z14.array(Project),
2790
- checkouts: z14.array(Checkout),
2791
- workspaces: z14.array(Workspace),
2792
- profiles: z14.array(Profile),
2793
- views: z14.array(View),
2794
- sessions: z14.array(Session),
2795
- tasks: z14.array(Task),
2796
- runs: z14.array(Run),
2797
- automations: z14.array(Automation),
2798
- attention: z14.array(AttentionItem),
2799
- interactions: z14.array(Interaction),
2800
- panels: z14.array(Panel),
2801
- devices: z14.array(Device),
2802
- adapters: z14.record(z14.string(), z14.array(AdapterInfo)),
2803
- dispatchPaused: z14.boolean()
2804
- });
2805
- var Presence = z14.object({
2806
- foreground: z14.boolean(),
2807
- interactedAt: z14.string().nullable(),
2808
- viewing: z14.object({ sessionId: z14.string() }).nullable()
2951
+ import { z as z15 } from "zod";
2952
+ var SyncState = z15.object({
2953
+ hosts: z15.array(Host),
2954
+ projects: z15.array(Project),
2955
+ checkouts: z15.array(Checkout),
2956
+ workspaces: z15.array(Workspace),
2957
+ profiles: z15.array(Profile),
2958
+ views: z15.array(View),
2959
+ sessions: z15.array(Session),
2960
+ tasks: z15.array(Task),
2961
+ runs: z15.array(Run),
2962
+ automations: z15.array(Automation),
2963
+ attention: z15.array(AttentionItem),
2964
+ interactions: z15.array(Interaction),
2965
+ panels: z15.array(Panel),
2966
+ devices: z15.array(Device),
2967
+ adapters: z15.record(z15.string(), z15.array(AdapterInfo)),
2968
+ dispatchPaused: z15.boolean()
2969
+ });
2970
+ var Presence = z15.object({
2971
+ foreground: z15.boolean(),
2972
+ interactedAt: z15.string().nullable(),
2973
+ viewing: z15.object({ sessionId: z15.string() }).nullable()
2809
2974
  });
2810
2975
  var CLIENT_CAPABILITIES = ["adapter.slots.v1", "timeline.cards.v1"];
2811
- var ClientToServer = z14.discriminatedUnion("type", [
2812
- z14.object({
2813
- type: z14.literal("hello"),
2814
- cursor: z14.number().int().nullable(),
2815
- capabilities: z14.array(z14.string().min(1).max(80)).max(32).optional(),
2816
- projectionId: z14.string().max(256).nullable().optional()
2976
+ var ClientToServer = z15.discriminatedUnion("type", [
2977
+ z15.object({
2978
+ type: z15.literal("hello"),
2979
+ cursor: z15.number().int().nullable(),
2980
+ capabilities: z15.array(z15.string().min(1).max(80)).max(32).optional(),
2981
+ projectionId: z15.string().max(256).nullable().optional()
2817
2982
  }),
2818
- z14.object({ type: z14.literal("presence"), presence: Presence }),
2819
- z14.object({ type: z14.literal("ping") })
2983
+ z15.object({ type: z15.literal("presence"), presence: Presence }),
2984
+ z15.object({ type: z15.literal("ping") })
2820
2985
  ]);
2821
- var ServerToClient = z14.discriminatedUnion("type", [
2822
- z14.object({
2823
- type: z14.literal("replay"),
2824
- seq: z14.number().int(),
2825
- events: z14.array(EventEnvelope),
2826
- capabilities: z14.array(z14.enum(CLIENT_CAPABILITIES)).optional(),
2827
- projectionId: z14.string().optional()
2986
+ var ServerToClient = z15.discriminatedUnion("type", [
2987
+ z15.object({
2988
+ type: z15.literal("replay"),
2989
+ seq: z15.number().int(),
2990
+ events: z15.array(EventEnvelope),
2991
+ capabilities: z15.array(z15.enum(CLIENT_CAPABILITIES)).optional(),
2992
+ projectionId: z15.string().optional()
2828
2993
  }),
2829
- z14.object({
2830
- type: z14.literal("snapshot"),
2831
- seq: z14.number().int(),
2994
+ z15.object({
2995
+ type: z15.literal("snapshot"),
2996
+ seq: z15.number().int(),
2832
2997
  state: SyncState,
2833
- capabilities: z14.array(z14.enum(CLIENT_CAPABILITIES)).optional(),
2834
- projectionId: z14.string().optional()
2998
+ capabilities: z15.array(z15.enum(CLIENT_CAPABILITIES)).optional(),
2999
+ projectionId: z15.string().optional()
2835
3000
  }),
2836
- z14.object({ type: z14.literal("event"), event: EventEnvelope }),
2837
- z14.object({ type: z14.literal("stream"), delta: StreamDelta }),
2838
- z14.object({ type: z14.literal("pong") }),
2839
- z14.object({ type: z14.literal("force_logout"), reason: z14.string() })
3001
+ z15.object({ type: z15.literal("event"), event: EventEnvelope }),
3002
+ z15.object({ type: z15.literal("stream"), delta: StreamDelta }),
3003
+ z15.object({ type: z15.literal("pong") }),
3004
+ z15.object({ type: z15.literal("force_logout"), reason: z15.string() })
2840
3005
  ]);
2841
3006
 
2842
3007
  // packages/protocol/dist/ids.js
@@ -2847,17 +3012,17 @@ var ulid = monotonicFactory();
2847
3012
  var CLIENT_OPEN_MS = 10 * 6e4;
2848
3013
 
2849
3014
  // packages/protocol/dist/web-bridge.js
2850
- import { z as z15 } from "zod";
3015
+ import { z as z16 } from "zod";
2851
3016
  var FRAME_MAX_HEIGHT = 4e3;
2852
- var FrameToParentMessageSchema = z15.discriminatedUnion("type", [
2853
- z15.object({
2854
- type: z15.literal("action"),
2855
- actionId: z15.string().min(1).max(200),
2856
- payload: z15.unknown().optional()
3017
+ var FrameToParentMessageSchema = z16.discriminatedUnion("type", [
3018
+ z16.object({
3019
+ type: z16.literal("action"),
3020
+ actionId: z16.string().min(1).max(200),
3021
+ payload: z16.unknown().optional()
2857
3022
  }),
2858
- z15.object({
2859
- type: z15.literal("resize"),
2860
- height: z15.number().finite().min(0).max(FRAME_MAX_HEIGHT)
3023
+ z16.object({
3024
+ type: z16.literal("resize"),
3025
+ height: z16.number().finite().min(0).max(FRAME_MAX_HEIGHT)
2861
3026
  })
2862
3027
  ]);
2863
3028