@spencerboucher/switchyard-client 0.14.0 → 0.17.0

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