@hearsay-tools/squawk 0.18.0-pr3583.6469 → 0.18.0-pr3586.6470
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 +4 -4
- package/dist/ci-wait/controller.d.ts +37 -37
- package/dist/ci-wait/tools.d.ts +4 -4
- package/dist/contract/health.d.ts +2 -0
- package/dist/contract/index.d.ts +1 -0
- package/dist/contract/index.js +591 -461
- package/dist/contract/projects.d.ts +1 -9
- package/dist/contract/voice.d.ts +213 -0
- package/dist/data-gitignore.js +1 -1
- package/dist/data-gitignore.js.map +1 -1
- package/dist/delegation/routes.d.ts +11 -11
- package/dist/delegation/transport.d.ts +4 -4
- package/dist/server/capabilities.d.ts +1 -0
- package/dist/server/capabilities.js +3 -0
- package/dist/server/capabilities.js.map +1 -1
- package/dist/server/forge/github.d.ts +1 -2
- package/dist/server/forge/github.js +1 -2
- package/dist/server/forge/github.js.map +1 -1
- package/dist/server/forge/types.d.ts +1 -1
- package/dist/server/live-routes.d.ts +6 -6
- package/dist/server/project-context.d.ts +1 -3
- package/dist/server/project-context.js +1 -3
- package/dist/server/project-context.js.map +1 -1
- package/dist/server/reports-api.d.ts +2 -2
- package/dist/server/server-deps.d.ts +1 -1
- package/dist/server/server-deps.js +1 -3
- package/dist/server/server-deps.js.map +1 -1
- package/dist/server/server.d.ts +195 -22
- package/dist/server/server.js +17 -13
- package/dist/server/server.js.map +1 -1
- package/dist/server/workspace-live-routes.d.ts +6 -6
- package/dist/voice/decide.d.ts +35 -0
- package/dist/voice/decide.js +329 -0
- package/dist/voice/decide.js.map +1 -0
- package/dist/voice/decision-log.d.ts +48 -0
- package/dist/voice/decision-log.js +117 -0
- package/dist/voice/decision-log.js.map +1 -0
- package/dist/voice/engine.d.ts +119 -0
- package/dist/voice/engine.js +61 -0
- package/dist/voice/engine.js.map +1 -0
- package/dist/voice/fake-engine.d.ts +10 -0
- package/dist/voice/fake-engine.js +192 -0
- package/dist/voice/fake-engine.js.map +1 -0
- package/dist/voice/jev-engine.d.ts +17 -0
- package/dist/voice/jev-engine.js +110 -0
- package/dist/voice/jev-engine.js.map +1 -0
- package/dist/voice/pending-ask.d.ts +17 -0
- package/dist/voice/pending-ask.js +51 -0
- package/dist/voice/pending-ask.js.map +1 -0
- package/dist/voice/routes.d.ts +115 -0
- package/dist/voice/routes.js +92 -0
- package/dist/voice/routes.js.map +1 -0
- package/dist/voice/sentence.d.ts +21 -0
- package/dist/voice/sentence.js +61 -0
- package/dist/voice/sentence.js.map +1 -0
- package/dist/voice/thresholds.d.ts +28 -0
- package/dist/voice/thresholds.js +29 -0
- package/dist/voice/thresholds.js.map +1 -0
- package/dist/workflows/continuation-admission.d.ts +72 -72
- package/dist/workflows/run/wait-engine.d.ts +72 -72
- package/package.json +4 -4
- package/scripts/voice-replay.ts +50 -0
- package/web/dist/assets/activity-motion-CbA_TAx4.js +2 -0
- package/web/dist/assets/{activity-route-DURvhLQf.js → activity-route-Cq5GO6rp.js} +1 -1
- package/web/dist/assets/agent-accounts-Cof8AiVl.js +18 -0
- package/web/dist/assets/{alert-dialog-CPBKJTj_.js → alert-dialog-CH4SXGfX.js} +1 -1
- package/web/dist/assets/attention-BjWQsJVw.js +1 -0
- package/web/dist/assets/button-DGwhwRuD.js +3 -0
- package/web/dist/assets/{centered-state-8l6wvu0C.js → centered-state-B5QmAy2y.js} +1 -1
- package/web/dist/assets/{cez-idle-TVRD1sce.js → cez-idle-xv7f96fc.js} +1 -1
- package/web/dist/assets/{commit-diff-panel-BbM4GEgm.js → commit-diff-panel-BInf9r-P.js} +1 -1
- package/web/dist/assets/{dialog-CkU56ywj.js → dialog-B7p5oc5r.js} +1 -1
- package/web/dist/assets/diff-BvCB85J2.js +3 -0
- package/web/dist/assets/{diff-controls-DzcrZF8L.js → diff-controls-CeYlCm_y.js} +1 -1
- package/web/dist/assets/{diff-view--NwKwseV.js → diff-view-Cnlbd7ej.js} +4 -4
- package/web/dist/assets/{dist-D4TujV9O.js → dist-ClnpAEgV.js} +1 -1
- package/web/dist/assets/{dropdown-menu-BN2BI4R1.js → dropdown-menu-DPrTX-zi.js} +1 -1
- package/web/dist/assets/{es2015-DnySZnV4.js → es2015-DTn4s5Lh.js} +1 -1
- package/web/dist/assets/{file-preview-B36xoAJ8.js → file-preview-EiGdhbDV.js} +2 -2
- package/web/dist/assets/git-toolbar-D6W3lamH.js +1 -0
- package/web/dist/assets/{github-CA0qpTLt.js → github-DQe-Ussy.js} +1 -1
- package/web/dist/assets/{global-activity-route-DRc_wjkF.js → global-activity-route-_1mbn6gk.js} +1 -1
- package/web/dist/assets/{image-preview-DpaJAUA9.js → image-preview-cn57tA1m.js} +1 -1
- package/web/dist/assets/index-Cs-8u_FQ.js +17 -0
- package/web/dist/assets/index-WLruDkjz.css +1 -0
- package/web/dist/assets/{live-protocol-aMLJJ0MQ.js → live-protocol-DjH6ZQwI.js} +1 -1
- package/web/dist/assets/{nav-row-styles-DoZBu-jT.js → nav-row-styles-DSBuSnEE.js} +1 -1
- package/web/dist/assets/preview-pane-connected-DgZ5q0xy.js +3 -0
- package/web/dist/assets/project-router-iGGf0Wcy.js +1 -0
- package/web/dist/assets/project-scope-context-DK2mtfmt.js +4 -0
- package/web/dist/assets/{prompt-template-menu-BJlLqUsI.js → prompt-template-menu-D1AqFsnv.js} +1 -1
- package/web/dist/assets/queries-CMLTX79n.js +1 -0
- package/web/dist/assets/{reference-chip-pp1FgLpK.js → reference-chip-uYFiC2FE.js} +1 -1
- package/web/dist/assets/repo-git-B_xucWJR.js +1 -0
- package/web/dist/assets/{report-reader-C_r69KvS.js → report-reader-Csv7xOrn.js} +1 -1
- package/web/dist/assets/reports-BVp32fGs.js +1 -0
- package/web/dist/assets/run-header-C941_3eU.js +2 -0
- package/web/dist/assets/skills-PpSAbEYS.js +1 -0
- package/web/dist/assets/{tab-link-92W6MWDZ.js → tab-link-dVF0beIK.js} +1 -1
- package/web/dist/assets/task-changes-BaCA5Izd.js +1 -0
- package/web/dist/assets/task-commits-B4oZHsub.js +1 -0
- package/web/dist/assets/task-files-Bg_J255X.js +1 -0
- package/web/dist/assets/task-github-item-DyBh5-Q_.js +1 -0
- package/web/dist/assets/task-thread-D6wp7G61.js +9 -0
- package/web/dist/assets/{thread-state-DBalnt7M.js → thread-state-DA5kehiy.js} +1 -1
- package/web/dist/assets/{toaster-2NK3PogQ.js → toaster-CoMJoQvk.js} +1 -1
- package/web/dist/assets/use-desktop-BL6xT4Rz.js +1 -0
- package/web/dist/assets/use-hand-to-agent-state-CPhF3TRe.js +1 -0
- package/web/dist/assets/{useInfiniteQuery-C22IahAC.js → useInfiniteQuery-CYsKbsRE.js} +1 -1
- package/web/dist/assets/useQuery-DMywwX-_.js +1 -0
- package/web/dist/assets/workflows-CsCKM6GN.js +7 -0
- package/web/dist/assets/{ws-D9whCwIN.js → ws-DdguL17F.js} +1 -1
- package/web/dist/assets/{zoomable-image-D0zshpve.js → zoomable-image-C7mEDZaS.js} +1 -1
- package/web/dist/index.html +24 -25
- package/web/dist/live-worker.js +1 -1
- package/dist/server/launch-key.d.ts +0 -5
- package/dist/server/launch-key.js +0 -35
- package/dist/server/launch-key.js.map +0 -1
- package/web/dist/assets/activity-motion-CSe8gVgw.js +0 -2
- package/web/dist/assets/agent-accounts-BrFoXDpa.js +0 -18
- package/web/dist/assets/attention-BeBfNOUJ.js +0 -1
- package/web/dist/assets/button-Czdi8NqC.js +0 -3
- package/web/dist/assets/diff-DgAd6acp.js +0 -3
- package/web/dist/assets/git-toolbar-Db0h7gTI.js +0 -1
- package/web/dist/assets/index-De7eAZ5M.js +0 -17
- package/web/dist/assets/index-Dps0ABGp.css +0 -1
- package/web/dist/assets/input-Dilvz-YI.js +0 -1
- package/web/dist/assets/preview-pane-connected-CU_lEf11.js +0 -3
- package/web/dist/assets/project-router-ir-bfT5a.js +0 -1
- package/web/dist/assets/project-scope-context-BSdXJd3m.js +0 -4
- package/web/dist/assets/queries-BXo4WfX0.js +0 -1
- package/web/dist/assets/repo-git-BOfsABl4.js +0 -1
- package/web/dist/assets/reports-CWIvS-PA.js +0 -1
- package/web/dist/assets/run-header-CSEAFAfa.js +0 -2
- package/web/dist/assets/skills-jwrn7yXY.js +0 -1
- package/web/dist/assets/task-changes-EalDx6wh.js +0 -1
- package/web/dist/assets/task-commits-ZWjrQSnF.js +0 -1
- package/web/dist/assets/task-files-Cg-INsaD.js +0 -1
- package/web/dist/assets/task-github-item-B8yO5uo1.js +0 -1
- package/web/dist/assets/task-thread-Bs6ZnRXz.js +0 -9
- package/web/dist/assets/use-desktop-BYMCVpyw.js +0 -1
- package/web/dist/assets/use-hand-to-agent-state-Bhmmem1E.js +0 -1
- package/web/dist/assets/useQuery-C0rYnV6X.js +0 -1
- package/web/dist/assets/workflows-BRhGKY_0.js +0 -7
package/dist/contract/index.js
CHANGED
|
@@ -1080,6 +1080,14 @@ var capabilitiesSchema = z12.object({
|
|
|
1080
1080
|
* REQUIRED for the same reason as `tokenMetrics` below: this server always sends it.
|
|
1081
1081
|
*/
|
|
1082
1082
|
preview: z12.boolean(),
|
|
1083
|
+
/**
|
|
1084
|
+
* `true` means `CEZ_VOICE=1` opted this server into voice mode and a way to decide exists:
|
|
1085
|
+
* `TYPESAFE_API_KEY` is set, or `CEZ_DRY_RUN=1` supplies the fake engine. Off — the default —
|
|
1086
|
+
* the `/api/v1/…/voice/*` family answers `409` and the ⌘K palette renders as before.
|
|
1087
|
+
*
|
|
1088
|
+
* REQUIRED for the same reason as `tokenMetrics` below: this server always sends it.
|
|
1089
|
+
*/
|
|
1090
|
+
voice: z12.boolean(),
|
|
1083
1091
|
/**
|
|
1084
1092
|
* `false` means `CEZ_HIDE_TOKEN_METRICS=1` asks the browser to omit token counts and monetary
|
|
1085
1093
|
* cost (#481). The telemetry itself still rides in run/event payloads — this is presentation
|
|
@@ -3654,9 +3662,6 @@ var fsBrowseResponseSchema = z22.object({
|
|
|
3654
3662
|
* silently short list. */
|
|
3655
3663
|
truncated: z22.boolean()
|
|
3656
3664
|
});
|
|
3657
|
-
var launchKeyResponseSchema = z22.object({
|
|
3658
|
-
key: z22.string()
|
|
3659
|
-
});
|
|
3660
3665
|
var checkoutProgressParamsSchema = z22.object({ checkoutId: z22.string().min(1).max(128) });
|
|
3661
3666
|
var checkoutProgressResponseSchema = z22.object({ progress: checkoutProgressEventSchema.nullable() });
|
|
3662
3667
|
var registerProjectInputSchema = z22.object({
|
|
@@ -4501,6 +4506,118 @@ var scheduledTasksAnswerSchema = z29.union([
|
|
|
4501
4506
|
refusal
|
|
4502
4507
|
]);
|
|
4503
4508
|
|
|
4509
|
+
// ../contract/src/voice.ts
|
|
4510
|
+
import { z as z30 } from "zod";
|
|
4511
|
+
var VOICE_TEXT_MAX = 500;
|
|
4512
|
+
var VOICE_STATUS_IDS = [
|
|
4513
|
+
"needs-you",
|
|
4514
|
+
"working",
|
|
4515
|
+
"finished",
|
|
4516
|
+
"archived",
|
|
4517
|
+
"needs-review",
|
|
4518
|
+
"needs-permission",
|
|
4519
|
+
"failed",
|
|
4520
|
+
"running",
|
|
4521
|
+
"waiting-for-ci",
|
|
4522
|
+
"monitoring",
|
|
4523
|
+
"waiting-for-capacity",
|
|
4524
|
+
"queued",
|
|
4525
|
+
"scheduled",
|
|
4526
|
+
"waiting-on-workers",
|
|
4527
|
+
"done",
|
|
4528
|
+
"cancelled",
|
|
4529
|
+
"unread"
|
|
4530
|
+
];
|
|
4531
|
+
var voiceStatusSchema = z30.enum(VOICE_STATUS_IDS);
|
|
4532
|
+
var VOICE_STATUS_DESCRIPTIONS = {
|
|
4533
|
+
"needs-you": "Tasks that wait for the user: a question, a permission or a review.",
|
|
4534
|
+
working: "Tasks that are running or waiting on something other than the user.",
|
|
4535
|
+
finished: "Done, failed or cancelled tasks the user has not archived.",
|
|
4536
|
+
archived: "Tasks the user has archived.",
|
|
4537
|
+
"needs-review": "Tasks that stopped at the review gate and wait for the user to review the change.",
|
|
4538
|
+
"needs-permission": "Tasks that wait for the user to allow or deny a tool call.",
|
|
4539
|
+
failed: "Tasks that ended with an error.",
|
|
4540
|
+
running: "Tasks whose agent is working right now.",
|
|
4541
|
+
"waiting-for-ci": "Tasks that wait for the checks of a pull request.",
|
|
4542
|
+
monitoring: "Tasks that parked to watch something and will wake later.",
|
|
4543
|
+
"waiting-for-capacity": "Tasks that wait for a free parallel slot or for memory.",
|
|
4544
|
+
queued: "Tasks that have not started yet.",
|
|
4545
|
+
scheduled: "Tasks that a timer will start or wake at a set time.",
|
|
4546
|
+
"waiting-on-workers": "Tasks that wait on other tasks: for the workers they started, for replies from their workers, or for a reply from their parent task.",
|
|
4547
|
+
done: "Tasks that finished their work without error.",
|
|
4548
|
+
cancelled: "Tasks the user stopped.",
|
|
4549
|
+
unread: "Tasks with news the user has not seen yet."
|
|
4550
|
+
};
|
|
4551
|
+
var voicePositionSchema = z30.union([z30.enum(["next", "previous", "last"]), z30.number().int().min(1).max(10)]);
|
|
4552
|
+
var voiceSidebarViewSchema = z30.enum(["active", "automations"]);
|
|
4553
|
+
var VOICE_VIEWS = ["task", "new-task", "github", "git", "automations", "inbox", "settings", "other"];
|
|
4554
|
+
var voiceViewSchema = z30.enum(VOICE_VIEWS);
|
|
4555
|
+
var voiceDecideRequestSchema = z30.object({
|
|
4556
|
+
text: z30.string().trim().min(1).max(VOICE_TEXT_MAX),
|
|
4557
|
+
sidebarView: voiceSidebarViewSchema,
|
|
4558
|
+
openRunId: runIdParamSchema.shape.id.optional(),
|
|
4559
|
+
view: voiceViewSchema.optional(),
|
|
4560
|
+
/**
|
|
4561
|
+
* The question card the palette shows for `openRunId`: its request id, `null` when it shows none,
|
|
4562
|
+
* absent when it does not know yet (the thread is still loading). A reply decided against another
|
|
4563
|
+
* card than the server's pending one is stale.
|
|
4564
|
+
*/
|
|
4565
|
+
askRequestId: z30.string().min(1).max(200).nullable().optional(),
|
|
4566
|
+
proposal: z30.object({
|
|
4567
|
+
decisionId: z30.uuid(),
|
|
4568
|
+
action: z30.enum(["answer", "tell"])
|
|
4569
|
+
}).strict().optional()
|
|
4570
|
+
}).strict();
|
|
4571
|
+
var voiceAnswerSchema = z30.discriminatedUnion("kind", [
|
|
4572
|
+
z30.object({
|
|
4573
|
+
question: z30.number().int().min(0).max(3),
|
|
4574
|
+
kind: z30.literal("option"),
|
|
4575
|
+
labels: z30.array(z30.string()).min(1).max(4)
|
|
4576
|
+
}),
|
|
4577
|
+
z30.object({
|
|
4578
|
+
question: z30.number().int().min(0).max(3),
|
|
4579
|
+
kind: z30.literal("other"),
|
|
4580
|
+
text: z30.string().min(1).max(VOICE_TEXT_MAX)
|
|
4581
|
+
})
|
|
4582
|
+
]);
|
|
4583
|
+
var decisionId = z30.uuid();
|
|
4584
|
+
var confidence = z30.number().min(0).max(1);
|
|
4585
|
+
var voiceDecisionSchema = z30.discriminatedUnion("action", [
|
|
4586
|
+
z30.object({
|
|
4587
|
+
action: z30.literal("open"),
|
|
4588
|
+
decisionId,
|
|
4589
|
+
status: voiceStatusSchema,
|
|
4590
|
+
position: voicePositionSchema,
|
|
4591
|
+
confidence,
|
|
4592
|
+
alternatives: z30.array(z30.object({ status: voiceStatusSchema, position: voicePositionSchema })).max(3).optional()
|
|
4593
|
+
}),
|
|
4594
|
+
z30.object({
|
|
4595
|
+
action: z30.literal("answer"),
|
|
4596
|
+
decisionId,
|
|
4597
|
+
runId: runIdParamSchema.shape.id,
|
|
4598
|
+
askRequestId: z30.string(),
|
|
4599
|
+
answers: z30.array(voiceAnswerSchema).min(1).max(4),
|
|
4600
|
+
confidence
|
|
4601
|
+
}),
|
|
4602
|
+
z30.object({
|
|
4603
|
+
action: z30.literal("tell"),
|
|
4604
|
+
decisionId,
|
|
4605
|
+
runId: runIdParamSchema.shape.id,
|
|
4606
|
+
text: z30.string().min(1).max(VOICE_TEXT_MAX),
|
|
4607
|
+
confidence
|
|
4608
|
+
}),
|
|
4609
|
+
z30.object({ action: z30.literal("confirm"), decisionId }),
|
|
4610
|
+
z30.object({ action: z30.literal("cancel"), decisionId }),
|
|
4611
|
+
z30.object({
|
|
4612
|
+
action: z30.literal("none"),
|
|
4613
|
+
decisionId,
|
|
4614
|
+
reason: z30.enum(["not-a-command", "no-open-task", "no-open-question", "unclear", "ambiguous", "stale-context", "unsupported"])
|
|
4615
|
+
})
|
|
4616
|
+
]);
|
|
4617
|
+
var voiceOutcomeSchema = z30.enum(["executed", "confirmed", "cancelled", "replaced", "abandoned"]);
|
|
4618
|
+
var voiceOutcomeRequestSchema = z30.object({ decisionId: z30.uuid(), outcome: voiceOutcomeSchema }).strict();
|
|
4619
|
+
var voiceOutcomeResponseSchema = z30.object({ ok: z30.literal(true) });
|
|
4620
|
+
|
|
4504
4621
|
// ../contract/src/run-predicates.ts
|
|
4505
4622
|
var LIVE_STATUSES = /* @__PURE__ */ new Set(["queued", "running", "waiting"]);
|
|
4506
4623
|
function isLiveStatus(status) {
|
|
@@ -4656,73 +4773,73 @@ function sqlPrefilterTokens(query, options = {}) {
|
|
|
4656
4773
|
}
|
|
4657
4774
|
|
|
4658
4775
|
// ../contract/src/artifacts.ts
|
|
4659
|
-
import { z as
|
|
4660
|
-
var pathSchema =
|
|
4661
|
-
var publishedArtifactSchema =
|
|
4662
|
-
id:
|
|
4663
|
-
runId:
|
|
4664
|
-
name:
|
|
4665
|
-
title:
|
|
4776
|
+
import { z as z31 } from "zod";
|
|
4777
|
+
var pathSchema = z31.string().min(1).max(8192).refine((value) => !value.includes("\0"), "Path contains NUL");
|
|
4778
|
+
var publishedArtifactSchema = z31.object({
|
|
4779
|
+
id: z31.uuid(),
|
|
4780
|
+
runId: z31.uuid(),
|
|
4781
|
+
name: z31.string().min(1).max(255),
|
|
4782
|
+
title: z31.string().max(200).optional(),
|
|
4666
4783
|
sourcePath: pathSchema.refine((value) => /^(?:\/|[A-Za-z]:[\\/]|\\\\)/.test(value), "Expected an absolute source path"),
|
|
4667
|
-
createdAt:
|
|
4668
|
-
size:
|
|
4669
|
-
sha256:
|
|
4784
|
+
createdAt: z31.iso.datetime(),
|
|
4785
|
+
size: z31.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
|
|
4786
|
+
sha256: z31.string().regex(/^[a-f0-9]{64}$/)
|
|
4670
4787
|
}).strict();
|
|
4671
|
-
var filePreviewDataSchema =
|
|
4672
|
-
type:
|
|
4788
|
+
var filePreviewDataSchema = z31.object({
|
|
4789
|
+
type: z31.literal("file"),
|
|
4673
4790
|
path: pathSchema,
|
|
4674
|
-
size:
|
|
4675
|
-
binary:
|
|
4676
|
-
tooLarge:
|
|
4677
|
-
content:
|
|
4678
|
-
source:
|
|
4791
|
+
size: z31.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
|
|
4792
|
+
binary: z31.boolean(),
|
|
4793
|
+
tooLarge: z31.boolean(),
|
|
4794
|
+
content: z31.string().optional(),
|
|
4795
|
+
source: z31.enum(["worktree", "project", "artifact"]),
|
|
4679
4796
|
artifact: publishedArtifactSchema.optional()
|
|
4680
4797
|
}).strict();
|
|
4681
|
-
var fileLinkResultSchema =
|
|
4798
|
+
var fileLinkResultSchema = z31.union([
|
|
4682
4799
|
filePreviewDataSchema,
|
|
4683
|
-
|
|
4684
|
-
type:
|
|
4800
|
+
z31.object({
|
|
4801
|
+
type: z31.enum(["unavailable", "unpublished"]),
|
|
4685
4802
|
path: pathSchema,
|
|
4686
|
-
reason:
|
|
4803
|
+
reason: z31.string().min(1).max(4096)
|
|
4687
4804
|
}).strict()
|
|
4688
4805
|
]);
|
|
4689
|
-
var artifactMetadataResponseSchema =
|
|
4690
|
-
var artifactListSchema =
|
|
4691
|
-
var fileLinkQuerySchema =
|
|
4692
|
-
var artifactParamsSchema =
|
|
4806
|
+
var artifactMetadataResponseSchema = z31.object({ artifact: publishedArtifactSchema }).strict();
|
|
4807
|
+
var artifactListSchema = z31.object({ artifacts: z31.array(publishedArtifactSchema).max(64) }).strict();
|
|
4808
|
+
var fileLinkQuerySchema = z31.object({ path: pathSchema, raw: z31.literal("1").optional() }).strict();
|
|
4809
|
+
var artifactParamsSchema = z31.object({ id: z31.uuid(), artifactId: z31.uuid() });
|
|
4693
4810
|
|
|
4694
4811
|
// ../contract/src/discovery.ts
|
|
4695
|
-
import { z as
|
|
4696
|
-
var hostDiscoveryRequestSchema =
|
|
4697
|
-
|
|
4698
|
-
|
|
4812
|
+
import { z as z32 } from "zod";
|
|
4813
|
+
var hostDiscoveryRequestSchema = z32.discriminatedUnion("kind", [
|
|
4814
|
+
z32.object({ kind: z32.literal("runners") }).strict(),
|
|
4815
|
+
z32.object({ kind: z32.literal("models"), runner: modelDiscoveryRunnerSchema }).strict()
|
|
4699
4816
|
]);
|
|
4700
|
-
var discoveryRequestSchema =
|
|
4817
|
+
var discoveryRequestSchema = z32.discriminatedUnion("kind", [
|
|
4701
4818
|
...hostDiscoveryRequestSchema.options,
|
|
4702
|
-
|
|
4819
|
+
z32.object({ kind: z32.literal("tasks"), all: z32.boolean().optional(), offset: z32.number().int().min(0).max(Number.MAX_SAFE_INTEGER).optional() }).strict()
|
|
4703
4820
|
]);
|
|
4704
4821
|
var discoveredRunnerSchema = providerStatusSchema.omit({ provider: true, profileId: true }).extend({ runner: modelDiscoveryRunnerSchema });
|
|
4705
|
-
var discoveredRunnersSchema =
|
|
4706
|
-
scope:
|
|
4707
|
-
runners:
|
|
4708
|
-
});
|
|
4709
|
-
var discoveredTasksSchema =
|
|
4710
|
-
tasks:
|
|
4711
|
-
id:
|
|
4712
|
-
title:
|
|
4822
|
+
var discoveredRunnersSchema = z32.object({
|
|
4823
|
+
scope: z32.literal("host-default-account"),
|
|
4824
|
+
runners: z32.array(discoveredRunnerSchema)
|
|
4825
|
+
});
|
|
4826
|
+
var discoveredTasksSchema = z32.object({
|
|
4827
|
+
tasks: z32.array(z32.object({
|
|
4828
|
+
id: z32.string(),
|
|
4829
|
+
title: z32.string(),
|
|
4713
4830
|
runner: runnerSchema.optional(),
|
|
4714
4831
|
status: runStatusSchema,
|
|
4715
|
-
attention:
|
|
4716
|
-
attentionLabel:
|
|
4717
|
-
accepts:
|
|
4718
|
-
reason:
|
|
4832
|
+
attention: z32.enum(["permission", "error", "waiting", "running", "unseen", "none"]),
|
|
4833
|
+
attentionLabel: z32.string(),
|
|
4834
|
+
accepts: z32.boolean(),
|
|
4835
|
+
reason: z32.string().optional()
|
|
4719
4836
|
})).max(32),
|
|
4720
|
-
nextOffset:
|
|
4837
|
+
nextOffset: z32.number().int().nonnegative().optional()
|
|
4721
4838
|
});
|
|
4722
|
-
var discoveryResponseSchema =
|
|
4839
|
+
var discoveryResponseSchema = z32.union([discoveredRunnersSchema, runnerModelCatalogResponseSchema, discoveredTasksSchema]);
|
|
4723
4840
|
|
|
4724
4841
|
// ../contract/src/live.ts
|
|
4725
|
-
import { z as
|
|
4842
|
+
import { z as z33 } from "zod";
|
|
4726
4843
|
|
|
4727
4844
|
// ../contract/src/live-limits.ts
|
|
4728
4845
|
var LIVE_RUN_LIMIT = 32;
|
|
@@ -4730,44 +4847,44 @@ var LIVE_EVENT_LIMIT = 256;
|
|
|
4730
4847
|
var LIVE_BYTE_LIMIT = 1024 * 1024;
|
|
4731
4848
|
|
|
4732
4849
|
// ../contract/src/live.ts
|
|
4733
|
-
var liveRunDemandSchema =
|
|
4734
|
-
projectId:
|
|
4850
|
+
var liveRunDemandSchema = z33.object({
|
|
4851
|
+
projectId: z33.string().min(1).max(128).regex(/^[a-zA-Z0-9_-]+$/),
|
|
4735
4852
|
runId: runIdParamSchema.shape.id,
|
|
4736
4853
|
cursor: runHistoryCursorSchema.optional(),
|
|
4737
|
-
afterSeq:
|
|
4854
|
+
afterSeq: z33.number().int().nonnegative().safe()
|
|
4738
4855
|
});
|
|
4739
|
-
var liveRunsRequestSchema =
|
|
4740
|
-
runs:
|
|
4856
|
+
var liveRunsRequestSchema = z33.object({
|
|
4857
|
+
runs: z33.array(liveRunDemandSchema).min(1).max(LIVE_RUN_LIMIT)
|
|
4741
4858
|
}).refine(({ runs }) => new Set(runs.map((r) => `${r.projectId}/${r.runId}`)).size === runs.length, {
|
|
4742
4859
|
message: "duplicate run demand"
|
|
4743
4860
|
});
|
|
4744
4861
|
var identity = liveRunDemandSchema.pick({ projectId: true, runId: true });
|
|
4745
4862
|
var liveRunErrorSchema = identity.extend({
|
|
4746
|
-
type:
|
|
4747
|
-
status:
|
|
4748
|
-
error:
|
|
4863
|
+
type: z33.enum(["error", "reset"]),
|
|
4864
|
+
status: z33.union([z33.literal(400), z33.literal(404), z33.literal(409), z33.literal(413), z33.literal(503)]),
|
|
4865
|
+
error: z33.string()
|
|
4749
4866
|
});
|
|
4750
4867
|
var liveRunBatchSchema = identity.extend({
|
|
4751
|
-
type:
|
|
4752
|
-
events:
|
|
4868
|
+
type: z33.literal("batch"),
|
|
4869
|
+
events: z33.array(runHistoryEventSchema).max(LIVE_EVENT_LIMIT),
|
|
4753
4870
|
cursor: runHistoryCursorSchema,
|
|
4754
|
-
afterSeq:
|
|
4755
|
-
hasMore:
|
|
4756
|
-
});
|
|
4757
|
-
var liveRunBatchResultSchema =
|
|
4758
|
-
var liveRunBatchResponseSchema =
|
|
4759
|
-
generation:
|
|
4760
|
-
results:
|
|
4761
|
-
});
|
|
4762
|
-
var liveRunFrameSchema =
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
identity.extend({ type:
|
|
4871
|
+
afterSeq: z33.number().int().nonnegative(),
|
|
4872
|
+
hasMore: z33.boolean()
|
|
4873
|
+
});
|
|
4874
|
+
var liveRunBatchResultSchema = z33.union([liveRunBatchSchema, liveRunErrorSchema]);
|
|
4875
|
+
var liveRunBatchResponseSchema = z33.object({
|
|
4876
|
+
generation: z33.string(),
|
|
4877
|
+
results: z33.array(liveRunBatchResultSchema)
|
|
4878
|
+
});
|
|
4879
|
+
var liveRunFrameSchema = z33.union([
|
|
4880
|
+
z33.object({ type: z33.literal("ready"), generation: z33.string() }),
|
|
4881
|
+
z33.object({ type: z33.literal("ping") }),
|
|
4882
|
+
identity.extend({ type: z33.literal("event"), name: z33.enum(["run-event", "ui-event"]), event: runHistoryEventSchema }),
|
|
4766
4883
|
liveRunErrorSchema
|
|
4767
4884
|
]);
|
|
4768
4885
|
|
|
4769
4886
|
// ../contract/src/activity.ts
|
|
4770
|
-
import { z as
|
|
4887
|
+
import { z as z34 } from "zod";
|
|
4771
4888
|
var ACTIVITY_RATE_SECONDS = 30;
|
|
4772
4889
|
var ACTIVITY_TEXT_MAX = 500;
|
|
4773
4890
|
var ACTIVITY_ERROR_MAX = 200;
|
|
@@ -4775,144 +4892,144 @@ var ACTIVITY_TOOL_TITLE_MAX = 160;
|
|
|
4775
4892
|
var ACTIVITY_CHECKS_MAX = 100;
|
|
4776
4893
|
var ACTIVITY_CHECK_NAME_MAX = 100;
|
|
4777
4894
|
var ACTIVITY_CLOSED_WINDOW_MS = 3e4;
|
|
4778
|
-
var iso =
|
|
4779
|
-
var count =
|
|
4780
|
-
var runId =
|
|
4895
|
+
var iso = z34.iso.datetime();
|
|
4896
|
+
var count = z34.number().int().nonnegative();
|
|
4897
|
+
var runId = z34.string().min(1);
|
|
4781
4898
|
var ACTIVITY_TOOL_KINDS = ["read", "edit", "delete", "move", "search", "execute", "think", "fetch", "task", "plan", "other"];
|
|
4782
|
-
var activityToolSchema =
|
|
4783
|
-
title:
|
|
4784
|
-
toolKind:
|
|
4785
|
-
status:
|
|
4899
|
+
var activityToolSchema = z34.object({
|
|
4900
|
+
title: z34.string().max(ACTIVITY_TOOL_TITLE_MAX),
|
|
4901
|
+
toolKind: z34.enum(ACTIVITY_TOOL_KINDS),
|
|
4902
|
+
status: z34.enum(["pending", "running", "completed", "failed", "declined"]),
|
|
4786
4903
|
startedAt: iso,
|
|
4787
4904
|
endedAt: iso.optional()
|
|
4788
4905
|
}).strict();
|
|
4789
|
-
var activityCheckBucketSchema =
|
|
4790
|
-
var activityPrProgressSchema =
|
|
4791
|
-
checks:
|
|
4792
|
-
counts:
|
|
4793
|
-
truncated:
|
|
4906
|
+
var activityCheckBucketSchema = z34.enum(["pass", "fail", "pending", "skipping", "cancel"]);
|
|
4907
|
+
var activityPrProgressSchema = z34.object({
|
|
4908
|
+
checks: z34.array(z34.object({ name: z34.string().max(ACTIVITY_CHECK_NAME_MAX), bucket: activityCheckBucketSchema }).strict()).max(ACTIVITY_CHECKS_MAX),
|
|
4909
|
+
counts: z34.object({ pass: count, fail: count, pending: count, skipping: count, cancel: count }).strict(),
|
|
4910
|
+
truncated: z34.literal(true).optional()
|
|
4794
4911
|
}).strict();
|
|
4795
|
-
var activityWaitSchema =
|
|
4796
|
-
|
|
4797
|
-
kind:
|
|
4912
|
+
var activityWaitSchema = z34.discriminatedUnion("kind", [
|
|
4913
|
+
z34.object({
|
|
4914
|
+
kind: z34.literal("human"),
|
|
4798
4915
|
since: iso,
|
|
4799
|
-
detail:
|
|
4916
|
+
detail: z34.object({
|
|
4800
4917
|
/** The ask card's first question. */
|
|
4801
|
-
question:
|
|
4918
|
+
question: z34.string().max(ACTIVITY_TEXT_MAX).optional(),
|
|
4802
4919
|
/** `question`: an open question; `turn-end`: Squawk's `no-wait` wait; `budget`: the
|
|
4803
4920
|
* automatic-wake budget is spent; `completion`: Squawk's completion gate. */
|
|
4804
|
-
reason:
|
|
4921
|
+
reason: z34.enum(["question", "turn-end", "budget", "completion"]),
|
|
4805
4922
|
/** Inputs not delivered yet, when there are any. */
|
|
4806
|
-
queuedMessages:
|
|
4923
|
+
queuedMessages: z34.number().int().positive().optional()
|
|
4807
4924
|
}).strict()
|
|
4808
4925
|
}).strict(),
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
kind:
|
|
4926
|
+
z34.object({ kind: z34.literal("usage-limit"), detail: z34.object({ resumeAt: z34.string() }).strict() }).strict(),
|
|
4927
|
+
z34.object({
|
|
4928
|
+
kind: z34.literal("workers"),
|
|
4812
4929
|
since: iso,
|
|
4813
4930
|
deadline: iso.optional(),
|
|
4814
|
-
detail:
|
|
4931
|
+
detail: z34.object({
|
|
4815
4932
|
/** `computeWaitingOn`'s count: the unanswered targets, summed over the entries. */
|
|
4816
4933
|
owed: count,
|
|
4817
4934
|
/** Targets named and targets settled, summed over the entries. */
|
|
4818
4935
|
total: count,
|
|
4819
4936
|
settled: count,
|
|
4820
4937
|
/** Every open entry waits on request replies. */
|
|
4821
|
-
replies:
|
|
4938
|
+
replies: z34.literal(true).optional(),
|
|
4822
4939
|
/** Only when one entry is open. */
|
|
4823
4940
|
mode: workerWaitModeSchema.optional(),
|
|
4824
4941
|
/** Who owes the awaited replies, each once. */
|
|
4825
|
-
recipientRunIds:
|
|
4942
|
+
recipientRunIds: z34.array(runId)
|
|
4826
4943
|
}).strict()
|
|
4827
4944
|
}).strict(),
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
kind:
|
|
4945
|
+
z34.object({ kind: z34.literal("peers"), since: iso, deadline: iso, detail: z34.object({ peerRunIds: z34.array(runId) }).strict() }).strict(),
|
|
4946
|
+
z34.object({ kind: z34.literal("subagents"), since: iso, deadline: iso, detail: z34.object({ running: count }).strict() }).strict(),
|
|
4947
|
+
z34.object({
|
|
4948
|
+
kind: z34.literal("pr"),
|
|
4832
4949
|
since: iso,
|
|
4833
4950
|
deadline: iso,
|
|
4834
|
-
detail:
|
|
4835
|
-
number:
|
|
4951
|
+
detail: z34.object({
|
|
4952
|
+
number: z34.number().int().positive(),
|
|
4836
4953
|
target: prWaitUntilSchema,
|
|
4837
4954
|
/** Check progress, while the CI progress registry holds some for this wait. */
|
|
4838
4955
|
checks: activityPrProgressSchema.shape.checks.optional(),
|
|
4839
4956
|
counts: activityPrProgressSchema.shape.counts.optional(),
|
|
4840
|
-
truncated:
|
|
4957
|
+
truncated: z34.literal(true).optional()
|
|
4841
4958
|
}).strict()
|
|
4842
4959
|
}).strict(),
|
|
4843
|
-
|
|
4844
|
-
|
|
4960
|
+
z34.object({ kind: z34.literal("process"), since: iso, deadline: iso, detail: z34.object({ pid: z34.number().int(), note: z34.string().optional() }).strict() }).strict(),
|
|
4961
|
+
z34.object({ kind: z34.literal("timer"), since: iso, deadline: iso, detail: z34.object({ wakeAt: iso, note: z34.string().optional() }).strict() }).strict()
|
|
4845
4962
|
]);
|
|
4846
4963
|
var activityRunShape = {
|
|
4847
4964
|
runId,
|
|
4848
4965
|
/** The display title: `titleSummary ?? title`. */
|
|
4849
|
-
title:
|
|
4966
|
+
title: z34.string(),
|
|
4850
4967
|
status: runStatusSchema,
|
|
4851
4968
|
/** The `deriveAttention` rung id, never a label. */
|
|
4852
|
-
rung:
|
|
4969
|
+
rung: z34.enum(ATTENTION_RUNGS),
|
|
4853
4970
|
runner: runnerSchema.optional(),
|
|
4854
|
-
model:
|
|
4855
|
-
currentStepId:
|
|
4856
|
-
startedAt:
|
|
4971
|
+
model: z34.string().optional(),
|
|
4972
|
+
currentStepId: z34.string().optional(),
|
|
4973
|
+
startedAt: z34.string().optional(),
|
|
4857
4974
|
wait: activityWaitSchema.optional(),
|
|
4858
4975
|
tool: activityToolSchema.optional(),
|
|
4859
4976
|
/** Tool calls started per second, oldest first. */
|
|
4860
|
-
rate:
|
|
4977
|
+
rate: z34.array(count).length(ACTIVITY_RATE_SECONDS),
|
|
4861
4978
|
/** One line of `RunRecord.error`. */
|
|
4862
|
-
error:
|
|
4979
|
+
error: z34.string().max(ACTIVITY_ERROR_MAX).optional()
|
|
4863
4980
|
};
|
|
4864
|
-
var activityWorkerSchema =
|
|
4981
|
+
var activityWorkerSchema = z34.object({
|
|
4865
4982
|
...activityRunShape,
|
|
4866
4983
|
/** The worker's current execution revision. */
|
|
4867
4984
|
revision: count,
|
|
4868
4985
|
/** The parent holds a collected result for this revision. */
|
|
4869
|
-
collected:
|
|
4986
|
+
collected: z34.boolean()
|
|
4870
4987
|
}).strict();
|
|
4871
|
-
var activityRunSchema =
|
|
4872
|
-
var activityRequestSchema =
|
|
4873
|
-
requestId:
|
|
4874
|
-
relationship:
|
|
4988
|
+
var activityRunSchema = z34.object({ ...activityRunShape, workers: z34.array(activityWorkerSchema) }).strict();
|
|
4989
|
+
var activityRequestSchema = z34.object({
|
|
4990
|
+
requestId: z34.uuid(),
|
|
4991
|
+
relationship: z34.enum(["family", "peer"]),
|
|
4875
4992
|
senderRunId: runId,
|
|
4876
4993
|
recipientRunId: runId,
|
|
4877
|
-
text:
|
|
4878
|
-
senderTitle:
|
|
4879
|
-
recipientTitle:
|
|
4994
|
+
text: z34.string().max(ACTIVITY_TEXT_MAX),
|
|
4995
|
+
senderTitle: z34.string().optional(),
|
|
4996
|
+
recipientTitle: z34.string().optional(),
|
|
4880
4997
|
createdAt: iso,
|
|
4881
4998
|
deadline: iso.optional()
|
|
4882
4999
|
}).strict();
|
|
4883
|
-
var activityClosedRequestSchema =
|
|
4884
|
-
requestId:
|
|
5000
|
+
var activityClosedRequestSchema = z34.object({
|
|
5001
|
+
requestId: z34.uuid(),
|
|
4885
5002
|
senderRunId: runId,
|
|
4886
5003
|
recipientRunId: runId,
|
|
4887
5004
|
status: requestOutcomeSchema.shape.status,
|
|
4888
5005
|
observedAt: iso
|
|
4889
5006
|
}).strict();
|
|
4890
|
-
var activityProjectSchema =
|
|
4891
|
-
projectId:
|
|
4892
|
-
name:
|
|
5007
|
+
var activityProjectSchema = z34.object({
|
|
5008
|
+
projectId: z34.string(),
|
|
5009
|
+
name: z34.string(),
|
|
4893
5010
|
/** False for a project this process has not loaded: its lists are empty because nothing was read. */
|
|
4894
|
-
loaded:
|
|
5011
|
+
loaded: z34.boolean(),
|
|
4895
5012
|
/** The project is loaded but its run store cannot open: the failure its project routes answer.
|
|
4896
5013
|
* The lists are empty because nothing could be read, not because nothing runs. */
|
|
4897
|
-
unavailable:
|
|
5014
|
+
unavailable: z34.object({ status: z34.union([z34.literal(404), z34.literal(409), z34.literal(503)]), error: z34.string() }).strict().optional(),
|
|
4898
5015
|
/** Root tasks in review: the summary chip (D8). */
|
|
4899
5016
|
inReview: count,
|
|
4900
|
-
tasks:
|
|
4901
|
-
requests:
|
|
4902
|
-
closed:
|
|
5017
|
+
tasks: z34.array(activityRunSchema),
|
|
5018
|
+
requests: z34.array(activityRequestSchema),
|
|
5019
|
+
closed: z34.array(activityClosedRequestSchema)
|
|
4903
5020
|
}).strict();
|
|
4904
|
-
var activitySnapshotSchema =
|
|
5021
|
+
var activitySnapshotSchema = z34.object({
|
|
4905
5022
|
/** The server clock; the client ticks ages from it. */
|
|
4906
5023
|
generatedAt: iso,
|
|
4907
5024
|
/** One entry, or every visible project for the global read. */
|
|
4908
|
-
projects:
|
|
5025
|
+
projects: z34.array(activityProjectSchema)
|
|
4909
5026
|
}).strict();
|
|
4910
|
-
var activityQuerySchema =
|
|
4911
|
-
project:
|
|
5027
|
+
var activityQuerySchema = z34.object({
|
|
5028
|
+
project: z34.union([z34.literal("default"), z34.string().regex(PROJECT_ID_PATTERN)]).optional()
|
|
4912
5029
|
});
|
|
4913
5030
|
|
|
4914
5031
|
// ../contract/src/live-coordination.ts
|
|
4915
|
-
import { z as
|
|
5032
|
+
import { z as z35 } from "zod";
|
|
4916
5033
|
var LIVE_PROTOCOL = 3;
|
|
4917
5034
|
var LIVE_WORKER_NAME = "cezar-live-v3";
|
|
4918
5035
|
var LEASE_MS = 15e3;
|
|
@@ -4921,111 +5038,111 @@ function allowedLiveRead(path) {
|
|
|
4921
5038
|
if (!path.startsWith("/api/v1/") || path.includes("#") || /[\\\r\n]/.test(path)) return false;
|
|
4922
5039
|
return /^\/api\/v1\/(?:workspace\/(?:runs-index|activity)|p\/[a-zA-Z0-9_-]+\/(?:reports\/state|runs\/[a-zA-Z0-9._-]+\/(?:changes|commits)|github(?:\/(?:checks|ref-status))?))(?:\?[^#]*)?$/.test(path);
|
|
4923
5040
|
}
|
|
4924
|
-
var liveDemandSchema =
|
|
4925
|
-
|
|
4926
|
-
liveRunDemandSchema.extend({ kind:
|
|
4927
|
-
|
|
5041
|
+
var liveDemandSchema = z35.discriminatedUnion("kind", [
|
|
5042
|
+
z35.object({ kind: z35.literal("workspace") }),
|
|
5043
|
+
liveRunDemandSchema.extend({ kind: z35.literal("run") }),
|
|
5044
|
+
z35.object({ kind: z35.literal("topic"), topic: z35.string().min(1).max(128) }),
|
|
4928
5045
|
// Preserve server-directed cadence (settled references use ten minutes). Only
|
|
4929
5046
|
// bound the timer itself: larger delays overflow setTimeout into a tight loop.
|
|
4930
|
-
|
|
5047
|
+
z35.object({ kind: z35.literal("read"), path: z35.string().max(4096).refine(allowedLiveRead), intervalMs: z35.number().int().min(1e3).max(2147483647) })
|
|
4931
5048
|
]);
|
|
4932
|
-
var liveEntrySchema =
|
|
4933
|
-
var envelope =
|
|
4934
|
-
var ownerInputSchema =
|
|
5049
|
+
var liveEntrySchema = z35.object({ id: z35.string().min(1).max(128), demand: liveDemandSchema });
|
|
5050
|
+
var envelope = z35.object({ version: z35.literal(LIVE_PROTOCOL), documentId: z35.string().min(1).max(128), epoch: z35.number().int().nonnegative() });
|
|
5051
|
+
var ownerInputSchema = z35.discriminatedUnion("type", [
|
|
4935
5052
|
envelope.extend({
|
|
4936
|
-
type:
|
|
4937
|
-
entries:
|
|
5053
|
+
type: z35.literal("sync"),
|
|
5054
|
+
entries: z35.array(liveEntrySchema).max(64),
|
|
4938
5055
|
/** The document knows no workspace stream generation (its `ready` was lost, for example to
|
|
4939
5056
|
* an epoch change): send it the stream's `ready` again (hearsay-tools/cezarion#2729). */
|
|
4940
|
-
workspaceReady:
|
|
5057
|
+
workspaceReady: z35.literal(true).optional()
|
|
4941
5058
|
}).refine((value) => new Set(value.entries.map((e) => e.id)).size === value.entries.length),
|
|
4942
|
-
envelope.extend({ type:
|
|
4943
|
-
envelope.extend({ type:
|
|
5059
|
+
envelope.extend({ type: z35.literal("ack"), id: z35.string(), seq: z35.number().int().nonnegative() }),
|
|
5060
|
+
envelope.extend({ type: z35.literal("refresh"), id: z35.string() })
|
|
4944
5061
|
]);
|
|
4945
|
-
var wireFrameSchema =
|
|
4946
|
-
var ownerOutputSchema =
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
5062
|
+
var wireFrameSchema = z35.object({ event: z35.string(), data: z35.string(), id: z35.string() });
|
|
5063
|
+
var ownerOutputSchema = z35.discriminatedUnion("type", [
|
|
5064
|
+
z35.object({ type: z35.literal("unavailable"), version: z35.literal(LIVE_PROTOCOL), epoch: z35.number(), reason: z35.string() }),
|
|
5065
|
+
z35.object({ type: z35.literal("hello"), version: z35.literal(LIVE_PROTOCOL) }),
|
|
5066
|
+
z35.object({ type: z35.literal("alive"), version: z35.literal(LIVE_PROTOCOL), epoch: z35.number() }),
|
|
5067
|
+
z35.object({ type: z35.literal("frame"), version: z35.literal(LIVE_PROTOCOL), epoch: z35.number(), id: z35.string(), frame: z35.union([wireFrameSchema, liveRunFrameSchema]) }),
|
|
5068
|
+
z35.object({ type: z35.literal("value"), version: z35.literal(LIVE_PROTOCOL), epoch: z35.number(), id: z35.string(), value: z35.unknown(), error: z35.string().optional() }),
|
|
5069
|
+
z35.object({ type: z35.literal("reset"), version: z35.literal(LIVE_PROTOCOL), epoch: z35.number(), id: z35.string(), reason: z35.string() })
|
|
4953
5070
|
]);
|
|
4954
5071
|
var runKey = (run) => `${run.projectId}/${run.runId}`;
|
|
4955
5072
|
|
|
4956
5073
|
// ../contract/src/workspace-events.ts
|
|
4957
|
-
import { z as
|
|
4958
|
-
var workspaceEventsQuerySchema =
|
|
4959
|
-
runs:
|
|
5074
|
+
import { z as z36 } from "zod";
|
|
5075
|
+
var workspaceEventsQuerySchema = z36.object({
|
|
5076
|
+
runs: z36.literal("summary").optional()
|
|
4960
5077
|
});
|
|
4961
|
-
var projectStamp =
|
|
4962
|
-
var frameSeq =
|
|
4963
|
-
var workspaceRunSummaryEventSchema =
|
|
5078
|
+
var projectStamp = z36.string().min(1);
|
|
5079
|
+
var frameSeq = z36.number().int().positive();
|
|
5080
|
+
var workspaceRunSummaryEventSchema = z36.object({
|
|
4964
5081
|
project: projectStamp,
|
|
4965
5082
|
seq: frameSeq,
|
|
4966
5083
|
run: runSummarySchema,
|
|
4967
|
-
relationships:
|
|
5084
|
+
relationships: z36.string().min(1)
|
|
4968
5085
|
});
|
|
4969
|
-
var workspaceRunDeletedEventSchema =
|
|
5086
|
+
var workspaceRunDeletedEventSchema = z36.object({
|
|
4970
5087
|
project: projectStamp,
|
|
4971
5088
|
seq: frameSeq,
|
|
4972
|
-
id:
|
|
5089
|
+
id: z36.string().min(1)
|
|
4973
5090
|
});
|
|
4974
|
-
var workspaceReadyEventSchema =
|
|
4975
|
-
generation:
|
|
4976
|
-
seq:
|
|
5091
|
+
var workspaceReadyEventSchema = z36.object({
|
|
5092
|
+
generation: z36.string().min(1),
|
|
5093
|
+
seq: z36.number().int().nonnegative()
|
|
4977
5094
|
});
|
|
4978
|
-
var workspaceUsageEventSchema =
|
|
5095
|
+
var workspaceUsageEventSchema = z36.object({
|
|
4979
5096
|
project: projectStamp,
|
|
4980
|
-
usage:
|
|
5097
|
+
usage: z36.record(z36.string(), processUsageSchema)
|
|
4981
5098
|
});
|
|
4982
|
-
var runsIndexResponseSchema =
|
|
5099
|
+
var runsIndexResponseSchema = z36.object({
|
|
4983
5100
|
/** Newest first, across every registered project: each project's window
|
|
4984
5101
|
* (hearsay-tools/cezarion#864) — every unarchived root run, plus its newest `perProjectLimit`
|
|
4985
5102
|
* archived root runs. Owned workers are never included. Older archived runs are reached
|
|
4986
5103
|
* through `GET /workspace/runs-search`. */
|
|
4987
|
-
runs:
|
|
5104
|
+
runs: z36.array(runIndexEntrySchema),
|
|
4988
5105
|
/** Additive: absent statuses mean "nothing warm", never "nothing to show". */
|
|
4989
5106
|
referenceStatuses: referenceStatusesByProjectSchema,
|
|
4990
5107
|
/** How many archived root runs each project contributes at most. Unarchived roots are never cut. */
|
|
4991
|
-
perProjectLimit:
|
|
5108
|
+
perProjectLimit: z36.number(),
|
|
4992
5109
|
/** Ids of the projects that had more archived root runs than `perProjectLimit`. */
|
|
4993
|
-
truncated:
|
|
5110
|
+
truncated: z36.array(z36.string()),
|
|
4994
5111
|
/** The server process that answered: the workspace stream's `ready.generation`. An `eventSeq`
|
|
4995
5112
|
* compares only within one generation. */
|
|
4996
|
-
generation:
|
|
5113
|
+
generation: z36.string().min(1),
|
|
4997
5114
|
/** The last workspace stream `seq` this answer includes: every `run-summary` and `run-deleted`
|
|
4998
5115
|
* frame at or below it is already in `runs`; a frame above it is newer than the snapshot. */
|
|
4999
|
-
eventSeq:
|
|
5116
|
+
eventSeq: z36.number().int().nonnegative()
|
|
5000
5117
|
});
|
|
5001
5118
|
|
|
5002
5119
|
// ../contract/src/permissions.ts
|
|
5003
|
-
import { z as
|
|
5004
|
-
var permissionOptionKindSchema =
|
|
5005
|
-
var permissionOptionSchema =
|
|
5006
|
-
id:
|
|
5007
|
-
label:
|
|
5120
|
+
import { z as z37 } from "zod";
|
|
5121
|
+
var permissionOptionKindSchema = z37.enum(["allow_once", "allow_always", "reject_once", "reject_always"]);
|
|
5122
|
+
var permissionOptionSchema = z37.object({
|
|
5123
|
+
id: z37.string().min(1).max(128),
|
|
5124
|
+
label: z37.string().min(1),
|
|
5008
5125
|
kind: permissionOptionKindSchema
|
|
5009
5126
|
}).strict();
|
|
5010
|
-
var permissionRequestedSchema =
|
|
5011
|
-
type:
|
|
5012
|
-
requestId:
|
|
5013
|
-
itemId:
|
|
5014
|
-
title:
|
|
5015
|
-
details:
|
|
5016
|
-
options:
|
|
5127
|
+
var permissionRequestedSchema = z37.object({
|
|
5128
|
+
type: z37.literal("permission.requested"),
|
|
5129
|
+
requestId: z37.string().min(1).max(128),
|
|
5130
|
+
itemId: z37.string().optional(),
|
|
5131
|
+
title: z37.string().min(1),
|
|
5132
|
+
details: z37.string().optional(),
|
|
5133
|
+
options: z37.array(permissionOptionSchema).min(1).refine((options) => new Set(options.map((option) => option.id)).size === options.length)
|
|
5017
5134
|
}).strict();
|
|
5018
|
-
var permissionResolvedSchema =
|
|
5019
|
-
type:
|
|
5020
|
-
requestId:
|
|
5021
|
-
optionId:
|
|
5022
|
-
reason:
|
|
5135
|
+
var permissionResolvedSchema = z37.object({
|
|
5136
|
+
type: z37.literal("permission.resolved"),
|
|
5137
|
+
requestId: z37.string().min(1).max(128),
|
|
5138
|
+
optionId: z37.string().optional(),
|
|
5139
|
+
reason: z37.string().optional()
|
|
5023
5140
|
}).strict();
|
|
5024
|
-
var permissionDecisionSchema =
|
|
5025
|
-
requestId:
|
|
5026
|
-
optionId:
|
|
5141
|
+
var permissionDecisionSchema = z37.object({
|
|
5142
|
+
requestId: z37.string().min(1).max(128),
|
|
5143
|
+
optionId: z37.string().min(1).max(128)
|
|
5027
5144
|
}).strict();
|
|
5028
|
-
var permissionDecisionResponseSchema =
|
|
5145
|
+
var permissionDecisionResponseSchema = z37.object({ delivered: z37.literal(true) });
|
|
5029
5146
|
|
|
5030
5147
|
// ../contract/src/defined.ts
|
|
5031
5148
|
function defined(value) {
|
|
@@ -5250,85 +5367,85 @@ function isImagePath(path) {
|
|
|
5250
5367
|
}
|
|
5251
5368
|
|
|
5252
5369
|
// ../contract/src/provider-requests.ts
|
|
5253
|
-
import { z as
|
|
5370
|
+
import { z as z38 } from "zod";
|
|
5254
5371
|
var PROVIDER_IDS = runnerSchema.options;
|
|
5255
|
-
var providerConnectSchema =
|
|
5256
|
-
provider:
|
|
5372
|
+
var providerConnectSchema = z38.object({
|
|
5373
|
+
provider: z38.enum(PROVIDER_IDS),
|
|
5257
5374
|
/** Which agent account to sign in (spec 2026-07-29-agent-profiles). Absent = the discovered
|
|
5258
5375
|
* default, which is what every pre-profiles client sends. Without this, "Connect" on a second
|
|
5259
5376
|
* Claude account would open a login for the FIRST one and report success. */
|
|
5260
|
-
profileId:
|
|
5377
|
+
profileId: z38.string().max(64).optional()
|
|
5261
5378
|
}).strict();
|
|
5262
|
-
var createAgentProfileSchema =
|
|
5263
|
-
provider:
|
|
5264
|
-
label:
|
|
5265
|
-
configDir:
|
|
5379
|
+
var createAgentProfileSchema = z38.object({
|
|
5380
|
+
provider: z38.enum(PROVIDER_IDS),
|
|
5381
|
+
label: z38.string().trim().max(200).optional(),
|
|
5382
|
+
configDir: z38.string().trim().min(1).max(4096)
|
|
5266
5383
|
}).strict();
|
|
5267
|
-
var openAgentAccountFileSchema =
|
|
5268
|
-
file:
|
|
5269
|
-
target:
|
|
5384
|
+
var openAgentAccountFileSchema = z38.object({
|
|
5385
|
+
file: z38.string().min(1).max(200),
|
|
5386
|
+
target: z38.string().min(1).max(64).optional()
|
|
5270
5387
|
}).strict();
|
|
5271
|
-
var updateAgentProfileSchema =
|
|
5272
|
-
label:
|
|
5273
|
-
configDir:
|
|
5388
|
+
var updateAgentProfileSchema = z38.object({
|
|
5389
|
+
label: z38.string().trim().max(200).optional(),
|
|
5390
|
+
configDir: z38.string().trim().min(1).max(4096).optional()
|
|
5274
5391
|
}).strict().refine(
|
|
5275
5392
|
(value) => value.label !== void 0 || value.configDir !== void 0,
|
|
5276
5393
|
"send label or configDir"
|
|
5277
5394
|
);
|
|
5278
|
-
var selectAgentProfileSchema =
|
|
5395
|
+
var selectAgentProfileSchema = z38.object({
|
|
5279
5396
|
/** `null` targets the machine-wide default rather than one repo. */
|
|
5280
|
-
projectId:
|
|
5281
|
-
provider:
|
|
5282
|
-
profileId:
|
|
5397
|
+
projectId: z38.string().min(1).max(64).nullable(),
|
|
5398
|
+
provider: z38.enum(PROVIDER_IDS),
|
|
5399
|
+
profileId: z38.string().max(64).nullable()
|
|
5283
5400
|
}).strict();
|
|
5284
|
-
var providerParamSchema =
|
|
5285
|
-
var providerEnabledSchema =
|
|
5286
|
-
var providerRetrySchema =
|
|
5287
|
-
authFailureId:
|
|
5401
|
+
var providerParamSchema = z38.enum(PROVIDER_IDS);
|
|
5402
|
+
var providerEnabledSchema = z38.object({ enabled: z38.boolean() }).strict();
|
|
5403
|
+
var providerRetrySchema = z38.object({
|
|
5404
|
+
authFailureId: z38.string().min(1).max(128)
|
|
5288
5405
|
}).strict();
|
|
5289
|
-
var providerRouteParamsSchema =
|
|
5290
|
-
var agentProfileRouteParamsSchema =
|
|
5406
|
+
var providerRouteParamsSchema = z38.object({ provider: providerParamSchema });
|
|
5407
|
+
var agentProfileRouteParamsSchema = z38.object({ id: z38.string() });
|
|
5291
5408
|
|
|
5292
5409
|
// ../contract/src/automation-requests.ts
|
|
5293
|
-
import { z as
|
|
5410
|
+
import { z as z40 } from "zod";
|
|
5294
5411
|
|
|
5295
5412
|
// ../contract/src/automation-storage.ts
|
|
5296
|
-
import { z as
|
|
5413
|
+
import { z as z39 } from "zod";
|
|
5297
5414
|
var RUNNER_IDS = runnerSchema.options;
|
|
5298
|
-
var storedAutomationEventSchema =
|
|
5415
|
+
var storedAutomationEventSchema = z39.enum([
|
|
5299
5416
|
"pull_request.opened",
|
|
5300
5417
|
"issue.opened",
|
|
5301
5418
|
"issue.labeled",
|
|
5302
5419
|
"issue.unlabeled"
|
|
5303
5420
|
]);
|
|
5304
|
-
var boundedString =
|
|
5305
|
-
var stringList =
|
|
5306
|
-
var storedAutomationFiltersSchema =
|
|
5307
|
-
includeExisting:
|
|
5421
|
+
var boundedString = z39.string().trim().min(1).max(200);
|
|
5422
|
+
var stringList = z39.array(boundedString).max(100).optional();
|
|
5423
|
+
var storedAutomationFiltersSchema = z39.object({
|
|
5424
|
+
includeExisting: z39.boolean().optional(),
|
|
5308
5425
|
/** Require an open item and matching live labels before reservation and launch. */
|
|
5309
|
-
requireCurrentLabels:
|
|
5426
|
+
requireCurrentLabels: z39.boolean().optional(),
|
|
5310
5427
|
authors: stringList,
|
|
5311
5428
|
assignees: stringList,
|
|
5312
5429
|
allLabels: stringList,
|
|
5313
5430
|
anyLabels: stringList,
|
|
5314
5431
|
excludeLabels: stringList,
|
|
5315
5432
|
changedLabels: stringList,
|
|
5316
|
-
lookbackDays:
|
|
5317
|
-
maxRecords:
|
|
5433
|
+
lookbackDays: z39.number().int().min(1).max(90).default(7),
|
|
5434
|
+
maxRecords: z39.number().int().min(1).max(100).default(25)
|
|
5318
5435
|
}).passthrough();
|
|
5319
|
-
var storedAutomationTaskSchema =
|
|
5320
|
-
prompt:
|
|
5321
|
-
workflow:
|
|
5322
|
-
steps:
|
|
5323
|
-
runner:
|
|
5324
|
-
model:
|
|
5325
|
-
effort:
|
|
5326
|
-
variants:
|
|
5327
|
-
worktree:
|
|
5328
|
-
autonomous:
|
|
5436
|
+
var storedAutomationTaskSchema = z39.object({
|
|
5437
|
+
prompt: z39.string().min(1).max(1e5),
|
|
5438
|
+
workflow: z39.string().trim().min(1).max(200).optional(),
|
|
5439
|
+
steps: z39.array(workflowStepDefSchema).min(1).max(100).optional(),
|
|
5440
|
+
runner: z39.enum(RUNNER_IDS).optional(),
|
|
5441
|
+
model: z39.string().trim().min(1).max(200).optional(),
|
|
5442
|
+
effort: z39.string().trim().min(1).max(32).optional(),
|
|
5443
|
+
variants: z39.union([z39.literal(1), z39.literal(2), z39.literal(3)]).optional(),
|
|
5444
|
+
worktree: z39.boolean().optional(),
|
|
5445
|
+
autonomous: z39.boolean().optional(),
|
|
5329
5446
|
...completionControlsShape,
|
|
5330
5447
|
...taskAccessShape,
|
|
5331
|
-
systemPrompt:
|
|
5448
|
+
systemPrompt: z39.string().max(1e5).optional()
|
|
5332
5449
|
}).passthrough().refine((task) => !(task.workflow && task.steps), {
|
|
5333
5450
|
message: "task selects either a named workflow or inline steps, not both"
|
|
5334
5451
|
});
|
|
@@ -5342,122 +5459,122 @@ var fillGithubDefaults = (raw) => {
|
|
|
5342
5459
|
filters: record.filters ?? {}
|
|
5343
5460
|
};
|
|
5344
5461
|
};
|
|
5345
|
-
var storedAutomationDefinitionObjectSchema =
|
|
5346
|
-
id:
|
|
5347
|
-
revision:
|
|
5348
|
-
name:
|
|
5349
|
-
description:
|
|
5350
|
-
enabled:
|
|
5462
|
+
var storedAutomationDefinitionObjectSchema = z39.object({
|
|
5463
|
+
id: z39.string().min(1).max(100),
|
|
5464
|
+
revision: z39.number().int().positive(),
|
|
5465
|
+
name: z39.string().trim().min(1).max(200),
|
|
5466
|
+
description: z39.string().max(2e3).optional(),
|
|
5467
|
+
enabled: z39.boolean().default(false),
|
|
5351
5468
|
/** A definition written before schedules has no `kind`: it is a poll. */
|
|
5352
5469
|
kind: automationKindSchema.default("github"),
|
|
5353
|
-
events:
|
|
5354
|
-
intervalSeconds:
|
|
5470
|
+
events: z39.array(storedAutomationEventSchema).min(1).max(4).optional(),
|
|
5471
|
+
intervalSeconds: z39.number().int().min(60).max(86400).optional(),
|
|
5355
5472
|
filters: storedAutomationFiltersSchema.optional(),
|
|
5356
5473
|
// Passthrough like every other persisted layer: a schedule key a later build adds survives a save here.
|
|
5357
5474
|
schedule: automationScheduleSchema.passthrough().optional(),
|
|
5358
5475
|
task: storedAutomationTaskSchema,
|
|
5359
5476
|
/** `once` schedules only (hearsay-tools/cezarion#1465): the archive record. */
|
|
5360
|
-
archived:
|
|
5361
|
-
at:
|
|
5362
|
-
outcome:
|
|
5363
|
-
runId:
|
|
5364
|
-
receiptId:
|
|
5365
|
-
trigger:
|
|
5477
|
+
archived: z39.object({
|
|
5478
|
+
at: z39.string().datetime(),
|
|
5479
|
+
outcome: z39.enum(["launched", "cancelled"]),
|
|
5480
|
+
runId: z39.string().optional(),
|
|
5481
|
+
receiptId: z39.string().optional(),
|
|
5482
|
+
trigger: z39.enum(["schedule", "late", "manual", "retry"]).optional()
|
|
5366
5483
|
}).passthrough().optional(),
|
|
5367
|
-
createdAt:
|
|
5368
|
-
updatedAt:
|
|
5484
|
+
createdAt: z39.string().datetime(),
|
|
5485
|
+
updatedAt: z39.string().datetime()
|
|
5369
5486
|
}).passthrough().superRefine((definition, ctx) => {
|
|
5370
5487
|
if (definition.kind === "schedule") {
|
|
5371
5488
|
if (!definition.schedule) {
|
|
5372
|
-
ctx.addIssue({ code:
|
|
5489
|
+
ctx.addIssue({ code: z39.ZodIssueCode.custom, path: ["schedule"], message: "a scheduled automation needs a schedule" });
|
|
5373
5490
|
}
|
|
5374
5491
|
return;
|
|
5375
5492
|
}
|
|
5376
5493
|
if (!definition.events?.length) {
|
|
5377
|
-
ctx.addIssue({ code:
|
|
5494
|
+
ctx.addIssue({ code: z39.ZodIssueCode.custom, path: ["events"], message: "a GitHub automation needs at least one event" });
|
|
5378
5495
|
}
|
|
5379
5496
|
if (definition.intervalSeconds === void 0) {
|
|
5380
|
-
ctx.addIssue({ code:
|
|
5497
|
+
ctx.addIssue({ code: z39.ZodIssueCode.custom, path: ["intervalSeconds"], message: "a GitHub automation needs a poll interval" });
|
|
5381
5498
|
}
|
|
5382
5499
|
if (!definition.filters) {
|
|
5383
|
-
ctx.addIssue({ code:
|
|
5500
|
+
ctx.addIssue({ code: z39.ZodIssueCode.custom, path: ["filters"], message: "a GitHub automation needs its bounded filter" });
|
|
5384
5501
|
}
|
|
5385
5502
|
if (definition.events?.some((event) => event === "issue.labeled" || event === "issue.unlabeled") && !definition.filters?.changedLabels?.length) {
|
|
5386
5503
|
ctx.addIssue({
|
|
5387
|
-
code:
|
|
5504
|
+
code: z39.ZodIssueCode.custom,
|
|
5388
5505
|
path: ["filters", "changedLabels"],
|
|
5389
5506
|
message: "changedLabels is required for issue label events"
|
|
5390
5507
|
});
|
|
5391
5508
|
}
|
|
5392
5509
|
});
|
|
5393
|
-
var storedAutomationDefinitionSchema =
|
|
5394
|
-
var storedAutomationDefinitionsFileSchema =
|
|
5395
|
-
version:
|
|
5396
|
-
automations:
|
|
5397
|
-
tombstones:
|
|
5510
|
+
var storedAutomationDefinitionSchema = z39.preprocess(fillGithubDefaults, storedAutomationDefinitionObjectSchema);
|
|
5511
|
+
var storedAutomationDefinitionsFileSchema = z39.object({
|
|
5512
|
+
version: z39.literal(1).default(1),
|
|
5513
|
+
automations: z39.array(z39.unknown()).default([]),
|
|
5514
|
+
tombstones: z39.record(z39.string(), z39.string().datetime()).optional()
|
|
5398
5515
|
}).passthrough();
|
|
5399
|
-
var storedAutomationCursorSchema =
|
|
5400
|
-
timestamp:
|
|
5401
|
-
tieBreaker:
|
|
5516
|
+
var storedAutomationCursorSchema = z39.object({
|
|
5517
|
+
timestamp: z39.string().datetime(),
|
|
5518
|
+
tieBreaker: z39.string().optional()
|
|
5402
5519
|
}).passthrough();
|
|
5403
5520
|
var storedAutomationHistoryScanSchema = automationHistoryScanSchema.extend({
|
|
5404
5521
|
cursor: storedAutomationCursorSchema.optional()
|
|
5405
5522
|
});
|
|
5406
|
-
var storedAutomationRuntimeStateSchema =
|
|
5407
|
-
revision:
|
|
5408
|
-
baselineAt:
|
|
5523
|
+
var storedAutomationRuntimeStateSchema = z39.object({
|
|
5524
|
+
revision: z39.number().int().positive().optional(),
|
|
5525
|
+
baselineAt: z39.string().datetime().optional(),
|
|
5409
5526
|
/** Arming time, independent of a history window's older lower bound. */
|
|
5410
|
-
armedAt:
|
|
5527
|
+
armedAt: z39.string().datetime().optional(),
|
|
5411
5528
|
historyScan: storedAutomationHistoryScanSchema.optional(),
|
|
5412
5529
|
cursor: storedAutomationCursorSchema.optional(),
|
|
5413
|
-
frozenHighWatermark: storedAutomationCursorSchema.extend({ tieBreaker:
|
|
5414
|
-
backlogAfter: storedAutomationCursorSchema.extend({ tieBreaker:
|
|
5415
|
-
nextCheckAt:
|
|
5416
|
-
lastSuccessAt:
|
|
5530
|
+
frozenHighWatermark: storedAutomationCursorSchema.extend({ tieBreaker: z39.string() }).optional(),
|
|
5531
|
+
backlogAfter: storedAutomationCursorSchema.extend({ tieBreaker: z39.string() }).optional(),
|
|
5532
|
+
nextCheckAt: z39.string().datetime().optional(),
|
|
5533
|
+
lastSuccessAt: z39.string().datetime().optional(),
|
|
5417
5534
|
/** schedule kind: the next occurrence's instant and the last fired one's. */
|
|
5418
|
-
nextRunAt:
|
|
5419
|
-
lastRunAt:
|
|
5420
|
-
etags:
|
|
5421
|
-
backoffUntil:
|
|
5422
|
-
consecutiveFailures:
|
|
5535
|
+
nextRunAt: z39.string().datetime().optional(),
|
|
5536
|
+
lastRunAt: z39.string().datetime().optional(),
|
|
5537
|
+
etags: z39.record(z39.string(), z39.string()).optional(),
|
|
5538
|
+
backoffUntil: z39.string().datetime().optional(),
|
|
5539
|
+
consecutiveFailures: z39.number().int().nonnegative().optional(),
|
|
5423
5540
|
...automationLastErrorShape,
|
|
5424
5541
|
/** once schedule: it stopped without a task — the launch failed, or it started past its cutoff. */
|
|
5425
|
-
onceOutcome:
|
|
5542
|
+
onceOutcome: z39.enum(["failed", "missed"]).optional()
|
|
5426
5543
|
}).passthrough();
|
|
5427
|
-
var storedAutomationStateFileSchema =
|
|
5428
|
-
version:
|
|
5429
|
-
states:
|
|
5544
|
+
var storedAutomationStateFileSchema = z39.object({
|
|
5545
|
+
version: z39.literal(1).default(1),
|
|
5546
|
+
states: z39.record(z39.string(), storedAutomationRuntimeStateSchema).default({})
|
|
5430
5547
|
}).passthrough();
|
|
5431
|
-
var storedAutomationReceiptSchema =
|
|
5432
|
-
receiptId:
|
|
5433
|
-
receiptKey:
|
|
5434
|
-
eventId:
|
|
5435
|
-
automationId:
|
|
5436
|
-
revision:
|
|
5437
|
-
status:
|
|
5438
|
-
runId:
|
|
5439
|
-
observedAt:
|
|
5440
|
-
updatedAt:
|
|
5441
|
-
error:
|
|
5548
|
+
var storedAutomationReceiptSchema = z39.object({
|
|
5549
|
+
receiptId: z39.string().min(1),
|
|
5550
|
+
receiptKey: z39.string().min(1),
|
|
5551
|
+
eventId: z39.string().min(1),
|
|
5552
|
+
automationId: z39.string().min(1),
|
|
5553
|
+
revision: z39.number().int().positive(),
|
|
5554
|
+
status: z39.enum(["reserved", "launched", "launch-error", "released"]),
|
|
5555
|
+
runId: z39.string().optional(),
|
|
5556
|
+
observedAt: z39.string().datetime(),
|
|
5557
|
+
updatedAt: z39.string().datetime(),
|
|
5558
|
+
error: z39.string().max(2e3).optional(),
|
|
5442
5559
|
/** schedule kind: the occurrence this receipt reserved, so a retry can fire it again. */
|
|
5443
|
-
occurrenceAt:
|
|
5444
|
-
candidate:
|
|
5445
|
-
eventId:
|
|
5560
|
+
occurrenceAt: z39.string().datetime().optional(),
|
|
5561
|
+
candidate: z39.object({
|
|
5562
|
+
eventId: z39.string(),
|
|
5446
5563
|
event: storedAutomationEventSchema,
|
|
5447
|
-
timestamp:
|
|
5448
|
-
tieBreaker:
|
|
5449
|
-
repo:
|
|
5450
|
-
nodeId:
|
|
5451
|
-
number:
|
|
5452
|
-
title:
|
|
5453
|
-
url:
|
|
5454
|
-
author:
|
|
5455
|
-
assignees:
|
|
5456
|
-
labels:
|
|
5457
|
-
changedLabel:
|
|
5564
|
+
timestamp: z39.string().datetime(),
|
|
5565
|
+
tieBreaker: z39.string(),
|
|
5566
|
+
repo: z39.string(),
|
|
5567
|
+
nodeId: z39.string(),
|
|
5568
|
+
number: z39.number().int().positive(),
|
|
5569
|
+
title: z39.string().max(500),
|
|
5570
|
+
url: z39.string().url(),
|
|
5571
|
+
author: z39.string().max(200),
|
|
5572
|
+
assignees: z39.array(z39.string().max(200)).max(100),
|
|
5573
|
+
labels: z39.array(z39.string().max(200)).max(100),
|
|
5574
|
+
changedLabel: z39.string().max(200).optional()
|
|
5458
5575
|
}).passthrough().optional()
|
|
5459
5576
|
}).passthrough();
|
|
5460
|
-
var storedAutomationLogResultSchema =
|
|
5577
|
+
var storedAutomationLogResultSchema = z39.enum([
|
|
5461
5578
|
"launched",
|
|
5462
5579
|
"no-match",
|
|
5463
5580
|
"duplicate",
|
|
@@ -5473,24 +5590,24 @@ var storedAutomationLogResultSchema = z38.enum([
|
|
|
5473
5590
|
// once schedule
|
|
5474
5591
|
"missed"
|
|
5475
5592
|
]);
|
|
5476
|
-
var storedAutomationLogRecordSchema =
|
|
5477
|
-
seq:
|
|
5478
|
-
ts:
|
|
5479
|
-
automationId:
|
|
5480
|
-
revision:
|
|
5593
|
+
var storedAutomationLogRecordSchema = z39.object({
|
|
5594
|
+
seq: z39.number().int().positive(),
|
|
5595
|
+
ts: z39.string().datetime(),
|
|
5596
|
+
automationId: z39.string().min(1),
|
|
5597
|
+
revision: z39.number().int().positive(),
|
|
5481
5598
|
event: storedAutomationEventSchema.optional(),
|
|
5482
5599
|
result: storedAutomationLogResultSchema,
|
|
5483
|
-
reason:
|
|
5484
|
-
durationMs:
|
|
5485
|
-
receiptId:
|
|
5486
|
-
runId:
|
|
5487
|
-
githubNumber:
|
|
5488
|
-
githubTitle:
|
|
5489
|
-
githubUrl:
|
|
5490
|
-
rateLimit:
|
|
5491
|
-
bucket:
|
|
5492
|
-
remaining:
|
|
5493
|
-
resetAt:
|
|
5600
|
+
reason: z39.string().max(2e3).optional(),
|
|
5601
|
+
durationMs: z39.number().int().nonnegative().optional(),
|
|
5602
|
+
receiptId: z39.string().optional(),
|
|
5603
|
+
runId: z39.string().optional(),
|
|
5604
|
+
githubNumber: z39.number().int().positive().optional(),
|
|
5605
|
+
githubTitle: z39.string().max(500).optional(),
|
|
5606
|
+
githubUrl: z39.string().url().optional(),
|
|
5607
|
+
rateLimit: z39.object({
|
|
5608
|
+
bucket: z39.enum(["core", "search"]),
|
|
5609
|
+
remaining: z39.number().int().nonnegative().optional(),
|
|
5610
|
+
resetAt: z39.string().datetime().optional()
|
|
5494
5611
|
}).passthrough().optional()
|
|
5495
5612
|
}).passthrough();
|
|
5496
5613
|
function storedIsOnceSchedule(definition) {
|
|
@@ -5504,208 +5621,208 @@ function storedIsScheduleAutomation(definition) {
|
|
|
5504
5621
|
}
|
|
5505
5622
|
|
|
5506
5623
|
// ../contract/src/automation-requests.ts
|
|
5507
|
-
var automationEditableSchema =
|
|
5508
|
-
name:
|
|
5509
|
-
description:
|
|
5510
|
-
enabled:
|
|
5624
|
+
var automationEditableSchema = z40.object({
|
|
5625
|
+
name: z40.string().trim().min(1).max(200),
|
|
5626
|
+
description: z40.string().max(2e3).optional(),
|
|
5627
|
+
enabled: z40.boolean().optional(),
|
|
5511
5628
|
kind: automationKindSchema.optional(),
|
|
5512
|
-
events:
|
|
5513
|
-
intervalSeconds:
|
|
5629
|
+
events: z40.array(automationEventSchema).min(1).max(4).optional(),
|
|
5630
|
+
intervalSeconds: z40.number().int().min(60).max(86400).optional(),
|
|
5514
5631
|
filters: storedAutomationFiltersSchema.optional(),
|
|
5515
5632
|
schedule: automationScheduleSchema.optional(),
|
|
5516
5633
|
task: storedAutomationTaskSchema.safeExtend({ variants: singleRunVariantsSchema })
|
|
5517
5634
|
}).strict();
|
|
5518
|
-
var automationCreateSchema = automationEditableSchema.extend({ enable:
|
|
5519
|
-
var automationUpdateSchema = automationEditableSchema.extend({ expectedRevision:
|
|
5520
|
-
var automationCheckRequestSchema =
|
|
5521
|
-
var automationLogQuerySchema =
|
|
5522
|
-
automationId:
|
|
5635
|
+
var automationCreateSchema = automationEditableSchema.extend({ enable: z40.boolean().optional() });
|
|
5636
|
+
var automationUpdateSchema = automationEditableSchema.extend({ expectedRevision: z40.number().int().positive() });
|
|
5637
|
+
var automationCheckRequestSchema = z40.object({ mode: z40.enum(["preview", "execute"]) }).strict();
|
|
5638
|
+
var automationLogQuerySchema = z40.object({
|
|
5639
|
+
automationId: z40.string().optional(),
|
|
5523
5640
|
result: automationLogResultSchema.optional(),
|
|
5524
5641
|
event: automationEventSchema.optional(),
|
|
5525
|
-
since:
|
|
5526
|
-
cursor:
|
|
5642
|
+
since: z40.string().datetime().optional(),
|
|
5643
|
+
cursor: z40.coerce.number().int().positive().optional(),
|
|
5527
5644
|
// Optional, not `.default(100)`: `AutomationStore.logs` already clamps `limit ?? 100` into
|
|
5528
5645
|
// 1..100, so the default here was a second copy of it — and a defaulted key is REQUIRED in the
|
|
5529
5646
|
// request type `queryZodValidator` publishes (see validators.ts on why the request side falls
|
|
5530
5647
|
// back to the schema's output), which would have made every caller send a `?limit=` this route
|
|
5531
5648
|
// never needed.
|
|
5532
|
-
limit:
|
|
5649
|
+
limit: z40.coerce.number().int().min(1).max(100).optional()
|
|
5533
5650
|
});
|
|
5534
5651
|
|
|
5535
5652
|
// ../contract/src/workflow-requests.ts
|
|
5536
|
-
import { z as
|
|
5537
|
-
var planSchema =
|
|
5653
|
+
import { z as z41 } from "zod";
|
|
5654
|
+
var planSchema = z41.object({
|
|
5538
5655
|
// Same bound as `createRunInputSchema.task` — this flows into `planChain` (legacy reference 429).
|
|
5539
|
-
task:
|
|
5656
|
+
task: z41.string().trim().min(1).max(1e5, "must be at most 100000 characters")
|
|
5540
5657
|
});
|
|
5541
|
-
var parseWorkflowSchema =
|
|
5542
|
-
yaml:
|
|
5658
|
+
var parseWorkflowSchema = z41.object({
|
|
5659
|
+
yaml: z41.string().min(1).max(1e5)
|
|
5543
5660
|
});
|
|
5544
5661
|
|
|
5545
5662
|
// ../contract/src/ui-state-requests.ts
|
|
5546
|
-
import { z as
|
|
5663
|
+
import { z as z42 } from "zod";
|
|
5547
5664
|
var SKILL_USAGE_MAX_ENTRIES = 200;
|
|
5548
5665
|
var UI_STATE_MAX_KEYS = 200;
|
|
5549
5666
|
var uiStateSchema2 = uiStateSchema.extend({
|
|
5550
5667
|
// null records a quick task with no selected skill or workflow.
|
|
5551
|
-
lastTask:
|
|
5552
|
-
source:
|
|
5553
|
-
ref:
|
|
5668
|
+
lastTask: z42.object({
|
|
5669
|
+
source: z42.enum(["workflow", "skill"]),
|
|
5670
|
+
ref: z42.string().min(1).max(200)
|
|
5554
5671
|
}).nullable().optional(),
|
|
5555
5672
|
// Most recent source choices, newest first.
|
|
5556
|
-
recentSources:
|
|
5557
|
-
|
|
5558
|
-
source:
|
|
5559
|
-
ref:
|
|
5673
|
+
recentSources: z42.array(
|
|
5674
|
+
z42.object({
|
|
5675
|
+
source: z42.enum(["workflow", "skill"]),
|
|
5676
|
+
ref: z42.string().min(1).max(200)
|
|
5560
5677
|
})
|
|
5561
5678
|
).max(50).optional(),
|
|
5562
|
-
skillUsage:
|
|
5679
|
+
skillUsage: z42.record(z42.string().min(1).max(200), z42.number().int().min(0).max(1e6)).refine((usage) => Object.keys(usage).length <= SKILL_USAGE_MAX_ENTRIES, {
|
|
5563
5680
|
message: `skillUsage must have at most ${SKILL_USAGE_MAX_ENTRIES} entries`
|
|
5564
5681
|
}).optional(),
|
|
5565
|
-
promptTemplates:
|
|
5566
|
-
|
|
5567
|
-
id:
|
|
5568
|
-
label:
|
|
5569
|
-
text:
|
|
5682
|
+
promptTemplates: z42.array(
|
|
5683
|
+
z42.object({
|
|
5684
|
+
id: z42.string().min(1).max(64),
|
|
5685
|
+
label: z42.string().trim().min(1).max(80),
|
|
5686
|
+
text: z42.string().trim().min(1).max(2e3),
|
|
5570
5687
|
// Skill names this template auto-applies for. Optional and additive: templates
|
|
5571
5688
|
// written before this key existed keep validating, and stay manual-only.
|
|
5572
|
-
skills:
|
|
5689
|
+
skills: z42.array(z42.string().trim().min(1).max(200)).max(50).optional()
|
|
5573
5690
|
})
|
|
5574
5691
|
).max(50).optional()
|
|
5575
5692
|
}).passthrough();
|
|
5576
5693
|
function capUiStateKeys(data, ctx) {
|
|
5577
5694
|
if (Object.keys(data).length > UI_STATE_MAX_KEYS) {
|
|
5578
|
-
ctx.addIssue({ code:
|
|
5695
|
+
ctx.addIssue({ code: z42.ZodIssueCode.custom, message: `ui-state has too many keys (max ${UI_STATE_MAX_KEYS})` });
|
|
5579
5696
|
}
|
|
5580
5697
|
}
|
|
5581
5698
|
var uiStateBody = uiStateSchema2.superRefine(capUiStateKeys);
|
|
5582
5699
|
|
|
5583
5700
|
// ../contract/src/run-requests.ts
|
|
5584
|
-
import { z as
|
|
5701
|
+
import { z as z43 } from "zod";
|
|
5585
5702
|
var RUNNER_IDS2 = runnerSchema.options;
|
|
5586
|
-
var queuedMessagePatchSchema =
|
|
5587
|
-
text:
|
|
5588
|
-
images:
|
|
5703
|
+
var queuedMessagePatchSchema = z43.object({
|
|
5704
|
+
text: z43.string().max(1e5).optional(),
|
|
5705
|
+
images: z43.array(attachmentInputSchema).max(4).optional()
|
|
5589
5706
|
}).refine((m) => m.text !== void 0 || m.images !== void 0, {
|
|
5590
5707
|
message: "message edit needs text or attachments"
|
|
5591
5708
|
});
|
|
5592
|
-
var continueSchema =
|
|
5593
|
-
text:
|
|
5594
|
-
images:
|
|
5595
|
-
runner:
|
|
5596
|
-
model:
|
|
5709
|
+
var continueSchema = z43.object({
|
|
5710
|
+
text: z43.string().max(1e5, "must be at most 100000 characters").optional(),
|
|
5711
|
+
images: z43.array(attachmentInputSchema).max(4).optional(),
|
|
5712
|
+
runner: z43.enum(RUNNER_IDS2).optional(),
|
|
5713
|
+
model: z43.string().max(200).optional(),
|
|
5597
5714
|
/** Reasoning-effort pin (legacy reference 45). Omitted keeps the run's pin; empty string clears it. */
|
|
5598
|
-
effort:
|
|
5715
|
+
effort: z43.string().max(32).optional(),
|
|
5599
5716
|
/** Agent account for the reopened session (spec 2026-07-29-agent-profiles). Bound mirrors
|
|
5600
5717
|
* `POST /runs`' own `agentProfile`. Omitted = keep the account the run is already on. */
|
|
5601
|
-
agentProfile:
|
|
5718
|
+
agentProfile: z43.string().max(64).optional()
|
|
5602
5719
|
});
|
|
5603
|
-
var archiveSchema =
|
|
5604
|
-
archived:
|
|
5720
|
+
var archiveSchema = z43.object({
|
|
5721
|
+
archived: z43.boolean().optional()
|
|
5605
5722
|
});
|
|
5606
|
-
var openInSchema =
|
|
5723
|
+
var openInSchema = z43.object({
|
|
5607
5724
|
// A short bound (legacy reference 429): matched against a downstream allowlist, so an editor id is never long.
|
|
5608
|
-
target:
|
|
5609
|
-
path:
|
|
5725
|
+
target: z43.string().trim().min(1, "target required").max(200),
|
|
5726
|
+
path: z43.string().max(1e3).optional()
|
|
5610
5727
|
});
|
|
5611
5728
|
|
|
5612
5729
|
// ../contract/src/query-requests.ts
|
|
5613
|
-
import { z as
|
|
5614
|
-
var queryValue =
|
|
5615
|
-
var refreshQuery =
|
|
5616
|
-
var waitQuery =
|
|
5617
|
-
var modelDiscoveryQuerySchema =
|
|
5618
|
-
var strictRefreshQuerySchema =
|
|
5619
|
-
var browseQuerySchema =
|
|
5620
|
-
var worktreeFilesQuerySchema =
|
|
5621
|
-
var commitQuerySchema =
|
|
5730
|
+
import { z as z44 } from "zod";
|
|
5731
|
+
var queryValue = z44.union([z44.string(), z44.array(z44.string()).transform((v) => v[0])]).optional();
|
|
5732
|
+
var refreshQuery = z44.object({ refresh: queryValue });
|
|
5733
|
+
var waitQuery = z44.object({ wait: queryValue });
|
|
5734
|
+
var modelDiscoveryQuerySchema = z44.object({ runner: z44.union([z44.string(), z44.array(z44.string()).transform((v) => v[0])]).pipe(modelDiscoveryRunnerSchema) });
|
|
5735
|
+
var strictRefreshQuerySchema = z44.object({ refresh: queryValue.refine((v) => v === void 0 || v === "1") });
|
|
5736
|
+
var browseQuerySchema = z44.object({ path: queryValue, showHidden: queryValue });
|
|
5737
|
+
var worktreeFilesQuerySchema = z44.object({ path: queryValue, raw: queryValue });
|
|
5738
|
+
var commitQuerySchema = z44.object({ structured: queryValue });
|
|
5622
5739
|
|
|
5623
5740
|
// ../contract/src/github-requests.ts
|
|
5624
|
-
import { z as
|
|
5625
|
-
var mergeNumberParams =
|
|
5626
|
-
var prChangesParams =
|
|
5627
|
-
var prChangesQuery =
|
|
5628
|
-
var mergeBodySchema =
|
|
5629
|
-
method:
|
|
5630
|
-
expectedHeadSha:
|
|
5631
|
-
overrideRules:
|
|
5741
|
+
import { z as z45 } from "zod";
|
|
5742
|
+
var mergeNumberParams = z45.object({ number: z45.coerce.number().int().positive() });
|
|
5743
|
+
var prChangesParams = z45.object({ number: z45.coerce.number().int().positive().safe() });
|
|
5744
|
+
var prChangesQuery = z45.object({ refresh: queryValue.refine((v) => v === void 0 || v === "1") });
|
|
5745
|
+
var mergeBodySchema = z45.object({
|
|
5746
|
+
method: z45.enum(["merge", "squash", "rebase"]),
|
|
5747
|
+
expectedHeadSha: z45.string().regex(/^[0-9a-f]{40}$/),
|
|
5748
|
+
overrideRules: z45.boolean().optional().default(false)
|
|
5632
5749
|
}).strict();
|
|
5633
|
-
var githubChecksQuerySchema =
|
|
5634
|
-
var githubRefsQuerySchema =
|
|
5750
|
+
var githubChecksQuerySchema = z45.object({ prs: z45.string().min(1) });
|
|
5751
|
+
var githubRefsQuerySchema = z45.object({ prs: z45.string().optional(), issues: z45.string().optional() });
|
|
5635
5752
|
|
|
5636
5753
|
// ../contract/src/repo-requests.ts
|
|
5637
|
-
import { z as
|
|
5638
|
-
var gitCommitSchema =
|
|
5639
|
-
message:
|
|
5754
|
+
import { z as z46 } from "zod";
|
|
5755
|
+
var gitCommitSchema = z46.object({
|
|
5756
|
+
message: z46.string().trim().min(1, "must not be empty").max(5e3)
|
|
5640
5757
|
});
|
|
5641
|
-
var reclaimBodySchema =
|
|
5642
|
-
var repoBranchSchema =
|
|
5643
|
-
name:
|
|
5644
|
-
from:
|
|
5758
|
+
var reclaimBodySchema = z46.object({}).passthrough();
|
|
5759
|
+
var repoBranchSchema = z46.object({
|
|
5760
|
+
name: z46.string().trim().min(1).max(200),
|
|
5761
|
+
from: z46.string().trim().min(1).max(200).optional()
|
|
5645
5762
|
});
|
|
5646
|
-
var reclaimRunParamsSchema =
|
|
5763
|
+
var reclaimRunParamsSchema = z46.object({ runId: z46.string().min(1) });
|
|
5647
5764
|
|
|
5648
5765
|
// ../contract/src/config-requests.ts
|
|
5649
|
-
import { z as
|
|
5766
|
+
import { z as z47 } from "zod";
|
|
5650
5767
|
var setConfigSchema = setConfigInputSchema.extend({
|
|
5651
|
-
systemPrompt:
|
|
5768
|
+
systemPrompt: z47.string().trim().max(2e4, "must be at most 20000 characters").nullable().optional()
|
|
5652
5769
|
});
|
|
5653
|
-
var setAgentConfigSchema =
|
|
5654
|
-
content:
|
|
5655
|
-
version:
|
|
5770
|
+
var setAgentConfigSchema = z47.object({
|
|
5771
|
+
content: z47.string().max(2e6),
|
|
5772
|
+
version: z47.string().nullable()
|
|
5656
5773
|
});
|
|
5657
5774
|
|
|
5658
5775
|
// ../contract/src/workflow-file.ts
|
|
5659
|
-
import { z as
|
|
5660
|
-
var workflowFileSchema =
|
|
5661
|
-
name:
|
|
5662
|
-
description:
|
|
5663
|
-
steps:
|
|
5664
|
-
skills:
|
|
5776
|
+
import { z as z48 } from "zod";
|
|
5777
|
+
var workflowFileSchema = z48.object({
|
|
5778
|
+
name: z48.string().min(1),
|
|
5779
|
+
description: z48.string().optional(),
|
|
5780
|
+
steps: z48.array(workflowStepDefSchema).min(1).optional(),
|
|
5781
|
+
skills: z48.array(z48.string().trim().min(1)).min(1).optional()
|
|
5665
5782
|
}).refine((d) => Boolean(d.steps) !== Boolean(d.skills), {
|
|
5666
5783
|
message: 'a workflow lists either "steps" or "skills", not both'
|
|
5667
5784
|
});
|
|
5668
5785
|
|
|
5669
5786
|
// ../contract/src/reports.ts
|
|
5670
|
-
import { z as
|
|
5787
|
+
import { z as z49 } from "zod";
|
|
5671
5788
|
var REPORTS_QUERY_MAX = 1e3;
|
|
5672
|
-
var cursorSchema =
|
|
5673
|
-
var reportsQuerySchema =
|
|
5674
|
-
q:
|
|
5789
|
+
var cursorSchema = z49.string().min(1).max(1024);
|
|
5790
|
+
var reportsQuerySchema = z49.object({
|
|
5791
|
+
q: z49.string().max(REPORTS_QUERY_MAX).optional(),
|
|
5675
5792
|
before: cursorSchema.optional(),
|
|
5676
|
-
limit:
|
|
5793
|
+
limit: z49.string().regex(/^(?:[1-9]|[1-9][0-9]|100)$/).transform(Number).optional()
|
|
5677
5794
|
}).strict();
|
|
5678
|
-
var reportSchema =
|
|
5679
|
-
id:
|
|
5680
|
-
runId:
|
|
5681
|
-
name:
|
|
5682
|
-
title:
|
|
5683
|
-
createdAt:
|
|
5684
|
-
size:
|
|
5685
|
-
taskTitle:
|
|
5795
|
+
var reportSchema = z49.object({
|
|
5796
|
+
id: z49.uuid(),
|
|
5797
|
+
runId: z49.uuid(),
|
|
5798
|
+
name: z49.string(),
|
|
5799
|
+
title: z49.string(),
|
|
5800
|
+
createdAt: z49.iso.datetime(),
|
|
5801
|
+
size: z49.number().int().nonnegative(),
|
|
5802
|
+
taskTitle: z49.string(),
|
|
5686
5803
|
taskStatus: runStatusSchema
|
|
5687
5804
|
}).strict();
|
|
5688
|
-
var reportsResponseSchema =
|
|
5689
|
-
reports:
|
|
5805
|
+
var reportsResponseSchema = z49.object({
|
|
5806
|
+
reports: z49.array(reportSchema),
|
|
5690
5807
|
nextCursor: cursorSchema.nullable(),
|
|
5691
5808
|
// Counts all matching cached rows with readable source summaries before page content checks.
|
|
5692
5809
|
// A missing-content row dropped while filling this page can lower total on the next request.
|
|
5693
|
-
total:
|
|
5810
|
+
total: z49.number().int().nonnegative()
|
|
5694
5811
|
}).strict();
|
|
5695
|
-
var reportsStateSchema =
|
|
5696
|
-
epoch:
|
|
5697
|
-
generation:
|
|
5698
|
-
metadataGeneration:
|
|
5812
|
+
var reportsStateSchema = z49.object({
|
|
5813
|
+
epoch: z49.uuid(),
|
|
5814
|
+
generation: z49.number().int().nonnegative(),
|
|
5815
|
+
metadataGeneration: z49.number().int().nonnegative()
|
|
5699
5816
|
}).strict();
|
|
5700
|
-
var reportsMetadataSchema =
|
|
5701
|
-
runId:
|
|
5702
|
-
taskTitle:
|
|
5817
|
+
var reportsMetadataSchema = z49.object({
|
|
5818
|
+
runId: z49.uuid(),
|
|
5819
|
+
taskTitle: z49.string(),
|
|
5703
5820
|
taskStatus: runStatusSchema
|
|
5704
5821
|
}).strict();
|
|
5705
|
-
var reportsFrameSchema =
|
|
5706
|
-
reportsStateSchema.extend({ type:
|
|
5707
|
-
reportsStateSchema.extend({ type:
|
|
5708
|
-
reportsStateSchema.extend({ type:
|
|
5822
|
+
var reportsFrameSchema = z49.discriminatedUnion("type", [
|
|
5823
|
+
reportsStateSchema.extend({ type: z49.literal("snapshot") }),
|
|
5824
|
+
reportsStateSchema.extend({ type: z49.literal("content") }),
|
|
5825
|
+
reportsStateSchema.extend({ type: z49.literal("metadata"), runs: z49.array(reportsMetadataSchema) })
|
|
5709
5826
|
]);
|
|
5710
5827
|
|
|
5711
5828
|
// ../contract/src/report-title.ts
|
|
@@ -5727,30 +5844,30 @@ function controlLocation(control, separator = " \u2192 ") {
|
|
|
5727
5844
|
}
|
|
5728
5845
|
|
|
5729
5846
|
// ../contract/src/home-recovery.ts
|
|
5730
|
-
import { z as
|
|
5847
|
+
import { z as z50 } from "zod";
|
|
5731
5848
|
var HOME_FILE_PATTERN = /^(?:(?:config\.json(?:\.bak)?|agent-accounts\.json|ui-state\.json|server\.json|server\.install\.lock)|(?:remote-settings|server-instances)\/[a-zA-Z0-9-]+\.(?:json|install\.lock))$/;
|
|
5732
|
-
var homeFileSchema =
|
|
5733
|
-
var recoveryFile =
|
|
5849
|
+
var homeFileSchema = z50.string().regex(HOME_FILE_PATTERN);
|
|
5850
|
+
var recoveryFile = z50.object({
|
|
5734
5851
|
file: homeFileSchema,
|
|
5735
|
-
detectedAt:
|
|
5736
|
-
canRestore:
|
|
5852
|
+
detectedAt: z50.iso.datetime(),
|
|
5853
|
+
canRestore: z50.boolean()
|
|
5737
5854
|
});
|
|
5738
5855
|
var HOME_RECOVERY_REASONS = ["reset", "outside-write", "legacy-change"];
|
|
5739
|
-
var homeRecoveryFileSchema =
|
|
5740
|
-
recoveryFile.extend({ reason:
|
|
5741
|
-
recoveryFile.extend({ reason:
|
|
5742
|
-
recoveryFile.extend({ reason:
|
|
5856
|
+
var homeRecoveryFileSchema = z50.discriminatedUnion("reason", [
|
|
5857
|
+
recoveryFile.extend({ reason: z50.literal("reset") }),
|
|
5858
|
+
recoveryFile.extend({ reason: z50.literal("outside-write") }),
|
|
5859
|
+
recoveryFile.extend({ reason: z50.literal("legacy-change"), canImport: z50.boolean() })
|
|
5743
5860
|
]);
|
|
5744
|
-
var homeRecoverySchema =
|
|
5861
|
+
var homeRecoverySchema = z50.object({ files: z50.array(homeRecoveryFileSchema) });
|
|
5745
5862
|
function filterHomeRecoveryReasons(value, reasons) {
|
|
5746
5863
|
if (!value || typeof value !== "object" || !("files" in value) || !Array.isArray(value.files)) return value;
|
|
5747
5864
|
return { ...value, files: value.files.filter((row) => !(row && typeof row === "object" && "reason" in row && typeof row.reason === "string" && !reasons.includes(row.reason))) };
|
|
5748
5865
|
}
|
|
5749
|
-
var homeRecoveryReaderSchema =
|
|
5866
|
+
var homeRecoveryReaderSchema = z50.preprocess(
|
|
5750
5867
|
(value) => filterHomeRecoveryReasons(value, HOME_RECOVERY_REASONS),
|
|
5751
5868
|
homeRecoverySchema
|
|
5752
5869
|
);
|
|
5753
|
-
var homeRecoveryActionSchema =
|
|
5870
|
+
var homeRecoveryActionSchema = z50.object({ file: homeFileSchema, detectedAt: z50.iso.datetime() }).strict();
|
|
5754
5871
|
export {
|
|
5755
5872
|
ACTIVITY_CHECKS_MAX,
|
|
5756
5873
|
ACTIVITY_CHECK_NAME_MAX,
|
|
@@ -5837,6 +5954,10 @@ export {
|
|
|
5837
5954
|
TIMER_MIN_SECONDS,
|
|
5838
5955
|
UNREAD_RUN_RULE,
|
|
5839
5956
|
UTC_MINUTE_PATTERN,
|
|
5957
|
+
VOICE_STATUS_DESCRIPTIONS,
|
|
5958
|
+
VOICE_STATUS_IDS,
|
|
5959
|
+
VOICE_TEXT_MAX,
|
|
5960
|
+
VOICE_VIEWS,
|
|
5840
5961
|
WAIT_LIMIT,
|
|
5841
5962
|
WAIT_MESSAGE_MAX,
|
|
5842
5963
|
WEBHOOK_TRIGGERS,
|
|
@@ -6106,7 +6227,6 @@ export {
|
|
|
6106
6227
|
isUsageLimitHold,
|
|
6107
6228
|
isValidTimeZone,
|
|
6108
6229
|
isoWeekday,
|
|
6109
|
-
launchKeyResponseSchema,
|
|
6110
6230
|
liveDemandSchema,
|
|
6111
6231
|
liveEntrySchema,
|
|
6112
6232
|
liveRunBatchResponseSchema,
|
|
@@ -6381,6 +6501,16 @@ export {
|
|
|
6381
6501
|
updateProjectWebhookInputSchema,
|
|
6382
6502
|
userMcpListingSchema,
|
|
6383
6503
|
utcMinute,
|
|
6504
|
+
voiceAnswerSchema,
|
|
6505
|
+
voiceDecideRequestSchema,
|
|
6506
|
+
voiceDecisionSchema,
|
|
6507
|
+
voiceOutcomeRequestSchema,
|
|
6508
|
+
voiceOutcomeResponseSchema,
|
|
6509
|
+
voiceOutcomeSchema,
|
|
6510
|
+
voicePositionSchema,
|
|
6511
|
+
voiceSidebarViewSchema,
|
|
6512
|
+
voiceStatusSchema,
|
|
6513
|
+
voiceViewSchema,
|
|
6384
6514
|
waitErrorCodeSchema,
|
|
6385
6515
|
waitPhaseSchema,
|
|
6386
6516
|
waitQuery,
|