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