@spencerboucher/switchyard-client 0.14.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1498 -1333
- package/dist/types/protocol/api.d.ts +38 -0
- package/dist/types/protocol/client-wire.d.ts +76 -0
- package/dist/types/protocol/entities.d.ts +39 -0
- package/dist/types/protocol/events.d.ts +38 -0
- package/dist/types/protocol/host-wire.d.ts +61 -0
- package/dist/types/protocol/ids.d.ts +1 -1
- package/dist/types/protocol/index.d.ts +1 -0
- package/dist/types/protocol/trackers.d.ts +244 -0
- package/dist/types/protocol/views.d.ts +3 -1
- package/package.json +5 -1
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
|
|
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
|
|
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/
|
|
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
|
|
971
|
-
var
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
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 =
|
|
977
|
-
prompt:
|
|
978
|
-
steer:
|
|
979
|
-
followUp:
|
|
980
|
-
abort:
|
|
981
|
-
resume:
|
|
982
|
-
rename:
|
|
983
|
-
importInactive:
|
|
984
|
-
extensionDialogs:
|
|
985
|
-
customUi:
|
|
986
|
-
widgetsText:
|
|
987
|
-
widgetsComponent:
|
|
988
|
-
tokenAccounting:
|
|
989
|
-
costAccounting:
|
|
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:
|
|
1129
|
+
terminal: z7.boolean().optional(),
|
|
995
1130
|
/** The host answers session.models, session.commands, session.setModel, session.setThinking and session.compact. */
|
|
996
|
-
sessionControls:
|
|
1131
|
+
sessionControls: z7.boolean().optional(),
|
|
997
1132
|
/** The host answers session.navigate for terminal sessions. */
|
|
998
|
-
treeNavigation:
|
|
999
|
-
agentRequests:
|
|
1000
|
-
messageDelivery:
|
|
1001
|
-
policies:
|
|
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:
|
|
1004
|
-
unsupported:
|
|
1138
|
+
adapterDevelopment: z7.boolean().optional(),
|
|
1139
|
+
unsupported: z7.array(z7.object({ capability: z7.string(), reason: z7.string() }))
|
|
1005
1140
|
});
|
|
1006
|
-
var ProjectScan =
|
|
1007
|
-
state:
|
|
1008
|
-
startedAt:
|
|
1009
|
-
finishedAt:
|
|
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:
|
|
1146
|
+
repositories: z7.number().int(),
|
|
1012
1147
|
/** New projects created by this scan. */
|
|
1013
|
-
projectsCreated:
|
|
1148
|
+
projectsCreated: z7.number().int(),
|
|
1014
1149
|
/** New checkouts (including the ones of new projects). */
|
|
1015
|
-
checkoutsAdded:
|
|
1150
|
+
checkoutsAdded: z7.number().int(),
|
|
1016
1151
|
/** "<folder>: <message>" per folder that failed; for state "failed", the reason last. */
|
|
1017
|
-
errors:
|
|
1018
|
-
});
|
|
1019
|
-
var UsageWindow =
|
|
1020
|
-
id:
|
|
1021
|
-
usedPct:
|
|
1022
|
-
resetsAt:
|
|
1023
|
-
});
|
|
1024
|
-
var ProviderUsage =
|
|
1025
|
-
provider:
|
|
1026
|
-
status:
|
|
1027
|
-
message:
|
|
1028
|
-
windows:
|
|
1029
|
-
fetchedAt:
|
|
1030
|
-
});
|
|
1031
|
-
var Host =
|
|
1032
|
-
id:
|
|
1033
|
-
name:
|
|
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:
|
|
1036
|
-
piVersion:
|
|
1037
|
-
piCompatible:
|
|
1170
|
+
agentVersion: z7.string(),
|
|
1171
|
+
piVersion: z7.string().nullable(),
|
|
1172
|
+
piCompatible: z7.boolean(),
|
|
1038
1173
|
capabilities: RuntimeCapabilities.nullable(),
|
|
1039
1174
|
connectivity: Connectivity,
|
|
1040
|
-
lastSeenAt:
|
|
1041
|
-
revokedAt:
|
|
1042
|
-
createdAt:
|
|
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:
|
|
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:
|
|
1182
|
+
usage: z7.array(ProviderUsage).optional(),
|
|
1048
1183
|
github: HostGitHub.optional()
|
|
1049
1184
|
});
|
|
1050
|
-
var WorktreeDir =
|
|
1051
|
-
var Project =
|
|
1052
|
-
id:
|
|
1053
|
-
name:
|
|
1054
|
-
repoIdentity:
|
|
1055
|
-
defaultProfileId:
|
|
1056
|
-
defaultHostId:
|
|
1057
|
-
maxConcurrentRuns:
|
|
1058
|
-
automationEnabled:
|
|
1059
|
-
setupCommand:
|
|
1060
|
-
checks:
|
|
1061
|
-
workspaceSharing:
|
|
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
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
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:
|
|
1093
|
-
state:
|
|
1094
|
-
log:
|
|
1233
|
+
setup: z7.object({
|
|
1234
|
+
state: z7.enum(["none", "running", "succeeded", "failed"]),
|
|
1235
|
+
log: z7.string()
|
|
1095
1236
|
}),
|
|
1096
|
-
archivedAt:
|
|
1097
|
-
updatedAt:
|
|
1237
|
+
archivedAt: Iso2.nullable(),
|
|
1238
|
+
updatedAt: Iso2,
|
|
1098
1239
|
github: WorkspaceGitHub.optional()
|
|
1099
1240
|
});
|
|
1100
|
-
var ThinkingLevel =
|
|
1101
|
-
var SessionModel =
|
|
1102
|
-
provider:
|
|
1103
|
-
id:
|
|
1104
|
-
name:
|
|
1105
|
-
contextWindow:
|
|
1106
|
-
reasoning:
|
|
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:
|
|
1249
|
+
scoped: z7.boolean().optional(),
|
|
1109
1250
|
/** Effort levels this model accepts, in Pi's order; ["off"] without reasoning. */
|
|
1110
|
-
thinkingLevels:
|
|
1251
|
+
thinkingLevels: z7.array(ThinkingLevel),
|
|
1111
1252
|
/** Prompt-cache lifetimes in seconds from Pi's model metadata. */
|
|
1112
|
-
promptCache:
|
|
1253
|
+
promptCache: z7.object({ short: z7.number().optional(), long: z7.number().optional() }).nullable().optional()
|
|
1113
1254
|
});
|
|
1114
|
-
var SlashCommand =
|
|
1115
|
-
name:
|
|
1116
|
-
description:
|
|
1117
|
-
source:
|
|
1118
|
-
argumentHint:
|
|
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 =
|
|
1261
|
+
var ContextUsage = z7.object({
|
|
1121
1262
|
/** Estimated tokens in context; null right after compaction until the next reply. */
|
|
1122
|
-
tokens:
|
|
1123
|
-
window:
|
|
1124
|
-
percent:
|
|
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 =
|
|
1128
|
-
var Profile =
|
|
1129
|
-
id:
|
|
1130
|
-
name:
|
|
1131
|
-
provider:
|
|
1132
|
-
model:
|
|
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:
|
|
1135
|
-
extraArgs:
|
|
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:
|
|
1278
|
+
resources: z7.enum(["all", "vanilla"]).optional()
|
|
1138
1279
|
});
|
|
1139
|
-
var ViewClient =
|
|
1280
|
+
var ViewClient = z7.object({
|
|
1140
1281
|
/** `${kind}:${name}@${machine}` */
|
|
1141
|
-
id:
|
|
1142
|
-
kind:
|
|
1143
|
-
name:
|
|
1144
|
-
machine:
|
|
1145
|
-
lastSeenAt:
|
|
1146
|
-
});
|
|
1147
|
-
var View =
|
|
1148
|
-
id:
|
|
1149
|
-
name:
|
|
1150
|
-
mode:
|
|
1151
|
-
projectIds:
|
|
1152
|
-
hostIds:
|
|
1153
|
-
sessionIds:
|
|
1154
|
-
clients:
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
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 =
|
|
1168
|
-
var SessionStats =
|
|
1169
|
-
tokens:
|
|
1170
|
-
costUsd:
|
|
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 =
|
|
1176
|
-
at:
|
|
1177
|
-
provider:
|
|
1178
|
-
model:
|
|
1179
|
-
cacheRead:
|
|
1180
|
-
cacheWrite:
|
|
1181
|
-
cacheWrite1h:
|
|
1182
|
-
});
|
|
1183
|
-
var Session =
|
|
1184
|
-
id:
|
|
1185
|
-
title:
|
|
1186
|
-
subtitle:
|
|
1187
|
-
hostId:
|
|
1188
|
-
workspaceId:
|
|
1189
|
-
projectId:
|
|
1190
|
-
cwd:
|
|
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:
|
|
1342
|
+
runtimeDetail: z7.string().nullable(),
|
|
1195
1343
|
connectivity: Connectivity,
|
|
1196
|
-
runId:
|
|
1197
|
-
taskId:
|
|
1198
|
-
provenance:
|
|
1199
|
-
readOnly:
|
|
1200
|
-
lastActivityAt:
|
|
1201
|
-
archivedAt:
|
|
1202
|
-
queue:
|
|
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:
|
|
1210
|
-
lastAssistantText:
|
|
1211
|
-
createdAt:
|
|
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:
|
|
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:
|
|
1368
|
+
unreadSince: Iso2.nullable().optional(),
|
|
1216
1369
|
/** Identity of the adapter presentation currently installed on the host. */
|
|
1217
|
-
adapterGeneration:
|
|
1370
|
+
adapterGeneration: z7.string().uuid().optional(),
|
|
1218
1371
|
/** Bumped when the transcript is rebuilt (rewind); clients drop cached copies (coordinator-owned). */
|
|
1219
|
-
transcriptEpoch:
|
|
1220
|
-
bridge:
|
|
1221
|
-
version:
|
|
1222
|
-
runtimeId:
|
|
1223
|
-
nativeSessionId:
|
|
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:
|
|
1226
|
-
agentTools:
|
|
1227
|
-
messageDelivery:
|
|
1228
|
-
policyState:
|
|
1229
|
-
policyPhases:
|
|
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:
|
|
1387
|
+
cacheAlert: z7.object({ ttlSec: z7.number().int().min(60).max(86400).nullable(), warnedFor: Iso2.nullable() }).nullable().optional()
|
|
1235
1388
|
});
|
|
1236
|
-
var ContinuationPolicy =
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
enabled:
|
|
1240
|
-
objective:
|
|
1241
|
-
maxContinuations:
|
|
1242
|
-
maxElapsedMinutes:
|
|
1243
|
-
maxTokens:
|
|
1244
|
-
maxCostUsd:
|
|
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 =
|
|
1248
|
-
checks:
|
|
1249
|
-
requireHumanReview:
|
|
1400
|
+
var CompletionPolicy = z7.object({
|
|
1401
|
+
checks: z7.array(z7.string()).nullable(),
|
|
1402
|
+
requireHumanReview: z7.boolean()
|
|
1250
1403
|
});
|
|
1251
|
-
var WorkspacePolicy =
|
|
1252
|
-
|
|
1253
|
-
mode:
|
|
1254
|
-
branch:
|
|
1255
|
-
base:
|
|
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
|
-
|
|
1410
|
+
z7.object({ mode: z7.literal("existing"), workspaceId: Id5 })
|
|
1258
1411
|
]);
|
|
1259
|
-
var TaskPolicy =
|
|
1260
|
-
hostId:
|
|
1261
|
-
profileId:
|
|
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 =
|
|
1267
|
-
var Priority =
|
|
1268
|
-
var TaskOrigin =
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
kind:
|
|
1272
|
-
automationId:
|
|
1273
|
-
occurrenceId:
|
|
1274
|
-
routine:
|
|
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 =
|
|
1278
|
-
id:
|
|
1279
|
-
projectId:
|
|
1280
|
-
title:
|
|
1281
|
-
objective:
|
|
1282
|
-
acceptanceCriteria:
|
|
1283
|
-
dependencies:
|
|
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:
|
|
1438
|
+
position: z7.number(),
|
|
1286
1439
|
state: TaskState,
|
|
1287
|
-
blocked:
|
|
1288
|
-
notBefore:
|
|
1440
|
+
blocked: z7.object({ reason: z7.string() }).nullable(),
|
|
1441
|
+
notBefore: Iso2.nullable(),
|
|
1289
1442
|
policy: TaskPolicy,
|
|
1290
1443
|
origin: TaskOrigin,
|
|
1291
|
-
groupingKey:
|
|
1292
|
-
parentTaskId:
|
|
1293
|
-
agentOrigin:
|
|
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
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
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 =
|
|
1316
|
-
command:
|
|
1317
|
-
exitCode:
|
|
1318
|
-
outputTail:
|
|
1319
|
-
});
|
|
1320
|
-
var Run =
|
|
1321
|
-
id:
|
|
1322
|
-
taskId:
|
|
1323
|
-
sessionId:
|
|
1324
|
-
hostId:
|
|
1325
|
-
dispatchKey:
|
|
1326
|
-
attempt:
|
|
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:
|
|
1330
|
-
continuationsUsed:
|
|
1331
|
-
infraRetries:
|
|
1332
|
-
nextAttemptAt:
|
|
1333
|
-
startedAt:
|
|
1334
|
-
endedAt:
|
|
1335
|
-
outcome:
|
|
1336
|
-
kind:
|
|
1337
|
-
summary:
|
|
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:
|
|
1341
|
-
tokens:
|
|
1342
|
-
costUsd:
|
|
1343
|
-
accounting:
|
|
1344
|
-
note:
|
|
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:
|
|
1347
|
-
createdAt:
|
|
1348
|
-
updatedAt:
|
|
1349
|
-
});
|
|
1350
|
-
var Trigger =
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
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 =
|
|
1358
|
-
title:
|
|
1359
|
-
objective:
|
|
1360
|
-
acceptanceCriteria:
|
|
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 =
|
|
1364
|
-
id:
|
|
1365
|
-
name:
|
|
1366
|
-
enabled:
|
|
1367
|
-
projectId:
|
|
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:
|
|
1524
|
+
filters: z7.array(z7.object({ path: z7.string(), equals: z7.string() })),
|
|
1370
1525
|
template: TaskTemplate,
|
|
1371
|
-
hostId:
|
|
1372
|
-
profileId:
|
|
1373
|
-
mode:
|
|
1374
|
-
groupingKey:
|
|
1375
|
-
overlap:
|
|
1376
|
-
missed:
|
|
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:
|
|
1380
|
-
lastEvaluatedAt:
|
|
1381
|
-
lastOutcome:
|
|
1382
|
-
failureCount:
|
|
1383
|
-
webhookTokenSet:
|
|
1384
|
-
createdAt:
|
|
1385
|
-
updatedAt:
|
|
1386
|
-
});
|
|
1387
|
-
var OccurrenceState =
|
|
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 =
|
|
1397
|
-
id:
|
|
1398
|
-
automationId:
|
|
1399
|
-
key:
|
|
1400
|
-
scheduledFor:
|
|
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:
|
|
1403
|
-
reason:
|
|
1404
|
-
outcome:
|
|
1405
|
-
createdAt:
|
|
1406
|
-
});
|
|
1407
|
-
var InteractionState =
|
|
1408
|
-
var Interaction =
|
|
1409
|
-
id:
|
|
1410
|
-
sessionId:
|
|
1411
|
-
revision:
|
|
1412
|
-
source:
|
|
1413
|
-
|
|
1414
|
-
kind:
|
|
1415
|
-
method:
|
|
1416
|
-
piRequestIds:
|
|
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
|
-
|
|
1573
|
+
z7.object({ kind: z7.literal("unsupported_custom"), title: z7.string().nullable() })
|
|
1419
1574
|
]),
|
|
1420
|
-
adapterId:
|
|
1575
|
+
adapterId: z7.string().nullable(),
|
|
1421
1576
|
permission: PolicyPermission.optional(),
|
|
1422
|
-
title:
|
|
1577
|
+
title: z7.string(),
|
|
1423
1578
|
presentation: UINodeSchema,
|
|
1424
1579
|
state: InteractionState,
|
|
1425
|
-
resolution:
|
|
1426
|
-
createdAt:
|
|
1580
|
+
resolution: z7.object({ by: z7.string(), summary: z7.string(), at: Iso2 }).nullable(),
|
|
1581
|
+
createdAt: Iso2
|
|
1427
1582
|
});
|
|
1428
|
-
var AttentionReason =
|
|
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 =
|
|
1437
|
-
id:
|
|
1438
|
-
sessionId:
|
|
1439
|
-
taskId:
|
|
1440
|
-
projectId:
|
|
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:
|
|
1443
|
-
summary:
|
|
1444
|
-
interactionId:
|
|
1445
|
-
deepLink:
|
|
1446
|
-
acknowledgedAt:
|
|
1447
|
-
resolvedAt:
|
|
1448
|
-
createdAt:
|
|
1449
|
-
});
|
|
1450
|
-
var Device =
|
|
1451
|
-
id:
|
|
1452
|
-
name:
|
|
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:
|
|
1455
|
-
lastSeenAt:
|
|
1456
|
-
revokedAt:
|
|
1457
|
-
push:
|
|
1458
|
-
subscribed:
|
|
1459
|
-
permission:
|
|
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:
|
|
1462
|
-
enrolledVia:
|
|
1463
|
-
});
|
|
1464
|
-
var ToolItemData =
|
|
1465
|
-
toolCallId:
|
|
1466
|
-
name:
|
|
1467
|
-
status:
|
|
1468
|
-
args:
|
|
1469
|
-
summary:
|
|
1470
|
-
output:
|
|
1471
|
-
startedAt:
|
|
1472
|
-
durationMs:
|
|
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:
|
|
1475
|
-
adapterGeneration:
|
|
1629
|
+
adapterId: z7.string().nullable(),
|
|
1630
|
+
adapterGeneration: z7.string().uuid().optional()
|
|
1476
1631
|
});
|
|
1477
|
-
var TranscriptItem =
|
|
1478
|
-
|
|
1479
|
-
id:
|
|
1480
|
-
sessionId:
|
|
1481
|
-
order:
|
|
1482
|
-
at:
|
|
1483
|
-
kind:
|
|
1484
|
-
data:
|
|
1485
|
-
text:
|
|
1486
|
-
images:
|
|
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:
|
|
1643
|
+
entryId: z7.string().optional()
|
|
1489
1644
|
})
|
|
1490
1645
|
}),
|
|
1491
|
-
|
|
1492
|
-
id:
|
|
1493
|
-
sessionId:
|
|
1494
|
-
order:
|
|
1495
|
-
at:
|
|
1496
|
-
kind:
|
|
1497
|
-
data:
|
|
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
|
-
|
|
1500
|
-
id:
|
|
1501
|
-
sessionId:
|
|
1502
|
-
order:
|
|
1503
|
-
at:
|
|
1504
|
-
kind:
|
|
1505
|
-
data:
|
|
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
|
-
|
|
1508
|
-
id:
|
|
1509
|
-
sessionId:
|
|
1510
|
-
order:
|
|
1511
|
-
at:
|
|
1512
|
-
kind:
|
|
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
|
-
|
|
1516
|
-
id:
|
|
1517
|
-
sessionId:
|
|
1518
|
-
order:
|
|
1519
|
-
at:
|
|
1520
|
-
kind:
|
|
1521
|
-
data:
|
|
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:
|
|
1524
|
-
customType:
|
|
1678
|
+
text: z7.string(),
|
|
1679
|
+
customType: z7.string().min(1).max(200).optional(),
|
|
1525
1680
|
card: UINodeSchema.optional(),
|
|
1526
|
-
adapterId:
|
|
1527
|
-
adapterGeneration:
|
|
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
|
-
|
|
1531
|
-
id:
|
|
1532
|
-
sessionId:
|
|
1533
|
-
order:
|
|
1534
|
-
at:
|
|
1535
|
-
kind:
|
|
1536
|
-
data:
|
|
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
|
-
|
|
1539
|
-
id:
|
|
1540
|
-
sessionId:
|
|
1541
|
-
order:
|
|
1542
|
-
at:
|
|
1543
|
-
kind:
|
|
1544
|
-
data:
|
|
1545
|
-
runId:
|
|
1546
|
-
label:
|
|
1547
|
-
status:
|
|
1548
|
-
sessionFile:
|
|
1549
|
-
linkedSessionId:
|
|
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
|
-
|
|
1553
|
-
id:
|
|
1554
|
-
sessionId:
|
|
1555
|
-
order:
|
|
1556
|
-
at:
|
|
1557
|
-
kind:
|
|
1558
|
-
data:
|
|
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 =
|
|
1562
|
-
sessionId:
|
|
1563
|
-
adapterId:
|
|
1564
|
-
slot:
|
|
1565
|
-
title:
|
|
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:
|
|
1568
|
-
mobileFallback:
|
|
1722
|
+
webRenderer: z7.boolean(),
|
|
1723
|
+
mobileFallback: z7.string().nullable(),
|
|
1569
1724
|
contribution: ContributionDescriptor.optional(),
|
|
1570
|
-
state:
|
|
1571
|
-
adapterGeneration:
|
|
1572
|
-
updatedAt:
|
|
1725
|
+
state: z7.unknown().optional(),
|
|
1726
|
+
adapterGeneration: z7.string().uuid().optional(),
|
|
1727
|
+
updatedAt: Iso2
|
|
1573
1728
|
});
|
|
1574
|
-
var Diagnostic =
|
|
1575
|
-
sessionId:
|
|
1576
|
-
adapterId:
|
|
1729
|
+
var Diagnostic = z7.object({
|
|
1730
|
+
sessionId: Id5.nullable(),
|
|
1731
|
+
adapterId: z7.string().nullable(),
|
|
1577
1732
|
level: DiagnosticLevel,
|
|
1578
|
-
message:
|
|
1579
|
-
at:
|
|
1580
|
-
});
|
|
1581
|
-
var AdapterInfo =
|
|
1582
|
-
id:
|
|
1583
|
-
version:
|
|
1584
|
-
tier:
|
|
1585
|
-
target:
|
|
1586
|
-
extension:
|
|
1587
|
-
versionRange:
|
|
1588
|
-
testedVersions:
|
|
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:
|
|
1591
|
-
webRenderer:
|
|
1592
|
-
status:
|
|
1593
|
-
detail:
|
|
1594
|
-
});
|
|
1595
|
-
var Passkey =
|
|
1596
|
-
id:
|
|
1597
|
-
name:
|
|
1598
|
-
createdAt:
|
|
1599
|
-
lastUsedAt:
|
|
1600
|
-
transports:
|
|
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
|
|
1768
|
+
return z8.NEVER;
|
|
1614
1769
|
}
|
|
1615
1770
|
}
|
|
1616
|
-
var
|
|
1617
|
-
var Text2 =
|
|
1618
|
-
var Tool = { toolCallId:
|
|
1619
|
-
var DialogCommon = { id:
|
|
1620
|
-
var AdapterPreviewPiUiRequestSchema =
|
|
1621
|
-
|
|
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:
|
|
1624
|
-
options:
|
|
1625
|
-
timeout:
|
|
1778
|
+
method: z8.literal("select"),
|
|
1779
|
+
options: z8.array(Text2).max(200),
|
|
1780
|
+
timeout: z8.number().nonnegative().optional()
|
|
1626
1781
|
}).strict(),
|
|
1627
|
-
|
|
1782
|
+
z8.object({
|
|
1628
1783
|
...DialogCommon,
|
|
1629
|
-
method:
|
|
1784
|
+
method: z8.literal("confirm"),
|
|
1630
1785
|
message: Text2,
|
|
1631
|
-
timeout:
|
|
1786
|
+
timeout: z8.number().nonnegative().optional()
|
|
1632
1787
|
}).strict(),
|
|
1633
|
-
|
|
1788
|
+
z8.object({
|
|
1634
1789
|
...DialogCommon,
|
|
1635
|
-
method:
|
|
1790
|
+
method: z8.literal("input"),
|
|
1636
1791
|
placeholder: Text2.optional(),
|
|
1637
|
-
timeout:
|
|
1792
|
+
timeout: z8.number().nonnegative().optional()
|
|
1638
1793
|
}).strict(),
|
|
1639
|
-
|
|
1794
|
+
z8.object({ ...DialogCommon, method: z8.literal("editor"), prefill: Text2.optional() }).strict()
|
|
1640
1795
|
]);
|
|
1641
|
-
var AdapterPreviewStepSchema =
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
kind:
|
|
1646
|
-
data:
|
|
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
|
-
|
|
1649
|
-
kind:
|
|
1650
|
-
data:
|
|
1803
|
+
z8.object({
|
|
1804
|
+
kind: z8.literal("toolEnd"),
|
|
1805
|
+
data: z8.object({
|
|
1651
1806
|
...Tool,
|
|
1652
|
-
result:
|
|
1653
|
-
isError:
|
|
1654
|
-
details:
|
|
1807
|
+
result: z8.unknown(),
|
|
1808
|
+
isError: z8.boolean(),
|
|
1809
|
+
details: z8.unknown().optional()
|
|
1655
1810
|
}).strict()
|
|
1656
1811
|
}).strict(),
|
|
1657
|
-
|
|
1658
|
-
kind:
|
|
1659
|
-
data:
|
|
1812
|
+
z8.object({
|
|
1813
|
+
kind: z8.literal("status"),
|
|
1814
|
+
data: z8.object({ key: Id6, text: Text2.optional() }).strict()
|
|
1660
1815
|
}).strict(),
|
|
1661
|
-
|
|
1662
|
-
kind:
|
|
1663
|
-
data:
|
|
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
|
-
|
|
1666
|
-
|
|
1667
|
-
kind:
|
|
1668
|
-
data:
|
|
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
|
-
|
|
1671
|
-
kind:
|
|
1672
|
-
data:
|
|
1673
|
-
customType:
|
|
1674
|
-
content:
|
|
1675
|
-
display:
|
|
1676
|
-
details:
|
|
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
|
-
|
|
1680
|
-
kind:
|
|
1681
|
-
data:
|
|
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 =
|
|
1685
|
-
version:
|
|
1686
|
-
name:
|
|
1687
|
-
initialState:
|
|
1688
|
-
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 =
|
|
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
|
|
1850
|
+
return z8.NEVER;
|
|
1696
1851
|
}
|
|
1697
1852
|
});
|
|
1698
|
-
var PreviewPanel = Panel.extend({ webRenderer:
|
|
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 =
|
|
1721
|
-
version:
|
|
1722
|
-
name:
|
|
1723
|
-
adapter:
|
|
1724
|
-
steps:
|
|
1725
|
-
index:
|
|
1726
|
-
kind:
|
|
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:
|
|
1739
|
-
error:
|
|
1893
|
+
ok: z8.boolean(),
|
|
1894
|
+
error: z8.string().max(4e3).nullable()
|
|
1740
1895
|
}).strict()).max(ADAPTER_PREVIEW_MAX_STEPS),
|
|
1741
|
-
panels:
|
|
1742
|
-
interactions:
|
|
1896
|
+
panels: z8.array(PreviewPanel).max(256),
|
|
1897
|
+
interactions: z8.array(z8.object({
|
|
1743
1898
|
request: AdapterPreviewPiUiRequestSchema,
|
|
1744
1899
|
presentation: PortableNode,
|
|
1745
|
-
state:
|
|
1900
|
+
state: z8.enum(["pending", "resolved"])
|
|
1746
1901
|
}).strict()).max(ADAPTER_PREVIEW_MAX_STEPS),
|
|
1747
|
-
cards:
|
|
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
|
|
1907
|
+
return z8.NEVER;
|
|
1753
1908
|
}
|
|
1754
1909
|
})).max(ADAPTER_PREVIEW_MAX_STEPS * 3),
|
|
1755
|
-
diagnostics:
|
|
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
|
|
1785
|
-
var Path =
|
|
1939
|
+
import { z as z9 } from "zod";
|
|
1940
|
+
var Path = z9.string().max(4096);
|
|
1786
1941
|
var SessionAdapterInfo = AdapterInfo.extend({
|
|
1787
|
-
runtimeStatus:
|
|
1788
|
-
runtimeDetail:
|
|
1789
|
-
provenance:
|
|
1790
|
-
scope:
|
|
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:
|
|
1795
|
-
entrypoints:
|
|
1796
|
-
evidence:
|
|
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 =
|
|
1800
|
-
generation:
|
|
1801
|
-
runtimeId:
|
|
1802
|
-
reloadable:
|
|
1803
|
-
blockedReason:
|
|
1804
|
-
adapters:
|
|
1805
|
-
diagnostics:
|
|
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
|
|
1810
|
-
var
|
|
1811
|
-
var Instant3 =
|
|
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 =
|
|
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 =
|
|
1827
|
-
var RequestHash =
|
|
1828
|
-
var AgentReceiptPeekRequest =
|
|
1829
|
-
var AgentReceiptPeekResult =
|
|
1830
|
-
|
|
1831
|
-
|
|
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 =
|
|
1834
|
-
var CreateAgentTask =
|
|
1835
|
-
objective:
|
|
1836
|
-
acceptance:
|
|
1837
|
-
dependencies:
|
|
1838
|
-
parentTaskId:
|
|
1839
|
-
hostId:
|
|
1840
|
-
profileId:
|
|
1841
|
-
notifyOnFinish:
|
|
1842
|
-
});
|
|
1843
|
-
var SendAgentMessage =
|
|
1844
|
-
sessionId:
|
|
1845
|
-
body:
|
|
1846
|
-
mode:
|
|
1847
|
-
replyTo:
|
|
1848
|
-
});
|
|
1849
|
-
var ReadAgentInbox =
|
|
1850
|
-
after:
|
|
1851
|
-
limit:
|
|
1852
|
-
});
|
|
1853
|
-
var DeliveryState =
|
|
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:
|
|
1865
|
-
id:
|
|
1866
|
-
recipientSessionId:
|
|
1867
|
-
replyTo:
|
|
1868
|
-
chainId:
|
|
1869
|
-
depth:
|
|
1870
|
-
body:
|
|
1871
|
-
requestedMode:
|
|
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:
|
|
1874
|
-
readAt:
|
|
1875
|
-
createdAt:
|
|
2028
|
+
holdUntil: z10.string(),
|
|
2029
|
+
readAt: z10.string().nullable(),
|
|
2030
|
+
createdAt: z10.string()
|
|
1876
2031
|
};
|
|
1877
|
-
var AgentMessage =
|
|
1878
|
-
|
|
1879
|
-
|
|
2032
|
+
var AgentMessage = z10.discriminatedUnion("kind", [
|
|
2033
|
+
z10.object({ ...AgentMessageFields, kind: z10.literal("message"), senderSessionId: Id7 }),
|
|
2034
|
+
z10.object({
|
|
1880
2035
|
...AgentMessageFields,
|
|
1881
|
-
kind:
|
|
1882
|
-
senderSessionId:
|
|
2036
|
+
kind: z10.literal("completion"),
|
|
2037
|
+
senderSessionId: Id7.nullable()
|
|
1883
2038
|
})
|
|
1884
2039
|
]);
|
|
1885
|
-
var AgentInbox =
|
|
1886
|
-
messages:
|
|
1887
|
-
nextAfter:
|
|
1888
|
-
hasMore:
|
|
1889
|
-
});
|
|
1890
|
-
var AgentToolPolicyWait = PolicyEvaluation.options[2].omit({ verdict: true }).extend({ type:
|
|
1891
|
-
var AgentRequestFrame =
|
|
1892
|
-
type:
|
|
1893
|
-
requestId:
|
|
1894
|
-
sessionId:
|
|
1895
|
-
nativeSessionId:
|
|
1896
|
-
runtimeId:
|
|
1897
|
-
context:
|
|
1898
|
-
toolCallId:
|
|
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:
|
|
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 =
|
|
1923
|
-
|
|
1924
|
-
type:
|
|
1925
|
-
requestId:
|
|
1926
|
-
runtimeId:
|
|
1927
|
-
ok:
|
|
1928
|
-
result:
|
|
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
|
-
|
|
1931
|
-
type:
|
|
1932
|
-
requestId:
|
|
1933
|
-
runtimeId:
|
|
1934
|
-
ok:
|
|
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
|
|
2095
|
+
import { z as z14 } from "zod";
|
|
1941
2096
|
|
|
1942
2097
|
// packages/protocol/dist/host-wire.js
|
|
1943
|
-
import { z as
|
|
2098
|
+
import { z as z13 } from "zod";
|
|
1944
2099
|
|
|
1945
2100
|
// packages/protocol/dist/events.js
|
|
1946
|
-
import { z as
|
|
2101
|
+
import { z as z11 } from "zod";
|
|
1947
2102
|
var EventDataSchemas = {
|
|
1948
2103
|
"host.updated": Host,
|
|
1949
2104
|
"project.updated": Project,
|
|
1950
|
-
"project.deleted":
|
|
2105
|
+
"project.deleted": z11.object({ id: z11.string() }),
|
|
1951
2106
|
"checkout.updated": Checkout,
|
|
1952
2107
|
"workspace.updated": Workspace,
|
|
1953
|
-
"workspace.deleted":
|
|
2108
|
+
"workspace.deleted": z11.object({ id: z11.string() }),
|
|
1954
2109
|
"profile.updated": Profile,
|
|
1955
|
-
"profile.deleted":
|
|
2110
|
+
"profile.deleted": z11.object({ id: z11.string() }),
|
|
1956
2111
|
"view.updated": View,
|
|
1957
|
-
"view.deleted":
|
|
2112
|
+
"view.deleted": z11.object({ id: z11.string() }),
|
|
1958
2113
|
"session.updated": Session,
|
|
1959
2114
|
"transcript.item": TranscriptItem,
|
|
1960
|
-
"transcript.reset":
|
|
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":
|
|
2118
|
+
"adapters.updated": z11.object({ hostId: z11.string(), adapters: z11.array(AdapterInfo) }),
|
|
1964
2119
|
diagnostic: Diagnostic,
|
|
1965
2120
|
"task.updated": Task,
|
|
1966
|
-
"task.deleted":
|
|
2121
|
+
"task.deleted": z11.object({ id: z11.string() }),
|
|
1967
2122
|
"run.updated": Run,
|
|
1968
2123
|
"automation.updated": Automation,
|
|
1969
|
-
"automation.deleted":
|
|
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":
|
|
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 =
|
|
1985
|
-
var EventScope =
|
|
1986
|
-
hostId:
|
|
1987
|
-
sessionId:
|
|
1988
|
-
taskId:
|
|
1989
|
-
projectId:
|
|
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:
|
|
1993
|
-
id:
|
|
2147
|
+
seq: z11.number().int(),
|
|
2148
|
+
id: z11.string(),
|
|
1994
2149
|
type: EventTypeSchema,
|
|
1995
|
-
at:
|
|
1996
|
-
data:
|
|
2150
|
+
at: z11.string(),
|
|
2151
|
+
data: z11.unknown()
|
|
1997
2152
|
});
|
|
1998
2153
|
var HOST_EVENT_TYPES = [
|
|
1999
2154
|
"session.updated",
|
|
@@ -2006,321 +2161,327 @@ var HOST_EVENT_TYPES = [
|
|
|
2006
2161
|
"workspace.deleted"
|
|
2007
2162
|
];
|
|
2008
2163
|
var HostEvent = EventScope.extend({
|
|
2009
|
-
eventId:
|
|
2010
|
-
type:
|
|
2011
|
-
at:
|
|
2012
|
-
data:
|
|
2013
|
-
});
|
|
2014
|
-
var StreamDelta =
|
|
2015
|
-
sessionId:
|
|
2016
|
-
itemId:
|
|
2017
|
-
kind:
|
|
2018
|
-
delta:
|
|
2019
|
-
order:
|
|
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
|
|
2024
|
-
var Cols =
|
|
2025
|
-
var Rows =
|
|
2026
|
-
var TermViewerToServer =
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
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 =
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
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 =
|
|
2037
|
-
|
|
2038
|
-
t:
|
|
2039
|
-
sessionId:
|
|
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:
|
|
2197
|
+
passive: z12.boolean().optional()
|
|
2043
2198
|
}),
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
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 =
|
|
2052
|
-
var HostCommand =
|
|
2053
|
-
|
|
2054
|
-
type:
|
|
2055
|
-
sessionId:
|
|
2056
|
-
title:
|
|
2057
|
-
workspacePath:
|
|
2058
|
-
projectId:
|
|
2206
|
+
var Origin = z13.enum(["human", "automation"]);
|
|
2207
|
+
var HostCommand = z13.discriminatedUnion("type", [
|
|
2208
|
+
z13.object({
|
|
2209
|
+
type: z13.literal("session.start"),
|
|
2210
|
+
sessionId: z13.string(),
|
|
2211
|
+
title: z13.string(),
|
|
2212
|
+
workspacePath: z13.string(),
|
|
2213
|
+
projectId: z13.string().nullable(),
|
|
2059
2214
|
profile: Profile,
|
|
2060
2215
|
nativeHandle: NativeHandle.nullable(),
|
|
2061
|
-
initialPrompt:
|
|
2062
|
-
dispatchKey:
|
|
2063
|
-
controlRevision:
|
|
2216
|
+
initialPrompt: z13.string().nullable(),
|
|
2217
|
+
dispatchKey: z13.string().nullable(),
|
|
2218
|
+
controlRevision: z13.number().int(),
|
|
2064
2219
|
controlMode: ControlMode,
|
|
2065
2220
|
origin: Origin,
|
|
2066
|
-
readOnly:
|
|
2067
|
-
policyRequired:
|
|
2221
|
+
readOnly: z13.boolean().default(false),
|
|
2222
|
+
policyRequired: z13.boolean().optional()
|
|
2068
2223
|
}),
|
|
2069
|
-
|
|
2070
|
-
type:
|
|
2071
|
-
sessionId:
|
|
2072
|
-
messageId:
|
|
2073
|
-
payload:
|
|
2074
|
-
deliveryId:
|
|
2075
|
-
kind:
|
|
2076
|
-
text:
|
|
2224
|
+
z13.object({
|
|
2225
|
+
type: z13.literal("session.deliverMessage"),
|
|
2226
|
+
sessionId: z13.string(),
|
|
2227
|
+
messageId: z13.string(),
|
|
2228
|
+
payload: z13.object({
|
|
2229
|
+
deliveryId: z13.string(),
|
|
2230
|
+
kind: z13.enum(["message", "completion"]),
|
|
2231
|
+
text: z13.string()
|
|
2077
2232
|
}),
|
|
2078
|
-
mode:
|
|
2079
|
-
holdUntil:
|
|
2233
|
+
mode: z13.enum(["steer", "queue"]),
|
|
2234
|
+
holdUntil: z13.string()
|
|
2080
2235
|
}),
|
|
2081
|
-
HostPolicySampleRequest.extend({ type:
|
|
2082
|
-
|
|
2083
|
-
type:
|
|
2084
|
-
sessionId:
|
|
2085
|
-
messageIds:
|
|
2236
|
+
HostPolicySampleRequest.extend({ type: z13.literal("session.classifyPolicySample") }),
|
|
2237
|
+
z13.object({
|
|
2238
|
+
type: z13.literal("session.messageStatus"),
|
|
2239
|
+
sessionId: z13.string(),
|
|
2240
|
+
messageIds: z13.array(z13.string().min(1)).min(1).max(100)
|
|
2086
2241
|
}),
|
|
2087
|
-
|
|
2088
|
-
type:
|
|
2089
|
-
sessionId:
|
|
2090
|
-
text:
|
|
2091
|
-
images:
|
|
2092
|
-
mode:
|
|
2242
|
+
z13.object({
|
|
2243
|
+
type: z13.literal("session.prompt"),
|
|
2244
|
+
sessionId: z13.string(),
|
|
2245
|
+
text: z13.string(),
|
|
2246
|
+
images: z13.array(z13.object({ mimeType: z13.string(), data: z13.string() })).default([]),
|
|
2247
|
+
mode: z13.enum(["prompt", "steer", "followUp"]),
|
|
2093
2248
|
origin: Origin,
|
|
2094
|
-
controlRevision:
|
|
2249
|
+
controlRevision: z13.number().int()
|
|
2095
2250
|
}),
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
type:
|
|
2100
|
-
sessionId:
|
|
2101
|
-
interactionId:
|
|
2102
|
-
revision:
|
|
2251
|
+
z13.object({ type: z13.literal("session.abort"), sessionId: z13.string(), clearQueue: z13.boolean() }),
|
|
2252
|
+
z13.object({ type: z13.literal("session.stop"), sessionId: z13.string() }),
|
|
2253
|
+
z13.object({
|
|
2254
|
+
type: z13.literal("session.answer"),
|
|
2255
|
+
sessionId: z13.string(),
|
|
2256
|
+
interactionId: z13.string(),
|
|
2257
|
+
revision: z13.number().int(),
|
|
2103
2258
|
response: InteractionResponseSchema,
|
|
2104
|
-
deviceId:
|
|
2259
|
+
deviceId: z13.string()
|
|
2105
2260
|
}),
|
|
2106
|
-
|
|
2107
|
-
type:
|
|
2108
|
-
sessionId:
|
|
2109
|
-
generation:
|
|
2110
|
-
adapterId:
|
|
2111
|
-
actionId:
|
|
2112
|
-
payload:
|
|
2261
|
+
z13.object({
|
|
2262
|
+
type: z13.literal("session.adapterAction"),
|
|
2263
|
+
sessionId: z13.string(),
|
|
2264
|
+
generation: z13.string().uuid().optional(),
|
|
2265
|
+
adapterId: z13.string(),
|
|
2266
|
+
actionId: z13.string(),
|
|
2267
|
+
payload: z13.unknown()
|
|
2113
2268
|
}),
|
|
2114
|
-
|
|
2115
|
-
type:
|
|
2116
|
-
sessionId:
|
|
2117
|
-
controlRevision:
|
|
2269
|
+
z13.object({
|
|
2270
|
+
type: z13.literal("session.setControl"),
|
|
2271
|
+
sessionId: z13.string(),
|
|
2272
|
+
controlRevision: z13.number().int(),
|
|
2118
2273
|
mode: ControlMode
|
|
2119
2274
|
}),
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
type:
|
|
2128
|
-
sessionId:
|
|
2129
|
-
text:
|
|
2275
|
+
z13.object({ type: z13.literal("session.rename"), sessionId: z13.string(), title: z13.string() }),
|
|
2276
|
+
z13.object({ type: z13.literal("session.importable") }),
|
|
2277
|
+
z13.object({ type: z13.literal("session.readNative"), sessionFile: z13.string() }),
|
|
2278
|
+
z13.object({ type: z13.literal("session.snapshot"), sessionId: z13.string() }),
|
|
2279
|
+
z13.object({ type: z13.literal("session.models"), sessionId: z13.string() }),
|
|
2280
|
+
z13.object({ type: z13.literal("session.commands"), sessionId: z13.string() }),
|
|
2281
|
+
z13.object({
|
|
2282
|
+
type: z13.literal("session.complete"),
|
|
2283
|
+
sessionId: z13.string(),
|
|
2284
|
+
text: z13.string().max(500)
|
|
2130
2285
|
}),
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
type:
|
|
2134
|
-
sessionId:
|
|
2135
|
-
entryId:
|
|
2136
|
-
fork:
|
|
2286
|
+
z13.object({ type: z13.literal("session.tree"), sessionId: z13.string() }),
|
|
2287
|
+
z13.object({
|
|
2288
|
+
type: z13.literal("session.branch"),
|
|
2289
|
+
sessionId: z13.string(),
|
|
2290
|
+
entryId: z13.string().nullable(),
|
|
2291
|
+
fork: z13.boolean()
|
|
2137
2292
|
}),
|
|
2138
|
-
|
|
2139
|
-
type:
|
|
2140
|
-
sessionId:
|
|
2141
|
-
entryId:
|
|
2142
|
-
summarize:
|
|
2143
|
-
instructions:
|
|
2293
|
+
z13.object({
|
|
2294
|
+
type: z13.literal("session.navigate"),
|
|
2295
|
+
sessionId: z13.string(),
|
|
2296
|
+
entryId: z13.string(),
|
|
2297
|
+
summarize: z13.boolean(),
|
|
2298
|
+
instructions: z13.string().max(2e3).nullable()
|
|
2144
2299
|
}),
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
type:
|
|
2151
|
-
sessionId:
|
|
2152
|
-
provider:
|
|
2153
|
-
modelId:
|
|
2300
|
+
z13.object({ type: z13.literal("session.reload"), sessionId: z13.string() }),
|
|
2301
|
+
z13.object({ type: z13.literal("session.adapters"), sessionId: z13.string() }),
|
|
2302
|
+
z13.object({ type: z13.literal("session.reloadAdapters"), sessionId: z13.string() }),
|
|
2303
|
+
z13.object({ type: z13.literal("session.export"), sessionId: z13.string() }),
|
|
2304
|
+
z13.object({
|
|
2305
|
+
type: z13.literal("session.setModel"),
|
|
2306
|
+
sessionId: z13.string(),
|
|
2307
|
+
provider: z13.string().min(1),
|
|
2308
|
+
modelId: z13.string().min(1)
|
|
2154
2309
|
}),
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
type:
|
|
2158
|
-
sessionId:
|
|
2159
|
-
instructions:
|
|
2310
|
+
z13.object({ type: z13.literal("session.setThinking"), sessionId: z13.string(), level: ThinkingLevel }),
|
|
2311
|
+
z13.object({
|
|
2312
|
+
type: z13.literal("session.compact"),
|
|
2313
|
+
sessionId: z13.string(),
|
|
2314
|
+
instructions: z13.string().nullable()
|
|
2160
2315
|
}),
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
type:
|
|
2165
|
-
days:
|
|
2316
|
+
z13.object({ type: z13.literal("checkout.inspect"), path: z13.string() }),
|
|
2317
|
+
z13.object({ type: z13.literal("projects.scan"), folder: z13.string().min(1) }),
|
|
2318
|
+
z13.object({
|
|
2319
|
+
type: z13.literal("projects.suggest"),
|
|
2320
|
+
days: z13.number().int().min(1).max(365).default(30)
|
|
2166
2321
|
}),
|
|
2167
|
-
|
|
2168
|
-
type:
|
|
2169
|
-
checkoutPath:
|
|
2170
|
-
worktreeDir:
|
|
2322
|
+
z13.object({
|
|
2323
|
+
type: z13.literal("workspace.discover"),
|
|
2324
|
+
checkoutPath: z13.string(),
|
|
2325
|
+
worktreeDir: z13.string().default(DEFAULT_WORKTREE_DIR)
|
|
2171
2326
|
}),
|
|
2172
|
-
|
|
2173
|
-
type:
|
|
2174
|
-
checkoutPath:
|
|
2175
|
-
branch:
|
|
2176
|
-
base:
|
|
2177
|
-
setupCommand:
|
|
2178
|
-
worktreeDir:
|
|
2327
|
+
z13.object({
|
|
2328
|
+
type: z13.literal("workspace.create"),
|
|
2329
|
+
checkoutPath: z13.string(),
|
|
2330
|
+
branch: z13.string(),
|
|
2331
|
+
base: z13.string(),
|
|
2332
|
+
setupCommand: z13.string().nullable(),
|
|
2333
|
+
worktreeDir: z13.string().default(DEFAULT_WORKTREE_DIR)
|
|
2179
2334
|
}),
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
type:
|
|
2183
|
-
path:
|
|
2184
|
-
checkoutPath:
|
|
2185
|
-
base:
|
|
2186
|
-
force:
|
|
2335
|
+
z13.object({ type: z13.literal("workspace.status"), path: z13.string(), base: z13.string().nullable() }),
|
|
2336
|
+
z13.object({
|
|
2337
|
+
type: z13.literal("workspace.remove"),
|
|
2338
|
+
path: z13.string(),
|
|
2339
|
+
checkoutPath: z13.string(),
|
|
2340
|
+
base: z13.string().nullable(),
|
|
2341
|
+
force: z13.object({ dirty: z13.boolean(), unmerged: z13.boolean() }),
|
|
2342
|
+
/** Also delete the worktree's local branch (hosts before trackers ignore it). */
|
|
2343
|
+
deleteBranch: z13.boolean().optional()
|
|
2187
2344
|
}),
|
|
2188
|
-
|
|
2189
|
-
type:
|
|
2190
|
-
path:
|
|
2191
|
-
base:
|
|
2192
|
-
file:
|
|
2345
|
+
z13.object({
|
|
2346
|
+
type: z13.literal("workspace.diff"),
|
|
2347
|
+
path: z13.string(),
|
|
2348
|
+
base: z13.string().nullable(),
|
|
2349
|
+
file: z13.string().nullable()
|
|
2193
2350
|
}),
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
GitHubHostViewRequest.extend({ type:
|
|
2197
|
-
GitHubHostLogsRequest.extend({ type:
|
|
2198
|
-
GitHubHostMergeRequest.extend({ type:
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2351
|
+
z13.object({ type: z13.literal("workspace.files"), path: z13.string(), dir: z13.string() }),
|
|
2352
|
+
z13.object({ type: z13.literal("workspace.readFile"), path: z13.string(), file: z13.string() }),
|
|
2353
|
+
GitHubHostViewRequest.extend({ type: z13.literal("workspace.prView") }),
|
|
2354
|
+
GitHubHostLogsRequest.extend({ type: z13.literal("workspace.prFailedLogs") }),
|
|
2355
|
+
GitHubHostMergeRequest.extend({ type: z13.literal("workspace.prMerge") }),
|
|
2356
|
+
TrackerHostSyncRequest.extend({ type: z13.literal("tracker.sync") }),
|
|
2357
|
+
TrackerHostPrepareBranchRequest.extend({ type: z13.literal("tracker.prepareBranch") }),
|
|
2358
|
+
TrackerHostStartIssueRequest.extend({ type: z13.literal("tracker.startIssue") }),
|
|
2359
|
+
TrackerHostSetStatusRequest.extend({ type: z13.literal("tracker.setStatus") }),
|
|
2360
|
+
z13.object({
|
|
2361
|
+
type: z13.literal("dispatch.start"),
|
|
2362
|
+
dispatchKey: z13.string(),
|
|
2363
|
+
runId: z13.string(),
|
|
2364
|
+
taskId: z13.string(),
|
|
2365
|
+
sessionId: z13.string(),
|
|
2366
|
+
projectId: z13.string(),
|
|
2367
|
+
title: z13.string(),
|
|
2368
|
+
workspace: z13.union([
|
|
2369
|
+
z13.object({ path: z13.string() }),
|
|
2370
|
+
z13.object({
|
|
2371
|
+
createFrom: z13.object({
|
|
2372
|
+
checkoutPath: z13.string(),
|
|
2373
|
+
branch: z13.string(),
|
|
2374
|
+
base: z13.string(),
|
|
2375
|
+
setupCommand: z13.string().nullable(),
|
|
2376
|
+
worktreeDir: z13.string().default(DEFAULT_WORKTREE_DIR)
|
|
2216
2377
|
})
|
|
2217
2378
|
})
|
|
2218
2379
|
]),
|
|
2219
2380
|
nativeHandle: NativeHandle.nullable(),
|
|
2220
2381
|
profile: Profile,
|
|
2221
|
-
prompt:
|
|
2382
|
+
prompt: z13.string(),
|
|
2222
2383
|
/** The launch's own revision; a takeover always carries a newer one. */
|
|
2223
|
-
controlRevision:
|
|
2384
|
+
controlRevision: z13.number().int(),
|
|
2224
2385
|
controlMode: ControlMode.default("automation"),
|
|
2225
|
-
policyRequired:
|
|
2386
|
+
policyRequired: z13.boolean().optional()
|
|
2226
2387
|
}),
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
type:
|
|
2230
|
-
sessionId:
|
|
2231
|
-
path:
|
|
2232
|
-
commands:
|
|
2388
|
+
z13.object({ type: z13.literal("dispatch.reconcile"), dispatchKey: z13.string() }),
|
|
2389
|
+
z13.object({
|
|
2390
|
+
type: z13.literal("checks.run"),
|
|
2391
|
+
sessionId: z13.string(),
|
|
2392
|
+
path: z13.string(),
|
|
2393
|
+
commands: z13.array(z13.string())
|
|
2233
2394
|
})
|
|
2234
2395
|
]);
|
|
2235
|
-
var ImportableSession =
|
|
2236
|
-
sessionFile:
|
|
2237
|
-
sessionId:
|
|
2238
|
-
cwd:
|
|
2239
|
-
name:
|
|
2240
|
-
mtime:
|
|
2241
|
-
inactive:
|
|
2242
|
-
});
|
|
2243
|
-
var DiscoveredWorktree =
|
|
2244
|
-
path:
|
|
2245
|
-
head:
|
|
2246
|
-
branch:
|
|
2247
|
-
bare:
|
|
2248
|
-
detached:
|
|
2249
|
-
locked:
|
|
2250
|
-
prunable:
|
|
2251
|
-
provenance:
|
|
2396
|
+
var ImportableSession = z13.object({
|
|
2397
|
+
sessionFile: z13.string(),
|
|
2398
|
+
sessionId: z13.string(),
|
|
2399
|
+
cwd: z13.string(),
|
|
2400
|
+
name: z13.string().nullable(),
|
|
2401
|
+
mtime: z13.string(),
|
|
2402
|
+
inactive: z13.boolean()
|
|
2403
|
+
});
|
|
2404
|
+
var DiscoveredWorktree = z13.object({
|
|
2405
|
+
path: z13.string(),
|
|
2406
|
+
head: z13.string().nullable(),
|
|
2407
|
+
branch: z13.string().nullable(),
|
|
2408
|
+
bare: z13.boolean(),
|
|
2409
|
+
detached: z13.boolean(),
|
|
2410
|
+
locked: z13.boolean(),
|
|
2411
|
+
prunable: z13.boolean(),
|
|
2412
|
+
provenance: z13.enum(["managed", "discovered", "main"]),
|
|
2252
2413
|
git: GitState.nullable()
|
|
2253
2414
|
});
|
|
2254
|
-
var CheckoutInfo =
|
|
2255
|
-
root:
|
|
2256
|
-
commonDir:
|
|
2257
|
-
repoIdentity:
|
|
2258
|
-
defaultBranch:
|
|
2415
|
+
var CheckoutInfo = z13.object({
|
|
2416
|
+
root: z13.string(),
|
|
2417
|
+
commonDir: z13.string(),
|
|
2418
|
+
repoIdentity: z13.string(),
|
|
2419
|
+
defaultBranch: z13.string()
|
|
2259
2420
|
});
|
|
2260
|
-
var ScannedRepository = CheckoutInfo.extend({ name:
|
|
2261
|
-
var ProjectFolderScan =
|
|
2421
|
+
var ScannedRepository = CheckoutInfo.extend({ name: z13.string() });
|
|
2422
|
+
var ProjectFolderScan = z13.object({
|
|
2262
2423
|
/** The folder, ~ expanded and realpath'd. */
|
|
2263
|
-
folder:
|
|
2264
|
-
repositories:
|
|
2265
|
-
});
|
|
2266
|
-
var ProjectSuggestion =
|
|
2267
|
-
rootPath:
|
|
2268
|
-
sessionCount:
|
|
2269
|
-
lastActivityAt:
|
|
2270
|
-
});
|
|
2271
|
-
var ProjectSuggestions =
|
|
2272
|
-
var DiffFile =
|
|
2273
|
-
path:
|
|
2274
|
-
oldPath:
|
|
2275
|
-
added:
|
|
2276
|
-
deleted:
|
|
2277
|
-
status:
|
|
2278
|
-
});
|
|
2279
|
-
var DiffResult =
|
|
2280
|
-
base:
|
|
2281
|
-
files:
|
|
2282
|
-
patch:
|
|
2283
|
-
});
|
|
2284
|
-
var FileEntry =
|
|
2285
|
-
name:
|
|
2286
|
-
path:
|
|
2287
|
-
kind:
|
|
2288
|
-
size:
|
|
2289
|
-
});
|
|
2290
|
-
var ReconcileResult =
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
known:
|
|
2294
|
-
sessionId:
|
|
2295
|
-
state:
|
|
2424
|
+
folder: z13.string(),
|
|
2425
|
+
repositories: z13.array(ScannedRepository)
|
|
2426
|
+
});
|
|
2427
|
+
var ProjectSuggestion = z13.object({
|
|
2428
|
+
rootPath: z13.string(),
|
|
2429
|
+
sessionCount: z13.number().int(),
|
|
2430
|
+
lastActivityAt: z13.string()
|
|
2431
|
+
});
|
|
2432
|
+
var ProjectSuggestions = z13.object({ suggestions: z13.array(ProjectSuggestion) });
|
|
2433
|
+
var DiffFile = z13.object({
|
|
2434
|
+
path: z13.string(),
|
|
2435
|
+
oldPath: z13.string().nullable(),
|
|
2436
|
+
added: z13.number().int(),
|
|
2437
|
+
deleted: z13.number().int(),
|
|
2438
|
+
status: z13.enum(["added", "modified", "deleted", "renamed", "untracked", "binary"])
|
|
2439
|
+
});
|
|
2440
|
+
var DiffResult = z13.object({
|
|
2441
|
+
base: z13.string(),
|
|
2442
|
+
files: z13.array(DiffFile),
|
|
2443
|
+
patch: z13.string().nullable()
|
|
2444
|
+
});
|
|
2445
|
+
var FileEntry = z13.object({
|
|
2446
|
+
name: z13.string(),
|
|
2447
|
+
path: z13.string(),
|
|
2448
|
+
kind: z13.enum(["file", "dir", "symlink"]),
|
|
2449
|
+
size: z13.number().int().nullable()
|
|
2450
|
+
});
|
|
2451
|
+
var ReconcileResult = z13.union([
|
|
2452
|
+
z13.object({ known: z13.literal(false) }),
|
|
2453
|
+
z13.object({
|
|
2454
|
+
known: z13.literal(true),
|
|
2455
|
+
sessionId: z13.string().nullable(),
|
|
2456
|
+
state: z13.enum(["accepted", "workspace_ready", "started", "failed"]),
|
|
2296
2457
|
runtime: RuntimeState.nullable(),
|
|
2297
|
-
workspacePath:
|
|
2458
|
+
workspacePath: z13.string().nullable(),
|
|
2298
2459
|
nativeHandle: NativeHandle.nullable(),
|
|
2299
|
-
error:
|
|
2460
|
+
error: z13.string().nullable(),
|
|
2300
2461
|
/** `{started: "unknown"}` when the host restarted after Pi may have been spawned. */
|
|
2301
|
-
errorDetails:
|
|
2462
|
+
errorDetails: z13.record(z13.string(), z13.unknown()).nullable().default(null)
|
|
2302
2463
|
})
|
|
2303
2464
|
]);
|
|
2304
|
-
var DispatchStartResult =
|
|
2305
|
-
sessionId:
|
|
2306
|
-
workspacePath:
|
|
2465
|
+
var DispatchStartResult = z13.object({
|
|
2466
|
+
sessionId: z13.string(),
|
|
2467
|
+
workspacePath: z13.string(),
|
|
2307
2468
|
nativeHandle: NativeHandle.nullable(),
|
|
2308
|
-
reused:
|
|
2469
|
+
reused: z13.boolean(),
|
|
2309
2470
|
/** Why the launch prompt was not delivered to Pi (the session itself started), if it was not. */
|
|
2310
|
-
promptError:
|
|
2471
|
+
promptError: z13.string().nullable().optional()
|
|
2311
2472
|
});
|
|
2312
|
-
var AnswerResult =
|
|
2313
|
-
status:
|
|
2473
|
+
var AnswerResult = z13.object({
|
|
2474
|
+
status: z13.enum(["answered", "already_answered"]),
|
|
2314
2475
|
interaction: Interaction
|
|
2315
2476
|
});
|
|
2316
|
-
var SnapshotResult =
|
|
2317
|
-
partial:
|
|
2318
|
-
pendingInteractions:
|
|
2477
|
+
var SnapshotResult = z13.object({
|
|
2478
|
+
partial: z13.array(TranscriptItem),
|
|
2479
|
+
pendingInteractions: z13.array(Interaction)
|
|
2319
2480
|
});
|
|
2320
|
-
var ChecksResult =
|
|
2321
|
-
var Receipt =
|
|
2322
|
-
|
|
2323
|
-
|
|
2481
|
+
var ChecksResult = z13.object({ results: z13.array(CheckResult) });
|
|
2482
|
+
var Receipt = z13.union([
|
|
2483
|
+
z13.object({ commandId: z13.string(), ok: z13.literal(true), result: z13.unknown() }),
|
|
2484
|
+
z13.object({ commandId: z13.string(), ok: z13.literal(false), error: ErrorBody })
|
|
2324
2485
|
]);
|
|
2325
2486
|
var HostAgentRequestFrame = AgentRequestFrame.safeExtend({
|
|
2326
2487
|
policyContext: HostToolPolicyContext.optional()
|
|
@@ -2339,279 +2500,281 @@ var HostAgentRequestFrame = AgentRequestFrame.safeExtend({
|
|
|
2339
2500
|
}
|
|
2340
2501
|
ctx.addIssue({ code: "custom", message: "Host agent frame exceeds 128 KiB or is not JSON." });
|
|
2341
2502
|
});
|
|
2342
|
-
var HostToCoordinator =
|
|
2343
|
-
|
|
2344
|
-
type:
|
|
2345
|
-
hostId:
|
|
2346
|
-
credential:
|
|
2347
|
-
name:
|
|
2348
|
-
agentVersion:
|
|
2349
|
-
piVersion:
|
|
2350
|
-
piCompatible:
|
|
2503
|
+
var HostToCoordinator = z13.discriminatedUnion("type", [
|
|
2504
|
+
z13.object({
|
|
2505
|
+
type: z13.literal("hello"),
|
|
2506
|
+
hostId: z13.string(),
|
|
2507
|
+
credential: z13.string(),
|
|
2508
|
+
name: z13.string(),
|
|
2509
|
+
agentVersion: z13.string(),
|
|
2510
|
+
piVersion: z13.string().nullable(),
|
|
2511
|
+
piCompatible: z13.boolean(),
|
|
2351
2512
|
platform: Platform,
|
|
2352
2513
|
capabilities: RuntimeCapabilities.nullable(),
|
|
2353
2514
|
github: HostGitHub.optional(),
|
|
2354
|
-
protocolVersion:
|
|
2355
|
-
features:
|
|
2515
|
+
protocolVersion: z13.number().int(),
|
|
2516
|
+
features: z13.array(z13.string()).optional()
|
|
2356
2517
|
}),
|
|
2357
2518
|
HostAgentRequestFrame,
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2519
|
+
z13.object({ type: z13.literal("event"), hostSeq: z13.number().int(), event: HostEvent }),
|
|
2520
|
+
z13.object({ type: z13.literal("stream"), delta: StreamDelta }),
|
|
2521
|
+
z13.object({ type: z13.literal("receipt"), receipt: Receipt }),
|
|
2522
|
+
z13.object({ type: z13.literal("pong") }),
|
|
2523
|
+
z13.object({ type: z13.literal("usage"), usage: z13.array(ProviderUsage) }),
|
|
2524
|
+
z13.object({ type: z13.literal("term"), streamId: z13.string(), msg: TermServerToViewer })
|
|
2364
2525
|
]);
|
|
2365
|
-
var CoordinatorToHost =
|
|
2366
|
-
|
|
2367
|
-
type:
|
|
2368
|
-
coordinatorVersion:
|
|
2369
|
-
ackedHostSeq:
|
|
2370
|
-
features:
|
|
2526
|
+
var CoordinatorToHost = z13.discriminatedUnion("type", [
|
|
2527
|
+
z13.object({
|
|
2528
|
+
type: z13.literal("welcome"),
|
|
2529
|
+
coordinatorVersion: z13.string(),
|
|
2530
|
+
ackedHostSeq: z13.number().int(),
|
|
2531
|
+
features: z13.array(z13.string()).optional()
|
|
2371
2532
|
}),
|
|
2372
2533
|
AgentResultFrame,
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2534
|
+
z13.object({ type: z13.literal("ack"), hostSeq: z13.number().int() }),
|
|
2535
|
+
z13.object({ type: z13.literal("command"), commandId: z13.string(), command: HostCommand }),
|
|
2536
|
+
z13.object({ type: z13.literal("ping") }),
|
|
2537
|
+
z13.object({ type: z13.literal("reject"), error: ErrorBody }),
|
|
2538
|
+
z13.object({ type: z13.literal("term"), streamId: z13.string(), msg: TermCoordinatorMsg })
|
|
2378
2539
|
]);
|
|
2379
2540
|
|
|
2380
2541
|
// packages/protocol/dist/api.js
|
|
2381
|
-
var EnrollRequest =
|
|
2382
|
-
token:
|
|
2383
|
-
name:
|
|
2542
|
+
var EnrollRequest = z14.object({
|
|
2543
|
+
token: z14.string().min(1),
|
|
2544
|
+
name: z14.string().min(1).max(80),
|
|
2384
2545
|
kind: DeviceKind
|
|
2385
2546
|
});
|
|
2386
|
-
var EnrollResponse =
|
|
2387
|
-
var CreateEnrollmentRequest =
|
|
2388
|
-
var CreateEnrollmentResponse =
|
|
2389
|
-
token:
|
|
2390
|
-
url:
|
|
2391
|
-
expiresAt:
|
|
2392
|
-
qrSvg:
|
|
2393
|
-
command:
|
|
2547
|
+
var EnrollResponse = z14.object({ deviceId: z14.string(), credential: z14.string() });
|
|
2548
|
+
var CreateEnrollmentRequest = z14.object({ kind: z14.enum(["device", "host"]) });
|
|
2549
|
+
var CreateEnrollmentResponse = z14.object({
|
|
2550
|
+
token: z14.string(),
|
|
2551
|
+
url: z14.string(),
|
|
2552
|
+
expiresAt: z14.string(),
|
|
2553
|
+
qrSvg: z14.string(),
|
|
2554
|
+
command: z14.string().nullable()
|
|
2394
2555
|
});
|
|
2395
|
-
var HostEnrollRequest =
|
|
2396
|
-
|
|
2397
|
-
token:
|
|
2398
|
-
name:
|
|
2556
|
+
var HostEnrollRequest = z14.union([
|
|
2557
|
+
z14.object({
|
|
2558
|
+
token: z14.string().min(1),
|
|
2559
|
+
name: z14.string().min(1).max(80),
|
|
2399
2560
|
platform: Platform
|
|
2400
2561
|
}),
|
|
2401
|
-
|
|
2402
|
-
secret:
|
|
2403
|
-
name:
|
|
2562
|
+
z14.object({
|
|
2563
|
+
secret: z14.string().min(1),
|
|
2564
|
+
name: z14.string().min(1).max(80),
|
|
2404
2565
|
platform: Platform
|
|
2405
2566
|
})
|
|
2406
2567
|
]);
|
|
2407
|
-
var HostEnrollResponse =
|
|
2408
|
-
var CreateProjectRequest =
|
|
2409
|
-
name:
|
|
2410
|
-
hostId:
|
|
2411
|
-
path:
|
|
2412
|
-
defaultProfileId:
|
|
2413
|
-
setupCommand:
|
|
2414
|
-
checks:
|
|
2415
|
-
maxConcurrentRuns:
|
|
2568
|
+
var HostEnrollResponse = z14.object({ hostId: z14.string(), credential: z14.string() });
|
|
2569
|
+
var CreateProjectRequest = z14.object({
|
|
2570
|
+
name: z14.string().min(1),
|
|
2571
|
+
hostId: z14.string(),
|
|
2572
|
+
path: z14.string().min(1),
|
|
2573
|
+
defaultProfileId: z14.string().nullable().optional(),
|
|
2574
|
+
setupCommand: z14.string().nullable().optional(),
|
|
2575
|
+
checks: z14.array(z14.string()).optional(),
|
|
2576
|
+
maxConcurrentRuns: z14.number().int().min(1).max(32).optional(),
|
|
2416
2577
|
worktreeDir: WorktreeDir.optional()
|
|
2417
2578
|
});
|
|
2418
|
-
var UpdateProjectRequest =
|
|
2419
|
-
name:
|
|
2420
|
-
defaultProfileId:
|
|
2421
|
-
defaultHostId:
|
|
2422
|
-
maxConcurrentRuns:
|
|
2423
|
-
automationEnabled:
|
|
2424
|
-
setupCommand:
|
|
2425
|
-
checks:
|
|
2426
|
-
workspaceSharing:
|
|
2427
|
-
worktreeDir: WorktreeDir.optional()
|
|
2428
|
-
|
|
2429
|
-
|
|
2579
|
+
var UpdateProjectRequest = z14.object({
|
|
2580
|
+
name: z14.string().min(1).optional(),
|
|
2581
|
+
defaultProfileId: z14.string().nullable().optional(),
|
|
2582
|
+
defaultHostId: z14.string().nullable().optional(),
|
|
2583
|
+
maxConcurrentRuns: z14.number().int().min(1).max(32).optional(),
|
|
2584
|
+
automationEnabled: z14.boolean().optional(),
|
|
2585
|
+
setupCommand: z14.string().nullable().optional(),
|
|
2586
|
+
checks: z14.array(z14.string()).optional(),
|
|
2587
|
+
workspaceSharing: z14.enum(["single_writer", "shared"]).optional(),
|
|
2588
|
+
worktreeDir: WorktreeDir.optional(),
|
|
2589
|
+
ensureSessions: z14.boolean().optional(),
|
|
2590
|
+
removeLanded: z14.boolean().optional()
|
|
2591
|
+
});
|
|
2592
|
+
var AddCheckoutRequest = z14.object({ hostId: z14.string(), path: z14.string().min(1) });
|
|
2430
2593
|
function isProjectFolderPath(s) {
|
|
2431
2594
|
if (s.includes("\0"))
|
|
2432
2595
|
return false;
|
|
2433
2596
|
return s === "~" || s.startsWith("~/") || s.startsWith("/");
|
|
2434
2597
|
}
|
|
2435
|
-
var ProjectFolder =
|
|
2436
|
-
var UpdateHostRequest =
|
|
2437
|
-
projectFolders:
|
|
2598
|
+
var ProjectFolder = z14.string().trim().min(1).max(1024).refine(isProjectFolderPath, "must be an absolute path or start with ~/");
|
|
2599
|
+
var UpdateHostRequest = z14.object({
|
|
2600
|
+
projectFolders: z14.array(ProjectFolder).max(20).optional()
|
|
2438
2601
|
});
|
|
2439
2602
|
var ProjectScanResult = ProjectScan.extend({
|
|
2440
|
-
added:
|
|
2441
|
-
projectId:
|
|
2442
|
-
name:
|
|
2443
|
-
path:
|
|
2444
|
-
newProject:
|
|
2603
|
+
added: z14.array(z14.object({
|
|
2604
|
+
projectId: z14.string(),
|
|
2605
|
+
name: z14.string(),
|
|
2606
|
+
path: z14.string(),
|
|
2607
|
+
newProject: z14.boolean()
|
|
2445
2608
|
}))
|
|
2446
2609
|
});
|
|
2447
|
-
var ProfileInput =
|
|
2448
|
-
name:
|
|
2449
|
-
provider:
|
|
2450
|
-
model:
|
|
2610
|
+
var ProfileInput = z14.object({
|
|
2611
|
+
name: z14.string().min(1),
|
|
2612
|
+
provider: z14.string().nullable().default(null),
|
|
2613
|
+
model: z14.string().nullable().default(null),
|
|
2451
2614
|
thinking: ThinkingLevel.nullable().default(null),
|
|
2452
|
-
projectTrust:
|
|
2453
|
-
extraArgs:
|
|
2454
|
-
resources:
|
|
2455
|
-
});
|
|
2456
|
-
var CreateWorkspaceRequest =
|
|
2457
|
-
checkoutId:
|
|
2458
|
-
branch:
|
|
2459
|
-
base:
|
|
2460
|
-
});
|
|
2461
|
-
var RemoveWorkspaceRequest =
|
|
2462
|
-
force:
|
|
2463
|
-
});
|
|
2464
|
-
var CreateSessionRequest =
|
|
2465
|
-
projectId:
|
|
2466
|
-
workspace:
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
checkoutId:
|
|
2470
|
-
newBranch:
|
|
2471
|
-
base:
|
|
2615
|
+
projectTrust: z14.enum(["ask", "approve", "ignore"]).default("ask"),
|
|
2616
|
+
extraArgs: z14.array(ExtraArg).default([]),
|
|
2617
|
+
resources: z14.enum(["all", "vanilla"]).default("all")
|
|
2618
|
+
});
|
|
2619
|
+
var CreateWorkspaceRequest = z14.object({
|
|
2620
|
+
checkoutId: z14.string(),
|
|
2621
|
+
branch: z14.string().min(1),
|
|
2622
|
+
base: z14.string().nullable().optional()
|
|
2623
|
+
});
|
|
2624
|
+
var RemoveWorkspaceRequest = z14.object({
|
|
2625
|
+
force: z14.object({ dirty: z14.boolean(), unmerged: z14.boolean() }).default({ dirty: false, unmerged: false })
|
|
2626
|
+
});
|
|
2627
|
+
var CreateSessionRequest = z14.object({
|
|
2628
|
+
projectId: z14.string(),
|
|
2629
|
+
workspace: z14.union([
|
|
2630
|
+
z14.object({ existingId: z14.string() }),
|
|
2631
|
+
z14.object({
|
|
2632
|
+
checkoutId: z14.string(),
|
|
2633
|
+
newBranch: z14.string().min(1),
|
|
2634
|
+
base: z14.string().nullable().optional()
|
|
2472
2635
|
})
|
|
2473
2636
|
]),
|
|
2474
|
-
profileId:
|
|
2475
|
-
prompt:
|
|
2476
|
-
title:
|
|
2477
|
-
viewId:
|
|
2478
|
-
});
|
|
2479
|
-
var PromptRequest =
|
|
2480
|
-
text:
|
|
2481
|
-
mode:
|
|
2482
|
-
images:
|
|
2483
|
-
clientMessageId:
|
|
2484
|
-
});
|
|
2485
|
-
var CacheAlertRequest =
|
|
2486
|
-
enabled:
|
|
2487
|
-
ttlSec:
|
|
2488
|
-
});
|
|
2489
|
-
var RenameRequest =
|
|
2490
|
-
var SetModelRequest =
|
|
2491
|
-
provider:
|
|
2492
|
-
modelId:
|
|
2493
|
-
});
|
|
2494
|
-
var SetThinkingRequest =
|
|
2495
|
-
var CompactRequest =
|
|
2496
|
-
var SessionModelsResult =
|
|
2497
|
-
var SessionCommandsResult =
|
|
2498
|
-
var CompleteRequest =
|
|
2499
|
-
var CompletionItem =
|
|
2500
|
-
value:
|
|
2501
|
-
label:
|
|
2502
|
-
description:
|
|
2503
|
-
});
|
|
2504
|
-
var SessionCompleteResult =
|
|
2505
|
-
items:
|
|
2506
|
-
prefix:
|
|
2507
|
-
});
|
|
2508
|
-
var TreeRow =
|
|
2509
|
-
entryId:
|
|
2510
|
-
parentId:
|
|
2511
|
-
depth:
|
|
2512
|
-
role:
|
|
2513
|
-
text:
|
|
2514
|
-
activeBranch:
|
|
2515
|
-
leaf:
|
|
2516
|
-
label:
|
|
2517
|
-
at:
|
|
2518
|
-
});
|
|
2519
|
-
var SessionTreeResult =
|
|
2520
|
-
var BranchRequest =
|
|
2521
|
-
entryId:
|
|
2522
|
-
fork:
|
|
2523
|
-
});
|
|
2524
|
-
var HostBranchResult =
|
|
2525
|
-
sessionFile:
|
|
2526
|
-
prefill:
|
|
2527
|
-
});
|
|
2528
|
-
var TranscriptPage =
|
|
2529
|
-
items:
|
|
2530
|
-
hasMore:
|
|
2531
|
-
epoch:
|
|
2532
|
-
rev:
|
|
2533
|
-
delta:
|
|
2534
|
-
reset:
|
|
2535
|
-
});
|
|
2536
|
-
var NavigateRequest =
|
|
2537
|
-
entryId:
|
|
2538
|
-
summarize:
|
|
2539
|
-
instructions:
|
|
2540
|
-
});
|
|
2541
|
-
var HostNavigateResult =
|
|
2542
|
-
items:
|
|
2543
|
-
prefill:
|
|
2544
|
-
});
|
|
2545
|
-
var NavigateResult =
|
|
2546
|
-
prefill:
|
|
2547
|
-
epoch:
|
|
2548
|
-
});
|
|
2549
|
-
var BranchResult =
|
|
2637
|
+
profileId: z14.string().nullable().optional(),
|
|
2638
|
+
prompt: z14.string().default(""),
|
|
2639
|
+
title: z14.string().optional(),
|
|
2640
|
+
viewId: z14.string().optional()
|
|
2641
|
+
});
|
|
2642
|
+
var PromptRequest = z14.object({
|
|
2643
|
+
text: z14.string().min(1),
|
|
2644
|
+
mode: z14.enum(["prompt", "steer", "followUp"]).default("prompt"),
|
|
2645
|
+
images: z14.array(z14.object({ mimeType: z14.string(), data: z14.string() })).default([]),
|
|
2646
|
+
clientMessageId: z14.string().optional()
|
|
2647
|
+
});
|
|
2648
|
+
var CacheAlertRequest = z14.object({
|
|
2649
|
+
enabled: z14.boolean(),
|
|
2650
|
+
ttlSec: z14.number().int().min(60).max(86400).nullable().default(null)
|
|
2651
|
+
});
|
|
2652
|
+
var RenameRequest = z14.object({ title: z14.string().min(1).max(200) });
|
|
2653
|
+
var SetModelRequest = z14.object({
|
|
2654
|
+
provider: z14.string().min(1),
|
|
2655
|
+
modelId: z14.string().min(1)
|
|
2656
|
+
});
|
|
2657
|
+
var SetThinkingRequest = z14.object({ level: ThinkingLevel });
|
|
2658
|
+
var CompactRequest = z14.object({ instructions: z14.string().max(4e3).optional() });
|
|
2659
|
+
var SessionModelsResult = z14.object({ models: z14.array(SessionModel) });
|
|
2660
|
+
var SessionCommandsResult = z14.object({ commands: z14.array(SlashCommand) });
|
|
2661
|
+
var CompleteRequest = z14.object({ text: z14.string().min(1).max(500) });
|
|
2662
|
+
var CompletionItem = z14.object({
|
|
2663
|
+
value: z14.string(),
|
|
2664
|
+
label: z14.string(),
|
|
2665
|
+
description: z14.string().nullable()
|
|
2666
|
+
});
|
|
2667
|
+
var SessionCompleteResult = z14.object({
|
|
2668
|
+
items: z14.array(CompletionItem).max(50),
|
|
2669
|
+
prefix: z14.string()
|
|
2670
|
+
});
|
|
2671
|
+
var TreeRow = z14.object({
|
|
2672
|
+
entryId: z14.string(),
|
|
2673
|
+
parentId: z14.string().nullable(),
|
|
2674
|
+
depth: z14.number().int(),
|
|
2675
|
+
role: z14.enum(["user", "assistant"]),
|
|
2676
|
+
text: z14.string(),
|
|
2677
|
+
activeBranch: z14.boolean(),
|
|
2678
|
+
leaf: z14.boolean(),
|
|
2679
|
+
label: z14.string().nullable(),
|
|
2680
|
+
at: z14.string().nullable()
|
|
2681
|
+
});
|
|
2682
|
+
var SessionTreeResult = z14.object({ rows: z14.array(TreeRow) });
|
|
2683
|
+
var BranchRequest = z14.object({
|
|
2684
|
+
entryId: z14.string().nullable(),
|
|
2685
|
+
fork: z14.boolean().default(false)
|
|
2686
|
+
});
|
|
2687
|
+
var HostBranchResult = z14.object({
|
|
2688
|
+
sessionFile: z14.string().nullable(),
|
|
2689
|
+
prefill: z14.string().nullable()
|
|
2690
|
+
});
|
|
2691
|
+
var TranscriptPage = z14.object({
|
|
2692
|
+
items: z14.array(TranscriptItem),
|
|
2693
|
+
hasMore: z14.boolean(),
|
|
2694
|
+
epoch: z14.number().int().optional(),
|
|
2695
|
+
rev: z14.number().int().optional(),
|
|
2696
|
+
delta: z14.boolean().optional(),
|
|
2697
|
+
reset: z14.boolean().optional()
|
|
2698
|
+
});
|
|
2699
|
+
var NavigateRequest = z14.object({
|
|
2700
|
+
entryId: z14.string().min(1),
|
|
2701
|
+
summarize: z14.boolean().default(false),
|
|
2702
|
+
instructions: z14.string().max(2e3).nullable().default(null)
|
|
2703
|
+
});
|
|
2704
|
+
var HostNavigateResult = z14.object({
|
|
2705
|
+
items: z14.array(TranscriptItem),
|
|
2706
|
+
prefill: z14.string().nullable()
|
|
2707
|
+
});
|
|
2708
|
+
var NavigateResult = z14.object({
|
|
2709
|
+
prefill: z14.string().nullable(),
|
|
2710
|
+
epoch: z14.number().int()
|
|
2711
|
+
});
|
|
2712
|
+
var BranchResult = z14.object({
|
|
2550
2713
|
session: Session.nullable(),
|
|
2551
|
-
prefill:
|
|
2714
|
+
prefill: z14.string().nullable()
|
|
2552
2715
|
});
|
|
2553
|
-
var SessionExportResult =
|
|
2554
|
-
var CommandViewAction =
|
|
2555
|
-
label:
|
|
2556
|
-
command:
|
|
2557
|
-
tone:
|
|
2716
|
+
var SessionExportResult = z14.object({ fileName: z14.string(), content: z14.string() });
|
|
2717
|
+
var CommandViewAction = z14.object({
|
|
2718
|
+
label: z14.string().min(1).max(80),
|
|
2719
|
+
command: z14.string().startsWith("/").max(500),
|
|
2720
|
+
tone: z14.enum(["default", "primary", "danger"]).optional()
|
|
2558
2721
|
});
|
|
2559
|
-
var CommandView =
|
|
2560
|
-
title:
|
|
2722
|
+
var CommandView = z14.object({
|
|
2723
|
+
title: z14.string().min(1).max(200),
|
|
2561
2724
|
body: UINodeSchema,
|
|
2562
|
-
actions:
|
|
2725
|
+
actions: z14.array(CommandViewAction).max(30).default([])
|
|
2563
2726
|
});
|
|
2564
|
-
var ModelStateResult =
|
|
2727
|
+
var ModelStateResult = z14.object({
|
|
2565
2728
|
model: SessionModel.nullable(),
|
|
2566
2729
|
thinking: ThinkingLevel.nullable()
|
|
2567
2730
|
});
|
|
2568
|
-
var ImportSessionRequest =
|
|
2569
|
-
hostId:
|
|
2570
|
-
sessionFile:
|
|
2571
|
-
projectId:
|
|
2731
|
+
var ImportSessionRequest = z14.object({
|
|
2732
|
+
hostId: z14.string(),
|
|
2733
|
+
sessionFile: z14.string(),
|
|
2734
|
+
projectId: z14.string().nullable().optional()
|
|
2572
2735
|
});
|
|
2573
|
-
var AnswerRequest =
|
|
2574
|
-
revision:
|
|
2736
|
+
var AnswerRequest = z14.object({
|
|
2737
|
+
revision: z14.number().int(),
|
|
2575
2738
|
response: InteractionResponseSchema
|
|
2576
2739
|
});
|
|
2577
|
-
var AdapterActionRequest =
|
|
2578
|
-
generation:
|
|
2579
|
-
adapterId:
|
|
2580
|
-
actionId:
|
|
2581
|
-
payload:
|
|
2582
|
-
});
|
|
2583
|
-
var TaskPolicyPatch =
|
|
2584
|
-
hostId:
|
|
2585
|
-
profileId:
|
|
2586
|
-
workspace:
|
|
2587
|
-
mode:
|
|
2588
|
-
branch:
|
|
2589
|
-
base:
|
|
2590
|
-
workspaceId:
|
|
2740
|
+
var AdapterActionRequest = z14.object({
|
|
2741
|
+
generation: z14.string().uuid().optional(),
|
|
2742
|
+
adapterId: z14.string(),
|
|
2743
|
+
actionId: z14.string(),
|
|
2744
|
+
payload: z14.unknown().optional()
|
|
2745
|
+
});
|
|
2746
|
+
var TaskPolicyPatch = z14.object({
|
|
2747
|
+
hostId: z14.string().nullable().optional(),
|
|
2748
|
+
profileId: z14.string().nullable().optional(),
|
|
2749
|
+
workspace: z14.object({
|
|
2750
|
+
mode: z14.enum(["new_worktree", "existing"]).optional(),
|
|
2751
|
+
branch: z14.string().nullable().optional(),
|
|
2752
|
+
base: z14.string().nullable().optional(),
|
|
2753
|
+
workspaceId: z14.string().optional()
|
|
2591
2754
|
}).optional(),
|
|
2592
|
-
continuation:
|
|
2593
|
-
enabled:
|
|
2594
|
-
objective:
|
|
2595
|
-
maxContinuations:
|
|
2596
|
-
maxElapsedMinutes:
|
|
2597
|
-
maxTokens:
|
|
2598
|
-
maxCostUsd:
|
|
2755
|
+
continuation: z14.object({
|
|
2756
|
+
enabled: z14.boolean().optional(),
|
|
2757
|
+
objective: z14.string().min(1).optional(),
|
|
2758
|
+
maxContinuations: z14.number().int().min(1).max(50).optional(),
|
|
2759
|
+
maxElapsedMinutes: z14.number().int().min(1).max(1440).optional(),
|
|
2760
|
+
maxTokens: z14.number().int().positive().nullable().optional(),
|
|
2761
|
+
maxCostUsd: z14.number().positive().nullable().optional()
|
|
2599
2762
|
}).optional(),
|
|
2600
2763
|
completion: CompletionPolicy.partial().optional()
|
|
2601
2764
|
});
|
|
2602
|
-
var CreateTaskRequest =
|
|
2603
|
-
projectId:
|
|
2604
|
-
title:
|
|
2765
|
+
var CreateTaskRequest = z14.object({
|
|
2766
|
+
projectId: z14.string(),
|
|
2767
|
+
title: z14.string().max(300).optional(),
|
|
2605
2768
|
githubIssueUrl: GitHubIssueUrl.optional(),
|
|
2606
|
-
githubIssue:
|
|
2607
|
-
launchPrompt:
|
|
2608
|
-
objective:
|
|
2609
|
-
acceptanceCriteria:
|
|
2610
|
-
dependencies:
|
|
2611
|
-
parentTaskId:
|
|
2769
|
+
githubIssue: z14.never().optional(),
|
|
2770
|
+
launchPrompt: z14.never().optional(),
|
|
2771
|
+
objective: z14.string().default(""),
|
|
2772
|
+
acceptanceCriteria: z14.array(z14.string()).default([]),
|
|
2773
|
+
dependencies: z14.array(z14.string()).default([]),
|
|
2774
|
+
parentTaskId: z14.string().nullable().optional(),
|
|
2612
2775
|
priority: Priority.default(2),
|
|
2613
|
-
state:
|
|
2614
|
-
notBefore:
|
|
2776
|
+
state: z14.enum(["backlog", "ready"]).default("backlog"),
|
|
2777
|
+
notBefore: z14.string().nullable().optional(),
|
|
2615
2778
|
policy: TaskPolicyPatch.optional()
|
|
2616
2779
|
}).superRefine((v, ctx) => {
|
|
2617
2780
|
if (v.githubIssueUrl === void 0) {
|
|
@@ -2649,32 +2812,33 @@ var CreateTaskRequest = z13.object({
|
|
|
2649
2812
|
const issue = githubIssueFromUrl(v.githubIssueUrl);
|
|
2650
2813
|
return { ...v, title: v.title?.trim() || `${issue.repository} #${issue.number}` };
|
|
2651
2814
|
});
|
|
2652
|
-
var UpdateTaskRequest =
|
|
2653
|
-
githubIssueUrl:
|
|
2654
|
-
githubIssue:
|
|
2655
|
-
launchPrompt:
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2815
|
+
var UpdateTaskRequest = z14.object({
|
|
2816
|
+
githubIssueUrl: z14.never().optional(),
|
|
2817
|
+
githubIssue: z14.never().optional(),
|
|
2818
|
+
launchPrompt: z14.never().optional(),
|
|
2819
|
+
tracker: z14.never().optional(),
|
|
2820
|
+
title: z14.string().min(1).max(300).optional(),
|
|
2821
|
+
objective: z14.string().optional(),
|
|
2822
|
+
acceptanceCriteria: z14.array(z14.string()).optional(),
|
|
2823
|
+
dependencies: z14.array(z14.string()).optional(),
|
|
2824
|
+
parentTaskId: z14.string().nullable().optional(),
|
|
2661
2825
|
priority: Priority.optional(),
|
|
2662
|
-
position:
|
|
2663
|
-
notBefore:
|
|
2826
|
+
position: z14.number().optional(),
|
|
2827
|
+
notBefore: z14.string().nullable().optional(),
|
|
2664
2828
|
policy: TaskPolicyPatch.optional()
|
|
2665
2829
|
});
|
|
2666
|
-
var MoveTaskRequest =
|
|
2830
|
+
var MoveTaskRequest = z14.object({
|
|
2667
2831
|
to: TaskState,
|
|
2668
|
-
confirm:
|
|
2669
|
-
onRunning:
|
|
2670
|
-
position:
|
|
2832
|
+
confirm: z14.boolean().optional(),
|
|
2833
|
+
onRunning: z14.enum(["pause", "stop"]).optional(),
|
|
2834
|
+
position: z14.number().optional()
|
|
2671
2835
|
});
|
|
2672
|
-
var RequestChangesRequest =
|
|
2673
|
-
var Eligibility =
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
eligible:
|
|
2677
|
-
wait:
|
|
2836
|
+
var RequestChangesRequest = z14.object({ feedback: z14.array(z14.string().min(1)).min(1) });
|
|
2837
|
+
var Eligibility = z14.union([
|
|
2838
|
+
z14.object({ eligible: z14.literal(true), hostId: z14.string(), hostName: z14.string() }),
|
|
2839
|
+
z14.object({
|
|
2840
|
+
eligible: z14.literal(false),
|
|
2841
|
+
wait: z14.enum([
|
|
2678
2842
|
"dependency",
|
|
2679
2843
|
"host_offline",
|
|
2680
2844
|
"project_limit",
|
|
@@ -2687,151 +2851,152 @@ var Eligibility = z13.union([
|
|
|
2687
2851
|
"already_dispatched",
|
|
2688
2852
|
"retry_backoff"
|
|
2689
2853
|
]),
|
|
2690
|
-
message:
|
|
2854
|
+
message: z14.string()
|
|
2691
2855
|
})
|
|
2692
2856
|
]);
|
|
2693
|
-
var NowResponse =
|
|
2694
|
-
running:
|
|
2695
|
-
queued:
|
|
2696
|
-
dispatchPaused:
|
|
2697
|
-
});
|
|
2698
|
-
var AutomationInput =
|
|
2699
|
-
name:
|
|
2700
|
-
enabled:
|
|
2701
|
-
projectId:
|
|
2857
|
+
var NowResponse = z14.object({
|
|
2858
|
+
running: z14.array(z14.object({ taskId: z14.string(), runId: z14.string(), sessionId: z14.string().nullable() })),
|
|
2859
|
+
queued: z14.array(z14.object({ taskId: z14.string(), eligibility: Eligibility })),
|
|
2860
|
+
dispatchPaused: z14.boolean()
|
|
2861
|
+
});
|
|
2862
|
+
var AutomationInput = z14.object({
|
|
2863
|
+
name: z14.string().min(1),
|
|
2864
|
+
enabled: z14.boolean().default(true),
|
|
2865
|
+
projectId: z14.string(),
|
|
2702
2866
|
trigger: Trigger,
|
|
2703
|
-
filters:
|
|
2867
|
+
filters: z14.array(z14.object({ path: z14.string(), equals: z14.string() })).default([]),
|
|
2704
2868
|
template: TaskTemplate,
|
|
2705
|
-
hostId:
|
|
2706
|
-
profileId:
|
|
2707
|
-
mode:
|
|
2708
|
-
groupingKey:
|
|
2709
|
-
overlap:
|
|
2710
|
-
missed:
|
|
2869
|
+
hostId: z14.string().nullable().default(null),
|
|
2870
|
+
profileId: z14.string().nullable().default(null),
|
|
2871
|
+
mode: z14.enum(["fresh", "continue", "watch"]).default("fresh"),
|
|
2872
|
+
groupingKey: z14.string().nullable().default(null),
|
|
2873
|
+
overlap: z14.enum(["skip", "queue_one", "append"]).default("skip"),
|
|
2874
|
+
missed: z14.enum(["skip", "run_once"]).default("skip"),
|
|
2711
2875
|
continuation: ContinuationPolicy.default({ enabled: false }),
|
|
2712
2876
|
completion: CompletionPolicy.default({ checks: null, requireHumanReview: true })
|
|
2713
2877
|
});
|
|
2714
|
-
var AutomationView = Automation.extend({ summary:
|
|
2715
|
-
var AutomationPreview =
|
|
2716
|
-
summary:
|
|
2878
|
+
var AutomationView = Automation.extend({ summary: z14.string() });
|
|
2879
|
+
var AutomationPreview = z14.object({
|
|
2880
|
+
summary: z14.string(),
|
|
2717
2881
|
task: TaskTemplate,
|
|
2718
|
-
next:
|
|
2719
|
-
});
|
|
2720
|
-
var WebhookTokenResponse =
|
|
2721
|
-
var PushSubscriptionRequest =
|
|
2722
|
-
endpoint:
|
|
2723
|
-
keys:
|
|
2724
|
-
permission:
|
|
2725
|
-
});
|
|
2726
|
-
var NotificationSettings =
|
|
2727
|
-
quietHours:
|
|
2728
|
-
start:
|
|
2729
|
-
end:
|
|
2730
|
-
timezone:
|
|
2882
|
+
next: z14.array(z14.string())
|
|
2883
|
+
});
|
|
2884
|
+
var WebhookTokenResponse = z14.object({ token: z14.string(), url: z14.string() });
|
|
2885
|
+
var PushSubscriptionRequest = z14.object({
|
|
2886
|
+
endpoint: z14.string().url(),
|
|
2887
|
+
keys: z14.object({ p256dh: z14.string(), auth: z14.string() }),
|
|
2888
|
+
permission: z14.enum(["granted", "denied", "default", "unknown"]).default("granted")
|
|
2889
|
+
});
|
|
2890
|
+
var NotificationSettings = z14.object({
|
|
2891
|
+
quietHours: z14.object({
|
|
2892
|
+
start: z14.string().regex(/^\d{2}:\d{2}$/),
|
|
2893
|
+
end: z14.string().regex(/^\d{2}:\d{2}$/),
|
|
2894
|
+
timezone: z14.string()
|
|
2731
2895
|
}).nullable(),
|
|
2732
|
-
privatePreviews:
|
|
2733
|
-
preferredDeviceId:
|
|
2896
|
+
privatePreviews: z14.boolean(),
|
|
2897
|
+
preferredDeviceId: z14.string().nullable()
|
|
2734
2898
|
});
|
|
2735
|
-
var PushPayload =
|
|
2736
|
-
|
|
2737
|
-
type:
|
|
2738
|
-
title:
|
|
2739
|
-
body:
|
|
2740
|
-
tag:
|
|
2741
|
-
url:
|
|
2742
|
-
renotify:
|
|
2899
|
+
var PushPayload = z14.union([
|
|
2900
|
+
z14.object({
|
|
2901
|
+
type: z14.literal("show"),
|
|
2902
|
+
title: z14.string(),
|
|
2903
|
+
body: z14.string(),
|
|
2904
|
+
tag: z14.string(),
|
|
2905
|
+
url: z14.string(),
|
|
2906
|
+
renotify: z14.boolean()
|
|
2743
2907
|
}),
|
|
2744
|
-
|
|
2908
|
+
z14.object({ type: z14.literal("clear"), tag: z14.string() })
|
|
2745
2909
|
]);
|
|
2746
|
-
var SetupState =
|
|
2747
|
-
passkey:
|
|
2748
|
-
available:
|
|
2749
|
-
registered:
|
|
2750
|
-
reason:
|
|
2910
|
+
var SetupState = z14.object({
|
|
2911
|
+
passkey: z14.object({
|
|
2912
|
+
available: z14.boolean(),
|
|
2913
|
+
registered: z14.boolean(),
|
|
2914
|
+
reason: z14.string().nullable()
|
|
2751
2915
|
}),
|
|
2752
|
-
oidc:
|
|
2916
|
+
oidc: z14.object({ label: z14.string() }).nullable()
|
|
2753
2917
|
});
|
|
2754
|
-
var PasskeyRegisterOptionsResponse =
|
|
2755
|
-
challengeId:
|
|
2756
|
-
options:
|
|
2918
|
+
var PasskeyRegisterOptionsResponse = z14.object({
|
|
2919
|
+
challengeId: z14.string(),
|
|
2920
|
+
options: z14.unknown()
|
|
2757
2921
|
});
|
|
2758
|
-
var PasskeyRegisterVerifyRequest =
|
|
2759
|
-
challengeId:
|
|
2760
|
-
name:
|
|
2761
|
-
response:
|
|
2922
|
+
var PasskeyRegisterVerifyRequest = z14.object({
|
|
2923
|
+
challengeId: z14.string(),
|
|
2924
|
+
name: z14.string().min(1).max(80),
|
|
2925
|
+
response: z14.unknown()
|
|
2762
2926
|
});
|
|
2763
|
-
var PasskeySignInOptionsResponse =
|
|
2764
|
-
challengeId:
|
|
2765
|
-
options:
|
|
2927
|
+
var PasskeySignInOptionsResponse = z14.object({
|
|
2928
|
+
challengeId: z14.string(),
|
|
2929
|
+
options: z14.unknown()
|
|
2766
2930
|
});
|
|
2767
|
-
var PasskeySignInVerifyRequest =
|
|
2768
|
-
challengeId:
|
|
2769
|
-
response:
|
|
2770
|
-
deviceName:
|
|
2931
|
+
var PasskeySignInVerifyRequest = z14.object({
|
|
2932
|
+
challengeId: z14.string(),
|
|
2933
|
+
response: z14.unknown(),
|
|
2934
|
+
deviceName: z14.string().min(1).max(80),
|
|
2771
2935
|
kind: DeviceKind.extract(["browser", "pwa"])
|
|
2772
2936
|
});
|
|
2773
|
-
var OidcBeginRequest =
|
|
2774
|
-
deviceName:
|
|
2937
|
+
var OidcBeginRequest = z14.object({
|
|
2938
|
+
deviceName: z14.string().min(1).max(80),
|
|
2775
2939
|
kind: DeviceKind.extract(["browser", "pwa"]),
|
|
2776
|
-
next:
|
|
2777
|
-
handoff:
|
|
2778
|
-
});
|
|
2779
|
-
var OidcBeginResponse =
|
|
2780
|
-
authorizeUrl:
|
|
2781
|
-
flowId:
|
|
2782
|
-
pollToken:
|
|
2783
|
-
});
|
|
2784
|
-
var OidcClaimRequest =
|
|
2785
|
-
var OidcClaimResponse =
|
|
2786
|
-
|
|
2787
|
-
|
|
2940
|
+
next: z14.string().default("/"),
|
|
2941
|
+
handoff: z14.boolean().default(false)
|
|
2942
|
+
});
|
|
2943
|
+
var OidcBeginResponse = z14.object({
|
|
2944
|
+
authorizeUrl: z14.string(),
|
|
2945
|
+
flowId: z14.string().nullable(),
|
|
2946
|
+
pollToken: z14.string().nullable()
|
|
2947
|
+
});
|
|
2948
|
+
var OidcClaimRequest = z14.object({ flowId: z14.string(), pollToken: z14.string() });
|
|
2949
|
+
var OidcClaimResponse = z14.union([
|
|
2950
|
+
z14.object({ status: z14.literal("pending") }),
|
|
2951
|
+
z14.object({ status: z14.literal("done"), deviceId: z14.string() })
|
|
2788
2952
|
]);
|
|
2789
|
-
var TerminalLoginStartRequest =
|
|
2790
|
-
var TerminalLoginStartResponse =
|
|
2791
|
-
userCode:
|
|
2792
|
-
pollToken:
|
|
2793
|
-
verifyUrl:
|
|
2794
|
-
expiresAt:
|
|
2795
|
-
intervalMs:
|
|
2796
|
-
});
|
|
2797
|
-
var TerminalLoginClaimRequest =
|
|
2798
|
-
userCode:
|
|
2799
|
-
pollToken:
|
|
2800
|
-
});
|
|
2801
|
-
var TerminalLoginClaimResponse =
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2953
|
+
var TerminalLoginStartRequest = z14.object({ name: z14.string().min(1).max(80) });
|
|
2954
|
+
var TerminalLoginStartResponse = z14.object({
|
|
2955
|
+
userCode: z14.string(),
|
|
2956
|
+
pollToken: z14.string(),
|
|
2957
|
+
verifyUrl: z14.string(),
|
|
2958
|
+
expiresAt: z14.string(),
|
|
2959
|
+
intervalMs: z14.number().int()
|
|
2960
|
+
});
|
|
2961
|
+
var TerminalLoginClaimRequest = z14.object({
|
|
2962
|
+
userCode: z14.string().min(1),
|
|
2963
|
+
pollToken: z14.string().min(1)
|
|
2964
|
+
});
|
|
2965
|
+
var TerminalLoginClaimResponse = z14.union([
|
|
2966
|
+
z14.object({ status: z14.literal("pending") }),
|
|
2967
|
+
z14.object({ status: z14.literal("denied") }),
|
|
2968
|
+
z14.object({ status: z14.literal("done"), deviceId: z14.string(), credential: z14.string() })
|
|
2805
2969
|
]);
|
|
2806
|
-
var TerminalLoginRequest =
|
|
2807
|
-
userCode:
|
|
2808
|
-
name:
|
|
2809
|
-
requestedFrom:
|
|
2810
|
-
createdAt:
|
|
2811
|
-
expiresAt:
|
|
2812
|
-
status:
|
|
2813
|
-
});
|
|
2814
|
-
var AuthMethods =
|
|
2815
|
-
passkeys:
|
|
2816
|
-
passkeyAvailability:
|
|
2817
|
-
oidc:
|
|
2818
|
-
issuer:
|
|
2819
|
-
label:
|
|
2820
|
-
ownerMatch:
|
|
2821
|
-
status:
|
|
2822
|
-
error:
|
|
2970
|
+
var TerminalLoginRequest = z14.object({
|
|
2971
|
+
userCode: z14.string(),
|
|
2972
|
+
name: z14.string(),
|
|
2973
|
+
requestedFrom: z14.string(),
|
|
2974
|
+
createdAt: z14.string(),
|
|
2975
|
+
expiresAt: z14.string(),
|
|
2976
|
+
status: z14.enum(["pending", "approved", "denied"])
|
|
2977
|
+
});
|
|
2978
|
+
var AuthMethods = z14.object({
|
|
2979
|
+
passkeys: z14.array(Passkey),
|
|
2980
|
+
passkeyAvailability: z14.object({ available: z14.boolean(), reason: z14.string().nullable() }),
|
|
2981
|
+
oidc: z14.object({
|
|
2982
|
+
issuer: z14.string(),
|
|
2983
|
+
label: z14.string(),
|
|
2984
|
+
ownerMatch: z14.string(),
|
|
2985
|
+
status: z14.enum(["ready", "error"]),
|
|
2986
|
+
error: z14.string().nullable()
|
|
2823
2987
|
}).nullable()
|
|
2824
2988
|
});
|
|
2825
|
-
var MeResponse =
|
|
2989
|
+
var MeResponse = z14.object({
|
|
2826
2990
|
device: Device,
|
|
2827
|
-
admin:
|
|
2828
|
-
publicUrl:
|
|
2991
|
+
admin: z14.boolean(),
|
|
2992
|
+
publicUrl: z14.string()
|
|
2829
2993
|
});
|
|
2830
2994
|
var ViewInput = View.pick({
|
|
2831
2995
|
name: true,
|
|
2832
2996
|
mode: true,
|
|
2833
2997
|
projectIds: true,
|
|
2834
|
-
hostIds: true
|
|
2998
|
+
hostIds: true,
|
|
2999
|
+
clientId: true
|
|
2835
3000
|
}).partial({
|
|
2836
3001
|
mode: true,
|
|
2837
3002
|
projectIds: true,
|
|
@@ -2839,8 +3004,8 @@ var ViewInput = View.pick({
|
|
|
2839
3004
|
});
|
|
2840
3005
|
var ViewPatch = ViewInput.partial();
|
|
2841
3006
|
var ViewClientReport = ViewClient.omit({ lastSeenAt: true });
|
|
2842
|
-
var ProjectSuggestionsResponse =
|
|
2843
|
-
suggestions:
|
|
3007
|
+
var ProjectSuggestionsResponse = z14.object({
|
|
3008
|
+
suggestions: z14.array(ProjectSuggestion.extend({ name: z14.string(), preselected: z14.boolean() }))
|
|
2844
3009
|
});
|
|
2845
3010
|
|
|
2846
3011
|
// packages/protocol/dist/backoff.js
|
|
@@ -2851,60 +3016,60 @@ function reconnectDelay(attempt, steps = RECONNECT_BACKOFF_MS, random = Math.ran
|
|
|
2851
3016
|
}
|
|
2852
3017
|
|
|
2853
3018
|
// packages/protocol/dist/client-wire.js
|
|
2854
|
-
import { z as
|
|
2855
|
-
var SyncState =
|
|
2856
|
-
hosts:
|
|
2857
|
-
projects:
|
|
2858
|
-
checkouts:
|
|
2859
|
-
workspaces:
|
|
2860
|
-
profiles:
|
|
2861
|
-
views:
|
|
2862
|
-
sessions:
|
|
2863
|
-
tasks:
|
|
2864
|
-
runs:
|
|
2865
|
-
automations:
|
|
2866
|
-
attention:
|
|
2867
|
-
interactions:
|
|
2868
|
-
panels:
|
|
2869
|
-
devices:
|
|
2870
|
-
adapters:
|
|
2871
|
-
dispatchPaused:
|
|
2872
|
-
});
|
|
2873
|
-
var Presence =
|
|
2874
|
-
foreground:
|
|
2875
|
-
interactedAt:
|
|
2876
|
-
viewing:
|
|
3019
|
+
import { z as z15 } from "zod";
|
|
3020
|
+
var SyncState = z15.object({
|
|
3021
|
+
hosts: z15.array(Host),
|
|
3022
|
+
projects: z15.array(Project),
|
|
3023
|
+
checkouts: z15.array(Checkout),
|
|
3024
|
+
workspaces: z15.array(Workspace),
|
|
3025
|
+
profiles: z15.array(Profile),
|
|
3026
|
+
views: z15.array(View),
|
|
3027
|
+
sessions: z15.array(Session),
|
|
3028
|
+
tasks: z15.array(Task),
|
|
3029
|
+
runs: z15.array(Run),
|
|
3030
|
+
automations: z15.array(Automation),
|
|
3031
|
+
attention: z15.array(AttentionItem),
|
|
3032
|
+
interactions: z15.array(Interaction),
|
|
3033
|
+
panels: z15.array(Panel),
|
|
3034
|
+
devices: z15.array(Device),
|
|
3035
|
+
adapters: z15.record(z15.string(), z15.array(AdapterInfo)),
|
|
3036
|
+
dispatchPaused: z15.boolean()
|
|
3037
|
+
});
|
|
3038
|
+
var Presence = z15.object({
|
|
3039
|
+
foreground: z15.boolean(),
|
|
3040
|
+
interactedAt: z15.string().nullable(),
|
|
3041
|
+
viewing: z15.object({ sessionId: z15.string() }).nullable()
|
|
2877
3042
|
});
|
|
2878
3043
|
var CLIENT_CAPABILITIES = ["adapter.slots.v1", "timeline.cards.v1"];
|
|
2879
|
-
var ClientToServer =
|
|
2880
|
-
|
|
2881
|
-
type:
|
|
2882
|
-
cursor:
|
|
2883
|
-
capabilities:
|
|
2884
|
-
projectionId:
|
|
3044
|
+
var ClientToServer = z15.discriminatedUnion("type", [
|
|
3045
|
+
z15.object({
|
|
3046
|
+
type: z15.literal("hello"),
|
|
3047
|
+
cursor: z15.number().int().nullable(),
|
|
3048
|
+
capabilities: z15.array(z15.string().min(1).max(80)).max(32).optional(),
|
|
3049
|
+
projectionId: z15.string().max(256).nullable().optional()
|
|
2885
3050
|
}),
|
|
2886
|
-
|
|
2887
|
-
|
|
3051
|
+
z15.object({ type: z15.literal("presence"), presence: Presence }),
|
|
3052
|
+
z15.object({ type: z15.literal("ping") })
|
|
2888
3053
|
]);
|
|
2889
|
-
var ServerToClient =
|
|
2890
|
-
|
|
2891
|
-
type:
|
|
2892
|
-
seq:
|
|
2893
|
-
events:
|
|
2894
|
-
capabilities:
|
|
2895
|
-
projectionId:
|
|
3054
|
+
var ServerToClient = z15.discriminatedUnion("type", [
|
|
3055
|
+
z15.object({
|
|
3056
|
+
type: z15.literal("replay"),
|
|
3057
|
+
seq: z15.number().int(),
|
|
3058
|
+
events: z15.array(EventEnvelope),
|
|
3059
|
+
capabilities: z15.array(z15.enum(CLIENT_CAPABILITIES)).optional(),
|
|
3060
|
+
projectionId: z15.string().optional()
|
|
2896
3061
|
}),
|
|
2897
|
-
|
|
2898
|
-
type:
|
|
2899
|
-
seq:
|
|
3062
|
+
z15.object({
|
|
3063
|
+
type: z15.literal("snapshot"),
|
|
3064
|
+
seq: z15.number().int(),
|
|
2900
3065
|
state: SyncState,
|
|
2901
|
-
capabilities:
|
|
2902
|
-
projectionId:
|
|
3066
|
+
capabilities: z15.array(z15.enum(CLIENT_CAPABILITIES)).optional(),
|
|
3067
|
+
projectionId: z15.string().optional()
|
|
2903
3068
|
}),
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
3069
|
+
z15.object({ type: z15.literal("event"), event: EventEnvelope }),
|
|
3070
|
+
z15.object({ type: z15.literal("stream"), delta: StreamDelta }),
|
|
3071
|
+
z15.object({ type: z15.literal("pong") }),
|
|
3072
|
+
z15.object({ type: z15.literal("force_logout"), reason: z15.string() })
|
|
2908
3073
|
]);
|
|
2909
3074
|
|
|
2910
3075
|
// node_modules/.pnpm/ulid@3.0.2/node_modules/ulid/dist/node/index.js
|
|
@@ -3044,17 +3209,17 @@ var ulid = monotonicFactory();
|
|
|
3044
3209
|
var CLIENT_OPEN_MS = 10 * 6e4;
|
|
3045
3210
|
|
|
3046
3211
|
// packages/protocol/dist/web-bridge.js
|
|
3047
|
-
import { z as
|
|
3212
|
+
import { z as z16 } from "zod";
|
|
3048
3213
|
var FRAME_MAX_HEIGHT = 4e3;
|
|
3049
|
-
var FrameToParentMessageSchema =
|
|
3050
|
-
|
|
3051
|
-
type:
|
|
3052
|
-
actionId:
|
|
3053
|
-
payload:
|
|
3214
|
+
var FrameToParentMessageSchema = z16.discriminatedUnion("type", [
|
|
3215
|
+
z16.object({
|
|
3216
|
+
type: z16.literal("action"),
|
|
3217
|
+
actionId: z16.string().min(1).max(200),
|
|
3218
|
+
payload: z16.unknown().optional()
|
|
3054
3219
|
}),
|
|
3055
|
-
|
|
3056
|
-
type:
|
|
3057
|
-
height:
|
|
3220
|
+
z16.object({
|
|
3221
|
+
type: z16.literal("resize"),
|
|
3222
|
+
height: z16.number().finite().min(0).max(FRAME_MAX_HEIGHT)
|
|
3058
3223
|
})
|
|
3059
3224
|
]);
|
|
3060
3225
|
|