@spencerboucher/switchyard 0.24.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/bridge/enroll.js +12 -3
- package/dist/bridge/switchyard-terminal.js +16 -0
- package/dist/catalog/worker.js +5937 -0
- package/dist/policies/worker.js +962 -953
- package/dist/switchyard.mjs +2536 -2494
- package/package.json +1 -1
- package/web-dist/assets/AutomationView-BdmWs08y.js +2 -0
- package/web-dist/assets/{AutomationView-BiSxKpgA.js.map → AutomationView-BdmWs08y.js.map} +1 -1
- package/web-dist/assets/{Checkbox-CneW7ZHn.js → Checkbox-9KyxtvcL.js} +2 -2
- package/web-dist/assets/{Checkbox-CneW7ZHn.js.map → Checkbox-9KyxtvcL.js.map} +1 -1
- package/web-dist/assets/{DangerZone-tpxj5S8V.js → DangerZone-CT2xbMEx.js} +2 -2
- package/web-dist/assets/{DangerZone-tpxj5S8V.js.map → DangerZone-CT2xbMEx.js.map} +1 -1
- package/web-dist/assets/{Field-0rAadZ7B.js → Field-D4UpWJFx.js} +2 -2
- package/web-dist/assets/{Field-0rAadZ7B.js.map → Field-D4UpWJFx.js.map} +1 -1
- package/web-dist/assets/{NavigationEditor-DE3vVnHw.js → NavigationEditor-CcxVgkiR.js} +2 -2
- package/web-dist/assets/{NavigationEditor-DE3vVnHw.js.map → NavigationEditor-CcxVgkiR.js.map} +1 -1
- package/web-dist/assets/{Overlay-kkZVSidv.js → Overlay-Cfm4AZk1.js} +2 -2
- package/web-dist/assets/{Overlay-kkZVSidv.js.map → Overlay-Cfm4AZk1.js.map} +1 -1
- package/web-dist/assets/{Priority-VTOBYjs9.js → Priority-DBLBg1FP.js} +2 -2
- package/web-dist/assets/{Priority-VTOBYjs9.js.map → Priority-DBLBg1FP.js.map} +1 -1
- package/web-dist/assets/{RadioCards-Oy23yrpF.js → RadioCards-DoHz_a-g.js} +2 -2
- package/web-dist/assets/{RadioCards-Oy23yrpF.js.map → RadioCards-DoHz_a-g.js.map} +1 -1
- package/web-dist/assets/{ScopeRepository-BU9I7Gs_.js → ScopeRepository-Cg1lXFrM.js} +3 -3
- package/web-dist/assets/{ScopeRepository-BU9I7Gs_.js.map → ScopeRepository-Cg1lXFrM.js.map} +1 -1
- package/web-dist/assets/{ScopeSelect-7ZYRzci5.js → ScopeSelect-DkEghnwv.js} +2 -2
- package/web-dist/assets/{ScopeSelect-7ZYRzci5.js.map → ScopeSelect-DkEghnwv.js.map} +1 -1
- package/web-dist/assets/{SegmentedControl-CCObjCnv.js → SegmentedControl-D6SGXg_K.js} +2 -2
- package/web-dist/assets/{SegmentedControl-CCObjCnv.js.map → SegmentedControl-D6SGXg_K.js.map} +1 -1
- package/web-dist/assets/{Select-CRC4mF4U.js → Select-D41sYIWt.js} +2 -2
- package/web-dist/assets/{Select-CRC4mF4U.js.map → Select-D41sYIWt.js.map} +1 -1
- package/web-dist/assets/StructuredValue-aIPp-NIc.js +5 -0
- package/web-dist/assets/StructuredValue-aIPp-NIc.js.map +1 -0
- package/web-dist/assets/{Switch-llihKH_2.js → Switch-D6hfPoPE.js} +2 -2
- package/web-dist/assets/{Switch-llihKH_2.js.map → Switch-D6hfPoPE.js.map} +1 -1
- package/web-dist/assets/{Tabs-CIolUgNo.js → Tabs-CRXYaXG7.js} +4 -4
- package/web-dist/assets/{Tabs-CIolUgNo.js.map → Tabs-CRXYaXG7.js.map} +1 -1
- package/web-dist/assets/TextLink-DWXZwPZa.js +2 -0
- package/web-dist/assets/{TextLink-BJlPjvKn.js.map → TextLink-DWXZwPZa.js.map} +1 -1
- package/web-dist/assets/{UINodeRenderer-DwZNt-8y.js → UINodeRenderer-BVjIBets.js} +3 -3
- package/web-dist/assets/UINodeRenderer-BVjIBets.js.map +1 -0
- package/web-dist/assets/{UnfilteredNote-B77oGOcW.js → UnfilteredNote-B7TY047m.js} +2 -2
- package/web-dist/assets/{UnfilteredNote-B77oGOcW.js.map → UnfilteredNote-B7TY047m.js.map} +1 -1
- package/web-dist/assets/{api-C7CMr6g-.js → api-C_h6nq6d.js} +2 -2
- package/web-dist/assets/{api-C7CMr6g-.js.map → api-C_h6nq6d.js.map} +1 -1
- package/web-dist/assets/{arrow-down-Bqx9CSB1.js → arrow-down-1LTpTi1H.js} +2 -2
- package/web-dist/assets/{arrow-down-Bqx9CSB1.js.map → arrow-down-1LTpTi1H.js.map} +1 -1
- package/web-dist/assets/{arrow-up-D0b2fv0Q.js → arrow-up-B4uK6ZGO.js} +2 -2
- package/web-dist/assets/{arrow-up-D0b2fv0Q.js.map → arrow-up-B4uK6ZGO.js.map} +1 -1
- package/web-dist/assets/attention--3lxyvUR.js +2 -0
- package/web-dist/assets/{attention-DMhF0I-p.js.map → attention--3lxyvUR.js.map} +1 -1
- package/web-dist/assets/{auth-vd8OFoQx.js → auth-BnOZcMwb.js} +2 -2
- package/web-dist/assets/{auth-vd8OFoQx.js.map → auth-BnOZcMwb.js.map} +1 -1
- package/web-dist/assets/{automations-Dz_JHvUj.js → automations-D-OXGU7s.js} +2 -2
- package/web-dist/assets/{automations-Dz_JHvUj.js.map → automations-D-OXGU7s.js.map} +1 -1
- package/web-dist/assets/board-B2hNZFQA.js +6 -0
- package/web-dist/assets/board-B2hNZFQA.js.map +1 -0
- package/web-dist/assets/{calendar-clock-C5cMYlld.js → calendar-clock-BPYJQFbH.js} +2 -2
- package/web-dist/assets/{calendar-clock-C5cMYlld.js.map → calendar-clock-BPYJQFbH.js.map} +1 -1
- package/web-dist/assets/chevron-right-CmbmRUFj.js +2 -0
- package/web-dist/assets/{chevron-right-5ip-ZfOW.js.map → chevron-right-CmbmRUFj.js.map} +1 -1
- package/web-dist/assets/{code-BpPDYwth.js → code-wpUFOdpF.js} +10 -10
- package/web-dist/assets/code-wpUFOdpF.js.map +1 -0
- package/web-dist/assets/{core.esm-C_QgTrGe.js → core.esm-kWS8EOvg.js} +2 -2
- package/web-dist/assets/{core.esm-C_QgTrGe.js.map → core.esm-kWS8EOvg.js.map} +1 -1
- package/web-dist/assets/{describe-Bd1JbydU.js → describe-C6HLxXjb.js} +3 -3
- package/web-dist/assets/{describe-Bd1JbydU.js.map → describe-C6HLxXjb.js.map} +1 -1
- package/web-dist/assets/{enroll-B_ZjVnEj.js → enroll-ErV_s7ej.js} +2 -2
- package/web-dist/assets/{enroll-B_ZjVnEj.js.map → enroll-ErV_s7ej.js.map} +1 -1
- package/web-dist/assets/{external-link-DeLk0jmb.js → external-link-fqMZHNsZ.js} +2 -2
- package/web-dist/assets/{external-link-DeLk0jmb.js.map → external-link-fqMZHNsZ.js.map} +1 -1
- package/web-dist/assets/{git-branch-DuApoZes.js → git-branch-Bss2qoIr.js} +2 -2
- package/web-dist/assets/{git-branch-DuApoZes.js.map → git-branch-Bss2qoIr.js.map} +1 -1
- package/web-dist/assets/{grip-vertical-DfKSP8jp.js → grip-vertical-DiopZ2MX.js} +2 -2
- package/web-dist/assets/{grip-vertical-DfKSP8jp.js.map → grip-vertical-DiopZ2MX.js.map} +1 -1
- package/web-dist/assets/{hand-ryhCgGbh.js → hand-fz9o4rRo.js} +2 -2
- package/web-dist/assets/{hand-ryhCgGbh.js.map → hand-fz9o4rRo.js.map} +1 -1
- package/web-dist/assets/index-BHIBqflQ.js +17 -0
- package/web-dist/assets/{index-BXoBPAUR.js.map → index-BHIBqflQ.js.map} +1 -1
- package/web-dist/assets/index-CJ9yttLk.css +2 -0
- package/web-dist/assets/{link-2-pHvZvxCs.js → link-2-CM14Jk-Z.js} +2 -2
- package/web-dist/assets/{link-2-pHvZvxCs.js.map → link-2-CM14Jk-Z.js.map} +1 -1
- package/web-dist/assets/{logic-3so3T0af.js → logic-C4E3wcuR.js} +3 -3
- package/web-dist/assets/{logic-3so3T0af.js.map → logic-C4E3wcuR.js.map} +1 -1
- package/web-dist/assets/{logic-uhnfzaYJ.js → logic-CxNUn_Si.js} +2 -2
- package/web-dist/assets/{logic-uhnfzaYJ.js.map → logic-CxNUn_Si.js.map} +1 -1
- package/web-dist/assets/{more-C41VHBVG.js → more-DPa20EIw.js} +2 -2
- package/web-dist/assets/{more-C41VHBVG.js.map → more-DPa20EIw.js.map} +1 -1
- package/web-dist/assets/{pencil-BoQa6LEV.js → pencil-C7o6vJgq.js} +2 -2
- package/web-dist/assets/{pencil-BoQa6LEV.js.map → pencil-C7o6vJgq.js.map} +1 -1
- package/web-dist/assets/{play-DjTVY8Ej.js → play-CFs0JI3B.js} +2 -2
- package/web-dist/assets/{play-DjTVY8Ej.js.map → play-CFs0JI3B.js.map} +1 -1
- package/web-dist/assets/{plus-BQPgQYui.js → plus-DEaNWSMA.js} +2 -2
- package/web-dist/assets/{plus-BQPgQYui.js.map → plus-DEaNWSMA.js.map} +1 -1
- package/web-dist/assets/{policyLogic-cyMrhCM6.js → policyLogic-1QWs7S1X.js} +2 -2
- package/web-dist/assets/{policyLogic-cyMrhCM6.js.map → policyLogic-1QWs7S1X.js.map} +1 -1
- package/web-dist/assets/{prefs-CkiUftvR.js → prefs-C0L6OJW2.js} +2 -2
- package/web-dist/assets/{prefs-CkiUftvR.js.map → prefs-C0L6OJW2.js.map} +1 -1
- package/web-dist/assets/preload-helper-B7-Z6Kuc.js +9 -0
- package/web-dist/assets/preload-helper-B7-Z6Kuc.js.map +1 -0
- package/web-dist/assets/queue-BGH7kGf3.js +2 -0
- package/web-dist/assets/{queue-CSCmR2Xf.js.map → queue-BGH7kGf3.js.map} +1 -1
- package/web-dist/assets/{rotate-ccw-C07CP9JG.js → rotate-ccw-7XsjGljp.js} +2 -2
- package/web-dist/assets/{rotate-ccw-C07CP9JG.js.map → rotate-ccw-7XsjGljp.js.map} +1 -1
- package/web-dist/assets/{search-bqDM8qB0.js → search-cJqErX2K.js} +2 -2
- package/web-dist/assets/{search-bqDM8qB0.js.map → search-cJqErX2K.js.map} +1 -1
- package/web-dist/assets/settings-BWvrxYxe.js +6 -0
- package/web-dist/assets/settings-BWvrxYxe.js.map +1 -0
- package/web-dist/assets/{states-goHGz_CJ.js → states-BtAXMBKP.js} +5 -5
- package/web-dist/assets/states-BtAXMBKP.js.map +1 -0
- package/web-dist/assets/{terminal-BFJK8pLS.js → terminal-CMO1fwr6.js} +2 -2
- package/web-dist/assets/{terminal-BFJK8pLS.js.map → terminal-CMO1fwr6.js.map} +1 -1
- package/web-dist/assets/{terminal-login-DwI8gUw-.js → terminal-login-B4ilxY0w.js} +2 -2
- package/web-dist/assets/{terminal-login-DwI8gUw-.js.map → terminal-login-B4ilxY0w.js.map} +1 -1
- package/web-dist/assets/{useBreakpoint-C7ONetzK.js → useBreakpoint-DQmHoUda.js} +2 -2
- package/web-dist/assets/{useBreakpoint-C7ONetzK.js.map → useBreakpoint-DQmHoUda.js.map} +1 -1
- package/web-dist/assets/{useNow-BFhACgmu.js → useNow-DAkRYkgZ.js} +2 -2
- package/web-dist/assets/{useNow-BFhACgmu.js.map → useNow-DAkRYkgZ.js.map} +1 -1
- package/web-dist/assets/{useResource-Br3v4Sui.js → useResource-BYljUzPs.js} +2 -2
- package/web-dist/assets/{useResource-Br3v4Sui.js.map → useResource-BYljUzPs.js.map} +1 -1
- package/web-dist/assets/{useSwipeTabs-_JvGirwa.js → useSwipeTabs-DEx87Ogc.js} +2 -2
- package/web-dist/assets/{useSwipeTabs-_JvGirwa.js.map → useSwipeTabs-DEx87Ogc.js.map} +1 -1
- package/web-dist/assets/workboard-6c73HyIJ.js +3 -0
- package/web-dist/assets/{workboard-IozvaLbf.js.map → workboard-6c73HyIJ.js.map} +1 -1
- package/web-dist/index.html +8 -8
- package/web-dist/sw.js +1 -1
- package/web-dist/assets/AutomationView-BiSxKpgA.js +0 -2
- package/web-dist/assets/StructuredValue-DdwqFsZd.js +0 -5
- package/web-dist/assets/StructuredValue-DdwqFsZd.js.map +0 -1
- package/web-dist/assets/TextLink-BJlPjvKn.js +0 -2
- package/web-dist/assets/UINodeRenderer-DwZNt-8y.js.map +0 -1
- package/web-dist/assets/attention-DMhF0I-p.js +0 -2
- package/web-dist/assets/board-CMfIsKrb.js +0 -6
- package/web-dist/assets/board-CMfIsKrb.js.map +0 -1
- package/web-dist/assets/chevron-right-5ip-ZfOW.js +0 -2
- package/web-dist/assets/code-BpPDYwth.js.map +0 -1
- package/web-dist/assets/index-BXoBPAUR.js +0 -17
- package/web-dist/assets/index-Bm6tklht.css +0 -2
- package/web-dist/assets/preload-helper-B_HW6k8N.js +0 -9
- package/web-dist/assets/preload-helper-B_HW6k8N.js.map +0 -1
- package/web-dist/assets/queue-CSCmR2Xf.js +0 -2
- package/web-dist/assets/settings-iTwK6CzQ.js +0 -6
- package/web-dist/assets/settings-iTwK6CzQ.js.map +0 -1
- package/web-dist/assets/states-goHGz_CJ.js.map +0 -1
- package/web-dist/assets/workboard-IozvaLbf.js +0 -3
package/dist/policies/worker.js
CHANGED
|
@@ -162,10 +162,14 @@ var UINodeSchema = z2.lazy(() => z2.discriminatedUnion("t", [
|
|
|
162
162
|
}),
|
|
163
163
|
z2.object({
|
|
164
164
|
t: z2.literal("actions"),
|
|
165
|
+
label: z2.string().min(1).max(80).optional(),
|
|
166
|
+
layout: z2.enum(["row", "segmented"]).optional(),
|
|
165
167
|
actions: z2.array(z2.object({
|
|
166
168
|
id: z2.string(),
|
|
167
169
|
label: z2.string(),
|
|
168
|
-
tone: z2.enum(["default", "primary", "danger"]).optional()
|
|
170
|
+
tone: z2.enum(["default", "primary", "danger"]).optional(),
|
|
171
|
+
active: z2.boolean().optional(),
|
|
172
|
+
disabled: z2.boolean().optional()
|
|
169
173
|
}))
|
|
170
174
|
}),
|
|
171
175
|
z2.object({
|
|
@@ -243,6 +247,8 @@ var ContributionPlacement = z3.enum([
|
|
|
243
247
|
"composer.pill",
|
|
244
248
|
/** `adapter.trackers.v1`: a live summary above the input that opens its detail. */
|
|
245
249
|
"composer.tracker",
|
|
250
|
+
/** `composer.suggestions.v1`: an editable next-prompt or command suggestion in the composer. */
|
|
251
|
+
"composer.suggestion",
|
|
246
252
|
/** `adapter.trackers.v1`: a short word on the session's navigator row. */
|
|
247
253
|
"session.badge",
|
|
248
254
|
"palette.item",
|
|
@@ -258,11 +264,18 @@ var TrackerSummary = z3.object({
|
|
|
258
264
|
/** The step in progress, such as the current todo. */
|
|
259
265
|
step: z3.string().min(1).max(120).optional()
|
|
260
266
|
}).strict();
|
|
267
|
+
var ComposerSuggestion = z3.object({
|
|
268
|
+
/** Exact text inserted into the composer when accepted (never auto-sent). */
|
|
269
|
+
text: z3.string().min(1).max(4e3),
|
|
270
|
+
/** Presentation hint (default "prompt"). */
|
|
271
|
+
kind: z3.enum(["prompt", "command"]).optional()
|
|
272
|
+
}).strict();
|
|
261
273
|
var Common = {
|
|
262
274
|
placement: ContributionPlacement,
|
|
263
275
|
order: z3.number().int().min(-1e3).max(1e3).optional(),
|
|
264
276
|
actionId: ActionId.optional(),
|
|
265
|
-
tracker: TrackerSummary.optional()
|
|
277
|
+
tracker: TrackerSummary.optional(),
|
|
278
|
+
suggestion: ComposerSuggestion.optional()
|
|
266
279
|
};
|
|
267
280
|
var ContributionDescriptor = z3.object({
|
|
268
281
|
id: Id,
|
|
@@ -291,6 +304,12 @@ var ContributionDescriptor = z3.object({
|
|
|
291
304
|
if (v.placement !== "composer.tracker" && v.tracker !== void 0) {
|
|
292
305
|
ctx.addIssue({ code: "custom", message: "Only composer trackers have a tracker summary" });
|
|
293
306
|
}
|
|
307
|
+
if (v.placement === "composer.suggestion" && !v.suggestion) {
|
|
308
|
+
ctx.addIssue({ code: "custom", message: "Composer suggestions require a suggestion" });
|
|
309
|
+
}
|
|
310
|
+
if (v.placement !== "composer.suggestion" && v.suggestion !== void 0) {
|
|
311
|
+
ctx.addIssue({ code: "custom", message: "Only composer suggestions have a suggestion" });
|
|
312
|
+
}
|
|
294
313
|
});
|
|
295
314
|
var ContributionInput = z3.object({
|
|
296
315
|
...Common,
|
|
@@ -378,6 +397,9 @@ function validateContribution(id, input) {
|
|
|
378
397
|
if (descriptor.placement === "composer.pill" && node.t !== "text" && node.t !== "progress") {
|
|
379
398
|
throw new Error("Composer pill content must be text or progress");
|
|
380
399
|
}
|
|
400
|
+
if (descriptor.placement === "composer.suggestion" && node.t !== "text" && node.t !== "code") {
|
|
401
|
+
throw new Error("Composer suggestion content must be text or code");
|
|
402
|
+
}
|
|
381
403
|
if (descriptor.placement === "session.badge") {
|
|
382
404
|
if (node.t !== "text" && node.t !== "badge") {
|
|
383
405
|
throw new Error("Session badge content must be text or a badge");
|
|
@@ -434,30 +456,42 @@ var displayUrl = z4.string().max(4096).refine((s) => {
|
|
|
434
456
|
return false;
|
|
435
457
|
}
|
|
436
458
|
});
|
|
459
|
+
var AUTHORITY_RE = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+$/;
|
|
460
|
+
var GitAuthority = z4.string().trim().transform((s) => s.toLowerCase()).refine((s) => s.length <= 253 && AUTHORITY_RE.test(s) && !/^\d+(?:\.\d+)*$/.test(s), {
|
|
461
|
+
message: "Invalid Git authority hostname"
|
|
462
|
+
});
|
|
437
463
|
var githubUrl = displayUrl.refine((s) => {
|
|
438
464
|
try {
|
|
439
465
|
const u = new URL(s);
|
|
440
|
-
return u.protocol === "https:" &&
|
|
466
|
+
return u.protocol === "https:" && !u.port && /^https:\/\/[^/:?#]+(?:[/?#]|$)/i.test(s) && GitAuthority.safeParse(u.hostname).success;
|
|
441
467
|
} catch {
|
|
442
468
|
return false;
|
|
443
469
|
}
|
|
444
470
|
});
|
|
445
471
|
var GitHubRepository = z4.string().regex(/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?\/(?!\.{1,2}$)[A-Za-z0-9_.-]{1,100}$/);
|
|
446
|
-
var issuePath = /^[hH][tT][tT][pP][sS]:\/\/[
|
|
472
|
+
var issuePath = /^[hH][tT][tT][pP][sS]:\/\/([^/:?#]+)\/([^/]+)\/([^/]+)\/issues\/([1-9][0-9]*)$/;
|
|
447
473
|
var GitHubIssueUrl = z4.string().trim().transform((raw, ctx) => {
|
|
448
474
|
const match = issuePath.exec(raw);
|
|
449
|
-
const
|
|
450
|
-
|
|
475
|
+
const authority = match ? GitAuthority.safeParse(match[1]) : null;
|
|
476
|
+
const number = match ? Number(match[4]) : NaN;
|
|
477
|
+
if (!match || !authority?.success || authority.data === "www.github.com" || !GitHubRepository.safeParse(`${match[2]}/${match[3]}`).success || !Number.isSafeInteger(number)) {
|
|
451
478
|
ctx.addIssue({ code: "custom", message: "Invalid GitHub issue URL" });
|
|
452
479
|
return z4.NEVER;
|
|
453
480
|
}
|
|
454
|
-
return `https
|
|
481
|
+
return `https://${authority.data}/${match[2]}/${match[3]}/issues/${number}`;
|
|
455
482
|
});
|
|
456
483
|
function issueParts(url) {
|
|
457
484
|
const match = issuePath.exec(url);
|
|
458
|
-
return {
|
|
485
|
+
return {
|
|
486
|
+
authority: match[1].toLowerCase(),
|
|
487
|
+
repository: `${match[2]}/${match[3]}`,
|
|
488
|
+
number: Number(match[4])
|
|
489
|
+
};
|
|
459
490
|
}
|
|
460
491
|
function issuePrompt(url) {
|
|
492
|
+
return `Work on GitHub issue ${url}.`;
|
|
493
|
+
}
|
|
494
|
+
function legacyGhIssuePrompt(url) {
|
|
461
495
|
return `${url}
|
|
462
496
|
|
|
463
497
|
Read it with \`gh issue view ${url}\`.`;
|
|
@@ -477,11 +511,12 @@ var GitHubIssue = z4.object({
|
|
|
477
511
|
launchPrompt: z4.string()
|
|
478
512
|
}).strict().refine((v) => {
|
|
479
513
|
const parts = issueParts(v.url);
|
|
480
|
-
return v.repository === parts.repository && v.number === parts.number && v.launchPrompt === issuePrompt(v.url);
|
|
514
|
+
return v.repository === parts.repository && v.number === parts.number && (v.launchPrompt === issuePrompt(v.url) || v.launchPrompt === legacyGhIssuePrompt(v.url));
|
|
481
515
|
});
|
|
482
516
|
function githubIssueFromUrl(raw) {
|
|
483
517
|
const url = GitHubIssueUrl.parse(raw);
|
|
484
|
-
|
|
518
|
+
const { repository, number } = issueParts(url);
|
|
519
|
+
return { repository, number, url, launchPrompt: issuePrompt(url) };
|
|
485
520
|
}
|
|
486
521
|
var GitHubSha = z4.string().regex(/^[0-9a-f]{40}$/);
|
|
487
522
|
var prUrl = githubUrl.refine((s) => {
|
|
@@ -722,7 +757,7 @@ var GitHubSource = z5.object({
|
|
|
722
757
|
/** Make a worktree for an issue branch that has none; absent means true. */
|
|
723
758
|
worktrees: z5.boolean().optional(),
|
|
724
759
|
enabled: z5.boolean(),
|
|
725
|
-
/** The
|
|
760
|
+
/** The connected GitHub account login, from the last sync. */
|
|
726
761
|
login: z5.string().nullable(),
|
|
727
762
|
lastSyncedAt: Iso.nullable(),
|
|
728
763
|
lastError: z5.string().max(2e3).nullable()
|
|
@@ -2244,759 +2279,253 @@ var AgentResultFrame = z11.discriminatedUnion("ok", [
|
|
|
2244
2279
|
]);
|
|
2245
2280
|
|
|
2246
2281
|
// packages/protocol/dist/api.js
|
|
2247
|
-
import { z as z15 } from "zod";
|
|
2248
|
-
|
|
2249
|
-
// packages/protocol/dist/host-wire.js
|
|
2250
|
-
import { z as z14 } from "zod";
|
|
2251
|
-
|
|
2252
|
-
// packages/protocol/dist/events.js
|
|
2253
2282
|
import { z as z12 } from "zod";
|
|
2254
|
-
var
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
"project.deleted": z12.object({ id: z12.string() }),
|
|
2258
|
-
"checkout.updated": Checkout,
|
|
2259
|
-
"workspace.updated": Workspace,
|
|
2260
|
-
"workspace.deleted": z12.object({ id: z12.string() }),
|
|
2261
|
-
"profile.updated": Profile,
|
|
2262
|
-
"profile.deleted": z12.object({ id: z12.string() }),
|
|
2263
|
-
"scope.updated": Scope,
|
|
2264
|
-
"scope.deleted": z12.object({ id: z12.string() }),
|
|
2265
|
-
"session.updated": Session,
|
|
2266
|
-
"transcript.item": TranscriptItem,
|
|
2267
|
-
"transcript.reset": z12.object({ sessionId: z12.string(), epoch: z12.number().int() }),
|
|
2268
|
-
"interaction.updated": Interaction,
|
|
2269
|
-
"panel.updated": Panel,
|
|
2270
|
-
"adapters.updated": z12.object({ hostId: z12.string(), adapters: z12.array(AdapterInfo) }),
|
|
2271
|
-
diagnostic: Diagnostic,
|
|
2272
|
-
"task.updated": Task,
|
|
2273
|
-
"task.deleted": z12.object({ id: z12.string() }),
|
|
2274
|
-
"run.updated": Run,
|
|
2275
|
-
"automation.updated": Automation,
|
|
2276
|
-
"automation.deleted": z12.object({ id: z12.string() }),
|
|
2277
|
-
"occurrence.created": Occurrence,
|
|
2278
|
-
"occurrence.updated": Occurrence,
|
|
2279
|
-
"attention.updated": AttentionItem,
|
|
2280
|
-
"device.updated": Device,
|
|
2281
|
-
"issue.updated": TrackedIssue,
|
|
2282
|
-
"issue.deleted": z12.object({ id: z12.string() }),
|
|
2283
|
-
"client.updated": Client,
|
|
2284
|
-
"client.deleted": z12.object({ id: z12.string() }),
|
|
2285
|
-
"settings.updated": z12.object({ dispatchPaused: z12.boolean() })
|
|
2286
|
-
};
|
|
2287
|
-
var EVENT_TYPES = Object.keys(EventDataSchemas);
|
|
2288
|
-
var LEGACY_EVENT_TYPES = {
|
|
2289
|
-
"workspace.removed": "workspace.deleted"
|
|
2290
|
-
};
|
|
2291
|
-
function canonicalEventType(type) {
|
|
2292
|
-
return LEGACY_EVENT_TYPES[type] ?? type;
|
|
2293
|
-
}
|
|
2294
|
-
var canonical = (v) => typeof v === "string" ? canonicalEventType(v) : v;
|
|
2295
|
-
var EventTypeSchema = z12.preprocess(canonical, z12.enum(EVENT_TYPES));
|
|
2296
|
-
var EventScope = z12.object({
|
|
2297
|
-
hostId: z12.string().optional(),
|
|
2298
|
-
sessionId: z12.string().optional(),
|
|
2299
|
-
taskId: z12.string().optional(),
|
|
2300
|
-
projectId: z12.string().optional()
|
|
2301
|
-
});
|
|
2302
|
-
var EventEnvelope = EventScope.extend({
|
|
2303
|
-
seq: z12.number().int(),
|
|
2304
|
-
id: z12.string(),
|
|
2305
|
-
type: EventTypeSchema,
|
|
2306
|
-
at: z12.string(),
|
|
2307
|
-
data: z12.unknown()
|
|
2308
|
-
});
|
|
2309
|
-
var HOST_EVENT_TYPES = [
|
|
2310
|
-
"session.updated",
|
|
2311
|
-
"transcript.item",
|
|
2312
|
-
"interaction.updated",
|
|
2313
|
-
"panel.updated",
|
|
2314
|
-
"adapters.updated",
|
|
2315
|
-
"diagnostic",
|
|
2316
|
-
"workspace.updated",
|
|
2317
|
-
"workspace.deleted"
|
|
2318
|
-
];
|
|
2319
|
-
var HostEvent = EventScope.extend({
|
|
2320
|
-
eventId: z12.string(),
|
|
2321
|
-
type: z12.preprocess(canonical, z12.enum(HOST_EVENT_TYPES)),
|
|
2322
|
-
at: z12.string(),
|
|
2323
|
-
data: z12.unknown()
|
|
2324
|
-
});
|
|
2325
|
-
var StreamDelta = z12.object({
|
|
2326
|
-
sessionId: z12.string(),
|
|
2327
|
-
itemId: z12.string(),
|
|
2328
|
-
kind: z12.enum(["text", "thinking", "tool_args", "tool_output"]),
|
|
2329
|
-
delta: z12.string(),
|
|
2330
|
-
order: z12.number().int().optional()
|
|
2331
|
-
});
|
|
2332
|
-
|
|
2333
|
-
// packages/protocol/dist/terminal-wire.js
|
|
2334
|
-
import { z as z13 } from "zod";
|
|
2335
|
-
var Cols = z13.number().int().min(10).max(1e3);
|
|
2336
|
-
var Rows = z13.number().int().min(5).max(500);
|
|
2337
|
-
var TermViewerToServer = z13.discriminatedUnion("t", [
|
|
2338
|
-
z13.object({ t: z13.literal("in"), d: z13.string() }),
|
|
2339
|
-
z13.object({ t: z13.literal("resize"), cols: Cols, rows: Rows }),
|
|
2340
|
-
z13.object({ t: z13.literal("claim") })
|
|
2341
|
-
]);
|
|
2342
|
-
var TermServerToViewer = z13.discriminatedUnion("t", [
|
|
2343
|
-
z13.object({ t: z13.literal("out"), d: z13.string() }),
|
|
2344
|
-
z13.object({ t: z13.literal("closed"), reason: z13.string() }),
|
|
2345
|
-
z13.object({ t: z13.literal("size"), cols: Cols, rows: Rows, owner: z13.boolean() })
|
|
2346
|
-
]);
|
|
2347
|
-
var TermCoordinatorMsg = z13.discriminatedUnion("t", [
|
|
2348
|
-
z13.object({
|
|
2349
|
-
t: z13.literal("open"),
|
|
2350
|
-
sessionId: z13.string(),
|
|
2351
|
-
cols: Cols,
|
|
2352
|
-
rows: Rows,
|
|
2353
|
-
passive: z13.boolean().optional()
|
|
2354
|
-
}),
|
|
2355
|
-
z13.object({ t: z13.literal("claim") }),
|
|
2356
|
-
z13.object({ t: z13.literal("in"), d: z13.string() }),
|
|
2357
|
-
z13.object({ t: z13.literal("resize"), cols: Cols, rows: Rows }),
|
|
2358
|
-
z13.object({ t: z13.literal("close") })
|
|
2359
|
-
]);
|
|
2360
|
-
|
|
2361
|
-
// packages/protocol/dist/host-wire.js
|
|
2362
|
-
var Origin = z14.enum(["human", "automation"]);
|
|
2363
|
-
var DiffRev = z14.string().regex(/^(uncommitted|[0-9a-f]{40})$/);
|
|
2364
|
-
var HostCommand = z14.discriminatedUnion("type", [
|
|
2365
|
-
z14.object({
|
|
2366
|
-
type: z14.literal("session.start"),
|
|
2367
|
-
sessionId: z14.string(),
|
|
2368
|
-
title: z14.string(),
|
|
2369
|
-
workspacePath: z14.string(),
|
|
2370
|
-
projectId: z14.string().nullable(),
|
|
2371
|
-
profile: Profile,
|
|
2372
|
-
nativeHandle: NativeHandle.nullable(),
|
|
2373
|
-
initialPrompt: z14.string().nullable(),
|
|
2374
|
-
dispatchKey: z14.string().nullable(),
|
|
2375
|
-
controlRevision: z14.number().int(),
|
|
2376
|
-
controlMode: ControlMode,
|
|
2377
|
-
origin: Origin,
|
|
2378
|
-
readOnly: z14.boolean().default(false),
|
|
2379
|
-
policyRequired: z14.boolean().optional()
|
|
2380
|
-
}),
|
|
2381
|
-
z14.object({
|
|
2382
|
-
type: z14.literal("session.deliverMessage"),
|
|
2383
|
-
sessionId: z14.string(),
|
|
2384
|
-
messageId: z14.string(),
|
|
2385
|
-
payload: z14.object({
|
|
2386
|
-
deliveryId: z14.string(),
|
|
2387
|
-
kind: z14.enum(["message", "completion"]),
|
|
2388
|
-
text: z14.string()
|
|
2389
|
-
}),
|
|
2390
|
-
mode: z14.enum(["steer", "queue"]),
|
|
2391
|
-
holdUntil: z14.string()
|
|
2392
|
-
}),
|
|
2393
|
-
HostPolicySampleRequest.extend({ type: z14.literal("session.classifyPolicySample") }),
|
|
2394
|
-
z14.object({
|
|
2395
|
-
type: z14.literal("session.messageStatus"),
|
|
2396
|
-
sessionId: z14.string(),
|
|
2397
|
-
messageIds: z14.array(z14.string().min(1)).min(1).max(100)
|
|
2398
|
-
}),
|
|
2399
|
-
z14.object({
|
|
2400
|
-
type: z14.literal("session.prompt"),
|
|
2401
|
-
sessionId: z14.string(),
|
|
2402
|
-
text: z14.string(),
|
|
2403
|
-
images: z14.array(z14.object({ mimeType: z14.string(), data: z14.string() })).default([]),
|
|
2404
|
-
mode: z14.enum(["prompt", "steer", "followUp"]),
|
|
2405
|
-
origin: Origin,
|
|
2406
|
-
controlRevision: z14.number().int()
|
|
2407
|
-
}),
|
|
2408
|
-
z14.object({ type: z14.literal("session.abort"), sessionId: z14.string(), clearQueue: z14.boolean() }),
|
|
2409
|
-
/** `queueClear.v1`: empty Pi's queue without aborting; the receipt's result has the messages. */
|
|
2410
|
-
z14.object({ type: z14.literal("session.clearQueue"), sessionId: z14.string() }),
|
|
2411
|
-
z14.object({ type: z14.literal("session.stop"), sessionId: z14.string() }),
|
|
2412
|
-
z14.object({
|
|
2413
|
-
type: z14.literal("session.answer"),
|
|
2414
|
-
sessionId: z14.string(),
|
|
2415
|
-
interactionId: z14.string(),
|
|
2416
|
-
revision: z14.number().int(),
|
|
2417
|
-
response: InteractionResponseSchema,
|
|
2418
|
-
deviceId: z14.string()
|
|
2419
|
-
}),
|
|
2420
|
-
z14.object({
|
|
2421
|
-
type: z14.literal("session.adapterAction"),
|
|
2422
|
-
sessionId: z14.string(),
|
|
2423
|
-
generation: z14.string().uuid().optional(),
|
|
2424
|
-
adapterId: z14.string(),
|
|
2425
|
-
actionId: z14.string(),
|
|
2426
|
-
payload: z14.unknown()
|
|
2427
|
-
}),
|
|
2428
|
-
z14.object({
|
|
2429
|
-
type: z14.literal("session.setControl"),
|
|
2430
|
-
sessionId: z14.string(),
|
|
2431
|
-
controlRevision: z14.number().int(),
|
|
2432
|
-
mode: ControlMode
|
|
2433
|
-
}),
|
|
2434
|
-
z14.object({ type: z14.literal("session.rename"), sessionId: z14.string(), title: z14.string() }),
|
|
2435
|
-
z14.object({ type: z14.literal("session.importable") }),
|
|
2436
|
-
z14.object({ type: z14.literal("session.readNative"), sessionFile: z14.string() }),
|
|
2437
|
-
z14.object({ type: z14.literal("session.snapshot"), sessionId: z14.string() }),
|
|
2438
|
-
z14.object({ type: z14.literal("session.models"), sessionId: z14.string() }),
|
|
2439
|
-
z14.object({ type: z14.literal("session.commands"), sessionId: z14.string() }),
|
|
2440
|
-
z14.object({
|
|
2441
|
-
type: z14.literal("session.complete"),
|
|
2442
|
-
sessionId: z14.string(),
|
|
2443
|
-
text: z14.string().max(500)
|
|
2444
|
-
}),
|
|
2445
|
-
z14.object({ type: z14.literal("session.tree"), sessionId: z14.string() }),
|
|
2446
|
-
z14.object({
|
|
2447
|
-
type: z14.literal("session.branch"),
|
|
2448
|
-
sessionId: z14.string(),
|
|
2449
|
-
entryId: z14.string().nullable(),
|
|
2450
|
-
fork: z14.boolean()
|
|
2451
|
-
}),
|
|
2452
|
-
z14.object({
|
|
2453
|
-
type: z14.literal("session.navigate"),
|
|
2454
|
-
sessionId: z14.string(),
|
|
2455
|
-
entryId: z14.string(),
|
|
2456
|
-
summarize: z14.boolean(),
|
|
2457
|
-
instructions: z14.string().max(2e3).nullable()
|
|
2458
|
-
}),
|
|
2459
|
-
z14.object({ type: z14.literal("session.reload"), sessionId: z14.string() }),
|
|
2460
|
-
z14.object({ type: z14.literal("session.adapters"), sessionId: z14.string() }),
|
|
2461
|
-
z14.object({ type: z14.literal("session.reloadAdapters"), sessionId: z14.string() }),
|
|
2462
|
-
z14.object({ type: z14.literal("session.export"), sessionId: z14.string() }),
|
|
2463
|
-
z14.object({
|
|
2464
|
-
type: z14.literal("session.setModel"),
|
|
2465
|
-
sessionId: z14.string(),
|
|
2466
|
-
provider: z14.string().min(1),
|
|
2467
|
-
modelId: z14.string().min(1)
|
|
2468
|
-
}),
|
|
2469
|
-
z14.object({ type: z14.literal("session.setThinking"), sessionId: z14.string(), level: ThinkingLevel }),
|
|
2470
|
-
z14.object({
|
|
2471
|
-
type: z14.literal("session.compact"),
|
|
2472
|
-
sessionId: z14.string(),
|
|
2473
|
-
instructions: z14.string().nullable()
|
|
2474
|
-
}),
|
|
2475
|
-
z14.object({ type: z14.literal("checkout.inspect"), path: z14.string() }),
|
|
2476
|
-
z14.strictObject({
|
|
2477
|
-
type: z14.literal("checkout.preview"),
|
|
2478
|
-
root: z14.string().min(1).max(4096),
|
|
2479
|
-
folderName: z14.string().min(1).max(128)
|
|
2480
|
-
}),
|
|
2481
|
-
z14.strictObject({
|
|
2482
|
-
type: z14.literal("checkout.provision"),
|
|
2483
|
-
root: z14.string().min(1).max(4096),
|
|
2484
|
-
folderName: z14.string().min(1).max(128),
|
|
2485
|
-
expectedPath: z14.string().min(1).max(4096),
|
|
2486
|
-
cloneUrl: z14.string().min(1).max(4096),
|
|
2487
|
-
/** Only carried by a confirmed live command. Never persist or replay this payload. */
|
|
2488
|
-
grant: z14.strictObject({
|
|
2489
|
-
token: z14.string().min(1).max(4096).refine((token) => !/[^!-~]/.test(token)),
|
|
2490
|
-
expiresAt: z14.iso.datetime({ offset: true })
|
|
2491
|
-
})
|
|
2492
|
-
}),
|
|
2493
|
-
z14.strictObject({ type: z14.literal("checkout.locate"), cwd: z14.string().min(1).max(4096) }),
|
|
2494
|
-
z14.object({ type: z14.literal("projects.scan"), folder: z14.string().min(1) }),
|
|
2495
|
-
z14.object({
|
|
2496
|
-
type: z14.literal("projects.suggest"),
|
|
2497
|
-
days: z14.number().int().min(1).max(365).default(30)
|
|
2498
|
-
}),
|
|
2499
|
-
z14.object({
|
|
2500
|
-
type: z14.literal("workspace.discover"),
|
|
2501
|
-
checkoutPath: z14.string(),
|
|
2502
|
-
worktreeDir: z14.string().default(DEFAULT_WORKTREE_DIR)
|
|
2503
|
-
}),
|
|
2504
|
-
z14.object({
|
|
2505
|
-
type: z14.literal("workspace.create"),
|
|
2506
|
-
checkoutPath: z14.string(),
|
|
2507
|
-
branch: z14.string(),
|
|
2508
|
-
base: z14.string(),
|
|
2509
|
-
setupCommand: z14.string().nullable(),
|
|
2510
|
-
worktreeDir: z14.string().default(DEFAULT_WORKTREE_DIR)
|
|
2511
|
-
}),
|
|
2512
|
-
z14.object({ type: z14.literal("workspace.status"), path: z14.string(), base: z14.string().nullable() }),
|
|
2513
|
-
z14.object({
|
|
2514
|
-
type: z14.literal("workspace.remove"),
|
|
2515
|
-
path: z14.string(),
|
|
2516
|
-
checkoutPath: z14.string(),
|
|
2517
|
-
base: z14.string().nullable(),
|
|
2518
|
-
force: z14.object({ dirty: z14.boolean(), unmerged: z14.boolean() }),
|
|
2519
|
-
/** Also delete the worktree's local branch (hosts before GitHub issue sync ignore it). */
|
|
2520
|
-
deleteBranch: z14.boolean().optional()
|
|
2521
|
-
}),
|
|
2522
|
-
z14.object({
|
|
2523
|
-
type: z14.literal("workspace.diff"),
|
|
2524
|
-
path: z14.string(),
|
|
2525
|
-
base: z14.string().nullable(),
|
|
2526
|
-
file: z14.string().nullable(),
|
|
2527
|
-
/** Hosts without gitLog.v1 never receive it. */
|
|
2528
|
-
rev: DiffRev.optional()
|
|
2529
|
-
}),
|
|
2530
|
-
z14.object({
|
|
2531
|
-
type: z14.literal("workspace.log"),
|
|
2532
|
-
path: z14.string(),
|
|
2533
|
-
base: z14.string().nullable(),
|
|
2534
|
-
limit: z14.number().int().min(1).max(200)
|
|
2535
|
-
}),
|
|
2536
|
-
z14.object({ type: z14.literal("workspace.files"), path: z14.string(), dir: z14.string() }),
|
|
2537
|
-
z14.object({ type: z14.literal("workspace.readFile"), path: z14.string(), file: z14.string() }),
|
|
2538
|
-
IssueHostPrepareBranchRequest.extend({ type: z14.literal("tracker.prepareBranch") }),
|
|
2539
|
-
z14.object({
|
|
2540
|
-
type: z14.literal("dispatch.start"),
|
|
2541
|
-
dispatchKey: z14.string(),
|
|
2542
|
-
runId: z14.string(),
|
|
2543
|
-
taskId: z14.string(),
|
|
2544
|
-
sessionId: z14.string(),
|
|
2545
|
-
projectId: z14.string(),
|
|
2546
|
-
title: z14.string(),
|
|
2547
|
-
workspace: z14.union([
|
|
2548
|
-
z14.object({ path: z14.string() }),
|
|
2549
|
-
z14.object({
|
|
2550
|
-
createFrom: z14.object({
|
|
2551
|
-
checkoutPath: z14.string(),
|
|
2552
|
-
branch: z14.string(),
|
|
2553
|
-
base: z14.string(),
|
|
2554
|
-
setupCommand: z14.string().nullable(),
|
|
2555
|
-
worktreeDir: z14.string().default(DEFAULT_WORKTREE_DIR)
|
|
2556
|
-
})
|
|
2557
|
-
})
|
|
2558
|
-
]),
|
|
2559
|
-
nativeHandle: NativeHandle.nullable(),
|
|
2560
|
-
profile: Profile,
|
|
2561
|
-
prompt: z14.string(),
|
|
2562
|
-
/** The launch's own revision; a takeover always carries a newer one. */
|
|
2563
|
-
controlRevision: z14.number().int(),
|
|
2564
|
-
controlMode: ControlMode.default("automation"),
|
|
2565
|
-
policyRequired: z14.boolean().optional()
|
|
2566
|
-
}),
|
|
2567
|
-
z14.object({ type: z14.literal("dispatch.reconcile"), dispatchKey: z14.string() }),
|
|
2568
|
-
z14.object({
|
|
2569
|
-
type: z14.literal("checks.run"),
|
|
2570
|
-
sessionId: z14.string(),
|
|
2571
|
-
path: z14.string(),
|
|
2572
|
-
commands: z14.array(z14.string())
|
|
2573
|
-
})
|
|
2574
|
-
]);
|
|
2575
|
-
var ImportableSession = z14.object({
|
|
2576
|
-
sessionFile: z14.string(),
|
|
2577
|
-
sessionId: z14.string(),
|
|
2578
|
-
cwd: z14.string(),
|
|
2579
|
-
name: z14.string().nullable(),
|
|
2580
|
-
mtime: z14.string(),
|
|
2581
|
-
inactive: z14.boolean()
|
|
2582
|
-
});
|
|
2583
|
-
var DiscoveredWorktree = z14.object({
|
|
2584
|
-
path: z14.string(),
|
|
2585
|
-
head: z14.string().nullable(),
|
|
2586
|
-
branch: z14.string().nullable(),
|
|
2587
|
-
bare: z14.boolean(),
|
|
2588
|
-
detached: z14.boolean(),
|
|
2589
|
-
locked: z14.boolean(),
|
|
2590
|
-
prunable: z14.boolean(),
|
|
2591
|
-
provenance: z14.enum(["managed", "discovered", "main"]),
|
|
2592
|
-
git: GitState.nullable()
|
|
2593
|
-
});
|
|
2594
|
-
var CheckoutInfo = z14.object({
|
|
2595
|
-
root: z14.string(),
|
|
2596
|
-
commonDir: z14.string(),
|
|
2597
|
-
repoIdentity: z14.string(),
|
|
2598
|
-
defaultBranch: z14.string()
|
|
2599
|
-
});
|
|
2600
|
-
var CheckoutPreviewResult = z14.object({
|
|
2601
|
-
path: z14.string(),
|
|
2602
|
-
root: z14.string(),
|
|
2603
|
-
state: z14.enum(["missing", "existing", "collision"]),
|
|
2604
|
-
checkout: CheckoutInfo.optional()
|
|
2605
|
-
});
|
|
2606
|
-
var CheckoutLocateResult = z14.object({ checkout: CheckoutInfo, worktreePath: z14.string() }).nullable();
|
|
2607
|
-
var ScannedRepository = CheckoutInfo.extend({ name: z14.string() });
|
|
2608
|
-
var ProjectFolderScan = z14.object({
|
|
2609
|
-
/** The folder, ~ expanded and realpath'd. */
|
|
2610
|
-
folder: z14.string(),
|
|
2611
|
-
repositories: z14.array(ScannedRepository)
|
|
2612
|
-
});
|
|
2613
|
-
var ProjectSuggestion = z14.object({
|
|
2614
|
-
rootPath: z14.string(),
|
|
2615
|
-
sessionCount: z14.number().int(),
|
|
2616
|
-
lastActivityAt: z14.string()
|
|
2617
|
-
});
|
|
2618
|
-
var ProjectSuggestions = z14.object({ suggestions: z14.array(ProjectSuggestion) });
|
|
2619
|
-
var GitCommit = z14.object({
|
|
2620
|
-
sha: z14.string().regex(/^[0-9a-f]{40}$/),
|
|
2621
|
-
subject: z14.string().max(300),
|
|
2622
|
-
author: z14.string().max(200),
|
|
2623
|
-
authoredAt: z14.string(),
|
|
2624
|
-
pushed: z14.boolean()
|
|
2625
|
-
});
|
|
2626
|
-
var LogResult = z14.object({
|
|
2627
|
-
/** The base branch the commits are counted from. */
|
|
2628
|
-
base: z14.string(),
|
|
2629
|
-
/** `branch`: commits since the merge base; `recent`: HEAD's latest commits (no commits of its own). */
|
|
2630
|
-
scope: z14.enum(["branch", "recent"]),
|
|
2631
|
-
commits: z14.array(GitCommit).max(200),
|
|
2632
|
-
truncated: z14.boolean(),
|
|
2633
|
-
/** Changed and untracked files not committed yet. */
|
|
2634
|
-
uncommitted: z14.number().int().min(0)
|
|
2635
|
-
});
|
|
2636
|
-
var DiffFile = z14.object({
|
|
2637
|
-
path: z14.string(),
|
|
2638
|
-
oldPath: z14.string().nullable(),
|
|
2639
|
-
added: z14.number().int(),
|
|
2640
|
-
deleted: z14.number().int(),
|
|
2641
|
-
status: z14.enum(["added", "modified", "deleted", "renamed", "untracked", "binary"])
|
|
2642
|
-
});
|
|
2643
|
-
var DiffResult = z14.object({
|
|
2644
|
-
base: z14.string(),
|
|
2645
|
-
files: z14.array(DiffFile),
|
|
2646
|
-
patch: z14.string().nullable()
|
|
2647
|
-
});
|
|
2648
|
-
var FileEntry = z14.object({
|
|
2649
|
-
name: z14.string(),
|
|
2650
|
-
path: z14.string(),
|
|
2651
|
-
kind: z14.enum(["file", "dir", "symlink"]),
|
|
2652
|
-
size: z14.number().int().nullable()
|
|
2653
|
-
});
|
|
2654
|
-
var ReconcileResult = z14.union([
|
|
2655
|
-
z14.object({ known: z14.literal(false) }),
|
|
2656
|
-
z14.object({
|
|
2657
|
-
known: z14.literal(true),
|
|
2658
|
-
sessionId: z14.string().nullable(),
|
|
2659
|
-
state: z14.enum(["accepted", "workspace_ready", "started", "failed"]),
|
|
2660
|
-
runtime: RuntimeState.nullable(),
|
|
2661
|
-
workspacePath: z14.string().nullable(),
|
|
2662
|
-
nativeHandle: NativeHandle.nullable(),
|
|
2663
|
-
error: z14.string().nullable(),
|
|
2664
|
-
/** `{started: "unknown"}` when the host restarted after Pi may have been spawned. */
|
|
2665
|
-
errorDetails: z14.record(z14.string(), z14.unknown()).nullable().default(null)
|
|
2666
|
-
})
|
|
2667
|
-
]);
|
|
2668
|
-
var DispatchStartResult = z14.object({
|
|
2669
|
-
sessionId: z14.string(),
|
|
2670
|
-
workspacePath: z14.string(),
|
|
2671
|
-
nativeHandle: NativeHandle.nullable(),
|
|
2672
|
-
reused: z14.boolean(),
|
|
2673
|
-
/** Why the launch prompt was not delivered to Pi (the session itself started), if it was not. */
|
|
2674
|
-
promptError: z14.string().nullable().optional()
|
|
2675
|
-
});
|
|
2676
|
-
var AnswerResult = z14.object({
|
|
2677
|
-
status: z14.enum(["answered", "already_answered"]),
|
|
2678
|
-
interaction: Interaction
|
|
2679
|
-
});
|
|
2680
|
-
var SnapshotResult = z14.object({
|
|
2681
|
-
partial: z14.array(TranscriptItem),
|
|
2682
|
-
pendingInteractions: z14.array(Interaction)
|
|
2683
|
-
});
|
|
2684
|
-
var ChecksResult = z14.object({ results: z14.array(CheckResult) });
|
|
2685
|
-
var Receipt = z14.union([
|
|
2686
|
-
z14.object({ commandId: z14.string(), ok: z14.literal(true), result: z14.unknown() }),
|
|
2687
|
-
z14.object({ commandId: z14.string(), ok: z14.literal(false), error: ErrorBody })
|
|
2688
|
-
]);
|
|
2689
|
-
var HostAgentRequestFrame = AgentRequestFrame.safeExtend({
|
|
2690
|
-
policyContext: HostToolPolicyContext.optional()
|
|
2691
|
-
}).strict().superRefine((frame, ctx) => {
|
|
2692
|
-
if (frame.method === "policy.evaluate" ? frame.policyContext === void 0 : Object.hasOwn(frame, "policyContext")) {
|
|
2693
|
-
ctx.addIssue({
|
|
2694
|
-
code: "custom",
|
|
2695
|
-
path: ["policyContext"],
|
|
2696
|
-
message: "Host policy context is required only for policy.evaluate."
|
|
2697
|
-
});
|
|
2698
|
-
}
|
|
2699
|
-
try {
|
|
2700
|
-
if (new TextEncoder().encode(JSON.stringify(frame)).length <= AGENT_FRAME_MAX_BYTES)
|
|
2701
|
-
return;
|
|
2702
|
-
} catch {
|
|
2703
|
-
}
|
|
2704
|
-
ctx.addIssue({ code: "custom", message: "Host agent frame exceeds 128 KiB or is not JSON." });
|
|
2705
|
-
});
|
|
2706
|
-
var HostToCoordinator = z14.discriminatedUnion("type", [
|
|
2707
|
-
z14.object({
|
|
2708
|
-
type: z14.literal("hello"),
|
|
2709
|
-
hostId: z14.string(),
|
|
2710
|
-
credential: z14.string(),
|
|
2711
|
-
name: z14.string(),
|
|
2712
|
-
agentVersion: z14.string(),
|
|
2713
|
-
piVersion: z14.string().nullable(),
|
|
2714
|
-
piCompatible: z14.boolean(),
|
|
2715
|
-
platform: Platform,
|
|
2716
|
-
capabilities: RuntimeCapabilities.nullable(),
|
|
2717
|
-
github: HostGitHub.optional(),
|
|
2718
|
-
protocolVersion: z14.number().int(),
|
|
2719
|
-
features: z14.array(z14.string()).optional()
|
|
2720
|
-
}),
|
|
2721
|
-
HostAgentRequestFrame,
|
|
2722
|
-
z14.object({ type: z14.literal("event"), hostSeq: z14.number().int(), event: HostEvent }),
|
|
2723
|
-
z14.object({ type: z14.literal("stream"), delta: StreamDelta }),
|
|
2724
|
-
z14.object({ type: z14.literal("receipt"), receipt: Receipt }),
|
|
2725
|
-
z14.object({ type: z14.literal("pong") }),
|
|
2726
|
-
z14.object({ type: z14.literal("usage"), usage: z14.array(ProviderUsage) }),
|
|
2727
|
-
z14.object({ type: z14.literal("term"), streamId: z14.string(), msg: TermServerToViewer })
|
|
2728
|
-
]);
|
|
2729
|
-
var CoordinatorToHost = z14.discriminatedUnion("type", [
|
|
2730
|
-
z14.object({
|
|
2731
|
-
type: z14.literal("welcome"),
|
|
2732
|
-
coordinatorVersion: z14.string(),
|
|
2733
|
-
ackedHostSeq: z14.number().int(),
|
|
2734
|
-
features: z14.array(z14.string()).optional()
|
|
2735
|
-
}),
|
|
2736
|
-
AgentResultFrame,
|
|
2737
|
-
z14.object({ type: z14.literal("ack"), hostSeq: z14.number().int() }),
|
|
2738
|
-
z14.object({ type: z14.literal("command"), commandId: z14.string(), command: HostCommand }),
|
|
2739
|
-
z14.object({ type: z14.literal("ping") }),
|
|
2740
|
-
z14.object({ type: z14.literal("reject"), error: ErrorBody }),
|
|
2741
|
-
z14.object({ type: z14.literal("term"), streamId: z14.string(), msg: TermCoordinatorMsg })
|
|
2742
|
-
]);
|
|
2743
|
-
|
|
2744
|
-
// packages/protocol/dist/api.js
|
|
2745
|
-
var EnrollRequest = z15.object({
|
|
2746
|
-
token: z15.string().min(1),
|
|
2747
|
-
name: z15.string().min(1).max(80),
|
|
2283
|
+
var EnrollRequest = z12.object({
|
|
2284
|
+
token: z12.string().min(1),
|
|
2285
|
+
name: z12.string().min(1).max(80),
|
|
2748
2286
|
kind: DeviceKind
|
|
2749
2287
|
});
|
|
2750
|
-
var EnrollResponse =
|
|
2751
|
-
var CreateEnrollmentRequest =
|
|
2752
|
-
var CreateEnrollmentResponse =
|
|
2753
|
-
token:
|
|
2754
|
-
url:
|
|
2755
|
-
expiresAt:
|
|
2756
|
-
qrSvg:
|
|
2757
|
-
command:
|
|
2758
|
-
});
|
|
2759
|
-
var HostEnrollRequest =
|
|
2760
|
-
|
|
2761
|
-
token:
|
|
2762
|
-
name:
|
|
2288
|
+
var EnrollResponse = z12.object({ deviceId: z12.string(), credential: z12.string() });
|
|
2289
|
+
var CreateEnrollmentRequest = z12.object({ kind: z12.enum(["device", "host"]) });
|
|
2290
|
+
var CreateEnrollmentResponse = z12.object({
|
|
2291
|
+
token: z12.string(),
|
|
2292
|
+
url: z12.string(),
|
|
2293
|
+
expiresAt: z12.string(),
|
|
2294
|
+
qrSvg: z12.string(),
|
|
2295
|
+
command: z12.string().nullable()
|
|
2296
|
+
});
|
|
2297
|
+
var HostEnrollRequest = z12.union([
|
|
2298
|
+
z12.object({
|
|
2299
|
+
token: z12.string().min(1),
|
|
2300
|
+
name: z12.string().min(1).max(80),
|
|
2763
2301
|
platform: Platform
|
|
2764
2302
|
}),
|
|
2765
|
-
|
|
2766
|
-
secret:
|
|
2767
|
-
name:
|
|
2303
|
+
z12.object({
|
|
2304
|
+
secret: z12.string().min(1),
|
|
2305
|
+
name: z12.string().min(1).max(80),
|
|
2768
2306
|
platform: Platform
|
|
2769
2307
|
})
|
|
2770
2308
|
]);
|
|
2771
|
-
var HostEnrollResponse =
|
|
2772
|
-
var CreateProjectRequest =
|
|
2773
|
-
name:
|
|
2774
|
-
hostId:
|
|
2775
|
-
path:
|
|
2776
|
-
defaultProfileId:
|
|
2777
|
-
setupCommand:
|
|
2778
|
-
checks:
|
|
2779
|
-
maxConcurrentRuns:
|
|
2309
|
+
var HostEnrollResponse = z12.object({ hostId: z12.string(), credential: z12.string() });
|
|
2310
|
+
var CreateProjectRequest = z12.object({
|
|
2311
|
+
name: z12.string().min(1),
|
|
2312
|
+
hostId: z12.string(),
|
|
2313
|
+
path: z12.string().min(1),
|
|
2314
|
+
defaultProfileId: z12.string().nullable().optional(),
|
|
2315
|
+
setupCommand: z12.string().nullable().optional(),
|
|
2316
|
+
checks: z12.array(z12.string()).optional(),
|
|
2317
|
+
maxConcurrentRuns: z12.number().int().min(1).max(32).optional(),
|
|
2780
2318
|
worktreeDir: WorktreeDir.optional()
|
|
2781
2319
|
});
|
|
2782
|
-
var UpdateProjectRequest =
|
|
2783
|
-
name:
|
|
2784
|
-
defaultProfileId:
|
|
2785
|
-
defaultHostId:
|
|
2786
|
-
maxConcurrentRuns:
|
|
2787
|
-
automationEnabled:
|
|
2788
|
-
setupCommand:
|
|
2789
|
-
checks:
|
|
2790
|
-
workspaceSharing:
|
|
2320
|
+
var UpdateProjectRequest = z12.object({
|
|
2321
|
+
name: z12.string().min(1).optional(),
|
|
2322
|
+
defaultProfileId: z12.string().nullable().optional(),
|
|
2323
|
+
defaultHostId: z12.string().nullable().optional(),
|
|
2324
|
+
maxConcurrentRuns: z12.number().int().min(1).max(32).optional(),
|
|
2325
|
+
automationEnabled: z12.boolean().optional(),
|
|
2326
|
+
setupCommand: z12.string().nullable().optional(),
|
|
2327
|
+
checks: z12.array(z12.string()).optional(),
|
|
2328
|
+
workspaceSharing: z12.enum(["single_writer", "shared"]).optional(),
|
|
2791
2329
|
worktreeDir: WorktreeDir.optional(),
|
|
2792
|
-
ensureSessions:
|
|
2793
|
-
removeLanded:
|
|
2330
|
+
ensureSessions: z12.boolean().optional(),
|
|
2331
|
+
removeLanded: z12.boolean().optional()
|
|
2794
2332
|
});
|
|
2795
|
-
var AddCheckoutRequest =
|
|
2333
|
+
var AddCheckoutRequest = z12.object({ hostId: z12.string(), path: z12.string().min(1) });
|
|
2796
2334
|
function isProjectFolderPath(s) {
|
|
2797
2335
|
if (s.includes("\0"))
|
|
2798
2336
|
return false;
|
|
2799
2337
|
return s === "~" || s.startsWith("~/") || s.startsWith("/");
|
|
2800
2338
|
}
|
|
2801
|
-
var ProjectFolder =
|
|
2802
|
-
var UpdateHostRequest =
|
|
2803
|
-
projectFolders: z15.array(ProjectFolder).max(20).optional(),
|
|
2339
|
+
var ProjectFolder = z12.string().trim().min(1).max(1024).refine(isProjectFolderPath, "must be an absolute path or start with ~/");
|
|
2340
|
+
var UpdateHostRequest = z12.object({
|
|
2804
2341
|
checkoutRoot: ProjectFolder.nullable().optional()
|
|
2805
2342
|
});
|
|
2806
|
-
var
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
path: z15.string(),
|
|
2811
|
-
newProject: z15.boolean()
|
|
2812
|
-
}))
|
|
2813
|
-
});
|
|
2814
|
-
var ProfileInput = z15.object({
|
|
2815
|
-
name: z15.string().min(1),
|
|
2816
|
-
provider: z15.string().nullable().default(null),
|
|
2817
|
-
model: z15.string().nullable().default(null),
|
|
2343
|
+
var ProfileInput = z12.object({
|
|
2344
|
+
name: z12.string().min(1),
|
|
2345
|
+
provider: z12.string().nullable().default(null),
|
|
2346
|
+
model: z12.string().nullable().default(null),
|
|
2818
2347
|
thinking: ThinkingLevel.nullable().default(null),
|
|
2819
|
-
projectTrust:
|
|
2820
|
-
extraArgs:
|
|
2821
|
-
resources:
|
|
2822
|
-
});
|
|
2823
|
-
var CreateWorkspaceRequest =
|
|
2824
|
-
checkoutId:
|
|
2825
|
-
branch:
|
|
2826
|
-
base:
|
|
2827
|
-
});
|
|
2828
|
-
var RemoveWorkspaceRequest =
|
|
2829
|
-
force:
|
|
2830
|
-
});
|
|
2831
|
-
var CreateSessionRequest =
|
|
2832
|
-
projectId:
|
|
2833
|
-
workspace:
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
checkoutId:
|
|
2837
|
-
newBranch:
|
|
2838
|
-
base:
|
|
2348
|
+
projectTrust: z12.enum(["ask", "approve", "ignore"]).default("ask"),
|
|
2349
|
+
extraArgs: z12.array(ExtraArg).default([]),
|
|
2350
|
+
resources: z12.enum(["all", "vanilla"]).default("all")
|
|
2351
|
+
});
|
|
2352
|
+
var CreateWorkspaceRequest = z12.object({
|
|
2353
|
+
checkoutId: z12.string(),
|
|
2354
|
+
branch: z12.string().min(1),
|
|
2355
|
+
base: z12.string().nullable().optional()
|
|
2356
|
+
});
|
|
2357
|
+
var RemoveWorkspaceRequest = z12.object({
|
|
2358
|
+
force: z12.object({ dirty: z12.boolean(), unmerged: z12.boolean() }).default({ dirty: false, unmerged: false })
|
|
2359
|
+
});
|
|
2360
|
+
var CreateSessionRequest = z12.object({
|
|
2361
|
+
projectId: z12.string(),
|
|
2362
|
+
workspace: z12.union([
|
|
2363
|
+
z12.object({ existingId: z12.string() }),
|
|
2364
|
+
z12.object({
|
|
2365
|
+
checkoutId: z12.string(),
|
|
2366
|
+
newBranch: z12.string().min(1),
|
|
2367
|
+
base: z12.string().nullable().optional()
|
|
2839
2368
|
})
|
|
2840
2369
|
]),
|
|
2841
|
-
profileId:
|
|
2842
|
-
prompt:
|
|
2843
|
-
title:
|
|
2844
|
-
scopeId:
|
|
2370
|
+
profileId: z12.string().nullable().optional(),
|
|
2371
|
+
prompt: z12.string().default(""),
|
|
2372
|
+
title: z12.string().optional(),
|
|
2373
|
+
scopeId: z12.string().optional(),
|
|
2845
2374
|
/** COMPAT(scopes-rename): remove after 2027-03-01. The old name of scopeId. */
|
|
2846
|
-
viewId:
|
|
2847
|
-
});
|
|
2848
|
-
var OpenBranchRequest =
|
|
2849
|
-
projectId:
|
|
2850
|
-
branch:
|
|
2851
|
-
hostId:
|
|
2852
|
-
base:
|
|
2853
|
-
prompt:
|
|
2854
|
-
profileId:
|
|
2855
|
-
title:
|
|
2856
|
-
scopeId:
|
|
2375
|
+
viewId: z12.string().optional()
|
|
2376
|
+
});
|
|
2377
|
+
var OpenBranchRequest = z12.object({
|
|
2378
|
+
projectId: z12.string(),
|
|
2379
|
+
branch: z12.string().min(1),
|
|
2380
|
+
hostId: z12.string().optional(),
|
|
2381
|
+
base: z12.string().nullable().optional(),
|
|
2382
|
+
prompt: z12.string().default(""),
|
|
2383
|
+
profileId: z12.string().nullable().optional(),
|
|
2384
|
+
title: z12.string().optional(),
|
|
2385
|
+
scopeId: z12.string().optional(),
|
|
2857
2386
|
/** COMPAT(scopes-rename): remove after 2027-03-01. The old name of scopeId. */
|
|
2858
|
-
viewId:
|
|
2387
|
+
viewId: z12.string().optional(),
|
|
2859
2388
|
/** Start another session even when the branch has one. */
|
|
2860
|
-
another:
|
|
2861
|
-
});
|
|
2862
|
-
var OpenBranchResult =
|
|
2863
|
-
var SetPrimaryRequest =
|
|
2864
|
-
var PromptRequest =
|
|
2865
|
-
text:
|
|
2866
|
-
mode:
|
|
2867
|
-
images:
|
|
2868
|
-
clientMessageId:
|
|
2869
|
-
});
|
|
2870
|
-
var CacheAlertRequest =
|
|
2871
|
-
enabled:
|
|
2872
|
-
ttlSec:
|
|
2873
|
-
});
|
|
2874
|
-
var RenameRequest =
|
|
2875
|
-
var SetModelRequest =
|
|
2876
|
-
provider:
|
|
2877
|
-
modelId:
|
|
2878
|
-
});
|
|
2879
|
-
var SetThinkingRequest =
|
|
2880
|
-
var CompactRequest =
|
|
2881
|
-
var SessionModelsResult =
|
|
2882
|
-
var SessionCommandsResult =
|
|
2883
|
-
var CompleteRequest =
|
|
2884
|
-
var CompletionItem =
|
|
2885
|
-
value:
|
|
2886
|
-
label:
|
|
2887
|
-
description:
|
|
2888
|
-
});
|
|
2889
|
-
var SessionCompleteResult =
|
|
2890
|
-
items:
|
|
2891
|
-
prefix:
|
|
2892
|
-
});
|
|
2893
|
-
var TreeRow =
|
|
2894
|
-
entryId:
|
|
2895
|
-
parentId:
|
|
2896
|
-
depth:
|
|
2897
|
-
role:
|
|
2898
|
-
text:
|
|
2899
|
-
activeBranch:
|
|
2900
|
-
leaf:
|
|
2901
|
-
label:
|
|
2902
|
-
at:
|
|
2903
|
-
});
|
|
2904
|
-
var SessionTreeResult =
|
|
2905
|
-
var BranchRequest =
|
|
2906
|
-
entryId:
|
|
2907
|
-
fork:
|
|
2908
|
-
});
|
|
2909
|
-
var HostBranchResult =
|
|
2910
|
-
sessionFile:
|
|
2911
|
-
prefill:
|
|
2912
|
-
});
|
|
2913
|
-
var TranscriptPage =
|
|
2914
|
-
items:
|
|
2915
|
-
hasMore:
|
|
2916
|
-
epoch:
|
|
2917
|
-
rev:
|
|
2918
|
-
delta:
|
|
2919
|
-
reset:
|
|
2920
|
-
});
|
|
2921
|
-
var NavigateRequest =
|
|
2922
|
-
entryId:
|
|
2923
|
-
summarize:
|
|
2924
|
-
instructions:
|
|
2925
|
-
});
|
|
2926
|
-
var HostNavigateResult =
|
|
2927
|
-
items:
|
|
2928
|
-
prefill:
|
|
2929
|
-
});
|
|
2930
|
-
var NavigateResult =
|
|
2931
|
-
prefill:
|
|
2932
|
-
epoch:
|
|
2933
|
-
});
|
|
2934
|
-
var BranchResult =
|
|
2389
|
+
another: z12.boolean().default(false)
|
|
2390
|
+
});
|
|
2391
|
+
var OpenBranchResult = z12.object({ session: Session, created: z12.boolean() });
|
|
2392
|
+
var SetPrimaryRequest = z12.object({ primary: z12.boolean() });
|
|
2393
|
+
var PromptRequest = z12.object({
|
|
2394
|
+
text: z12.string().min(1),
|
|
2395
|
+
mode: z12.enum(["prompt", "steer", "followUp"]).default("prompt"),
|
|
2396
|
+
images: z12.array(z12.object({ mimeType: z12.string(), data: z12.string() })).default([]),
|
|
2397
|
+
clientMessageId: z12.string().optional()
|
|
2398
|
+
});
|
|
2399
|
+
var CacheAlertRequest = z12.object({
|
|
2400
|
+
enabled: z12.boolean(),
|
|
2401
|
+
ttlSec: z12.number().int().min(60).max(86400).nullable().default(null)
|
|
2402
|
+
});
|
|
2403
|
+
var RenameRequest = z12.object({ title: z12.string().min(1).max(200) });
|
|
2404
|
+
var SetModelRequest = z12.object({
|
|
2405
|
+
provider: z12.string().min(1),
|
|
2406
|
+
modelId: z12.string().min(1)
|
|
2407
|
+
});
|
|
2408
|
+
var SetThinkingRequest = z12.object({ level: ThinkingLevel });
|
|
2409
|
+
var CompactRequest = z12.object({ instructions: z12.string().max(4e3).optional() });
|
|
2410
|
+
var SessionModelsResult = z12.object({ models: z12.array(SessionModel) });
|
|
2411
|
+
var SessionCommandsResult = z12.object({ commands: z12.array(SlashCommand) });
|
|
2412
|
+
var CompleteRequest = z12.object({ text: z12.string().min(1).max(500) });
|
|
2413
|
+
var CompletionItem = z12.object({
|
|
2414
|
+
value: z12.string(),
|
|
2415
|
+
label: z12.string(),
|
|
2416
|
+
description: z12.string().nullable()
|
|
2417
|
+
});
|
|
2418
|
+
var SessionCompleteResult = z12.object({
|
|
2419
|
+
items: z12.array(CompletionItem).max(50),
|
|
2420
|
+
prefix: z12.string()
|
|
2421
|
+
});
|
|
2422
|
+
var TreeRow = z12.object({
|
|
2423
|
+
entryId: z12.string(),
|
|
2424
|
+
parentId: z12.string().nullable(),
|
|
2425
|
+
depth: z12.number().int(),
|
|
2426
|
+
role: z12.enum(["user", "assistant"]),
|
|
2427
|
+
text: z12.string(),
|
|
2428
|
+
activeBranch: z12.boolean(),
|
|
2429
|
+
leaf: z12.boolean(),
|
|
2430
|
+
label: z12.string().nullable(),
|
|
2431
|
+
at: z12.string().nullable()
|
|
2432
|
+
});
|
|
2433
|
+
var SessionTreeResult = z12.object({ rows: z12.array(TreeRow) });
|
|
2434
|
+
var BranchRequest = z12.object({
|
|
2435
|
+
entryId: z12.string().nullable(),
|
|
2436
|
+
fork: z12.boolean().default(false)
|
|
2437
|
+
});
|
|
2438
|
+
var HostBranchResult = z12.object({
|
|
2439
|
+
sessionFile: z12.string().nullable(),
|
|
2440
|
+
prefill: z12.string().nullable()
|
|
2441
|
+
});
|
|
2442
|
+
var TranscriptPage = z12.object({
|
|
2443
|
+
items: z12.array(TranscriptItem),
|
|
2444
|
+
hasMore: z12.boolean(),
|
|
2445
|
+
epoch: z12.number().int().optional(),
|
|
2446
|
+
rev: z12.number().int().optional(),
|
|
2447
|
+
delta: z12.boolean().optional(),
|
|
2448
|
+
reset: z12.boolean().optional()
|
|
2449
|
+
});
|
|
2450
|
+
var NavigateRequest = z12.object({
|
|
2451
|
+
entryId: z12.string().min(1),
|
|
2452
|
+
summarize: z12.boolean().default(false),
|
|
2453
|
+
instructions: z12.string().max(2e3).nullable().default(null)
|
|
2454
|
+
});
|
|
2455
|
+
var HostNavigateResult = z12.object({
|
|
2456
|
+
items: z12.array(TranscriptItem),
|
|
2457
|
+
prefill: z12.string().nullable()
|
|
2458
|
+
});
|
|
2459
|
+
var NavigateResult = z12.object({
|
|
2460
|
+
prefill: z12.string().nullable(),
|
|
2461
|
+
epoch: z12.number().int()
|
|
2462
|
+
});
|
|
2463
|
+
var BranchResult = z12.object({
|
|
2935
2464
|
session: Session.nullable(),
|
|
2936
|
-
prefill:
|
|
2465
|
+
prefill: z12.string().nullable()
|
|
2937
2466
|
});
|
|
2938
|
-
var SessionExportResult =
|
|
2939
|
-
var CommandViewAction =
|
|
2940
|
-
label:
|
|
2941
|
-
command:
|
|
2942
|
-
tone:
|
|
2467
|
+
var SessionExportResult = z12.object({ fileName: z12.string(), content: z12.string() });
|
|
2468
|
+
var CommandViewAction = z12.object({
|
|
2469
|
+
label: z12.string().min(1).max(80),
|
|
2470
|
+
command: z12.string().startsWith("/").max(500),
|
|
2471
|
+
tone: z12.enum(["default", "primary", "danger"]).optional()
|
|
2943
2472
|
});
|
|
2944
|
-
var CommandView =
|
|
2945
|
-
title:
|
|
2473
|
+
var CommandView = z12.object({
|
|
2474
|
+
title: z12.string().min(1).max(200),
|
|
2946
2475
|
body: UINodeSchema,
|
|
2947
|
-
actions:
|
|
2476
|
+
actions: z12.array(CommandViewAction).max(30).default([])
|
|
2948
2477
|
});
|
|
2949
|
-
var ModelStateResult =
|
|
2478
|
+
var ModelStateResult = z12.object({
|
|
2950
2479
|
model: SessionModel.nullable(),
|
|
2951
2480
|
thinking: ThinkingLevel.nullable()
|
|
2952
2481
|
});
|
|
2953
|
-
var ImportSessionRequest =
|
|
2954
|
-
hostId:
|
|
2955
|
-
sessionFile:
|
|
2956
|
-
projectId:
|
|
2482
|
+
var ImportSessionRequest = z12.object({
|
|
2483
|
+
hostId: z12.string(),
|
|
2484
|
+
sessionFile: z12.string(),
|
|
2485
|
+
projectId: z12.string().nullable().optional()
|
|
2957
2486
|
});
|
|
2958
|
-
var AnswerRequest =
|
|
2959
|
-
revision:
|
|
2487
|
+
var AnswerRequest = z12.object({
|
|
2488
|
+
revision: z12.number().int(),
|
|
2960
2489
|
response: InteractionResponseSchema
|
|
2961
2490
|
});
|
|
2962
|
-
var AdapterActionRequest =
|
|
2963
|
-
generation:
|
|
2964
|
-
adapterId:
|
|
2965
|
-
actionId:
|
|
2966
|
-
payload:
|
|
2967
|
-
});
|
|
2968
|
-
var TaskPolicyPatch =
|
|
2969
|
-
hostId:
|
|
2970
|
-
profileId:
|
|
2971
|
-
workspace:
|
|
2972
|
-
mode:
|
|
2973
|
-
branch:
|
|
2974
|
-
base:
|
|
2975
|
-
workspaceId:
|
|
2491
|
+
var AdapterActionRequest = z12.object({
|
|
2492
|
+
generation: z12.string().uuid().optional(),
|
|
2493
|
+
adapterId: z12.string(),
|
|
2494
|
+
actionId: z12.string(),
|
|
2495
|
+
payload: z12.unknown().optional()
|
|
2496
|
+
});
|
|
2497
|
+
var TaskPolicyPatch = z12.object({
|
|
2498
|
+
hostId: z12.string().nullable().optional(),
|
|
2499
|
+
profileId: z12.string().nullable().optional(),
|
|
2500
|
+
workspace: z12.object({
|
|
2501
|
+
mode: z12.enum(["new_worktree", "existing"]).optional(),
|
|
2502
|
+
branch: z12.string().nullable().optional(),
|
|
2503
|
+
base: z12.string().nullable().optional(),
|
|
2504
|
+
workspaceId: z12.string().optional()
|
|
2976
2505
|
}).optional(),
|
|
2977
|
-
continuation:
|
|
2978
|
-
enabled:
|
|
2979
|
-
objective:
|
|
2980
|
-
maxContinuations:
|
|
2981
|
-
maxElapsedMinutes:
|
|
2982
|
-
maxTokens:
|
|
2983
|
-
maxCostUsd:
|
|
2506
|
+
continuation: z12.object({
|
|
2507
|
+
enabled: z12.boolean().optional(),
|
|
2508
|
+
objective: z12.string().min(1).optional(),
|
|
2509
|
+
maxContinuations: z12.number().int().min(1).max(50).optional(),
|
|
2510
|
+
maxElapsedMinutes: z12.number().int().min(1).max(1440).optional(),
|
|
2511
|
+
maxTokens: z12.number().int().positive().nullable().optional(),
|
|
2512
|
+
maxCostUsd: z12.number().positive().nullable().optional()
|
|
2984
2513
|
}).optional(),
|
|
2985
2514
|
completion: CompletionPolicy.partial().optional()
|
|
2986
2515
|
});
|
|
2987
|
-
var CreateTaskRequest =
|
|
2988
|
-
projectId:
|
|
2989
|
-
title:
|
|
2516
|
+
var CreateTaskRequest = z12.object({
|
|
2517
|
+
projectId: z12.string(),
|
|
2518
|
+
title: z12.string().max(300).optional(),
|
|
2990
2519
|
githubIssueUrl: GitHubIssueUrl.optional(),
|
|
2991
|
-
githubIssue:
|
|
2992
|
-
launchPrompt:
|
|
2993
|
-
objective:
|
|
2994
|
-
acceptanceCriteria:
|
|
2995
|
-
dependencies:
|
|
2996
|
-
parentTaskId:
|
|
2520
|
+
githubIssue: z12.never().optional(),
|
|
2521
|
+
launchPrompt: z12.never().optional(),
|
|
2522
|
+
objective: z12.string().default(""),
|
|
2523
|
+
acceptanceCriteria: z12.array(z12.string()).default([]),
|
|
2524
|
+
dependencies: z12.array(z12.string()).default([]),
|
|
2525
|
+
parentTaskId: z12.string().nullable().optional(),
|
|
2997
2526
|
priority: Priority.default(2),
|
|
2998
|
-
state:
|
|
2999
|
-
notBefore:
|
|
2527
|
+
state: z12.enum(["backlog", "ready"]).default("backlog"),
|
|
2528
|
+
notBefore: z12.string().nullable().optional(),
|
|
3000
2529
|
policy: TaskPolicyPatch.optional()
|
|
3001
2530
|
}).superRefine((v, ctx) => {
|
|
3002
2531
|
if (v.githubIssueUrl === void 0) {
|
|
@@ -3034,32 +2563,32 @@ var CreateTaskRequest = z15.object({
|
|
|
3034
2563
|
const issue = githubIssueFromUrl(v.githubIssueUrl);
|
|
3035
2564
|
return { ...v, title: v.title?.trim() || `${issue.repository} #${issue.number}` };
|
|
3036
2565
|
});
|
|
3037
|
-
var UpdateTaskRequest =
|
|
3038
|
-
githubIssueUrl:
|
|
3039
|
-
githubIssue:
|
|
3040
|
-
launchPrompt:
|
|
3041
|
-
title:
|
|
3042
|
-
objective:
|
|
3043
|
-
acceptanceCriteria:
|
|
3044
|
-
dependencies:
|
|
3045
|
-
parentTaskId:
|
|
2566
|
+
var UpdateTaskRequest = z12.object({
|
|
2567
|
+
githubIssueUrl: z12.never().optional(),
|
|
2568
|
+
githubIssue: z12.never().optional(),
|
|
2569
|
+
launchPrompt: z12.never().optional(),
|
|
2570
|
+
title: z12.string().min(1).max(300).optional(),
|
|
2571
|
+
objective: z12.string().optional(),
|
|
2572
|
+
acceptanceCriteria: z12.array(z12.string()).optional(),
|
|
2573
|
+
dependencies: z12.array(z12.string()).optional(),
|
|
2574
|
+
parentTaskId: z12.string().nullable().optional(),
|
|
3046
2575
|
priority: Priority.optional(),
|
|
3047
|
-
position:
|
|
3048
|
-
notBefore:
|
|
2576
|
+
position: z12.number().optional(),
|
|
2577
|
+
notBefore: z12.string().nullable().optional(),
|
|
3049
2578
|
policy: TaskPolicyPatch.optional()
|
|
3050
2579
|
});
|
|
3051
|
-
var MoveTaskRequest =
|
|
2580
|
+
var MoveTaskRequest = z12.object({
|
|
3052
2581
|
to: TaskState,
|
|
3053
|
-
confirm:
|
|
3054
|
-
onRunning:
|
|
3055
|
-
position:
|
|
3056
|
-
});
|
|
3057
|
-
var RequestChangesRequest =
|
|
3058
|
-
var Eligibility =
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
eligible:
|
|
3062
|
-
wait:
|
|
2582
|
+
confirm: z12.boolean().optional(),
|
|
2583
|
+
onRunning: z12.enum(["pause", "stop"]).optional(),
|
|
2584
|
+
position: z12.number().optional()
|
|
2585
|
+
});
|
|
2586
|
+
var RequestChangesRequest = z12.object({ feedback: z12.array(z12.string().min(1)).min(1) });
|
|
2587
|
+
var Eligibility = z12.union([
|
|
2588
|
+
z12.object({ eligible: z12.literal(true), hostId: z12.string(), hostName: z12.string() }),
|
|
2589
|
+
z12.object({
|
|
2590
|
+
eligible: z12.literal(false),
|
|
2591
|
+
wait: z12.enum([
|
|
3063
2592
|
"dependency",
|
|
3064
2593
|
"host_offline",
|
|
3065
2594
|
"project_limit",
|
|
@@ -3072,157 +2601,157 @@ var Eligibility = z15.union([
|
|
|
3072
2601
|
"already_dispatched",
|
|
3073
2602
|
"retry_backoff"
|
|
3074
2603
|
]),
|
|
3075
|
-
message:
|
|
2604
|
+
message: z12.string()
|
|
3076
2605
|
})
|
|
3077
2606
|
]);
|
|
3078
|
-
var NowResponse =
|
|
3079
|
-
running:
|
|
3080
|
-
queued:
|
|
3081
|
-
dispatchPaused:
|
|
3082
|
-
});
|
|
3083
|
-
var AutomationInput =
|
|
3084
|
-
name:
|
|
3085
|
-
enabled:
|
|
3086
|
-
projectId:
|
|
2607
|
+
var NowResponse = z12.object({
|
|
2608
|
+
running: z12.array(z12.object({ taskId: z12.string(), runId: z12.string(), sessionId: z12.string().nullable() })),
|
|
2609
|
+
queued: z12.array(z12.object({ taskId: z12.string(), eligibility: Eligibility })),
|
|
2610
|
+
dispatchPaused: z12.boolean()
|
|
2611
|
+
});
|
|
2612
|
+
var AutomationInput = z12.object({
|
|
2613
|
+
name: z12.string().min(1),
|
|
2614
|
+
enabled: z12.boolean().default(true),
|
|
2615
|
+
projectId: z12.string(),
|
|
3087
2616
|
trigger: Trigger,
|
|
3088
|
-
filters:
|
|
2617
|
+
filters: z12.array(z12.object({ path: z12.string(), equals: z12.string() })).default([]),
|
|
3089
2618
|
template: TaskTemplate,
|
|
3090
|
-
hostId:
|
|
3091
|
-
profileId:
|
|
3092
|
-
mode:
|
|
3093
|
-
groupingKey:
|
|
3094
|
-
overlap:
|
|
3095
|
-
missed:
|
|
2619
|
+
hostId: z12.string().nullable().default(null),
|
|
2620
|
+
profileId: z12.string().nullable().default(null),
|
|
2621
|
+
mode: z12.enum(["fresh", "continue", "watch"]).default("fresh"),
|
|
2622
|
+
groupingKey: z12.string().nullable().default(null),
|
|
2623
|
+
overlap: z12.enum(["skip", "queue_one", "append"]).default("skip"),
|
|
2624
|
+
missed: z12.enum(["skip", "run_once"]).default("skip"),
|
|
3096
2625
|
continuation: ContinuationPolicy.default({ enabled: false }),
|
|
3097
2626
|
completion: CompletionPolicy.default({ checks: null, requireHumanReview: true })
|
|
3098
2627
|
});
|
|
3099
|
-
var AutomationView = Automation.extend({ summary:
|
|
3100
|
-
var AutomationPreview =
|
|
3101
|
-
summary:
|
|
2628
|
+
var AutomationView = Automation.extend({ summary: z12.string() });
|
|
2629
|
+
var AutomationPreview = z12.object({
|
|
2630
|
+
summary: z12.string(),
|
|
3102
2631
|
task: TaskTemplate,
|
|
3103
|
-
next:
|
|
3104
|
-
});
|
|
3105
|
-
var WebhookTokenResponse =
|
|
3106
|
-
var PushSubscriptionRequest =
|
|
3107
|
-
endpoint:
|
|
3108
|
-
keys:
|
|
3109
|
-
permission:
|
|
3110
|
-
});
|
|
3111
|
-
var NotificationSettings =
|
|
3112
|
-
quietHours:
|
|
3113
|
-
start:
|
|
3114
|
-
end:
|
|
3115
|
-
timezone:
|
|
2632
|
+
next: z12.array(z12.string())
|
|
2633
|
+
});
|
|
2634
|
+
var WebhookTokenResponse = z12.object({ token: z12.string(), url: z12.string() });
|
|
2635
|
+
var PushSubscriptionRequest = z12.object({
|
|
2636
|
+
endpoint: z12.string().url(),
|
|
2637
|
+
keys: z12.object({ p256dh: z12.string(), auth: z12.string() }),
|
|
2638
|
+
permission: z12.enum(["granted", "denied", "default", "unknown"]).default("granted")
|
|
2639
|
+
});
|
|
2640
|
+
var NotificationSettings = z12.object({
|
|
2641
|
+
quietHours: z12.object({
|
|
2642
|
+
start: z12.string().regex(/^\d{2}:\d{2}$/),
|
|
2643
|
+
end: z12.string().regex(/^\d{2}:\d{2}$/),
|
|
2644
|
+
timezone: z12.string()
|
|
3116
2645
|
}).nullable(),
|
|
3117
|
-
privatePreviews:
|
|
3118
|
-
preferredDeviceId:
|
|
3119
|
-
});
|
|
3120
|
-
var PushPayload =
|
|
3121
|
-
|
|
3122
|
-
type:
|
|
3123
|
-
title:
|
|
3124
|
-
body:
|
|
3125
|
-
tag:
|
|
3126
|
-
url:
|
|
3127
|
-
renotify:
|
|
2646
|
+
privatePreviews: z12.boolean(),
|
|
2647
|
+
preferredDeviceId: z12.string().nullable()
|
|
2648
|
+
});
|
|
2649
|
+
var PushPayload = z12.union([
|
|
2650
|
+
z12.object({
|
|
2651
|
+
type: z12.literal("show"),
|
|
2652
|
+
title: z12.string(),
|
|
2653
|
+
body: z12.string(),
|
|
2654
|
+
tag: z12.string(),
|
|
2655
|
+
url: z12.string(),
|
|
2656
|
+
renotify: z12.boolean()
|
|
3128
2657
|
}),
|
|
3129
|
-
|
|
2658
|
+
z12.object({ type: z12.literal("clear"), tag: z12.string() })
|
|
3130
2659
|
]);
|
|
3131
|
-
var SetupState =
|
|
3132
|
-
passkey:
|
|
3133
|
-
available:
|
|
3134
|
-
registered:
|
|
3135
|
-
reason:
|
|
2660
|
+
var SetupState = z12.object({
|
|
2661
|
+
passkey: z12.object({
|
|
2662
|
+
available: z12.boolean(),
|
|
2663
|
+
registered: z12.boolean(),
|
|
2664
|
+
reason: z12.string().nullable()
|
|
3136
2665
|
}),
|
|
3137
|
-
oidc:
|
|
2666
|
+
oidc: z12.object({ label: z12.string() }).nullable()
|
|
3138
2667
|
});
|
|
3139
|
-
var PasskeyRegisterOptionsResponse =
|
|
3140
|
-
challengeId:
|
|
3141
|
-
options:
|
|
2668
|
+
var PasskeyRegisterOptionsResponse = z12.object({
|
|
2669
|
+
challengeId: z12.string(),
|
|
2670
|
+
options: z12.unknown()
|
|
3142
2671
|
});
|
|
3143
|
-
var PasskeyRegisterVerifyRequest =
|
|
3144
|
-
challengeId:
|
|
3145
|
-
name:
|
|
3146
|
-
response:
|
|
2672
|
+
var PasskeyRegisterVerifyRequest = z12.object({
|
|
2673
|
+
challengeId: z12.string(),
|
|
2674
|
+
name: z12.string().min(1).max(80),
|
|
2675
|
+
response: z12.unknown()
|
|
3147
2676
|
});
|
|
3148
|
-
var PasskeySignInOptionsResponse =
|
|
3149
|
-
challengeId:
|
|
3150
|
-
options:
|
|
2677
|
+
var PasskeySignInOptionsResponse = z12.object({
|
|
2678
|
+
challengeId: z12.string(),
|
|
2679
|
+
options: z12.unknown()
|
|
3151
2680
|
});
|
|
3152
|
-
var PasskeySignInVerifyRequest =
|
|
3153
|
-
challengeId:
|
|
3154
|
-
response:
|
|
3155
|
-
deviceName:
|
|
2681
|
+
var PasskeySignInVerifyRequest = z12.object({
|
|
2682
|
+
challengeId: z12.string(),
|
|
2683
|
+
response: z12.unknown(),
|
|
2684
|
+
deviceName: z12.string().min(1).max(80),
|
|
3156
2685
|
kind: DeviceKind.extract(["browser", "pwa"])
|
|
3157
2686
|
});
|
|
3158
|
-
var OidcBeginRequest =
|
|
3159
|
-
deviceName:
|
|
2687
|
+
var OidcBeginRequest = z12.object({
|
|
2688
|
+
deviceName: z12.string().min(1).max(80),
|
|
3160
2689
|
kind: DeviceKind.extract(["browser", "pwa"]),
|
|
3161
|
-
next:
|
|
3162
|
-
handoff:
|
|
3163
|
-
});
|
|
3164
|
-
var OidcBeginResponse =
|
|
3165
|
-
authorizeUrl:
|
|
3166
|
-
flowId:
|
|
3167
|
-
pollToken:
|
|
3168
|
-
});
|
|
3169
|
-
var OidcClaimRequest =
|
|
3170
|
-
var OidcClaimResponse =
|
|
3171
|
-
|
|
3172
|
-
|
|
2690
|
+
next: z12.string().default("/"),
|
|
2691
|
+
handoff: z12.boolean().default(false)
|
|
2692
|
+
});
|
|
2693
|
+
var OidcBeginResponse = z12.object({
|
|
2694
|
+
authorizeUrl: z12.string(),
|
|
2695
|
+
flowId: z12.string().nullable(),
|
|
2696
|
+
pollToken: z12.string().nullable()
|
|
2697
|
+
});
|
|
2698
|
+
var OidcClaimRequest = z12.object({ flowId: z12.string(), pollToken: z12.string() });
|
|
2699
|
+
var OidcClaimResponse = z12.union([
|
|
2700
|
+
z12.object({ status: z12.literal("pending") }),
|
|
2701
|
+
z12.object({ status: z12.literal("done"), deviceId: z12.string() })
|
|
3173
2702
|
]);
|
|
3174
|
-
var TerminalLoginStartRequest =
|
|
3175
|
-
var TerminalLoginStartResponse =
|
|
3176
|
-
userCode:
|
|
3177
|
-
pollToken:
|
|
3178
|
-
verifyUrl:
|
|
3179
|
-
expiresAt:
|
|
3180
|
-
intervalMs:
|
|
3181
|
-
});
|
|
3182
|
-
var TerminalLoginClaimRequest =
|
|
3183
|
-
userCode:
|
|
3184
|
-
pollToken:
|
|
3185
|
-
});
|
|
3186
|
-
var TerminalLoginClaimResponse =
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
2703
|
+
var TerminalLoginStartRequest = z12.object({ name: z12.string().min(1).max(80) });
|
|
2704
|
+
var TerminalLoginStartResponse = z12.object({
|
|
2705
|
+
userCode: z12.string(),
|
|
2706
|
+
pollToken: z12.string(),
|
|
2707
|
+
verifyUrl: z12.string(),
|
|
2708
|
+
expiresAt: z12.string(),
|
|
2709
|
+
intervalMs: z12.number().int()
|
|
2710
|
+
});
|
|
2711
|
+
var TerminalLoginClaimRequest = z12.object({
|
|
2712
|
+
userCode: z12.string().min(1),
|
|
2713
|
+
pollToken: z12.string().min(1)
|
|
2714
|
+
});
|
|
2715
|
+
var TerminalLoginClaimResponse = z12.union([
|
|
2716
|
+
z12.object({ status: z12.literal("pending") }),
|
|
2717
|
+
z12.object({ status: z12.literal("denied") }),
|
|
2718
|
+
z12.object({ status: z12.literal("done"), deviceId: z12.string(), credential: z12.string() })
|
|
3190
2719
|
]);
|
|
3191
|
-
var TerminalLoginRequest =
|
|
3192
|
-
userCode:
|
|
3193
|
-
name:
|
|
3194
|
-
requestedFrom:
|
|
3195
|
-
createdAt:
|
|
3196
|
-
expiresAt:
|
|
3197
|
-
status:
|
|
3198
|
-
});
|
|
3199
|
-
var AuthMethods =
|
|
3200
|
-
passkeys:
|
|
3201
|
-
passkeyAvailability:
|
|
3202
|
-
oidc:
|
|
3203
|
-
issuer:
|
|
3204
|
-
label:
|
|
3205
|
-
ownerMatch:
|
|
3206
|
-
status:
|
|
3207
|
-
error:
|
|
2720
|
+
var TerminalLoginRequest = z12.object({
|
|
2721
|
+
userCode: z12.string(),
|
|
2722
|
+
name: z12.string(),
|
|
2723
|
+
requestedFrom: z12.string(),
|
|
2724
|
+
createdAt: z12.string(),
|
|
2725
|
+
expiresAt: z12.string(),
|
|
2726
|
+
status: z12.enum(["pending", "approved", "denied"])
|
|
2727
|
+
});
|
|
2728
|
+
var AuthMethods = z12.object({
|
|
2729
|
+
passkeys: z12.array(Passkey),
|
|
2730
|
+
passkeyAvailability: z12.object({ available: z12.boolean(), reason: z12.string().nullable() }),
|
|
2731
|
+
oidc: z12.object({
|
|
2732
|
+
issuer: z12.string(),
|
|
2733
|
+
label: z12.string(),
|
|
2734
|
+
ownerMatch: z12.string(),
|
|
2735
|
+
status: z12.enum(["ready", "error"]),
|
|
2736
|
+
error: z12.string().nullable()
|
|
3208
2737
|
}).nullable()
|
|
3209
2738
|
});
|
|
3210
|
-
var MeResponse =
|
|
2739
|
+
var MeResponse = z12.object({
|
|
3211
2740
|
device: Device,
|
|
3212
|
-
admin:
|
|
3213
|
-
publicUrl:
|
|
2741
|
+
admin: z12.boolean(),
|
|
2742
|
+
publicUrl: z12.string()
|
|
3214
2743
|
});
|
|
3215
|
-
var ClientBindingInput =
|
|
2744
|
+
var ClientBindingInput = z12.object({ mirror: ClientMirror, scopeId: z12.string().min(1).nullable().optional() }).refine((b) => b.mirror === "scope" === !!b.scopeId, {
|
|
3216
2745
|
message: "scopeId is required for mirror=scope and only then"
|
|
3217
2746
|
});
|
|
3218
2747
|
var ClientReport = Client.pick({ kind: true, name: true, machine: true }).extend({
|
|
3219
|
-
hostId:
|
|
2748
|
+
hostId: z12.string().nullable().optional(),
|
|
3220
2749
|
/** Sessions in its mirror tabs or windows; omitted when unchanged or unknown. */
|
|
3221
|
-
shows:
|
|
2750
|
+
shows: z12.array(z12.string()).max(1e3).optional(),
|
|
3222
2751
|
/** The binding this client had before bindings were recorded (env file); applied only when none is recorded. */
|
|
3223
2752
|
seed: ClientBindingInput.optional()
|
|
3224
2753
|
});
|
|
3225
|
-
var ScopeInput =
|
|
2754
|
+
var ScopeInput = z12.object({
|
|
3226
2755
|
name: Scope.shape.name,
|
|
3227
2756
|
mode: Scope.shape.mode.optional(),
|
|
3228
2757
|
projectIds: Scope.shape.projectIds.optional(),
|
|
@@ -3230,7 +2759,7 @@ var ScopeInput = z15.object({
|
|
|
3230
2759
|
/** A GitHub source makes this a GitHub scope; its projects are then kept by GitHub. */
|
|
3231
2760
|
source: GitHubSourceInput.nullable().optional()
|
|
3232
2761
|
});
|
|
3233
|
-
var ScopePatch =
|
|
2762
|
+
var ScopePatch = z12.object({
|
|
3234
2763
|
name: Scope.shape.name.optional(),
|
|
3235
2764
|
mode: Scope.shape.mode.optional(),
|
|
3236
2765
|
projectIds: Scope.shape.projectIds.optional(),
|
|
@@ -3238,100 +2767,181 @@ var ScopePatch = z15.object({
|
|
|
3238
2767
|
/** null removes the source; an object changes it, or adds one (then hostId and owner are required). */
|
|
3239
2768
|
source: GitHubSourcePatch.nullable().optional()
|
|
3240
2769
|
});
|
|
3241
|
-
var ProjectSuggestionsResponse = z15.object({
|
|
3242
|
-
suggestions: z15.array(ProjectSuggestion.extend({ name: z15.string(), preselected: z15.boolean() }))
|
|
3243
|
-
});
|
|
3244
2770
|
|
|
3245
2771
|
// packages/protocol/dist/scopes.js
|
|
3246
2772
|
var CLIENT_OPEN_MS = 10 * 6e4;
|
|
3247
2773
|
|
|
3248
2774
|
// packages/protocol/dist/catalog.js
|
|
3249
|
-
import { z as
|
|
3250
|
-
var CatalogRepository =
|
|
3251
|
-
authority:
|
|
3252
|
-
externalId:
|
|
3253
|
-
owner:
|
|
3254
|
-
name:
|
|
3255
|
-
webUrl:
|
|
3256
|
-
cloneUrl:
|
|
3257
|
-
defaultBranch:
|
|
3258
|
-
});
|
|
3259
|
-
var CatalogAccountType =
|
|
3260
|
-
var CatalogConnectionKind =
|
|
3261
|
-
var CatalogSelection =
|
|
3262
|
-
owners:
|
|
3263
|
-
repositories:
|
|
3264
|
-
});
|
|
3265
|
-
var CatalogConnectionStatus =
|
|
3266
|
-
id:
|
|
2775
|
+
import { z as z13 } from "zod";
|
|
2776
|
+
var CatalogRepository = z13.strictObject({
|
|
2777
|
+
authority: z13.string().min(1),
|
|
2778
|
+
externalId: z13.string().min(1),
|
|
2779
|
+
owner: z13.string().min(1),
|
|
2780
|
+
name: z13.string().min(1),
|
|
2781
|
+
webUrl: z13.url({ protocol: /^https$/ }),
|
|
2782
|
+
cloneUrl: z13.url({ protocol: /^https$/ }),
|
|
2783
|
+
defaultBranch: z13.string().nullable()
|
|
2784
|
+
});
|
|
2785
|
+
var CatalogAccountType = z13.enum(["personal", "organization"]);
|
|
2786
|
+
var CatalogConnectionKind = z13.enum(["github_app", "pat"]);
|
|
2787
|
+
var CatalogSelection = z13.strictObject({
|
|
2788
|
+
owners: z13.array(z13.string().min(1).max(39)).max(50),
|
|
2789
|
+
repositories: z13.array(z13.string().min(1).max(140)).max(500)
|
|
2790
|
+
});
|
|
2791
|
+
var CatalogConnectionStatus = z13.object({
|
|
2792
|
+
id: z13.string(),
|
|
3267
2793
|
kind: CatalogConnectionKind.default("github_app"),
|
|
3268
|
-
|
|
2794
|
+
authority: z13.string().min(1).default("github.com"),
|
|
2795
|
+
account: z13.string(),
|
|
3269
2796
|
accountType: CatalogAccountType,
|
|
3270
|
-
state:
|
|
3271
|
-
lastSyncedAt:
|
|
3272
|
-
lastError:
|
|
3273
|
-
installUrl:
|
|
3274
|
-
manageUrl:
|
|
2797
|
+
state: z13.enum(["pending", "ready", "stale", "suspended", "removed", "disconnected"]),
|
|
2798
|
+
lastSyncedAt: z13.string().nullable(),
|
|
2799
|
+
lastError: z13.string().nullable(),
|
|
2800
|
+
installUrl: z13.string().nullable(),
|
|
2801
|
+
manageUrl: z13.string().nullable(),
|
|
3275
2802
|
selection: CatalogSelection.nullable().optional()
|
|
3276
2803
|
});
|
|
3277
|
-
var CatalogAvailableOwner =
|
|
3278
|
-
login:
|
|
2804
|
+
var CatalogAvailableOwner = z13.object({
|
|
2805
|
+
login: z13.string(),
|
|
3279
2806
|
type: CatalogAccountType
|
|
3280
2807
|
});
|
|
3281
|
-
var CatalogAvailableInventory =
|
|
3282
|
-
account:
|
|
3283
|
-
owners:
|
|
3284
|
-
repositories:
|
|
2808
|
+
var CatalogAvailableInventory = z13.object({
|
|
2809
|
+
account: z13.string(),
|
|
2810
|
+
owners: z13.array(CatalogAvailableOwner),
|
|
2811
|
+
repositories: z13.array(CatalogRepository)
|
|
3285
2812
|
});
|
|
3286
|
-
var ConnectPatRequest =
|
|
3287
|
-
token:
|
|
2813
|
+
var ConnectPatRequest = z13.strictObject({
|
|
2814
|
+
token: z13.string().trim().min(10).max(512),
|
|
3288
2815
|
selection: CatalogSelection.optional()
|
|
3289
2816
|
});
|
|
3290
|
-
var UpdateCatalogSelectionRequest =
|
|
2817
|
+
var UpdateCatalogSelectionRequest = z13.strictObject({
|
|
3291
2818
|
selection: CatalogSelection
|
|
3292
2819
|
});
|
|
3293
|
-
var CheckoutPreviewRequest =
|
|
3294
|
-
hostId:
|
|
3295
|
-
folderName:
|
|
2820
|
+
var CheckoutPreviewRequest = z13.strictObject({
|
|
2821
|
+
hostId: z13.string().min(1),
|
|
2822
|
+
folderName: z13.string().min(1).max(128).optional()
|
|
3296
2823
|
});
|
|
3297
|
-
var CheckoutProvisionRequest =
|
|
2824
|
+
var CheckoutProvisionRequest = z13.strictObject({ previewId: z13.string().min(1).max(128) });
|
|
3298
2825
|
|
|
3299
2826
|
// packages/protocol/dist/client-wire.js
|
|
3300
|
-
import { z as
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
2827
|
+
import { z as z15 } from "zod";
|
|
2828
|
+
|
|
2829
|
+
// packages/protocol/dist/events.js
|
|
2830
|
+
import { z as z14 } from "zod";
|
|
2831
|
+
var EventDataSchemas = {
|
|
2832
|
+
"host.updated": Host,
|
|
2833
|
+
"project.updated": Project,
|
|
2834
|
+
"project.deleted": z14.object({ id: z14.string() }),
|
|
2835
|
+
"checkout.updated": Checkout,
|
|
2836
|
+
"workspace.updated": Workspace,
|
|
2837
|
+
"workspace.deleted": z14.object({ id: z14.string() }),
|
|
2838
|
+
"profile.updated": Profile,
|
|
2839
|
+
"profile.deleted": z14.object({ id: z14.string() }),
|
|
2840
|
+
"scope.updated": Scope,
|
|
2841
|
+
"scope.deleted": z14.object({ id: z14.string() }),
|
|
2842
|
+
"session.updated": Session,
|
|
2843
|
+
"transcript.item": TranscriptItem,
|
|
2844
|
+
"transcript.reset": z14.object({ sessionId: z14.string(), epoch: z14.number().int() }),
|
|
2845
|
+
"interaction.updated": Interaction,
|
|
2846
|
+
"panel.updated": Panel,
|
|
2847
|
+
"adapters.updated": z14.object({ hostId: z14.string(), adapters: z14.array(AdapterInfo) }),
|
|
2848
|
+
diagnostic: Diagnostic,
|
|
2849
|
+
"task.updated": Task,
|
|
2850
|
+
"task.deleted": z14.object({ id: z14.string() }),
|
|
2851
|
+
"run.updated": Run,
|
|
2852
|
+
"automation.updated": Automation,
|
|
2853
|
+
"automation.deleted": z14.object({ id: z14.string() }),
|
|
2854
|
+
"occurrence.created": Occurrence,
|
|
2855
|
+
"occurrence.updated": Occurrence,
|
|
2856
|
+
"attention.updated": AttentionItem,
|
|
2857
|
+
"device.updated": Device,
|
|
2858
|
+
"issue.updated": TrackedIssue,
|
|
2859
|
+
"issue.deleted": z14.object({ id: z14.string() }),
|
|
2860
|
+
"client.updated": Client,
|
|
2861
|
+
"client.deleted": z14.object({ id: z14.string() }),
|
|
2862
|
+
"settings.updated": z14.object({ dispatchPaused: z14.boolean() })
|
|
2863
|
+
};
|
|
2864
|
+
var EVENT_TYPES = Object.keys(EventDataSchemas);
|
|
2865
|
+
var LEGACY_EVENT_TYPES = {
|
|
2866
|
+
"workspace.removed": "workspace.deleted"
|
|
2867
|
+
};
|
|
2868
|
+
function canonicalEventType(type) {
|
|
2869
|
+
return LEGACY_EVENT_TYPES[type] ?? type;
|
|
2870
|
+
}
|
|
2871
|
+
var canonical = (v) => typeof v === "string" ? canonicalEventType(v) : v;
|
|
2872
|
+
var EventTypeSchema = z14.preprocess(canonical, z14.enum(EVENT_TYPES));
|
|
2873
|
+
var EventScope = z14.object({
|
|
2874
|
+
hostId: z14.string().optional(),
|
|
2875
|
+
sessionId: z14.string().optional(),
|
|
2876
|
+
taskId: z14.string().optional(),
|
|
2877
|
+
projectId: z14.string().optional()
|
|
2878
|
+
});
|
|
2879
|
+
var EventEnvelope = EventScope.extend({
|
|
2880
|
+
seq: z14.number().int(),
|
|
2881
|
+
id: z14.string(),
|
|
2882
|
+
type: EventTypeSchema,
|
|
2883
|
+
at: z14.string(),
|
|
2884
|
+
data: z14.unknown()
|
|
2885
|
+
});
|
|
2886
|
+
var HOST_EVENT_TYPES = [
|
|
2887
|
+
"session.updated",
|
|
2888
|
+
"transcript.item",
|
|
2889
|
+
"interaction.updated",
|
|
2890
|
+
"panel.updated",
|
|
2891
|
+
"adapters.updated",
|
|
2892
|
+
"diagnostic",
|
|
2893
|
+
"workspace.updated",
|
|
2894
|
+
"workspace.deleted"
|
|
2895
|
+
];
|
|
2896
|
+
var HostEvent = EventScope.extend({
|
|
2897
|
+
eventId: z14.string(),
|
|
2898
|
+
type: z14.preprocess(canonical, z14.enum(HOST_EVENT_TYPES)),
|
|
2899
|
+
at: z14.string(),
|
|
2900
|
+
data: z14.unknown()
|
|
2901
|
+
});
|
|
2902
|
+
var StreamDelta = z14.object({
|
|
2903
|
+
sessionId: z14.string(),
|
|
2904
|
+
itemId: z14.string(),
|
|
2905
|
+
kind: z14.enum(["text", "thinking", "tool_args", "tool_output"]),
|
|
2906
|
+
delta: z14.string(),
|
|
2907
|
+
order: z14.number().int().optional()
|
|
2908
|
+
});
|
|
2909
|
+
|
|
2910
|
+
// packages/protocol/dist/client-wire.js
|
|
2911
|
+
var SyncState = z15.object({
|
|
2912
|
+
hosts: z15.array(Host),
|
|
2913
|
+
projects: z15.array(Project),
|
|
2914
|
+
checkouts: z15.array(Checkout),
|
|
2915
|
+
workspaces: z15.array(Workspace),
|
|
2916
|
+
profiles: z15.array(Profile),
|
|
3307
2917
|
/** Scopes; absent from coordinators before 0.21. */
|
|
3308
|
-
scopes:
|
|
3309
|
-
sessions:
|
|
3310
|
-
tasks:
|
|
3311
|
-
runs:
|
|
3312
|
-
automations:
|
|
3313
|
-
attention:
|
|
3314
|
-
interactions:
|
|
3315
|
-
panels:
|
|
3316
|
-
devices:
|
|
2918
|
+
scopes: z15.array(Scope).default([]),
|
|
2919
|
+
sessions: z15.array(Session),
|
|
2920
|
+
tasks: z15.array(Task),
|
|
2921
|
+
runs: z15.array(Run),
|
|
2922
|
+
automations: z15.array(Automation),
|
|
2923
|
+
attention: z15.array(AttentionItem),
|
|
2924
|
+
interactions: z15.array(Interaction),
|
|
2925
|
+
panels: z15.array(Panel),
|
|
2926
|
+
devices: z15.array(Device),
|
|
3317
2927
|
/** Tracked issues; absent from older coordinators. */
|
|
3318
|
-
issues:
|
|
2928
|
+
issues: z15.array(TrackedIssue).default([]),
|
|
3319
2929
|
/** Clients (herdr and tmux sessions); absent from coordinators before 0.21. */
|
|
3320
|
-
clients:
|
|
3321
|
-
adapters:
|
|
3322
|
-
dispatchPaused:
|
|
3323
|
-
});
|
|
3324
|
-
var Presence =
|
|
3325
|
-
foreground:
|
|
3326
|
-
interactedAt:
|
|
3327
|
-
viewing:
|
|
2930
|
+
clients: z15.array(Client).default([]),
|
|
2931
|
+
adapters: z15.record(z15.string(), z15.array(AdapterInfo)),
|
|
2932
|
+
dispatchPaused: z15.boolean()
|
|
2933
|
+
});
|
|
2934
|
+
var Presence = z15.object({
|
|
2935
|
+
foreground: z15.boolean(),
|
|
2936
|
+
interactedAt: z15.string().nullable(),
|
|
2937
|
+
viewing: z15.object({ sessionId: z15.string() }).nullable(),
|
|
3328
2938
|
/**
|
|
3329
2939
|
* A herdr or tmux daemon reporting the session focused in its client (kept apart from the
|
|
3330
2940
|
* device's own presence).
|
|
3331
2941
|
*/
|
|
3332
|
-
clientId:
|
|
2942
|
+
clientId: z15.string().min(1).max(200).optional(),
|
|
3333
2943
|
/** COMPAT(scopes-rename): remove after 2027-03-01. The old name of clientId. */
|
|
3334
|
-
terminalId:
|
|
2944
|
+
terminalId: z15.string().min(1).max(200).optional()
|
|
3335
2945
|
});
|
|
3336
2946
|
var CLIENT_CAPABILITIES = [
|
|
3337
2947
|
"adapter.slots.v1",
|
|
@@ -3342,37 +2952,436 @@ var CLIENT_CAPABILITIES = [
|
|
|
3342
2952
|
/** The client draws checklist, facts, rows and badge nodes, `section.open` and URL refs. */
|
|
3343
2953
|
"ui.nodes.v2",
|
|
3344
2954
|
/** The client draws `composer.tracker` and `session.badge` contributions. */
|
|
3345
|
-
"adapter.trackers.v1"
|
|
2955
|
+
"adapter.trackers.v1",
|
|
2956
|
+
/** The client draws `composer.suggestion` contributions in the composer. */
|
|
2957
|
+
"composer.suggestions.v1"
|
|
3346
2958
|
];
|
|
3347
|
-
var ClientToServer =
|
|
3348
|
-
|
|
3349
|
-
type:
|
|
3350
|
-
cursor:
|
|
3351
|
-
capabilities:
|
|
3352
|
-
projectionId:
|
|
2959
|
+
var ClientToServer = z15.discriminatedUnion("type", [
|
|
2960
|
+
z15.object({
|
|
2961
|
+
type: z15.literal("hello"),
|
|
2962
|
+
cursor: z15.number().int().nullable(),
|
|
2963
|
+
capabilities: z15.array(z15.string().min(1).max(80)).max(32).optional(),
|
|
2964
|
+
projectionId: z15.string().max(256).nullable().optional()
|
|
2965
|
+
}),
|
|
2966
|
+
z15.object({ type: z15.literal("presence"), presence: Presence }),
|
|
2967
|
+
z15.object({ type: z15.literal("ping") })
|
|
2968
|
+
]);
|
|
2969
|
+
var ServerToClient = z15.discriminatedUnion("type", [
|
|
2970
|
+
z15.object({
|
|
2971
|
+
type: z15.literal("replay"),
|
|
2972
|
+
seq: z15.number().int(),
|
|
2973
|
+
events: z15.array(EventEnvelope),
|
|
2974
|
+
capabilities: z15.array(z15.enum(CLIENT_CAPABILITIES)).optional(),
|
|
2975
|
+
projectionId: z15.string().optional()
|
|
2976
|
+
}),
|
|
2977
|
+
z15.object({
|
|
2978
|
+
type: z15.literal("snapshot"),
|
|
2979
|
+
seq: z15.number().int(),
|
|
2980
|
+
state: SyncState,
|
|
2981
|
+
capabilities: z15.array(z15.enum(CLIENT_CAPABILITIES)).optional(),
|
|
2982
|
+
projectionId: z15.string().optional()
|
|
2983
|
+
}),
|
|
2984
|
+
z15.object({ type: z15.literal("event"), event: EventEnvelope }),
|
|
2985
|
+
z15.object({ type: z15.literal("stream"), delta: StreamDelta }),
|
|
2986
|
+
z15.object({ type: z15.literal("pong") }),
|
|
2987
|
+
z15.object({ type: z15.literal("force_logout"), reason: z15.string() })
|
|
2988
|
+
]);
|
|
2989
|
+
|
|
2990
|
+
// packages/protocol/dist/host-wire.js
|
|
2991
|
+
import { z as z17 } from "zod";
|
|
2992
|
+
|
|
2993
|
+
// packages/protocol/dist/terminal-wire.js
|
|
2994
|
+
import { z as z16 } from "zod";
|
|
2995
|
+
var Cols = z16.number().int().min(10).max(1e3);
|
|
2996
|
+
var Rows = z16.number().int().min(5).max(500);
|
|
2997
|
+
var TermViewerToServer = z16.discriminatedUnion("t", [
|
|
2998
|
+
z16.object({ t: z16.literal("in"), d: z16.string() }),
|
|
2999
|
+
z16.object({ t: z16.literal("resize"), cols: Cols, rows: Rows }),
|
|
3000
|
+
z16.object({ t: z16.literal("claim") })
|
|
3001
|
+
]);
|
|
3002
|
+
var TermServerToViewer = z16.discriminatedUnion("t", [
|
|
3003
|
+
z16.object({ t: z16.literal("out"), d: z16.string() }),
|
|
3004
|
+
z16.object({ t: z16.literal("closed"), reason: z16.string() }),
|
|
3005
|
+
z16.object({ t: z16.literal("size"), cols: Cols, rows: Rows, owner: z16.boolean() })
|
|
3006
|
+
]);
|
|
3007
|
+
var TermCoordinatorMsg = z16.discriminatedUnion("t", [
|
|
3008
|
+
z16.object({
|
|
3009
|
+
t: z16.literal("open"),
|
|
3010
|
+
sessionId: z16.string(),
|
|
3011
|
+
cols: Cols,
|
|
3012
|
+
rows: Rows,
|
|
3013
|
+
passive: z16.boolean().optional()
|
|
3353
3014
|
}),
|
|
3354
|
-
|
|
3355
|
-
|
|
3015
|
+
z16.object({ t: z16.literal("claim") }),
|
|
3016
|
+
z16.object({ t: z16.literal("in"), d: z16.string() }),
|
|
3017
|
+
z16.object({ t: z16.literal("resize"), cols: Cols, rows: Rows }),
|
|
3018
|
+
z16.object({ t: z16.literal("close") })
|
|
3356
3019
|
]);
|
|
3357
|
-
|
|
3020
|
+
|
|
3021
|
+
// packages/protocol/dist/host-wire.js
|
|
3022
|
+
var Origin = z17.enum(["human", "automation"]);
|
|
3023
|
+
var DiffRev = z17.string().regex(/^(uncommitted|[0-9a-f]{40})$/);
|
|
3024
|
+
var HostCommand = z17.discriminatedUnion("type", [
|
|
3358
3025
|
z17.object({
|
|
3359
|
-
type: z17.literal("
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3026
|
+
type: z17.literal("session.start"),
|
|
3027
|
+
sessionId: z17.string(),
|
|
3028
|
+
title: z17.string(),
|
|
3029
|
+
workspacePath: z17.string(),
|
|
3030
|
+
projectId: z17.string().nullable(),
|
|
3031
|
+
profile: Profile,
|
|
3032
|
+
nativeHandle: NativeHandle.nullable(),
|
|
3033
|
+
initialPrompt: z17.string().nullable(),
|
|
3034
|
+
dispatchKey: z17.string().nullable(),
|
|
3035
|
+
controlRevision: z17.number().int(),
|
|
3036
|
+
controlMode: ControlMode,
|
|
3037
|
+
origin: Origin,
|
|
3038
|
+
readOnly: z17.boolean().default(false),
|
|
3039
|
+
policyRequired: z17.boolean().optional()
|
|
3364
3040
|
}),
|
|
3365
3041
|
z17.object({
|
|
3366
|
-
type: z17.literal("
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3042
|
+
type: z17.literal("session.deliverMessage"),
|
|
3043
|
+
sessionId: z17.string(),
|
|
3044
|
+
messageId: z17.string(),
|
|
3045
|
+
payload: z17.object({
|
|
3046
|
+
deliveryId: z17.string(),
|
|
3047
|
+
kind: z17.enum(["message", "completion"]),
|
|
3048
|
+
text: z17.string()
|
|
3049
|
+
}),
|
|
3050
|
+
mode: z17.enum(["steer", "queue"]),
|
|
3051
|
+
holdUntil: z17.string()
|
|
3052
|
+
}),
|
|
3053
|
+
HostPolicySampleRequest.extend({ type: z17.literal("session.classifyPolicySample") }),
|
|
3054
|
+
z17.object({
|
|
3055
|
+
type: z17.literal("session.messageStatus"),
|
|
3056
|
+
sessionId: z17.string(),
|
|
3057
|
+
messageIds: z17.array(z17.string().min(1)).min(1).max(100)
|
|
3058
|
+
}),
|
|
3059
|
+
z17.object({
|
|
3060
|
+
type: z17.literal("session.prompt"),
|
|
3061
|
+
sessionId: z17.string(),
|
|
3062
|
+
text: z17.string(),
|
|
3063
|
+
images: z17.array(z17.object({ mimeType: z17.string(), data: z17.string() })).default([]),
|
|
3064
|
+
mode: z17.enum(["prompt", "steer", "followUp"]),
|
|
3065
|
+
origin: Origin,
|
|
3066
|
+
controlRevision: z17.number().int()
|
|
3067
|
+
}),
|
|
3068
|
+
z17.object({ type: z17.literal("session.abort"), sessionId: z17.string(), clearQueue: z17.boolean() }),
|
|
3069
|
+
/** `queueClear.v1`: empty Pi's queue without aborting; the receipt's result has the messages. */
|
|
3070
|
+
z17.object({ type: z17.literal("session.clearQueue"), sessionId: z17.string() }),
|
|
3071
|
+
z17.object({ type: z17.literal("session.stop"), sessionId: z17.string() }),
|
|
3072
|
+
z17.object({
|
|
3073
|
+
type: z17.literal("session.answer"),
|
|
3074
|
+
sessionId: z17.string(),
|
|
3075
|
+
interactionId: z17.string(),
|
|
3076
|
+
revision: z17.number().int(),
|
|
3077
|
+
response: InteractionResponseSchema,
|
|
3078
|
+
deviceId: z17.string()
|
|
3079
|
+
}),
|
|
3080
|
+
z17.object({
|
|
3081
|
+
type: z17.literal("session.adapterAction"),
|
|
3082
|
+
sessionId: z17.string(),
|
|
3083
|
+
generation: z17.string().uuid().optional(),
|
|
3084
|
+
adapterId: z17.string(),
|
|
3085
|
+
actionId: z17.string(),
|
|
3086
|
+
payload: z17.unknown()
|
|
3371
3087
|
}),
|
|
3372
|
-
z17.object({
|
|
3088
|
+
z17.object({
|
|
3089
|
+
type: z17.literal("session.setControl"),
|
|
3090
|
+
sessionId: z17.string(),
|
|
3091
|
+
controlRevision: z17.number().int(),
|
|
3092
|
+
mode: ControlMode
|
|
3093
|
+
}),
|
|
3094
|
+
z17.object({ type: z17.literal("session.rename"), sessionId: z17.string(), title: z17.string() }),
|
|
3095
|
+
z17.object({ type: z17.literal("session.importable") }),
|
|
3096
|
+
z17.object({ type: z17.literal("session.readNative"), sessionFile: z17.string() }),
|
|
3097
|
+
z17.object({ type: z17.literal("session.snapshot"), sessionId: z17.string() }),
|
|
3098
|
+
z17.object({ type: z17.literal("session.models"), sessionId: z17.string() }),
|
|
3099
|
+
z17.object({ type: z17.literal("session.commands"), sessionId: z17.string() }),
|
|
3100
|
+
z17.object({
|
|
3101
|
+
type: z17.literal("session.complete"),
|
|
3102
|
+
sessionId: z17.string(),
|
|
3103
|
+
text: z17.string().max(500)
|
|
3104
|
+
}),
|
|
3105
|
+
z17.object({ type: z17.literal("session.tree"), sessionId: z17.string() }),
|
|
3106
|
+
z17.object({
|
|
3107
|
+
type: z17.literal("session.branch"),
|
|
3108
|
+
sessionId: z17.string(),
|
|
3109
|
+
entryId: z17.string().nullable(),
|
|
3110
|
+
fork: z17.boolean()
|
|
3111
|
+
}),
|
|
3112
|
+
z17.object({
|
|
3113
|
+
type: z17.literal("session.navigate"),
|
|
3114
|
+
sessionId: z17.string(),
|
|
3115
|
+
entryId: z17.string(),
|
|
3116
|
+
summarize: z17.boolean(),
|
|
3117
|
+
instructions: z17.string().max(2e3).nullable()
|
|
3118
|
+
}),
|
|
3119
|
+
z17.object({ type: z17.literal("session.reload"), sessionId: z17.string() }),
|
|
3120
|
+
z17.object({ type: z17.literal("session.adapters"), sessionId: z17.string() }),
|
|
3121
|
+
z17.object({ type: z17.literal("session.reloadAdapters"), sessionId: z17.string() }),
|
|
3122
|
+
z17.object({ type: z17.literal("session.export"), sessionId: z17.string() }),
|
|
3123
|
+
z17.object({
|
|
3124
|
+
type: z17.literal("session.setModel"),
|
|
3125
|
+
sessionId: z17.string(),
|
|
3126
|
+
provider: z17.string().min(1),
|
|
3127
|
+
modelId: z17.string().min(1)
|
|
3128
|
+
}),
|
|
3129
|
+
z17.object({ type: z17.literal("session.setThinking"), sessionId: z17.string(), level: ThinkingLevel }),
|
|
3130
|
+
z17.object({
|
|
3131
|
+
type: z17.literal("session.compact"),
|
|
3132
|
+
sessionId: z17.string(),
|
|
3133
|
+
instructions: z17.string().nullable()
|
|
3134
|
+
}),
|
|
3135
|
+
z17.object({ type: z17.literal("checkout.inspect"), path: z17.string() }),
|
|
3136
|
+
z17.strictObject({
|
|
3137
|
+
type: z17.literal("checkout.preview"),
|
|
3138
|
+
root: z17.string().min(1).max(4096),
|
|
3139
|
+
folderName: z17.string().min(1).max(128)
|
|
3140
|
+
}),
|
|
3141
|
+
z17.strictObject({
|
|
3142
|
+
type: z17.literal("checkout.provision"),
|
|
3143
|
+
root: z17.string().min(1).max(4096),
|
|
3144
|
+
folderName: z17.string().min(1).max(128),
|
|
3145
|
+
expectedPath: z17.string().min(1).max(4096),
|
|
3146
|
+
cloneUrl: z17.string().min(1).max(4096),
|
|
3147
|
+
/** Only carried by a confirmed live command. Never persist or replay this payload. */
|
|
3148
|
+
grant: z17.strictObject({
|
|
3149
|
+
token: z17.string().min(1).max(4096).refine((token) => !/[^!-~]/.test(token)),
|
|
3150
|
+
expiresAt: z17.iso.datetime({ offset: true })
|
|
3151
|
+
})
|
|
3152
|
+
}),
|
|
3153
|
+
z17.strictObject({ type: z17.literal("checkout.locate"), cwd: z17.string().min(1).max(4096) }),
|
|
3154
|
+
z17.object({
|
|
3155
|
+
type: z17.literal("workspace.discover"),
|
|
3156
|
+
checkoutPath: z17.string(),
|
|
3157
|
+
worktreeDir: z17.string().default(DEFAULT_WORKTREE_DIR)
|
|
3158
|
+
}),
|
|
3159
|
+
z17.object({
|
|
3160
|
+
type: z17.literal("workspace.create"),
|
|
3161
|
+
checkoutPath: z17.string(),
|
|
3162
|
+
branch: z17.string(),
|
|
3163
|
+
base: z17.string(),
|
|
3164
|
+
setupCommand: z17.string().nullable(),
|
|
3165
|
+
worktreeDir: z17.string().default(DEFAULT_WORKTREE_DIR)
|
|
3166
|
+
}),
|
|
3167
|
+
z17.object({ type: z17.literal("workspace.status"), path: z17.string(), base: z17.string().nullable() }),
|
|
3168
|
+
z17.object({
|
|
3169
|
+
type: z17.literal("workspace.remove"),
|
|
3170
|
+
path: z17.string(),
|
|
3171
|
+
checkoutPath: z17.string(),
|
|
3172
|
+
base: z17.string().nullable(),
|
|
3173
|
+
force: z17.object({ dirty: z17.boolean(), unmerged: z17.boolean() }),
|
|
3174
|
+
/** Also delete the worktree's local branch (hosts before GitHub issue sync ignore it). */
|
|
3175
|
+
deleteBranch: z17.boolean().optional()
|
|
3176
|
+
}),
|
|
3177
|
+
z17.object({
|
|
3178
|
+
type: z17.literal("workspace.diff"),
|
|
3179
|
+
path: z17.string(),
|
|
3180
|
+
base: z17.string().nullable(),
|
|
3181
|
+
file: z17.string().nullable(),
|
|
3182
|
+
/** Hosts without gitLog.v1 never receive it. */
|
|
3183
|
+
rev: DiffRev.optional()
|
|
3184
|
+
}),
|
|
3185
|
+
z17.object({
|
|
3186
|
+
type: z17.literal("workspace.log"),
|
|
3187
|
+
path: z17.string(),
|
|
3188
|
+
base: z17.string().nullable(),
|
|
3189
|
+
limit: z17.number().int().min(1).max(200)
|
|
3190
|
+
}),
|
|
3191
|
+
z17.object({ type: z17.literal("workspace.files"), path: z17.string(), dir: z17.string() }),
|
|
3192
|
+
z17.object({ type: z17.literal("workspace.readFile"), path: z17.string(), file: z17.string() }),
|
|
3193
|
+
IssueHostPrepareBranchRequest.extend({ type: z17.literal("tracker.prepareBranch") }),
|
|
3194
|
+
z17.object({
|
|
3195
|
+
type: z17.literal("dispatch.start"),
|
|
3196
|
+
dispatchKey: z17.string(),
|
|
3197
|
+
runId: z17.string(),
|
|
3198
|
+
taskId: z17.string(),
|
|
3199
|
+
sessionId: z17.string(),
|
|
3200
|
+
projectId: z17.string(),
|
|
3201
|
+
title: z17.string(),
|
|
3202
|
+
workspace: z17.union([
|
|
3203
|
+
z17.object({ path: z17.string() }),
|
|
3204
|
+
z17.object({
|
|
3205
|
+
createFrom: z17.object({
|
|
3206
|
+
checkoutPath: z17.string(),
|
|
3207
|
+
branch: z17.string(),
|
|
3208
|
+
base: z17.string(),
|
|
3209
|
+
setupCommand: z17.string().nullable(),
|
|
3210
|
+
worktreeDir: z17.string().default(DEFAULT_WORKTREE_DIR)
|
|
3211
|
+
})
|
|
3212
|
+
})
|
|
3213
|
+
]),
|
|
3214
|
+
nativeHandle: NativeHandle.nullable(),
|
|
3215
|
+
profile: Profile,
|
|
3216
|
+
prompt: z17.string(),
|
|
3217
|
+
/** The launch's own revision; a takeover always carries a newer one. */
|
|
3218
|
+
controlRevision: z17.number().int(),
|
|
3219
|
+
controlMode: ControlMode.default("automation"),
|
|
3220
|
+
policyRequired: z17.boolean().optional()
|
|
3221
|
+
}),
|
|
3222
|
+
z17.object({ type: z17.literal("dispatch.reconcile"), dispatchKey: z17.string() }),
|
|
3223
|
+
z17.object({
|
|
3224
|
+
type: z17.literal("checks.run"),
|
|
3225
|
+
sessionId: z17.string(),
|
|
3226
|
+
path: z17.string(),
|
|
3227
|
+
commands: z17.array(z17.string())
|
|
3228
|
+
})
|
|
3229
|
+
]);
|
|
3230
|
+
var ImportableSession = z17.object({
|
|
3231
|
+
sessionFile: z17.string(),
|
|
3232
|
+
sessionId: z17.string(),
|
|
3233
|
+
cwd: z17.string(),
|
|
3234
|
+
name: z17.string().nullable(),
|
|
3235
|
+
mtime: z17.string(),
|
|
3236
|
+
inactive: z17.boolean()
|
|
3237
|
+
});
|
|
3238
|
+
var DiscoveredWorktree = z17.object({
|
|
3239
|
+
path: z17.string(),
|
|
3240
|
+
head: z17.string().nullable(),
|
|
3241
|
+
branch: z17.string().nullable(),
|
|
3242
|
+
bare: z17.boolean(),
|
|
3243
|
+
detached: z17.boolean(),
|
|
3244
|
+
locked: z17.boolean(),
|
|
3245
|
+
prunable: z17.boolean(),
|
|
3246
|
+
provenance: z17.enum(["managed", "discovered", "main"]),
|
|
3247
|
+
git: GitState.nullable()
|
|
3248
|
+
});
|
|
3249
|
+
var CheckoutInfo = z17.object({
|
|
3250
|
+
root: z17.string(),
|
|
3251
|
+
commonDir: z17.string(),
|
|
3252
|
+
repoIdentity: z17.string(),
|
|
3253
|
+
defaultBranch: z17.string()
|
|
3254
|
+
});
|
|
3255
|
+
var CheckoutPreviewResult = z17.object({
|
|
3256
|
+
path: z17.string(),
|
|
3257
|
+
root: z17.string(),
|
|
3258
|
+
state: z17.enum(["missing", "existing", "collision"]),
|
|
3259
|
+
checkout: CheckoutInfo.optional()
|
|
3260
|
+
});
|
|
3261
|
+
var CheckoutLocateResult = z17.object({ checkout: CheckoutInfo, worktreePath: z17.string() }).nullable();
|
|
3262
|
+
var GitCommit = z17.object({
|
|
3263
|
+
sha: z17.string().regex(/^[0-9a-f]{40}$/),
|
|
3264
|
+
subject: z17.string().max(300),
|
|
3265
|
+
author: z17.string().max(200),
|
|
3266
|
+
authoredAt: z17.string(),
|
|
3267
|
+
pushed: z17.boolean()
|
|
3268
|
+
});
|
|
3269
|
+
var LogResult = z17.object({
|
|
3270
|
+
/** The base branch the commits are counted from. */
|
|
3271
|
+
base: z17.string(),
|
|
3272
|
+
/** `branch`: commits since the merge base; `recent`: HEAD's latest commits (no commits of its own). */
|
|
3273
|
+
scope: z17.enum(["branch", "recent"]),
|
|
3274
|
+
commits: z17.array(GitCommit).max(200),
|
|
3275
|
+
truncated: z17.boolean(),
|
|
3276
|
+
/** Changed and untracked files not committed yet. */
|
|
3277
|
+
uncommitted: z17.number().int().min(0)
|
|
3278
|
+
});
|
|
3279
|
+
var DiffFile = z17.object({
|
|
3280
|
+
path: z17.string(),
|
|
3281
|
+
oldPath: z17.string().nullable(),
|
|
3282
|
+
added: z17.number().int(),
|
|
3283
|
+
deleted: z17.number().int(),
|
|
3284
|
+
status: z17.enum(["added", "modified", "deleted", "renamed", "untracked", "binary"])
|
|
3285
|
+
});
|
|
3286
|
+
var DiffResult = z17.object({
|
|
3287
|
+
base: z17.string(),
|
|
3288
|
+
files: z17.array(DiffFile),
|
|
3289
|
+
patch: z17.string().nullable()
|
|
3290
|
+
});
|
|
3291
|
+
var FileEntry = z17.object({
|
|
3292
|
+
name: z17.string(),
|
|
3293
|
+
path: z17.string(),
|
|
3294
|
+
kind: z17.enum(["file", "dir", "symlink"]),
|
|
3295
|
+
size: z17.number().int().nullable()
|
|
3296
|
+
});
|
|
3297
|
+
var ReconcileResult = z17.union([
|
|
3298
|
+
z17.object({ known: z17.literal(false) }),
|
|
3299
|
+
z17.object({
|
|
3300
|
+
known: z17.literal(true),
|
|
3301
|
+
sessionId: z17.string().nullable(),
|
|
3302
|
+
state: z17.enum(["accepted", "workspace_ready", "started", "failed"]),
|
|
3303
|
+
runtime: RuntimeState.nullable(),
|
|
3304
|
+
workspacePath: z17.string().nullable(),
|
|
3305
|
+
nativeHandle: NativeHandle.nullable(),
|
|
3306
|
+
error: z17.string().nullable(),
|
|
3307
|
+
/** `{started: "unknown"}` when the host restarted after Pi may have been spawned. */
|
|
3308
|
+
errorDetails: z17.record(z17.string(), z17.unknown()).nullable().default(null)
|
|
3309
|
+
})
|
|
3310
|
+
]);
|
|
3311
|
+
var DispatchStartResult = z17.object({
|
|
3312
|
+
sessionId: z17.string(),
|
|
3313
|
+
workspacePath: z17.string(),
|
|
3314
|
+
nativeHandle: NativeHandle.nullable(),
|
|
3315
|
+
reused: z17.boolean(),
|
|
3316
|
+
/** Why the launch prompt was not delivered to Pi (the session itself started), if it was not. */
|
|
3317
|
+
promptError: z17.string().nullable().optional()
|
|
3318
|
+
});
|
|
3319
|
+
var AnswerResult = z17.object({
|
|
3320
|
+
status: z17.enum(["answered", "already_answered"]),
|
|
3321
|
+
interaction: Interaction
|
|
3322
|
+
});
|
|
3323
|
+
var SnapshotResult = z17.object({
|
|
3324
|
+
partial: z17.array(TranscriptItem),
|
|
3325
|
+
pendingInteractions: z17.array(Interaction)
|
|
3326
|
+
});
|
|
3327
|
+
var ChecksResult = z17.object({ results: z17.array(CheckResult) });
|
|
3328
|
+
var Receipt = z17.union([
|
|
3329
|
+
z17.object({ commandId: z17.string(), ok: z17.literal(true), result: z17.unknown() }),
|
|
3330
|
+
z17.object({ commandId: z17.string(), ok: z17.literal(false), error: ErrorBody })
|
|
3331
|
+
]);
|
|
3332
|
+
var HostAgentRequestFrame = AgentRequestFrame.safeExtend({
|
|
3333
|
+
policyContext: HostToolPolicyContext.optional()
|
|
3334
|
+
}).strict().superRefine((frame, ctx) => {
|
|
3335
|
+
if (frame.method === "policy.evaluate" ? frame.policyContext === void 0 : Object.hasOwn(frame, "policyContext")) {
|
|
3336
|
+
ctx.addIssue({
|
|
3337
|
+
code: "custom",
|
|
3338
|
+
path: ["policyContext"],
|
|
3339
|
+
message: "Host policy context is required only for policy.evaluate."
|
|
3340
|
+
});
|
|
3341
|
+
}
|
|
3342
|
+
try {
|
|
3343
|
+
if (new TextEncoder().encode(JSON.stringify(frame)).length <= AGENT_FRAME_MAX_BYTES)
|
|
3344
|
+
return;
|
|
3345
|
+
} catch {
|
|
3346
|
+
}
|
|
3347
|
+
ctx.addIssue({ code: "custom", message: "Host agent frame exceeds 128 KiB or is not JSON." });
|
|
3348
|
+
});
|
|
3349
|
+
var HostToCoordinator = z17.discriminatedUnion("type", [
|
|
3350
|
+
z17.object({
|
|
3351
|
+
type: z17.literal("hello"),
|
|
3352
|
+
hostId: z17.string(),
|
|
3353
|
+
credential: z17.string(),
|
|
3354
|
+
name: z17.string(),
|
|
3355
|
+
agentVersion: z17.string(),
|
|
3356
|
+
piVersion: z17.string().nullable(),
|
|
3357
|
+
piCompatible: z17.boolean(),
|
|
3358
|
+
platform: Platform,
|
|
3359
|
+
capabilities: RuntimeCapabilities.nullable(),
|
|
3360
|
+
github: HostGitHub.optional(),
|
|
3361
|
+
protocolVersion: z17.number().int(),
|
|
3362
|
+
features: z17.array(z17.string()).optional()
|
|
3363
|
+
}),
|
|
3364
|
+
HostAgentRequestFrame,
|
|
3365
|
+
z17.object({ type: z17.literal("event"), hostSeq: z17.number().int(), event: HostEvent }),
|
|
3373
3366
|
z17.object({ type: z17.literal("stream"), delta: StreamDelta }),
|
|
3367
|
+
z17.object({ type: z17.literal("receipt"), receipt: Receipt }),
|
|
3374
3368
|
z17.object({ type: z17.literal("pong") }),
|
|
3375
|
-
z17.object({ type: z17.literal("
|
|
3369
|
+
z17.object({ type: z17.literal("usage"), usage: z17.array(ProviderUsage) }),
|
|
3370
|
+
z17.object({ type: z17.literal("term"), streamId: z17.string(), msg: TermServerToViewer })
|
|
3371
|
+
]);
|
|
3372
|
+
var CoordinatorToHost = z17.discriminatedUnion("type", [
|
|
3373
|
+
z17.object({
|
|
3374
|
+
type: z17.literal("welcome"),
|
|
3375
|
+
coordinatorVersion: z17.string(),
|
|
3376
|
+
ackedHostSeq: z17.number().int(),
|
|
3377
|
+
features: z17.array(z17.string()).optional()
|
|
3378
|
+
}),
|
|
3379
|
+
AgentResultFrame,
|
|
3380
|
+
z17.object({ type: z17.literal("ack"), hostSeq: z17.number().int() }),
|
|
3381
|
+
z17.object({ type: z17.literal("command"), commandId: z17.string(), command: HostCommand }),
|
|
3382
|
+
z17.object({ type: z17.literal("ping") }),
|
|
3383
|
+
z17.object({ type: z17.literal("reject"), error: ErrorBody }),
|
|
3384
|
+
z17.object({ type: z17.literal("term"), streamId: z17.string(), msg: TermCoordinatorMsg })
|
|
3376
3385
|
]);
|
|
3377
3386
|
|
|
3378
3387
|
// packages/protocol/dist/ids.js
|