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