@spencerboucher/switchyard 0.20.0 → 0.22.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 +20 -16
- package/dist/policies/worker.js +1866 -1777
- package/dist/switchyard.mjs +5526 -4684
- package/package.json +1 -1
- package/web-dist/assets/AutomationView-DwZ_2m9J.js +2 -0
- package/web-dist/assets/AutomationView-DwZ_2m9J.js.map +1 -0
- package/web-dist/assets/Checkbox-DR78wXsg.js +2 -0
- package/web-dist/assets/{Checkbox-BnRsg6ki.js.map → Checkbox-DR78wXsg.js.map} +1 -1
- package/web-dist/assets/DangerZone-CBnW9h0p.js +2 -0
- package/web-dist/assets/{DangerZone-BicyqXv8.js.map → DangerZone-CBnW9h0p.js.map} +1 -1
- package/web-dist/assets/Field-DS2BMoqA.js +2 -0
- package/web-dist/assets/{Field-Cp-08kpe.js.map → Field-DS2BMoqA.js.map} +1 -1
- package/web-dist/assets/{Markdown-BPWc6K6m.js → Markdown-BIO6MBTM.js} +7 -7
- package/web-dist/assets/{Markdown-BPWc6K6m.js.map → Markdown-BIO6MBTM.js.map} +1 -1
- package/web-dist/assets/NavigationEditor-C0J7vDXL.js +2 -0
- package/web-dist/assets/NavigationEditor-C0J7vDXL.js.map +1 -0
- package/web-dist/assets/Overlay-DPZqU_vB.js +2 -0
- package/web-dist/assets/Overlay-DPZqU_vB.js.map +1 -0
- package/web-dist/assets/Priority-0hv1Vpg7.js +2 -0
- package/web-dist/assets/{Priority-ZGpTH645.js.map → Priority-0hv1Vpg7.js.map} +1 -1
- package/web-dist/assets/RadioCards-CN5xELnc.js +2 -0
- package/web-dist/assets/RadioCards-CN5xELnc.js.map +1 -0
- package/web-dist/assets/ScopeSelect-BaJjip1Y.js +2 -0
- package/web-dist/assets/ScopeSelect-BaJjip1Y.js.map +1 -0
- package/web-dist/assets/SegmentedControl-CRmhE-Kn.js +2 -0
- package/web-dist/assets/SegmentedControl-CRmhE-Kn.js.map +1 -0
- package/web-dist/assets/Select-CN7M29ap.js +2 -0
- package/web-dist/assets/{Select-DHRR7IAK.js.map → Select-CN7M29ap.js.map} +1 -1
- package/web-dist/assets/Switch-CZMY83Fw.js +2 -0
- package/web-dist/assets/{Switch-D5pVfZgf.js.map → Switch-CZMY83Fw.js.map} +1 -1
- package/web-dist/assets/Tabs-_1w3hoAR.js +2 -0
- package/web-dist/assets/Tabs-_1w3hoAR.js.map +1 -0
- package/web-dist/assets/TextLink-BpF2vLiL.js +2 -0
- package/web-dist/assets/{TextLink-BGtYWCW9.js.map → TextLink-BpF2vLiL.js.map} +1 -1
- package/web-dist/assets/UINodeRenderer-DqIkLhF8.js +4 -0
- package/web-dist/assets/UINodeRenderer-DqIkLhF8.js.map +1 -0
- package/web-dist/assets/UnfilteredNote-22-Qjb-f.js +2 -0
- package/web-dist/assets/UnfilteredNote-22-Qjb-f.js.map +1 -0
- package/web-dist/assets/api-RftVSu44.js +2 -0
- package/web-dist/assets/api-RftVSu44.js.map +1 -0
- package/web-dist/assets/{arrow-down-Dn3KG_JI.js → arrow-down-CzjHSpfM.js} +2 -2
- package/web-dist/assets/{arrow-down-Dn3KG_JI.js.map → arrow-down-CzjHSpfM.js.map} +1 -1
- package/web-dist/assets/{arrow-up-BiPtOqqy.js → arrow-up-B4YU8Bg0.js} +2 -2
- package/web-dist/assets/{arrow-up-BiPtOqqy.js.map → arrow-up-B4YU8Bg0.js.map} +1 -1
- package/web-dist/assets/attention-CEgIsUuq.js +2 -0
- package/web-dist/assets/attention-CEgIsUuq.js.map +1 -0
- package/web-dist/assets/automations-DnydDML9.js +2 -0
- package/web-dist/assets/{automations-IX9DQNk8.js.map → automations-DnydDML9.js.map} +1 -1
- package/web-dist/assets/board-BPxxc8G4.js +6 -0
- package/web-dist/assets/board-BPxxc8G4.js.map +1 -0
- package/web-dist/assets/{calendar-clock-DVlat602.js → calendar-clock-B3bQkNKq.js} +2 -2
- package/web-dist/assets/{calendar-clock-DVlat602.js.map → calendar-clock-B3bQkNKq.js.map} +1 -1
- package/web-dist/assets/chevron-right-DuAbbYQ-.js +2 -0
- package/web-dist/assets/{chevron-right-BM1IJI2z.js.map → chevron-right-DuAbbYQ-.js.map} +1 -1
- package/web-dist/assets/code-D5IB7jTT.js +28 -0
- package/web-dist/assets/code-D5IB7jTT.js.map +1 -0
- package/web-dist/assets/{core.esm-C4dCvG0s.js → core.esm-BbOnWvFK.js} +2 -2
- package/web-dist/assets/{core.esm-C4dCvG0s.js.map → core.esm-BbOnWvFK.js.map} +1 -1
- package/web-dist/assets/describe-DWsoiUix.js +5 -0
- package/web-dist/assets/describe-DWsoiUix.js.map +1 -0
- package/web-dist/assets/enroll-CV77Sk6h.js +2 -0
- package/web-dist/assets/{enroll-GUEF5Uxu.js.map → enroll-CV77Sk6h.js.map} +1 -1
- package/web-dist/assets/git-branch-Dr8PvfHN.js +2 -0
- package/web-dist/assets/git-branch-Dr8PvfHN.js.map +1 -0
- package/web-dist/assets/grip-vertical-Bc5pJHHF.js +2 -0
- package/web-dist/assets/grip-vertical-Bc5pJHHF.js.map +1 -0
- package/web-dist/assets/{hand-B6lvj014.js → hand-B2TrADIv.js} +2 -2
- package/web-dist/assets/{hand-B6lvj014.js.map → hand-B2TrADIv.js.map} +1 -1
- package/web-dist/assets/haptics-O69vKVoK.js +2 -0
- package/web-dist/assets/haptics-O69vKVoK.js.map +1 -0
- package/web-dist/assets/index-BXQwol8u.css +2 -0
- package/web-dist/assets/index-cmIcNnnF.js +17 -0
- package/web-dist/assets/index-cmIcNnnF.js.map +1 -0
- package/web-dist/assets/{link-2-CCq9WzMy.js → link-2-M5ENDPWT.js} +2 -2
- package/web-dist/assets/{link-2-CCq9WzMy.js.map → link-2-M5ENDPWT.js.map} +1 -1
- package/web-dist/assets/logic-CG2E-voG.js +2 -0
- package/web-dist/assets/{logic-BnSIy9_P.js.map → logic-CG2E-voG.js.map} +1 -1
- package/web-dist/assets/logic-D_vBBkcD.js +4 -0
- package/web-dist/assets/logic-D_vBBkcD.js.map +1 -0
- package/web-dist/assets/more-CVjg2O5h.js +2 -0
- package/web-dist/assets/more-CVjg2O5h.js.map +1 -0
- package/web-dist/assets/pencil-y_4AgVa2.js +2 -0
- package/web-dist/assets/pencil-y_4AgVa2.js.map +1 -0
- package/web-dist/assets/{play-NHO6U6cY.js → play-CYKX2aVL.js} +2 -2
- package/web-dist/assets/{play-NHO6U6cY.js.map → play-CYKX2aVL.js.map} +1 -1
- package/web-dist/assets/{plus-C83uJhbf.js → plus-B6uH1yKa.js} +2 -2
- package/web-dist/assets/{plus-C83uJhbf.js.map → plus-B6uH1yKa.js.map} +1 -1
- package/web-dist/assets/policyLogic-CioD2rMm.js +2 -0
- package/web-dist/assets/{policyLogic-DqKyFQEW.js.map → policyLogic-CioD2rMm.js.map} +1 -1
- package/web-dist/assets/prefs-V29Ms2ZL.js +2 -0
- package/web-dist/assets/prefs-V29Ms2ZL.js.map +1 -0
- package/web-dist/assets/queue-BGK9c062.js +2 -0
- package/web-dist/assets/queue-BGK9c062.js.map +1 -0
- package/web-dist/assets/repo-CuL_qbqU.js +5 -0
- package/web-dist/assets/repo-CuL_qbqU.js.map +1 -0
- package/web-dist/assets/{rotate-ccw-BRrlVEAQ.js → rotate-ccw-DvfmNYNE.js} +2 -2
- package/web-dist/assets/{rotate-ccw-BRrlVEAQ.js.map → rotate-ccw-DvfmNYNE.js.map} +1 -1
- package/web-dist/assets/{search-C5H14z0D.js → search-GTFKEqAS.js} +2 -2
- package/web-dist/assets/{search-C5H14z0D.js.map → search-GTFKEqAS.js.map} +1 -1
- package/web-dist/assets/selection-CAMJBh5A.js +9 -0
- package/web-dist/assets/selection-CAMJBh5A.js.map +1 -0
- package/web-dist/assets/settings-o7k_MPK7.js +9 -0
- package/web-dist/assets/settings-o7k_MPK7.js.map +1 -0
- package/web-dist/assets/states-BUWwUyu-.js +60 -0
- package/web-dist/assets/states-BUWwUyu-.js.map +1 -0
- package/web-dist/assets/{terminal-CATQN_17.js → terminal-DGVFZER3.js} +2 -2
- package/web-dist/assets/{terminal-CATQN_17.js.map → terminal-DGVFZER3.js.map} +1 -1
- package/web-dist/assets/terminal-login-Gy6aLzgC.js +2 -0
- package/web-dist/assets/{terminal-login-BdkmJdOO.js.map → terminal-login-Gy6aLzgC.js.map} +1 -1
- package/web-dist/assets/useBreakpoint-DoLUoCMf.js +2 -0
- package/web-dist/assets/useBreakpoint-DoLUoCMf.js.map +1 -0
- package/web-dist/assets/useIndicator-BKqIsw2Q.js +2 -0
- package/web-dist/assets/useIndicator-BKqIsw2Q.js.map +1 -0
- package/web-dist/assets/useNow-BS_9T7IY.js +2 -0
- package/web-dist/assets/useNow-BS_9T7IY.js.map +1 -0
- package/web-dist/assets/useResource-CPN6cDQ5.js +2 -0
- package/web-dist/assets/useResource-CPN6cDQ5.js.map +1 -0
- package/web-dist/assets/useSwipeTabs-XRK0_O6T.js +2 -0
- package/web-dist/assets/useSwipeTabs-XRK0_O6T.js.map +1 -0
- package/web-dist/assets/workboard-FE6bAMnW.js +3 -0
- package/web-dist/assets/workboard-FE6bAMnW.js.map +1 -0
- package/web-dist/index.html +7 -7
- package/web-dist/sw.js +1 -1
- package/web-dist/sw.js.map +1 -1
- package/web-dist/assets/AutomationView-B4O_teaB.js +0 -2
- package/web-dist/assets/AutomationView-B4O_teaB.js.map +0 -1
- package/web-dist/assets/Button-C7TQGuSX.js +0 -2
- package/web-dist/assets/Button-C7TQGuSX.js.map +0 -1
- package/web-dist/assets/Card-DzHrwFrv.js +0 -2
- package/web-dist/assets/Card-DzHrwFrv.js.map +0 -1
- package/web-dist/assets/Checkbox-BnRsg6ki.js +0 -2
- package/web-dist/assets/DangerZone-BicyqXv8.js +0 -2
- package/web-dist/assets/Field-Cp-08kpe.js +0 -2
- package/web-dist/assets/Priority-ZGpTH645.js +0 -2
- package/web-dist/assets/SegmentedControl-Cvkz7C_A.js +0 -2
- package/web-dist/assets/SegmentedControl-Cvkz7C_A.js.map +0 -1
- package/web-dist/assets/Select-DHRR7IAK.js +0 -2
- package/web-dist/assets/Switch-D5pVfZgf.js +0 -2
- package/web-dist/assets/Tabs-2GilVMsH.js +0 -2
- package/web-dist/assets/Tabs-2GilVMsH.js.map +0 -1
- package/web-dist/assets/TextLink-BGtYWCW9.js +0 -2
- package/web-dist/assets/UINodeRenderer-BaANWHvJ.js +0 -4
- package/web-dist/assets/UINodeRenderer-BaANWHvJ.js.map +0 -1
- package/web-dist/assets/UnfilteredNote-zVO8ajSi.js +0 -2
- package/web-dist/assets/UnfilteredNote-zVO8ajSi.js.map +0 -1
- package/web-dist/assets/ViewSelect-C9gNftWK.js +0 -2
- package/web-dist/assets/ViewSelect-C9gNftWK.js.map +0 -1
- package/web-dist/assets/api-DMrk4xwq.js +0 -2
- package/web-dist/assets/api-DMrk4xwq.js.map +0 -1
- package/web-dist/assets/attention-B9uawu1d.js +0 -2
- package/web-dist/assets/attention-B9uawu1d.js.map +0 -1
- package/web-dist/assets/automations-IX9DQNk8.js +0 -2
- package/web-dist/assets/board-BUAI4L7M.js +0 -6
- package/web-dist/assets/board-BUAI4L7M.js.map +0 -1
- package/web-dist/assets/check-CEnbWw4D.js +0 -2
- package/web-dist/assets/check-CEnbWw4D.js.map +0 -1
- package/web-dist/assets/chevron-right-BM1IJI2z.js +0 -2
- package/web-dist/assets/code-Dav4E15n.js +0 -25
- package/web-dist/assets/code-Dav4E15n.js.map +0 -1
- package/web-dist/assets/describe-B66LJTqU.js +0 -2
- package/web-dist/assets/describe-B66LJTqU.js.map +0 -1
- package/web-dist/assets/describe-BeFxHr2Y.js +0 -5
- package/web-dist/assets/describe-BeFxHr2Y.js.map +0 -1
- package/web-dist/assets/enroll-GUEF5Uxu.js +0 -2
- package/web-dist/assets/external-link-B3hnazCa.js +0 -2
- package/web-dist/assets/external-link-B3hnazCa.js.map +0 -1
- package/web-dist/assets/index-BUZpNu-R.js +0 -22
- package/web-dist/assets/index-BUZpNu-R.js.map +0 -1
- package/web-dist/assets/index-C9iuCGwg.css +0 -2
- package/web-dist/assets/keyboardLayers-BZOygMAH.js +0 -2
- package/web-dist/assets/keyboardLayers-BZOygMAH.js.map +0 -1
- package/web-dist/assets/logic-BBQ4d1GC.js +0 -4
- package/web-dist/assets/logic-BBQ4d1GC.js.map +0 -1
- package/web-dist/assets/logic-BnSIy9_P.js +0 -2
- package/web-dist/assets/more-C1oPXLVM.js +0 -2
- package/web-dist/assets/more-C1oPXLVM.js.map +0 -1
- package/web-dist/assets/pencil-DeML-0z2.js +0 -2
- package/web-dist/assets/pencil-DeML-0z2.js.map +0 -1
- package/web-dist/assets/policyLogic-DqKyFQEW.js +0 -2
- package/web-dist/assets/queue-DWSd1kia.js +0 -2
- package/web-dist/assets/queue-DWSd1kia.js.map +0 -1
- package/web-dist/assets/repo-DRwGWCut.js +0 -2
- package/web-dist/assets/repo-DRwGWCut.js.map +0 -1
- package/web-dist/assets/settings-B0IbaTOd.js +0 -12
- package/web-dist/assets/settings-B0IbaTOd.js.map +0 -1
- package/web-dist/assets/states-hyf_ATdQ.js +0 -58
- package/web-dist/assets/states-hyf_ATdQ.js.map +0 -1
- package/web-dist/assets/terminal-login-BdkmJdOO.js +0 -2
- package/web-dist/assets/timer-DFrvOKOy.js +0 -2
- package/web-dist/assets/timer-DFrvOKOy.js.map +0 -1
- package/web-dist/assets/useBreakpoint-BYCN9s8X.js +0 -2
- package/web-dist/assets/useBreakpoint-BYCN9s8X.js.map +0 -1
- package/web-dist/assets/useNow-DXyC-YfE.js +0 -2
- package/web-dist/assets/useNow-DXyC-YfE.js.map +0 -1
- package/web-dist/assets/useResource-DYNGG9XS.js +0 -2
- package/web-dist/assets/useResource-DYNGG9XS.js.map +0 -1
- package/web-dist/assets/workboard-BJCZsLp5.js +0 -3
- package/web-dist/assets/workboard-BJCZsLp5.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 z9 } from "zod";
|
|
7
7
|
|
|
8
8
|
// packages/protocol/dist/contributions.js
|
|
9
9
|
import { z as z3 } from "zod";
|
|
@@ -107,7 +107,11 @@ var RefSchema = z2.discriminatedUnion("kind", [
|
|
|
107
107
|
z2.object({ kind: z2.literal("file"), path: z2.string() }),
|
|
108
108
|
z2.object({ kind: z2.literal("session"), sessionId: z2.string() }),
|
|
109
109
|
z2.object({ kind: z2.literal("task"), taskId: z2.string() }),
|
|
110
|
-
z2.object({ kind: z2.literal("native_session"), hostId: z2.string(), sessionFile: z2.string() })
|
|
110
|
+
z2.object({ kind: z2.literal("native_session"), hostId: z2.string(), sessionFile: z2.string() }),
|
|
111
|
+
z2.object({
|
|
112
|
+
kind: z2.literal("url"),
|
|
113
|
+
url: z2.string().max(2e3).regex(/^https?:\/\/[^\s]+$/i, "must be an http(s) URL")
|
|
114
|
+
})
|
|
111
115
|
]);
|
|
112
116
|
var UINodeSchema = z2.lazy(() => z2.discriminatedUnion("t", [
|
|
113
117
|
z2.object({ t: z2.literal("text"), text: z2.string(), tone: ToneSchema.optional() }),
|
|
@@ -128,6 +132,7 @@ var UINodeSchema = z2.lazy(() => z2.discriminatedUnion("t", [
|
|
|
128
132
|
t: z2.literal("section"),
|
|
129
133
|
title: z2.string().optional(),
|
|
130
134
|
collapsible: z2.boolean().optional(),
|
|
135
|
+
open: z2.boolean().optional(),
|
|
131
136
|
children: z2.array(UINodeSchema)
|
|
132
137
|
}),
|
|
133
138
|
z2.object({
|
|
@@ -162,7 +167,30 @@ var UINodeSchema = z2.lazy(() => z2.discriminatedUnion("t", [
|
|
|
162
167
|
label: z2.string(),
|
|
163
168
|
tone: z2.enum(["default", "primary", "danger"]).optional()
|
|
164
169
|
}))
|
|
165
|
-
})
|
|
170
|
+
}),
|
|
171
|
+
z2.object({
|
|
172
|
+
t: z2.literal("checklist"),
|
|
173
|
+
items: z2.array(z2.object({
|
|
174
|
+
text: z2.string(),
|
|
175
|
+
state: z2.enum(["todo", "doing", "done", "skipped"]),
|
|
176
|
+
note: z2.string().optional()
|
|
177
|
+
}))
|
|
178
|
+
}),
|
|
179
|
+
z2.object({
|
|
180
|
+
t: z2.literal("facts"),
|
|
181
|
+
items: z2.array(z2.object({ label: z2.string(), value: z2.string(), mono: z2.boolean().optional() }))
|
|
182
|
+
}),
|
|
183
|
+
z2.object({
|
|
184
|
+
t: z2.literal("rows"),
|
|
185
|
+
rows: z2.array(z2.object({
|
|
186
|
+
title: z2.string(),
|
|
187
|
+
status: z2.string().optional(),
|
|
188
|
+
tone: ToneSchema.optional(),
|
|
189
|
+
meta: z2.string().optional(),
|
|
190
|
+
ref: RefSchema.optional()
|
|
191
|
+
}))
|
|
192
|
+
}),
|
|
193
|
+
z2.object({ t: z2.literal("badge"), text: z2.string(), tone: ToneSchema.optional() })
|
|
166
194
|
]));
|
|
167
195
|
var UI_MAX_DEPTH = 12;
|
|
168
196
|
var UI_MAX_NODES = 2e3;
|
|
@@ -213,16 +241,28 @@ var ContributionPlacement = z3.enum([
|
|
|
213
241
|
"sidebar.footer",
|
|
214
242
|
"session.panel",
|
|
215
243
|
"composer.pill",
|
|
244
|
+
/** `adapter.trackers.v1`: a live summary above the input that opens its detail. */
|
|
245
|
+
"composer.tracker",
|
|
246
|
+
/** `adapter.trackers.v1`: a short word on the session's navigator row. */
|
|
247
|
+
"session.badge",
|
|
216
248
|
"palette.item",
|
|
217
249
|
"slash.command"
|
|
218
250
|
]);
|
|
219
251
|
var Id = z3.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9._-]{0,79}$/);
|
|
220
252
|
var ActionId = z3.string().min(1).max(200);
|
|
221
253
|
var Keywords = z3.array(z3.string().min(1).max(80)).max(20);
|
|
254
|
+
var TrackerSummary = z3.object({
|
|
255
|
+
/** Progress or a count, such as "2/5" or "3". */
|
|
256
|
+
count: z3.string().min(1).max(24).optional(),
|
|
257
|
+
status: z3.enum(["idle", "running", "ok", "error", "attention"]).optional(),
|
|
258
|
+
/** The step in progress, such as the current todo. */
|
|
259
|
+
step: z3.string().min(1).max(120).optional()
|
|
260
|
+
}).strict();
|
|
222
261
|
var Common = {
|
|
223
262
|
placement: ContributionPlacement,
|
|
224
263
|
order: z3.number().int().min(-1e3).max(1e3).optional(),
|
|
225
|
-
actionId: ActionId.optional()
|
|
264
|
+
actionId: ActionId.optional(),
|
|
265
|
+
tracker: TrackerSummary.optional()
|
|
226
266
|
};
|
|
227
267
|
var ContributionDescriptor = z3.object({
|
|
228
268
|
id: Id,
|
|
@@ -245,6 +285,12 @@ var ContributionDescriptor = z3.object({
|
|
|
245
285
|
if (v.placement === "composer.pill" && v.actionId !== void 0) {
|
|
246
286
|
ctx.addIssue({ code: "custom", message: "Composer pills are not interactive" });
|
|
247
287
|
}
|
|
288
|
+
if (v.placement === "session.badge" && v.actionId !== void 0) {
|
|
289
|
+
ctx.addIssue({ code: "custom", message: "Session badges are not interactive" });
|
|
290
|
+
}
|
|
291
|
+
if (v.placement !== "composer.tracker" && v.tracker !== void 0) {
|
|
292
|
+
ctx.addIssue({ code: "custom", message: "Only composer trackers have a tracker summary" });
|
|
293
|
+
}
|
|
248
294
|
});
|
|
249
295
|
var ContributionInput = z3.object({
|
|
250
296
|
...Common,
|
|
@@ -255,6 +301,7 @@ var ContributionInput = z3.object({
|
|
|
255
301
|
name: z3.string().regex(/^[a-z][a-z0-9-]{0,39}$/).optional(),
|
|
256
302
|
keywords: Keywords.optional()
|
|
257
303
|
}).strict();
|
|
304
|
+
var SESSION_BADGE_MAX = 24;
|
|
258
305
|
function boundContributionJson(value, maxBytes = 256 * 1024) {
|
|
259
306
|
const stack = [{ value, depth: 0 }];
|
|
260
307
|
const ancestors = /* @__PURE__ */ new Set();
|
|
@@ -331,6 +378,14 @@ function validateContribution(id, input) {
|
|
|
331
378
|
if (descriptor.placement === "composer.pill" && node.t !== "text" && node.t !== "progress") {
|
|
332
379
|
throw new Error("Composer pill content must be text or progress");
|
|
333
380
|
}
|
|
381
|
+
if (descriptor.placement === "session.badge") {
|
|
382
|
+
if (node.t !== "text" && node.t !== "badge") {
|
|
383
|
+
throw new Error("Session badge content must be text or a badge");
|
|
384
|
+
}
|
|
385
|
+
if (node.text.length === 0 || node.text.length > SESSION_BADGE_MAX) {
|
|
386
|
+
throw new Error(`Session badge text must be 1 to ${SESSION_BADGE_MAX} characters`);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
334
389
|
if (descriptor.placement !== "session.panel" && state !== void 0) {
|
|
335
390
|
throw new Error("Only session panels accept renderer state");
|
|
336
391
|
}
|
|
@@ -353,7 +408,7 @@ function contributionSlot(id) {
|
|
|
353
408
|
}
|
|
354
409
|
|
|
355
410
|
// packages/protocol/dist/entities.js
|
|
356
|
-
import { z as
|
|
411
|
+
import { z as z8 } from "zod";
|
|
357
412
|
|
|
358
413
|
// packages/protocol/dist/github.js
|
|
359
414
|
import { z as z4 } from "zod";
|
|
@@ -602,20 +657,207 @@ var GitHubHostMergeRequest = GitHubHostLogsRequest.extend({
|
|
|
602
657
|
expectedPullRequestNodeId: z4.string().min(1)
|
|
603
658
|
});
|
|
604
659
|
|
|
605
|
-
// packages/protocol/dist/
|
|
660
|
+
// packages/protocol/dist/issues.js
|
|
606
661
|
import { z as z5 } from "zod";
|
|
607
|
-
var
|
|
608
|
-
var
|
|
609
|
-
var
|
|
662
|
+
var Iso = z5.string();
|
|
663
|
+
var Id3 = z5.string().min(1);
|
|
664
|
+
var IssueFollow = z5.enum(["assigned", "board"]);
|
|
665
|
+
var GitHubLogin = z5.string().regex(/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})$/);
|
|
666
|
+
var BoardStatusOption = z5.object({
|
|
667
|
+
id: z5.string().min(1),
|
|
668
|
+
name: z5.string().min(1).max(200)
|
|
669
|
+
});
|
|
670
|
+
var SourceBoard = z5.object({
|
|
671
|
+
projectNumber: z5.number().int().positive(),
|
|
672
|
+
statusField: z5.string().min(1).max(100).default("Status"),
|
|
673
|
+
/** Column to move a card to once its worktree exists (write-back). */
|
|
674
|
+
onStart: z5.string().min(1).max(200).nullable().default(null),
|
|
675
|
+
/** Column to move a card to once a pull request is open (write-back). */
|
|
676
|
+
onReview: z5.string().min(1).max(200).nullable().default(null),
|
|
677
|
+
/** A single-select field that ranks issues: its first option is the highest. */
|
|
678
|
+
priorityField: z5.string().min(1).max(100).nullable().optional(),
|
|
679
|
+
/** Columns whose cards are not tracked until they have a branch or pull request. */
|
|
680
|
+
backlog: z5.array(z5.string().min(1).max(200)).max(20).optional()
|
|
681
|
+
});
|
|
682
|
+
var GitHubSource = z5.object({
|
|
683
|
+
kind: z5.literal("github"),
|
|
684
|
+
/** The host whose `gh` login reads the issues. */
|
|
685
|
+
hostId: Id3,
|
|
686
|
+
owner: GitHubLogin,
|
|
687
|
+
repositories: z5.array(GitHubRepository).min(1).max(50).nullable(),
|
|
688
|
+
/** Repositories outside `owner` that belong to this source too (never limited by `repositories`). */
|
|
689
|
+
extraRepositories: z5.array(GitHubRepository).max(20).optional(),
|
|
690
|
+
board: SourceBoard.nullable(),
|
|
691
|
+
/** Which issues it follows; absent means "assigned". "board": every open issue on its board. */
|
|
692
|
+
follow: IssueFollow.optional(),
|
|
693
|
+
writeBack: z5.boolean(),
|
|
694
|
+
moveShared: z5.boolean(),
|
|
695
|
+
/** Make a worktree for an issue branch that has none; absent means true. */
|
|
696
|
+
worktrees: z5.boolean().optional(),
|
|
697
|
+
enabled: z5.boolean(),
|
|
698
|
+
/** The host's `gh` user, from the last sync. */
|
|
699
|
+
login: z5.string().nullable(),
|
|
700
|
+
lastSyncedAt: Iso.nullable(),
|
|
701
|
+
lastError: z5.string().max(2e3).nullable()
|
|
702
|
+
});
|
|
703
|
+
var GitHubSourceInput = z5.object({
|
|
704
|
+
hostId: Id3,
|
|
705
|
+
owner: GitHubLogin,
|
|
706
|
+
repositories: GitHubSource.shape.repositories.default(null),
|
|
707
|
+
extraRepositories: z5.array(GitHubRepository).max(20).default([]),
|
|
708
|
+
board: SourceBoard.nullable().default(null),
|
|
709
|
+
follow: IssueFollow.default("assigned"),
|
|
710
|
+
writeBack: z5.boolean().default(false),
|
|
711
|
+
moveShared: z5.boolean().default(true),
|
|
712
|
+
worktrees: z5.boolean().default(true),
|
|
713
|
+
enabled: z5.boolean().default(true)
|
|
714
|
+
});
|
|
715
|
+
var GitHubSourcePatch = z5.object({
|
|
716
|
+
hostId: Id3.optional(),
|
|
717
|
+
owner: GitHubLogin.optional(),
|
|
718
|
+
repositories: GitHubSource.shape.repositories.optional(),
|
|
719
|
+
extraRepositories: z5.array(GitHubRepository).max(20).optional(),
|
|
720
|
+
board: SourceBoard.nullable().optional(),
|
|
721
|
+
follow: IssueFollow.optional(),
|
|
722
|
+
writeBack: z5.boolean().optional(),
|
|
723
|
+
moveShared: z5.boolean().optional(),
|
|
724
|
+
worktrees: z5.boolean().optional(),
|
|
725
|
+
enabled: z5.boolean().optional()
|
|
726
|
+
});
|
|
727
|
+
var IssueBoard = z5.object({
|
|
728
|
+
projectId: z5.string().min(1),
|
|
729
|
+
projectItemId: z5.string().min(1),
|
|
730
|
+
fieldId: z5.string().min(1),
|
|
731
|
+
status: z5.string().nullable(),
|
|
732
|
+
statusOptionId: z5.string().nullable(),
|
|
733
|
+
options: z5.array(BoardStatusOption).max(50),
|
|
734
|
+
/** The issue's value of the source's priority field; `rank` is its option's position. */
|
|
735
|
+
priority: z5.object({ name: z5.string().min(1).max(200), rank: z5.number().int().min(0) }).nullable().optional()
|
|
736
|
+
});
|
|
737
|
+
var IssuePullRequest = z5.object({
|
|
738
|
+
number: z5.number().int().positive(),
|
|
739
|
+
state: z5.enum(["OPEN", "CLOSED", "MERGED"]),
|
|
740
|
+
url: z5.string().url(),
|
|
741
|
+
headRefName: z5.string().min(1).max(255)
|
|
742
|
+
});
|
|
743
|
+
var IssueParent = z5.object({
|
|
744
|
+
number: z5.number().int().positive(),
|
|
745
|
+
title: z5.string().max(300),
|
|
746
|
+
url: GitHubIssueUrl
|
|
747
|
+
});
|
|
748
|
+
var IssueSubIssues = z5.object({
|
|
749
|
+
total: z5.number().int().min(0),
|
|
750
|
+
completed: z5.number().int().min(0)
|
|
751
|
+
});
|
|
752
|
+
var SyncedIssue = z5.object({
|
|
753
|
+
itemId: z5.string().min(1),
|
|
754
|
+
repository: GitHubRepository,
|
|
755
|
+
number: z5.number().int().positive(),
|
|
756
|
+
title: z5.string().min(1).max(1e3),
|
|
757
|
+
url: GitHubIssueUrl,
|
|
758
|
+
assignees: z5.array(z5.string()).max(20),
|
|
759
|
+
branches: z5.array(z5.string().min(1).max(255)).max(10),
|
|
760
|
+
pullRequest: IssuePullRequest.nullable(),
|
|
761
|
+
board: IssueBoard.nullable(),
|
|
762
|
+
parent: IssueParent.nullable().optional(),
|
|
763
|
+
subIssues: IssueSubIssues.nullable().optional()
|
|
764
|
+
});
|
|
765
|
+
var IssueSyncResult = z5.object({
|
|
766
|
+
login: z5.string().min(1),
|
|
767
|
+
items: z5.array(SyncedIssue).max(200),
|
|
768
|
+
truncated: z5.boolean()
|
|
769
|
+
});
|
|
770
|
+
var TrackedIssue = z5.object({
|
|
771
|
+
/** `${scopeId}:${itemId}` */
|
|
772
|
+
id: Id3,
|
|
773
|
+
scopeId: Id3,
|
|
774
|
+
/** COMPAT(scopes-rename): remove after 2027-03-01. A copy of scopeId for 0.20 clients. */
|
|
775
|
+
trackerId: Id3.optional(),
|
|
776
|
+
itemId: z5.string().min(1),
|
|
777
|
+
projectId: Id3,
|
|
778
|
+
repository: GitHubRepository,
|
|
779
|
+
number: z5.number().int().positive(),
|
|
780
|
+
title: z5.string().min(1).max(300),
|
|
781
|
+
url: GitHubIssueUrl,
|
|
782
|
+
assignees: z5.array(z5.string()).max(20),
|
|
783
|
+
/** Branches GitHub links to the issue. */
|
|
784
|
+
branches: z5.array(z5.string()).max(10),
|
|
785
|
+
/** The branch Switchyard works on. */
|
|
786
|
+
branch: z5.string().nullable(),
|
|
787
|
+
workspaceId: Id3.nullable(),
|
|
788
|
+
pullRequest: IssuePullRequest.nullable(),
|
|
789
|
+
board: IssueBoard.nullable(),
|
|
790
|
+
/** The issue this one is a sub-issue of. */
|
|
791
|
+
parent: IssueParent.nullable().optional(),
|
|
792
|
+
subIssues: IssueSubIssues.nullable().optional(),
|
|
793
|
+
updatedAt: Iso
|
|
794
|
+
});
|
|
795
|
+
var OpenIssueRequest = z5.object({
|
|
796
|
+
hostId: Id3.optional(),
|
|
797
|
+
scopeId: z5.string().optional(),
|
|
798
|
+
/** COMPAT(scopes-rename): remove after 2027-03-01. The old name of scopeId. */
|
|
799
|
+
viewId: z5.string().optional(),
|
|
800
|
+
/** The first prompt of a new session. */
|
|
801
|
+
prompt: z5.string().optional(),
|
|
802
|
+
profileId: z5.string().nullable().optional()
|
|
803
|
+
});
|
|
804
|
+
var IssueSetStatusResult = z5.discriminatedUnion("status", [
|
|
805
|
+
z5.object({ status: z5.literal("moved") }),
|
|
806
|
+
z5.object({
|
|
807
|
+
status: z5.literal("skipped"),
|
|
808
|
+
reason: z5.enum(["not_assigned", "shared", "stale"])
|
|
809
|
+
})
|
|
810
|
+
]);
|
|
811
|
+
var LinkIssueRequest = z5.object({ workspaceId: Id3 });
|
|
812
|
+
var IssueStatusRequest = z5.object({ status: z5.string().min(1).max(200) });
|
|
813
|
+
var IssueHostSyncRequest = z5.object({
|
|
814
|
+
owner: GitHubLogin,
|
|
815
|
+
repositories: z5.array(GitHubRepository).nullable(),
|
|
816
|
+
board: z5.object({
|
|
817
|
+
projectNumber: z5.number().int().positive(),
|
|
818
|
+
statusField: z5.string().min(1),
|
|
819
|
+
priorityField: z5.string().min(1).nullable().optional()
|
|
820
|
+
}).nullable(),
|
|
821
|
+
follow: IssueFollow.optional(),
|
|
822
|
+
backlog: z5.array(z5.string().min(1)).max(20).optional()
|
|
823
|
+
});
|
|
824
|
+
var IssueHostPrepareBranchRequest = z5.object({
|
|
825
|
+
checkoutPath: z5.string().min(1),
|
|
826
|
+
branch: z5.string().min(1).max(255)
|
|
827
|
+
});
|
|
828
|
+
var IssueHostStartIssueRequest = z5.object({
|
|
829
|
+
checkoutPath: z5.string().min(1),
|
|
830
|
+
repository: GitHubRepository,
|
|
831
|
+
number: z5.number().int().positive(),
|
|
832
|
+
branch: z5.string().min(1).max(255),
|
|
833
|
+
base: z5.string().min(1)
|
|
834
|
+
});
|
|
835
|
+
var IssueHostSetStatusRequest = z5.object({
|
|
836
|
+
projectId: z5.string().min(1),
|
|
837
|
+
projectItemId: z5.string().min(1),
|
|
838
|
+
fieldId: z5.string().min(1),
|
|
839
|
+
statusField: z5.string().min(1),
|
|
840
|
+
optionId: z5.string().min(1),
|
|
841
|
+
expectedOptionId: z5.string().nullable(),
|
|
842
|
+
login: z5.string().min(1),
|
|
843
|
+
allowShared: z5.boolean(),
|
|
844
|
+
allowUnassigned: z5.boolean().optional()
|
|
845
|
+
});
|
|
846
|
+
|
|
847
|
+
// packages/protocol/dist/policies.js
|
|
848
|
+
import { z as z6 } from "zod";
|
|
849
|
+
var Id4 = z6.string().min(1).max(200);
|
|
850
|
+
var Revision = z6.number().int().safe().min(1);
|
|
851
|
+
var Instant2 = z6.string().refine((s) => {
|
|
610
852
|
try {
|
|
611
853
|
return new Date(s).toISOString() === s;
|
|
612
854
|
} catch {
|
|
613
855
|
return false;
|
|
614
856
|
}
|
|
615
857
|
});
|
|
616
|
-
var Text =
|
|
858
|
+
var Text = z6.string().max(4e3);
|
|
617
859
|
var Reason = Text.min(1);
|
|
618
|
-
var Fingerprint =
|
|
860
|
+
var Fingerprint = z6.string().regex(/^[0-9a-f]{64}$/);
|
|
619
861
|
var forbidden = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
|
|
620
862
|
var bytes2 = (s) => new TextEncoder().encode(s).length;
|
|
621
863
|
function validJson(value, depth = 0, seen = /* @__PURE__ */ new Set()) {
|
|
@@ -652,43 +894,43 @@ function validJson(value, depth = 0, seen = /* @__PURE__ */ new Set()) {
|
|
|
652
894
|
seen.delete(value);
|
|
653
895
|
}
|
|
654
896
|
}
|
|
655
|
-
var JsonObject =
|
|
656
|
-
var CompletedUsageWatermark =
|
|
657
|
-
var scopeShape = { scope:
|
|
897
|
+
var JsonObject = z6.custom((v) => !!v && typeof v === "object" && !Array.isArray(v) && validJson(v));
|
|
898
|
+
var CompletedUsageWatermark = z6.object({ runtimeId: Id4, settleSeq: Revision }).strict();
|
|
899
|
+
var scopeShape = { scope: z6.enum(["session", "profile", "server"]), scopeId: Id4.nullable() };
|
|
658
900
|
var scopeValid = (v) => v.scope === "server" === (v.scopeId === null);
|
|
659
|
-
var PolicyPhase =
|
|
660
|
-
var PolicyVerdict =
|
|
661
|
-
var PolicyRequestAction =
|
|
901
|
+
var PolicyPhase = z6.enum(["tool_call", "request"]);
|
|
902
|
+
var PolicyVerdict = z6.enum(["ALLOW", "ASK", "DENY"]);
|
|
903
|
+
var PolicyRequestAction = z6.enum([
|
|
662
904
|
"task.create",
|
|
663
905
|
"message.send",
|
|
664
906
|
"inbox.read",
|
|
665
907
|
"run.continue"
|
|
666
908
|
]);
|
|
667
909
|
var PolicyScope = scopeShape.scope;
|
|
668
|
-
var PolicyCounterMap =
|
|
669
|
-
var phases =
|
|
910
|
+
var PolicyCounterMap = z6.record(z6.string().regex(/^[A-Za-z_][A-Za-z0-9_]{0,63}$/).refine((k) => !forbidden.has(k)), z6.number().int().safe()).refine((v) => Object.keys(v).length <= 64);
|
|
911
|
+
var phases = z6.array(PolicyPhase).min(1).max(2).refine((v) => new Set(v).size === v.length);
|
|
670
912
|
var ruleFields = {
|
|
671
|
-
priority:
|
|
672
|
-
enabled:
|
|
913
|
+
priority: z6.number().int().safe().min(-1e6).max(1e6),
|
|
914
|
+
enabled: z6.boolean(),
|
|
673
915
|
phases,
|
|
674
|
-
name:
|
|
675
|
-
expression:
|
|
916
|
+
name: z6.string().min(1).max(120),
|
|
917
|
+
expression: z6.string().min(1).max(8192)
|
|
676
918
|
};
|
|
677
|
-
var PolicyRule =
|
|
678
|
-
id:
|
|
919
|
+
var PolicyRule = z6.object({
|
|
920
|
+
id: Id4,
|
|
679
921
|
...scopeShape,
|
|
680
922
|
...ruleFields,
|
|
681
923
|
revision: Revision,
|
|
682
|
-
builtIn:
|
|
924
|
+
builtIn: z6.boolean(),
|
|
683
925
|
createdAt: Instant2,
|
|
684
926
|
updatedAt: Instant2
|
|
685
927
|
}).strict().refine(scopeValid);
|
|
686
|
-
var PolicyToolSafety =
|
|
687
|
-
destructiveDelete:
|
|
688
|
-
forcePush:
|
|
689
|
-
defaultBranchPush:
|
|
690
|
-
uncertain:
|
|
691
|
-
reasons:
|
|
928
|
+
var PolicyToolSafety = z6.object({
|
|
929
|
+
destructiveDelete: z6.boolean(),
|
|
930
|
+
forcePush: z6.boolean(),
|
|
931
|
+
defaultBranchPush: z6.boolean(),
|
|
932
|
+
uncertain: z6.boolean(),
|
|
933
|
+
reasons: z6.array(z6.string().min(1).max(1e3)).max(16)
|
|
692
934
|
}).strict();
|
|
693
935
|
function normalizePosixPath(value) {
|
|
694
936
|
const parts = [];
|
|
@@ -700,7 +942,7 @@ function normalizePosixPath(value) {
|
|
|
700
942
|
}
|
|
701
943
|
return `/${parts.join("/")}`;
|
|
702
944
|
}
|
|
703
|
-
var hostPath =
|
|
945
|
+
var hostPath = z6.string().min(1).max(8192).refine((value) => value.startsWith("/") && !value.includes("\0"), "Expected absolute POSIX path").transform(normalizePosixPath);
|
|
704
946
|
function relativePosixPath(from, to) {
|
|
705
947
|
const fromParts = from.split("/").filter(Boolean);
|
|
706
948
|
const toParts = to.split("/").filter(Boolean);
|
|
@@ -709,7 +951,7 @@ function relativePosixPath(from, to) {
|
|
|
709
951
|
shared++;
|
|
710
952
|
return [...fromParts.slice(shared).map(() => ".."), ...toParts.slice(shared)].join("/");
|
|
711
953
|
}
|
|
712
|
-
var HostPolicyBoundary =
|
|
954
|
+
var HostPolicyBoundary = z6.object({
|
|
713
955
|
cwd: hostPath,
|
|
714
956
|
workspaceRoot: hostPath,
|
|
715
957
|
cwdReal: hostPath,
|
|
@@ -718,51 +960,51 @@ var HostPolicyBoundary = z5.object({
|
|
|
718
960
|
const relative = relativePosixPath(boundary.workspaceRootReal, boundary.cwdReal);
|
|
719
961
|
return relative !== ".." && !relative.startsWith("../");
|
|
720
962
|
}, "Real cwd must be within the real workspace boundary.");
|
|
721
|
-
var HostToolPolicyContext =
|
|
722
|
-
version:
|
|
723
|
-
toolCallId:
|
|
963
|
+
var HostToolPolicyContext = z6.object({
|
|
964
|
+
version: z6.literal(1),
|
|
965
|
+
toolCallId: Id4,
|
|
724
966
|
toolHash: Fingerprint,
|
|
725
967
|
boundary: HostPolicyBoundary,
|
|
726
|
-
defaultBranch:
|
|
968
|
+
defaultBranch: z6.string().min(1).max(255).nullable(),
|
|
727
969
|
safety: PolicyToolSafety
|
|
728
970
|
}).strict();
|
|
729
|
-
var PolicyToolContext =
|
|
730
|
-
var PolicyRequestContext =
|
|
731
|
-
var absolutePath =
|
|
732
|
-
var controlMode =
|
|
733
|
-
var PolicySessionContext =
|
|
734
|
-
id:
|
|
735
|
-
hostId:
|
|
736
|
-
nativeSessionId:
|
|
737
|
-
runtimeId:
|
|
738
|
-
profileId:
|
|
739
|
-
projectId:
|
|
740
|
-
taskId:
|
|
741
|
-
runId:
|
|
971
|
+
var PolicyToolContext = z6.object({ name: Id4, args: JsonObject, safety: PolicyToolSafety }).strict();
|
|
972
|
+
var PolicyRequestContext = z6.object({ method: PolicyRequestAction, args: JsonObject }).strict();
|
|
973
|
+
var absolutePath = z6.string().min(1).max(8192).refine((v) => v.startsWith("/") || /^[A-Za-z]:[\\/]/.test(v));
|
|
974
|
+
var controlMode = z6.enum(["human", "automation"]);
|
|
975
|
+
var PolicySessionContext = z6.object({
|
|
976
|
+
id: Id4,
|
|
977
|
+
hostId: Id4,
|
|
978
|
+
nativeSessionId: Id4.nullable(),
|
|
979
|
+
runtimeId: Id4.nullable(),
|
|
980
|
+
profileId: Id4,
|
|
981
|
+
projectId: Id4.nullable(),
|
|
982
|
+
taskId: Id4.nullable(),
|
|
983
|
+
runId: Id4.nullable(),
|
|
742
984
|
controlMode,
|
|
743
985
|
controlRevision: Revision,
|
|
744
986
|
cwd: absolutePath,
|
|
745
987
|
workspaceRoot: absolutePath,
|
|
746
|
-
repository:
|
|
747
|
-
defaultBranch:
|
|
748
|
-
readOnly:
|
|
988
|
+
repository: z6.string().min(1).max(2048).nullable(),
|
|
989
|
+
defaultBranch: z6.string().min(1).max(255).nullable(),
|
|
990
|
+
readOnly: z6.boolean()
|
|
749
991
|
}).strict();
|
|
750
|
-
var PolicyTaskContext =
|
|
751
|
-
id:
|
|
752
|
-
projectId:
|
|
753
|
-
rootTaskId:
|
|
754
|
-
parentTaskId:
|
|
755
|
-
title:
|
|
756
|
-
state:
|
|
992
|
+
var PolicyTaskContext = z6.object({
|
|
993
|
+
id: Id4,
|
|
994
|
+
projectId: Id4,
|
|
995
|
+
rootTaskId: Id4,
|
|
996
|
+
parentTaskId: Id4.nullable(),
|
|
997
|
+
title: z6.string().min(1).max(300),
|
|
998
|
+
state: z6.enum(["backlog", "ready", "in_progress", "review", "done", "canceled"])
|
|
757
999
|
}).strict();
|
|
758
|
-
var PolicyTargetContext =
|
|
759
|
-
id:
|
|
760
|
-
hostId:
|
|
761
|
-
projectId:
|
|
762
|
-
taskId:
|
|
1000
|
+
var PolicyTargetContext = z6.object({
|
|
1001
|
+
id: Id4,
|
|
1002
|
+
hostId: Id4,
|
|
1003
|
+
projectId: Id4.nullable(),
|
|
1004
|
+
taskId: Id4.nullable(),
|
|
763
1005
|
controlMode,
|
|
764
1006
|
controlRevision: Revision,
|
|
765
|
-
runtime:
|
|
1007
|
+
runtime: z6.enum([
|
|
766
1008
|
"starting",
|
|
767
1009
|
"idle",
|
|
768
1010
|
"running",
|
|
@@ -771,24 +1013,24 @@ var PolicyTargetContext = z5.object({
|
|
|
771
1013
|
"failed",
|
|
772
1014
|
"stopped"
|
|
773
1015
|
]),
|
|
774
|
-
readOnly:
|
|
1016
|
+
readOnly: z6.boolean()
|
|
775
1017
|
}).strict();
|
|
776
|
-
var PolicyCostContext =
|
|
777
|
-
tokens:
|
|
778
|
-
costUsd:
|
|
779
|
-
maxTokens:
|
|
780
|
-
maxCostUsd:
|
|
781
|
-
accounting:
|
|
782
|
-
fresh:
|
|
1018
|
+
var PolicyCostContext = z6.object({
|
|
1019
|
+
tokens: z6.number().int().safe().nonnegative().nullable(),
|
|
1020
|
+
costUsd: z6.number().finite().nonnegative().nullable(),
|
|
1021
|
+
maxTokens: z6.number().int().safe().positive().nullable(),
|
|
1022
|
+
maxCostUsd: z6.number().finite().positive().nullable(),
|
|
1023
|
+
accounting: z6.enum(["available", "unavailable"]),
|
|
1024
|
+
fresh: z6.boolean(),
|
|
783
1025
|
watermark: CompletedUsageWatermark.nullable(),
|
|
784
|
-
provider:
|
|
785
|
-
modelId:
|
|
786
|
-
classification:
|
|
787
|
-
expensive:
|
|
1026
|
+
provider: Id4.nullable(),
|
|
1027
|
+
modelId: z6.string().min(1).max(512).nullable(),
|
|
1028
|
+
classification: z6.enum(["cheap", "expensive", "unclassified"]),
|
|
1029
|
+
expensive: z6.boolean()
|
|
788
1030
|
}).strict().refine((v) => v.expensive === (v.classification !== "cheap") && (v.provider !== null && v.modelId !== null || v.classification === "unclassified") && v.accounting === "available" === (v.tokens !== null || v.costUsd !== null));
|
|
789
|
-
var PolicyContext =
|
|
1031
|
+
var PolicyContext = z6.object({
|
|
790
1032
|
phase: PolicyPhase,
|
|
791
|
-
action:
|
|
1033
|
+
action: z6.union([z6.literal("tool.call"), PolicyRequestAction]),
|
|
792
1034
|
tool: PolicyToolContext.nullable(),
|
|
793
1035
|
request: PolicyRequestContext.nullable(),
|
|
794
1036
|
session: PolicySessionContext,
|
|
@@ -797,11 +1039,11 @@ var PolicyContext = z5.object({
|
|
|
797
1039
|
cost: PolicyCostContext,
|
|
798
1040
|
counters: PolicyCounterMap
|
|
799
1041
|
}).strict().refine((v) => (v.phase === "tool_call" ? v.action === "tool.call" && v.tool !== null && v.request === null : v.tool === null && v.request !== null && v.action === v.request.method) && (v.action === "message.send" ? v.target !== null : v.target === null)).refine((v) => bytes2(JSON.stringify(v)) <= 65536, "Policy input is too large to evaluate.");
|
|
800
|
-
var PolicyRuleResult =
|
|
801
|
-
|
|
802
|
-
|
|
1042
|
+
var PolicyRuleResult = z6.union([
|
|
1043
|
+
z6.null(),
|
|
1044
|
+
z6.object({ verdict: PolicyVerdict, reason: Text, state_updates: PolicyCounterMap.optional() }).strict().refine((v) => v.verdict === "ALLOW" || v.reason.length > 0)
|
|
803
1045
|
]);
|
|
804
|
-
var webUrl =
|
|
1046
|
+
var webUrl = z6.string().max(4096).refine((s) => {
|
|
805
1047
|
try {
|
|
806
1048
|
const u = new URL(s);
|
|
807
1049
|
return ["http:", "https:"].includes(u.protocol) && !u.username && !u.password;
|
|
@@ -809,322 +1051,335 @@ var webUrl = z5.string().max(4096).refine((s) => {
|
|
|
809
1051
|
return false;
|
|
810
1052
|
}
|
|
811
1053
|
});
|
|
812
|
-
var PolicyEvaluation =
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
verdict:
|
|
817
|
-
decisionId:
|
|
818
|
-
interactionId:
|
|
1054
|
+
var PolicyEvaluation = z6.discriminatedUnion("verdict", [
|
|
1055
|
+
z6.object({ verdict: z6.literal("ALLOW") }).strict(),
|
|
1056
|
+
z6.object({ verdict: z6.literal("DENY"), reason: Reason }).strict(),
|
|
1057
|
+
z6.object({
|
|
1058
|
+
verdict: z6.literal("ASK"),
|
|
1059
|
+
decisionId: Id4,
|
|
1060
|
+
interactionId: Id4,
|
|
819
1061
|
interactionUrl: webUrl
|
|
820
1062
|
}).strict()
|
|
821
1063
|
]);
|
|
822
|
-
var PolicyPermission =
|
|
823
|
-
kind:
|
|
824
|
-
decisionId:
|
|
825
|
-
rootTaskId:
|
|
826
|
-
ruleId:
|
|
1064
|
+
var PolicyPermission = z6.object({
|
|
1065
|
+
kind: z6.literal("policy"),
|
|
1066
|
+
decisionId: Id4,
|
|
1067
|
+
rootTaskId: Id4.nullable(),
|
|
1068
|
+
ruleId: Id4,
|
|
827
1069
|
ruleRevision: Revision,
|
|
828
1070
|
fingerprint: Fingerprint
|
|
829
1071
|
}).strict();
|
|
830
|
-
var PolicyGrant =
|
|
831
|
-
id:
|
|
832
|
-
scope:
|
|
833
|
-
ruleId:
|
|
1072
|
+
var PolicyGrant = z6.object({
|
|
1073
|
+
id: Id4,
|
|
1074
|
+
scope: z6.object({ kind: z6.enum(["task", "session"]), id: Id4 }).strict(),
|
|
1075
|
+
ruleId: Id4,
|
|
834
1076
|
ruleRevision: Revision,
|
|
835
1077
|
fingerprint: Fingerprint,
|
|
836
|
-
approvedByDeviceId:
|
|
1078
|
+
approvedByDeviceId: Id4,
|
|
837
1079
|
approvedAt: Instant2
|
|
838
1080
|
}).strict();
|
|
839
|
-
var trimmed = (max) =>
|
|
840
|
-
var PolicyModelClassification =
|
|
1081
|
+
var trimmed = (max) => z6.string().min(1).max(max).refine((s) => s.trim() === s);
|
|
1082
|
+
var PolicyModelClassification = z6.object({
|
|
841
1083
|
provider: trimmed(200),
|
|
842
1084
|
modelId: trimmed(512),
|
|
843
|
-
classification:
|
|
1085
|
+
classification: z6.enum(["cheap", "expensive"])
|
|
844
1086
|
}).strict();
|
|
845
|
-
var classifications =
|
|
846
|
-
var PolicySettings =
|
|
847
|
-
var toolInput =
|
|
848
|
-
var sampleIdentity = { sessionId:
|
|
849
|
-
var HostPolicySampleRequest =
|
|
850
|
-
var HostPolicySampleResult =
|
|
1087
|
+
var classifications = z6.array(PolicyModelClassification).max(1e3).refine((v) => new Set(v.map((x) => JSON.stringify([x.provider, x.modelId]))).size === v.length);
|
|
1088
|
+
var PolicySettings = z6.object({ revision: Revision, modelClassifications: classifications, updatedAt: Instant2 }).strict();
|
|
1089
|
+
var toolInput = z6.object({ name: Id4, args: JsonObject }).strict();
|
|
1090
|
+
var sampleIdentity = { sessionId: Id4, nativeSessionId: Id4, runtimeId: Id4, sampleId: Id4 };
|
|
1091
|
+
var HostPolicySampleRequest = z6.object({ ...sampleIdentity, tool: toolInput }).strict();
|
|
1092
|
+
var HostPolicySampleResult = z6.object({
|
|
851
1093
|
...sampleIdentity,
|
|
852
1094
|
toolHash: Fingerprint,
|
|
853
1095
|
boundary: HostPolicyBoundary,
|
|
854
|
-
defaultBranch:
|
|
1096
|
+
defaultBranch: z6.string().min(1).max(255).nullable(),
|
|
855
1097
|
safety: PolicyToolSafety
|
|
856
1098
|
}).strict();
|
|
857
|
-
var PolicyEvaluateRequest =
|
|
858
|
-
var PolicyStatusRequest =
|
|
859
|
-
var PolicyStatusResult =
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
1099
|
+
var PolicyEvaluateRequest = z6.object({ evaluationId: Id4, toolCallId: Id4, tool: toolInput }).strict();
|
|
1100
|
+
var PolicyStatusRequest = z6.object({ decisionId: Id4, waitMs: z6.literal(25e3) }).strict();
|
|
1101
|
+
var PolicyStatusResult = z6.discriminatedUnion("state", [
|
|
1102
|
+
z6.object({ state: z6.literal("pending") }).strict(),
|
|
1103
|
+
z6.object({ state: z6.literal("allowed") }).strict(),
|
|
1104
|
+
z6.object({ state: z6.literal("denied"), reason: Reason }).strict(),
|
|
1105
|
+
z6.object({ state: z6.literal("canceled"), reason: Reason }).strict()
|
|
864
1106
|
]);
|
|
865
|
-
var PolicyCancelRequest =
|
|
866
|
-
var PolicyCancelResult =
|
|
867
|
-
var PolicyTrace =
|
|
868
|
-
ruleId:
|
|
1107
|
+
var PolicyCancelRequest = z6.object({ decisionId: Id4 }).strict();
|
|
1108
|
+
var PolicyCancelResult = z6.object({ state: z6.enum(["canceled", "already_resolved"]) }).strict();
|
|
1109
|
+
var PolicyTrace = z6.object({
|
|
1110
|
+
ruleId: Id4,
|
|
869
1111
|
ruleRevision: Revision,
|
|
870
1112
|
...scopeShape,
|
|
871
1113
|
verdict: PolicyVerdict.nullable(),
|
|
872
1114
|
reason: Text.nullable(),
|
|
873
|
-
granted:
|
|
874
|
-
overridden:
|
|
1115
|
+
granted: z6.boolean(),
|
|
1116
|
+
overridden: z6.boolean(),
|
|
875
1117
|
proposedStateUpdates: PolicyCounterMap
|
|
876
1118
|
}).strict().refine(scopeValid);
|
|
877
|
-
var PolicyTestResult =
|
|
1119
|
+
var PolicyTestResult = z6.object({
|
|
878
1120
|
verdict: PolicyVerdict,
|
|
879
1121
|
reason: Text.nullable(),
|
|
880
|
-
trace:
|
|
881
|
-
proposedStateUpdates:
|
|
882
|
-
enforcement:
|
|
883
|
-
phases:
|
|
884
|
-
modelRequest:
|
|
885
|
-
explanation:
|
|
1122
|
+
trace: z6.array(PolicyTrace).max(128),
|
|
1123
|
+
proposedStateUpdates: z6.record(Id4, PolicyCounterMap),
|
|
1124
|
+
enforcement: z6.object({
|
|
1125
|
+
phases: z6.array(PolicyPhase),
|
|
1126
|
+
modelRequest: z6.literal(false),
|
|
1127
|
+
explanation: z6.string()
|
|
886
1128
|
}).strict()
|
|
887
1129
|
}).strict();
|
|
888
|
-
var CreatePolicyRuleRequest =
|
|
889
|
-
var UpdatePolicyRuleRequest =
|
|
1130
|
+
var CreatePolicyRuleRequest = z6.object({ ...scopeShape, ...ruleFields }).strict().refine(scopeValid);
|
|
1131
|
+
var UpdatePolicyRuleRequest = z6.object({
|
|
890
1132
|
expectedRevision: Revision,
|
|
891
1133
|
name: ruleFields.name.optional(),
|
|
892
1134
|
priority: ruleFields.priority.optional(),
|
|
893
|
-
enabled:
|
|
1135
|
+
enabled: z6.boolean().optional(),
|
|
894
1136
|
phases: phases.optional(),
|
|
895
1137
|
expression: ruleFields.expression.optional()
|
|
896
1138
|
}).strict().refine((v) => Object.keys(v).length > 1);
|
|
897
|
-
var DeletePolicyRuleQuery =
|
|
898
|
-
var UpdatePolicySettingsRequest =
|
|
899
|
-
var PolicyTestRequest =
|
|
900
|
-
sessionId:
|
|
1139
|
+
var DeletePolicyRuleQuery = z6.object({ expectedRevision: Revision }).strict();
|
|
1140
|
+
var UpdatePolicySettingsRequest = z6.object({ expectedRevision: Revision, modelClassifications: classifications }).strict();
|
|
1141
|
+
var PolicyTestRequest = z6.object({
|
|
1142
|
+
sessionId: Id4,
|
|
901
1143
|
phase: PolicyPhase,
|
|
902
1144
|
tool: toolInput.nullable(),
|
|
903
1145
|
request: PolicyRequestContext.nullable()
|
|
904
1146
|
}).strict().refine((v) => v.phase === "tool_call" ? v.tool !== null && v.request === null : v.tool === null && v.request !== null);
|
|
905
1147
|
|
|
1148
|
+
// packages/protocol/dist/tool-view.js
|
|
1149
|
+
import { z as z7 } from "zod";
|
|
1150
|
+
var TOOL_KINDS = ["read", "edit", "write", "command", "search", "other"];
|
|
1151
|
+
var ToolViewData = z7.object({
|
|
1152
|
+
kind: z7.enum(TOOL_KINDS).optional(),
|
|
1153
|
+
/** Finished: "Asked", "Updated todo". */
|
|
1154
|
+
verb: z7.string().min(1).max(40).optional(),
|
|
1155
|
+
/** Running: "Asking". Defaults to `verb`. */
|
|
1156
|
+
activeVerb: z7.string().min(1).max(40).optional(),
|
|
1157
|
+
/** What the call acted on, shown in mono. */
|
|
1158
|
+
target: z7.string().max(500).optional(),
|
|
1159
|
+
/** Short facts after the target ("3 items", "exit 1"). */
|
|
1160
|
+
meta: z7.array(z7.string().min(1).max(80)).max(6).optional(),
|
|
1161
|
+
/** Lines added and removed. */
|
|
1162
|
+
stat: z7.object({ added: z7.number().int().min(0), removed: z7.number().int().min(0) }).optional(),
|
|
1163
|
+
/** Shown when the row is opened, in place of the typed detail. No forms or confirms. */
|
|
1164
|
+
detail: UINodeSchema.optional(),
|
|
1165
|
+
/** Do not draw the row: a dock question or a tracker already stands for this call. */
|
|
1166
|
+
hide: z7.boolean().optional()
|
|
1167
|
+
});
|
|
1168
|
+
|
|
906
1169
|
// packages/protocol/dist/entities.js
|
|
907
|
-
var
|
|
908
|
-
var
|
|
909
|
-
var Connectivity =
|
|
910
|
-
var ControlMode =
|
|
911
|
-
var Platform =
|
|
912
|
-
var DeviceKind =
|
|
913
|
-
var DiagnosticLevel =
|
|
1170
|
+
var Iso2 = z8.string();
|
|
1171
|
+
var Id5 = z8.string();
|
|
1172
|
+
var Connectivity = z8.enum(["connected", "reconnecting", "unreachable"]);
|
|
1173
|
+
var ControlMode = z8.enum(["automation", "human"]);
|
|
1174
|
+
var Platform = z8.enum(["darwin", "linux"]);
|
|
1175
|
+
var DeviceKind = z8.enum(["browser", "pwa", "terminal", "cli"]);
|
|
1176
|
+
var DiagnosticLevel = z8.enum(["info", "warning", "error"]);
|
|
914
1177
|
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:
|
|
1178
|
+
var CoreCapabilities = z8.object({
|
|
1179
|
+
prompt: z8.boolean(),
|
|
1180
|
+
steer: z8.boolean(),
|
|
1181
|
+
followUp: z8.boolean(),
|
|
1182
|
+
abort: z8.boolean(),
|
|
1183
|
+
resume: z8.boolean(),
|
|
1184
|
+
rename: z8.boolean(),
|
|
1185
|
+
importInactive: z8.boolean(),
|
|
1186
|
+
extensionDialogs: z8.boolean(),
|
|
1187
|
+
customUi: z8.boolean(),
|
|
1188
|
+
widgetsText: z8.boolean(),
|
|
1189
|
+
widgetsComponent: z8.boolean(),
|
|
1190
|
+
tokenAccounting: z8.boolean(),
|
|
1191
|
+
costAccounting: z8.boolean()
|
|
929
1192
|
});
|
|
930
1193
|
var CAPABILITY_KEYS = CoreCapabilities.keyof().options;
|
|
931
1194
|
var RuntimeCapabilities = CoreCapabilities.extend({
|
|
932
1195
|
/** The host runs sessions as interactive Pi in a terminal that clients can attach to. */
|
|
933
|
-
terminal:
|
|
1196
|
+
terminal: z8.boolean().optional(),
|
|
934
1197
|
/** The host answers session.models, session.commands, session.setModel, session.setThinking and session.compact. */
|
|
935
|
-
sessionControls:
|
|
1198
|
+
sessionControls: z8.boolean().optional(),
|
|
936
1199
|
/** The host answers session.navigate for terminal sessions. */
|
|
937
|
-
treeNavigation:
|
|
938
|
-
agentRequests:
|
|
939
|
-
messageDelivery:
|
|
940
|
-
policies:
|
|
1200
|
+
treeNavigation: z8.boolean().optional(),
|
|
1201
|
+
agentRequests: z8.boolean().optional(),
|
|
1202
|
+
messageDelivery: z8.boolean().optional(),
|
|
1203
|
+
policies: z8.boolean().optional(),
|
|
941
1204
|
/** Session-scoped adapter inspection and safe reload. */
|
|
942
|
-
adapterDevelopment:
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
1205
|
+
adapterDevelopment: z8.boolean().optional(),
|
|
1206
|
+
/** The host answers session.clearQueue (Edit queue). */
|
|
1207
|
+
queueEdit: z8.boolean().optional(),
|
|
1208
|
+
unsupported: z8.array(z8.object({ capability: z8.string(), reason: z8.string() }))
|
|
1209
|
+
});
|
|
1210
|
+
var ProjectScan = z8.object({
|
|
1211
|
+
state: z8.enum(["running", "done", "failed"]),
|
|
1212
|
+
startedAt: Iso2,
|
|
1213
|
+
finishedAt: Iso2.nullable(),
|
|
949
1214
|
/** Repositories found across all folders. */
|
|
950
|
-
repositories:
|
|
1215
|
+
repositories: z8.number().int(),
|
|
951
1216
|
/** New projects created by this scan. */
|
|
952
|
-
projectsCreated:
|
|
1217
|
+
projectsCreated: z8.number().int(),
|
|
953
1218
|
/** New checkouts (including the ones of new projects). */
|
|
954
|
-
checkoutsAdded:
|
|
1219
|
+
checkoutsAdded: z8.number().int(),
|
|
955
1220
|
/** "<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:
|
|
1221
|
+
errors: z8.array(z8.string())
|
|
1222
|
+
});
|
|
1223
|
+
var UsageWindow = z8.object({
|
|
1224
|
+
id: z8.enum(["five_hour", "weekly"]),
|
|
1225
|
+
usedPct: z8.number(),
|
|
1226
|
+
resetsAt: Iso2.nullable()
|
|
1227
|
+
});
|
|
1228
|
+
var ProviderUsage = z8.object({
|
|
1229
|
+
provider: z8.enum(["anthropic", "openai-codex"]),
|
|
1230
|
+
status: z8.enum(["available", "expired", "rejected", "error"]),
|
|
1231
|
+
message: z8.string().nullable(),
|
|
1232
|
+
windows: z8.array(UsageWindow),
|
|
1233
|
+
fetchedAt: Iso2
|
|
1234
|
+
});
|
|
1235
|
+
var Host = z8.object({
|
|
1236
|
+
id: Id5,
|
|
1237
|
+
name: z8.string(),
|
|
973
1238
|
platform: Platform,
|
|
974
|
-
agentVersion:
|
|
975
|
-
piVersion:
|
|
976
|
-
piCompatible:
|
|
1239
|
+
agentVersion: z8.string(),
|
|
1240
|
+
piVersion: z8.string().nullable(),
|
|
1241
|
+
piCompatible: z8.boolean(),
|
|
977
1242
|
capabilities: RuntimeCapabilities.nullable(),
|
|
978
1243
|
connectivity: Connectivity,
|
|
979
|
-
lastSeenAt:
|
|
980
|
-
revokedAt:
|
|
981
|
-
createdAt:
|
|
1244
|
+
lastSeenAt: Iso2.nullable(),
|
|
1245
|
+
revokedAt: Iso2.nullable(),
|
|
1246
|
+
createdAt: Iso2,
|
|
982
1247
|
/** Folders on the host whose git repositories become projects (absolute or ~/...). */
|
|
983
|
-
projectFolders:
|
|
1248
|
+
projectFolders: z8.array(z8.string()).optional(),
|
|
984
1249
|
projectScan: ProjectScan.nullable().optional(),
|
|
985
1250
|
/** Subscription limits (host-reported, refreshed every few minutes). */
|
|
986
|
-
usage:
|
|
1251
|
+
usage: z8.array(ProviderUsage).optional(),
|
|
987
1252
|
github: HostGitHub.optional()
|
|
988
1253
|
});
|
|
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:
|
|
1254
|
+
var WorktreeDir = z8.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");
|
|
1255
|
+
var Project = z8.object({
|
|
1256
|
+
id: Id5,
|
|
1257
|
+
name: z8.string().min(1),
|
|
1258
|
+
repoIdentity: z8.string(),
|
|
1259
|
+
defaultProfileId: Id5.nullable(),
|
|
1260
|
+
defaultHostId: Id5.nullable(),
|
|
1261
|
+
maxConcurrentRuns: z8.number().int().min(1).max(32),
|
|
1262
|
+
automationEnabled: z8.boolean(),
|
|
1263
|
+
setupCommand: z8.string().nullable(),
|
|
1264
|
+
checks: z8.array(z8.string()),
|
|
1265
|
+
workspaceSharing: z8.enum(["single_writer", "shared"]),
|
|
1001
1266
|
worktreeDir: WorktreeDir.default(DEFAULT_WORKTREE_DIR),
|
|
1002
1267
|
/** Start one session in every non-main worktree the first time it appears without one. */
|
|
1003
|
-
ensureSessions:
|
|
1268
|
+
ensureSessions: z8.boolean().default(false),
|
|
1004
1269
|
/** Archive sessions and remove a worktree (and its local branch) once its PR has merged. */
|
|
1005
|
-
removeLanded:
|
|
1006
|
-
createdAt:
|
|
1007
|
-
updatedAt:
|
|
1270
|
+
removeLanded: z8.boolean().default(false),
|
|
1271
|
+
createdAt: Iso2,
|
|
1272
|
+
updatedAt: Iso2
|
|
1008
1273
|
});
|
|
1009
|
-
var Checkout =
|
|
1010
|
-
id:
|
|
1011
|
-
projectId:
|
|
1012
|
-
hostId:
|
|
1013
|
-
path:
|
|
1014
|
-
commonDir:
|
|
1015
|
-
defaultBranch:
|
|
1016
|
-
createdAt:
|
|
1017
|
-
});
|
|
1018
|
-
var GitState =
|
|
1019
|
-
dirty:
|
|
1020
|
-
changedFiles:
|
|
1021
|
-
ahead:
|
|
1022
|
-
behind:
|
|
1023
|
-
unmerged:
|
|
1274
|
+
var Checkout = z8.object({
|
|
1275
|
+
id: Id5,
|
|
1276
|
+
projectId: Id5,
|
|
1277
|
+
hostId: Id5,
|
|
1278
|
+
path: z8.string(),
|
|
1279
|
+
commonDir: z8.string(),
|
|
1280
|
+
defaultBranch: z8.string(),
|
|
1281
|
+
createdAt: Iso2
|
|
1282
|
+
});
|
|
1283
|
+
var GitState = z8.object({
|
|
1284
|
+
dirty: z8.boolean(),
|
|
1285
|
+
changedFiles: z8.number().int(),
|
|
1286
|
+
ahead: z8.number().int(),
|
|
1287
|
+
behind: z8.number().int(),
|
|
1288
|
+
unmerged: z8.boolean(),
|
|
1024
1289
|
/** HEAD commit; absent from older hosts. */
|
|
1025
|
-
head:
|
|
1026
|
-
});
|
|
1027
|
-
var Workspace =
|
|
1028
|
-
id:
|
|
1029
|
-
checkoutId:
|
|
1030
|
-
projectId:
|
|
1031
|
-
hostId:
|
|
1032
|
-
path:
|
|
1033
|
-
branch:
|
|
1034
|
-
baseBranch:
|
|
1035
|
-
provenance:
|
|
1290
|
+
head: z8.string().regex(/^[0-9a-f]{40}$/).optional()
|
|
1291
|
+
});
|
|
1292
|
+
var Workspace = z8.object({
|
|
1293
|
+
id: Id5,
|
|
1294
|
+
checkoutId: Id5,
|
|
1295
|
+
projectId: Id5,
|
|
1296
|
+
hostId: Id5,
|
|
1297
|
+
path: z8.string(),
|
|
1298
|
+
branch: z8.string().nullable(),
|
|
1299
|
+
baseBranch: z8.string().nullable(),
|
|
1300
|
+
provenance: z8.enum(["managed", "discovered", "main"]),
|
|
1036
1301
|
git: GitState,
|
|
1037
|
-
setup:
|
|
1038
|
-
state:
|
|
1039
|
-
log:
|
|
1302
|
+
setup: z8.object({
|
|
1303
|
+
state: z8.enum(["none", "running", "succeeded", "failed"]),
|
|
1304
|
+
log: z8.string()
|
|
1040
1305
|
}),
|
|
1041
|
-
archivedAt:
|
|
1042
|
-
updatedAt:
|
|
1306
|
+
archivedAt: Iso2.nullable(),
|
|
1307
|
+
updatedAt: Iso2,
|
|
1043
1308
|
github: WorkspaceGitHub.optional()
|
|
1044
1309
|
});
|
|
1045
|
-
var ThinkingLevel =
|
|
1046
|
-
var SessionModel =
|
|
1047
|
-
provider:
|
|
1048
|
-
id:
|
|
1049
|
-
name:
|
|
1050
|
-
contextWindow:
|
|
1051
|
-
reasoning:
|
|
1310
|
+
var ThinkingLevel = z8.enum(["off", "minimal", "low", "medium", "high", "xhigh", "max"]);
|
|
1311
|
+
var SessionModel = z8.object({
|
|
1312
|
+
provider: z8.string(),
|
|
1313
|
+
id: z8.string(),
|
|
1314
|
+
name: z8.string().nullable(),
|
|
1315
|
+
contextWindow: z8.number().nullable(),
|
|
1316
|
+
reasoning: z8.boolean(),
|
|
1052
1317
|
/** In Pi's scoped (favorite) model list; set only when Pi has one. */
|
|
1053
|
-
scoped:
|
|
1318
|
+
scoped: z8.boolean().optional(),
|
|
1054
1319
|
/** Effort levels this model accepts, in Pi's order; ["off"] without reasoning. */
|
|
1055
|
-
thinkingLevels:
|
|
1320
|
+
thinkingLevels: z8.array(ThinkingLevel),
|
|
1056
1321
|
/** Prompt-cache lifetimes in seconds from Pi's model metadata. */
|
|
1057
|
-
promptCache:
|
|
1322
|
+
promptCache: z8.object({ short: z8.number().optional(), long: z8.number().optional() }).nullable().optional()
|
|
1058
1323
|
});
|
|
1059
|
-
var SlashCommand =
|
|
1060
|
-
name:
|
|
1061
|
-
description:
|
|
1062
|
-
source:
|
|
1063
|
-
argumentHint:
|
|
1324
|
+
var SlashCommand = z8.object({
|
|
1325
|
+
name: z8.string().min(1),
|
|
1326
|
+
description: z8.string().nullable(),
|
|
1327
|
+
source: z8.enum(["extension", "prompt", "skill"]),
|
|
1328
|
+
argumentHint: z8.string().nullable().optional()
|
|
1064
1329
|
});
|
|
1065
|
-
var ContextUsage =
|
|
1330
|
+
var ContextUsage = z8.object({
|
|
1066
1331
|
/** Estimated tokens in context; null right after compaction until the next reply. */
|
|
1067
|
-
tokens:
|
|
1068
|
-
window:
|
|
1069
|
-
percent:
|
|
1332
|
+
tokens: z8.number().nullable(),
|
|
1333
|
+
window: z8.number(),
|
|
1334
|
+
percent: z8.number().nullable()
|
|
1070
1335
|
});
|
|
1071
1336
|
var FORBIDDEN_EXTRA_ARGS = ["--mode", "--fork", "--no-session", "-e", "--extension"];
|
|
1072
|
-
var ExtraArg =
|
|
1073
|
-
var Profile =
|
|
1074
|
-
id:
|
|
1075
|
-
name:
|
|
1076
|
-
provider:
|
|
1077
|
-
model:
|
|
1337
|
+
var ExtraArg = z8.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");
|
|
1338
|
+
var Profile = z8.object({
|
|
1339
|
+
id: Id5,
|
|
1340
|
+
name: z8.string().min(1),
|
|
1341
|
+
provider: z8.string().nullable(),
|
|
1342
|
+
model: z8.string().nullable(),
|
|
1078
1343
|
thinking: ThinkingLevel.nullable(),
|
|
1079
|
-
projectTrust:
|
|
1080
|
-
extraArgs:
|
|
1344
|
+
projectTrust: z8.enum(["ask", "approve", "ignore"]),
|
|
1345
|
+
extraArgs: z8.array(ExtraArg),
|
|
1081
1346
|
/** "vanilla": --no-extensions --no-skills --no-prompt-templates. Undefined means "all". */
|
|
1082
|
-
resources:
|
|
1083
|
-
});
|
|
1084
|
-
var
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
mode: z6.enum(["all", "pinned"]),
|
|
1096
|
-
projectIds: z6.array(z6.string()).nullable(),
|
|
1097
|
-
hostIds: z6.array(z6.string()).nullable(),
|
|
1098
|
-
sessionIds: z6.array(z6.string()),
|
|
1099
|
-
/** Deprecated: always empty; see Terminal. */
|
|
1100
|
-
clients: z6.array(ViewClient).default([]),
|
|
1101
|
-
/** A tracker keeps this view's projects (see docs/trackers.md). */
|
|
1102
|
-
trackerId: z6.string().nullable().optional(),
|
|
1103
|
-
createdAt: Iso,
|
|
1104
|
-
updatedAt: Iso
|
|
1347
|
+
resources: z8.enum(["all", "vanilla"]).optional()
|
|
1348
|
+
});
|
|
1349
|
+
var Scope = z8.object({
|
|
1350
|
+
id: Id5,
|
|
1351
|
+
name: z8.string().min(1).max(60),
|
|
1352
|
+
mode: z8.enum(["all", "pinned"]),
|
|
1353
|
+
projectIds: z8.array(z8.string()).nullable(),
|
|
1354
|
+
hostIds: z8.array(z8.string()).nullable(),
|
|
1355
|
+
sessionIds: z8.array(z8.string()),
|
|
1356
|
+
/** What feeds this scope its issues; null for a scope of projects you choose. */
|
|
1357
|
+
source: GitHubSource.nullable(),
|
|
1358
|
+
createdAt: Iso2,
|
|
1359
|
+
updatedAt: Iso2
|
|
1105
1360
|
});
|
|
1106
|
-
var
|
|
1107
|
-
var
|
|
1108
|
-
var
|
|
1361
|
+
var ClientKind = z8.string().regex(/^[a-z][a-z0-9-]{0,31}$/);
|
|
1362
|
+
var ClientMirror = z8.enum(["none", "all", "scope"]);
|
|
1363
|
+
var Client = z8.object({
|
|
1109
1364
|
/** `${kind}:${name}@${machine}` */
|
|
1110
|
-
id:
|
|
1111
|
-
kind:
|
|
1112
|
-
name:
|
|
1113
|
-
machine:
|
|
1114
|
-
deviceId:
|
|
1115
|
-
hostId:
|
|
1116
|
-
/** What it mirrors (coordinator-owned)
|
|
1117
|
-
mirror:
|
|
1118
|
-
/** The
|
|
1119
|
-
|
|
1365
|
+
id: z8.string().min(1).max(200),
|
|
1366
|
+
kind: ClientKind,
|
|
1367
|
+
name: z8.string().min(1),
|
|
1368
|
+
machine: z8.string().min(1),
|
|
1369
|
+
deviceId: Id5,
|
|
1370
|
+
hostId: Id5.nullable(),
|
|
1371
|
+
/** What it mirrors (coordinator-owned). */
|
|
1372
|
+
mirror: ClientMirror,
|
|
1373
|
+
/** The scope it mirrors when `mirror` is "scope" (coordinator-owned). */
|
|
1374
|
+
scopeId: Id5.nullable(),
|
|
1120
1375
|
/** When the binding was recorded; null when it never was (a daemon may seed it once). */
|
|
1121
|
-
bindingSetAt:
|
|
1376
|
+
bindingSetAt: Iso2.nullable().optional(),
|
|
1122
1377
|
/** Sessions it shows in mirror tabs or windows now (daemon-owned). */
|
|
1123
|
-
shows:
|
|
1124
|
-
lastSeenAt:
|
|
1125
|
-
createdAt:
|
|
1378
|
+
shows: z8.array(Id5).max(1e3).optional(),
|
|
1379
|
+
lastSeenAt: Iso2,
|
|
1380
|
+
createdAt: Iso2
|
|
1126
1381
|
});
|
|
1127
|
-
var RuntimeState =
|
|
1382
|
+
var RuntimeState = z8.enum([
|
|
1128
1383
|
"starting",
|
|
1129
1384
|
"idle",
|
|
1130
1385
|
"running",
|
|
@@ -1133,160 +1388,161 @@ var RuntimeState = z6.enum([
|
|
|
1133
1388
|
"failed",
|
|
1134
1389
|
"stopped"
|
|
1135
1390
|
]);
|
|
1136
|
-
var NativeHandle =
|
|
1137
|
-
var SessionStats =
|
|
1138
|
-
tokens:
|
|
1139
|
-
costUsd:
|
|
1391
|
+
var NativeHandle = z8.object({ sessionId: z8.string(), sessionFile: z8.string() });
|
|
1392
|
+
var SessionStats = z8.object({
|
|
1393
|
+
tokens: z8.number().nullable(),
|
|
1394
|
+
costUsd: z8.number().nullable(),
|
|
1140
1395
|
/** Completed usage, refreshed for this exact settlement; absent on older hosts or failure. */
|
|
1141
1396
|
watermark: CompletedUsageWatermark.optional(),
|
|
1142
1397
|
context: ContextUsage.nullable().optional()
|
|
1143
1398
|
});
|
|
1144
|
-
var PromptCacheInfo =
|
|
1145
|
-
at:
|
|
1146
|
-
provider:
|
|
1147
|
-
model:
|
|
1148
|
-
cacheRead:
|
|
1149
|
-
cacheWrite:
|
|
1150
|
-
cacheWrite1h:
|
|
1151
|
-
});
|
|
1152
|
-
var Session =
|
|
1153
|
-
id:
|
|
1154
|
-
title:
|
|
1155
|
-
subtitle:
|
|
1156
|
-
hostId:
|
|
1157
|
-
workspaceId:
|
|
1158
|
-
projectId:
|
|
1159
|
-
cwd:
|
|
1399
|
+
var PromptCacheInfo = z8.object({
|
|
1400
|
+
at: Iso2,
|
|
1401
|
+
provider: z8.string(),
|
|
1402
|
+
model: z8.string(),
|
|
1403
|
+
cacheRead: z8.number(),
|
|
1404
|
+
cacheWrite: z8.number(),
|
|
1405
|
+
cacheWrite1h: z8.number()
|
|
1406
|
+
});
|
|
1407
|
+
var Session = z8.object({
|
|
1408
|
+
id: Id5,
|
|
1409
|
+
title: z8.string(),
|
|
1410
|
+
subtitle: z8.string().nullable(),
|
|
1411
|
+
hostId: Id5,
|
|
1412
|
+
workspaceId: Id5.nullable(),
|
|
1413
|
+
projectId: Id5.nullable(),
|
|
1414
|
+
cwd: z8.string(),
|
|
1160
1415
|
nativeHandle: NativeHandle.nullable(),
|
|
1161
1416
|
profileSnapshot: Profile,
|
|
1162
1417
|
runtime: RuntimeState,
|
|
1163
|
-
runtimeDetail:
|
|
1418
|
+
runtimeDetail: z8.string().nullable(),
|
|
1164
1419
|
connectivity: Connectivity,
|
|
1165
|
-
runId:
|
|
1166
|
-
taskId:
|
|
1167
|
-
provenance:
|
|
1168
|
-
readOnly:
|
|
1169
|
-
lastActivityAt:
|
|
1170
|
-
archivedAt:
|
|
1171
|
-
queue:
|
|
1420
|
+
runId: Id5.nullable(),
|
|
1421
|
+
taskId: Id5.nullable(),
|
|
1422
|
+
provenance: z8.enum(["created", "imported", "subagent"]),
|
|
1423
|
+
readOnly: z8.boolean(),
|
|
1424
|
+
lastActivityAt: Iso2,
|
|
1425
|
+
archivedAt: Iso2.nullable(),
|
|
1426
|
+
queue: z8.object({ steering: z8.array(z8.string()), followUp: z8.array(z8.string()) }),
|
|
1172
1427
|
stats: SessionStats.nullable(),
|
|
1173
1428
|
/** The live model (host-owned; last known when stopped). */
|
|
1174
1429
|
model: SessionModel.nullable().optional(),
|
|
1175
1430
|
/** The live effort (Pi's thinking level). */
|
|
1176
1431
|
thinking: ThinkingLevel.nullable().optional(),
|
|
1177
1432
|
/** Pi is compacting the context. */
|
|
1178
|
-
compacting:
|
|
1179
|
-
lastAssistantText:
|
|
1180
|
-
createdAt:
|
|
1433
|
+
compacting: z8.boolean().optional(),
|
|
1434
|
+
lastAssistantText: z8.string().nullable(),
|
|
1435
|
+
createdAt: Iso2,
|
|
1181
1436
|
/** A live terminal session: `switchyard tui` can attach to its Pi terminal. */
|
|
1182
|
-
terminal:
|
|
1437
|
+
terminal: z8.boolean().optional(),
|
|
1183
1438
|
/**
|
|
1184
|
-
* A Pi the user started in their own terminal and enrolled (`client`: the
|
|
1185
|
-
* in, when known). Switchyard never shows or closes that terminal.
|
|
1439
|
+
* A Pi the user started in their own terminal and enrolled (`client`: the id of the herdr or
|
|
1440
|
+
* tmux client it runs in, when known). Switchyard never shows or closes that terminal.
|
|
1186
1441
|
*/
|
|
1187
|
-
external:
|
|
1442
|
+
external: z8.object({ client: z8.string().min(1).max(200).nullable() }).nullable().optional(),
|
|
1188
1443
|
/**
|
|
1189
|
-
* Where this Pi last ran by hand (host-owned): the
|
|
1190
|
-
* and pane. Kept after it stops; cleared once
|
|
1444
|
+
* Where this Pi last ran by hand (host-owned): the client (`herdr:<s>@<m>`, `tmux:<s>@<m>`;
|
|
1445
|
+
* the wire field keeps the name `terminalId`) and pane. Kept after it stops; cleared once
|
|
1446
|
+
* Switchyard starts it. Older hosts omit it.
|
|
1191
1447
|
*/
|
|
1192
|
-
place:
|
|
1193
|
-
terminalId:
|
|
1194
|
-
pane:
|
|
1448
|
+
place: z8.object({
|
|
1449
|
+
terminalId: z8.string().min(1).max(200),
|
|
1450
|
+
pane: z8.string().min(1).max(200).nullable()
|
|
1195
1451
|
}).nullable().optional(),
|
|
1196
1452
|
/** The session this subagent was started by (coordinator-owned). */
|
|
1197
|
-
parentSessionId:
|
|
1453
|
+
parentSessionId: Id5.nullable().optional(),
|
|
1198
1454
|
/** Chosen as its branch's primary session (coordinator-owned); without one the primary is derived. */
|
|
1199
|
-
primary:
|
|
1455
|
+
primary: z8.boolean().optional(),
|
|
1200
1456
|
/** Set when the session finished or failed with nobody viewing it; cleared when viewed (coordinator-owned). */
|
|
1201
|
-
unreadSince:
|
|
1457
|
+
unreadSince: Iso2.nullable().optional(),
|
|
1202
1458
|
/** Identity of the adapter presentation currently installed on the host. */
|
|
1203
|
-
adapterGeneration:
|
|
1459
|
+
adapterGeneration: z8.string().uuid().optional(),
|
|
1204
1460
|
/** Bumped when the transcript is rebuilt (rewind); clients drop cached copies (coordinator-owned). */
|
|
1205
|
-
transcriptEpoch:
|
|
1206
|
-
bridge:
|
|
1207
|
-
version:
|
|
1208
|
-
runtimeId:
|
|
1209
|
-
nativeSessionId:
|
|
1461
|
+
transcriptEpoch: z8.number().int().min(0).optional(),
|
|
1462
|
+
bridge: z8.object({
|
|
1463
|
+
version: z8.literal(1),
|
|
1464
|
+
runtimeId: Id5,
|
|
1465
|
+
nativeSessionId: Id5,
|
|
1210
1466
|
/** Host-generated local-controller identity, not Pi's private binding credential. */
|
|
1211
|
-
controllerEpoch:
|
|
1212
|
-
agentTools:
|
|
1213
|
-
messageDelivery:
|
|
1214
|
-
policyState:
|
|
1215
|
-
policyPhases:
|
|
1467
|
+
controllerEpoch: Id5.optional(),
|
|
1468
|
+
agentTools: z8.boolean(),
|
|
1469
|
+
messageDelivery: z8.boolean(),
|
|
1470
|
+
policyState: z8.enum(["initializing", "active", "unsupported", "lost"]),
|
|
1471
|
+
policyPhases: z8.array(PolicyPhase)
|
|
1216
1472
|
}).optional(),
|
|
1217
1473
|
/** Last assistant message's cache usage (host-owned). */
|
|
1218
1474
|
promptCache: PromptCacheInfo.nullable().optional(),
|
|
1219
1475
|
/** Warn before the prompt cache expires; non-null means on (coordinator-owned). */
|
|
1220
|
-
cacheAlert:
|
|
1221
|
-
});
|
|
1222
|
-
var ContinuationPolicy =
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
enabled:
|
|
1226
|
-
objective:
|
|
1227
|
-
maxContinuations:
|
|
1228
|
-
maxElapsedMinutes:
|
|
1229
|
-
maxTokens:
|
|
1230
|
-
maxCostUsd:
|
|
1476
|
+
cacheAlert: z8.object({ ttlSec: z8.number().int().min(60).max(86400).nullable(), warnedFor: Iso2.nullable() }).nullable().optional()
|
|
1477
|
+
});
|
|
1478
|
+
var ContinuationPolicy = z8.discriminatedUnion("enabled", [
|
|
1479
|
+
z8.object({ enabled: z8.literal(false) }),
|
|
1480
|
+
z8.object({
|
|
1481
|
+
enabled: z8.literal(true),
|
|
1482
|
+
objective: z8.string().min(1),
|
|
1483
|
+
maxContinuations: z8.number().int().min(1).max(50),
|
|
1484
|
+
maxElapsedMinutes: z8.number().int().min(1).max(1440),
|
|
1485
|
+
maxTokens: z8.number().int().positive().nullable(),
|
|
1486
|
+
maxCostUsd: z8.number().positive().nullable()
|
|
1231
1487
|
})
|
|
1232
1488
|
]);
|
|
1233
|
-
var CompletionPolicy =
|
|
1234
|
-
checks:
|
|
1235
|
-
requireHumanReview:
|
|
1236
|
-
});
|
|
1237
|
-
var WorkspacePolicy =
|
|
1238
|
-
|
|
1239
|
-
mode:
|
|
1240
|
-
branch:
|
|
1241
|
-
base:
|
|
1489
|
+
var CompletionPolicy = z8.object({
|
|
1490
|
+
checks: z8.array(z8.string()).nullable(),
|
|
1491
|
+
requireHumanReview: z8.boolean()
|
|
1492
|
+
});
|
|
1493
|
+
var WorkspacePolicy = z8.discriminatedUnion("mode", [
|
|
1494
|
+
z8.object({
|
|
1495
|
+
mode: z8.literal("new_worktree"),
|
|
1496
|
+
branch: z8.string().nullable(),
|
|
1497
|
+
base: z8.string().nullable()
|
|
1242
1498
|
}),
|
|
1243
|
-
|
|
1499
|
+
z8.object({ mode: z8.literal("existing"), workspaceId: Id5 })
|
|
1244
1500
|
]);
|
|
1245
|
-
var TaskPolicy =
|
|
1246
|
-
hostId:
|
|
1247
|
-
profileId:
|
|
1501
|
+
var TaskPolicy = z8.object({
|
|
1502
|
+
hostId: Id5.nullable(),
|
|
1503
|
+
profileId: Id5.nullable(),
|
|
1248
1504
|
workspace: WorkspacePolicy,
|
|
1249
1505
|
continuation: ContinuationPolicy,
|
|
1250
1506
|
completion: CompletionPolicy
|
|
1251
1507
|
});
|
|
1252
|
-
var TaskState =
|
|
1253
|
-
var Priority =
|
|
1254
|
-
var TaskOrigin =
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
kind:
|
|
1258
|
-
automationId:
|
|
1259
|
-
occurrenceId:
|
|
1260
|
-
routine:
|
|
1508
|
+
var TaskState = z8.enum(["backlog", "ready", "in_progress", "review", "done", "canceled"]);
|
|
1509
|
+
var Priority = z8.union([z8.literal(0), z8.literal(1), z8.literal(2), z8.literal(3)]);
|
|
1510
|
+
var TaskOrigin = z8.discriminatedUnion("kind", [
|
|
1511
|
+
z8.object({ kind: z8.literal("manual") }),
|
|
1512
|
+
z8.object({
|
|
1513
|
+
kind: z8.literal("automation"),
|
|
1514
|
+
automationId: Id5,
|
|
1515
|
+
occurrenceId: Id5,
|
|
1516
|
+
routine: z8.boolean()
|
|
1261
1517
|
})
|
|
1262
1518
|
]);
|
|
1263
|
-
var Task =
|
|
1264
|
-
id:
|
|
1265
|
-
projectId:
|
|
1266
|
-
title:
|
|
1267
|
-
objective:
|
|
1268
|
-
acceptanceCriteria:
|
|
1269
|
-
dependencies:
|
|
1519
|
+
var Task = z8.object({
|
|
1520
|
+
id: Id5,
|
|
1521
|
+
projectId: Id5,
|
|
1522
|
+
title: z8.string().min(1),
|
|
1523
|
+
objective: z8.string(),
|
|
1524
|
+
acceptanceCriteria: z8.array(z8.string()),
|
|
1525
|
+
dependencies: z8.array(Id5),
|
|
1270
1526
|
priority: Priority,
|
|
1271
|
-
position:
|
|
1527
|
+
position: z8.number(),
|
|
1272
1528
|
state: TaskState,
|
|
1273
|
-
blocked:
|
|
1274
|
-
notBefore:
|
|
1529
|
+
blocked: z8.object({ reason: z8.string() }).nullable(),
|
|
1530
|
+
notBefore: Iso2.nullable(),
|
|
1275
1531
|
policy: TaskPolicy,
|
|
1276
1532
|
origin: TaskOrigin,
|
|
1277
|
-
groupingKey:
|
|
1278
|
-
parentTaskId:
|
|
1279
|
-
agentOrigin:
|
|
1533
|
+
groupingKey: z8.string().nullable(),
|
|
1534
|
+
parentTaskId: Id5.nullable().optional(),
|
|
1535
|
+
agentOrigin: z8.object({ sessionId: Id5, toolCallId: Id5 }).optional(),
|
|
1280
1536
|
githubIssue: GitHubIssue.optional(),
|
|
1281
|
-
currentRunId:
|
|
1282
|
-
sessionId:
|
|
1283
|
-
review:
|
|
1284
|
-
hiddenFromBoard:
|
|
1285
|
-
lastActivityAt:
|
|
1286
|
-
createdAt:
|
|
1287
|
-
updatedAt:
|
|
1537
|
+
currentRunId: Id5.nullable(),
|
|
1538
|
+
sessionId: Id5.nullable(),
|
|
1539
|
+
review: z8.object({ feedback: z8.array(z8.string()), changesRequested: z8.boolean() }),
|
|
1540
|
+
hiddenFromBoard: z8.boolean(),
|
|
1541
|
+
lastActivityAt: Iso2,
|
|
1542
|
+
createdAt: Iso2,
|
|
1543
|
+
updatedAt: Iso2
|
|
1288
1544
|
});
|
|
1289
|
-
var RunState =
|
|
1545
|
+
var RunState = z8.enum([
|
|
1290
1546
|
"queued",
|
|
1291
1547
|
"dispatching",
|
|
1292
1548
|
"uncertain",
|
|
@@ -1298,79 +1554,79 @@ var RunState = z6.enum([
|
|
|
1298
1554
|
"interrupted",
|
|
1299
1555
|
"canceled"
|
|
1300
1556
|
]);
|
|
1301
|
-
var CheckResult =
|
|
1302
|
-
command:
|
|
1303
|
-
exitCode:
|
|
1304
|
-
outputTail:
|
|
1305
|
-
});
|
|
1306
|
-
var Run =
|
|
1307
|
-
id:
|
|
1308
|
-
taskId:
|
|
1309
|
-
sessionId:
|
|
1310
|
-
hostId:
|
|
1311
|
-
dispatchKey:
|
|
1312
|
-
attempt:
|
|
1557
|
+
var CheckResult = z8.object({
|
|
1558
|
+
command: z8.string(),
|
|
1559
|
+
exitCode: z8.number().int().nullable(),
|
|
1560
|
+
outputTail: z8.string()
|
|
1561
|
+
});
|
|
1562
|
+
var Run = z8.object({
|
|
1563
|
+
id: Id5,
|
|
1564
|
+
taskId: Id5,
|
|
1565
|
+
sessionId: Id5.nullable(),
|
|
1566
|
+
hostId: Id5.nullable(),
|
|
1567
|
+
dispatchKey: z8.string(),
|
|
1568
|
+
attempt: z8.number().int().min(1),
|
|
1313
1569
|
state: RunState,
|
|
1314
1570
|
controlMode: ControlMode,
|
|
1315
|
-
controlRevision:
|
|
1316
|
-
continuationsUsed:
|
|
1317
|
-
infraRetries:
|
|
1318
|
-
nextAttemptAt:
|
|
1319
|
-
startedAt:
|
|
1320
|
-
endedAt:
|
|
1321
|
-
outcome:
|
|
1322
|
-
kind:
|
|
1323
|
-
summary:
|
|
1571
|
+
controlRevision: z8.number().int().min(1),
|
|
1572
|
+
continuationsUsed: z8.number().int().min(0),
|
|
1573
|
+
infraRetries: z8.number().int().min(0),
|
|
1574
|
+
nextAttemptAt: Iso2.nullable(),
|
|
1575
|
+
startedAt: Iso2.nullable(),
|
|
1576
|
+
endedAt: Iso2.nullable(),
|
|
1577
|
+
outcome: z8.object({
|
|
1578
|
+
kind: z8.enum(["review", "failed", "blocked", "no_change", "canceled"]),
|
|
1579
|
+
summary: z8.string()
|
|
1324
1580
|
}).nullable(),
|
|
1325
1581
|
limits: ContinuationPolicy,
|
|
1326
|
-
usage:
|
|
1327
|
-
tokens:
|
|
1328
|
-
costUsd:
|
|
1329
|
-
accounting:
|
|
1330
|
-
note:
|
|
1582
|
+
usage: z8.object({
|
|
1583
|
+
tokens: z8.number().nullable(),
|
|
1584
|
+
costUsd: z8.number().nullable(),
|
|
1585
|
+
accounting: z8.enum(["available", "unavailable"]),
|
|
1586
|
+
note: z8.string().nullable()
|
|
1331
1587
|
}),
|
|
1332
|
-
checks:
|
|
1333
|
-
createdAt:
|
|
1334
|
-
updatedAt:
|
|
1588
|
+
checks: z8.array(CheckResult),
|
|
1589
|
+
createdAt: Iso2,
|
|
1590
|
+
updatedAt: Iso2
|
|
1335
1591
|
});
|
|
1336
|
-
var Trigger =
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1592
|
+
var Trigger = z8.discriminatedUnion("kind", [
|
|
1593
|
+
z8.object({ kind: z8.literal("manual") }),
|
|
1594
|
+
z8.object({ kind: z8.literal("once"), at: Iso2 }),
|
|
1595
|
+
z8.object({ kind: z8.literal("cron"), expr: z8.string().min(1), timezone: z8.string().min(1) }),
|
|
1596
|
+
z8.object({ kind: z8.literal("webhook") }),
|
|
1597
|
+
z8.object({ kind: z8.literal("dependency"), taskId: Id5 })
|
|
1342
1598
|
]);
|
|
1343
|
-
var TaskTemplate =
|
|
1344
|
-
title:
|
|
1345
|
-
objective:
|
|
1346
|
-
acceptanceCriteria:
|
|
1599
|
+
var TaskTemplate = z8.object({
|
|
1600
|
+
title: z8.string().min(1),
|
|
1601
|
+
objective: z8.string(),
|
|
1602
|
+
acceptanceCriteria: z8.array(z8.string()),
|
|
1347
1603
|
priority: Priority
|
|
1348
1604
|
});
|
|
1349
|
-
var Automation =
|
|
1350
|
-
id:
|
|
1351
|
-
name:
|
|
1352
|
-
enabled:
|
|
1353
|
-
projectId:
|
|
1605
|
+
var Automation = z8.object({
|
|
1606
|
+
id: Id5,
|
|
1607
|
+
name: z8.string().min(1),
|
|
1608
|
+
enabled: z8.boolean(),
|
|
1609
|
+
projectId: Id5,
|
|
1354
1610
|
trigger: Trigger,
|
|
1355
|
-
filters:
|
|
1611
|
+
filters: z8.array(z8.object({ path: z8.string(), equals: z8.string() })),
|
|
1356
1612
|
template: TaskTemplate,
|
|
1357
|
-
hostId:
|
|
1358
|
-
profileId:
|
|
1359
|
-
mode:
|
|
1360
|
-
groupingKey:
|
|
1361
|
-
overlap:
|
|
1362
|
-
missed:
|
|
1613
|
+
hostId: Id5.nullable(),
|
|
1614
|
+
profileId: Id5.nullable(),
|
|
1615
|
+
mode: z8.enum(["fresh", "continue", "watch"]),
|
|
1616
|
+
groupingKey: z8.string().nullable(),
|
|
1617
|
+
overlap: z8.enum(["skip", "queue_one", "append"]),
|
|
1618
|
+
missed: z8.enum(["skip", "run_once"]),
|
|
1363
1619
|
continuation: ContinuationPolicy,
|
|
1364
1620
|
completion: CompletionPolicy,
|
|
1365
|
-
nextAt:
|
|
1366
|
-
lastEvaluatedAt:
|
|
1367
|
-
lastOutcome:
|
|
1368
|
-
failureCount:
|
|
1369
|
-
webhookTokenSet:
|
|
1370
|
-
createdAt:
|
|
1371
|
-
updatedAt:
|
|
1621
|
+
nextAt: Iso2.nullable(),
|
|
1622
|
+
lastEvaluatedAt: Iso2.nullable(),
|
|
1623
|
+
lastOutcome: z8.string().nullable(),
|
|
1624
|
+
failureCount: z8.number().int().min(0),
|
|
1625
|
+
webhookTokenSet: z8.boolean(),
|
|
1626
|
+
createdAt: Iso2,
|
|
1627
|
+
updatedAt: Iso2
|
|
1372
1628
|
});
|
|
1373
|
-
var OccurrenceState =
|
|
1629
|
+
var OccurrenceState = z8.enum([
|
|
1374
1630
|
"fired",
|
|
1375
1631
|
"skipped_overlap",
|
|
1376
1632
|
"skipped_missed",
|
|
@@ -1379,39 +1635,47 @@ var OccurrenceState = z6.enum([
|
|
|
1379
1635
|
"failed",
|
|
1380
1636
|
"filtered"
|
|
1381
1637
|
]);
|
|
1382
|
-
var Occurrence =
|
|
1383
|
-
id:
|
|
1384
|
-
automationId:
|
|
1385
|
-
key:
|
|
1386
|
-
scheduledFor:
|
|
1638
|
+
var Occurrence = z8.object({
|
|
1639
|
+
id: Id5,
|
|
1640
|
+
automationId: Id5,
|
|
1641
|
+
key: z8.string(),
|
|
1642
|
+
scheduledFor: Iso2.nullable(),
|
|
1387
1643
|
state: OccurrenceState,
|
|
1388
|
-
taskId:
|
|
1389
|
-
reason:
|
|
1390
|
-
outcome:
|
|
1391
|
-
createdAt:
|
|
1392
|
-
});
|
|
1393
|
-
var InteractionState =
|
|
1394
|
-
var
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1644
|
+
taskId: Id5.nullable(),
|
|
1645
|
+
reason: z8.string().nullable(),
|
|
1646
|
+
outcome: z8.string().nullable(),
|
|
1647
|
+
createdAt: Iso2
|
|
1648
|
+
});
|
|
1649
|
+
var InteractionState = z8.preprocess((v) => v === "cancelled" ? "canceled" : v, z8.enum(["pending", "resolved", "expired", "canceled", "unsupported"]));
|
|
1650
|
+
var InteractionKind = z8.enum(["question", "approval", "plan"]);
|
|
1651
|
+
var Interaction = z8.object({
|
|
1652
|
+
id: Id5,
|
|
1653
|
+
sessionId: Id5,
|
|
1654
|
+
revision: z8.number().int().min(1),
|
|
1655
|
+
source: z8.discriminatedUnion("kind", [
|
|
1656
|
+
z8.object({
|
|
1657
|
+
kind: z8.literal("extension_ui"),
|
|
1658
|
+
method: z8.enum(["select", "confirm", "input", "editor"]),
|
|
1659
|
+
piRequestIds: z8.array(z8.string())
|
|
1403
1660
|
}),
|
|
1404
|
-
|
|
1661
|
+
z8.object({ kind: z8.literal("unsupported_custom"), title: z8.string().nullable() })
|
|
1405
1662
|
]),
|
|
1406
|
-
adapterId:
|
|
1663
|
+
adapterId: z8.string().nullable(),
|
|
1407
1664
|
permission: PolicyPermission.optional(),
|
|
1408
|
-
|
|
1665
|
+
/**
|
|
1666
|
+
* What the dialog is, when its adapter or the host says so: a question to answer, an approval
|
|
1667
|
+
* of something Pi wants to do, or a plan to accept. Absent for a dialog nobody described.
|
|
1668
|
+
*/
|
|
1669
|
+
kind: InteractionKind.optional(),
|
|
1670
|
+
/** The tool call that opened the dialog, when the host knows it. */
|
|
1671
|
+
toolCallId: z8.string().optional(),
|
|
1672
|
+
title: z8.string(),
|
|
1409
1673
|
presentation: UINodeSchema,
|
|
1410
1674
|
state: InteractionState,
|
|
1411
|
-
resolution:
|
|
1412
|
-
createdAt:
|
|
1675
|
+
resolution: z8.object({ by: z8.string(), summary: z8.string(), at: Iso2 }).nullable(),
|
|
1676
|
+
createdAt: Iso2
|
|
1413
1677
|
});
|
|
1414
|
-
var AttentionReason =
|
|
1678
|
+
var AttentionReason = z8.enum([
|
|
1415
1679
|
"needs_input",
|
|
1416
1680
|
"failed",
|
|
1417
1681
|
"ready_for_review",
|
|
@@ -1419,171 +1683,173 @@ var AttentionReason = z6.enum([
|
|
|
1419
1683
|
"host_unreachable",
|
|
1420
1684
|
"cache_expiring"
|
|
1421
1685
|
]);
|
|
1422
|
-
var AttentionItem =
|
|
1423
|
-
id:
|
|
1424
|
-
sessionId:
|
|
1425
|
-
taskId:
|
|
1426
|
-
projectId:
|
|
1686
|
+
var AttentionItem = z8.object({
|
|
1687
|
+
id: Id5,
|
|
1688
|
+
sessionId: Id5.nullable(),
|
|
1689
|
+
taskId: Id5.nullable(),
|
|
1690
|
+
projectId: Id5.nullable(),
|
|
1427
1691
|
reason: AttentionReason,
|
|
1428
|
-
severity:
|
|
1429
|
-
summary:
|
|
1430
|
-
interactionId:
|
|
1431
|
-
deepLink:
|
|
1432
|
-
acknowledgedAt:
|
|
1433
|
-
resolvedAt:
|
|
1434
|
-
createdAt:
|
|
1435
|
-
});
|
|
1436
|
-
var Device =
|
|
1437
|
-
id:
|
|
1438
|
-
name:
|
|
1692
|
+
severity: z8.enum(["info", "warning", "critical"]),
|
|
1693
|
+
summary: z8.string(),
|
|
1694
|
+
interactionId: Id5.nullable(),
|
|
1695
|
+
deepLink: z8.string(),
|
|
1696
|
+
acknowledgedAt: Iso2.nullable(),
|
|
1697
|
+
resolvedAt: Iso2.nullable(),
|
|
1698
|
+
createdAt: Iso2
|
|
1699
|
+
});
|
|
1700
|
+
var Device = z8.object({
|
|
1701
|
+
id: Id5,
|
|
1702
|
+
name: z8.string(),
|
|
1439
1703
|
kind: DeviceKind,
|
|
1440
|
-
createdAt:
|
|
1441
|
-
lastSeenAt:
|
|
1442
|
-
revokedAt:
|
|
1443
|
-
push:
|
|
1444
|
-
subscribed:
|
|
1445
|
-
permission:
|
|
1704
|
+
createdAt: Iso2,
|
|
1705
|
+
lastSeenAt: Iso2.nullable(),
|
|
1706
|
+
revokedAt: Iso2.nullable(),
|
|
1707
|
+
push: z8.object({
|
|
1708
|
+
subscribed: z8.boolean(),
|
|
1709
|
+
permission: z8.enum(["granted", "denied", "default", "unknown"])
|
|
1446
1710
|
}),
|
|
1447
|
-
preferredMobile:
|
|
1448
|
-
enrolledVia:
|
|
1449
|
-
});
|
|
1450
|
-
var ToolItemData =
|
|
1451
|
-
toolCallId:
|
|
1452
|
-
name:
|
|
1453
|
-
status:
|
|
1454
|
-
args:
|
|
1455
|
-
summary:
|
|
1456
|
-
output:
|
|
1457
|
-
startedAt:
|
|
1458
|
-
durationMs:
|
|
1711
|
+
preferredMobile: z8.boolean(),
|
|
1712
|
+
enrolledVia: z8.enum(["enrollment", "passkey", "oidc", "admin", "approval"]).default("enrollment")
|
|
1713
|
+
});
|
|
1714
|
+
var ToolItemData = z8.object({
|
|
1715
|
+
toolCallId: z8.string(),
|
|
1716
|
+
name: z8.string(),
|
|
1717
|
+
status: z8.enum(["running", "ok", "error"]),
|
|
1718
|
+
args: z8.unknown(),
|
|
1719
|
+
summary: z8.string(),
|
|
1720
|
+
output: z8.string(),
|
|
1721
|
+
startedAt: Iso2,
|
|
1722
|
+
durationMs: z8.number().nullable(),
|
|
1459
1723
|
card: UINodeSchema.nullable(),
|
|
1460
|
-
adapterId:
|
|
1461
|
-
adapterGeneration:
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1724
|
+
adapterId: z8.string().nullable(),
|
|
1725
|
+
adapterGeneration: z8.string().uuid().optional(),
|
|
1726
|
+
/** `tool.views.v1`: what the host and an adapter say about the call (see tool-view.ts). */
|
|
1727
|
+
view: ToolViewData.optional()
|
|
1728
|
+
});
|
|
1729
|
+
var TranscriptItem = z8.discriminatedUnion("kind", [
|
|
1730
|
+
z8.object({
|
|
1731
|
+
id: Id5,
|
|
1732
|
+
sessionId: Id5,
|
|
1733
|
+
order: z8.number().int(),
|
|
1734
|
+
at: Iso2,
|
|
1735
|
+
kind: z8.literal("user"),
|
|
1736
|
+
data: z8.object({
|
|
1737
|
+
text: z8.string(),
|
|
1738
|
+
images: z8.number().int().optional(),
|
|
1473
1739
|
/** Pi session entry id, for rewind and fork from this message. */
|
|
1474
|
-
entryId:
|
|
1740
|
+
entryId: z8.string().optional()
|
|
1475
1741
|
})
|
|
1476
1742
|
}),
|
|
1477
|
-
|
|
1478
|
-
id:
|
|
1479
|
-
sessionId:
|
|
1480
|
-
order:
|
|
1481
|
-
at:
|
|
1482
|
-
kind:
|
|
1483
|
-
data:
|
|
1743
|
+
z8.object({
|
|
1744
|
+
id: Id5,
|
|
1745
|
+
sessionId: Id5,
|
|
1746
|
+
order: z8.number().int(),
|
|
1747
|
+
at: Iso2,
|
|
1748
|
+
kind: z8.literal("assistant"),
|
|
1749
|
+
data: z8.object({ text: z8.string(), streaming: z8.boolean().optional() })
|
|
1484
1750
|
}),
|
|
1485
|
-
|
|
1486
|
-
id:
|
|
1487
|
-
sessionId:
|
|
1488
|
-
order:
|
|
1489
|
-
at:
|
|
1490
|
-
kind:
|
|
1491
|
-
data:
|
|
1751
|
+
z8.object({
|
|
1752
|
+
id: Id5,
|
|
1753
|
+
sessionId: Id5,
|
|
1754
|
+
order: z8.number().int(),
|
|
1755
|
+
at: Iso2,
|
|
1756
|
+
kind: z8.literal("thinking"),
|
|
1757
|
+
data: z8.object({ text: z8.string() })
|
|
1492
1758
|
}),
|
|
1493
|
-
|
|
1494
|
-
id:
|
|
1495
|
-
sessionId:
|
|
1496
|
-
order:
|
|
1497
|
-
at:
|
|
1498
|
-
kind:
|
|
1759
|
+
z8.object({
|
|
1760
|
+
id: Id5,
|
|
1761
|
+
sessionId: Id5,
|
|
1762
|
+
order: z8.number().int(),
|
|
1763
|
+
at: Iso2,
|
|
1764
|
+
kind: z8.literal("tool"),
|
|
1499
1765
|
data: ToolItemData
|
|
1500
1766
|
}),
|
|
1501
|
-
|
|
1502
|
-
id:
|
|
1503
|
-
sessionId:
|
|
1504
|
-
order:
|
|
1505
|
-
at:
|
|
1506
|
-
kind:
|
|
1507
|
-
data:
|
|
1767
|
+
z8.object({
|
|
1768
|
+
id: Id5,
|
|
1769
|
+
sessionId: Id5,
|
|
1770
|
+
order: z8.number().int(),
|
|
1771
|
+
at: Iso2,
|
|
1772
|
+
kind: z8.literal("notice"),
|
|
1773
|
+
data: z8.object({
|
|
1508
1774
|
level: DiagnosticLevel,
|
|
1509
|
-
text:
|
|
1510
|
-
customType:
|
|
1775
|
+
text: z8.string(),
|
|
1776
|
+
customType: z8.string().min(1).max(200).optional(),
|
|
1511
1777
|
card: UINodeSchema.optional(),
|
|
1512
|
-
adapterId:
|
|
1513
|
-
adapterGeneration:
|
|
1778
|
+
adapterId: z8.string().optional(),
|
|
1779
|
+
adapterGeneration: z8.string().uuid().optional()
|
|
1514
1780
|
}).refine((data) => !data.card || !!data.adapterId, "Card requires adapterId")
|
|
1515
1781
|
}),
|
|
1516
|
-
|
|
1517
|
-
id:
|
|
1518
|
-
sessionId:
|
|
1519
|
-
order:
|
|
1520
|
-
at:
|
|
1521
|
-
kind:
|
|
1522
|
-
data:
|
|
1782
|
+
z8.object({
|
|
1783
|
+
id: Id5,
|
|
1784
|
+
sessionId: Id5,
|
|
1785
|
+
order: z8.number().int(),
|
|
1786
|
+
at: Iso2,
|
|
1787
|
+
kind: z8.literal("interaction"),
|
|
1788
|
+
data: z8.object({ interactionId: Id5 })
|
|
1523
1789
|
}),
|
|
1524
|
-
|
|
1525
|
-
id:
|
|
1526
|
-
sessionId:
|
|
1527
|
-
order:
|
|
1528
|
-
at:
|
|
1529
|
-
kind:
|
|
1530
|
-
data:
|
|
1531
|
-
runId:
|
|
1532
|
-
label:
|
|
1533
|
-
status:
|
|
1534
|
-
sessionFile:
|
|
1535
|
-
linkedSessionId:
|
|
1790
|
+
z8.object({
|
|
1791
|
+
id: Id5,
|
|
1792
|
+
sessionId: Id5,
|
|
1793
|
+
order: z8.number().int(),
|
|
1794
|
+
at: Iso2,
|
|
1795
|
+
kind: z8.literal("subagent"),
|
|
1796
|
+
data: z8.object({
|
|
1797
|
+
runId: z8.string(),
|
|
1798
|
+
label: z8.string(),
|
|
1799
|
+
status: z8.string(),
|
|
1800
|
+
sessionFile: z8.string().nullable(),
|
|
1801
|
+
linkedSessionId: Id5.nullable()
|
|
1536
1802
|
})
|
|
1537
1803
|
}),
|
|
1538
|
-
|
|
1539
|
-
id:
|
|
1540
|
-
sessionId:
|
|
1541
|
-
order:
|
|
1542
|
-
at:
|
|
1543
|
-
kind:
|
|
1544
|
-
data:
|
|
1804
|
+
z8.object({
|
|
1805
|
+
id: Id5,
|
|
1806
|
+
sessionId: Id5,
|
|
1807
|
+
order: z8.number().int(),
|
|
1808
|
+
at: Iso2,
|
|
1809
|
+
kind: z8.literal("system"),
|
|
1810
|
+
data: z8.object({ text: z8.string(), suggestion: z8.boolean().optional() })
|
|
1545
1811
|
})
|
|
1546
1812
|
]);
|
|
1547
|
-
var Panel =
|
|
1548
|
-
sessionId:
|
|
1549
|
-
adapterId:
|
|
1550
|
-
slot:
|
|
1551
|
-
title:
|
|
1813
|
+
var Panel = z8.object({
|
|
1814
|
+
sessionId: Id5,
|
|
1815
|
+
adapterId: z8.string(),
|
|
1816
|
+
slot: z8.string(),
|
|
1817
|
+
title: z8.string(),
|
|
1552
1818
|
node: UINodeSchema.nullable(),
|
|
1553
|
-
webRenderer:
|
|
1554
|
-
mobileFallback:
|
|
1819
|
+
webRenderer: z8.boolean(),
|
|
1820
|
+
mobileFallback: z8.string().nullable(),
|
|
1555
1821
|
contribution: ContributionDescriptor.optional(),
|
|
1556
|
-
state:
|
|
1557
|
-
adapterGeneration:
|
|
1558
|
-
updatedAt:
|
|
1822
|
+
state: z8.unknown().optional(),
|
|
1823
|
+
adapterGeneration: z8.string().uuid().optional(),
|
|
1824
|
+
updatedAt: Iso2
|
|
1559
1825
|
});
|
|
1560
|
-
var Diagnostic =
|
|
1561
|
-
sessionId:
|
|
1562
|
-
adapterId:
|
|
1826
|
+
var Diagnostic = z8.object({
|
|
1827
|
+
sessionId: Id5.nullable(),
|
|
1828
|
+
adapterId: z8.string().nullable(),
|
|
1563
1829
|
level: DiagnosticLevel,
|
|
1564
|
-
message:
|
|
1565
|
-
at:
|
|
1566
|
-
});
|
|
1567
|
-
var AdapterInfo =
|
|
1568
|
-
id:
|
|
1569
|
-
version:
|
|
1570
|
-
tier:
|
|
1571
|
-
target:
|
|
1572
|
-
extension:
|
|
1573
|
-
versionRange:
|
|
1574
|
-
testedVersions:
|
|
1830
|
+
message: z8.string(),
|
|
1831
|
+
at: Iso2
|
|
1832
|
+
});
|
|
1833
|
+
var AdapterInfo = z8.object({
|
|
1834
|
+
id: z8.string(),
|
|
1835
|
+
version: z8.string(),
|
|
1836
|
+
tier: z8.enum(["project", "owner", "plugin", "bundled"]),
|
|
1837
|
+
target: z8.object({
|
|
1838
|
+
extension: z8.string(),
|
|
1839
|
+
versionRange: z8.string(),
|
|
1840
|
+
testedVersions: z8.array(z8.string())
|
|
1575
1841
|
}),
|
|
1576
|
-
capabilities:
|
|
1577
|
-
webRenderer:
|
|
1578
|
-
status:
|
|
1579
|
-
detail:
|
|
1580
|
-
});
|
|
1581
|
-
var Passkey =
|
|
1582
|
-
id:
|
|
1583
|
-
name:
|
|
1584
|
-
createdAt:
|
|
1585
|
-
lastUsedAt:
|
|
1586
|
-
transports:
|
|
1842
|
+
capabilities: z8.array(z8.string()),
|
|
1843
|
+
webRenderer: z8.boolean(),
|
|
1844
|
+
status: z8.enum(["active", "disabled", "error"]),
|
|
1845
|
+
detail: z8.string().nullable()
|
|
1846
|
+
});
|
|
1847
|
+
var Passkey = z8.object({
|
|
1848
|
+
id: z8.string(),
|
|
1849
|
+
name: z8.string(),
|
|
1850
|
+
createdAt: Iso2,
|
|
1851
|
+
lastUsedAt: Iso2.nullable(),
|
|
1852
|
+
transports: z8.array(z8.string())
|
|
1587
1853
|
});
|
|
1588
1854
|
|
|
1589
1855
|
// packages/protocol/dist/adapter-preview.js
|
|
@@ -1596,92 +1862,92 @@ function bounded(input, ctx) {
|
|
|
1596
1862
|
return input;
|
|
1597
1863
|
} catch (error) {
|
|
1598
1864
|
ctx.addIssue({ code: "custom", message: error.message });
|
|
1599
|
-
return
|
|
1865
|
+
return z9.NEVER;
|
|
1600
1866
|
}
|
|
1601
1867
|
}
|
|
1602
|
-
var
|
|
1603
|
-
var Text2 =
|
|
1604
|
-
var Tool = { toolCallId:
|
|
1605
|
-
var DialogCommon = { id:
|
|
1606
|
-
var AdapterPreviewPiUiRequestSchema =
|
|
1607
|
-
|
|
1868
|
+
var Id6 = z9.string().min(1).max(200);
|
|
1869
|
+
var Text2 = z9.string().max(64 * 1024);
|
|
1870
|
+
var Tool = { toolCallId: Id6, name: Id6, args: z9.unknown() };
|
|
1871
|
+
var DialogCommon = { id: Id6, title: Text2 };
|
|
1872
|
+
var AdapterPreviewPiUiRequestSchema = z9.discriminatedUnion("method", [
|
|
1873
|
+
z9.object({
|
|
1608
1874
|
...DialogCommon,
|
|
1609
|
-
method:
|
|
1610
|
-
options:
|
|
1611
|
-
timeout:
|
|
1875
|
+
method: z9.literal("select"),
|
|
1876
|
+
options: z9.array(Text2).max(200),
|
|
1877
|
+
timeout: z9.number().nonnegative().optional()
|
|
1612
1878
|
}).strict(),
|
|
1613
|
-
|
|
1879
|
+
z9.object({
|
|
1614
1880
|
...DialogCommon,
|
|
1615
|
-
method:
|
|
1881
|
+
method: z9.literal("confirm"),
|
|
1616
1882
|
message: Text2,
|
|
1617
|
-
timeout:
|
|
1883
|
+
timeout: z9.number().nonnegative().optional()
|
|
1618
1884
|
}).strict(),
|
|
1619
|
-
|
|
1885
|
+
z9.object({
|
|
1620
1886
|
...DialogCommon,
|
|
1621
|
-
method:
|
|
1887
|
+
method: z9.literal("input"),
|
|
1622
1888
|
placeholder: Text2.optional(),
|
|
1623
|
-
timeout:
|
|
1889
|
+
timeout: z9.number().nonnegative().optional()
|
|
1624
1890
|
}).strict(),
|
|
1625
|
-
|
|
1891
|
+
z9.object({ ...DialogCommon, method: z9.literal("editor"), prefill: Text2.optional() }).strict()
|
|
1626
1892
|
]);
|
|
1627
|
-
var AdapterPreviewStepSchema =
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
kind:
|
|
1632
|
-
data:
|
|
1893
|
+
var AdapterPreviewStepSchema = z9.discriminatedUnion("kind", [
|
|
1894
|
+
z9.object({ kind: z9.literal("restore") }).strict(),
|
|
1895
|
+
z9.object({ kind: z9.literal("toolStart"), data: z9.object(Tool).strict() }).strict(),
|
|
1896
|
+
z9.object({
|
|
1897
|
+
kind: z9.literal("toolUpdate"),
|
|
1898
|
+
data: z9.object({ ...Tool, partialResult: z9.unknown(), details: z9.unknown().optional() }).strict()
|
|
1633
1899
|
}).strict(),
|
|
1634
|
-
|
|
1635
|
-
kind:
|
|
1636
|
-
data:
|
|
1900
|
+
z9.object({
|
|
1901
|
+
kind: z9.literal("toolEnd"),
|
|
1902
|
+
data: z9.object({
|
|
1637
1903
|
...Tool,
|
|
1638
|
-
result:
|
|
1639
|
-
isError:
|
|
1640
|
-
details:
|
|
1904
|
+
result: z9.unknown(),
|
|
1905
|
+
isError: z9.boolean(),
|
|
1906
|
+
details: z9.unknown().optional()
|
|
1641
1907
|
}).strict()
|
|
1642
1908
|
}).strict(),
|
|
1643
|
-
|
|
1644
|
-
kind:
|
|
1645
|
-
data:
|
|
1909
|
+
z9.object({
|
|
1910
|
+
kind: z9.literal("status"),
|
|
1911
|
+
data: z9.object({ key: Id6, text: Text2.optional() }).strict()
|
|
1646
1912
|
}).strict(),
|
|
1647
|
-
|
|
1648
|
-
kind:
|
|
1649
|
-
data:
|
|
1913
|
+
z9.object({
|
|
1914
|
+
kind: z9.literal("widget"),
|
|
1915
|
+
data: z9.object({ key: Id6, lines: z9.array(Text2).max(200).optional() }).strict()
|
|
1650
1916
|
}).strict(),
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
kind:
|
|
1654
|
-
data:
|
|
1917
|
+
z9.object({ kind: z9.literal("dialog"), data: AdapterPreviewPiUiRequestSchema }).strict(),
|
|
1918
|
+
z9.object({
|
|
1919
|
+
kind: z9.literal("answer"),
|
|
1920
|
+
data: z9.object({ requestId: Id6, response: InteractionResponseSchema }).strict()
|
|
1655
1921
|
}).strict(),
|
|
1656
|
-
|
|
1657
|
-
kind:
|
|
1658
|
-
data:
|
|
1659
|
-
customType:
|
|
1660
|
-
content:
|
|
1661
|
-
display:
|
|
1662
|
-
details:
|
|
1922
|
+
z9.object({
|
|
1923
|
+
kind: z9.literal("customMessage"),
|
|
1924
|
+
data: z9.object({
|
|
1925
|
+
customType: Id6,
|
|
1926
|
+
content: z9.unknown(),
|
|
1927
|
+
display: z9.boolean().optional(),
|
|
1928
|
+
details: z9.unknown().optional()
|
|
1663
1929
|
}).strict()
|
|
1664
1930
|
}).strict(),
|
|
1665
|
-
|
|
1666
|
-
kind:
|
|
1667
|
-
data:
|
|
1931
|
+
z9.object({
|
|
1932
|
+
kind: z9.literal("action"),
|
|
1933
|
+
data: z9.object({ actionId: Id6, payload: z9.unknown() }).strict()
|
|
1668
1934
|
}).strict()
|
|
1669
1935
|
]);
|
|
1670
|
-
var AdapterPreviewFixtureSchema =
|
|
1671
|
-
version:
|
|
1672
|
-
name:
|
|
1673
|
-
initialState:
|
|
1674
|
-
steps:
|
|
1936
|
+
var AdapterPreviewFixtureSchema = z9.unknown().transform(bounded).pipe(z9.object({
|
|
1937
|
+
version: z9.literal(1),
|
|
1938
|
+
name: z9.string().min(1).max(200),
|
|
1939
|
+
initialState: z9.record(z9.string(), z9.record(z9.string(), z9.unknown())).optional(),
|
|
1940
|
+
steps: z9.array(AdapterPreviewStepSchema).max(ADAPTER_PREVIEW_MAX_STEPS)
|
|
1675
1941
|
}).strict());
|
|
1676
|
-
var PortableNode =
|
|
1942
|
+
var PortableNode = z9.unknown().transform((input, ctx) => {
|
|
1677
1943
|
try {
|
|
1678
1944
|
return validateUINode(input);
|
|
1679
1945
|
} catch (error) {
|
|
1680
1946
|
ctx.addIssue({ code: "custom", message: error.message });
|
|
1681
|
-
return
|
|
1947
|
+
return z9.NEVER;
|
|
1682
1948
|
}
|
|
1683
1949
|
});
|
|
1684
|
-
var PreviewPanel = Panel.extend({ webRenderer:
|
|
1950
|
+
var PreviewPanel = Panel.extend({ webRenderer: z9.literal(false) }).superRefine((panel, ctx) => {
|
|
1685
1951
|
try {
|
|
1686
1952
|
if (panel.sessionId !== ADAPTER_PREVIEW_SESSION_ID)
|
|
1687
1953
|
throw new Error("Preview panels must use the fake preview session");
|
|
@@ -1703,13 +1969,13 @@ var PreviewPanel = Panel.extend({ webRenderer: z7.literal(false) }).superRefine(
|
|
|
1703
1969
|
ctx.addIssue({ code: "custom", message: error.message });
|
|
1704
1970
|
}
|
|
1705
1971
|
});
|
|
1706
|
-
var AdapterPreviewSchema =
|
|
1707
|
-
version:
|
|
1708
|
-
name:
|
|
1709
|
-
adapter:
|
|
1710
|
-
steps:
|
|
1711
|
-
index:
|
|
1712
|
-
kind:
|
|
1972
|
+
var AdapterPreviewSchema = z9.unknown().transform(bounded).pipe(z9.object({
|
|
1973
|
+
version: z9.literal(1),
|
|
1974
|
+
name: z9.string().min(1).max(200),
|
|
1975
|
+
adapter: z9.object({ id: Id6, version: Id6 }).strict(),
|
|
1976
|
+
steps: z9.array(z9.object({
|
|
1977
|
+
index: z9.number().int().min(0).max(ADAPTER_PREVIEW_MAX_STEPS - 1),
|
|
1978
|
+
kind: z9.enum([
|
|
1713
1979
|
"restore",
|
|
1714
1980
|
"toolStart",
|
|
1715
1981
|
"toolUpdate",
|
|
@@ -1721,24 +1987,24 @@ var AdapterPreviewSchema = z7.unknown().transform(bounded).pipe(z7.object({
|
|
|
1721
1987
|
"customMessage",
|
|
1722
1988
|
"action"
|
|
1723
1989
|
]),
|
|
1724
|
-
ok:
|
|
1725
|
-
error:
|
|
1990
|
+
ok: z9.boolean(),
|
|
1991
|
+
error: z9.string().max(4e3).nullable()
|
|
1726
1992
|
}).strict()).max(ADAPTER_PREVIEW_MAX_STEPS),
|
|
1727
|
-
panels:
|
|
1728
|
-
interactions:
|
|
1993
|
+
panels: z9.array(PreviewPanel).max(256),
|
|
1994
|
+
interactions: z9.array(z9.object({
|
|
1729
1995
|
request: AdapterPreviewPiUiRequestSchema,
|
|
1730
1996
|
presentation: PortableNode,
|
|
1731
|
-
state:
|
|
1997
|
+
state: z9.enum(["pending", "resolved"])
|
|
1732
1998
|
}).strict()).max(ADAPTER_PREVIEW_MAX_STEPS),
|
|
1733
|
-
cards:
|
|
1999
|
+
cards: z9.array(z9.unknown().transform((input, ctx) => {
|
|
1734
2000
|
try {
|
|
1735
2001
|
return validateContributionCard(input);
|
|
1736
2002
|
} catch (error) {
|
|
1737
2003
|
ctx.addIssue({ code: "custom", message: error.message });
|
|
1738
|
-
return
|
|
2004
|
+
return z9.NEVER;
|
|
1739
2005
|
}
|
|
1740
2006
|
})).max(ADAPTER_PREVIEW_MAX_STEPS * 3),
|
|
1741
|
-
diagnostics:
|
|
2007
|
+
diagnostics: z9.array(Diagnostic.extend({ message: z9.string().max(4e3) }).refine((d) => d.sessionId === null || d.sessionId === ADAPTER_PREVIEW_SESSION_ID, "Preview diagnostics must use the fake preview session")).max(200)
|
|
1742
2008
|
}).strict().superRefine((preview, ctx) => {
|
|
1743
2009
|
const slots = /* @__PURE__ */ new Set();
|
|
1744
2010
|
let contributions = 0;
|
|
@@ -1767,39 +2033,39 @@ var AdapterPreviewSchema = z7.unknown().transform(bounded).pipe(z7.object({
|
|
|
1767
2033
|
}));
|
|
1768
2034
|
|
|
1769
2035
|
// packages/protocol/dist/adapters.js
|
|
1770
|
-
import { z as
|
|
1771
|
-
var Path =
|
|
2036
|
+
import { z as z10 } from "zod";
|
|
2037
|
+
var Path = z10.string().max(4096);
|
|
1772
2038
|
var SessionAdapterInfo = AdapterInfo.extend({
|
|
1773
|
-
runtimeStatus:
|
|
1774
|
-
runtimeDetail:
|
|
1775
|
-
provenance:
|
|
1776
|
-
scope:
|
|
2039
|
+
runtimeStatus: z10.enum(["active", "disabled", "unavailable"]),
|
|
2040
|
+
runtimeDetail: z10.string().max(4e3).nullable(),
|
|
2041
|
+
provenance: z10.object({
|
|
2042
|
+
scope: z10.enum(["user", "project", "explicit"]),
|
|
1777
2043
|
source: Path.nullable(),
|
|
1778
2044
|
packageDir: Path.nullable(),
|
|
1779
2045
|
manifestPath: Path.nullable(),
|
|
1780
|
-
targetVersion:
|
|
1781
|
-
entrypoints:
|
|
1782
|
-
evidence:
|
|
2046
|
+
targetVersion: z10.string().nullable(),
|
|
2047
|
+
entrypoints: z10.array(Path).max(128),
|
|
2048
|
+
evidence: z10.enum(["runtime-reported", "package-level", "explicit"])
|
|
1783
2049
|
})
|
|
1784
2050
|
});
|
|
1785
|
-
var SessionAdaptersResult =
|
|
1786
|
-
generation:
|
|
1787
|
-
runtimeId:
|
|
1788
|
-
reloadable:
|
|
1789
|
-
blockedReason:
|
|
1790
|
-
adapters:
|
|
1791
|
-
diagnostics:
|
|
2051
|
+
var SessionAdaptersResult = z10.object({
|
|
2052
|
+
generation: z10.string().uuid().nullable(),
|
|
2053
|
+
runtimeId: z10.string().nullable(),
|
|
2054
|
+
reloadable: z10.boolean(),
|
|
2055
|
+
blockedReason: z10.string().nullable(),
|
|
2056
|
+
adapters: z10.array(SessionAdapterInfo).max(256),
|
|
2057
|
+
diagnostics: z10.array(Diagnostic).max(100)
|
|
1792
2058
|
});
|
|
1793
2059
|
|
|
1794
2060
|
// packages/protocol/dist/agent-wire.js
|
|
1795
|
-
import { z as
|
|
1796
|
-
var
|
|
1797
|
-
var Instant3 =
|
|
2061
|
+
import { z as z11 } from "zod";
|
|
2062
|
+
var Id7 = z11.string().min(1).max(200);
|
|
2063
|
+
var Instant3 = z11.string().refine((value) => {
|
|
1798
2064
|
const date = new Date(value);
|
|
1799
2065
|
return Number.isFinite(date.getTime()) && date.toISOString() === value;
|
|
1800
2066
|
}, "Expected canonical UTC timestamp");
|
|
1801
2067
|
var AGENT_FRAME_MAX_BYTES = 128 * 1024;
|
|
1802
|
-
var AgentMethod =
|
|
2068
|
+
var AgentMethod = z11.enum([
|
|
1803
2069
|
"session.bind",
|
|
1804
2070
|
"task.create",
|
|
1805
2071
|
"message.send",
|
|
@@ -1809,34 +2075,34 @@ var AgentMethod = z9.enum([
|
|
|
1809
2075
|
"policy.status",
|
|
1810
2076
|
"policy.cancel"
|
|
1811
2077
|
]);
|
|
1812
|
-
var AgentToolMethod =
|
|
1813
|
-
var RequestHash =
|
|
1814
|
-
var AgentReceiptPeekRequest =
|
|
1815
|
-
var AgentReceiptPeekResult =
|
|
1816
|
-
|
|
1817
|
-
|
|
2078
|
+
var AgentToolMethod = z11.enum(["task.create", "message.send", "inbox.read"]);
|
|
2079
|
+
var RequestHash = z11.string().regex(/^[a-f0-9]{64}$/);
|
|
2080
|
+
var AgentReceiptPeekRequest = z11.object({ method: AgentToolMethod, args: z11.record(z11.string(), z11.json()) }).strict();
|
|
2081
|
+
var AgentReceiptPeekResult = z11.discriminatedUnion("found", [
|
|
2082
|
+
z11.object({ found: z11.literal(false) }).strict(),
|
|
2083
|
+
z11.object({ found: z11.literal(true), requestHash: RequestHash }).strict()
|
|
1818
2084
|
]);
|
|
1819
|
-
var AgentReceiptReplay =
|
|
1820
|
-
var CreateAgentTask =
|
|
1821
|
-
objective:
|
|
1822
|
-
acceptance:
|
|
1823
|
-
dependencies:
|
|
1824
|
-
parentTaskId:
|
|
1825
|
-
hostId:
|
|
1826
|
-
profileId:
|
|
1827
|
-
notifyOnFinish:
|
|
1828
|
-
});
|
|
1829
|
-
var SendAgentMessage =
|
|
1830
|
-
sessionId:
|
|
1831
|
-
body:
|
|
1832
|
-
mode:
|
|
1833
|
-
replyTo:
|
|
1834
|
-
});
|
|
1835
|
-
var ReadAgentInbox =
|
|
1836
|
-
after:
|
|
1837
|
-
limit:
|
|
1838
|
-
});
|
|
1839
|
-
var DeliveryState =
|
|
2085
|
+
var AgentReceiptReplay = z11.object({ requestHash: RequestHash }).strict();
|
|
2086
|
+
var CreateAgentTask = z11.object({
|
|
2087
|
+
objective: z11.string().min(1).max(16e3),
|
|
2088
|
+
acceptance: z11.array(z11.string().min(1).max(2e3)).max(100).default([]),
|
|
2089
|
+
dependencies: z11.array(Id7).max(100).default([]),
|
|
2090
|
+
parentTaskId: Id7.nullable().optional(),
|
|
2091
|
+
hostId: Id7.optional(),
|
|
2092
|
+
profileId: Id7.optional(),
|
|
2093
|
+
notifyOnFinish: z11.boolean().default(true)
|
|
2094
|
+
});
|
|
2095
|
+
var SendAgentMessage = z11.object({
|
|
2096
|
+
sessionId: Id7,
|
|
2097
|
+
body: z11.string().min(1).max(16e3),
|
|
2098
|
+
mode: z11.enum(["steer", "queue"]),
|
|
2099
|
+
replyTo: Id7.optional()
|
|
2100
|
+
});
|
|
2101
|
+
var ReadAgentInbox = z11.object({
|
|
2102
|
+
after: z11.number().int().nonnegative().default(0),
|
|
2103
|
+
limit: z11.number().int().min(1).max(100).default(20)
|
|
2104
|
+
});
|
|
2105
|
+
var DeliveryState = z11.enum([
|
|
1840
2106
|
"pending",
|
|
1841
2107
|
"held",
|
|
1842
2108
|
"deferred",
|
|
@@ -1847,46 +2113,46 @@ var DeliveryState = z9.enum([
|
|
|
1847
2113
|
"failed"
|
|
1848
2114
|
]);
|
|
1849
2115
|
var AgentMessageFields = {
|
|
1850
|
-
seq:
|
|
1851
|
-
id:
|
|
1852
|
-
recipientSessionId:
|
|
1853
|
-
replyTo:
|
|
1854
|
-
chainId:
|
|
1855
|
-
depth:
|
|
1856
|
-
body:
|
|
1857
|
-
requestedMode:
|
|
2116
|
+
seq: z11.number().int().positive(),
|
|
2117
|
+
id: Id7,
|
|
2118
|
+
recipientSessionId: Id7,
|
|
2119
|
+
replyTo: Id7.nullable(),
|
|
2120
|
+
chainId: Id7,
|
|
2121
|
+
depth: z11.number().int().min(0).max(4),
|
|
2122
|
+
body: z11.unknown(),
|
|
2123
|
+
requestedMode: z11.enum(["steer", "queue"]),
|
|
1858
2124
|
deliveryState: DeliveryState,
|
|
1859
|
-
holdUntil:
|
|
1860
|
-
readAt:
|
|
1861
|
-
createdAt:
|
|
2125
|
+
holdUntil: z11.string(),
|
|
2126
|
+
readAt: z11.string().nullable(),
|
|
2127
|
+
createdAt: z11.string()
|
|
1862
2128
|
};
|
|
1863
|
-
var AgentMessage =
|
|
1864
|
-
|
|
1865
|
-
|
|
2129
|
+
var AgentMessage = z11.discriminatedUnion("kind", [
|
|
2130
|
+
z11.object({ ...AgentMessageFields, kind: z11.literal("message"), senderSessionId: Id7 }),
|
|
2131
|
+
z11.object({
|
|
1866
2132
|
...AgentMessageFields,
|
|
1867
|
-
kind:
|
|
1868
|
-
senderSessionId:
|
|
2133
|
+
kind: z11.literal("completion"),
|
|
2134
|
+
senderSessionId: Id7.nullable()
|
|
1869
2135
|
})
|
|
1870
2136
|
]);
|
|
1871
|
-
var AgentInbox =
|
|
1872
|
-
messages:
|
|
1873
|
-
nextAfter:
|
|
1874
|
-
hasMore:
|
|
1875
|
-
});
|
|
1876
|
-
var AgentToolPolicyWait = PolicyEvaluation.options[2].omit({ verdict: true }).extend({ type:
|
|
1877
|
-
var AgentRequestFrame =
|
|
1878
|
-
type:
|
|
1879
|
-
requestId:
|
|
1880
|
-
sessionId:
|
|
1881
|
-
nativeSessionId:
|
|
1882
|
-
runtimeId:
|
|
1883
|
-
context:
|
|
1884
|
-
toolCallId:
|
|
2137
|
+
var AgentInbox = z11.object({
|
|
2138
|
+
messages: z11.array(AgentMessage),
|
|
2139
|
+
nextAfter: z11.number().int().nonnegative(),
|
|
2140
|
+
hasMore: z11.boolean()
|
|
2141
|
+
});
|
|
2142
|
+
var AgentToolPolicyWait = PolicyEvaluation.options[2].omit({ verdict: true }).extend({ type: z11.literal("policy.required") }).strict();
|
|
2143
|
+
var AgentRequestFrame = z11.object({
|
|
2144
|
+
type: z11.literal("agent.request"),
|
|
2145
|
+
requestId: Id7,
|
|
2146
|
+
sessionId: Id7,
|
|
2147
|
+
nativeSessionId: Id7,
|
|
2148
|
+
runtimeId: Id7,
|
|
2149
|
+
context: z11.object({ humanInputId: Id7.nullable(), causalMessageId: Id7.nullable() }).strict(),
|
|
2150
|
+
toolCallId: Id7.optional(),
|
|
1885
2151
|
receiptReplay: AgentReceiptReplay.optional(),
|
|
1886
2152
|
// Tool-method ingress requires this separately; legacy/non-tool frames remain compatible.
|
|
1887
2153
|
deadlineAt: Instant3.optional(),
|
|
1888
2154
|
method: AgentMethod,
|
|
1889
|
-
args:
|
|
2155
|
+
args: z11.unknown()
|
|
1890
2156
|
}).strict().superRefine((frame, ctx) => {
|
|
1891
2157
|
if (frame.method === "receipt.peek") {
|
|
1892
2158
|
if (!frame.toolCallId) {
|
|
@@ -1905,277 +2171,85 @@ var AgentRequestFrame = z9.object({
|
|
|
1905
2171
|
});
|
|
1906
2172
|
}
|
|
1907
2173
|
});
|
|
1908
|
-
var AgentResultFrame =
|
|
1909
|
-
|
|
1910
|
-
type:
|
|
1911
|
-
requestId:
|
|
1912
|
-
runtimeId:
|
|
1913
|
-
ok:
|
|
1914
|
-
result:
|
|
2174
|
+
var AgentResultFrame = z11.discriminatedUnion("ok", [
|
|
2175
|
+
z11.object({
|
|
2176
|
+
type: z11.literal("agent.result"),
|
|
2177
|
+
requestId: Id7,
|
|
2178
|
+
runtimeId: Id7,
|
|
2179
|
+
ok: z11.literal(true),
|
|
2180
|
+
result: z11.unknown()
|
|
1915
2181
|
}),
|
|
1916
|
-
|
|
1917
|
-
type:
|
|
1918
|
-
requestId:
|
|
1919
|
-
runtimeId:
|
|
1920
|
-
ok:
|
|
2182
|
+
z11.object({
|
|
2183
|
+
type: z11.literal("agent.result"),
|
|
2184
|
+
requestId: Id7,
|
|
2185
|
+
runtimeId: Id7,
|
|
2186
|
+
ok: z11.literal(false),
|
|
1921
2187
|
error: ErrorBody
|
|
1922
2188
|
})
|
|
1923
2189
|
]);
|
|
1924
2190
|
|
|
1925
2191
|
// packages/protocol/dist/api.js
|
|
1926
|
-
import { z as
|
|
2192
|
+
import { z as z15 } from "zod";
|
|
1927
2193
|
|
|
1928
2194
|
// packages/protocol/dist/host-wire.js
|
|
1929
|
-
import { z as
|
|
1930
|
-
|
|
1931
|
-
// packages/protocol/dist/events.js
|
|
1932
|
-
import { z as z11 } from "zod";
|
|
1933
|
-
|
|
1934
|
-
// packages/protocol/dist/trackers.js
|
|
1935
|
-
import { z as z10 } from "zod";
|
|
1936
|
-
var Iso2 = z10.string();
|
|
1937
|
-
var Id7 = z10.string().min(1);
|
|
1938
|
-
var TrackerFollow = z10.enum(["assigned", "board"]);
|
|
1939
|
-
var GitHubLogin = z10.string().regex(/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})$/);
|
|
1940
|
-
var TrackerStatusOption = z10.object({
|
|
1941
|
-
id: z10.string().min(1),
|
|
1942
|
-
name: z10.string().min(1).max(200)
|
|
1943
|
-
});
|
|
1944
|
-
var TrackerBoard = z10.object({
|
|
1945
|
-
projectNumber: z10.number().int().positive(),
|
|
1946
|
-
statusField: z10.string().min(1).max(100).default("Status"),
|
|
1947
|
-
/** Column to move a card to once its worktree exists (write-back). */
|
|
1948
|
-
onStart: z10.string().min(1).max(200).nullable().default(null),
|
|
1949
|
-
/** Column to move a card to once a pull request is open (write-back). */
|
|
1950
|
-
onReview: z10.string().min(1).max(200).nullable().default(null),
|
|
1951
|
-
/** A single-select field that ranks issues: its first option is the highest. */
|
|
1952
|
-
priorityField: z10.string().min(1).max(100).nullable().optional(),
|
|
1953
|
-
/** Columns whose cards are not tracked until they have a branch or pull request. */
|
|
1954
|
-
backlog: z10.array(z10.string().min(1).max(200)).max(20).optional()
|
|
1955
|
-
});
|
|
1956
|
-
var Tracker = z10.object({
|
|
1957
|
-
id: Id7,
|
|
1958
|
-
name: z10.string().min(1).max(60),
|
|
1959
|
-
provider: z10.literal("github"),
|
|
1960
|
-
hostId: Id7,
|
|
1961
|
-
owner: GitHubLogin,
|
|
1962
|
-
repositories: z10.array(GitHubRepository).min(1).max(50).nullable(),
|
|
1963
|
-
/** Repositories outside `owner` that belong to this tracker too (never limited by `repositories`). */
|
|
1964
|
-
extraRepositories: z10.array(GitHubRepository).max(20).optional(),
|
|
1965
|
-
board: TrackerBoard.nullable(),
|
|
1966
|
-
/** Which issues it follows; absent means "assigned". "board": every open issue on its board. */
|
|
1967
|
-
follow: TrackerFollow.optional(),
|
|
1968
|
-
writeBack: z10.boolean(),
|
|
1969
|
-
moveShared: z10.boolean(),
|
|
1970
|
-
/** Make a worktree for an issue branch that has none; absent means true. */
|
|
1971
|
-
worktrees: z10.boolean().optional(),
|
|
1972
|
-
enabled: z10.boolean(),
|
|
1973
|
-
/** The host's `gh` user, from the last sync. */
|
|
1974
|
-
login: z10.string().nullable(),
|
|
1975
|
-
lastSyncedAt: Iso2.nullable(),
|
|
1976
|
-
lastError: z10.string().max(2e3).nullable(),
|
|
1977
|
-
createdAt: Iso2,
|
|
1978
|
-
updatedAt: Iso2
|
|
1979
|
-
});
|
|
1980
|
-
var TrackerInput = z10.object({
|
|
1981
|
-
name: Tracker.shape.name,
|
|
1982
|
-
hostId: Id7,
|
|
1983
|
-
owner: GitHubLogin,
|
|
1984
|
-
repositories: Tracker.shape.repositories.default(null),
|
|
1985
|
-
extraRepositories: z10.array(GitHubRepository).max(20).default([]),
|
|
1986
|
-
board: TrackerBoard.nullable().default(null),
|
|
1987
|
-
follow: TrackerFollow.default("assigned"),
|
|
1988
|
-
writeBack: z10.boolean().default(false),
|
|
1989
|
-
moveShared: z10.boolean().default(true),
|
|
1990
|
-
worktrees: z10.boolean().default(true),
|
|
1991
|
-
enabled: z10.boolean().default(true)
|
|
1992
|
-
});
|
|
1993
|
-
var TrackerPatch = z10.object({
|
|
1994
|
-
name: Tracker.shape.name.optional(),
|
|
1995
|
-
hostId: Id7.optional(),
|
|
1996
|
-
owner: GitHubLogin.optional(),
|
|
1997
|
-
repositories: Tracker.shape.repositories.optional(),
|
|
1998
|
-
extraRepositories: z10.array(GitHubRepository).max(20).optional(),
|
|
1999
|
-
board: TrackerBoard.nullable().optional(),
|
|
2000
|
-
follow: TrackerFollow.optional(),
|
|
2001
|
-
writeBack: z10.boolean().optional(),
|
|
2002
|
-
moveShared: z10.boolean().optional(),
|
|
2003
|
-
worktrees: z10.boolean().optional(),
|
|
2004
|
-
enabled: z10.boolean().optional()
|
|
2005
|
-
});
|
|
2006
|
-
var TrackerItemBoard = z10.object({
|
|
2007
|
-
projectId: z10.string().min(1),
|
|
2008
|
-
projectItemId: z10.string().min(1),
|
|
2009
|
-
fieldId: z10.string().min(1),
|
|
2010
|
-
status: z10.string().nullable(),
|
|
2011
|
-
statusOptionId: z10.string().nullable(),
|
|
2012
|
-
options: z10.array(TrackerStatusOption).max(50),
|
|
2013
|
-
/** The issue's value of the tracker's priority field; `rank` is its option's position. */
|
|
2014
|
-
priority: z10.object({ name: z10.string().min(1).max(200), rank: z10.number().int().min(0) }).nullable().optional()
|
|
2015
|
-
});
|
|
2016
|
-
var TrackerPullRequest = z10.object({
|
|
2017
|
-
number: z10.number().int().positive(),
|
|
2018
|
-
state: z10.enum(["OPEN", "CLOSED", "MERGED"]),
|
|
2019
|
-
url: z10.string().url(),
|
|
2020
|
-
headRefName: z10.string().min(1).max(255)
|
|
2021
|
-
});
|
|
2022
|
-
var TrackerParent = z10.object({
|
|
2023
|
-
number: z10.number().int().positive(),
|
|
2024
|
-
title: z10.string().max(300),
|
|
2025
|
-
url: GitHubIssueUrl
|
|
2026
|
-
});
|
|
2027
|
-
var TrackerSubIssues = z10.object({
|
|
2028
|
-
total: z10.number().int().min(0),
|
|
2029
|
-
completed: z10.number().int().min(0)
|
|
2030
|
-
});
|
|
2031
|
-
var TrackerItem = z10.object({
|
|
2032
|
-
itemId: z10.string().min(1),
|
|
2033
|
-
repository: GitHubRepository,
|
|
2034
|
-
number: z10.number().int().positive(),
|
|
2035
|
-
title: z10.string().min(1).max(1e3),
|
|
2036
|
-
url: GitHubIssueUrl,
|
|
2037
|
-
assignees: z10.array(z10.string()).max(20),
|
|
2038
|
-
branches: z10.array(z10.string().min(1).max(255)).max(10),
|
|
2039
|
-
pullRequest: TrackerPullRequest.nullable(),
|
|
2040
|
-
board: TrackerItemBoard.nullable(),
|
|
2041
|
-
parent: TrackerParent.nullable().optional(),
|
|
2042
|
-
subIssues: TrackerSubIssues.nullable().optional()
|
|
2043
|
-
});
|
|
2044
|
-
var TrackerSyncResult = z10.object({
|
|
2045
|
-
login: z10.string().min(1),
|
|
2046
|
-
items: z10.array(TrackerItem).max(200),
|
|
2047
|
-
truncated: z10.boolean()
|
|
2048
|
-
});
|
|
2049
|
-
var TrackedIssue = z10.object({
|
|
2050
|
-
/** `${trackerId}:${itemId}` */
|
|
2051
|
-
id: Id7,
|
|
2052
|
-
trackerId: Id7,
|
|
2053
|
-
itemId: z10.string().min(1),
|
|
2054
|
-
projectId: Id7,
|
|
2055
|
-
repository: GitHubRepository,
|
|
2056
|
-
number: z10.number().int().positive(),
|
|
2057
|
-
title: z10.string().min(1).max(300),
|
|
2058
|
-
url: GitHubIssueUrl,
|
|
2059
|
-
assignees: z10.array(z10.string()).max(20),
|
|
2060
|
-
/** Branches GitHub links to the issue. */
|
|
2061
|
-
branches: z10.array(z10.string()).max(10),
|
|
2062
|
-
/** The branch Switchyard works on. */
|
|
2063
|
-
branch: z10.string().nullable(),
|
|
2064
|
-
workspaceId: Id7.nullable(),
|
|
2065
|
-
pullRequest: TrackerPullRequest.nullable(),
|
|
2066
|
-
board: TrackerItemBoard.nullable(),
|
|
2067
|
-
/** The issue this one is a sub-issue of. */
|
|
2068
|
-
parent: TrackerParent.nullable().optional(),
|
|
2069
|
-
subIssues: TrackerSubIssues.nullable().optional(),
|
|
2070
|
-
updatedAt: Iso2
|
|
2071
|
-
});
|
|
2072
|
-
var OpenIssueRequest = z10.object({
|
|
2073
|
-
hostId: Id7.optional(),
|
|
2074
|
-
viewId: z10.string().optional(),
|
|
2075
|
-
/** The first prompt of a new session. */
|
|
2076
|
-
prompt: z10.string().optional(),
|
|
2077
|
-
profileId: z10.string().nullable().optional()
|
|
2078
|
-
});
|
|
2079
|
-
var TrackerSetStatusResult = z10.discriminatedUnion("status", [
|
|
2080
|
-
z10.object({ status: z10.literal("moved") }),
|
|
2081
|
-
z10.object({
|
|
2082
|
-
status: z10.literal("skipped"),
|
|
2083
|
-
reason: z10.enum(["not_assigned", "shared", "stale"])
|
|
2084
|
-
})
|
|
2085
|
-
]);
|
|
2086
|
-
var LinkIssueRequest = z10.object({ workspaceId: Id7 });
|
|
2087
|
-
var TrackerStatusRequest = z10.object({ status: z10.string().min(1).max(200) });
|
|
2088
|
-
var TrackerHostSyncRequest = z10.object({
|
|
2089
|
-
owner: GitHubLogin,
|
|
2090
|
-
repositories: z10.array(GitHubRepository).nullable(),
|
|
2091
|
-
board: z10.object({
|
|
2092
|
-
projectNumber: z10.number().int().positive(),
|
|
2093
|
-
statusField: z10.string().min(1),
|
|
2094
|
-
priorityField: z10.string().min(1).nullable().optional()
|
|
2095
|
-
}).nullable(),
|
|
2096
|
-
follow: TrackerFollow.optional(),
|
|
2097
|
-
backlog: z10.array(z10.string().min(1)).max(20).optional()
|
|
2098
|
-
});
|
|
2099
|
-
var TrackerHostPrepareBranchRequest = z10.object({
|
|
2100
|
-
checkoutPath: z10.string().min(1),
|
|
2101
|
-
branch: z10.string().min(1).max(255)
|
|
2102
|
-
});
|
|
2103
|
-
var TrackerHostStartIssueRequest = z10.object({
|
|
2104
|
-
checkoutPath: z10.string().min(1),
|
|
2105
|
-
repository: GitHubRepository,
|
|
2106
|
-
number: z10.number().int().positive(),
|
|
2107
|
-
branch: z10.string().min(1).max(255),
|
|
2108
|
-
base: z10.string().min(1)
|
|
2109
|
-
});
|
|
2110
|
-
var TrackerHostSetStatusRequest = z10.object({
|
|
2111
|
-
projectId: z10.string().min(1),
|
|
2112
|
-
projectItemId: z10.string().min(1),
|
|
2113
|
-
fieldId: z10.string().min(1),
|
|
2114
|
-
statusField: z10.string().min(1),
|
|
2115
|
-
optionId: z10.string().min(1),
|
|
2116
|
-
expectedOptionId: z10.string().nullable(),
|
|
2117
|
-
login: z10.string().min(1),
|
|
2118
|
-
allowShared: z10.boolean(),
|
|
2119
|
-
allowUnassigned: z10.boolean().optional()
|
|
2120
|
-
});
|
|
2195
|
+
import { z as z14 } from "zod";
|
|
2121
2196
|
|
|
2122
2197
|
// packages/protocol/dist/events.js
|
|
2198
|
+
import { z as z12 } from "zod";
|
|
2123
2199
|
var EventDataSchemas = {
|
|
2124
2200
|
"host.updated": Host,
|
|
2125
2201
|
"project.updated": Project,
|
|
2126
|
-
"project.deleted":
|
|
2202
|
+
"project.deleted": z12.object({ id: z12.string() }),
|
|
2127
2203
|
"checkout.updated": Checkout,
|
|
2128
2204
|
"workspace.updated": Workspace,
|
|
2129
|
-
"workspace.deleted":
|
|
2205
|
+
"workspace.deleted": z12.object({ id: z12.string() }),
|
|
2130
2206
|
"profile.updated": Profile,
|
|
2131
|
-
"profile.deleted":
|
|
2132
|
-
"
|
|
2133
|
-
"
|
|
2207
|
+
"profile.deleted": z12.object({ id: z12.string() }),
|
|
2208
|
+
"scope.updated": Scope,
|
|
2209
|
+
"scope.deleted": z12.object({ id: z12.string() }),
|
|
2134
2210
|
"session.updated": Session,
|
|
2135
2211
|
"transcript.item": TranscriptItem,
|
|
2136
|
-
"transcript.reset":
|
|
2212
|
+
"transcript.reset": z12.object({ sessionId: z12.string(), epoch: z12.number().int() }),
|
|
2137
2213
|
"interaction.updated": Interaction,
|
|
2138
2214
|
"panel.updated": Panel,
|
|
2139
|
-
"adapters.updated":
|
|
2215
|
+
"adapters.updated": z12.object({ hostId: z12.string(), adapters: z12.array(AdapterInfo) }),
|
|
2140
2216
|
diagnostic: Diagnostic,
|
|
2141
2217
|
"task.updated": Task,
|
|
2142
|
-
"task.deleted":
|
|
2218
|
+
"task.deleted": z12.object({ id: z12.string() }),
|
|
2143
2219
|
"run.updated": Run,
|
|
2144
2220
|
"automation.updated": Automation,
|
|
2145
|
-
"automation.deleted":
|
|
2221
|
+
"automation.deleted": z12.object({ id: z12.string() }),
|
|
2146
2222
|
"occurrence.created": Occurrence,
|
|
2147
2223
|
"occurrence.updated": Occurrence,
|
|
2148
2224
|
"attention.updated": AttentionItem,
|
|
2149
2225
|
"device.updated": Device,
|
|
2150
2226
|
"issue.updated": TrackedIssue,
|
|
2151
|
-
"issue.deleted":
|
|
2152
|
-
"
|
|
2153
|
-
"
|
|
2154
|
-
"settings.updated":
|
|
2227
|
+
"issue.deleted": z12.object({ id: z12.string() }),
|
|
2228
|
+
"client.updated": Client,
|
|
2229
|
+
"client.deleted": z12.object({ id: z12.string() }),
|
|
2230
|
+
"settings.updated": z12.object({ dispatchPaused: z12.boolean() })
|
|
2155
2231
|
};
|
|
2156
2232
|
var EVENT_TYPES = Object.keys(EventDataSchemas);
|
|
2157
2233
|
var LEGACY_EVENT_TYPES = {
|
|
2158
|
-
"workspace.removed": "workspace.deleted"
|
|
2159
|
-
"surface.updated": "terminal.updated",
|
|
2160
|
-
"surface.deleted": "terminal.deleted"
|
|
2234
|
+
"workspace.removed": "workspace.deleted"
|
|
2161
2235
|
};
|
|
2162
2236
|
function canonicalEventType(type) {
|
|
2163
2237
|
return LEGACY_EVENT_TYPES[type] ?? type;
|
|
2164
2238
|
}
|
|
2165
2239
|
var canonical = (v) => typeof v === "string" ? canonicalEventType(v) : v;
|
|
2166
|
-
var EventTypeSchema =
|
|
2167
|
-
var EventScope =
|
|
2168
|
-
hostId:
|
|
2169
|
-
sessionId:
|
|
2170
|
-
taskId:
|
|
2171
|
-
projectId:
|
|
2240
|
+
var EventTypeSchema = z12.preprocess(canonical, z12.enum(EVENT_TYPES));
|
|
2241
|
+
var EventScope = z12.object({
|
|
2242
|
+
hostId: z12.string().optional(),
|
|
2243
|
+
sessionId: z12.string().optional(),
|
|
2244
|
+
taskId: z12.string().optional(),
|
|
2245
|
+
projectId: z12.string().optional()
|
|
2172
2246
|
});
|
|
2173
2247
|
var EventEnvelope = EventScope.extend({
|
|
2174
|
-
seq:
|
|
2175
|
-
id:
|
|
2248
|
+
seq: z12.number().int(),
|
|
2249
|
+
id: z12.string(),
|
|
2176
2250
|
type: EventTypeSchema,
|
|
2177
|
-
at:
|
|
2178
|
-
data:
|
|
2251
|
+
at: z12.string(),
|
|
2252
|
+
data: z12.unknown()
|
|
2179
2253
|
});
|
|
2180
2254
|
var HOST_EVENT_TYPES = [
|
|
2181
2255
|
"session.updated",
|
|
@@ -2188,353 +2262,355 @@ var HOST_EVENT_TYPES = [
|
|
|
2188
2262
|
"workspace.deleted"
|
|
2189
2263
|
];
|
|
2190
2264
|
var HostEvent = EventScope.extend({
|
|
2191
|
-
eventId:
|
|
2192
|
-
type:
|
|
2193
|
-
at:
|
|
2194
|
-
data:
|
|
2195
|
-
});
|
|
2196
|
-
var StreamDelta =
|
|
2197
|
-
sessionId:
|
|
2198
|
-
itemId:
|
|
2199
|
-
kind:
|
|
2200
|
-
delta:
|
|
2201
|
-
order:
|
|
2265
|
+
eventId: z12.string(),
|
|
2266
|
+
type: z12.preprocess(canonical, z12.enum(HOST_EVENT_TYPES)),
|
|
2267
|
+
at: z12.string(),
|
|
2268
|
+
data: z12.unknown()
|
|
2269
|
+
});
|
|
2270
|
+
var StreamDelta = z12.object({
|
|
2271
|
+
sessionId: z12.string(),
|
|
2272
|
+
itemId: z12.string(),
|
|
2273
|
+
kind: z12.enum(["text", "thinking", "tool_args", "tool_output"]),
|
|
2274
|
+
delta: z12.string(),
|
|
2275
|
+
order: z12.number().int().optional()
|
|
2202
2276
|
});
|
|
2203
2277
|
|
|
2204
2278
|
// packages/protocol/dist/terminal-wire.js
|
|
2205
|
-
import { z as
|
|
2206
|
-
var Cols =
|
|
2207
|
-
var Rows =
|
|
2208
|
-
var TermViewerToServer =
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2279
|
+
import { z as z13 } from "zod";
|
|
2280
|
+
var Cols = z13.number().int().min(10).max(1e3);
|
|
2281
|
+
var Rows = z13.number().int().min(5).max(500);
|
|
2282
|
+
var TermViewerToServer = z13.discriminatedUnion("t", [
|
|
2283
|
+
z13.object({ t: z13.literal("in"), d: z13.string() }),
|
|
2284
|
+
z13.object({ t: z13.literal("resize"), cols: Cols, rows: Rows }),
|
|
2285
|
+
z13.object({ t: z13.literal("claim") })
|
|
2212
2286
|
]);
|
|
2213
|
-
var TermServerToViewer =
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2287
|
+
var TermServerToViewer = z13.discriminatedUnion("t", [
|
|
2288
|
+
z13.object({ t: z13.literal("out"), d: z13.string() }),
|
|
2289
|
+
z13.object({ t: z13.literal("closed"), reason: z13.string() }),
|
|
2290
|
+
z13.object({ t: z13.literal("size"), cols: Cols, rows: Rows, owner: z13.boolean() })
|
|
2217
2291
|
]);
|
|
2218
|
-
var TermCoordinatorMsg =
|
|
2219
|
-
|
|
2220
|
-
t:
|
|
2221
|
-
sessionId:
|
|
2292
|
+
var TermCoordinatorMsg = z13.discriminatedUnion("t", [
|
|
2293
|
+
z13.object({
|
|
2294
|
+
t: z13.literal("open"),
|
|
2295
|
+
sessionId: z13.string(),
|
|
2222
2296
|
cols: Cols,
|
|
2223
2297
|
rows: Rows,
|
|
2224
|
-
passive:
|
|
2298
|
+
passive: z13.boolean().optional()
|
|
2225
2299
|
}),
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2300
|
+
z13.object({ t: z13.literal("claim") }),
|
|
2301
|
+
z13.object({ t: z13.literal("in"), d: z13.string() }),
|
|
2302
|
+
z13.object({ t: z13.literal("resize"), cols: Cols, rows: Rows }),
|
|
2303
|
+
z13.object({ t: z13.literal("close") })
|
|
2230
2304
|
]);
|
|
2231
2305
|
|
|
2232
2306
|
// packages/protocol/dist/host-wire.js
|
|
2233
|
-
var Origin =
|
|
2234
|
-
var DiffRev =
|
|
2235
|
-
var HostCommand =
|
|
2236
|
-
|
|
2237
|
-
type:
|
|
2238
|
-
sessionId:
|
|
2239
|
-
title:
|
|
2240
|
-
workspacePath:
|
|
2241
|
-
projectId:
|
|
2307
|
+
var Origin = z14.enum(["human", "automation"]);
|
|
2308
|
+
var DiffRev = z14.string().regex(/^(uncommitted|[0-9a-f]{40})$/);
|
|
2309
|
+
var HostCommand = z14.discriminatedUnion("type", [
|
|
2310
|
+
z14.object({
|
|
2311
|
+
type: z14.literal("session.start"),
|
|
2312
|
+
sessionId: z14.string(),
|
|
2313
|
+
title: z14.string(),
|
|
2314
|
+
workspacePath: z14.string(),
|
|
2315
|
+
projectId: z14.string().nullable(),
|
|
2242
2316
|
profile: Profile,
|
|
2243
2317
|
nativeHandle: NativeHandle.nullable(),
|
|
2244
|
-
initialPrompt:
|
|
2245
|
-
dispatchKey:
|
|
2246
|
-
controlRevision:
|
|
2318
|
+
initialPrompt: z14.string().nullable(),
|
|
2319
|
+
dispatchKey: z14.string().nullable(),
|
|
2320
|
+
controlRevision: z14.number().int(),
|
|
2247
2321
|
controlMode: ControlMode,
|
|
2248
2322
|
origin: Origin,
|
|
2249
|
-
readOnly:
|
|
2250
|
-
policyRequired:
|
|
2323
|
+
readOnly: z14.boolean().default(false),
|
|
2324
|
+
policyRequired: z14.boolean().optional()
|
|
2251
2325
|
}),
|
|
2252
|
-
|
|
2253
|
-
type:
|
|
2254
|
-
sessionId:
|
|
2255
|
-
messageId:
|
|
2256
|
-
payload:
|
|
2257
|
-
deliveryId:
|
|
2258
|
-
kind:
|
|
2259
|
-
text:
|
|
2326
|
+
z14.object({
|
|
2327
|
+
type: z14.literal("session.deliverMessage"),
|
|
2328
|
+
sessionId: z14.string(),
|
|
2329
|
+
messageId: z14.string(),
|
|
2330
|
+
payload: z14.object({
|
|
2331
|
+
deliveryId: z14.string(),
|
|
2332
|
+
kind: z14.enum(["message", "completion"]),
|
|
2333
|
+
text: z14.string()
|
|
2260
2334
|
}),
|
|
2261
|
-
mode:
|
|
2262
|
-
holdUntil:
|
|
2335
|
+
mode: z14.enum(["steer", "queue"]),
|
|
2336
|
+
holdUntil: z14.string()
|
|
2263
2337
|
}),
|
|
2264
|
-
HostPolicySampleRequest.extend({ type:
|
|
2265
|
-
|
|
2266
|
-
type:
|
|
2267
|
-
sessionId:
|
|
2268
|
-
messageIds:
|
|
2338
|
+
HostPolicySampleRequest.extend({ type: z14.literal("session.classifyPolicySample") }),
|
|
2339
|
+
z14.object({
|
|
2340
|
+
type: z14.literal("session.messageStatus"),
|
|
2341
|
+
sessionId: z14.string(),
|
|
2342
|
+
messageIds: z14.array(z14.string().min(1)).min(1).max(100)
|
|
2269
2343
|
}),
|
|
2270
|
-
|
|
2271
|
-
type:
|
|
2272
|
-
sessionId:
|
|
2273
|
-
text:
|
|
2274
|
-
images:
|
|
2275
|
-
mode:
|
|
2344
|
+
z14.object({
|
|
2345
|
+
type: z14.literal("session.prompt"),
|
|
2346
|
+
sessionId: z14.string(),
|
|
2347
|
+
text: z14.string(),
|
|
2348
|
+
images: z14.array(z14.object({ mimeType: z14.string(), data: z14.string() })).default([]),
|
|
2349
|
+
mode: z14.enum(["prompt", "steer", "followUp"]),
|
|
2276
2350
|
origin: Origin,
|
|
2277
|
-
controlRevision:
|
|
2351
|
+
controlRevision: z14.number().int()
|
|
2278
2352
|
}),
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2353
|
+
z14.object({ type: z14.literal("session.abort"), sessionId: z14.string(), clearQueue: z14.boolean() }),
|
|
2354
|
+
/** `queueClear.v1`: empty Pi's queue without aborting; the receipt's result has the messages. */
|
|
2355
|
+
z14.object({ type: z14.literal("session.clearQueue"), sessionId: z14.string() }),
|
|
2356
|
+
z14.object({ type: z14.literal("session.stop"), sessionId: z14.string() }),
|
|
2357
|
+
z14.object({
|
|
2358
|
+
type: z14.literal("session.answer"),
|
|
2359
|
+
sessionId: z14.string(),
|
|
2360
|
+
interactionId: z14.string(),
|
|
2361
|
+
revision: z14.number().int(),
|
|
2286
2362
|
response: InteractionResponseSchema,
|
|
2287
|
-
deviceId:
|
|
2363
|
+
deviceId: z14.string()
|
|
2288
2364
|
}),
|
|
2289
|
-
|
|
2290
|
-
type:
|
|
2291
|
-
sessionId:
|
|
2292
|
-
generation:
|
|
2293
|
-
adapterId:
|
|
2294
|
-
actionId:
|
|
2295
|
-
payload:
|
|
2365
|
+
z14.object({
|
|
2366
|
+
type: z14.literal("session.adapterAction"),
|
|
2367
|
+
sessionId: z14.string(),
|
|
2368
|
+
generation: z14.string().uuid().optional(),
|
|
2369
|
+
adapterId: z14.string(),
|
|
2370
|
+
actionId: z14.string(),
|
|
2371
|
+
payload: z14.unknown()
|
|
2296
2372
|
}),
|
|
2297
|
-
|
|
2298
|
-
type:
|
|
2299
|
-
sessionId:
|
|
2300
|
-
controlRevision:
|
|
2373
|
+
z14.object({
|
|
2374
|
+
type: z14.literal("session.setControl"),
|
|
2375
|
+
sessionId: z14.string(),
|
|
2376
|
+
controlRevision: z14.number().int(),
|
|
2301
2377
|
mode: ControlMode
|
|
2302
2378
|
}),
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
type:
|
|
2311
|
-
sessionId:
|
|
2312
|
-
text:
|
|
2379
|
+
z14.object({ type: z14.literal("session.rename"), sessionId: z14.string(), title: z14.string() }),
|
|
2380
|
+
z14.object({ type: z14.literal("session.importable") }),
|
|
2381
|
+
z14.object({ type: z14.literal("session.readNative"), sessionFile: z14.string() }),
|
|
2382
|
+
z14.object({ type: z14.literal("session.snapshot"), sessionId: z14.string() }),
|
|
2383
|
+
z14.object({ type: z14.literal("session.models"), sessionId: z14.string() }),
|
|
2384
|
+
z14.object({ type: z14.literal("session.commands"), sessionId: z14.string() }),
|
|
2385
|
+
z14.object({
|
|
2386
|
+
type: z14.literal("session.complete"),
|
|
2387
|
+
sessionId: z14.string(),
|
|
2388
|
+
text: z14.string().max(500)
|
|
2313
2389
|
}),
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
type:
|
|
2317
|
-
sessionId:
|
|
2318
|
-
entryId:
|
|
2319
|
-
fork:
|
|
2390
|
+
z14.object({ type: z14.literal("session.tree"), sessionId: z14.string() }),
|
|
2391
|
+
z14.object({
|
|
2392
|
+
type: z14.literal("session.branch"),
|
|
2393
|
+
sessionId: z14.string(),
|
|
2394
|
+
entryId: z14.string().nullable(),
|
|
2395
|
+
fork: z14.boolean()
|
|
2320
2396
|
}),
|
|
2321
|
-
|
|
2322
|
-
type:
|
|
2323
|
-
sessionId:
|
|
2324
|
-
entryId:
|
|
2325
|
-
summarize:
|
|
2326
|
-
instructions:
|
|
2397
|
+
z14.object({
|
|
2398
|
+
type: z14.literal("session.navigate"),
|
|
2399
|
+
sessionId: z14.string(),
|
|
2400
|
+
entryId: z14.string(),
|
|
2401
|
+
summarize: z14.boolean(),
|
|
2402
|
+
instructions: z14.string().max(2e3).nullable()
|
|
2327
2403
|
}),
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
type:
|
|
2334
|
-
sessionId:
|
|
2335
|
-
provider:
|
|
2336
|
-
modelId:
|
|
2404
|
+
z14.object({ type: z14.literal("session.reload"), sessionId: z14.string() }),
|
|
2405
|
+
z14.object({ type: z14.literal("session.adapters"), sessionId: z14.string() }),
|
|
2406
|
+
z14.object({ type: z14.literal("session.reloadAdapters"), sessionId: z14.string() }),
|
|
2407
|
+
z14.object({ type: z14.literal("session.export"), sessionId: z14.string() }),
|
|
2408
|
+
z14.object({
|
|
2409
|
+
type: z14.literal("session.setModel"),
|
|
2410
|
+
sessionId: z14.string(),
|
|
2411
|
+
provider: z14.string().min(1),
|
|
2412
|
+
modelId: z14.string().min(1)
|
|
2337
2413
|
}),
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
type:
|
|
2341
|
-
sessionId:
|
|
2342
|
-
instructions:
|
|
2414
|
+
z14.object({ type: z14.literal("session.setThinking"), sessionId: z14.string(), level: ThinkingLevel }),
|
|
2415
|
+
z14.object({
|
|
2416
|
+
type: z14.literal("session.compact"),
|
|
2417
|
+
sessionId: z14.string(),
|
|
2418
|
+
instructions: z14.string().nullable()
|
|
2343
2419
|
}),
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
type:
|
|
2348
|
-
days:
|
|
2420
|
+
z14.object({ type: z14.literal("checkout.inspect"), path: z14.string() }),
|
|
2421
|
+
z14.object({ type: z14.literal("projects.scan"), folder: z14.string().min(1) }),
|
|
2422
|
+
z14.object({
|
|
2423
|
+
type: z14.literal("projects.suggest"),
|
|
2424
|
+
days: z14.number().int().min(1).max(365).default(30)
|
|
2349
2425
|
}),
|
|
2350
|
-
|
|
2351
|
-
type:
|
|
2352
|
-
checkoutPath:
|
|
2353
|
-
worktreeDir:
|
|
2426
|
+
z14.object({
|
|
2427
|
+
type: z14.literal("workspace.discover"),
|
|
2428
|
+
checkoutPath: z14.string(),
|
|
2429
|
+
worktreeDir: z14.string().default(DEFAULT_WORKTREE_DIR)
|
|
2354
2430
|
}),
|
|
2355
|
-
|
|
2356
|
-
type:
|
|
2357
|
-
checkoutPath:
|
|
2358
|
-
branch:
|
|
2359
|
-
base:
|
|
2360
|
-
setupCommand:
|
|
2361
|
-
worktreeDir:
|
|
2431
|
+
z14.object({
|
|
2432
|
+
type: z14.literal("workspace.create"),
|
|
2433
|
+
checkoutPath: z14.string(),
|
|
2434
|
+
branch: z14.string(),
|
|
2435
|
+
base: z14.string(),
|
|
2436
|
+
setupCommand: z14.string().nullable(),
|
|
2437
|
+
worktreeDir: z14.string().default(DEFAULT_WORKTREE_DIR)
|
|
2362
2438
|
}),
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
type:
|
|
2366
|
-
path:
|
|
2367
|
-
checkoutPath:
|
|
2368
|
-
base:
|
|
2369
|
-
force:
|
|
2370
|
-
/** Also delete the worktree's local branch (hosts before
|
|
2371
|
-
deleteBranch:
|
|
2439
|
+
z14.object({ type: z14.literal("workspace.status"), path: z14.string(), base: z14.string().nullable() }),
|
|
2440
|
+
z14.object({
|
|
2441
|
+
type: z14.literal("workspace.remove"),
|
|
2442
|
+
path: z14.string(),
|
|
2443
|
+
checkoutPath: z14.string(),
|
|
2444
|
+
base: z14.string().nullable(),
|
|
2445
|
+
force: z14.object({ dirty: z14.boolean(), unmerged: z14.boolean() }),
|
|
2446
|
+
/** Also delete the worktree's local branch (hosts before GitHub issue sync ignore it). */
|
|
2447
|
+
deleteBranch: z14.boolean().optional()
|
|
2372
2448
|
}),
|
|
2373
|
-
|
|
2374
|
-
type:
|
|
2375
|
-
path:
|
|
2376
|
-
base:
|
|
2377
|
-
file:
|
|
2449
|
+
z14.object({
|
|
2450
|
+
type: z14.literal("workspace.diff"),
|
|
2451
|
+
path: z14.string(),
|
|
2452
|
+
base: z14.string().nullable(),
|
|
2453
|
+
file: z14.string().nullable(),
|
|
2378
2454
|
/** Hosts without gitLog.v1 never receive it. */
|
|
2379
2455
|
rev: DiffRev.optional()
|
|
2380
2456
|
}),
|
|
2381
|
-
|
|
2382
|
-
type:
|
|
2383
|
-
path:
|
|
2384
|
-
base:
|
|
2385
|
-
limit:
|
|
2457
|
+
z14.object({
|
|
2458
|
+
type: z14.literal("workspace.log"),
|
|
2459
|
+
path: z14.string(),
|
|
2460
|
+
base: z14.string().nullable(),
|
|
2461
|
+
limit: z14.number().int().min(1).max(200)
|
|
2386
2462
|
}),
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
GitHubHostViewRequest.extend({ type:
|
|
2390
|
-
GitHubHostLogsRequest.extend({ type:
|
|
2391
|
-
GitHubHostMergeRequest.extend({ type:
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
type:
|
|
2398
|
-
dispatchKey:
|
|
2399
|
-
runId:
|
|
2400
|
-
taskId:
|
|
2401
|
-
sessionId:
|
|
2402
|
-
projectId:
|
|
2403
|
-
title:
|
|
2404
|
-
workspace:
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
createFrom:
|
|
2408
|
-
checkoutPath:
|
|
2409
|
-
branch:
|
|
2410
|
-
base:
|
|
2411
|
-
setupCommand:
|
|
2412
|
-
worktreeDir:
|
|
2463
|
+
z14.object({ type: z14.literal("workspace.files"), path: z14.string(), dir: z14.string() }),
|
|
2464
|
+
z14.object({ type: z14.literal("workspace.readFile"), path: z14.string(), file: z14.string() }),
|
|
2465
|
+
GitHubHostViewRequest.extend({ type: z14.literal("workspace.prView") }),
|
|
2466
|
+
GitHubHostLogsRequest.extend({ type: z14.literal("workspace.prFailedLogs") }),
|
|
2467
|
+
GitHubHostMergeRequest.extend({ type: z14.literal("workspace.prMerge") }),
|
|
2468
|
+
IssueHostSyncRequest.extend({ type: z14.literal("tracker.sync") }),
|
|
2469
|
+
IssueHostPrepareBranchRequest.extend({ type: z14.literal("tracker.prepareBranch") }),
|
|
2470
|
+
IssueHostStartIssueRequest.extend({ type: z14.literal("tracker.startIssue") }),
|
|
2471
|
+
IssueHostSetStatusRequest.extend({ type: z14.literal("tracker.setStatus") }),
|
|
2472
|
+
z14.object({
|
|
2473
|
+
type: z14.literal("dispatch.start"),
|
|
2474
|
+
dispatchKey: z14.string(),
|
|
2475
|
+
runId: z14.string(),
|
|
2476
|
+
taskId: z14.string(),
|
|
2477
|
+
sessionId: z14.string(),
|
|
2478
|
+
projectId: z14.string(),
|
|
2479
|
+
title: z14.string(),
|
|
2480
|
+
workspace: z14.union([
|
|
2481
|
+
z14.object({ path: z14.string() }),
|
|
2482
|
+
z14.object({
|
|
2483
|
+
createFrom: z14.object({
|
|
2484
|
+
checkoutPath: z14.string(),
|
|
2485
|
+
branch: z14.string(),
|
|
2486
|
+
base: z14.string(),
|
|
2487
|
+
setupCommand: z14.string().nullable(),
|
|
2488
|
+
worktreeDir: z14.string().default(DEFAULT_WORKTREE_DIR)
|
|
2413
2489
|
})
|
|
2414
2490
|
})
|
|
2415
2491
|
]),
|
|
2416
2492
|
nativeHandle: NativeHandle.nullable(),
|
|
2417
2493
|
profile: Profile,
|
|
2418
|
-
prompt:
|
|
2494
|
+
prompt: z14.string(),
|
|
2419
2495
|
/** The launch's own revision; a takeover always carries a newer one. */
|
|
2420
|
-
controlRevision:
|
|
2496
|
+
controlRevision: z14.number().int(),
|
|
2421
2497
|
controlMode: ControlMode.default("automation"),
|
|
2422
|
-
policyRequired:
|
|
2498
|
+
policyRequired: z14.boolean().optional()
|
|
2423
2499
|
}),
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
type:
|
|
2427
|
-
sessionId:
|
|
2428
|
-
path:
|
|
2429
|
-
commands:
|
|
2500
|
+
z14.object({ type: z14.literal("dispatch.reconcile"), dispatchKey: z14.string() }),
|
|
2501
|
+
z14.object({
|
|
2502
|
+
type: z14.literal("checks.run"),
|
|
2503
|
+
sessionId: z14.string(),
|
|
2504
|
+
path: z14.string(),
|
|
2505
|
+
commands: z14.array(z14.string())
|
|
2430
2506
|
})
|
|
2431
2507
|
]);
|
|
2432
|
-
var ImportableSession =
|
|
2433
|
-
sessionFile:
|
|
2434
|
-
sessionId:
|
|
2435
|
-
cwd:
|
|
2436
|
-
name:
|
|
2437
|
-
mtime:
|
|
2438
|
-
inactive:
|
|
2439
|
-
});
|
|
2440
|
-
var DiscoveredWorktree =
|
|
2441
|
-
path:
|
|
2442
|
-
head:
|
|
2443
|
-
branch:
|
|
2444
|
-
bare:
|
|
2445
|
-
detached:
|
|
2446
|
-
locked:
|
|
2447
|
-
prunable:
|
|
2448
|
-
provenance:
|
|
2508
|
+
var ImportableSession = z14.object({
|
|
2509
|
+
sessionFile: z14.string(),
|
|
2510
|
+
sessionId: z14.string(),
|
|
2511
|
+
cwd: z14.string(),
|
|
2512
|
+
name: z14.string().nullable(),
|
|
2513
|
+
mtime: z14.string(),
|
|
2514
|
+
inactive: z14.boolean()
|
|
2515
|
+
});
|
|
2516
|
+
var DiscoveredWorktree = z14.object({
|
|
2517
|
+
path: z14.string(),
|
|
2518
|
+
head: z14.string().nullable(),
|
|
2519
|
+
branch: z14.string().nullable(),
|
|
2520
|
+
bare: z14.boolean(),
|
|
2521
|
+
detached: z14.boolean(),
|
|
2522
|
+
locked: z14.boolean(),
|
|
2523
|
+
prunable: z14.boolean(),
|
|
2524
|
+
provenance: z14.enum(["managed", "discovered", "main"]),
|
|
2449
2525
|
git: GitState.nullable()
|
|
2450
2526
|
});
|
|
2451
|
-
var CheckoutInfo =
|
|
2452
|
-
root:
|
|
2453
|
-
commonDir:
|
|
2454
|
-
repoIdentity:
|
|
2455
|
-
defaultBranch:
|
|
2527
|
+
var CheckoutInfo = z14.object({
|
|
2528
|
+
root: z14.string(),
|
|
2529
|
+
commonDir: z14.string(),
|
|
2530
|
+
repoIdentity: z14.string(),
|
|
2531
|
+
defaultBranch: z14.string()
|
|
2456
2532
|
});
|
|
2457
|
-
var ScannedRepository = CheckoutInfo.extend({ name:
|
|
2458
|
-
var ProjectFolderScan =
|
|
2533
|
+
var ScannedRepository = CheckoutInfo.extend({ name: z14.string() });
|
|
2534
|
+
var ProjectFolderScan = z14.object({
|
|
2459
2535
|
/** The folder, ~ expanded and realpath'd. */
|
|
2460
|
-
folder:
|
|
2461
|
-
repositories:
|
|
2462
|
-
});
|
|
2463
|
-
var ProjectSuggestion =
|
|
2464
|
-
rootPath:
|
|
2465
|
-
sessionCount:
|
|
2466
|
-
lastActivityAt:
|
|
2467
|
-
});
|
|
2468
|
-
var ProjectSuggestions =
|
|
2469
|
-
var GitCommit =
|
|
2470
|
-
sha:
|
|
2471
|
-
subject:
|
|
2472
|
-
author:
|
|
2473
|
-
authoredAt:
|
|
2474
|
-
pushed:
|
|
2475
|
-
});
|
|
2476
|
-
var LogResult =
|
|
2536
|
+
folder: z14.string(),
|
|
2537
|
+
repositories: z14.array(ScannedRepository)
|
|
2538
|
+
});
|
|
2539
|
+
var ProjectSuggestion = z14.object({
|
|
2540
|
+
rootPath: z14.string(),
|
|
2541
|
+
sessionCount: z14.number().int(),
|
|
2542
|
+
lastActivityAt: z14.string()
|
|
2543
|
+
});
|
|
2544
|
+
var ProjectSuggestions = z14.object({ suggestions: z14.array(ProjectSuggestion) });
|
|
2545
|
+
var GitCommit = z14.object({
|
|
2546
|
+
sha: z14.string().regex(/^[0-9a-f]{40}$/),
|
|
2547
|
+
subject: z14.string().max(300),
|
|
2548
|
+
author: z14.string().max(200),
|
|
2549
|
+
authoredAt: z14.string(),
|
|
2550
|
+
pushed: z14.boolean()
|
|
2551
|
+
});
|
|
2552
|
+
var LogResult = z14.object({
|
|
2477
2553
|
/** The base branch the commits are counted from. */
|
|
2478
|
-
base:
|
|
2554
|
+
base: z14.string(),
|
|
2479
2555
|
/** `branch`: commits since the merge base; `recent`: HEAD's latest commits (no commits of its own). */
|
|
2480
|
-
scope:
|
|
2481
|
-
commits:
|
|
2482
|
-
truncated:
|
|
2556
|
+
scope: z14.enum(["branch", "recent"]),
|
|
2557
|
+
commits: z14.array(GitCommit).max(200),
|
|
2558
|
+
truncated: z14.boolean(),
|
|
2483
2559
|
/** Changed and untracked files not committed yet. */
|
|
2484
|
-
uncommitted:
|
|
2485
|
-
});
|
|
2486
|
-
var DiffFile =
|
|
2487
|
-
path:
|
|
2488
|
-
oldPath:
|
|
2489
|
-
added:
|
|
2490
|
-
deleted:
|
|
2491
|
-
status:
|
|
2492
|
-
});
|
|
2493
|
-
var DiffResult =
|
|
2494
|
-
base:
|
|
2495
|
-
files:
|
|
2496
|
-
patch:
|
|
2497
|
-
});
|
|
2498
|
-
var FileEntry =
|
|
2499
|
-
name:
|
|
2500
|
-
path:
|
|
2501
|
-
kind:
|
|
2502
|
-
size:
|
|
2503
|
-
});
|
|
2504
|
-
var ReconcileResult =
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
known:
|
|
2508
|
-
sessionId:
|
|
2509
|
-
state:
|
|
2560
|
+
uncommitted: z14.number().int().min(0)
|
|
2561
|
+
});
|
|
2562
|
+
var DiffFile = z14.object({
|
|
2563
|
+
path: z14.string(),
|
|
2564
|
+
oldPath: z14.string().nullable(),
|
|
2565
|
+
added: z14.number().int(),
|
|
2566
|
+
deleted: z14.number().int(),
|
|
2567
|
+
status: z14.enum(["added", "modified", "deleted", "renamed", "untracked", "binary"])
|
|
2568
|
+
});
|
|
2569
|
+
var DiffResult = z14.object({
|
|
2570
|
+
base: z14.string(),
|
|
2571
|
+
files: z14.array(DiffFile),
|
|
2572
|
+
patch: z14.string().nullable()
|
|
2573
|
+
});
|
|
2574
|
+
var FileEntry = z14.object({
|
|
2575
|
+
name: z14.string(),
|
|
2576
|
+
path: z14.string(),
|
|
2577
|
+
kind: z14.enum(["file", "dir", "symlink"]),
|
|
2578
|
+
size: z14.number().int().nullable()
|
|
2579
|
+
});
|
|
2580
|
+
var ReconcileResult = z14.union([
|
|
2581
|
+
z14.object({ known: z14.literal(false) }),
|
|
2582
|
+
z14.object({
|
|
2583
|
+
known: z14.literal(true),
|
|
2584
|
+
sessionId: z14.string().nullable(),
|
|
2585
|
+
state: z14.enum(["accepted", "workspace_ready", "started", "failed"]),
|
|
2510
2586
|
runtime: RuntimeState.nullable(),
|
|
2511
|
-
workspacePath:
|
|
2587
|
+
workspacePath: z14.string().nullable(),
|
|
2512
2588
|
nativeHandle: NativeHandle.nullable(),
|
|
2513
|
-
error:
|
|
2589
|
+
error: z14.string().nullable(),
|
|
2514
2590
|
/** `{started: "unknown"}` when the host restarted after Pi may have been spawned. */
|
|
2515
|
-
errorDetails:
|
|
2591
|
+
errorDetails: z14.record(z14.string(), z14.unknown()).nullable().default(null)
|
|
2516
2592
|
})
|
|
2517
2593
|
]);
|
|
2518
|
-
var DispatchStartResult =
|
|
2519
|
-
sessionId:
|
|
2520
|
-
workspacePath:
|
|
2594
|
+
var DispatchStartResult = z14.object({
|
|
2595
|
+
sessionId: z14.string(),
|
|
2596
|
+
workspacePath: z14.string(),
|
|
2521
2597
|
nativeHandle: NativeHandle.nullable(),
|
|
2522
|
-
reused:
|
|
2598
|
+
reused: z14.boolean(),
|
|
2523
2599
|
/** Why the launch prompt was not delivered to Pi (the session itself started), if it was not. */
|
|
2524
|
-
promptError:
|
|
2600
|
+
promptError: z14.string().nullable().optional()
|
|
2525
2601
|
});
|
|
2526
|
-
var AnswerResult =
|
|
2527
|
-
status:
|
|
2602
|
+
var AnswerResult = z14.object({
|
|
2603
|
+
status: z14.enum(["answered", "already_answered"]),
|
|
2528
2604
|
interaction: Interaction
|
|
2529
2605
|
});
|
|
2530
|
-
var SnapshotResult =
|
|
2531
|
-
partial:
|
|
2532
|
-
pendingInteractions:
|
|
2606
|
+
var SnapshotResult = z14.object({
|
|
2607
|
+
partial: z14.array(TranscriptItem),
|
|
2608
|
+
pendingInteractions: z14.array(Interaction)
|
|
2533
2609
|
});
|
|
2534
|
-
var ChecksResult =
|
|
2535
|
-
var Receipt =
|
|
2536
|
-
|
|
2537
|
-
|
|
2610
|
+
var ChecksResult = z14.object({ results: z14.array(CheckResult) });
|
|
2611
|
+
var Receipt = z14.union([
|
|
2612
|
+
z14.object({ commandId: z14.string(), ok: z14.literal(true), result: z14.unknown() }),
|
|
2613
|
+
z14.object({ commandId: z14.string(), ok: z14.literal(false), error: ErrorBody })
|
|
2538
2614
|
]);
|
|
2539
2615
|
var HostAgentRequestFrame = AgentRequestFrame.safeExtend({
|
|
2540
2616
|
policyContext: HostToolPolicyContext.optional()
|
|
@@ -2553,295 +2629,299 @@ var HostAgentRequestFrame = AgentRequestFrame.safeExtend({
|
|
|
2553
2629
|
}
|
|
2554
2630
|
ctx.addIssue({ code: "custom", message: "Host agent frame exceeds 128 KiB or is not JSON." });
|
|
2555
2631
|
});
|
|
2556
|
-
var HostToCoordinator =
|
|
2557
|
-
|
|
2558
|
-
type:
|
|
2559
|
-
hostId:
|
|
2560
|
-
credential:
|
|
2561
|
-
name:
|
|
2562
|
-
agentVersion:
|
|
2563
|
-
piVersion:
|
|
2564
|
-
piCompatible:
|
|
2632
|
+
var HostToCoordinator = z14.discriminatedUnion("type", [
|
|
2633
|
+
z14.object({
|
|
2634
|
+
type: z14.literal("hello"),
|
|
2635
|
+
hostId: z14.string(),
|
|
2636
|
+
credential: z14.string(),
|
|
2637
|
+
name: z14.string(),
|
|
2638
|
+
agentVersion: z14.string(),
|
|
2639
|
+
piVersion: z14.string().nullable(),
|
|
2640
|
+
piCompatible: z14.boolean(),
|
|
2565
2641
|
platform: Platform,
|
|
2566
2642
|
capabilities: RuntimeCapabilities.nullable(),
|
|
2567
2643
|
github: HostGitHub.optional(),
|
|
2568
|
-
protocolVersion:
|
|
2569
|
-
features:
|
|
2644
|
+
protocolVersion: z14.number().int(),
|
|
2645
|
+
features: z14.array(z14.string()).optional()
|
|
2570
2646
|
}),
|
|
2571
2647
|
HostAgentRequestFrame,
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2648
|
+
z14.object({ type: z14.literal("event"), hostSeq: z14.number().int(), event: HostEvent }),
|
|
2649
|
+
z14.object({ type: z14.literal("stream"), delta: StreamDelta }),
|
|
2650
|
+
z14.object({ type: z14.literal("receipt"), receipt: Receipt }),
|
|
2651
|
+
z14.object({ type: z14.literal("pong") }),
|
|
2652
|
+
z14.object({ type: z14.literal("usage"), usage: z14.array(ProviderUsage) }),
|
|
2653
|
+
z14.object({ type: z14.literal("term"), streamId: z14.string(), msg: TermServerToViewer })
|
|
2578
2654
|
]);
|
|
2579
|
-
var CoordinatorToHost =
|
|
2580
|
-
|
|
2581
|
-
type:
|
|
2582
|
-
coordinatorVersion:
|
|
2583
|
-
ackedHostSeq:
|
|
2584
|
-
features:
|
|
2655
|
+
var CoordinatorToHost = z14.discriminatedUnion("type", [
|
|
2656
|
+
z14.object({
|
|
2657
|
+
type: z14.literal("welcome"),
|
|
2658
|
+
coordinatorVersion: z14.string(),
|
|
2659
|
+
ackedHostSeq: z14.number().int(),
|
|
2660
|
+
features: z14.array(z14.string()).optional()
|
|
2585
2661
|
}),
|
|
2586
2662
|
AgentResultFrame,
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2663
|
+
z14.object({ type: z14.literal("ack"), hostSeq: z14.number().int() }),
|
|
2664
|
+
z14.object({ type: z14.literal("command"), commandId: z14.string(), command: HostCommand }),
|
|
2665
|
+
z14.object({ type: z14.literal("ping") }),
|
|
2666
|
+
z14.object({ type: z14.literal("reject"), error: ErrorBody }),
|
|
2667
|
+
z14.object({ type: z14.literal("term"), streamId: z14.string(), msg: TermCoordinatorMsg })
|
|
2592
2668
|
]);
|
|
2593
2669
|
|
|
2594
2670
|
// packages/protocol/dist/api.js
|
|
2595
|
-
var EnrollRequest =
|
|
2596
|
-
token:
|
|
2597
|
-
name:
|
|
2671
|
+
var EnrollRequest = z15.object({
|
|
2672
|
+
token: z15.string().min(1),
|
|
2673
|
+
name: z15.string().min(1).max(80),
|
|
2598
2674
|
kind: DeviceKind
|
|
2599
2675
|
});
|
|
2600
|
-
var EnrollResponse =
|
|
2601
|
-
var CreateEnrollmentRequest =
|
|
2602
|
-
var CreateEnrollmentResponse =
|
|
2603
|
-
token:
|
|
2604
|
-
url:
|
|
2605
|
-
expiresAt:
|
|
2606
|
-
qrSvg:
|
|
2607
|
-
command:
|
|
2676
|
+
var EnrollResponse = z15.object({ deviceId: z15.string(), credential: z15.string() });
|
|
2677
|
+
var CreateEnrollmentRequest = z15.object({ kind: z15.enum(["device", "host"]) });
|
|
2678
|
+
var CreateEnrollmentResponse = z15.object({
|
|
2679
|
+
token: z15.string(),
|
|
2680
|
+
url: z15.string(),
|
|
2681
|
+
expiresAt: z15.string(),
|
|
2682
|
+
qrSvg: z15.string(),
|
|
2683
|
+
command: z15.string().nullable()
|
|
2608
2684
|
});
|
|
2609
|
-
var HostEnrollRequest =
|
|
2610
|
-
|
|
2611
|
-
token:
|
|
2612
|
-
name:
|
|
2685
|
+
var HostEnrollRequest = z15.union([
|
|
2686
|
+
z15.object({
|
|
2687
|
+
token: z15.string().min(1),
|
|
2688
|
+
name: z15.string().min(1).max(80),
|
|
2613
2689
|
platform: Platform
|
|
2614
2690
|
}),
|
|
2615
|
-
|
|
2616
|
-
secret:
|
|
2617
|
-
name:
|
|
2691
|
+
z15.object({
|
|
2692
|
+
secret: z15.string().min(1),
|
|
2693
|
+
name: z15.string().min(1).max(80),
|
|
2618
2694
|
platform: Platform
|
|
2619
2695
|
})
|
|
2620
2696
|
]);
|
|
2621
|
-
var HostEnrollResponse =
|
|
2622
|
-
var CreateProjectRequest =
|
|
2623
|
-
name:
|
|
2624
|
-
hostId:
|
|
2625
|
-
path:
|
|
2626
|
-
defaultProfileId:
|
|
2627
|
-
setupCommand:
|
|
2628
|
-
checks:
|
|
2629
|
-
maxConcurrentRuns:
|
|
2697
|
+
var HostEnrollResponse = z15.object({ hostId: z15.string(), credential: z15.string() });
|
|
2698
|
+
var CreateProjectRequest = z15.object({
|
|
2699
|
+
name: z15.string().min(1),
|
|
2700
|
+
hostId: z15.string(),
|
|
2701
|
+
path: z15.string().min(1),
|
|
2702
|
+
defaultProfileId: z15.string().nullable().optional(),
|
|
2703
|
+
setupCommand: z15.string().nullable().optional(),
|
|
2704
|
+
checks: z15.array(z15.string()).optional(),
|
|
2705
|
+
maxConcurrentRuns: z15.number().int().min(1).max(32).optional(),
|
|
2630
2706
|
worktreeDir: WorktreeDir.optional()
|
|
2631
2707
|
});
|
|
2632
|
-
var UpdateProjectRequest =
|
|
2633
|
-
name:
|
|
2634
|
-
defaultProfileId:
|
|
2635
|
-
defaultHostId:
|
|
2636
|
-
maxConcurrentRuns:
|
|
2637
|
-
automationEnabled:
|
|
2638
|
-
setupCommand:
|
|
2639
|
-
checks:
|
|
2640
|
-
workspaceSharing:
|
|
2708
|
+
var UpdateProjectRequest = z15.object({
|
|
2709
|
+
name: z15.string().min(1).optional(),
|
|
2710
|
+
defaultProfileId: z15.string().nullable().optional(),
|
|
2711
|
+
defaultHostId: z15.string().nullable().optional(),
|
|
2712
|
+
maxConcurrentRuns: z15.number().int().min(1).max(32).optional(),
|
|
2713
|
+
automationEnabled: z15.boolean().optional(),
|
|
2714
|
+
setupCommand: z15.string().nullable().optional(),
|
|
2715
|
+
checks: z15.array(z15.string()).optional(),
|
|
2716
|
+
workspaceSharing: z15.enum(["single_writer", "shared"]).optional(),
|
|
2641
2717
|
worktreeDir: WorktreeDir.optional(),
|
|
2642
|
-
ensureSessions:
|
|
2643
|
-
removeLanded:
|
|
2718
|
+
ensureSessions: z15.boolean().optional(),
|
|
2719
|
+
removeLanded: z15.boolean().optional()
|
|
2644
2720
|
});
|
|
2645
|
-
var AddCheckoutRequest =
|
|
2721
|
+
var AddCheckoutRequest = z15.object({ hostId: z15.string(), path: z15.string().min(1) });
|
|
2646
2722
|
function isProjectFolderPath(s) {
|
|
2647
2723
|
if (s.includes("\0"))
|
|
2648
2724
|
return false;
|
|
2649
2725
|
return s === "~" || s.startsWith("~/") || s.startsWith("/");
|
|
2650
2726
|
}
|
|
2651
|
-
var ProjectFolder =
|
|
2652
|
-
var UpdateHostRequest =
|
|
2653
|
-
projectFolders:
|
|
2727
|
+
var ProjectFolder = z15.string().trim().min(1).max(1024).refine(isProjectFolderPath, "must be an absolute path or start with ~/");
|
|
2728
|
+
var UpdateHostRequest = z15.object({
|
|
2729
|
+
projectFolders: z15.array(ProjectFolder).max(20).optional()
|
|
2654
2730
|
});
|
|
2655
2731
|
var ProjectScanResult = ProjectScan.extend({
|
|
2656
|
-
added:
|
|
2657
|
-
projectId:
|
|
2658
|
-
name:
|
|
2659
|
-
path:
|
|
2660
|
-
newProject:
|
|
2732
|
+
added: z15.array(z15.object({
|
|
2733
|
+
projectId: z15.string(),
|
|
2734
|
+
name: z15.string(),
|
|
2735
|
+
path: z15.string(),
|
|
2736
|
+
newProject: z15.boolean()
|
|
2661
2737
|
}))
|
|
2662
2738
|
});
|
|
2663
|
-
var ProfileInput =
|
|
2664
|
-
name:
|
|
2665
|
-
provider:
|
|
2666
|
-
model:
|
|
2739
|
+
var ProfileInput = z15.object({
|
|
2740
|
+
name: z15.string().min(1),
|
|
2741
|
+
provider: z15.string().nullable().default(null),
|
|
2742
|
+
model: z15.string().nullable().default(null),
|
|
2667
2743
|
thinking: ThinkingLevel.nullable().default(null),
|
|
2668
|
-
projectTrust:
|
|
2669
|
-
extraArgs:
|
|
2670
|
-
resources:
|
|
2671
|
-
});
|
|
2672
|
-
var CreateWorkspaceRequest =
|
|
2673
|
-
checkoutId:
|
|
2674
|
-
branch:
|
|
2675
|
-
base:
|
|
2676
|
-
});
|
|
2677
|
-
var RemoveWorkspaceRequest =
|
|
2678
|
-
force:
|
|
2679
|
-
});
|
|
2680
|
-
var CreateSessionRequest =
|
|
2681
|
-
projectId:
|
|
2682
|
-
workspace:
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
checkoutId:
|
|
2686
|
-
newBranch:
|
|
2687
|
-
base:
|
|
2744
|
+
projectTrust: z15.enum(["ask", "approve", "ignore"]).default("ask"),
|
|
2745
|
+
extraArgs: z15.array(ExtraArg).default([]),
|
|
2746
|
+
resources: z15.enum(["all", "vanilla"]).default("all")
|
|
2747
|
+
});
|
|
2748
|
+
var CreateWorkspaceRequest = z15.object({
|
|
2749
|
+
checkoutId: z15.string(),
|
|
2750
|
+
branch: z15.string().min(1),
|
|
2751
|
+
base: z15.string().nullable().optional()
|
|
2752
|
+
});
|
|
2753
|
+
var RemoveWorkspaceRequest = z15.object({
|
|
2754
|
+
force: z15.object({ dirty: z15.boolean(), unmerged: z15.boolean() }).default({ dirty: false, unmerged: false })
|
|
2755
|
+
});
|
|
2756
|
+
var CreateSessionRequest = z15.object({
|
|
2757
|
+
projectId: z15.string(),
|
|
2758
|
+
workspace: z15.union([
|
|
2759
|
+
z15.object({ existingId: z15.string() }),
|
|
2760
|
+
z15.object({
|
|
2761
|
+
checkoutId: z15.string(),
|
|
2762
|
+
newBranch: z15.string().min(1),
|
|
2763
|
+
base: z15.string().nullable().optional()
|
|
2688
2764
|
})
|
|
2689
2765
|
]),
|
|
2690
|
-
profileId:
|
|
2691
|
-
prompt:
|
|
2692
|
-
title:
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2766
|
+
profileId: z15.string().nullable().optional(),
|
|
2767
|
+
prompt: z15.string().default(""),
|
|
2768
|
+
title: z15.string().optional(),
|
|
2769
|
+
scopeId: z15.string().optional(),
|
|
2770
|
+
/** COMPAT(scopes-rename): remove after 2027-03-01. The old name of scopeId. */
|
|
2771
|
+
viewId: z15.string().optional()
|
|
2772
|
+
});
|
|
2773
|
+
var OpenBranchRequest = z15.object({
|
|
2774
|
+
projectId: z15.string(),
|
|
2775
|
+
branch: z15.string().min(1),
|
|
2776
|
+
hostId: z15.string().optional(),
|
|
2777
|
+
base: z15.string().nullable().optional(),
|
|
2778
|
+
prompt: z15.string().default(""),
|
|
2779
|
+
profileId: z15.string().nullable().optional(),
|
|
2780
|
+
title: z15.string().optional(),
|
|
2781
|
+
scopeId: z15.string().optional(),
|
|
2782
|
+
/** COMPAT(scopes-rename): remove after 2027-03-01. The old name of scopeId. */
|
|
2783
|
+
viewId: z15.string().optional(),
|
|
2704
2784
|
/** Start another session even when the branch has one. */
|
|
2705
|
-
another:
|
|
2706
|
-
});
|
|
2707
|
-
var OpenBranchResult =
|
|
2708
|
-
var SetPrimaryRequest =
|
|
2709
|
-
var PromptRequest =
|
|
2710
|
-
text:
|
|
2711
|
-
mode:
|
|
2712
|
-
images:
|
|
2713
|
-
clientMessageId:
|
|
2714
|
-
});
|
|
2715
|
-
var CacheAlertRequest =
|
|
2716
|
-
enabled:
|
|
2717
|
-
ttlSec:
|
|
2718
|
-
});
|
|
2719
|
-
var RenameRequest =
|
|
2720
|
-
var SetModelRequest =
|
|
2721
|
-
provider:
|
|
2722
|
-
modelId:
|
|
2723
|
-
});
|
|
2724
|
-
var SetThinkingRequest =
|
|
2725
|
-
var CompactRequest =
|
|
2726
|
-
var SessionModelsResult =
|
|
2727
|
-
var SessionCommandsResult =
|
|
2728
|
-
var CompleteRequest =
|
|
2729
|
-
var CompletionItem =
|
|
2730
|
-
value:
|
|
2731
|
-
label:
|
|
2732
|
-
description:
|
|
2733
|
-
});
|
|
2734
|
-
var SessionCompleteResult =
|
|
2735
|
-
items:
|
|
2736
|
-
prefix:
|
|
2737
|
-
});
|
|
2738
|
-
var TreeRow =
|
|
2739
|
-
entryId:
|
|
2740
|
-
parentId:
|
|
2741
|
-
depth:
|
|
2742
|
-
role:
|
|
2743
|
-
text:
|
|
2744
|
-
activeBranch:
|
|
2745
|
-
leaf:
|
|
2746
|
-
label:
|
|
2747
|
-
at:
|
|
2748
|
-
});
|
|
2749
|
-
var SessionTreeResult =
|
|
2750
|
-
var BranchRequest =
|
|
2751
|
-
entryId:
|
|
2752
|
-
fork:
|
|
2753
|
-
});
|
|
2754
|
-
var HostBranchResult =
|
|
2755
|
-
sessionFile:
|
|
2756
|
-
prefill:
|
|
2757
|
-
});
|
|
2758
|
-
var TranscriptPage =
|
|
2759
|
-
items:
|
|
2760
|
-
hasMore:
|
|
2761
|
-
epoch:
|
|
2762
|
-
rev:
|
|
2763
|
-
delta:
|
|
2764
|
-
reset:
|
|
2765
|
-
});
|
|
2766
|
-
var NavigateRequest =
|
|
2767
|
-
entryId:
|
|
2768
|
-
summarize:
|
|
2769
|
-
instructions:
|
|
2770
|
-
});
|
|
2771
|
-
var HostNavigateResult =
|
|
2772
|
-
items:
|
|
2773
|
-
prefill:
|
|
2774
|
-
});
|
|
2775
|
-
var NavigateResult =
|
|
2776
|
-
prefill:
|
|
2777
|
-
epoch:
|
|
2778
|
-
});
|
|
2779
|
-
var BranchResult =
|
|
2785
|
+
another: z15.boolean().default(false)
|
|
2786
|
+
});
|
|
2787
|
+
var OpenBranchResult = z15.object({ session: Session, created: z15.boolean() });
|
|
2788
|
+
var SetPrimaryRequest = z15.object({ primary: z15.boolean() });
|
|
2789
|
+
var PromptRequest = z15.object({
|
|
2790
|
+
text: z15.string().min(1),
|
|
2791
|
+
mode: z15.enum(["prompt", "steer", "followUp"]).default("prompt"),
|
|
2792
|
+
images: z15.array(z15.object({ mimeType: z15.string(), data: z15.string() })).default([]),
|
|
2793
|
+
clientMessageId: z15.string().optional()
|
|
2794
|
+
});
|
|
2795
|
+
var CacheAlertRequest = z15.object({
|
|
2796
|
+
enabled: z15.boolean(),
|
|
2797
|
+
ttlSec: z15.number().int().min(60).max(86400).nullable().default(null)
|
|
2798
|
+
});
|
|
2799
|
+
var RenameRequest = z15.object({ title: z15.string().min(1).max(200) });
|
|
2800
|
+
var SetModelRequest = z15.object({
|
|
2801
|
+
provider: z15.string().min(1),
|
|
2802
|
+
modelId: z15.string().min(1)
|
|
2803
|
+
});
|
|
2804
|
+
var SetThinkingRequest = z15.object({ level: ThinkingLevel });
|
|
2805
|
+
var CompactRequest = z15.object({ instructions: z15.string().max(4e3).optional() });
|
|
2806
|
+
var SessionModelsResult = z15.object({ models: z15.array(SessionModel) });
|
|
2807
|
+
var SessionCommandsResult = z15.object({ commands: z15.array(SlashCommand) });
|
|
2808
|
+
var CompleteRequest = z15.object({ text: z15.string().min(1).max(500) });
|
|
2809
|
+
var CompletionItem = z15.object({
|
|
2810
|
+
value: z15.string(),
|
|
2811
|
+
label: z15.string(),
|
|
2812
|
+
description: z15.string().nullable()
|
|
2813
|
+
});
|
|
2814
|
+
var SessionCompleteResult = z15.object({
|
|
2815
|
+
items: z15.array(CompletionItem).max(50),
|
|
2816
|
+
prefix: z15.string()
|
|
2817
|
+
});
|
|
2818
|
+
var TreeRow = z15.object({
|
|
2819
|
+
entryId: z15.string(),
|
|
2820
|
+
parentId: z15.string().nullable(),
|
|
2821
|
+
depth: z15.number().int(),
|
|
2822
|
+
role: z15.enum(["user", "assistant"]),
|
|
2823
|
+
text: z15.string(),
|
|
2824
|
+
activeBranch: z15.boolean(),
|
|
2825
|
+
leaf: z15.boolean(),
|
|
2826
|
+
label: z15.string().nullable(),
|
|
2827
|
+
at: z15.string().nullable()
|
|
2828
|
+
});
|
|
2829
|
+
var SessionTreeResult = z15.object({ rows: z15.array(TreeRow) });
|
|
2830
|
+
var BranchRequest = z15.object({
|
|
2831
|
+
entryId: z15.string().nullable(),
|
|
2832
|
+
fork: z15.boolean().default(false)
|
|
2833
|
+
});
|
|
2834
|
+
var HostBranchResult = z15.object({
|
|
2835
|
+
sessionFile: z15.string().nullable(),
|
|
2836
|
+
prefill: z15.string().nullable()
|
|
2837
|
+
});
|
|
2838
|
+
var TranscriptPage = z15.object({
|
|
2839
|
+
items: z15.array(TranscriptItem),
|
|
2840
|
+
hasMore: z15.boolean(),
|
|
2841
|
+
epoch: z15.number().int().optional(),
|
|
2842
|
+
rev: z15.number().int().optional(),
|
|
2843
|
+
delta: z15.boolean().optional(),
|
|
2844
|
+
reset: z15.boolean().optional()
|
|
2845
|
+
});
|
|
2846
|
+
var NavigateRequest = z15.object({
|
|
2847
|
+
entryId: z15.string().min(1),
|
|
2848
|
+
summarize: z15.boolean().default(false),
|
|
2849
|
+
instructions: z15.string().max(2e3).nullable().default(null)
|
|
2850
|
+
});
|
|
2851
|
+
var HostNavigateResult = z15.object({
|
|
2852
|
+
items: z15.array(TranscriptItem),
|
|
2853
|
+
prefill: z15.string().nullable()
|
|
2854
|
+
});
|
|
2855
|
+
var NavigateResult = z15.object({
|
|
2856
|
+
prefill: z15.string().nullable(),
|
|
2857
|
+
epoch: z15.number().int()
|
|
2858
|
+
});
|
|
2859
|
+
var BranchResult = z15.object({
|
|
2780
2860
|
session: Session.nullable(),
|
|
2781
|
-
prefill:
|
|
2861
|
+
prefill: z15.string().nullable()
|
|
2782
2862
|
});
|
|
2783
|
-
var SessionExportResult =
|
|
2784
|
-
var CommandViewAction =
|
|
2785
|
-
label:
|
|
2786
|
-
command:
|
|
2787
|
-
tone:
|
|
2863
|
+
var SessionExportResult = z15.object({ fileName: z15.string(), content: z15.string() });
|
|
2864
|
+
var CommandViewAction = z15.object({
|
|
2865
|
+
label: z15.string().min(1).max(80),
|
|
2866
|
+
command: z15.string().startsWith("/").max(500),
|
|
2867
|
+
tone: z15.enum(["default", "primary", "danger"]).optional()
|
|
2788
2868
|
});
|
|
2789
|
-
var CommandView =
|
|
2790
|
-
title:
|
|
2869
|
+
var CommandView = z15.object({
|
|
2870
|
+
title: z15.string().min(1).max(200),
|
|
2791
2871
|
body: UINodeSchema,
|
|
2792
|
-
actions:
|
|
2872
|
+
actions: z15.array(CommandViewAction).max(30).default([])
|
|
2793
2873
|
});
|
|
2794
|
-
var ModelStateResult =
|
|
2874
|
+
var ModelStateResult = z15.object({
|
|
2795
2875
|
model: SessionModel.nullable(),
|
|
2796
2876
|
thinking: ThinkingLevel.nullable()
|
|
2797
2877
|
});
|
|
2798
|
-
var ImportSessionRequest =
|
|
2799
|
-
hostId:
|
|
2800
|
-
sessionFile:
|
|
2801
|
-
projectId:
|
|
2878
|
+
var ImportSessionRequest = z15.object({
|
|
2879
|
+
hostId: z15.string(),
|
|
2880
|
+
sessionFile: z15.string(),
|
|
2881
|
+
projectId: z15.string().nullable().optional()
|
|
2802
2882
|
});
|
|
2803
|
-
var AnswerRequest =
|
|
2804
|
-
revision:
|
|
2883
|
+
var AnswerRequest = z15.object({
|
|
2884
|
+
revision: z15.number().int(),
|
|
2805
2885
|
response: InteractionResponseSchema
|
|
2806
2886
|
});
|
|
2807
|
-
var AdapterActionRequest =
|
|
2808
|
-
generation:
|
|
2809
|
-
adapterId:
|
|
2810
|
-
actionId:
|
|
2811
|
-
payload:
|
|
2812
|
-
});
|
|
2813
|
-
var TaskPolicyPatch =
|
|
2814
|
-
hostId:
|
|
2815
|
-
profileId:
|
|
2816
|
-
workspace:
|
|
2817
|
-
mode:
|
|
2818
|
-
branch:
|
|
2819
|
-
base:
|
|
2820
|
-
workspaceId:
|
|
2887
|
+
var AdapterActionRequest = z15.object({
|
|
2888
|
+
generation: z15.string().uuid().optional(),
|
|
2889
|
+
adapterId: z15.string(),
|
|
2890
|
+
actionId: z15.string(),
|
|
2891
|
+
payload: z15.unknown().optional()
|
|
2892
|
+
});
|
|
2893
|
+
var TaskPolicyPatch = z15.object({
|
|
2894
|
+
hostId: z15.string().nullable().optional(),
|
|
2895
|
+
profileId: z15.string().nullable().optional(),
|
|
2896
|
+
workspace: z15.object({
|
|
2897
|
+
mode: z15.enum(["new_worktree", "existing"]).optional(),
|
|
2898
|
+
branch: z15.string().nullable().optional(),
|
|
2899
|
+
base: z15.string().nullable().optional(),
|
|
2900
|
+
workspaceId: z15.string().optional()
|
|
2821
2901
|
}).optional(),
|
|
2822
|
-
continuation:
|
|
2823
|
-
enabled:
|
|
2824
|
-
objective:
|
|
2825
|
-
maxContinuations:
|
|
2826
|
-
maxElapsedMinutes:
|
|
2827
|
-
maxTokens:
|
|
2828
|
-
maxCostUsd:
|
|
2902
|
+
continuation: z15.object({
|
|
2903
|
+
enabled: z15.boolean().optional(),
|
|
2904
|
+
objective: z15.string().min(1).optional(),
|
|
2905
|
+
maxContinuations: z15.number().int().min(1).max(50).optional(),
|
|
2906
|
+
maxElapsedMinutes: z15.number().int().min(1).max(1440).optional(),
|
|
2907
|
+
maxTokens: z15.number().int().positive().nullable().optional(),
|
|
2908
|
+
maxCostUsd: z15.number().positive().nullable().optional()
|
|
2829
2909
|
}).optional(),
|
|
2830
2910
|
completion: CompletionPolicy.partial().optional()
|
|
2831
2911
|
});
|
|
2832
|
-
var CreateTaskRequest =
|
|
2833
|
-
projectId:
|
|
2834
|
-
title:
|
|
2912
|
+
var CreateTaskRequest = z15.object({
|
|
2913
|
+
projectId: z15.string(),
|
|
2914
|
+
title: z15.string().max(300).optional(),
|
|
2835
2915
|
githubIssueUrl: GitHubIssueUrl.optional(),
|
|
2836
|
-
githubIssue:
|
|
2837
|
-
launchPrompt:
|
|
2838
|
-
objective:
|
|
2839
|
-
acceptanceCriteria:
|
|
2840
|
-
dependencies:
|
|
2841
|
-
parentTaskId:
|
|
2916
|
+
githubIssue: z15.never().optional(),
|
|
2917
|
+
launchPrompt: z15.never().optional(),
|
|
2918
|
+
objective: z15.string().default(""),
|
|
2919
|
+
acceptanceCriteria: z15.array(z15.string()).default([]),
|
|
2920
|
+
dependencies: z15.array(z15.string()).default([]),
|
|
2921
|
+
parentTaskId: z15.string().nullable().optional(),
|
|
2842
2922
|
priority: Priority.default(2),
|
|
2843
|
-
state:
|
|
2844
|
-
notBefore:
|
|
2923
|
+
state: z15.enum(["backlog", "ready"]).default("backlog"),
|
|
2924
|
+
notBefore: z15.string().nullable().optional(),
|
|
2845
2925
|
policy: TaskPolicyPatch.optional()
|
|
2846
2926
|
}).superRefine((v, ctx) => {
|
|
2847
2927
|
if (v.githubIssueUrl === void 0) {
|
|
@@ -2879,32 +2959,32 @@ var CreateTaskRequest = z14.object({
|
|
|
2879
2959
|
const issue = githubIssueFromUrl(v.githubIssueUrl);
|
|
2880
2960
|
return { ...v, title: v.title?.trim() || `${issue.repository} #${issue.number}` };
|
|
2881
2961
|
});
|
|
2882
|
-
var UpdateTaskRequest =
|
|
2883
|
-
githubIssueUrl:
|
|
2884
|
-
githubIssue:
|
|
2885
|
-
launchPrompt:
|
|
2886
|
-
title:
|
|
2887
|
-
objective:
|
|
2888
|
-
acceptanceCriteria:
|
|
2889
|
-
dependencies:
|
|
2890
|
-
parentTaskId:
|
|
2962
|
+
var UpdateTaskRequest = z15.object({
|
|
2963
|
+
githubIssueUrl: z15.never().optional(),
|
|
2964
|
+
githubIssue: z15.never().optional(),
|
|
2965
|
+
launchPrompt: z15.never().optional(),
|
|
2966
|
+
title: z15.string().min(1).max(300).optional(),
|
|
2967
|
+
objective: z15.string().optional(),
|
|
2968
|
+
acceptanceCriteria: z15.array(z15.string()).optional(),
|
|
2969
|
+
dependencies: z15.array(z15.string()).optional(),
|
|
2970
|
+
parentTaskId: z15.string().nullable().optional(),
|
|
2891
2971
|
priority: Priority.optional(),
|
|
2892
|
-
position:
|
|
2893
|
-
notBefore:
|
|
2972
|
+
position: z15.number().optional(),
|
|
2973
|
+
notBefore: z15.string().nullable().optional(),
|
|
2894
2974
|
policy: TaskPolicyPatch.optional()
|
|
2895
2975
|
});
|
|
2896
|
-
var MoveTaskRequest =
|
|
2976
|
+
var MoveTaskRequest = z15.object({
|
|
2897
2977
|
to: TaskState,
|
|
2898
|
-
confirm:
|
|
2899
|
-
onRunning:
|
|
2900
|
-
position:
|
|
2978
|
+
confirm: z15.boolean().optional(),
|
|
2979
|
+
onRunning: z15.enum(["pause", "stop"]).optional(),
|
|
2980
|
+
position: z15.number().optional()
|
|
2901
2981
|
});
|
|
2902
|
-
var RequestChangesRequest =
|
|
2903
|
-
var Eligibility =
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
eligible:
|
|
2907
|
-
wait:
|
|
2982
|
+
var RequestChangesRequest = z15.object({ feedback: z15.array(z15.string().min(1)).min(1) });
|
|
2983
|
+
var Eligibility = z15.union([
|
|
2984
|
+
z15.object({ eligible: z15.literal(true), hostId: z15.string(), hostName: z15.string() }),
|
|
2985
|
+
z15.object({
|
|
2986
|
+
eligible: z15.literal(false),
|
|
2987
|
+
wait: z15.enum([
|
|
2908
2988
|
"dependency",
|
|
2909
2989
|
"host_offline",
|
|
2910
2990
|
"project_limit",
|
|
@@ -2917,247 +2997,256 @@ var Eligibility = z14.union([
|
|
|
2917
2997
|
"already_dispatched",
|
|
2918
2998
|
"retry_backoff"
|
|
2919
2999
|
]),
|
|
2920
|
-
message:
|
|
3000
|
+
message: z15.string()
|
|
2921
3001
|
})
|
|
2922
3002
|
]);
|
|
2923
|
-
var NowResponse =
|
|
2924
|
-
running:
|
|
2925
|
-
queued:
|
|
2926
|
-
dispatchPaused:
|
|
2927
|
-
});
|
|
2928
|
-
var AutomationInput =
|
|
2929
|
-
name:
|
|
2930
|
-
enabled:
|
|
2931
|
-
projectId:
|
|
3003
|
+
var NowResponse = z15.object({
|
|
3004
|
+
running: z15.array(z15.object({ taskId: z15.string(), runId: z15.string(), sessionId: z15.string().nullable() })),
|
|
3005
|
+
queued: z15.array(z15.object({ taskId: z15.string(), eligibility: Eligibility })),
|
|
3006
|
+
dispatchPaused: z15.boolean()
|
|
3007
|
+
});
|
|
3008
|
+
var AutomationInput = z15.object({
|
|
3009
|
+
name: z15.string().min(1),
|
|
3010
|
+
enabled: z15.boolean().default(true),
|
|
3011
|
+
projectId: z15.string(),
|
|
2932
3012
|
trigger: Trigger,
|
|
2933
|
-
filters:
|
|
3013
|
+
filters: z15.array(z15.object({ path: z15.string(), equals: z15.string() })).default([]),
|
|
2934
3014
|
template: TaskTemplate,
|
|
2935
|
-
hostId:
|
|
2936
|
-
profileId:
|
|
2937
|
-
mode:
|
|
2938
|
-
groupingKey:
|
|
2939
|
-
overlap:
|
|
2940
|
-
missed:
|
|
3015
|
+
hostId: z15.string().nullable().default(null),
|
|
3016
|
+
profileId: z15.string().nullable().default(null),
|
|
3017
|
+
mode: z15.enum(["fresh", "continue", "watch"]).default("fresh"),
|
|
3018
|
+
groupingKey: z15.string().nullable().default(null),
|
|
3019
|
+
overlap: z15.enum(["skip", "queue_one", "append"]).default("skip"),
|
|
3020
|
+
missed: z15.enum(["skip", "run_once"]).default("skip"),
|
|
2941
3021
|
continuation: ContinuationPolicy.default({ enabled: false }),
|
|
2942
3022
|
completion: CompletionPolicy.default({ checks: null, requireHumanReview: true })
|
|
2943
3023
|
});
|
|
2944
|
-
var AutomationView = Automation.extend({ summary:
|
|
2945
|
-
var AutomationPreview =
|
|
2946
|
-
summary:
|
|
3024
|
+
var AutomationView = Automation.extend({ summary: z15.string() });
|
|
3025
|
+
var AutomationPreview = z15.object({
|
|
3026
|
+
summary: z15.string(),
|
|
2947
3027
|
task: TaskTemplate,
|
|
2948
|
-
next:
|
|
2949
|
-
});
|
|
2950
|
-
var WebhookTokenResponse =
|
|
2951
|
-
var PushSubscriptionRequest =
|
|
2952
|
-
endpoint:
|
|
2953
|
-
keys:
|
|
2954
|
-
permission:
|
|
2955
|
-
});
|
|
2956
|
-
var NotificationSettings =
|
|
2957
|
-
quietHours:
|
|
2958
|
-
start:
|
|
2959
|
-
end:
|
|
2960
|
-
timezone:
|
|
3028
|
+
next: z15.array(z15.string())
|
|
3029
|
+
});
|
|
3030
|
+
var WebhookTokenResponse = z15.object({ token: z15.string(), url: z15.string() });
|
|
3031
|
+
var PushSubscriptionRequest = z15.object({
|
|
3032
|
+
endpoint: z15.string().url(),
|
|
3033
|
+
keys: z15.object({ p256dh: z15.string(), auth: z15.string() }),
|
|
3034
|
+
permission: z15.enum(["granted", "denied", "default", "unknown"]).default("granted")
|
|
3035
|
+
});
|
|
3036
|
+
var NotificationSettings = z15.object({
|
|
3037
|
+
quietHours: z15.object({
|
|
3038
|
+
start: z15.string().regex(/^\d{2}:\d{2}$/),
|
|
3039
|
+
end: z15.string().regex(/^\d{2}:\d{2}$/),
|
|
3040
|
+
timezone: z15.string()
|
|
2961
3041
|
}).nullable(),
|
|
2962
|
-
privatePreviews:
|
|
2963
|
-
preferredDeviceId:
|
|
3042
|
+
privatePreviews: z15.boolean(),
|
|
3043
|
+
preferredDeviceId: z15.string().nullable()
|
|
2964
3044
|
});
|
|
2965
|
-
var PushPayload =
|
|
2966
|
-
|
|
2967
|
-
type:
|
|
2968
|
-
title:
|
|
2969
|
-
body:
|
|
2970
|
-
tag:
|
|
2971
|
-
url:
|
|
2972
|
-
renotify:
|
|
3045
|
+
var PushPayload = z15.union([
|
|
3046
|
+
z15.object({
|
|
3047
|
+
type: z15.literal("show"),
|
|
3048
|
+
title: z15.string(),
|
|
3049
|
+
body: z15.string(),
|
|
3050
|
+
tag: z15.string(),
|
|
3051
|
+
url: z15.string(),
|
|
3052
|
+
renotify: z15.boolean()
|
|
2973
3053
|
}),
|
|
2974
|
-
|
|
3054
|
+
z15.object({ type: z15.literal("clear"), tag: z15.string() })
|
|
2975
3055
|
]);
|
|
2976
|
-
var SetupState =
|
|
2977
|
-
passkey:
|
|
2978
|
-
available:
|
|
2979
|
-
registered:
|
|
2980
|
-
reason:
|
|
3056
|
+
var SetupState = z15.object({
|
|
3057
|
+
passkey: z15.object({
|
|
3058
|
+
available: z15.boolean(),
|
|
3059
|
+
registered: z15.boolean(),
|
|
3060
|
+
reason: z15.string().nullable()
|
|
2981
3061
|
}),
|
|
2982
|
-
oidc:
|
|
3062
|
+
oidc: z15.object({ label: z15.string() }).nullable()
|
|
2983
3063
|
});
|
|
2984
|
-
var PasskeyRegisterOptionsResponse =
|
|
2985
|
-
challengeId:
|
|
2986
|
-
options:
|
|
3064
|
+
var PasskeyRegisterOptionsResponse = z15.object({
|
|
3065
|
+
challengeId: z15.string(),
|
|
3066
|
+
options: z15.unknown()
|
|
2987
3067
|
});
|
|
2988
|
-
var PasskeyRegisterVerifyRequest =
|
|
2989
|
-
challengeId:
|
|
2990
|
-
name:
|
|
2991
|
-
response:
|
|
3068
|
+
var PasskeyRegisterVerifyRequest = z15.object({
|
|
3069
|
+
challengeId: z15.string(),
|
|
3070
|
+
name: z15.string().min(1).max(80),
|
|
3071
|
+
response: z15.unknown()
|
|
2992
3072
|
});
|
|
2993
|
-
var PasskeySignInOptionsResponse =
|
|
2994
|
-
challengeId:
|
|
2995
|
-
options:
|
|
3073
|
+
var PasskeySignInOptionsResponse = z15.object({
|
|
3074
|
+
challengeId: z15.string(),
|
|
3075
|
+
options: z15.unknown()
|
|
2996
3076
|
});
|
|
2997
|
-
var PasskeySignInVerifyRequest =
|
|
2998
|
-
challengeId:
|
|
2999
|
-
response:
|
|
3000
|
-
deviceName:
|
|
3077
|
+
var PasskeySignInVerifyRequest = z15.object({
|
|
3078
|
+
challengeId: z15.string(),
|
|
3079
|
+
response: z15.unknown(),
|
|
3080
|
+
deviceName: z15.string().min(1).max(80),
|
|
3001
3081
|
kind: DeviceKind.extract(["browser", "pwa"])
|
|
3002
3082
|
});
|
|
3003
|
-
var OidcBeginRequest =
|
|
3004
|
-
deviceName:
|
|
3083
|
+
var OidcBeginRequest = z15.object({
|
|
3084
|
+
deviceName: z15.string().min(1).max(80),
|
|
3005
3085
|
kind: DeviceKind.extract(["browser", "pwa"]),
|
|
3006
|
-
next:
|
|
3007
|
-
handoff:
|
|
3008
|
-
});
|
|
3009
|
-
var OidcBeginResponse =
|
|
3010
|
-
authorizeUrl:
|
|
3011
|
-
flowId:
|
|
3012
|
-
pollToken:
|
|
3013
|
-
});
|
|
3014
|
-
var OidcClaimRequest =
|
|
3015
|
-
var OidcClaimResponse =
|
|
3016
|
-
|
|
3017
|
-
|
|
3086
|
+
next: z15.string().default("/"),
|
|
3087
|
+
handoff: z15.boolean().default(false)
|
|
3088
|
+
});
|
|
3089
|
+
var OidcBeginResponse = z15.object({
|
|
3090
|
+
authorizeUrl: z15.string(),
|
|
3091
|
+
flowId: z15.string().nullable(),
|
|
3092
|
+
pollToken: z15.string().nullable()
|
|
3093
|
+
});
|
|
3094
|
+
var OidcClaimRequest = z15.object({ flowId: z15.string(), pollToken: z15.string() });
|
|
3095
|
+
var OidcClaimResponse = z15.union([
|
|
3096
|
+
z15.object({ status: z15.literal("pending") }),
|
|
3097
|
+
z15.object({ status: z15.literal("done"), deviceId: z15.string() })
|
|
3018
3098
|
]);
|
|
3019
|
-
var TerminalLoginStartRequest =
|
|
3020
|
-
var TerminalLoginStartResponse =
|
|
3021
|
-
userCode:
|
|
3022
|
-
pollToken:
|
|
3023
|
-
verifyUrl:
|
|
3024
|
-
expiresAt:
|
|
3025
|
-
intervalMs:
|
|
3026
|
-
});
|
|
3027
|
-
var TerminalLoginClaimRequest =
|
|
3028
|
-
userCode:
|
|
3029
|
-
pollToken:
|
|
3030
|
-
});
|
|
3031
|
-
var TerminalLoginClaimResponse =
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3099
|
+
var TerminalLoginStartRequest = z15.object({ name: z15.string().min(1).max(80) });
|
|
3100
|
+
var TerminalLoginStartResponse = z15.object({
|
|
3101
|
+
userCode: z15.string(),
|
|
3102
|
+
pollToken: z15.string(),
|
|
3103
|
+
verifyUrl: z15.string(),
|
|
3104
|
+
expiresAt: z15.string(),
|
|
3105
|
+
intervalMs: z15.number().int()
|
|
3106
|
+
});
|
|
3107
|
+
var TerminalLoginClaimRequest = z15.object({
|
|
3108
|
+
userCode: z15.string().min(1),
|
|
3109
|
+
pollToken: z15.string().min(1)
|
|
3110
|
+
});
|
|
3111
|
+
var TerminalLoginClaimResponse = z15.union([
|
|
3112
|
+
z15.object({ status: z15.literal("pending") }),
|
|
3113
|
+
z15.object({ status: z15.literal("denied") }),
|
|
3114
|
+
z15.object({ status: z15.literal("done"), deviceId: z15.string(), credential: z15.string() })
|
|
3035
3115
|
]);
|
|
3036
|
-
var TerminalLoginRequest =
|
|
3037
|
-
userCode:
|
|
3038
|
-
name:
|
|
3039
|
-
requestedFrom:
|
|
3040
|
-
createdAt:
|
|
3041
|
-
expiresAt:
|
|
3042
|
-
status:
|
|
3043
|
-
});
|
|
3044
|
-
var AuthMethods =
|
|
3045
|
-
passkeys:
|
|
3046
|
-
passkeyAvailability:
|
|
3047
|
-
oidc:
|
|
3048
|
-
issuer:
|
|
3049
|
-
label:
|
|
3050
|
-
ownerMatch:
|
|
3051
|
-
status:
|
|
3052
|
-
error:
|
|
3116
|
+
var TerminalLoginRequest = z15.object({
|
|
3117
|
+
userCode: z15.string(),
|
|
3118
|
+
name: z15.string(),
|
|
3119
|
+
requestedFrom: z15.string(),
|
|
3120
|
+
createdAt: z15.string(),
|
|
3121
|
+
expiresAt: z15.string(),
|
|
3122
|
+
status: z15.enum(["pending", "approved", "denied"])
|
|
3123
|
+
});
|
|
3124
|
+
var AuthMethods = z15.object({
|
|
3125
|
+
passkeys: z15.array(Passkey),
|
|
3126
|
+
passkeyAvailability: z15.object({ available: z15.boolean(), reason: z15.string().nullable() }),
|
|
3127
|
+
oidc: z15.object({
|
|
3128
|
+
issuer: z15.string(),
|
|
3129
|
+
label: z15.string(),
|
|
3130
|
+
ownerMatch: z15.string(),
|
|
3131
|
+
status: z15.enum(["ready", "error"]),
|
|
3132
|
+
error: z15.string().nullable()
|
|
3053
3133
|
}).nullable()
|
|
3054
3134
|
});
|
|
3055
|
-
var MeResponse =
|
|
3135
|
+
var MeResponse = z15.object({
|
|
3056
3136
|
device: Device,
|
|
3057
|
-
admin:
|
|
3058
|
-
publicUrl:
|
|
3137
|
+
admin: z15.boolean(),
|
|
3138
|
+
publicUrl: z15.string()
|
|
3059
3139
|
});
|
|
3060
|
-
var
|
|
3061
|
-
message: "
|
|
3140
|
+
var ClientBindingInput = z15.object({ mirror: ClientMirror, scopeId: z15.string().min(1).nullable().optional() }).refine((b) => b.mirror === "scope" === !!b.scopeId, {
|
|
3141
|
+
message: "scopeId is required for mirror=scope and only then"
|
|
3062
3142
|
});
|
|
3063
|
-
var
|
|
3064
|
-
hostId:
|
|
3143
|
+
var ClientReport = Client.pick({ kind: true, name: true, machine: true }).extend({
|
|
3144
|
+
hostId: z15.string().nullable().optional(),
|
|
3065
3145
|
/** Sessions in its mirror tabs or windows; omitted when unchanged or unknown. */
|
|
3066
|
-
shows:
|
|
3067
|
-
/** The binding this
|
|
3068
|
-
seed:
|
|
3069
|
-
});
|
|
3070
|
-
var
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
});
|
|
3086
|
-
var
|
|
3087
|
-
|
|
3088
|
-
var ProjectSuggestionsResponse = z14.object({
|
|
3089
|
-
suggestions: z14.array(ProjectSuggestion.extend({ name: z14.string(), preselected: z14.boolean() }))
|
|
3146
|
+
shows: z15.array(z15.string()).max(1e3).optional(),
|
|
3147
|
+
/** The binding this client had before bindings were recorded (env file); applied only when none is recorded. */
|
|
3148
|
+
seed: ClientBindingInput.optional()
|
|
3149
|
+
});
|
|
3150
|
+
var ScopeInput = z15.object({
|
|
3151
|
+
name: Scope.shape.name,
|
|
3152
|
+
mode: Scope.shape.mode.optional(),
|
|
3153
|
+
projectIds: Scope.shape.projectIds.optional(),
|
|
3154
|
+
hostIds: Scope.shape.hostIds.optional(),
|
|
3155
|
+
/** A GitHub source makes this a GitHub scope; its projects are then kept by GitHub. */
|
|
3156
|
+
source: GitHubSourceInput.nullable().optional()
|
|
3157
|
+
});
|
|
3158
|
+
var ScopePatch = z15.object({
|
|
3159
|
+
name: Scope.shape.name.optional(),
|
|
3160
|
+
mode: Scope.shape.mode.optional(),
|
|
3161
|
+
projectIds: Scope.shape.projectIds.optional(),
|
|
3162
|
+
hostIds: Scope.shape.hostIds.optional(),
|
|
3163
|
+
/** null removes the source; an object changes it, or adds one (then hostId and owner are required). */
|
|
3164
|
+
source: GitHubSourcePatch.nullable().optional()
|
|
3165
|
+
});
|
|
3166
|
+
var ProjectSuggestionsResponse = z15.object({
|
|
3167
|
+
suggestions: z15.array(ProjectSuggestion.extend({ name: z15.string(), preselected: z15.boolean() }))
|
|
3090
3168
|
});
|
|
3091
3169
|
|
|
3092
|
-
// packages/protocol/dist/
|
|
3093
|
-
var
|
|
3170
|
+
// packages/protocol/dist/scopes.js
|
|
3171
|
+
var CLIENT_OPEN_MS = 10 * 6e4;
|
|
3094
3172
|
|
|
3095
3173
|
// packages/protocol/dist/client-wire.js
|
|
3096
|
-
import { z as
|
|
3097
|
-
var SyncState =
|
|
3098
|
-
hosts:
|
|
3099
|
-
projects:
|
|
3100
|
-
checkouts:
|
|
3101
|
-
workspaces:
|
|
3102
|
-
profiles:
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3174
|
+
import { z as z16 } from "zod";
|
|
3175
|
+
var SyncState = z16.object({
|
|
3176
|
+
hosts: z16.array(Host),
|
|
3177
|
+
projects: z16.array(Project),
|
|
3178
|
+
checkouts: z16.array(Checkout),
|
|
3179
|
+
workspaces: z16.array(Workspace),
|
|
3180
|
+
profiles: z16.array(Profile),
|
|
3181
|
+
/** Scopes; absent from coordinators before 0.21. */
|
|
3182
|
+
scopes: z16.array(Scope).default([]),
|
|
3183
|
+
sessions: z16.array(Session),
|
|
3184
|
+
tasks: z16.array(Task),
|
|
3185
|
+
runs: z16.array(Run),
|
|
3186
|
+
automations: z16.array(Automation),
|
|
3187
|
+
attention: z16.array(AttentionItem),
|
|
3188
|
+
interactions: z16.array(Interaction),
|
|
3189
|
+
panels: z16.array(Panel),
|
|
3190
|
+
devices: z16.array(Device),
|
|
3112
3191
|
/** Tracked issues; absent from older coordinators. */
|
|
3113
|
-
issues:
|
|
3114
|
-
/**
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
interactedAt: z15.string().nullable(),
|
|
3124
|
-
viewing: z15.object({ sessionId: z15.string() }).nullable(),
|
|
3192
|
+
issues: z16.array(TrackedIssue).default([]),
|
|
3193
|
+
/** Clients (herdr and tmux sessions); absent from coordinators before 0.21. */
|
|
3194
|
+
clients: z16.array(Client).default([]),
|
|
3195
|
+
adapters: z16.record(z16.string(), z16.array(AdapterInfo)),
|
|
3196
|
+
dispatchPaused: z16.boolean()
|
|
3197
|
+
});
|
|
3198
|
+
var Presence = z16.object({
|
|
3199
|
+
foreground: z16.boolean(),
|
|
3200
|
+
interactedAt: z16.string().nullable(),
|
|
3201
|
+
viewing: z16.object({ sessionId: z16.string() }).nullable(),
|
|
3125
3202
|
/**
|
|
3126
|
-
* A herdr or tmux daemon reporting the session focused in its
|
|
3127
|
-
* device's own presence).
|
|
3203
|
+
* A herdr or tmux daemon reporting the session focused in its client (kept apart from the
|
|
3204
|
+
* device's own presence).
|
|
3128
3205
|
*/
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3206
|
+
clientId: z16.string().min(1).max(200).optional(),
|
|
3207
|
+
/** COMPAT(scopes-rename): remove after 2027-03-01. The old name of clientId. */
|
|
3208
|
+
terminalId: z16.string().min(1).max(200).optional()
|
|
3209
|
+
});
|
|
3210
|
+
var CLIENT_CAPABILITIES = [
|
|
3211
|
+
"adapter.slots.v1",
|
|
3212
|
+
"timeline.cards.v1",
|
|
3213
|
+
"scopes.v1",
|
|
3214
|
+
/** The client reads `ToolItemData.view`. */
|
|
3215
|
+
"tool.views.v1",
|
|
3216
|
+
/** The client draws checklist, facts, rows and badge nodes, `section.open` and URL refs. */
|
|
3217
|
+
"ui.nodes.v2",
|
|
3218
|
+
/** The client draws `composer.tracker` and `session.badge` contributions. */
|
|
3219
|
+
"adapter.trackers.v1"
|
|
3220
|
+
];
|
|
3221
|
+
var ClientToServer = z16.discriminatedUnion("type", [
|
|
3222
|
+
z16.object({
|
|
3223
|
+
type: z16.literal("hello"),
|
|
3224
|
+
cursor: z16.number().int().nullable(),
|
|
3225
|
+
capabilities: z16.array(z16.string().min(1).max(80)).max(32).optional(),
|
|
3226
|
+
projectionId: z16.string().max(256).nullable().optional()
|
|
3138
3227
|
}),
|
|
3139
|
-
|
|
3140
|
-
|
|
3228
|
+
z16.object({ type: z16.literal("presence"), presence: Presence }),
|
|
3229
|
+
z16.object({ type: z16.literal("ping") })
|
|
3141
3230
|
]);
|
|
3142
|
-
var ServerToClient =
|
|
3143
|
-
|
|
3144
|
-
type:
|
|
3145
|
-
seq:
|
|
3146
|
-
events:
|
|
3147
|
-
capabilities:
|
|
3148
|
-
projectionId:
|
|
3231
|
+
var ServerToClient = z16.discriminatedUnion("type", [
|
|
3232
|
+
z16.object({
|
|
3233
|
+
type: z16.literal("replay"),
|
|
3234
|
+
seq: z16.number().int(),
|
|
3235
|
+
events: z16.array(EventEnvelope),
|
|
3236
|
+
capabilities: z16.array(z16.enum(CLIENT_CAPABILITIES)).optional(),
|
|
3237
|
+
projectionId: z16.string().optional()
|
|
3149
3238
|
}),
|
|
3150
|
-
|
|
3151
|
-
type:
|
|
3152
|
-
seq:
|
|
3239
|
+
z16.object({
|
|
3240
|
+
type: z16.literal("snapshot"),
|
|
3241
|
+
seq: z16.number().int(),
|
|
3153
3242
|
state: SyncState,
|
|
3154
|
-
capabilities:
|
|
3155
|
-
projectionId:
|
|
3243
|
+
capabilities: z16.array(z16.enum(CLIENT_CAPABILITIES)).optional(),
|
|
3244
|
+
projectionId: z16.string().optional()
|
|
3156
3245
|
}),
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3246
|
+
z16.object({ type: z16.literal("event"), event: EventEnvelope }),
|
|
3247
|
+
z16.object({ type: z16.literal("stream"), delta: StreamDelta }),
|
|
3248
|
+
z16.object({ type: z16.literal("pong") }),
|
|
3249
|
+
z16.object({ type: z16.literal("force_logout"), reason: z16.string() })
|
|
3161
3250
|
]);
|
|
3162
3251
|
|
|
3163
3252
|
// packages/protocol/dist/ids.js
|
|
@@ -3165,17 +3254,17 @@ import { monotonicFactory } from "ulid";
|
|
|
3165
3254
|
var ulid = monotonicFactory();
|
|
3166
3255
|
|
|
3167
3256
|
// packages/protocol/dist/web-bridge.js
|
|
3168
|
-
import { z as
|
|
3257
|
+
import { z as z17 } from "zod";
|
|
3169
3258
|
var FRAME_MAX_HEIGHT = 4e3;
|
|
3170
|
-
var FrameToParentMessageSchema =
|
|
3171
|
-
|
|
3172
|
-
type:
|
|
3173
|
-
actionId:
|
|
3174
|
-
payload:
|
|
3259
|
+
var FrameToParentMessageSchema = z17.discriminatedUnion("type", [
|
|
3260
|
+
z17.object({
|
|
3261
|
+
type: z17.literal("action"),
|
|
3262
|
+
actionId: z17.string().min(1).max(200),
|
|
3263
|
+
payload: z17.unknown().optional()
|
|
3175
3264
|
}),
|
|
3176
|
-
|
|
3177
|
-
type:
|
|
3178
|
-
height:
|
|
3265
|
+
z17.object({
|
|
3266
|
+
type: z17.literal("resize"),
|
|
3267
|
+
height: z17.number().finite().min(0).max(FRAME_MAX_HEIGHT)
|
|
3179
3268
|
})
|
|
3180
3269
|
]);
|
|
3181
3270
|
|