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