@spencerboucher/switchyard-client 0.14.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1524 -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 +103 -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,353 @@ 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
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2206
|
+
var Origin = z13.enum(["human", "automation"]);
|
|
2207
|
+
var DiffRev = z13.string().regex(/^(uncommitted|[0-9a-f]{40})$/);
|
|
2208
|
+
var HostCommand = z13.discriminatedUnion("type", [
|
|
2209
|
+
z13.object({
|
|
2210
|
+
type: z13.literal("session.start"),
|
|
2211
|
+
sessionId: z13.string(),
|
|
2212
|
+
title: z13.string(),
|
|
2213
|
+
workspacePath: z13.string(),
|
|
2214
|
+
projectId: z13.string().nullable(),
|
|
2059
2215
|
profile: Profile,
|
|
2060
2216
|
nativeHandle: NativeHandle.nullable(),
|
|
2061
|
-
initialPrompt:
|
|
2062
|
-
dispatchKey:
|
|
2063
|
-
controlRevision:
|
|
2217
|
+
initialPrompt: z13.string().nullable(),
|
|
2218
|
+
dispatchKey: z13.string().nullable(),
|
|
2219
|
+
controlRevision: z13.number().int(),
|
|
2064
2220
|
controlMode: ControlMode,
|
|
2065
2221
|
origin: Origin,
|
|
2066
|
-
readOnly:
|
|
2067
|
-
policyRequired:
|
|
2222
|
+
readOnly: z13.boolean().default(false),
|
|
2223
|
+
policyRequired: z13.boolean().optional()
|
|
2068
2224
|
}),
|
|
2069
|
-
|
|
2070
|
-
type:
|
|
2071
|
-
sessionId:
|
|
2072
|
-
messageId:
|
|
2073
|
-
payload:
|
|
2074
|
-
deliveryId:
|
|
2075
|
-
kind:
|
|
2076
|
-
text:
|
|
2225
|
+
z13.object({
|
|
2226
|
+
type: z13.literal("session.deliverMessage"),
|
|
2227
|
+
sessionId: z13.string(),
|
|
2228
|
+
messageId: z13.string(),
|
|
2229
|
+
payload: z13.object({
|
|
2230
|
+
deliveryId: z13.string(),
|
|
2231
|
+
kind: z13.enum(["message", "completion"]),
|
|
2232
|
+
text: z13.string()
|
|
2077
2233
|
}),
|
|
2078
|
-
mode:
|
|
2079
|
-
holdUntil:
|
|
2234
|
+
mode: z13.enum(["steer", "queue"]),
|
|
2235
|
+
holdUntil: z13.string()
|
|
2080
2236
|
}),
|
|
2081
|
-
HostPolicySampleRequest.extend({ type:
|
|
2082
|
-
|
|
2083
|
-
type:
|
|
2084
|
-
sessionId:
|
|
2085
|
-
messageIds:
|
|
2237
|
+
HostPolicySampleRequest.extend({ type: z13.literal("session.classifyPolicySample") }),
|
|
2238
|
+
z13.object({
|
|
2239
|
+
type: z13.literal("session.messageStatus"),
|
|
2240
|
+
sessionId: z13.string(),
|
|
2241
|
+
messageIds: z13.array(z13.string().min(1)).min(1).max(100)
|
|
2086
2242
|
}),
|
|
2087
|
-
|
|
2088
|
-
type:
|
|
2089
|
-
sessionId:
|
|
2090
|
-
text:
|
|
2091
|
-
images:
|
|
2092
|
-
mode:
|
|
2243
|
+
z13.object({
|
|
2244
|
+
type: z13.literal("session.prompt"),
|
|
2245
|
+
sessionId: z13.string(),
|
|
2246
|
+
text: z13.string(),
|
|
2247
|
+
images: z13.array(z13.object({ mimeType: z13.string(), data: z13.string() })).default([]),
|
|
2248
|
+
mode: z13.enum(["prompt", "steer", "followUp"]),
|
|
2093
2249
|
origin: Origin,
|
|
2094
|
-
controlRevision:
|
|
2250
|
+
controlRevision: z13.number().int()
|
|
2095
2251
|
}),
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
type:
|
|
2100
|
-
sessionId:
|
|
2101
|
-
interactionId:
|
|
2102
|
-
revision:
|
|
2252
|
+
z13.object({ type: z13.literal("session.abort"), sessionId: z13.string(), clearQueue: z13.boolean() }),
|
|
2253
|
+
z13.object({ type: z13.literal("session.stop"), sessionId: z13.string() }),
|
|
2254
|
+
z13.object({
|
|
2255
|
+
type: z13.literal("session.answer"),
|
|
2256
|
+
sessionId: z13.string(),
|
|
2257
|
+
interactionId: z13.string(),
|
|
2258
|
+
revision: z13.number().int(),
|
|
2103
2259
|
response: InteractionResponseSchema,
|
|
2104
|
-
deviceId:
|
|
2260
|
+
deviceId: z13.string()
|
|
2105
2261
|
}),
|
|
2106
|
-
|
|
2107
|
-
type:
|
|
2108
|
-
sessionId:
|
|
2109
|
-
generation:
|
|
2110
|
-
adapterId:
|
|
2111
|
-
actionId:
|
|
2112
|
-
payload:
|
|
2262
|
+
z13.object({
|
|
2263
|
+
type: z13.literal("session.adapterAction"),
|
|
2264
|
+
sessionId: z13.string(),
|
|
2265
|
+
generation: z13.string().uuid().optional(),
|
|
2266
|
+
adapterId: z13.string(),
|
|
2267
|
+
actionId: z13.string(),
|
|
2268
|
+
payload: z13.unknown()
|
|
2113
2269
|
}),
|
|
2114
|
-
|
|
2115
|
-
type:
|
|
2116
|
-
sessionId:
|
|
2117
|
-
controlRevision:
|
|
2270
|
+
z13.object({
|
|
2271
|
+
type: z13.literal("session.setControl"),
|
|
2272
|
+
sessionId: z13.string(),
|
|
2273
|
+
controlRevision: z13.number().int(),
|
|
2118
2274
|
mode: ControlMode
|
|
2119
2275
|
}),
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
type:
|
|
2128
|
-
sessionId:
|
|
2129
|
-
text:
|
|
2276
|
+
z13.object({ type: z13.literal("session.rename"), sessionId: z13.string(), title: z13.string() }),
|
|
2277
|
+
z13.object({ type: z13.literal("session.importable") }),
|
|
2278
|
+
z13.object({ type: z13.literal("session.readNative"), sessionFile: z13.string() }),
|
|
2279
|
+
z13.object({ type: z13.literal("session.snapshot"), sessionId: z13.string() }),
|
|
2280
|
+
z13.object({ type: z13.literal("session.models"), sessionId: z13.string() }),
|
|
2281
|
+
z13.object({ type: z13.literal("session.commands"), sessionId: z13.string() }),
|
|
2282
|
+
z13.object({
|
|
2283
|
+
type: z13.literal("session.complete"),
|
|
2284
|
+
sessionId: z13.string(),
|
|
2285
|
+
text: z13.string().max(500)
|
|
2130
2286
|
}),
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
type:
|
|
2134
|
-
sessionId:
|
|
2135
|
-
entryId:
|
|
2136
|
-
fork:
|
|
2287
|
+
z13.object({ type: z13.literal("session.tree"), sessionId: z13.string() }),
|
|
2288
|
+
z13.object({
|
|
2289
|
+
type: z13.literal("session.branch"),
|
|
2290
|
+
sessionId: z13.string(),
|
|
2291
|
+
entryId: z13.string().nullable(),
|
|
2292
|
+
fork: z13.boolean()
|
|
2137
2293
|
}),
|
|
2138
|
-
|
|
2139
|
-
type:
|
|
2140
|
-
sessionId:
|
|
2141
|
-
entryId:
|
|
2142
|
-
summarize:
|
|
2143
|
-
instructions:
|
|
2294
|
+
z13.object({
|
|
2295
|
+
type: z13.literal("session.navigate"),
|
|
2296
|
+
sessionId: z13.string(),
|
|
2297
|
+
entryId: z13.string(),
|
|
2298
|
+
summarize: z13.boolean(),
|
|
2299
|
+
instructions: z13.string().max(2e3).nullable()
|
|
2144
2300
|
}),
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
type:
|
|
2151
|
-
sessionId:
|
|
2152
|
-
provider:
|
|
2153
|
-
modelId:
|
|
2301
|
+
z13.object({ type: z13.literal("session.reload"), sessionId: z13.string() }),
|
|
2302
|
+
z13.object({ type: z13.literal("session.adapters"), sessionId: z13.string() }),
|
|
2303
|
+
z13.object({ type: z13.literal("session.reloadAdapters"), sessionId: z13.string() }),
|
|
2304
|
+
z13.object({ type: z13.literal("session.export"), sessionId: z13.string() }),
|
|
2305
|
+
z13.object({
|
|
2306
|
+
type: z13.literal("session.setModel"),
|
|
2307
|
+
sessionId: z13.string(),
|
|
2308
|
+
provider: z13.string().min(1),
|
|
2309
|
+
modelId: z13.string().min(1)
|
|
2154
2310
|
}),
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
type:
|
|
2158
|
-
sessionId:
|
|
2159
|
-
instructions:
|
|
2311
|
+
z13.object({ type: z13.literal("session.setThinking"), sessionId: z13.string(), level: ThinkingLevel }),
|
|
2312
|
+
z13.object({
|
|
2313
|
+
type: z13.literal("session.compact"),
|
|
2314
|
+
sessionId: z13.string(),
|
|
2315
|
+
instructions: z13.string().nullable()
|
|
2160
2316
|
}),
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
type:
|
|
2165
|
-
days:
|
|
2317
|
+
z13.object({ type: z13.literal("checkout.inspect"), path: z13.string() }),
|
|
2318
|
+
z13.object({ type: z13.literal("projects.scan"), folder: z13.string().min(1) }),
|
|
2319
|
+
z13.object({
|
|
2320
|
+
type: z13.literal("projects.suggest"),
|
|
2321
|
+
days: z13.number().int().min(1).max(365).default(30)
|
|
2166
2322
|
}),
|
|
2167
|
-
|
|
2168
|
-
type:
|
|
2169
|
-
checkoutPath:
|
|
2170
|
-
worktreeDir:
|
|
2323
|
+
z13.object({
|
|
2324
|
+
type: z13.literal("workspace.discover"),
|
|
2325
|
+
checkoutPath: z13.string(),
|
|
2326
|
+
worktreeDir: z13.string().default(DEFAULT_WORKTREE_DIR)
|
|
2171
2327
|
}),
|
|
2172
|
-
|
|
2173
|
-
type:
|
|
2174
|
-
checkoutPath:
|
|
2175
|
-
branch:
|
|
2176
|
-
base:
|
|
2177
|
-
setupCommand:
|
|
2178
|
-
worktreeDir:
|
|
2328
|
+
z13.object({
|
|
2329
|
+
type: z13.literal("workspace.create"),
|
|
2330
|
+
checkoutPath: z13.string(),
|
|
2331
|
+
branch: z13.string(),
|
|
2332
|
+
base: z13.string(),
|
|
2333
|
+
setupCommand: z13.string().nullable(),
|
|
2334
|
+
worktreeDir: z13.string().default(DEFAULT_WORKTREE_DIR)
|
|
2179
2335
|
}),
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
type:
|
|
2183
|
-
path:
|
|
2184
|
-
checkoutPath:
|
|
2185
|
-
base:
|
|
2186
|
-
force:
|
|
2336
|
+
z13.object({ type: z13.literal("workspace.status"), path: z13.string(), base: z13.string().nullable() }),
|
|
2337
|
+
z13.object({
|
|
2338
|
+
type: z13.literal("workspace.remove"),
|
|
2339
|
+
path: z13.string(),
|
|
2340
|
+
checkoutPath: z13.string(),
|
|
2341
|
+
base: z13.string().nullable(),
|
|
2342
|
+
force: z13.object({ dirty: z13.boolean(), unmerged: z13.boolean() }),
|
|
2343
|
+
/** Also delete the worktree's local branch (hosts before trackers ignore it). */
|
|
2344
|
+
deleteBranch: z13.boolean().optional()
|
|
2187
2345
|
}),
|
|
2188
|
-
|
|
2189
|
-
type:
|
|
2190
|
-
path:
|
|
2191
|
-
base:
|
|
2192
|
-
file:
|
|
2346
|
+
z13.object({
|
|
2347
|
+
type: z13.literal("workspace.diff"),
|
|
2348
|
+
path: z13.string(),
|
|
2349
|
+
base: z13.string().nullable(),
|
|
2350
|
+
file: z13.string().nullable(),
|
|
2351
|
+
/** Hosts without gitLog.v1 never receive it. */
|
|
2352
|
+
rev: DiffRev.optional()
|
|
2193
2353
|
}),
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2354
|
+
z13.object({
|
|
2355
|
+
type: z13.literal("workspace.log"),
|
|
2356
|
+
path: z13.string(),
|
|
2357
|
+
base: z13.string().nullable(),
|
|
2358
|
+
limit: z13.number().int().min(1).max(200)
|
|
2359
|
+
}),
|
|
2360
|
+
z13.object({ type: z13.literal("workspace.files"), path: z13.string(), dir: z13.string() }),
|
|
2361
|
+
z13.object({ type: z13.literal("workspace.readFile"), path: z13.string(), file: z13.string() }),
|
|
2362
|
+
GitHubHostViewRequest.extend({ type: z13.literal("workspace.prView") }),
|
|
2363
|
+
GitHubHostLogsRequest.extend({ type: z13.literal("workspace.prFailedLogs") }),
|
|
2364
|
+
GitHubHostMergeRequest.extend({ type: z13.literal("workspace.prMerge") }),
|
|
2365
|
+
TrackerHostSyncRequest.extend({ type: z13.literal("tracker.sync") }),
|
|
2366
|
+
TrackerHostPrepareBranchRequest.extend({ type: z13.literal("tracker.prepareBranch") }),
|
|
2367
|
+
TrackerHostStartIssueRequest.extend({ type: z13.literal("tracker.startIssue") }),
|
|
2368
|
+
TrackerHostSetStatusRequest.extend({ type: z13.literal("tracker.setStatus") }),
|
|
2369
|
+
z13.object({
|
|
2370
|
+
type: z13.literal("dispatch.start"),
|
|
2371
|
+
dispatchKey: z13.string(),
|
|
2372
|
+
runId: z13.string(),
|
|
2373
|
+
taskId: z13.string(),
|
|
2374
|
+
sessionId: z13.string(),
|
|
2375
|
+
projectId: z13.string(),
|
|
2376
|
+
title: z13.string(),
|
|
2377
|
+
workspace: z13.union([
|
|
2378
|
+
z13.object({ path: z13.string() }),
|
|
2379
|
+
z13.object({
|
|
2380
|
+
createFrom: z13.object({
|
|
2381
|
+
checkoutPath: z13.string(),
|
|
2382
|
+
branch: z13.string(),
|
|
2383
|
+
base: z13.string(),
|
|
2384
|
+
setupCommand: z13.string().nullable(),
|
|
2385
|
+
worktreeDir: z13.string().default(DEFAULT_WORKTREE_DIR)
|
|
2216
2386
|
})
|
|
2217
2387
|
})
|
|
2218
2388
|
]),
|
|
2219
2389
|
nativeHandle: NativeHandle.nullable(),
|
|
2220
2390
|
profile: Profile,
|
|
2221
|
-
prompt:
|
|
2391
|
+
prompt: z13.string(),
|
|
2222
2392
|
/** The launch's own revision; a takeover always carries a newer one. */
|
|
2223
|
-
controlRevision:
|
|
2393
|
+
controlRevision: z13.number().int(),
|
|
2224
2394
|
controlMode: ControlMode.default("automation"),
|
|
2225
|
-
policyRequired:
|
|
2395
|
+
policyRequired: z13.boolean().optional()
|
|
2226
2396
|
}),
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
type:
|
|
2230
|
-
sessionId:
|
|
2231
|
-
path:
|
|
2232
|
-
commands:
|
|
2397
|
+
z13.object({ type: z13.literal("dispatch.reconcile"), dispatchKey: z13.string() }),
|
|
2398
|
+
z13.object({
|
|
2399
|
+
type: z13.literal("checks.run"),
|
|
2400
|
+
sessionId: z13.string(),
|
|
2401
|
+
path: z13.string(),
|
|
2402
|
+
commands: z13.array(z13.string())
|
|
2233
2403
|
})
|
|
2234
2404
|
]);
|
|
2235
|
-
var ImportableSession =
|
|
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:
|
|
2405
|
+
var ImportableSession = z13.object({
|
|
2406
|
+
sessionFile: z13.string(),
|
|
2407
|
+
sessionId: z13.string(),
|
|
2408
|
+
cwd: z13.string(),
|
|
2409
|
+
name: z13.string().nullable(),
|
|
2410
|
+
mtime: z13.string(),
|
|
2411
|
+
inactive: z13.boolean()
|
|
2412
|
+
});
|
|
2413
|
+
var DiscoveredWorktree = z13.object({
|
|
2414
|
+
path: z13.string(),
|
|
2415
|
+
head: z13.string().nullable(),
|
|
2416
|
+
branch: z13.string().nullable(),
|
|
2417
|
+
bare: z13.boolean(),
|
|
2418
|
+
detached: z13.boolean(),
|
|
2419
|
+
locked: z13.boolean(),
|
|
2420
|
+
prunable: z13.boolean(),
|
|
2421
|
+
provenance: z13.enum(["managed", "discovered", "main"]),
|
|
2252
2422
|
git: GitState.nullable()
|
|
2253
2423
|
});
|
|
2254
|
-
var CheckoutInfo =
|
|
2255
|
-
root:
|
|
2256
|
-
commonDir:
|
|
2257
|
-
repoIdentity:
|
|
2258
|
-
defaultBranch:
|
|
2424
|
+
var CheckoutInfo = z13.object({
|
|
2425
|
+
root: z13.string(),
|
|
2426
|
+
commonDir: z13.string(),
|
|
2427
|
+
repoIdentity: z13.string(),
|
|
2428
|
+
defaultBranch: z13.string()
|
|
2259
2429
|
});
|
|
2260
|
-
var ScannedRepository = CheckoutInfo.extend({ name:
|
|
2261
|
-
var ProjectFolderScan =
|
|
2430
|
+
var ScannedRepository = CheckoutInfo.extend({ name: z13.string() });
|
|
2431
|
+
var ProjectFolderScan = z13.object({
|
|
2262
2432
|
/** 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
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
});
|
|
2279
|
-
var
|
|
2280
|
-
base
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2433
|
+
folder: z13.string(),
|
|
2434
|
+
repositories: z13.array(ScannedRepository)
|
|
2435
|
+
});
|
|
2436
|
+
var ProjectSuggestion = z13.object({
|
|
2437
|
+
rootPath: z13.string(),
|
|
2438
|
+
sessionCount: z13.number().int(),
|
|
2439
|
+
lastActivityAt: z13.string()
|
|
2440
|
+
});
|
|
2441
|
+
var ProjectSuggestions = z13.object({ suggestions: z13.array(ProjectSuggestion) });
|
|
2442
|
+
var GitCommit = z13.object({
|
|
2443
|
+
sha: z13.string().regex(/^[0-9a-f]{40}$/),
|
|
2444
|
+
subject: z13.string().max(300),
|
|
2445
|
+
author: z13.string().max(200),
|
|
2446
|
+
authoredAt: z13.string(),
|
|
2447
|
+
pushed: z13.boolean()
|
|
2448
|
+
});
|
|
2449
|
+
var LogResult = z13.object({
|
|
2450
|
+
/** The base branch the commits are counted from. */
|
|
2451
|
+
base: z13.string(),
|
|
2452
|
+
/** `branch`: commits since the merge base; `recent`: HEAD's latest commits (no commits of its own). */
|
|
2453
|
+
scope: z13.enum(["branch", "recent"]),
|
|
2454
|
+
commits: z13.array(GitCommit).max(200),
|
|
2455
|
+
truncated: z13.boolean(),
|
|
2456
|
+
/** Changed and untracked files not committed yet. */
|
|
2457
|
+
uncommitted: z13.number().int().min(0)
|
|
2458
|
+
});
|
|
2459
|
+
var DiffFile = z13.object({
|
|
2460
|
+
path: z13.string(),
|
|
2461
|
+
oldPath: z13.string().nullable(),
|
|
2462
|
+
added: z13.number().int(),
|
|
2463
|
+
deleted: z13.number().int(),
|
|
2464
|
+
status: z13.enum(["added", "modified", "deleted", "renamed", "untracked", "binary"])
|
|
2465
|
+
});
|
|
2466
|
+
var DiffResult = z13.object({
|
|
2467
|
+
base: z13.string(),
|
|
2468
|
+
files: z13.array(DiffFile),
|
|
2469
|
+
patch: z13.string().nullable()
|
|
2470
|
+
});
|
|
2471
|
+
var FileEntry = z13.object({
|
|
2472
|
+
name: z13.string(),
|
|
2473
|
+
path: z13.string(),
|
|
2474
|
+
kind: z13.enum(["file", "dir", "symlink"]),
|
|
2475
|
+
size: z13.number().int().nullable()
|
|
2476
|
+
});
|
|
2477
|
+
var ReconcileResult = z13.union([
|
|
2478
|
+
z13.object({ known: z13.literal(false) }),
|
|
2479
|
+
z13.object({
|
|
2480
|
+
known: z13.literal(true),
|
|
2481
|
+
sessionId: z13.string().nullable(),
|
|
2482
|
+
state: z13.enum(["accepted", "workspace_ready", "started", "failed"]),
|
|
2296
2483
|
runtime: RuntimeState.nullable(),
|
|
2297
|
-
workspacePath:
|
|
2484
|
+
workspacePath: z13.string().nullable(),
|
|
2298
2485
|
nativeHandle: NativeHandle.nullable(),
|
|
2299
|
-
error:
|
|
2486
|
+
error: z13.string().nullable(),
|
|
2300
2487
|
/** `{started: "unknown"}` when the host restarted after Pi may have been spawned. */
|
|
2301
|
-
errorDetails:
|
|
2488
|
+
errorDetails: z13.record(z13.string(), z13.unknown()).nullable().default(null)
|
|
2302
2489
|
})
|
|
2303
2490
|
]);
|
|
2304
|
-
var DispatchStartResult =
|
|
2305
|
-
sessionId:
|
|
2306
|
-
workspacePath:
|
|
2491
|
+
var DispatchStartResult = z13.object({
|
|
2492
|
+
sessionId: z13.string(),
|
|
2493
|
+
workspacePath: z13.string(),
|
|
2307
2494
|
nativeHandle: NativeHandle.nullable(),
|
|
2308
|
-
reused:
|
|
2495
|
+
reused: z13.boolean(),
|
|
2309
2496
|
/** Why the launch prompt was not delivered to Pi (the session itself started), if it was not. */
|
|
2310
|
-
promptError:
|
|
2497
|
+
promptError: z13.string().nullable().optional()
|
|
2311
2498
|
});
|
|
2312
|
-
var AnswerResult =
|
|
2313
|
-
status:
|
|
2499
|
+
var AnswerResult = z13.object({
|
|
2500
|
+
status: z13.enum(["answered", "already_answered"]),
|
|
2314
2501
|
interaction: Interaction
|
|
2315
2502
|
});
|
|
2316
|
-
var SnapshotResult =
|
|
2317
|
-
partial:
|
|
2318
|
-
pendingInteractions:
|
|
2503
|
+
var SnapshotResult = z13.object({
|
|
2504
|
+
partial: z13.array(TranscriptItem),
|
|
2505
|
+
pendingInteractions: z13.array(Interaction)
|
|
2319
2506
|
});
|
|
2320
|
-
var ChecksResult =
|
|
2321
|
-
var Receipt =
|
|
2322
|
-
|
|
2323
|
-
|
|
2507
|
+
var ChecksResult = z13.object({ results: z13.array(CheckResult) });
|
|
2508
|
+
var Receipt = z13.union([
|
|
2509
|
+
z13.object({ commandId: z13.string(), ok: z13.literal(true), result: z13.unknown() }),
|
|
2510
|
+
z13.object({ commandId: z13.string(), ok: z13.literal(false), error: ErrorBody })
|
|
2324
2511
|
]);
|
|
2325
2512
|
var HostAgentRequestFrame = AgentRequestFrame.safeExtend({
|
|
2326
2513
|
policyContext: HostToolPolicyContext.optional()
|
|
@@ -2339,279 +2526,281 @@ var HostAgentRequestFrame = AgentRequestFrame.safeExtend({
|
|
|
2339
2526
|
}
|
|
2340
2527
|
ctx.addIssue({ code: "custom", message: "Host agent frame exceeds 128 KiB or is not JSON." });
|
|
2341
2528
|
});
|
|
2342
|
-
var HostToCoordinator =
|
|
2343
|
-
|
|
2344
|
-
type:
|
|
2345
|
-
hostId:
|
|
2346
|
-
credential:
|
|
2347
|
-
name:
|
|
2348
|
-
agentVersion:
|
|
2349
|
-
piVersion:
|
|
2350
|
-
piCompatible:
|
|
2529
|
+
var HostToCoordinator = z13.discriminatedUnion("type", [
|
|
2530
|
+
z13.object({
|
|
2531
|
+
type: z13.literal("hello"),
|
|
2532
|
+
hostId: z13.string(),
|
|
2533
|
+
credential: z13.string(),
|
|
2534
|
+
name: z13.string(),
|
|
2535
|
+
agentVersion: z13.string(),
|
|
2536
|
+
piVersion: z13.string().nullable(),
|
|
2537
|
+
piCompatible: z13.boolean(),
|
|
2351
2538
|
platform: Platform,
|
|
2352
2539
|
capabilities: RuntimeCapabilities.nullable(),
|
|
2353
2540
|
github: HostGitHub.optional(),
|
|
2354
|
-
protocolVersion:
|
|
2355
|
-
features:
|
|
2541
|
+
protocolVersion: z13.number().int(),
|
|
2542
|
+
features: z13.array(z13.string()).optional()
|
|
2356
2543
|
}),
|
|
2357
2544
|
HostAgentRequestFrame,
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2545
|
+
z13.object({ type: z13.literal("event"), hostSeq: z13.number().int(), event: HostEvent }),
|
|
2546
|
+
z13.object({ type: z13.literal("stream"), delta: StreamDelta }),
|
|
2547
|
+
z13.object({ type: z13.literal("receipt"), receipt: Receipt }),
|
|
2548
|
+
z13.object({ type: z13.literal("pong") }),
|
|
2549
|
+
z13.object({ type: z13.literal("usage"), usage: z13.array(ProviderUsage) }),
|
|
2550
|
+
z13.object({ type: z13.literal("term"), streamId: z13.string(), msg: TermServerToViewer })
|
|
2364
2551
|
]);
|
|
2365
|
-
var CoordinatorToHost =
|
|
2366
|
-
|
|
2367
|
-
type:
|
|
2368
|
-
coordinatorVersion:
|
|
2369
|
-
ackedHostSeq:
|
|
2370
|
-
features:
|
|
2552
|
+
var CoordinatorToHost = z13.discriminatedUnion("type", [
|
|
2553
|
+
z13.object({
|
|
2554
|
+
type: z13.literal("welcome"),
|
|
2555
|
+
coordinatorVersion: z13.string(),
|
|
2556
|
+
ackedHostSeq: z13.number().int(),
|
|
2557
|
+
features: z13.array(z13.string()).optional()
|
|
2371
2558
|
}),
|
|
2372
2559
|
AgentResultFrame,
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2560
|
+
z13.object({ type: z13.literal("ack"), hostSeq: z13.number().int() }),
|
|
2561
|
+
z13.object({ type: z13.literal("command"), commandId: z13.string(), command: HostCommand }),
|
|
2562
|
+
z13.object({ type: z13.literal("ping") }),
|
|
2563
|
+
z13.object({ type: z13.literal("reject"), error: ErrorBody }),
|
|
2564
|
+
z13.object({ type: z13.literal("term"), streamId: z13.string(), msg: TermCoordinatorMsg })
|
|
2378
2565
|
]);
|
|
2379
2566
|
|
|
2380
2567
|
// packages/protocol/dist/api.js
|
|
2381
|
-
var EnrollRequest =
|
|
2382
|
-
token:
|
|
2383
|
-
name:
|
|
2568
|
+
var EnrollRequest = z14.object({
|
|
2569
|
+
token: z14.string().min(1),
|
|
2570
|
+
name: z14.string().min(1).max(80),
|
|
2384
2571
|
kind: DeviceKind
|
|
2385
2572
|
});
|
|
2386
|
-
var EnrollResponse =
|
|
2387
|
-
var CreateEnrollmentRequest =
|
|
2388
|
-
var CreateEnrollmentResponse =
|
|
2389
|
-
token:
|
|
2390
|
-
url:
|
|
2391
|
-
expiresAt:
|
|
2392
|
-
qrSvg:
|
|
2393
|
-
command:
|
|
2573
|
+
var EnrollResponse = z14.object({ deviceId: z14.string(), credential: z14.string() });
|
|
2574
|
+
var CreateEnrollmentRequest = z14.object({ kind: z14.enum(["device", "host"]) });
|
|
2575
|
+
var CreateEnrollmentResponse = z14.object({
|
|
2576
|
+
token: z14.string(),
|
|
2577
|
+
url: z14.string(),
|
|
2578
|
+
expiresAt: z14.string(),
|
|
2579
|
+
qrSvg: z14.string(),
|
|
2580
|
+
command: z14.string().nullable()
|
|
2394
2581
|
});
|
|
2395
|
-
var HostEnrollRequest =
|
|
2396
|
-
|
|
2397
|
-
token:
|
|
2398
|
-
name:
|
|
2582
|
+
var HostEnrollRequest = z14.union([
|
|
2583
|
+
z14.object({
|
|
2584
|
+
token: z14.string().min(1),
|
|
2585
|
+
name: z14.string().min(1).max(80),
|
|
2399
2586
|
platform: Platform
|
|
2400
2587
|
}),
|
|
2401
|
-
|
|
2402
|
-
secret:
|
|
2403
|
-
name:
|
|
2588
|
+
z14.object({
|
|
2589
|
+
secret: z14.string().min(1),
|
|
2590
|
+
name: z14.string().min(1).max(80),
|
|
2404
2591
|
platform: Platform
|
|
2405
2592
|
})
|
|
2406
2593
|
]);
|
|
2407
|
-
var HostEnrollResponse =
|
|
2408
|
-
var CreateProjectRequest =
|
|
2409
|
-
name:
|
|
2410
|
-
hostId:
|
|
2411
|
-
path:
|
|
2412
|
-
defaultProfileId:
|
|
2413
|
-
setupCommand:
|
|
2414
|
-
checks:
|
|
2415
|
-
maxConcurrentRuns:
|
|
2416
|
-
worktreeDir: WorktreeDir.optional()
|
|
2417
|
-
});
|
|
2418
|
-
var UpdateProjectRequest = z13.object({
|
|
2419
|
-
name: z13.string().min(1).optional(),
|
|
2420
|
-
defaultProfileId: z13.string().nullable().optional(),
|
|
2421
|
-
defaultHostId: z13.string().nullable().optional(),
|
|
2422
|
-
maxConcurrentRuns: z13.number().int().min(1).max(32).optional(),
|
|
2423
|
-
automationEnabled: z13.boolean().optional(),
|
|
2424
|
-
setupCommand: z13.string().nullable().optional(),
|
|
2425
|
-
checks: z13.array(z13.string()).optional(),
|
|
2426
|
-
workspaceSharing: z13.enum(["single_writer", "shared"]).optional(),
|
|
2594
|
+
var HostEnrollResponse = z14.object({ hostId: z14.string(), credential: z14.string() });
|
|
2595
|
+
var CreateProjectRequest = z14.object({
|
|
2596
|
+
name: z14.string().min(1),
|
|
2597
|
+
hostId: z14.string(),
|
|
2598
|
+
path: z14.string().min(1),
|
|
2599
|
+
defaultProfileId: z14.string().nullable().optional(),
|
|
2600
|
+
setupCommand: z14.string().nullable().optional(),
|
|
2601
|
+
checks: z14.array(z14.string()).optional(),
|
|
2602
|
+
maxConcurrentRuns: z14.number().int().min(1).max(32).optional(),
|
|
2427
2603
|
worktreeDir: WorktreeDir.optional()
|
|
2428
2604
|
});
|
|
2429
|
-
var
|
|
2605
|
+
var UpdateProjectRequest = z14.object({
|
|
2606
|
+
name: z14.string().min(1).optional(),
|
|
2607
|
+
defaultProfileId: z14.string().nullable().optional(),
|
|
2608
|
+
defaultHostId: z14.string().nullable().optional(),
|
|
2609
|
+
maxConcurrentRuns: z14.number().int().min(1).max(32).optional(),
|
|
2610
|
+
automationEnabled: z14.boolean().optional(),
|
|
2611
|
+
setupCommand: z14.string().nullable().optional(),
|
|
2612
|
+
checks: z14.array(z14.string()).optional(),
|
|
2613
|
+
workspaceSharing: z14.enum(["single_writer", "shared"]).optional(),
|
|
2614
|
+
worktreeDir: WorktreeDir.optional(),
|
|
2615
|
+
ensureSessions: z14.boolean().optional(),
|
|
2616
|
+
removeLanded: z14.boolean().optional()
|
|
2617
|
+
});
|
|
2618
|
+
var AddCheckoutRequest = z14.object({ hostId: z14.string(), path: z14.string().min(1) });
|
|
2430
2619
|
function isProjectFolderPath(s) {
|
|
2431
2620
|
if (s.includes("\0"))
|
|
2432
2621
|
return false;
|
|
2433
2622
|
return s === "~" || s.startsWith("~/") || s.startsWith("/");
|
|
2434
2623
|
}
|
|
2435
|
-
var ProjectFolder =
|
|
2436
|
-
var UpdateHostRequest =
|
|
2437
|
-
projectFolders:
|
|
2624
|
+
var ProjectFolder = z14.string().trim().min(1).max(1024).refine(isProjectFolderPath, "must be an absolute path or start with ~/");
|
|
2625
|
+
var UpdateHostRequest = z14.object({
|
|
2626
|
+
projectFolders: z14.array(ProjectFolder).max(20).optional()
|
|
2438
2627
|
});
|
|
2439
2628
|
var ProjectScanResult = ProjectScan.extend({
|
|
2440
|
-
added:
|
|
2441
|
-
projectId:
|
|
2442
|
-
name:
|
|
2443
|
-
path:
|
|
2444
|
-
newProject:
|
|
2629
|
+
added: z14.array(z14.object({
|
|
2630
|
+
projectId: z14.string(),
|
|
2631
|
+
name: z14.string(),
|
|
2632
|
+
path: z14.string(),
|
|
2633
|
+
newProject: z14.boolean()
|
|
2445
2634
|
}))
|
|
2446
2635
|
});
|
|
2447
|
-
var ProfileInput =
|
|
2448
|
-
name:
|
|
2449
|
-
provider:
|
|
2450
|
-
model:
|
|
2636
|
+
var ProfileInput = z14.object({
|
|
2637
|
+
name: z14.string().min(1),
|
|
2638
|
+
provider: z14.string().nullable().default(null),
|
|
2639
|
+
model: z14.string().nullable().default(null),
|
|
2451
2640
|
thinking: ThinkingLevel.nullable().default(null),
|
|
2452
|
-
projectTrust:
|
|
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:
|
|
2641
|
+
projectTrust: z14.enum(["ask", "approve", "ignore"]).default("ask"),
|
|
2642
|
+
extraArgs: z14.array(ExtraArg).default([]),
|
|
2643
|
+
resources: z14.enum(["all", "vanilla"]).default("all")
|
|
2644
|
+
});
|
|
2645
|
+
var CreateWorkspaceRequest = z14.object({
|
|
2646
|
+
checkoutId: z14.string(),
|
|
2647
|
+
branch: z14.string().min(1),
|
|
2648
|
+
base: z14.string().nullable().optional()
|
|
2649
|
+
});
|
|
2650
|
+
var RemoveWorkspaceRequest = z14.object({
|
|
2651
|
+
force: z14.object({ dirty: z14.boolean(), unmerged: z14.boolean() }).default({ dirty: false, unmerged: false })
|
|
2652
|
+
});
|
|
2653
|
+
var CreateSessionRequest = z14.object({
|
|
2654
|
+
projectId: z14.string(),
|
|
2655
|
+
workspace: z14.union([
|
|
2656
|
+
z14.object({ existingId: z14.string() }),
|
|
2657
|
+
z14.object({
|
|
2658
|
+
checkoutId: z14.string(),
|
|
2659
|
+
newBranch: z14.string().min(1),
|
|
2660
|
+
base: z14.string().nullable().optional()
|
|
2472
2661
|
})
|
|
2473
2662
|
]),
|
|
2474
|
-
profileId:
|
|
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 =
|
|
2663
|
+
profileId: z14.string().nullable().optional(),
|
|
2664
|
+
prompt: z14.string().default(""),
|
|
2665
|
+
title: z14.string().optional(),
|
|
2666
|
+
viewId: z14.string().optional()
|
|
2667
|
+
});
|
|
2668
|
+
var PromptRequest = z14.object({
|
|
2669
|
+
text: z14.string().min(1),
|
|
2670
|
+
mode: z14.enum(["prompt", "steer", "followUp"]).default("prompt"),
|
|
2671
|
+
images: z14.array(z14.object({ mimeType: z14.string(), data: z14.string() })).default([]),
|
|
2672
|
+
clientMessageId: z14.string().optional()
|
|
2673
|
+
});
|
|
2674
|
+
var CacheAlertRequest = z14.object({
|
|
2675
|
+
enabled: z14.boolean(),
|
|
2676
|
+
ttlSec: z14.number().int().min(60).max(86400).nullable().default(null)
|
|
2677
|
+
});
|
|
2678
|
+
var RenameRequest = z14.object({ title: z14.string().min(1).max(200) });
|
|
2679
|
+
var SetModelRequest = z14.object({
|
|
2680
|
+
provider: z14.string().min(1),
|
|
2681
|
+
modelId: z14.string().min(1)
|
|
2682
|
+
});
|
|
2683
|
+
var SetThinkingRequest = z14.object({ level: ThinkingLevel });
|
|
2684
|
+
var CompactRequest = z14.object({ instructions: z14.string().max(4e3).optional() });
|
|
2685
|
+
var SessionModelsResult = z14.object({ models: z14.array(SessionModel) });
|
|
2686
|
+
var SessionCommandsResult = z14.object({ commands: z14.array(SlashCommand) });
|
|
2687
|
+
var CompleteRequest = z14.object({ text: z14.string().min(1).max(500) });
|
|
2688
|
+
var CompletionItem = z14.object({
|
|
2689
|
+
value: z14.string(),
|
|
2690
|
+
label: z14.string(),
|
|
2691
|
+
description: z14.string().nullable()
|
|
2692
|
+
});
|
|
2693
|
+
var SessionCompleteResult = z14.object({
|
|
2694
|
+
items: z14.array(CompletionItem).max(50),
|
|
2695
|
+
prefix: z14.string()
|
|
2696
|
+
});
|
|
2697
|
+
var TreeRow = z14.object({
|
|
2698
|
+
entryId: z14.string(),
|
|
2699
|
+
parentId: z14.string().nullable(),
|
|
2700
|
+
depth: z14.number().int(),
|
|
2701
|
+
role: z14.enum(["user", "assistant"]),
|
|
2702
|
+
text: z14.string(),
|
|
2703
|
+
activeBranch: z14.boolean(),
|
|
2704
|
+
leaf: z14.boolean(),
|
|
2705
|
+
label: z14.string().nullable(),
|
|
2706
|
+
at: z14.string().nullable()
|
|
2707
|
+
});
|
|
2708
|
+
var SessionTreeResult = z14.object({ rows: z14.array(TreeRow) });
|
|
2709
|
+
var BranchRequest = z14.object({
|
|
2710
|
+
entryId: z14.string().nullable(),
|
|
2711
|
+
fork: z14.boolean().default(false)
|
|
2712
|
+
});
|
|
2713
|
+
var HostBranchResult = z14.object({
|
|
2714
|
+
sessionFile: z14.string().nullable(),
|
|
2715
|
+
prefill: z14.string().nullable()
|
|
2716
|
+
});
|
|
2717
|
+
var TranscriptPage = z14.object({
|
|
2718
|
+
items: z14.array(TranscriptItem),
|
|
2719
|
+
hasMore: z14.boolean(),
|
|
2720
|
+
epoch: z14.number().int().optional(),
|
|
2721
|
+
rev: z14.number().int().optional(),
|
|
2722
|
+
delta: z14.boolean().optional(),
|
|
2723
|
+
reset: z14.boolean().optional()
|
|
2724
|
+
});
|
|
2725
|
+
var NavigateRequest = z14.object({
|
|
2726
|
+
entryId: z14.string().min(1),
|
|
2727
|
+
summarize: z14.boolean().default(false),
|
|
2728
|
+
instructions: z14.string().max(2e3).nullable().default(null)
|
|
2729
|
+
});
|
|
2730
|
+
var HostNavigateResult = z14.object({
|
|
2731
|
+
items: z14.array(TranscriptItem),
|
|
2732
|
+
prefill: z14.string().nullable()
|
|
2733
|
+
});
|
|
2734
|
+
var NavigateResult = z14.object({
|
|
2735
|
+
prefill: z14.string().nullable(),
|
|
2736
|
+
epoch: z14.number().int()
|
|
2737
|
+
});
|
|
2738
|
+
var BranchResult = z14.object({
|
|
2550
2739
|
session: Session.nullable(),
|
|
2551
|
-
prefill:
|
|
2740
|
+
prefill: z14.string().nullable()
|
|
2552
2741
|
});
|
|
2553
|
-
var SessionExportResult =
|
|
2554
|
-
var CommandViewAction =
|
|
2555
|
-
label:
|
|
2556
|
-
command:
|
|
2557
|
-
tone:
|
|
2742
|
+
var SessionExportResult = z14.object({ fileName: z14.string(), content: z14.string() });
|
|
2743
|
+
var CommandViewAction = z14.object({
|
|
2744
|
+
label: z14.string().min(1).max(80),
|
|
2745
|
+
command: z14.string().startsWith("/").max(500),
|
|
2746
|
+
tone: z14.enum(["default", "primary", "danger"]).optional()
|
|
2558
2747
|
});
|
|
2559
|
-
var CommandView =
|
|
2560
|
-
title:
|
|
2748
|
+
var CommandView = z14.object({
|
|
2749
|
+
title: z14.string().min(1).max(200),
|
|
2561
2750
|
body: UINodeSchema,
|
|
2562
|
-
actions:
|
|
2751
|
+
actions: z14.array(CommandViewAction).max(30).default([])
|
|
2563
2752
|
});
|
|
2564
|
-
var ModelStateResult =
|
|
2753
|
+
var ModelStateResult = z14.object({
|
|
2565
2754
|
model: SessionModel.nullable(),
|
|
2566
2755
|
thinking: ThinkingLevel.nullable()
|
|
2567
2756
|
});
|
|
2568
|
-
var ImportSessionRequest =
|
|
2569
|
-
hostId:
|
|
2570
|
-
sessionFile:
|
|
2571
|
-
projectId:
|
|
2757
|
+
var ImportSessionRequest = z14.object({
|
|
2758
|
+
hostId: z14.string(),
|
|
2759
|
+
sessionFile: z14.string(),
|
|
2760
|
+
projectId: z14.string().nullable().optional()
|
|
2572
2761
|
});
|
|
2573
|
-
var AnswerRequest =
|
|
2574
|
-
revision:
|
|
2762
|
+
var AnswerRequest = z14.object({
|
|
2763
|
+
revision: z14.number().int(),
|
|
2575
2764
|
response: InteractionResponseSchema
|
|
2576
2765
|
});
|
|
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:
|
|
2766
|
+
var AdapterActionRequest = z14.object({
|
|
2767
|
+
generation: z14.string().uuid().optional(),
|
|
2768
|
+
adapterId: z14.string(),
|
|
2769
|
+
actionId: z14.string(),
|
|
2770
|
+
payload: z14.unknown().optional()
|
|
2771
|
+
});
|
|
2772
|
+
var TaskPolicyPatch = z14.object({
|
|
2773
|
+
hostId: z14.string().nullable().optional(),
|
|
2774
|
+
profileId: z14.string().nullable().optional(),
|
|
2775
|
+
workspace: z14.object({
|
|
2776
|
+
mode: z14.enum(["new_worktree", "existing"]).optional(),
|
|
2777
|
+
branch: z14.string().nullable().optional(),
|
|
2778
|
+
base: z14.string().nullable().optional(),
|
|
2779
|
+
workspaceId: z14.string().optional()
|
|
2591
2780
|
}).optional(),
|
|
2592
|
-
continuation:
|
|
2593
|
-
enabled:
|
|
2594
|
-
objective:
|
|
2595
|
-
maxContinuations:
|
|
2596
|
-
maxElapsedMinutes:
|
|
2597
|
-
maxTokens:
|
|
2598
|
-
maxCostUsd:
|
|
2781
|
+
continuation: z14.object({
|
|
2782
|
+
enabled: z14.boolean().optional(),
|
|
2783
|
+
objective: z14.string().min(1).optional(),
|
|
2784
|
+
maxContinuations: z14.number().int().min(1).max(50).optional(),
|
|
2785
|
+
maxElapsedMinutes: z14.number().int().min(1).max(1440).optional(),
|
|
2786
|
+
maxTokens: z14.number().int().positive().nullable().optional(),
|
|
2787
|
+
maxCostUsd: z14.number().positive().nullable().optional()
|
|
2599
2788
|
}).optional(),
|
|
2600
2789
|
completion: CompletionPolicy.partial().optional()
|
|
2601
2790
|
});
|
|
2602
|
-
var CreateTaskRequest =
|
|
2603
|
-
projectId:
|
|
2604
|
-
title:
|
|
2791
|
+
var CreateTaskRequest = z14.object({
|
|
2792
|
+
projectId: z14.string(),
|
|
2793
|
+
title: z14.string().max(300).optional(),
|
|
2605
2794
|
githubIssueUrl: GitHubIssueUrl.optional(),
|
|
2606
|
-
githubIssue:
|
|
2607
|
-
launchPrompt:
|
|
2608
|
-
objective:
|
|
2609
|
-
acceptanceCriteria:
|
|
2610
|
-
dependencies:
|
|
2611
|
-
parentTaskId:
|
|
2795
|
+
githubIssue: z14.never().optional(),
|
|
2796
|
+
launchPrompt: z14.never().optional(),
|
|
2797
|
+
objective: z14.string().default(""),
|
|
2798
|
+
acceptanceCriteria: z14.array(z14.string()).default([]),
|
|
2799
|
+
dependencies: z14.array(z14.string()).default([]),
|
|
2800
|
+
parentTaskId: z14.string().nullable().optional(),
|
|
2612
2801
|
priority: Priority.default(2),
|
|
2613
|
-
state:
|
|
2614
|
-
notBefore:
|
|
2802
|
+
state: z14.enum(["backlog", "ready"]).default("backlog"),
|
|
2803
|
+
notBefore: z14.string().nullable().optional(),
|
|
2615
2804
|
policy: TaskPolicyPatch.optional()
|
|
2616
2805
|
}).superRefine((v, ctx) => {
|
|
2617
2806
|
if (v.githubIssueUrl === void 0) {
|
|
@@ -2649,32 +2838,33 @@ var CreateTaskRequest = z13.object({
|
|
|
2649
2838
|
const issue = githubIssueFromUrl(v.githubIssueUrl);
|
|
2650
2839
|
return { ...v, title: v.title?.trim() || `${issue.repository} #${issue.number}` };
|
|
2651
2840
|
});
|
|
2652
|
-
var UpdateTaskRequest =
|
|
2653
|
-
githubIssueUrl:
|
|
2654
|
-
githubIssue:
|
|
2655
|
-
launchPrompt:
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2841
|
+
var UpdateTaskRequest = z14.object({
|
|
2842
|
+
githubIssueUrl: z14.never().optional(),
|
|
2843
|
+
githubIssue: z14.never().optional(),
|
|
2844
|
+
launchPrompt: z14.never().optional(),
|
|
2845
|
+
tracker: z14.never().optional(),
|
|
2846
|
+
title: z14.string().min(1).max(300).optional(),
|
|
2847
|
+
objective: z14.string().optional(),
|
|
2848
|
+
acceptanceCriteria: z14.array(z14.string()).optional(),
|
|
2849
|
+
dependencies: z14.array(z14.string()).optional(),
|
|
2850
|
+
parentTaskId: z14.string().nullable().optional(),
|
|
2661
2851
|
priority: Priority.optional(),
|
|
2662
|
-
position:
|
|
2663
|
-
notBefore:
|
|
2852
|
+
position: z14.number().optional(),
|
|
2853
|
+
notBefore: z14.string().nullable().optional(),
|
|
2664
2854
|
policy: TaskPolicyPatch.optional()
|
|
2665
2855
|
});
|
|
2666
|
-
var MoveTaskRequest =
|
|
2856
|
+
var MoveTaskRequest = z14.object({
|
|
2667
2857
|
to: TaskState,
|
|
2668
|
-
confirm:
|
|
2669
|
-
onRunning:
|
|
2670
|
-
position:
|
|
2858
|
+
confirm: z14.boolean().optional(),
|
|
2859
|
+
onRunning: z14.enum(["pause", "stop"]).optional(),
|
|
2860
|
+
position: z14.number().optional()
|
|
2671
2861
|
});
|
|
2672
|
-
var RequestChangesRequest =
|
|
2673
|
-
var Eligibility =
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
eligible:
|
|
2677
|
-
wait:
|
|
2862
|
+
var RequestChangesRequest = z14.object({ feedback: z14.array(z14.string().min(1)).min(1) });
|
|
2863
|
+
var Eligibility = z14.union([
|
|
2864
|
+
z14.object({ eligible: z14.literal(true), hostId: z14.string(), hostName: z14.string() }),
|
|
2865
|
+
z14.object({
|
|
2866
|
+
eligible: z14.literal(false),
|
|
2867
|
+
wait: z14.enum([
|
|
2678
2868
|
"dependency",
|
|
2679
2869
|
"host_offline",
|
|
2680
2870
|
"project_limit",
|
|
@@ -2687,151 +2877,152 @@ var Eligibility = z13.union([
|
|
|
2687
2877
|
"already_dispatched",
|
|
2688
2878
|
"retry_backoff"
|
|
2689
2879
|
]),
|
|
2690
|
-
message:
|
|
2880
|
+
message: z14.string()
|
|
2691
2881
|
})
|
|
2692
2882
|
]);
|
|
2693
|
-
var NowResponse =
|
|
2694
|
-
running:
|
|
2695
|
-
queued:
|
|
2696
|
-
dispatchPaused:
|
|
2697
|
-
});
|
|
2698
|
-
var AutomationInput =
|
|
2699
|
-
name:
|
|
2700
|
-
enabled:
|
|
2701
|
-
projectId:
|
|
2883
|
+
var NowResponse = z14.object({
|
|
2884
|
+
running: z14.array(z14.object({ taskId: z14.string(), runId: z14.string(), sessionId: z14.string().nullable() })),
|
|
2885
|
+
queued: z14.array(z14.object({ taskId: z14.string(), eligibility: Eligibility })),
|
|
2886
|
+
dispatchPaused: z14.boolean()
|
|
2887
|
+
});
|
|
2888
|
+
var AutomationInput = z14.object({
|
|
2889
|
+
name: z14.string().min(1),
|
|
2890
|
+
enabled: z14.boolean().default(true),
|
|
2891
|
+
projectId: z14.string(),
|
|
2702
2892
|
trigger: Trigger,
|
|
2703
|
-
filters:
|
|
2893
|
+
filters: z14.array(z14.object({ path: z14.string(), equals: z14.string() })).default([]),
|
|
2704
2894
|
template: TaskTemplate,
|
|
2705
|
-
hostId:
|
|
2706
|
-
profileId:
|
|
2707
|
-
mode:
|
|
2708
|
-
groupingKey:
|
|
2709
|
-
overlap:
|
|
2710
|
-
missed:
|
|
2895
|
+
hostId: z14.string().nullable().default(null),
|
|
2896
|
+
profileId: z14.string().nullable().default(null),
|
|
2897
|
+
mode: z14.enum(["fresh", "continue", "watch"]).default("fresh"),
|
|
2898
|
+
groupingKey: z14.string().nullable().default(null),
|
|
2899
|
+
overlap: z14.enum(["skip", "queue_one", "append"]).default("skip"),
|
|
2900
|
+
missed: z14.enum(["skip", "run_once"]).default("skip"),
|
|
2711
2901
|
continuation: ContinuationPolicy.default({ enabled: false }),
|
|
2712
2902
|
completion: CompletionPolicy.default({ checks: null, requireHumanReview: true })
|
|
2713
2903
|
});
|
|
2714
|
-
var AutomationView = Automation.extend({ summary:
|
|
2715
|
-
var AutomationPreview =
|
|
2716
|
-
summary:
|
|
2904
|
+
var AutomationView = Automation.extend({ summary: z14.string() });
|
|
2905
|
+
var AutomationPreview = z14.object({
|
|
2906
|
+
summary: z14.string(),
|
|
2717
2907
|
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:
|
|
2908
|
+
next: z14.array(z14.string())
|
|
2909
|
+
});
|
|
2910
|
+
var WebhookTokenResponse = z14.object({ token: z14.string(), url: z14.string() });
|
|
2911
|
+
var PushSubscriptionRequest = z14.object({
|
|
2912
|
+
endpoint: z14.string().url(),
|
|
2913
|
+
keys: z14.object({ p256dh: z14.string(), auth: z14.string() }),
|
|
2914
|
+
permission: z14.enum(["granted", "denied", "default", "unknown"]).default("granted")
|
|
2915
|
+
});
|
|
2916
|
+
var NotificationSettings = z14.object({
|
|
2917
|
+
quietHours: z14.object({
|
|
2918
|
+
start: z14.string().regex(/^\d{2}:\d{2}$/),
|
|
2919
|
+
end: z14.string().regex(/^\d{2}:\d{2}$/),
|
|
2920
|
+
timezone: z14.string()
|
|
2731
2921
|
}).nullable(),
|
|
2732
|
-
privatePreviews:
|
|
2733
|
-
preferredDeviceId:
|
|
2922
|
+
privatePreviews: z14.boolean(),
|
|
2923
|
+
preferredDeviceId: z14.string().nullable()
|
|
2734
2924
|
});
|
|
2735
|
-
var PushPayload =
|
|
2736
|
-
|
|
2737
|
-
type:
|
|
2738
|
-
title:
|
|
2739
|
-
body:
|
|
2740
|
-
tag:
|
|
2741
|
-
url:
|
|
2742
|
-
renotify:
|
|
2925
|
+
var PushPayload = z14.union([
|
|
2926
|
+
z14.object({
|
|
2927
|
+
type: z14.literal("show"),
|
|
2928
|
+
title: z14.string(),
|
|
2929
|
+
body: z14.string(),
|
|
2930
|
+
tag: z14.string(),
|
|
2931
|
+
url: z14.string(),
|
|
2932
|
+
renotify: z14.boolean()
|
|
2743
2933
|
}),
|
|
2744
|
-
|
|
2934
|
+
z14.object({ type: z14.literal("clear"), tag: z14.string() })
|
|
2745
2935
|
]);
|
|
2746
|
-
var SetupState =
|
|
2747
|
-
passkey:
|
|
2748
|
-
available:
|
|
2749
|
-
registered:
|
|
2750
|
-
reason:
|
|
2936
|
+
var SetupState = z14.object({
|
|
2937
|
+
passkey: z14.object({
|
|
2938
|
+
available: z14.boolean(),
|
|
2939
|
+
registered: z14.boolean(),
|
|
2940
|
+
reason: z14.string().nullable()
|
|
2751
2941
|
}),
|
|
2752
|
-
oidc:
|
|
2942
|
+
oidc: z14.object({ label: z14.string() }).nullable()
|
|
2753
2943
|
});
|
|
2754
|
-
var PasskeyRegisterOptionsResponse =
|
|
2755
|
-
challengeId:
|
|
2756
|
-
options:
|
|
2944
|
+
var PasskeyRegisterOptionsResponse = z14.object({
|
|
2945
|
+
challengeId: z14.string(),
|
|
2946
|
+
options: z14.unknown()
|
|
2757
2947
|
});
|
|
2758
|
-
var PasskeyRegisterVerifyRequest =
|
|
2759
|
-
challengeId:
|
|
2760
|
-
name:
|
|
2761
|
-
response:
|
|
2948
|
+
var PasskeyRegisterVerifyRequest = z14.object({
|
|
2949
|
+
challengeId: z14.string(),
|
|
2950
|
+
name: z14.string().min(1).max(80),
|
|
2951
|
+
response: z14.unknown()
|
|
2762
2952
|
});
|
|
2763
|
-
var PasskeySignInOptionsResponse =
|
|
2764
|
-
challengeId:
|
|
2765
|
-
options:
|
|
2953
|
+
var PasskeySignInOptionsResponse = z14.object({
|
|
2954
|
+
challengeId: z14.string(),
|
|
2955
|
+
options: z14.unknown()
|
|
2766
2956
|
});
|
|
2767
|
-
var PasskeySignInVerifyRequest =
|
|
2768
|
-
challengeId:
|
|
2769
|
-
response:
|
|
2770
|
-
deviceName:
|
|
2957
|
+
var PasskeySignInVerifyRequest = z14.object({
|
|
2958
|
+
challengeId: z14.string(),
|
|
2959
|
+
response: z14.unknown(),
|
|
2960
|
+
deviceName: z14.string().min(1).max(80),
|
|
2771
2961
|
kind: DeviceKind.extract(["browser", "pwa"])
|
|
2772
2962
|
});
|
|
2773
|
-
var OidcBeginRequest =
|
|
2774
|
-
deviceName:
|
|
2963
|
+
var OidcBeginRequest = z14.object({
|
|
2964
|
+
deviceName: z14.string().min(1).max(80),
|
|
2775
2965
|
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
|
-
|
|
2966
|
+
next: z14.string().default("/"),
|
|
2967
|
+
handoff: z14.boolean().default(false)
|
|
2968
|
+
});
|
|
2969
|
+
var OidcBeginResponse = z14.object({
|
|
2970
|
+
authorizeUrl: z14.string(),
|
|
2971
|
+
flowId: z14.string().nullable(),
|
|
2972
|
+
pollToken: z14.string().nullable()
|
|
2973
|
+
});
|
|
2974
|
+
var OidcClaimRequest = z14.object({ flowId: z14.string(), pollToken: z14.string() });
|
|
2975
|
+
var OidcClaimResponse = z14.union([
|
|
2976
|
+
z14.object({ status: z14.literal("pending") }),
|
|
2977
|
+
z14.object({ status: z14.literal("done"), deviceId: z14.string() })
|
|
2788
2978
|
]);
|
|
2789
|
-
var TerminalLoginStartRequest =
|
|
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
|
-
|
|
2979
|
+
var TerminalLoginStartRequest = z14.object({ name: z14.string().min(1).max(80) });
|
|
2980
|
+
var TerminalLoginStartResponse = z14.object({
|
|
2981
|
+
userCode: z14.string(),
|
|
2982
|
+
pollToken: z14.string(),
|
|
2983
|
+
verifyUrl: z14.string(),
|
|
2984
|
+
expiresAt: z14.string(),
|
|
2985
|
+
intervalMs: z14.number().int()
|
|
2986
|
+
});
|
|
2987
|
+
var TerminalLoginClaimRequest = z14.object({
|
|
2988
|
+
userCode: z14.string().min(1),
|
|
2989
|
+
pollToken: z14.string().min(1)
|
|
2990
|
+
});
|
|
2991
|
+
var TerminalLoginClaimResponse = z14.union([
|
|
2992
|
+
z14.object({ status: z14.literal("pending") }),
|
|
2993
|
+
z14.object({ status: z14.literal("denied") }),
|
|
2994
|
+
z14.object({ status: z14.literal("done"), deviceId: z14.string(), credential: z14.string() })
|
|
2805
2995
|
]);
|
|
2806
|
-
var TerminalLoginRequest =
|
|
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:
|
|
2996
|
+
var TerminalLoginRequest = z14.object({
|
|
2997
|
+
userCode: z14.string(),
|
|
2998
|
+
name: z14.string(),
|
|
2999
|
+
requestedFrom: z14.string(),
|
|
3000
|
+
createdAt: z14.string(),
|
|
3001
|
+
expiresAt: z14.string(),
|
|
3002
|
+
status: z14.enum(["pending", "approved", "denied"])
|
|
3003
|
+
});
|
|
3004
|
+
var AuthMethods = z14.object({
|
|
3005
|
+
passkeys: z14.array(Passkey),
|
|
3006
|
+
passkeyAvailability: z14.object({ available: z14.boolean(), reason: z14.string().nullable() }),
|
|
3007
|
+
oidc: z14.object({
|
|
3008
|
+
issuer: z14.string(),
|
|
3009
|
+
label: z14.string(),
|
|
3010
|
+
ownerMatch: z14.string(),
|
|
3011
|
+
status: z14.enum(["ready", "error"]),
|
|
3012
|
+
error: z14.string().nullable()
|
|
2823
3013
|
}).nullable()
|
|
2824
3014
|
});
|
|
2825
|
-
var MeResponse =
|
|
3015
|
+
var MeResponse = z14.object({
|
|
2826
3016
|
device: Device,
|
|
2827
|
-
admin:
|
|
2828
|
-
publicUrl:
|
|
3017
|
+
admin: z14.boolean(),
|
|
3018
|
+
publicUrl: z14.string()
|
|
2829
3019
|
});
|
|
2830
3020
|
var ViewInput = View.pick({
|
|
2831
3021
|
name: true,
|
|
2832
3022
|
mode: true,
|
|
2833
3023
|
projectIds: true,
|
|
2834
|
-
hostIds: true
|
|
3024
|
+
hostIds: true,
|
|
3025
|
+
clientId: true
|
|
2835
3026
|
}).partial({
|
|
2836
3027
|
mode: true,
|
|
2837
3028
|
projectIds: true,
|
|
@@ -2839,8 +3030,8 @@ var ViewInput = View.pick({
|
|
|
2839
3030
|
});
|
|
2840
3031
|
var ViewPatch = ViewInput.partial();
|
|
2841
3032
|
var ViewClientReport = ViewClient.omit({ lastSeenAt: true });
|
|
2842
|
-
var ProjectSuggestionsResponse =
|
|
2843
|
-
suggestions:
|
|
3033
|
+
var ProjectSuggestionsResponse = z14.object({
|
|
3034
|
+
suggestions: z14.array(ProjectSuggestion.extend({ name: z14.string(), preselected: z14.boolean() }))
|
|
2844
3035
|
});
|
|
2845
3036
|
|
|
2846
3037
|
// packages/protocol/dist/backoff.js
|
|
@@ -2851,60 +3042,60 @@ function reconnectDelay(attempt, steps = RECONNECT_BACKOFF_MS, random = Math.ran
|
|
|
2851
3042
|
}
|
|
2852
3043
|
|
|
2853
3044
|
// packages/protocol/dist/client-wire.js
|
|
2854
|
-
import { z as
|
|
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:
|
|
3045
|
+
import { z as z15 } from "zod";
|
|
3046
|
+
var SyncState = z15.object({
|
|
3047
|
+
hosts: z15.array(Host),
|
|
3048
|
+
projects: z15.array(Project),
|
|
3049
|
+
checkouts: z15.array(Checkout),
|
|
3050
|
+
workspaces: z15.array(Workspace),
|
|
3051
|
+
profiles: z15.array(Profile),
|
|
3052
|
+
views: z15.array(View),
|
|
3053
|
+
sessions: z15.array(Session),
|
|
3054
|
+
tasks: z15.array(Task),
|
|
3055
|
+
runs: z15.array(Run),
|
|
3056
|
+
automations: z15.array(Automation),
|
|
3057
|
+
attention: z15.array(AttentionItem),
|
|
3058
|
+
interactions: z15.array(Interaction),
|
|
3059
|
+
panels: z15.array(Panel),
|
|
3060
|
+
devices: z15.array(Device),
|
|
3061
|
+
adapters: z15.record(z15.string(), z15.array(AdapterInfo)),
|
|
3062
|
+
dispatchPaused: z15.boolean()
|
|
3063
|
+
});
|
|
3064
|
+
var Presence = z15.object({
|
|
3065
|
+
foreground: z15.boolean(),
|
|
3066
|
+
interactedAt: z15.string().nullable(),
|
|
3067
|
+
viewing: z15.object({ sessionId: z15.string() }).nullable()
|
|
2877
3068
|
});
|
|
2878
3069
|
var CLIENT_CAPABILITIES = ["adapter.slots.v1", "timeline.cards.v1"];
|
|
2879
|
-
var ClientToServer =
|
|
2880
|
-
|
|
2881
|
-
type:
|
|
2882
|
-
cursor:
|
|
2883
|
-
capabilities:
|
|
2884
|
-
projectionId:
|
|
3070
|
+
var ClientToServer = z15.discriminatedUnion("type", [
|
|
3071
|
+
z15.object({
|
|
3072
|
+
type: z15.literal("hello"),
|
|
3073
|
+
cursor: z15.number().int().nullable(),
|
|
3074
|
+
capabilities: z15.array(z15.string().min(1).max(80)).max(32).optional(),
|
|
3075
|
+
projectionId: z15.string().max(256).nullable().optional()
|
|
2885
3076
|
}),
|
|
2886
|
-
|
|
2887
|
-
|
|
3077
|
+
z15.object({ type: z15.literal("presence"), presence: Presence }),
|
|
3078
|
+
z15.object({ type: z15.literal("ping") })
|
|
2888
3079
|
]);
|
|
2889
|
-
var ServerToClient =
|
|
2890
|
-
|
|
2891
|
-
type:
|
|
2892
|
-
seq:
|
|
2893
|
-
events:
|
|
2894
|
-
capabilities:
|
|
2895
|
-
projectionId:
|
|
3080
|
+
var ServerToClient = z15.discriminatedUnion("type", [
|
|
3081
|
+
z15.object({
|
|
3082
|
+
type: z15.literal("replay"),
|
|
3083
|
+
seq: z15.number().int(),
|
|
3084
|
+
events: z15.array(EventEnvelope),
|
|
3085
|
+
capabilities: z15.array(z15.enum(CLIENT_CAPABILITIES)).optional(),
|
|
3086
|
+
projectionId: z15.string().optional()
|
|
2896
3087
|
}),
|
|
2897
|
-
|
|
2898
|
-
type:
|
|
2899
|
-
seq:
|
|
3088
|
+
z15.object({
|
|
3089
|
+
type: z15.literal("snapshot"),
|
|
3090
|
+
seq: z15.number().int(),
|
|
2900
3091
|
state: SyncState,
|
|
2901
|
-
capabilities:
|
|
2902
|
-
projectionId:
|
|
3092
|
+
capabilities: z15.array(z15.enum(CLIENT_CAPABILITIES)).optional(),
|
|
3093
|
+
projectionId: z15.string().optional()
|
|
2903
3094
|
}),
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
3095
|
+
z15.object({ type: z15.literal("event"), event: EventEnvelope }),
|
|
3096
|
+
z15.object({ type: z15.literal("stream"), delta: StreamDelta }),
|
|
3097
|
+
z15.object({ type: z15.literal("pong") }),
|
|
3098
|
+
z15.object({ type: z15.literal("force_logout"), reason: z15.string() })
|
|
2908
3099
|
]);
|
|
2909
3100
|
|
|
2910
3101
|
// node_modules/.pnpm/ulid@3.0.2/node_modules/ulid/dist/node/index.js
|
|
@@ -3044,17 +3235,17 @@ var ulid = monotonicFactory();
|
|
|
3044
3235
|
var CLIENT_OPEN_MS = 10 * 6e4;
|
|
3045
3236
|
|
|
3046
3237
|
// packages/protocol/dist/web-bridge.js
|
|
3047
|
-
import { z as
|
|
3238
|
+
import { z as z16 } from "zod";
|
|
3048
3239
|
var FRAME_MAX_HEIGHT = 4e3;
|
|
3049
|
-
var FrameToParentMessageSchema =
|
|
3050
|
-
|
|
3051
|
-
type:
|
|
3052
|
-
actionId:
|
|
3053
|
-
payload:
|
|
3240
|
+
var FrameToParentMessageSchema = z16.discriminatedUnion("type", [
|
|
3241
|
+
z16.object({
|
|
3242
|
+
type: z16.literal("action"),
|
|
3243
|
+
actionId: z16.string().min(1).max(200),
|
|
3244
|
+
payload: z16.unknown().optional()
|
|
3054
3245
|
}),
|
|
3055
|
-
|
|
3056
|
-
type:
|
|
3057
|
-
height:
|
|
3246
|
+
z16.object({
|
|
3247
|
+
type: z16.literal("resize"),
|
|
3248
|
+
height: z16.number().finite().min(0).max(FRAME_MAX_HEIGHT)
|
|
3058
3249
|
})
|
|
3059
3250
|
]);
|
|
3060
3251
|
|