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