@hearsay-tools/squawk 0.18.0-pr4151.8017 → 0.18.0-pr4153.8018
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/dist/ci-wait/client.js.map +1 -1
- package/dist/ci-wait/controller.d.ts +5 -6
- package/dist/ci-wait/controller.js.map +1 -1
- package/dist/ci-wait/tool-catalog.js.map +1 -1
- package/dist/contract/index.d.ts +0 -1
- package/dist/contract/index.js +615 -622
- package/dist/contract/wait-limits.d.ts +0 -3
- package/dist/contract/waits.d.ts +441 -2
- package/dist/delegation/routes.d.ts +4 -4
- package/dist/delegation/transport.d.ts +15 -15
- package/dist/runs/run-archive.d.ts +72 -72
- package/dist/runs/run-decode.d.ts +72 -72
- package/dist/runs/run-exits.d.ts +336 -336
- package/dist/workflows/continuation-admission.d.ts +72 -72
- package/dist/workflows/run/compose.d.ts +1 -2
- package/dist/workflows/run/compose.js.map +1 -1
- package/dist/workflows/run/run-finish.js.map +1 -1
- package/dist/workflows/run/squawk-tools.d.ts +1 -2
- package/dist/workflows/run/squawk-tools.js.map +1 -1
- package/dist/workflows/run/wait-registration-tool.js +1 -2
- package/dist/workflows/run/wait-registration-tool.js.map +1 -1
- package/dist/workflows/run/wait-registration.d.ts +1 -2
- package/dist/workflows/run/wait-registration.js.map +1 -1
- package/dist/workflows/run/wait-registry.d.ts +1 -2
- package/dist/workflows/run/wait-registry.js.map +1 -1
- package/dist/workflows/run.d.ts +1 -2
- package/dist/workflows/run.js.map +1 -1
- package/package.json +4 -4
- package/web/dist/assets/{accounts-section-Lxa13E8O.js → accounts-section-CJ1xR0FN.js} +1 -1
- package/web/dist/assets/{activity-motion-D-8GF_WP.js → activity-motion-C01GEN0y.js} +1 -1
- package/web/dist/assets/{activity-route-Bo-Cyzsz.js → activity-route-BZ1NIKSY.js} +1 -1
- package/web/dist/assets/{agent-config-section-BE239EYo.js → agent-config-section-DvFcRRLD.js} +1 -1
- package/web/dist/assets/{agent-defaults-section-Bj5dO6F3.js → agent-defaults-section-BE88c2RN.js} +1 -1
- package/web/dist/assets/{appearance-C2v7z5MF.js → appearance-B9Z6lNEm.js} +1 -1
- package/web/dist/assets/{archive-on-merge-field-Ta3WlY1p.js → archive-on-merge-field-DtR7twJI.js} +1 -1
- package/web/dist/assets/attention-B6NEiTGm.js +1 -0
- package/web/dist/assets/{automations-route-DPpaFR0Q.js → automations-route-Dpa01C3j.js} +1 -1
- package/web/dist/assets/{commit-diff-panel-CzY8bO3p.js → commit-diff-panel-CGjhxIPJ.js} +1 -1
- package/web/dist/assets/{diff-3jSM3IH7.js → diff-DQ18_bA-.js} +2 -2
- package/web/dist/assets/{diff-view-C3cwyYRv.js → diff-view-CMwe_Rx7.js} +1 -1
- package/web/dist/assets/{file-preview-B71T62DU.js → file-preview-_lAUlt5u.js} +1 -1
- package/web/dist/assets/{folder-browser-BTYMFLBY.js → folder-browser-Cy26Y6YK.js} +1 -1
- package/web/dist/assets/{git-toolbar-Dng31AhK.js → git-toolbar-BJM3pWHY.js} +1 -1
- package/web/dist/assets/{github-Cft2RNHM.js → github-aO7y0526.js} +1 -1
- package/web/dist/assets/{global-activity-route-CngRjBlD.js → global-activity-route-BWOfw2C5.js} +1 -1
- package/web/dist/assets/{index-MG3T7zFQ.js → index-D-Y1olb1.js} +5 -5
- package/web/dist/assets/{label-C9IGG0mW.js → label-CbEJ99h4.js} +1 -1
- package/web/dist/assets/{markdown-BDWm6oGX.js → markdown-BDWII3gy.js} +1 -1
- package/web/dist/assets/{notifications-section-BxIKJ1NF.js → notifications-section-Z_4IW83J.js} +1 -1
- package/web/dist/assets/{open-in-menu-LbTu2sP4.js → open-in-menu-21vcjK3t.js} +1 -1
- package/web/dist/assets/{preview-pane-connected-CGQngtTw.js → preview-pane-connected-CxwvH4pt.js} +1 -1
- package/web/dist/assets/{project-location-B-18C392.js → project-location-CvJMe_Vp.js} +1 -1
- package/web/dist/assets/{project-router-DImKA81z.js → project-router-hhGBPlav.js} +1 -1
- package/web/dist/assets/project-scope-context-BiijuuWU.js +4 -0
- package/web/dist/assets/{projects-section-DQ1LxJ3A.js → projects-section-CQ34YFnT.js} +1 -1
- package/web/dist/assets/{prompt-templates-section-C5AYB6Ig.js → prompt-templates-section-UIxQCLJq.js} +1 -1
- package/web/dist/assets/{queries-BaHOUYn4.js → queries-D6ioEk6c.js} +1 -1
- package/web/dist/assets/{reference-chip-CdOqXRll.js → reference-chip-B5br2cfV.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-BTdflMqO.js → remote-settings-notice-BWDpTH5W.js} +1 -1
- package/web/dist/assets/{repo-git-DChiMWrS.js → repo-git-U12bPaG-.js} +1 -1
- package/web/dist/assets/{report-reader-nV2G6iRk.js → report-reader-B5vipU-m.js} +1 -1
- package/web/dist/assets/{reports-CoQqVEy4.js → reports-Cdk8Dc-w.js} +1 -1
- package/web/dist/assets/{resources-section-CVaIlicS.js → resources-section-BCLu3v1Z.js} +1 -1
- package/web/dist/assets/{run-header-xPtXOBkm.js → run-header-gOqc0BKa.js} +1 -1
- package/web/dist/assets/{runners-DccsyraI.js → runners-5cgs0qUY.js} +1 -1
- package/web/dist/assets/{settings-agent-picker-ixlEQ-MP.js → settings-agent-picker-CB7l8AW-.js} +1 -1
- package/web/dist/assets/{settings-shell-BwknM_fs.js → settings-shell-BUHHoCDs.js} +1 -1
- package/web/dist/assets/{sidebar-section-BNy-fRPU.js → sidebar-section-8dTKLdQw.js} +1 -1
- package/web/dist/assets/{skills-CKceHo5J.js → skills-thuBrq2s.js} +1 -1
- package/web/dist/assets/{tab-link-VCVNqxFc.js → tab-link-DaFUyEhe.js} +1 -1
- package/web/dist/assets/{task-changes-D4H5YbMo.js → task-changes-DSpeg6sX.js} +1 -1
- package/web/dist/assets/{task-commits-BNu0VTTf.js → task-commits-DRDRswBh.js} +1 -1
- package/web/dist/assets/{task-files-C8q8GHYK.js → task-files-Cevz9Mex.js} +1 -1
- package/web/dist/assets/{task-github-item-D5kHfnwY.js → task-github-item-DpLkKSKy.js} +1 -1
- package/web/dist/assets/{task-groups-C7yO8nMy.js → task-groups-CafTiSSz.js} +1 -1
- package/web/dist/assets/{task-thread-Dhts8Nbu.js → task-thread-BvM4rEQe.js} +1 -1
- package/web/dist/assets/{tasks-table-I_z4e7uI.js → tasks-table-DYjfmofR.js} +1 -1
- package/web/dist/assets/{thread-state-DV19z3BD.js → thread-state-A3TSuI5v.js} +1 -1
- package/web/dist/assets/{use-hand-to-agent-state-C6e6Mgi1.js → use-hand-to-agent-state-IepoiFbj.js} +1 -1
- package/web/dist/assets/{useInfiniteQuery-DR5UfhCS.js → useInfiniteQuery-B20OnjTe.js} +1 -1
- package/web/dist/assets/useQuery-BTg3x78A.js +1 -0
- package/web/dist/assets/{workflows-BNHmFZRc.js → workflows-B0TaHAzz.js} +1 -1
- package/web/dist/assets/{workspace-tools-UHJAnHEN.js → workspace-tools-B8sP_p5c.js} +1 -1
- package/web/dist/assets/{worktrees-section-B4XPx6R5.js → worktrees-section-BDfwadB6.js} +1 -1
- package/web/dist/assets/{ws-CH3zNFKR.js → ws-ExzR2_Yn.js} +1 -1
- package/web/dist/index.html +15 -15
- package/dist/contract/wait-tools.d.ts +0 -440
- package/web/dist/assets/attention-B1Ei1IW6.js +0 -1
- package/web/dist/assets/project-scope-context-D3_4Nfjk.js +0 -4
- package/web/dist/assets/useQuery-BMyCehPp.js +0 -1
package/dist/contract/index.js
CHANGED
|
@@ -1558,8 +1558,6 @@ var SUBAGENT_WAIT_DEADLINE_SECONDS = 1800;
|
|
|
1558
1558
|
var SUBAGENT_WAIT_GRACE_SECONDS = 15;
|
|
1559
1559
|
var SUBAGENT_WAIT_CHILD_LIMIT = 32;
|
|
1560
1560
|
var WAIT_MESSAGE_MAX = 4096;
|
|
1561
|
-
var NOTE_MAX = 512;
|
|
1562
|
-
var PID_MIN = 2;
|
|
1563
1561
|
|
|
1564
1562
|
// ../contract/src/waiting-on.ts
|
|
1565
1563
|
function peerRequestIds(delegation) {
|
|
@@ -1639,7 +1637,8 @@ function resolveWaitingOn(run) {
|
|
|
1639
1637
|
}
|
|
1640
1638
|
|
|
1641
1639
|
// ../contract/src/waits.ts
|
|
1642
|
-
var
|
|
1640
|
+
var NOTE_MAX = 512;
|
|
1641
|
+
var pidSchema = z21.number().int().min(2);
|
|
1643
1642
|
var waitPhaseSchema = z21.enum(["open", "resolved", "delivered", "cancelled"]);
|
|
1644
1643
|
var waitViaSchema = z21.enum([
|
|
1645
1644
|
// `cezar_wait_for_ci` is kept for stored rows only: the tool was removed (hearsay-tools/cezarion#1236).
|
|
@@ -1785,6 +1784,49 @@ function runningSubagents(wait) {
|
|
|
1785
1784
|
return wait.children.filter((child) => child.status === "running").length;
|
|
1786
1785
|
}
|
|
1787
1786
|
var waitSchema = z21.discriminatedUnion("kind", [prWaitEntrySchema, timerWaitEntrySchema, humanWaitEntrySchema, workerWaitEntrySchema, processWaitEntrySchema, peerWaitEntrySchema, subagentWaitEntrySchema]);
|
|
1787
|
+
var oneModeTakesOneId = (ids, mode, ctx) => {
|
|
1788
|
+
if (mode === "one" && ids.length !== 1) ctx.addIssue({ code: "custom", message: "one mode requires exactly one id", path: ["mode"] });
|
|
1789
|
+
};
|
|
1790
|
+
var waitTimeoutSeconds = z21.number().int().min(1).max(PEER_WAIT_MAX_SECONDS).default(PEER_WAIT_DEFAULT_SECONDS);
|
|
1791
|
+
var registrationFields = { operation_id: z21.uuid().optional() };
|
|
1792
|
+
var squawkWaitRequestSchema = z21.discriminatedUnion("kind", [
|
|
1793
|
+
ciWaitRequestSchema.extend({ kind: z21.literal("pr"), ...registrationFields }).strict(),
|
|
1794
|
+
z21.object({
|
|
1795
|
+
kind: z21.literal("worker"),
|
|
1796
|
+
...registrationFields,
|
|
1797
|
+
worker_ids: workerIdsSchema,
|
|
1798
|
+
mode: workerWaitModeSchema.optional(),
|
|
1799
|
+
timeout_seconds: waitTimeoutSeconds
|
|
1800
|
+
}).strict().superRefine((request, ctx) => oneModeTakesOneId(request.worker_ids, request.mode, ctx)),
|
|
1801
|
+
z21.object({
|
|
1802
|
+
kind: z21.literal("request"),
|
|
1803
|
+
...registrationFields,
|
|
1804
|
+
request_ids: workerIdsSchema,
|
|
1805
|
+
mode: workerWaitModeSchema.optional(),
|
|
1806
|
+
timeout_seconds: waitTimeoutSeconds
|
|
1807
|
+
}).strict().superRefine((request, ctx) => oneModeTakesOneId(request.request_ids, request.mode, ctx)),
|
|
1808
|
+
z21.object({
|
|
1809
|
+
kind: z21.literal("peer"),
|
|
1810
|
+
...registrationFields,
|
|
1811
|
+
peer_ids: workerIdsSchema,
|
|
1812
|
+
timeout_seconds: waitTimeoutSeconds
|
|
1813
|
+
}).strict(),
|
|
1814
|
+
z21.object({
|
|
1815
|
+
kind: z21.literal("timer"),
|
|
1816
|
+
...registrationFields,
|
|
1817
|
+
seconds: z21.number().int().min(TIMER_MIN_SECONDS).max(TIMER_MAX_SECONDS),
|
|
1818
|
+
note: z21.string().max(NOTE_MAX).optional()
|
|
1819
|
+
}).strict(),
|
|
1820
|
+
z21.object({
|
|
1821
|
+
kind: z21.literal("process"),
|
|
1822
|
+
...registrationFields,
|
|
1823
|
+
pid: pidSchema,
|
|
1824
|
+
exit_file: z21.string().min(1).max(PROCESS_EXIT_FILE_MAX).optional(),
|
|
1825
|
+
timeout_seconds: z21.number().int().min(1).max(PROCESS_TIMEOUT_MAX_SECONDS).default(PROCESS_TIMEOUT_DEFAULT_SECONDS),
|
|
1826
|
+
note: z21.string().max(NOTE_MAX).optional()
|
|
1827
|
+
}).strict()
|
|
1828
|
+
]);
|
|
1829
|
+
var squawkCancelWaitRequestSchema = z21.object({ wait_id: z21.uuid() }).strict();
|
|
1788
1830
|
var openWaitFields = { wait_id: z21.uuid(), summary: z21.string().max(256) };
|
|
1789
1831
|
var openWaitSchema = z21.discriminatedUnion("kind", [
|
|
1790
1832
|
z21.object({ ...openWaitFields, kind: z21.enum(["pr", "timer", "worker", "process", "peer", "subagent"]), deadline: z21.iso.datetime() }).strict(),
|
|
@@ -1804,12 +1846,41 @@ var waitErrorCodeSchema = z21.enum([
|
|
|
1804
1846
|
// hearsay-tools/cezarion#2784: a peer wait on a task whose messaging switch is off.
|
|
1805
1847
|
"messaging_off"
|
|
1806
1848
|
]);
|
|
1849
|
+
var message = z21.string().max(WAIT_MESSAGE_MAX);
|
|
1807
1850
|
var waitRegistrationReceiptSchema = z21.object({
|
|
1808
1851
|
operationId: z21.uuid(),
|
|
1809
1852
|
requestHash: z21.string().regex(/^[0-9a-f]{64}$/),
|
|
1810
1853
|
wait: waitSchema,
|
|
1811
1854
|
deduplicated: z21.boolean()
|
|
1812
1855
|
}).strict();
|
|
1856
|
+
var registrationAnswerFields = {
|
|
1857
|
+
operation_id: z21.uuid().optional()
|
|
1858
|
+
};
|
|
1859
|
+
var squawkWaitAnswerSchema = z21.discriminatedUnion("ok", [
|
|
1860
|
+
z21.object({
|
|
1861
|
+
ok: z21.literal(true),
|
|
1862
|
+
...registrationAnswerFields,
|
|
1863
|
+
effect: z21.enum(["applied", "unchanged"]).optional(),
|
|
1864
|
+
deduplicated: z21.boolean().optional(),
|
|
1865
|
+
replayed: z21.boolean().optional(),
|
|
1866
|
+
wait_phase: z21.enum([...waitPhaseSchema.options, "unavailable"]).optional(),
|
|
1867
|
+
wait_id: z21.uuid(),
|
|
1868
|
+
/** The kind the call asked for: a `request` wait is stored as a `worker` entry. */
|
|
1869
|
+
kind: z21.enum(["pr", "timer", "worker", "request", "process", "peer"]),
|
|
1870
|
+
deadline: z21.iso.datetime(),
|
|
1871
|
+
open_waits: z21.array(openWaitSchema).max(WAIT_LIMIT)
|
|
1872
|
+
}).strict(),
|
|
1873
|
+
z21.object({
|
|
1874
|
+
ok: z21.literal(false),
|
|
1875
|
+
...registrationAnswerFields,
|
|
1876
|
+
effect: z21.enum(["refused", "unknown"]).optional(),
|
|
1877
|
+
retained_wait: openWaitSchema.optional(),
|
|
1878
|
+
code: waitErrorCodeSchema,
|
|
1879
|
+
message,
|
|
1880
|
+
open_waits: z21.array(openWaitSchema).max(WAIT_LIMIT).optional()
|
|
1881
|
+
}).strict()
|
|
1882
|
+
]);
|
|
1883
|
+
var squawkAskRequestSchema = askRequestSchema.extend({ context: askContextSchema });
|
|
1813
1884
|
var askErrorCodeSchema = z21.enum([
|
|
1814
1885
|
"invalid_request",
|
|
1815
1886
|
"capacity",
|
|
@@ -1832,6 +1903,29 @@ var askErrorCodeSchema = z21.enum([
|
|
|
1832
1903
|
"root_finish_pending",
|
|
1833
1904
|
"supervisor_is_worker"
|
|
1834
1905
|
]);
|
|
1906
|
+
var squawkAskAnswerSchema = z21.discriminatedUnion("ok", [
|
|
1907
|
+
z21.object({ ok: z21.literal(true), wait_id: z21.uuid(), open_waits: z21.array(openWaitSchema).max(WAIT_LIMIT) }).strict(),
|
|
1908
|
+
z21.object({
|
|
1909
|
+
ok: z21.literal(false),
|
|
1910
|
+
code: askErrorCodeSchema,
|
|
1911
|
+
message,
|
|
1912
|
+
open_waits: z21.array(openWaitSchema).max(WAIT_LIMIT).optional()
|
|
1913
|
+
}).strict()
|
|
1914
|
+
]);
|
|
1915
|
+
var squawkCancelWaitAnswerSchema = z21.discriminatedUnion("cancelled", [
|
|
1916
|
+
z21.object({
|
|
1917
|
+
cancelled: z21.literal(true),
|
|
1918
|
+
wait_id: z21.uuid(),
|
|
1919
|
+
open_waits: z21.array(openWaitSchema).max(WAIT_LIMIT)
|
|
1920
|
+
}).strict(),
|
|
1921
|
+
z21.object({
|
|
1922
|
+
cancelled: z21.literal(false),
|
|
1923
|
+
code: z21.enum(["not_found", "already_resolved", "human_question", "invalid_request", "unavailable"]),
|
|
1924
|
+
message,
|
|
1925
|
+
open_waits: z21.array(openWaitSchema).max(WAIT_LIMIT).optional()
|
|
1926
|
+
}).strict()
|
|
1927
|
+
]);
|
|
1928
|
+
var squawkDoneRequestSchema = z21.object({ summary: z21.string().max(2e3).optional() }).strict();
|
|
1835
1929
|
var doneErrorCodeSchema = z21.enum([
|
|
1836
1930
|
"workers_outstanding",
|
|
1837
1931
|
"workers_uncollected",
|
|
@@ -1862,6 +1956,30 @@ var doneOwedInputSchema = z21.discriminatedUnion("kind", [
|
|
|
1862
1956
|
z21.object({ kind: z21.literal("in_flight"), input_id: z21.string() }).strict(),
|
|
1863
1957
|
z21.object({ kind: z21.literal("unread"), input_id: z21.string() }).strict()
|
|
1864
1958
|
]);
|
|
1959
|
+
var doneAccepted = {
|
|
1960
|
+
ok: z21.literal(true),
|
|
1961
|
+
finishes: z21.literal("at_turn_end"),
|
|
1962
|
+
open_waits: z21.array(openWaitSchema).max(WAIT_LIMIT)
|
|
1963
|
+
};
|
|
1964
|
+
var squawkDoneAnswerSchema = z21.discriminatedUnion("ok", [
|
|
1965
|
+
z21.discriminatedUnion("completes", [
|
|
1966
|
+
z21.object({ ...doneAccepted, completes: z21.literal("task") }).strict(),
|
|
1967
|
+
z21.object({ ...doneAccepted, completes: z21.literal("step"), next_step: z21.string().min(1) }).strict()
|
|
1968
|
+
]),
|
|
1969
|
+
z21.object({
|
|
1970
|
+
ok: z21.literal(false),
|
|
1971
|
+
code: doneErrorCodeSchema,
|
|
1972
|
+
message,
|
|
1973
|
+
/** The workers that block the finish, and why each one does. */
|
|
1974
|
+
workers: z21.array(z21.object({
|
|
1975
|
+
worker_id: z21.string(),
|
|
1976
|
+
reason: z21.enum(["outstanding", "uncollected", "question"])
|
|
1977
|
+
}).strict()).max(64).optional(),
|
|
1978
|
+
open_waits: z21.array(openWaitSchema).max(WAIT_LIMIT).optional(),
|
|
1979
|
+
/** `input_pending` (hearsay-tools/squawk#2587): what the run still owes the agent. */
|
|
1980
|
+
owed: z21.array(doneOwedInputSchema).max(64).optional()
|
|
1981
|
+
}).strict()
|
|
1982
|
+
]);
|
|
1865
1983
|
var waitingOnUnionSchema = z21.discriminatedUnion("kind", [
|
|
1866
1984
|
/** `shown` once the user sees the question (its `askSeq`): attention reads that as Needs you at
|
|
1867
1985
|
* any status, a wake turn's included (phase 4b, hearsay-tools/cezarion#1236). */
|
|
@@ -4583,129 +4701,6 @@ var scheduledTasksAnswerSchema = z34.union([
|
|
|
4583
4701
|
refusal
|
|
4584
4702
|
]);
|
|
4585
4703
|
|
|
4586
|
-
// ../contract/src/wait-tools.ts
|
|
4587
|
-
import { z as z35 } from "zod";
|
|
4588
|
-
var pidSchema2 = z35.number().int().min(PID_MIN);
|
|
4589
|
-
var oneModeTakesOneId = (ids, mode, ctx) => {
|
|
4590
|
-
if (mode === "one" && ids.length !== 1) ctx.addIssue({ code: "custom", message: "one mode requires exactly one id", path: ["mode"] });
|
|
4591
|
-
};
|
|
4592
|
-
var waitTimeoutSeconds = z35.number().int().min(1).max(PEER_WAIT_MAX_SECONDS).default(PEER_WAIT_DEFAULT_SECONDS);
|
|
4593
|
-
var registrationFields = { operation_id: z35.uuid().optional() };
|
|
4594
|
-
var squawkWaitRequestSchema = z35.discriminatedUnion("kind", [
|
|
4595
|
-
ciWaitRequestSchema.extend({ kind: z35.literal("pr"), ...registrationFields }).strict(),
|
|
4596
|
-
z35.object({
|
|
4597
|
-
kind: z35.literal("worker"),
|
|
4598
|
-
...registrationFields,
|
|
4599
|
-
worker_ids: workerIdsSchema,
|
|
4600
|
-
mode: workerWaitModeSchema.optional(),
|
|
4601
|
-
timeout_seconds: waitTimeoutSeconds
|
|
4602
|
-
}).strict().superRefine((request, ctx) => oneModeTakesOneId(request.worker_ids, request.mode, ctx)),
|
|
4603
|
-
z35.object({
|
|
4604
|
-
kind: z35.literal("request"),
|
|
4605
|
-
...registrationFields,
|
|
4606
|
-
request_ids: workerIdsSchema,
|
|
4607
|
-
mode: workerWaitModeSchema.optional(),
|
|
4608
|
-
timeout_seconds: waitTimeoutSeconds
|
|
4609
|
-
}).strict().superRefine((request, ctx) => oneModeTakesOneId(request.request_ids, request.mode, ctx)),
|
|
4610
|
-
z35.object({
|
|
4611
|
-
kind: z35.literal("peer"),
|
|
4612
|
-
...registrationFields,
|
|
4613
|
-
peer_ids: workerIdsSchema,
|
|
4614
|
-
timeout_seconds: waitTimeoutSeconds
|
|
4615
|
-
}).strict(),
|
|
4616
|
-
z35.object({
|
|
4617
|
-
kind: z35.literal("timer"),
|
|
4618
|
-
...registrationFields,
|
|
4619
|
-
seconds: z35.number().int().min(TIMER_MIN_SECONDS).max(TIMER_MAX_SECONDS),
|
|
4620
|
-
note: z35.string().max(NOTE_MAX).optional()
|
|
4621
|
-
}).strict(),
|
|
4622
|
-
z35.object({
|
|
4623
|
-
kind: z35.literal("process"),
|
|
4624
|
-
...registrationFields,
|
|
4625
|
-
pid: pidSchema2,
|
|
4626
|
-
exit_file: z35.string().min(1).max(PROCESS_EXIT_FILE_MAX).optional(),
|
|
4627
|
-
timeout_seconds: z35.number().int().min(1).max(PROCESS_TIMEOUT_MAX_SECONDS).default(PROCESS_TIMEOUT_DEFAULT_SECONDS),
|
|
4628
|
-
note: z35.string().max(NOTE_MAX).optional()
|
|
4629
|
-
}).strict()
|
|
4630
|
-
]);
|
|
4631
|
-
var squawkCancelWaitRequestSchema = z35.object({ wait_id: z35.uuid() }).strict();
|
|
4632
|
-
var message = z35.string().max(WAIT_MESSAGE_MAX);
|
|
4633
|
-
var registrationAnswerFields = {
|
|
4634
|
-
operation_id: z35.uuid().optional()
|
|
4635
|
-
};
|
|
4636
|
-
var squawkWaitAnswerSchema = z35.discriminatedUnion("ok", [
|
|
4637
|
-
z35.object({
|
|
4638
|
-
ok: z35.literal(true),
|
|
4639
|
-
...registrationAnswerFields,
|
|
4640
|
-
effect: z35.enum(["applied", "unchanged"]).optional(),
|
|
4641
|
-
deduplicated: z35.boolean().optional(),
|
|
4642
|
-
replayed: z35.boolean().optional(),
|
|
4643
|
-
wait_phase: z35.enum([...waitPhaseSchema.options, "unavailable"]).optional(),
|
|
4644
|
-
wait_id: z35.uuid(),
|
|
4645
|
-
/** The kind the call asked for: a `request` wait is stored as a `worker` entry. */
|
|
4646
|
-
kind: z35.enum(["pr", "timer", "worker", "request", "process", "peer"]),
|
|
4647
|
-
deadline: z35.iso.datetime(),
|
|
4648
|
-
open_waits: z35.array(openWaitSchema).max(WAIT_LIMIT)
|
|
4649
|
-
}).strict(),
|
|
4650
|
-
z35.object({
|
|
4651
|
-
ok: z35.literal(false),
|
|
4652
|
-
...registrationAnswerFields,
|
|
4653
|
-
effect: z35.enum(["refused", "unknown"]).optional(),
|
|
4654
|
-
retained_wait: openWaitSchema.optional(),
|
|
4655
|
-
code: waitErrorCodeSchema,
|
|
4656
|
-
message,
|
|
4657
|
-
open_waits: z35.array(openWaitSchema).max(WAIT_LIMIT).optional()
|
|
4658
|
-
}).strict()
|
|
4659
|
-
]);
|
|
4660
|
-
var squawkAskRequestSchema = askRequestSchema.extend({ context: askContextSchema });
|
|
4661
|
-
var squawkAskAnswerSchema = z35.discriminatedUnion("ok", [
|
|
4662
|
-
z35.object({ ok: z35.literal(true), wait_id: z35.uuid(), open_waits: z35.array(openWaitSchema).max(WAIT_LIMIT) }).strict(),
|
|
4663
|
-
z35.object({
|
|
4664
|
-
ok: z35.literal(false),
|
|
4665
|
-
code: askErrorCodeSchema,
|
|
4666
|
-
message,
|
|
4667
|
-
open_waits: z35.array(openWaitSchema).max(WAIT_LIMIT).optional()
|
|
4668
|
-
}).strict()
|
|
4669
|
-
]);
|
|
4670
|
-
var squawkCancelWaitAnswerSchema = z35.discriminatedUnion("cancelled", [
|
|
4671
|
-
z35.object({
|
|
4672
|
-
cancelled: z35.literal(true),
|
|
4673
|
-
wait_id: z35.uuid(),
|
|
4674
|
-
open_waits: z35.array(openWaitSchema).max(WAIT_LIMIT)
|
|
4675
|
-
}).strict(),
|
|
4676
|
-
z35.object({
|
|
4677
|
-
cancelled: z35.literal(false),
|
|
4678
|
-
code: z35.enum(["not_found", "already_resolved", "human_question", "invalid_request", "unavailable"]),
|
|
4679
|
-
message,
|
|
4680
|
-
open_waits: z35.array(openWaitSchema).max(WAIT_LIMIT).optional()
|
|
4681
|
-
}).strict()
|
|
4682
|
-
]);
|
|
4683
|
-
var squawkDoneRequestSchema = z35.object({ summary: z35.string().max(2e3).optional() }).strict();
|
|
4684
|
-
var doneAccepted = {
|
|
4685
|
-
ok: z35.literal(true),
|
|
4686
|
-
finishes: z35.literal("at_turn_end"),
|
|
4687
|
-
open_waits: z35.array(openWaitSchema).max(WAIT_LIMIT)
|
|
4688
|
-
};
|
|
4689
|
-
var squawkDoneAnswerSchema = z35.discriminatedUnion("ok", [
|
|
4690
|
-
z35.discriminatedUnion("completes", [
|
|
4691
|
-
z35.object({ ...doneAccepted, completes: z35.literal("task") }).strict(),
|
|
4692
|
-
z35.object({ ...doneAccepted, completes: z35.literal("step"), next_step: z35.string().min(1) }).strict()
|
|
4693
|
-
]),
|
|
4694
|
-
z35.object({
|
|
4695
|
-
ok: z35.literal(false),
|
|
4696
|
-
code: doneErrorCodeSchema,
|
|
4697
|
-
message,
|
|
4698
|
-
/** The workers that block the finish, and why each one does. */
|
|
4699
|
-
workers: z35.array(z35.object({
|
|
4700
|
-
worker_id: z35.string(),
|
|
4701
|
-
reason: z35.enum(["outstanding", "uncollected", "question"])
|
|
4702
|
-
}).strict()).max(64).optional(),
|
|
4703
|
-
open_waits: z35.array(openWaitSchema).max(WAIT_LIMIT).optional(),
|
|
4704
|
-
/** `input_pending` (hearsay-tools/squawk#2587): what the run still owes the agent. */
|
|
4705
|
-
owed: z35.array(doneOwedInputSchema).max(64).optional()
|
|
4706
|
-
}).strict()
|
|
4707
|
-
]);
|
|
4708
|
-
|
|
4709
4704
|
// ../contract/src/run-predicates.ts
|
|
4710
4705
|
function latestSessionStep(steps, except) {
|
|
4711
4706
|
let latest;
|
|
@@ -4885,73 +4880,73 @@ function sqlPrefilterTokens(query, options = {}) {
|
|
|
4885
4880
|
}
|
|
4886
4881
|
|
|
4887
4882
|
// ../contract/src/artifacts.ts
|
|
4888
|
-
import { z as
|
|
4889
|
-
var pathSchema =
|
|
4890
|
-
var publishedArtifactSchema =
|
|
4891
|
-
id:
|
|
4892
|
-
runId:
|
|
4893
|
-
name:
|
|
4894
|
-
title:
|
|
4883
|
+
import { z as z35 } from "zod";
|
|
4884
|
+
var pathSchema = z35.string().min(1).max(8192).refine((value) => !value.includes("\0"), "Path contains NUL");
|
|
4885
|
+
var publishedArtifactSchema = z35.object({
|
|
4886
|
+
id: z35.uuid(),
|
|
4887
|
+
runId: z35.uuid(),
|
|
4888
|
+
name: z35.string().min(1).max(255),
|
|
4889
|
+
title: z35.string().max(200).optional(),
|
|
4895
4890
|
sourcePath: pathSchema.refine((value) => /^(?:\/|[A-Za-z]:[\\/]|\\\\)/.test(value), "Expected an absolute source path"),
|
|
4896
|
-
createdAt:
|
|
4897
|
-
size:
|
|
4898
|
-
sha256:
|
|
4891
|
+
createdAt: z35.iso.datetime(),
|
|
4892
|
+
size: z35.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
|
|
4893
|
+
sha256: z35.string().regex(/^[a-f0-9]{64}$/)
|
|
4899
4894
|
}).strict();
|
|
4900
|
-
var filePreviewDataSchema =
|
|
4901
|
-
type:
|
|
4895
|
+
var filePreviewDataSchema = z35.object({
|
|
4896
|
+
type: z35.literal("file"),
|
|
4902
4897
|
path: pathSchema,
|
|
4903
|
-
size:
|
|
4904
|
-
binary:
|
|
4905
|
-
tooLarge:
|
|
4906
|
-
content:
|
|
4907
|
-
source:
|
|
4898
|
+
size: z35.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
|
|
4899
|
+
binary: z35.boolean(),
|
|
4900
|
+
tooLarge: z35.boolean(),
|
|
4901
|
+
content: z35.string().optional(),
|
|
4902
|
+
source: z35.enum(["worktree", "project", "artifact"]),
|
|
4908
4903
|
artifact: publishedArtifactSchema.optional()
|
|
4909
4904
|
}).strict();
|
|
4910
|
-
var fileLinkResultSchema =
|
|
4905
|
+
var fileLinkResultSchema = z35.union([
|
|
4911
4906
|
filePreviewDataSchema,
|
|
4912
|
-
|
|
4913
|
-
type:
|
|
4907
|
+
z35.object({
|
|
4908
|
+
type: z35.enum(["unavailable", "unpublished"]),
|
|
4914
4909
|
path: pathSchema,
|
|
4915
|
-
reason:
|
|
4910
|
+
reason: z35.string().min(1).max(4096)
|
|
4916
4911
|
}).strict()
|
|
4917
4912
|
]);
|
|
4918
|
-
var artifactMetadataResponseSchema =
|
|
4919
|
-
var artifactListSchema =
|
|
4920
|
-
var fileLinkQuerySchema =
|
|
4921
|
-
var artifactParamsSchema =
|
|
4913
|
+
var artifactMetadataResponseSchema = z35.object({ artifact: publishedArtifactSchema }).strict();
|
|
4914
|
+
var artifactListSchema = z35.object({ artifacts: z35.array(publishedArtifactSchema).max(64) }).strict();
|
|
4915
|
+
var fileLinkQuerySchema = z35.object({ path: pathSchema, raw: z35.literal("1").optional() }).strict();
|
|
4916
|
+
var artifactParamsSchema = z35.object({ id: z35.uuid(), artifactId: z35.uuid() });
|
|
4922
4917
|
|
|
4923
4918
|
// ../contract/src/discovery.ts
|
|
4924
|
-
import { z as
|
|
4925
|
-
var hostDiscoveryRequestSchema =
|
|
4926
|
-
|
|
4927
|
-
|
|
4919
|
+
import { z as z36 } from "zod";
|
|
4920
|
+
var hostDiscoveryRequestSchema = z36.discriminatedUnion("kind", [
|
|
4921
|
+
z36.object({ kind: z36.literal("runners") }).strict(),
|
|
4922
|
+
z36.object({ kind: z36.literal("models"), runner: modelDiscoveryRunnerSchema }).strict()
|
|
4928
4923
|
]);
|
|
4929
|
-
var discoveryRequestSchema =
|
|
4924
|
+
var discoveryRequestSchema = z36.discriminatedUnion("kind", [
|
|
4930
4925
|
...hostDiscoveryRequestSchema.options,
|
|
4931
|
-
|
|
4926
|
+
z36.object({ kind: z36.literal("tasks"), all: z36.boolean().optional(), offset: z36.number().int().min(0).max(Number.MAX_SAFE_INTEGER).optional() }).strict()
|
|
4932
4927
|
]);
|
|
4933
4928
|
var discoveredRunnerSchema = providerStatusSchema.omit({ provider: true, profileId: true }).extend({ runner: modelDiscoveryRunnerSchema });
|
|
4934
|
-
var discoveredRunnersSchema =
|
|
4935
|
-
scope:
|
|
4936
|
-
runners:
|
|
4937
|
-
});
|
|
4938
|
-
var discoveredTasksSchema =
|
|
4939
|
-
tasks:
|
|
4940
|
-
id:
|
|
4941
|
-
title:
|
|
4929
|
+
var discoveredRunnersSchema = z36.object({
|
|
4930
|
+
scope: z36.literal("host-default-account"),
|
|
4931
|
+
runners: z36.array(discoveredRunnerSchema)
|
|
4932
|
+
});
|
|
4933
|
+
var discoveredTasksSchema = z36.object({
|
|
4934
|
+
tasks: z36.array(z36.object({
|
|
4935
|
+
id: z36.string(),
|
|
4936
|
+
title: z36.string(),
|
|
4942
4937
|
runner: runnerSchema.optional(),
|
|
4943
4938
|
status: runStatusSchema,
|
|
4944
|
-
attention:
|
|
4945
|
-
attentionLabel:
|
|
4946
|
-
accepts:
|
|
4947
|
-
reason:
|
|
4939
|
+
attention: z36.enum(["permission", "error", "waiting", "running", "unseen", "none"]),
|
|
4940
|
+
attentionLabel: z36.string(),
|
|
4941
|
+
accepts: z36.boolean(),
|
|
4942
|
+
reason: z36.string().optional()
|
|
4948
4943
|
})).max(32),
|
|
4949
|
-
nextOffset:
|
|
4944
|
+
nextOffset: z36.number().int().nonnegative().optional()
|
|
4950
4945
|
});
|
|
4951
|
-
var discoveryResponseSchema =
|
|
4946
|
+
var discoveryResponseSchema = z36.union([discoveredRunnersSchema, runnerModelCatalogResponseSchema, discoveredTasksSchema]);
|
|
4952
4947
|
|
|
4953
4948
|
// ../contract/src/live.ts
|
|
4954
|
-
import { z as
|
|
4949
|
+
import { z as z37 } from "zod";
|
|
4955
4950
|
|
|
4956
4951
|
// ../contract/src/live-limits.ts
|
|
4957
4952
|
var LIVE_RUN_LIMIT = 32;
|
|
@@ -4959,44 +4954,44 @@ var LIVE_EVENT_LIMIT = 256;
|
|
|
4959
4954
|
var LIVE_BYTE_LIMIT = 1024 * 1024;
|
|
4960
4955
|
|
|
4961
4956
|
// ../contract/src/live.ts
|
|
4962
|
-
var liveRunDemandSchema =
|
|
4963
|
-
projectId:
|
|
4957
|
+
var liveRunDemandSchema = z37.object({
|
|
4958
|
+
projectId: z37.string().min(1).max(128).regex(/^[a-zA-Z0-9_-]+$/),
|
|
4964
4959
|
runId: runIdParamSchema.shape.id,
|
|
4965
4960
|
cursor: runHistoryCursorSchema.optional(),
|
|
4966
|
-
afterSeq:
|
|
4961
|
+
afterSeq: z37.number().int().nonnegative().safe()
|
|
4967
4962
|
});
|
|
4968
|
-
var liveRunsRequestSchema =
|
|
4969
|
-
runs:
|
|
4963
|
+
var liveRunsRequestSchema = z37.object({
|
|
4964
|
+
runs: z37.array(liveRunDemandSchema).min(1).max(LIVE_RUN_LIMIT)
|
|
4970
4965
|
}).refine(({ runs }) => new Set(runs.map((r) => `${r.projectId}/${r.runId}`)).size === runs.length, {
|
|
4971
4966
|
message: "duplicate run demand"
|
|
4972
4967
|
});
|
|
4973
4968
|
var identity = liveRunDemandSchema.pick({ projectId: true, runId: true });
|
|
4974
4969
|
var liveRunErrorSchema = identity.extend({
|
|
4975
|
-
type:
|
|
4976
|
-
status:
|
|
4977
|
-
error:
|
|
4970
|
+
type: z37.enum(["error", "reset"]),
|
|
4971
|
+
status: z37.union([z37.literal(400), z37.literal(404), z37.literal(409), z37.literal(413), z37.literal(503)]),
|
|
4972
|
+
error: z37.string()
|
|
4978
4973
|
});
|
|
4979
4974
|
var liveRunBatchSchema = identity.extend({
|
|
4980
|
-
type:
|
|
4981
|
-
events:
|
|
4975
|
+
type: z37.literal("batch"),
|
|
4976
|
+
events: z37.array(runHistoryEventSchema).max(LIVE_EVENT_LIMIT),
|
|
4982
4977
|
cursor: runHistoryCursorSchema,
|
|
4983
|
-
afterSeq:
|
|
4984
|
-
hasMore:
|
|
4985
|
-
});
|
|
4986
|
-
var liveRunBatchResultSchema =
|
|
4987
|
-
var liveRunBatchResponseSchema =
|
|
4988
|
-
generation:
|
|
4989
|
-
results:
|
|
4990
|
-
});
|
|
4991
|
-
var liveRunFrameSchema =
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
identity.extend({ type:
|
|
4978
|
+
afterSeq: z37.number().int().nonnegative(),
|
|
4979
|
+
hasMore: z37.boolean()
|
|
4980
|
+
});
|
|
4981
|
+
var liveRunBatchResultSchema = z37.union([liveRunBatchSchema, liveRunErrorSchema]);
|
|
4982
|
+
var liveRunBatchResponseSchema = z37.object({
|
|
4983
|
+
generation: z37.string(),
|
|
4984
|
+
results: z37.array(liveRunBatchResultSchema)
|
|
4985
|
+
});
|
|
4986
|
+
var liveRunFrameSchema = z37.union([
|
|
4987
|
+
z37.object({ type: z37.literal("ready"), generation: z37.string() }),
|
|
4988
|
+
z37.object({ type: z37.literal("ping") }),
|
|
4989
|
+
identity.extend({ type: z37.literal("event"), name: z37.enum(["run-event", "ui-event"]), event: runHistoryEventSchema }),
|
|
4995
4990
|
liveRunErrorSchema
|
|
4996
4991
|
]);
|
|
4997
4992
|
|
|
4998
4993
|
// ../contract/src/activity.ts
|
|
4999
|
-
import { z as
|
|
4994
|
+
import { z as z38 } from "zod";
|
|
5000
4995
|
var ACTIVITY_RATE_SECONDS = 30;
|
|
5001
4996
|
var ACTIVITY_TEXT_MAX = 500;
|
|
5002
4997
|
var ACTIVITY_ERROR_MAX = 200;
|
|
@@ -5004,144 +4999,144 @@ var ACTIVITY_TOOL_TITLE_MAX = 160;
|
|
|
5004
4999
|
var ACTIVITY_CHECKS_MAX = 100;
|
|
5005
5000
|
var ACTIVITY_CHECK_NAME_MAX = 100;
|
|
5006
5001
|
var ACTIVITY_CLOSED_WINDOW_MS = 3e4;
|
|
5007
|
-
var iso =
|
|
5008
|
-
var count =
|
|
5009
|
-
var runId =
|
|
5002
|
+
var iso = z38.iso.datetime();
|
|
5003
|
+
var count = z38.number().int().nonnegative();
|
|
5004
|
+
var runId = z38.string().min(1);
|
|
5010
5005
|
var ACTIVITY_TOOL_KINDS = ["read", "edit", "delete", "move", "search", "execute", "think", "fetch", "task", "plan", "other"];
|
|
5011
|
-
var activityToolSchema =
|
|
5012
|
-
title:
|
|
5013
|
-
toolKind:
|
|
5014
|
-
status:
|
|
5006
|
+
var activityToolSchema = z38.object({
|
|
5007
|
+
title: z38.string().max(ACTIVITY_TOOL_TITLE_MAX),
|
|
5008
|
+
toolKind: z38.enum(ACTIVITY_TOOL_KINDS),
|
|
5009
|
+
status: z38.enum(["pending", "running", "completed", "failed", "declined"]),
|
|
5015
5010
|
startedAt: iso,
|
|
5016
5011
|
endedAt: iso.optional()
|
|
5017
5012
|
}).strict();
|
|
5018
|
-
var activityCheckBucketSchema =
|
|
5019
|
-
var activityPrProgressSchema =
|
|
5020
|
-
checks:
|
|
5021
|
-
counts:
|
|
5022
|
-
truncated:
|
|
5013
|
+
var activityCheckBucketSchema = z38.enum(["pass", "fail", "pending", "skipping", "cancel"]);
|
|
5014
|
+
var activityPrProgressSchema = z38.object({
|
|
5015
|
+
checks: z38.array(z38.object({ name: z38.string().max(ACTIVITY_CHECK_NAME_MAX), bucket: activityCheckBucketSchema }).strict()).max(ACTIVITY_CHECKS_MAX),
|
|
5016
|
+
counts: z38.object({ pass: count, fail: count, pending: count, skipping: count, cancel: count }).strict(),
|
|
5017
|
+
truncated: z38.literal(true).optional()
|
|
5023
5018
|
}).strict();
|
|
5024
|
-
var activityWaitSchema =
|
|
5025
|
-
|
|
5026
|
-
kind:
|
|
5019
|
+
var activityWaitSchema = z38.discriminatedUnion("kind", [
|
|
5020
|
+
z38.object({
|
|
5021
|
+
kind: z38.literal("human"),
|
|
5027
5022
|
since: iso,
|
|
5028
|
-
detail:
|
|
5023
|
+
detail: z38.object({
|
|
5029
5024
|
/** The ask card's first question. */
|
|
5030
|
-
question:
|
|
5025
|
+
question: z38.string().max(ACTIVITY_TEXT_MAX).optional(),
|
|
5031
5026
|
/** `question`: an open question; `turn-end`: Squawk's `no-wait` wait; `budget`: the
|
|
5032
5027
|
* automatic-wake budget is spent; `completion`: Squawk's completion gate. */
|
|
5033
|
-
reason:
|
|
5028
|
+
reason: z38.enum(["question", "turn-end", "budget", "completion"]),
|
|
5034
5029
|
/** Inputs not delivered yet, when there are any. */
|
|
5035
|
-
queuedMessages:
|
|
5030
|
+
queuedMessages: z38.number().int().positive().optional()
|
|
5036
5031
|
}).strict()
|
|
5037
5032
|
}).strict(),
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
kind:
|
|
5033
|
+
z38.object({ kind: z38.literal("usage-limit"), detail: z38.object({ resumeAt: z38.string() }).strict() }).strict(),
|
|
5034
|
+
z38.object({
|
|
5035
|
+
kind: z38.literal("workers"),
|
|
5041
5036
|
since: iso,
|
|
5042
5037
|
deadline: iso.optional(),
|
|
5043
|
-
detail:
|
|
5038
|
+
detail: z38.object({
|
|
5044
5039
|
/** `computeWaitingOn`'s count: the unanswered targets, summed over the entries. */
|
|
5045
5040
|
owed: count,
|
|
5046
5041
|
/** Targets named and targets settled, summed over the entries. */
|
|
5047
5042
|
total: count,
|
|
5048
5043
|
settled: count,
|
|
5049
5044
|
/** Every open entry waits on request replies. */
|
|
5050
|
-
replies:
|
|
5045
|
+
replies: z38.literal(true).optional(),
|
|
5051
5046
|
/** Only when one entry is open. */
|
|
5052
5047
|
mode: workerWaitModeSchema.optional(),
|
|
5053
5048
|
/** Who owes the awaited replies, each once. */
|
|
5054
|
-
recipientRunIds:
|
|
5049
|
+
recipientRunIds: z38.array(runId)
|
|
5055
5050
|
}).strict()
|
|
5056
5051
|
}).strict(),
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
kind:
|
|
5052
|
+
z38.object({ kind: z38.literal("peers"), since: iso, deadline: iso, detail: z38.object({ peerRunIds: z38.array(runId) }).strict() }).strict(),
|
|
5053
|
+
z38.object({ kind: z38.literal("subagents"), since: iso, deadline: iso, detail: z38.object({ running: count }).strict() }).strict(),
|
|
5054
|
+
z38.object({
|
|
5055
|
+
kind: z38.literal("pr"),
|
|
5061
5056
|
since: iso,
|
|
5062
5057
|
deadline: iso,
|
|
5063
|
-
detail:
|
|
5064
|
-
number:
|
|
5058
|
+
detail: z38.object({
|
|
5059
|
+
number: z38.number().int().positive(),
|
|
5065
5060
|
target: prWaitUntilSchema,
|
|
5066
5061
|
/** Check progress, while the CI progress registry holds some for this wait. */
|
|
5067
5062
|
checks: activityPrProgressSchema.shape.checks.optional(),
|
|
5068
5063
|
counts: activityPrProgressSchema.shape.counts.optional(),
|
|
5069
|
-
truncated:
|
|
5064
|
+
truncated: z38.literal(true).optional()
|
|
5070
5065
|
}).strict()
|
|
5071
5066
|
}).strict(),
|
|
5072
|
-
|
|
5073
|
-
|
|
5067
|
+
z38.object({ kind: z38.literal("process"), since: iso, deadline: iso, detail: z38.object({ pid: z38.number().int(), note: z38.string().optional() }).strict() }).strict(),
|
|
5068
|
+
z38.object({ kind: z38.literal("timer"), since: iso, deadline: iso, detail: z38.object({ wakeAt: iso, note: z38.string().optional() }).strict() }).strict()
|
|
5074
5069
|
]);
|
|
5075
5070
|
var activityRunShape = {
|
|
5076
5071
|
runId,
|
|
5077
5072
|
/** The display title: `titleSummary ?? title`. */
|
|
5078
|
-
title:
|
|
5073
|
+
title: z38.string(),
|
|
5079
5074
|
status: runStatusSchema,
|
|
5080
5075
|
/** The `deriveAttention` rung id, never a label. */
|
|
5081
|
-
rung:
|
|
5076
|
+
rung: z38.enum(ATTENTION_RUNGS),
|
|
5082
5077
|
runner: runnerSchema.optional(),
|
|
5083
|
-
model:
|
|
5084
|
-
currentStepId:
|
|
5085
|
-
startedAt:
|
|
5078
|
+
model: z38.string().optional(),
|
|
5079
|
+
currentStepId: z38.string().optional(),
|
|
5080
|
+
startedAt: z38.string().optional(),
|
|
5086
5081
|
wait: activityWaitSchema.optional(),
|
|
5087
5082
|
tool: activityToolSchema.optional(),
|
|
5088
5083
|
/** Tool calls started per second, oldest first. */
|
|
5089
|
-
rate:
|
|
5084
|
+
rate: z38.array(count).length(ACTIVITY_RATE_SECONDS),
|
|
5090
5085
|
/** One line of `RunRecord.error`. */
|
|
5091
|
-
error:
|
|
5086
|
+
error: z38.string().max(ACTIVITY_ERROR_MAX).optional()
|
|
5092
5087
|
};
|
|
5093
|
-
var activityWorkerSchema =
|
|
5088
|
+
var activityWorkerSchema = z38.object({
|
|
5094
5089
|
...activityRunShape,
|
|
5095
5090
|
/** The worker's current execution revision. */
|
|
5096
5091
|
revision: count,
|
|
5097
5092
|
/** The parent holds a collected result for this revision. */
|
|
5098
|
-
collected:
|
|
5093
|
+
collected: z38.boolean()
|
|
5099
5094
|
}).strict();
|
|
5100
|
-
var activityRunSchema =
|
|
5101
|
-
var activityRequestSchema =
|
|
5102
|
-
requestId:
|
|
5103
|
-
relationship:
|
|
5095
|
+
var activityRunSchema = z38.object({ ...activityRunShape, workers: z38.array(activityWorkerSchema) }).strict();
|
|
5096
|
+
var activityRequestSchema = z38.object({
|
|
5097
|
+
requestId: z38.uuid(),
|
|
5098
|
+
relationship: z38.enum(["family", "peer"]),
|
|
5104
5099
|
senderRunId: runId,
|
|
5105
5100
|
recipientRunId: runId,
|
|
5106
|
-
text:
|
|
5107
|
-
senderTitle:
|
|
5108
|
-
recipientTitle:
|
|
5101
|
+
text: z38.string().max(ACTIVITY_TEXT_MAX),
|
|
5102
|
+
senderTitle: z38.string().optional(),
|
|
5103
|
+
recipientTitle: z38.string().optional(),
|
|
5109
5104
|
createdAt: iso,
|
|
5110
5105
|
deadline: iso.optional()
|
|
5111
5106
|
}).strict();
|
|
5112
|
-
var activityClosedRequestSchema =
|
|
5113
|
-
requestId:
|
|
5107
|
+
var activityClosedRequestSchema = z38.object({
|
|
5108
|
+
requestId: z38.uuid(),
|
|
5114
5109
|
senderRunId: runId,
|
|
5115
5110
|
recipientRunId: runId,
|
|
5116
5111
|
status: requestOutcomeSchema.shape.status,
|
|
5117
5112
|
observedAt: iso
|
|
5118
5113
|
}).strict();
|
|
5119
|
-
var activityProjectSchema =
|
|
5120
|
-
projectId:
|
|
5121
|
-
name:
|
|
5114
|
+
var activityProjectSchema = z38.object({
|
|
5115
|
+
projectId: z38.string(),
|
|
5116
|
+
name: z38.string(),
|
|
5122
5117
|
/** False for a project this process has not loaded: its lists are empty because nothing was read. */
|
|
5123
|
-
loaded:
|
|
5118
|
+
loaded: z38.boolean(),
|
|
5124
5119
|
/** The project is loaded but its run store cannot open: the failure its project routes answer.
|
|
5125
5120
|
* The lists are empty because nothing could be read, not because nothing runs. */
|
|
5126
|
-
unavailable:
|
|
5121
|
+
unavailable: z38.object({ status: z38.union([z38.literal(404), z38.literal(409), z38.literal(503)]), error: z38.string() }).strict().optional(),
|
|
5127
5122
|
/** Root tasks in review: the summary chip (D8). */
|
|
5128
5123
|
inReview: count,
|
|
5129
|
-
tasks:
|
|
5130
|
-
requests:
|
|
5131
|
-
closed:
|
|
5124
|
+
tasks: z38.array(activityRunSchema),
|
|
5125
|
+
requests: z38.array(activityRequestSchema),
|
|
5126
|
+
closed: z38.array(activityClosedRequestSchema)
|
|
5132
5127
|
}).strict();
|
|
5133
|
-
var activitySnapshotSchema =
|
|
5128
|
+
var activitySnapshotSchema = z38.object({
|
|
5134
5129
|
/** The server clock; the client ticks ages from it. */
|
|
5135
5130
|
generatedAt: iso,
|
|
5136
5131
|
/** One entry, or every visible project for the global read. */
|
|
5137
|
-
projects:
|
|
5132
|
+
projects: z38.array(activityProjectSchema)
|
|
5138
5133
|
}).strict();
|
|
5139
|
-
var activityQuerySchema =
|
|
5140
|
-
project:
|
|
5134
|
+
var activityQuerySchema = z38.object({
|
|
5135
|
+
project: z38.union([z38.literal("default"), z38.string().regex(PROJECT_ID_PATTERN)]).optional()
|
|
5141
5136
|
});
|
|
5142
5137
|
|
|
5143
5138
|
// ../contract/src/live-coordination.ts
|
|
5144
|
-
import { z as
|
|
5139
|
+
import { z as z39 } from "zod";
|
|
5145
5140
|
var LIVE_PROTOCOL = 3;
|
|
5146
5141
|
var LIVE_WORKER_NAME = "cezar-live-v3";
|
|
5147
5142
|
var LEASE_MS = 15e3;
|
|
@@ -5150,111 +5145,111 @@ function allowedLiveRead(path) {
|
|
|
5150
5145
|
if (!path.startsWith("/api/v1/") || path.includes("#") || /[\\\r\n]/.test(path)) return false;
|
|
5151
5146
|
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);
|
|
5152
5147
|
}
|
|
5153
|
-
var liveDemandSchema =
|
|
5154
|
-
|
|
5155
|
-
liveRunDemandSchema.extend({ kind:
|
|
5156
|
-
|
|
5148
|
+
var liveDemandSchema = z39.discriminatedUnion("kind", [
|
|
5149
|
+
z39.object({ kind: z39.literal("workspace") }),
|
|
5150
|
+
liveRunDemandSchema.extend({ kind: z39.literal("run") }),
|
|
5151
|
+
z39.object({ kind: z39.literal("topic"), topic: z39.string().min(1).max(128) }),
|
|
5157
5152
|
// Preserve server-directed cadence (settled references use ten minutes). Only
|
|
5158
5153
|
// bound the timer itself: larger delays overflow setTimeout into a tight loop.
|
|
5159
|
-
|
|
5154
|
+
z39.object({ kind: z39.literal("read"), path: z39.string().max(4096).refine(allowedLiveRead), intervalMs: z39.number().int().min(1e3).max(2147483647) })
|
|
5160
5155
|
]);
|
|
5161
|
-
var liveEntrySchema =
|
|
5162
|
-
var envelope =
|
|
5163
|
-
var ownerInputSchema =
|
|
5156
|
+
var liveEntrySchema = z39.object({ id: z39.string().min(1).max(128), demand: liveDemandSchema });
|
|
5157
|
+
var envelope = z39.object({ version: z39.literal(LIVE_PROTOCOL), documentId: z39.string().min(1).max(128), epoch: z39.number().int().nonnegative() });
|
|
5158
|
+
var ownerInputSchema = z39.discriminatedUnion("type", [
|
|
5164
5159
|
envelope.extend({
|
|
5165
|
-
type:
|
|
5166
|
-
entries:
|
|
5160
|
+
type: z39.literal("sync"),
|
|
5161
|
+
entries: z39.array(liveEntrySchema).max(64),
|
|
5167
5162
|
/** The document knows no workspace stream generation (its `ready` was lost, for example to
|
|
5168
5163
|
* an epoch change): send it the stream's `ready` again (hearsay-tools/cezarion#2729). */
|
|
5169
|
-
workspaceReady:
|
|
5164
|
+
workspaceReady: z39.literal(true).optional()
|
|
5170
5165
|
}).refine((value) => new Set(value.entries.map((e) => e.id)).size === value.entries.length),
|
|
5171
|
-
envelope.extend({ type:
|
|
5172
|
-
envelope.extend({ type:
|
|
5166
|
+
envelope.extend({ type: z39.literal("ack"), id: z39.string(), seq: z39.number().int().nonnegative() }),
|
|
5167
|
+
envelope.extend({ type: z39.literal("refresh"), id: z39.string() })
|
|
5173
5168
|
]);
|
|
5174
|
-
var wireFrameSchema =
|
|
5175
|
-
var ownerOutputSchema =
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5169
|
+
var wireFrameSchema = z39.object({ event: z39.string(), data: z39.string(), id: z39.string() });
|
|
5170
|
+
var ownerOutputSchema = z39.discriminatedUnion("type", [
|
|
5171
|
+
z39.object({ type: z39.literal("unavailable"), version: z39.literal(LIVE_PROTOCOL), epoch: z39.number(), reason: z39.string() }),
|
|
5172
|
+
z39.object({ type: z39.literal("hello"), version: z39.literal(LIVE_PROTOCOL) }),
|
|
5173
|
+
z39.object({ type: z39.literal("alive"), version: z39.literal(LIVE_PROTOCOL), epoch: z39.number() }),
|
|
5174
|
+
z39.object({ type: z39.literal("frame"), version: z39.literal(LIVE_PROTOCOL), epoch: z39.number(), id: z39.string(), frame: z39.union([wireFrameSchema, liveRunFrameSchema]) }),
|
|
5175
|
+
z39.object({ type: z39.literal("value"), version: z39.literal(LIVE_PROTOCOL), epoch: z39.number(), id: z39.string(), value: z39.unknown(), error: z39.string().optional() }),
|
|
5176
|
+
z39.object({ type: z39.literal("reset"), version: z39.literal(LIVE_PROTOCOL), epoch: z39.number(), id: z39.string(), reason: z39.string() })
|
|
5182
5177
|
]);
|
|
5183
5178
|
var runKey = (run) => `${run.projectId}/${run.runId}`;
|
|
5184
5179
|
|
|
5185
5180
|
// ../contract/src/workspace-events.ts
|
|
5186
|
-
import { z as
|
|
5187
|
-
var workspaceEventsQuerySchema =
|
|
5188
|
-
runs:
|
|
5181
|
+
import { z as z40 } from "zod";
|
|
5182
|
+
var workspaceEventsQuerySchema = z40.object({
|
|
5183
|
+
runs: z40.literal("summary").optional()
|
|
5189
5184
|
});
|
|
5190
|
-
var projectStamp =
|
|
5191
|
-
var frameSeq =
|
|
5192
|
-
var workspaceRunSummaryEventSchema =
|
|
5185
|
+
var projectStamp = z40.string().min(1);
|
|
5186
|
+
var frameSeq = z40.number().int().positive();
|
|
5187
|
+
var workspaceRunSummaryEventSchema = z40.object({
|
|
5193
5188
|
project: projectStamp,
|
|
5194
5189
|
seq: frameSeq,
|
|
5195
5190
|
run: runSummarySchema,
|
|
5196
|
-
relationships:
|
|
5191
|
+
relationships: z40.string().min(1)
|
|
5197
5192
|
});
|
|
5198
|
-
var workspaceRunDeletedEventSchema =
|
|
5193
|
+
var workspaceRunDeletedEventSchema = z40.object({
|
|
5199
5194
|
project: projectStamp,
|
|
5200
5195
|
seq: frameSeq,
|
|
5201
|
-
id:
|
|
5196
|
+
id: z40.string().min(1)
|
|
5202
5197
|
});
|
|
5203
|
-
var workspaceReadyEventSchema =
|
|
5204
|
-
generation:
|
|
5205
|
-
seq:
|
|
5198
|
+
var workspaceReadyEventSchema = z40.object({
|
|
5199
|
+
generation: z40.string().min(1),
|
|
5200
|
+
seq: z40.number().int().nonnegative()
|
|
5206
5201
|
});
|
|
5207
|
-
var workspaceUsageEventSchema =
|
|
5202
|
+
var workspaceUsageEventSchema = z40.object({
|
|
5208
5203
|
project: projectStamp,
|
|
5209
|
-
usage:
|
|
5204
|
+
usage: z40.record(z40.string(), processUsageSchema)
|
|
5210
5205
|
});
|
|
5211
|
-
var runsIndexResponseSchema =
|
|
5206
|
+
var runsIndexResponseSchema = z40.object({
|
|
5212
5207
|
/** Newest first, across every registered project: each project's window
|
|
5213
5208
|
* (hearsay-tools/cezarion#864) — every unarchived root run, plus its newest `perProjectLimit`
|
|
5214
5209
|
* archived root runs. Owned workers are never included. Older archived runs are reached
|
|
5215
5210
|
* through `GET /workspace/runs-search`. */
|
|
5216
|
-
runs:
|
|
5211
|
+
runs: z40.array(runIndexEntrySchema),
|
|
5217
5212
|
/** Additive: absent statuses mean "nothing warm", never "nothing to show". */
|
|
5218
5213
|
referenceStatuses: referenceStatusesByProjectSchema,
|
|
5219
5214
|
/** How many archived root runs each project contributes at most. Unarchived roots are never cut. */
|
|
5220
|
-
perProjectLimit:
|
|
5215
|
+
perProjectLimit: z40.number(),
|
|
5221
5216
|
/** Ids of the projects that had more archived root runs than `perProjectLimit`. */
|
|
5222
|
-
truncated:
|
|
5217
|
+
truncated: z40.array(z40.string()),
|
|
5223
5218
|
/** The server process that answered: the workspace stream's `ready.generation`. An `eventSeq`
|
|
5224
5219
|
* compares only within one generation. */
|
|
5225
|
-
generation:
|
|
5220
|
+
generation: z40.string().min(1),
|
|
5226
5221
|
/** The last workspace stream `seq` this answer includes: every `run-summary` and `run-deleted`
|
|
5227
5222
|
* frame at or below it is already in `runs`; a frame above it is newer than the snapshot. */
|
|
5228
|
-
eventSeq:
|
|
5223
|
+
eventSeq: z40.number().int().nonnegative()
|
|
5229
5224
|
});
|
|
5230
5225
|
|
|
5231
5226
|
// ../contract/src/permissions.ts
|
|
5232
|
-
import { z as
|
|
5233
|
-
var permissionOptionKindSchema =
|
|
5234
|
-
var permissionOptionSchema =
|
|
5235
|
-
id:
|
|
5236
|
-
label:
|
|
5227
|
+
import { z as z41 } from "zod";
|
|
5228
|
+
var permissionOptionKindSchema = z41.enum(["allow_once", "allow_always", "reject_once", "reject_always"]);
|
|
5229
|
+
var permissionOptionSchema = z41.object({
|
|
5230
|
+
id: z41.string().min(1).max(128),
|
|
5231
|
+
label: z41.string().min(1),
|
|
5237
5232
|
kind: permissionOptionKindSchema
|
|
5238
5233
|
}).strict();
|
|
5239
|
-
var permissionRequestedSchema =
|
|
5240
|
-
type:
|
|
5241
|
-
requestId:
|
|
5242
|
-
itemId:
|
|
5243
|
-
title:
|
|
5244
|
-
details:
|
|
5245
|
-
options:
|
|
5234
|
+
var permissionRequestedSchema = z41.object({
|
|
5235
|
+
type: z41.literal("permission.requested"),
|
|
5236
|
+
requestId: z41.string().min(1).max(128),
|
|
5237
|
+
itemId: z41.string().optional(),
|
|
5238
|
+
title: z41.string().min(1),
|
|
5239
|
+
details: z41.string().optional(),
|
|
5240
|
+
options: z41.array(permissionOptionSchema).min(1).refine((options) => new Set(options.map((option) => option.id)).size === options.length)
|
|
5246
5241
|
}).strict();
|
|
5247
|
-
var permissionResolvedSchema =
|
|
5248
|
-
type:
|
|
5249
|
-
requestId:
|
|
5250
|
-
optionId:
|
|
5251
|
-
reason:
|
|
5242
|
+
var permissionResolvedSchema = z41.object({
|
|
5243
|
+
type: z41.literal("permission.resolved"),
|
|
5244
|
+
requestId: z41.string().min(1).max(128),
|
|
5245
|
+
optionId: z41.string().optional(),
|
|
5246
|
+
reason: z41.string().optional()
|
|
5252
5247
|
}).strict();
|
|
5253
|
-
var permissionDecisionSchema =
|
|
5254
|
-
requestId:
|
|
5255
|
-
optionId:
|
|
5248
|
+
var permissionDecisionSchema = z41.object({
|
|
5249
|
+
requestId: z41.string().min(1).max(128),
|
|
5250
|
+
optionId: z41.string().min(1).max(128)
|
|
5256
5251
|
}).strict();
|
|
5257
|
-
var permissionDecisionResponseSchema =
|
|
5252
|
+
var permissionDecisionResponseSchema = z41.object({ delivered: z41.literal(true) });
|
|
5258
5253
|
|
|
5259
5254
|
// ../contract/src/defined.ts
|
|
5260
5255
|
function defined(value) {
|
|
@@ -5524,83 +5519,83 @@ function isImagePath(path) {
|
|
|
5524
5519
|
}
|
|
5525
5520
|
|
|
5526
5521
|
// ../contract/src/provider-requests.ts
|
|
5527
|
-
import { z as
|
|
5528
|
-
var providerConnectSchema =
|
|
5522
|
+
import { z as z42 } from "zod";
|
|
5523
|
+
var providerConnectSchema = z42.object({
|
|
5529
5524
|
provider: runnerSchema,
|
|
5530
5525
|
/** Which agent account to sign in (spec 2026-07-29-agent-profiles). Absent = the discovered
|
|
5531
5526
|
* default, which is what every pre-profiles client sends. Without this, "Connect" on a second
|
|
5532
5527
|
* Claude account would open a login for the FIRST one and report success. */
|
|
5533
|
-
profileId:
|
|
5528
|
+
profileId: z42.string().max(64).optional()
|
|
5534
5529
|
}).strict();
|
|
5535
|
-
var createAgentProfileSchema =
|
|
5530
|
+
var createAgentProfileSchema = z42.object({
|
|
5536
5531
|
provider: runnerSchema,
|
|
5537
|
-
label:
|
|
5538
|
-
configDir:
|
|
5532
|
+
label: z42.string().trim().max(200).optional(),
|
|
5533
|
+
configDir: z42.string().trim().min(1).max(4096)
|
|
5539
5534
|
}).strict();
|
|
5540
|
-
var updateAgentProfileSchema =
|
|
5541
|
-
label:
|
|
5542
|
-
configDir:
|
|
5535
|
+
var updateAgentProfileSchema = z42.object({
|
|
5536
|
+
label: z42.string().trim().max(200).optional(),
|
|
5537
|
+
configDir: z42.string().trim().min(1).max(4096).optional()
|
|
5543
5538
|
}).strict().refine(
|
|
5544
5539
|
(value) => value.label !== void 0 || value.configDir !== void 0,
|
|
5545
5540
|
"send label or configDir"
|
|
5546
5541
|
);
|
|
5547
|
-
var selectAgentProfileSchema =
|
|
5548
|
-
projectId:
|
|
5542
|
+
var selectAgentProfileSchema = z42.object({
|
|
5543
|
+
projectId: z42.string().min(1).max(64),
|
|
5549
5544
|
provider: runnerSchema,
|
|
5550
|
-
profileId:
|
|
5545
|
+
profileId: z42.string().max(64).nullable()
|
|
5551
5546
|
}).strict();
|
|
5552
5547
|
var providerParamSchema = runnerSchema;
|
|
5553
|
-
var providerEnabledSchema =
|
|
5554
|
-
var providerRetrySchema =
|
|
5555
|
-
authFailureId:
|
|
5548
|
+
var providerEnabledSchema = z42.object({ enabled: z42.boolean() }).strict();
|
|
5549
|
+
var providerRetrySchema = z42.object({
|
|
5550
|
+
authFailureId: z42.string().min(1).max(128)
|
|
5556
5551
|
}).strict();
|
|
5557
|
-
var providerRouteParamsSchema =
|
|
5558
|
-
var agentProfileRouteParamsSchema =
|
|
5559
|
-
var providerSignInParamsSchema =
|
|
5560
|
-
var providerSignInRedirectSchema =
|
|
5552
|
+
var providerRouteParamsSchema = z42.object({ provider: providerParamSchema });
|
|
5553
|
+
var agentProfileRouteParamsSchema = z42.object({ id: z42.string() });
|
|
5554
|
+
var providerSignInParamsSchema = z42.object({ id: z42.uuid() });
|
|
5555
|
+
var providerSignInRedirectSchema = z42.object({
|
|
5561
5556
|
/** The address the browser landed on after consent, or the code that page shows. */
|
|
5562
|
-
redirectUrl:
|
|
5557
|
+
redirectUrl: z42.string().trim().min(1).max(8192)
|
|
5563
5558
|
}).strict();
|
|
5564
5559
|
|
|
5565
5560
|
// ../contract/src/automation-requests.ts
|
|
5566
|
-
import { z as
|
|
5561
|
+
import { z as z44 } from "zod";
|
|
5567
5562
|
|
|
5568
5563
|
// ../contract/src/automation-storage.ts
|
|
5569
|
-
import { z as
|
|
5570
|
-
var storedAutomationEventSchema =
|
|
5564
|
+
import { z as z43 } from "zod";
|
|
5565
|
+
var storedAutomationEventSchema = z43.enum([
|
|
5571
5566
|
"pull_request.opened",
|
|
5572
5567
|
"issue.opened",
|
|
5573
5568
|
"issue.labeled",
|
|
5574
5569
|
"issue.unlabeled"
|
|
5575
5570
|
]);
|
|
5576
|
-
var boundedString =
|
|
5577
|
-
var stringList =
|
|
5578
|
-
var storedAutomationFiltersSchema =
|
|
5579
|
-
includeExisting:
|
|
5571
|
+
var boundedString = z43.string().trim().min(1).max(200);
|
|
5572
|
+
var stringList = z43.array(boundedString).max(100).optional();
|
|
5573
|
+
var storedAutomationFiltersSchema = z43.object({
|
|
5574
|
+
includeExisting: z43.boolean().optional(),
|
|
5580
5575
|
/** Require an open item and matching live labels before reservation and launch. */
|
|
5581
|
-
requireCurrentLabels:
|
|
5576
|
+
requireCurrentLabels: z43.boolean().optional(),
|
|
5582
5577
|
authors: stringList,
|
|
5583
5578
|
assignees: stringList,
|
|
5584
5579
|
allLabels: stringList,
|
|
5585
5580
|
anyLabels: stringList,
|
|
5586
5581
|
excludeLabels: stringList,
|
|
5587
5582
|
changedLabels: stringList,
|
|
5588
|
-
lookbackDays:
|
|
5589
|
-
maxRecords:
|
|
5583
|
+
lookbackDays: z43.number().int().min(1).max(90).default(7),
|
|
5584
|
+
maxRecords: z43.number().int().min(1).max(100).default(25)
|
|
5590
5585
|
}).passthrough();
|
|
5591
|
-
var storedAutomationTaskSchema =
|
|
5592
|
-
prompt:
|
|
5593
|
-
workflow:
|
|
5594
|
-
steps:
|
|
5586
|
+
var storedAutomationTaskSchema = z43.object({
|
|
5587
|
+
prompt: z43.string().min(1).max(1e5),
|
|
5588
|
+
workflow: z43.string().trim().min(1).max(200).optional(),
|
|
5589
|
+
steps: z43.array(workflowStepDefSchema).min(1).max(100).optional(),
|
|
5595
5590
|
runner: runnerSchema.optional(),
|
|
5596
|
-
model:
|
|
5597
|
-
effort:
|
|
5598
|
-
variants:
|
|
5599
|
-
worktree:
|
|
5600
|
-
autonomous:
|
|
5591
|
+
model: z43.string().trim().min(1).max(200).optional(),
|
|
5592
|
+
effort: z43.string().trim().min(1).max(32).optional(),
|
|
5593
|
+
variants: z43.union([z43.literal(1), z43.literal(2), z43.literal(3)]).optional(),
|
|
5594
|
+
worktree: z43.boolean().optional(),
|
|
5595
|
+
autonomous: z43.boolean().optional(),
|
|
5601
5596
|
...completionControlsShape,
|
|
5602
5597
|
...taskAccessShape,
|
|
5603
|
-
systemPrompt:
|
|
5598
|
+
systemPrompt: z43.string().max(1e5).optional()
|
|
5604
5599
|
}).passthrough().refine((task) => !(task.workflow && task.steps), {
|
|
5605
5600
|
message: "task selects either a named workflow or inline steps, not both"
|
|
5606
5601
|
});
|
|
@@ -5618,122 +5613,122 @@ var fillGithubDefaults = (raw) => {
|
|
|
5618
5613
|
filters: record.filters ?? {}
|
|
5619
5614
|
};
|
|
5620
5615
|
};
|
|
5621
|
-
var storedAutomationDefinitionObjectSchema =
|
|
5622
|
-
id:
|
|
5623
|
-
revision:
|
|
5624
|
-
name:
|
|
5625
|
-
description:
|
|
5626
|
-
enabled:
|
|
5616
|
+
var storedAutomationDefinitionObjectSchema = z43.object({
|
|
5617
|
+
id: z43.string().min(1).max(100),
|
|
5618
|
+
revision: z43.number().int().positive(),
|
|
5619
|
+
name: z43.string().trim().min(1).max(200),
|
|
5620
|
+
description: z43.string().max(2e3).optional(),
|
|
5621
|
+
enabled: z43.boolean().default(false),
|
|
5627
5622
|
/** A definition written before schedules has no `kind`: it is a poll. */
|
|
5628
5623
|
kind: automationKindSchema.default("github"),
|
|
5629
|
-
events:
|
|
5630
|
-
intervalSeconds:
|
|
5624
|
+
events: z43.array(storedAutomationEventSchema).min(1).max(4).optional(),
|
|
5625
|
+
intervalSeconds: z43.number().int().min(60).max(86400).optional(),
|
|
5631
5626
|
filters: storedAutomationFiltersSchema.optional(),
|
|
5632
5627
|
// Passthrough like every other persisted layer: a schedule key a later build adds survives a save here.
|
|
5633
5628
|
schedule: automationScheduleSchema.passthrough().optional(),
|
|
5634
5629
|
task: storedAutomationTaskSchema,
|
|
5635
5630
|
/** `once` schedules only (hearsay-tools/cezarion#1465): the archive record. */
|
|
5636
|
-
archived:
|
|
5637
|
-
at:
|
|
5638
|
-
outcome:
|
|
5639
|
-
runId:
|
|
5640
|
-
receiptId:
|
|
5641
|
-
trigger:
|
|
5631
|
+
archived: z43.object({
|
|
5632
|
+
at: z43.string().datetime(),
|
|
5633
|
+
outcome: z43.enum(["launched", "cancelled"]),
|
|
5634
|
+
runId: z43.string().optional(),
|
|
5635
|
+
receiptId: z43.string().optional(),
|
|
5636
|
+
trigger: z43.enum(["schedule", "late", "manual", "retry"]).optional()
|
|
5642
5637
|
}).passthrough().optional(),
|
|
5643
|
-
createdAt:
|
|
5644
|
-
updatedAt:
|
|
5638
|
+
createdAt: z43.string().datetime(),
|
|
5639
|
+
updatedAt: z43.string().datetime()
|
|
5645
5640
|
}).passthrough().superRefine((definition, ctx) => {
|
|
5646
5641
|
if (definition.kind === "schedule") {
|
|
5647
5642
|
if (!definition.schedule) {
|
|
5648
|
-
ctx.addIssue({ code:
|
|
5643
|
+
ctx.addIssue({ code: z43.ZodIssueCode.custom, path: ["schedule"], message: "a scheduled automation needs a schedule" });
|
|
5649
5644
|
}
|
|
5650
5645
|
return;
|
|
5651
5646
|
}
|
|
5652
5647
|
if (!definition.events?.length) {
|
|
5653
|
-
ctx.addIssue({ code:
|
|
5648
|
+
ctx.addIssue({ code: z43.ZodIssueCode.custom, path: ["events"], message: "a GitHub automation needs at least one event" });
|
|
5654
5649
|
}
|
|
5655
5650
|
if (definition.intervalSeconds === void 0) {
|
|
5656
|
-
ctx.addIssue({ code:
|
|
5651
|
+
ctx.addIssue({ code: z43.ZodIssueCode.custom, path: ["intervalSeconds"], message: "a GitHub automation needs a poll interval" });
|
|
5657
5652
|
}
|
|
5658
5653
|
if (!definition.filters) {
|
|
5659
|
-
ctx.addIssue({ code:
|
|
5654
|
+
ctx.addIssue({ code: z43.ZodIssueCode.custom, path: ["filters"], message: "a GitHub automation needs its bounded filter" });
|
|
5660
5655
|
}
|
|
5661
5656
|
if (definition.events?.some((event) => event === "issue.labeled" || event === "issue.unlabeled") && !definition.filters?.changedLabels?.length) {
|
|
5662
5657
|
ctx.addIssue({
|
|
5663
|
-
code:
|
|
5658
|
+
code: z43.ZodIssueCode.custom,
|
|
5664
5659
|
path: ["filters", "changedLabels"],
|
|
5665
5660
|
message: "changedLabels is required for issue label events"
|
|
5666
5661
|
});
|
|
5667
5662
|
}
|
|
5668
5663
|
});
|
|
5669
|
-
var storedAutomationDefinitionSchema =
|
|
5670
|
-
var storedAutomationDefinitionsFileSchema =
|
|
5671
|
-
version:
|
|
5672
|
-
automations:
|
|
5673
|
-
tombstones:
|
|
5664
|
+
var storedAutomationDefinitionSchema = z43.preprocess(fillGithubDefaults, storedAutomationDefinitionObjectSchema);
|
|
5665
|
+
var storedAutomationDefinitionsFileSchema = z43.object({
|
|
5666
|
+
version: z43.literal(1).default(1),
|
|
5667
|
+
automations: z43.array(z43.unknown()).default([]),
|
|
5668
|
+
tombstones: z43.record(z43.string(), z43.string().datetime()).optional()
|
|
5674
5669
|
}).passthrough();
|
|
5675
|
-
var storedAutomationCursorSchema =
|
|
5676
|
-
timestamp:
|
|
5677
|
-
tieBreaker:
|
|
5670
|
+
var storedAutomationCursorSchema = z43.object({
|
|
5671
|
+
timestamp: z43.string().datetime(),
|
|
5672
|
+
tieBreaker: z43.string().optional()
|
|
5678
5673
|
}).passthrough();
|
|
5679
5674
|
var storedAutomationHistoryScanSchema = automationHistoryScanSchema.extend({
|
|
5680
5675
|
cursor: storedAutomationCursorSchema.optional()
|
|
5681
5676
|
});
|
|
5682
|
-
var storedAutomationRuntimeStateSchema =
|
|
5683
|
-
revision:
|
|
5684
|
-
baselineAt:
|
|
5677
|
+
var storedAutomationRuntimeStateSchema = z43.object({
|
|
5678
|
+
revision: z43.number().int().positive().optional(),
|
|
5679
|
+
baselineAt: z43.string().datetime().optional(),
|
|
5685
5680
|
/** Arming time, independent of a history window's older lower bound. */
|
|
5686
|
-
armedAt:
|
|
5681
|
+
armedAt: z43.string().datetime().optional(),
|
|
5687
5682
|
historyScan: storedAutomationHistoryScanSchema.optional(),
|
|
5688
5683
|
cursor: storedAutomationCursorSchema.optional(),
|
|
5689
|
-
frozenHighWatermark: storedAutomationCursorSchema.extend({ tieBreaker:
|
|
5690
|
-
backlogAfter: storedAutomationCursorSchema.extend({ tieBreaker:
|
|
5691
|
-
nextCheckAt:
|
|
5692
|
-
lastSuccessAt:
|
|
5684
|
+
frozenHighWatermark: storedAutomationCursorSchema.extend({ tieBreaker: z43.string() }).optional(),
|
|
5685
|
+
backlogAfter: storedAutomationCursorSchema.extend({ tieBreaker: z43.string() }).optional(),
|
|
5686
|
+
nextCheckAt: z43.string().datetime().optional(),
|
|
5687
|
+
lastSuccessAt: z43.string().datetime().optional(),
|
|
5693
5688
|
/** schedule kind: the next occurrence's instant and the last fired one's. */
|
|
5694
|
-
nextRunAt:
|
|
5695
|
-
lastRunAt:
|
|
5696
|
-
etags:
|
|
5697
|
-
backoffUntil:
|
|
5698
|
-
consecutiveFailures:
|
|
5689
|
+
nextRunAt: z43.string().datetime().optional(),
|
|
5690
|
+
lastRunAt: z43.string().datetime().optional(),
|
|
5691
|
+
etags: z43.record(z43.string(), z43.string()).optional(),
|
|
5692
|
+
backoffUntil: z43.string().datetime().optional(),
|
|
5693
|
+
consecutiveFailures: z43.number().int().nonnegative().optional(),
|
|
5699
5694
|
...automationLastErrorShape,
|
|
5700
5695
|
/** once schedule: it stopped without a task — the launch failed, or it started past its cutoff. */
|
|
5701
|
-
onceOutcome:
|
|
5696
|
+
onceOutcome: z43.enum(["failed", "missed"]).optional()
|
|
5702
5697
|
}).passthrough();
|
|
5703
|
-
var storedAutomationStateFileSchema =
|
|
5704
|
-
version:
|
|
5705
|
-
states:
|
|
5698
|
+
var storedAutomationStateFileSchema = z43.object({
|
|
5699
|
+
version: z43.literal(1).default(1),
|
|
5700
|
+
states: z43.record(z43.string(), storedAutomationRuntimeStateSchema).default({})
|
|
5706
5701
|
}).passthrough();
|
|
5707
|
-
var storedAutomationReceiptSchema =
|
|
5708
|
-
receiptId:
|
|
5709
|
-
receiptKey:
|
|
5710
|
-
eventId:
|
|
5711
|
-
automationId:
|
|
5712
|
-
revision:
|
|
5713
|
-
status:
|
|
5714
|
-
runId:
|
|
5715
|
-
observedAt:
|
|
5716
|
-
updatedAt:
|
|
5717
|
-
error:
|
|
5702
|
+
var storedAutomationReceiptSchema = z43.object({
|
|
5703
|
+
receiptId: z43.string().min(1),
|
|
5704
|
+
receiptKey: z43.string().min(1),
|
|
5705
|
+
eventId: z43.string().min(1),
|
|
5706
|
+
automationId: z43.string().min(1),
|
|
5707
|
+
revision: z43.number().int().positive(),
|
|
5708
|
+
status: z43.enum(["reserved", "launched", "launch-error", "released"]),
|
|
5709
|
+
runId: z43.string().optional(),
|
|
5710
|
+
observedAt: z43.string().datetime(),
|
|
5711
|
+
updatedAt: z43.string().datetime(),
|
|
5712
|
+
error: z43.string().max(2e3).optional(),
|
|
5718
5713
|
/** schedule kind: the occurrence this receipt reserved, so a retry can fire it again. */
|
|
5719
|
-
occurrenceAt:
|
|
5720
|
-
candidate:
|
|
5721
|
-
eventId:
|
|
5714
|
+
occurrenceAt: z43.string().datetime().optional(),
|
|
5715
|
+
candidate: z43.object({
|
|
5716
|
+
eventId: z43.string(),
|
|
5722
5717
|
event: storedAutomationEventSchema,
|
|
5723
|
-
timestamp:
|
|
5724
|
-
tieBreaker:
|
|
5725
|
-
repo:
|
|
5726
|
-
nodeId:
|
|
5727
|
-
number:
|
|
5728
|
-
title:
|
|
5729
|
-
url:
|
|
5730
|
-
author:
|
|
5731
|
-
assignees:
|
|
5732
|
-
labels:
|
|
5733
|
-
changedLabel:
|
|
5718
|
+
timestamp: z43.string().datetime(),
|
|
5719
|
+
tieBreaker: z43.string(),
|
|
5720
|
+
repo: z43.string(),
|
|
5721
|
+
nodeId: z43.string(),
|
|
5722
|
+
number: z43.number().int().positive(),
|
|
5723
|
+
title: z43.string().max(500),
|
|
5724
|
+
url: z43.string().url(),
|
|
5725
|
+
author: z43.string().max(200),
|
|
5726
|
+
assignees: z43.array(z43.string().max(200)).max(100),
|
|
5727
|
+
labels: z43.array(z43.string().max(200)).max(100),
|
|
5728
|
+
changedLabel: z43.string().max(200).optional()
|
|
5734
5729
|
}).passthrough().optional()
|
|
5735
5730
|
}).passthrough();
|
|
5736
|
-
var storedAutomationLogResultSchema =
|
|
5731
|
+
var storedAutomationLogResultSchema = z43.enum([
|
|
5737
5732
|
"launched",
|
|
5738
5733
|
"no-match",
|
|
5739
5734
|
"duplicate",
|
|
@@ -5749,24 +5744,24 @@ var storedAutomationLogResultSchema = z44.enum([
|
|
|
5749
5744
|
// once schedule
|
|
5750
5745
|
"missed"
|
|
5751
5746
|
]);
|
|
5752
|
-
var storedAutomationLogRecordSchema =
|
|
5753
|
-
seq:
|
|
5754
|
-
ts:
|
|
5755
|
-
automationId:
|
|
5756
|
-
revision:
|
|
5747
|
+
var storedAutomationLogRecordSchema = z43.object({
|
|
5748
|
+
seq: z43.number().int().positive(),
|
|
5749
|
+
ts: z43.string().datetime(),
|
|
5750
|
+
automationId: z43.string().min(1),
|
|
5751
|
+
revision: z43.number().int().positive(),
|
|
5757
5752
|
event: storedAutomationEventSchema.optional(),
|
|
5758
5753
|
result: storedAutomationLogResultSchema,
|
|
5759
|
-
reason:
|
|
5760
|
-
durationMs:
|
|
5761
|
-
receiptId:
|
|
5762
|
-
runId:
|
|
5763
|
-
githubNumber:
|
|
5764
|
-
githubTitle:
|
|
5765
|
-
githubUrl:
|
|
5766
|
-
rateLimit:
|
|
5767
|
-
bucket:
|
|
5768
|
-
remaining:
|
|
5769
|
-
resetAt:
|
|
5754
|
+
reason: z43.string().max(2e3).optional(),
|
|
5755
|
+
durationMs: z43.number().int().nonnegative().optional(),
|
|
5756
|
+
receiptId: z43.string().optional(),
|
|
5757
|
+
runId: z43.string().optional(),
|
|
5758
|
+
githubNumber: z43.number().int().positive().optional(),
|
|
5759
|
+
githubTitle: z43.string().max(500).optional(),
|
|
5760
|
+
githubUrl: z43.string().url().optional(),
|
|
5761
|
+
rateLimit: z43.object({
|
|
5762
|
+
bucket: z43.enum(["core", "search"]),
|
|
5763
|
+
remaining: z43.number().int().nonnegative().optional(),
|
|
5764
|
+
resetAt: z43.string().datetime().optional()
|
|
5770
5765
|
}).passthrough().optional()
|
|
5771
5766
|
}).passthrough();
|
|
5772
5767
|
function storedIsOnceSchedule(definition) {
|
|
@@ -5780,210 +5775,210 @@ function storedIsScheduleAutomation(definition) {
|
|
|
5780
5775
|
}
|
|
5781
5776
|
|
|
5782
5777
|
// ../contract/src/automation-requests.ts
|
|
5783
|
-
var automationEditableSchema =
|
|
5784
|
-
name:
|
|
5785
|
-
description:
|
|
5786
|
-
enabled:
|
|
5778
|
+
var automationEditableSchema = z44.object({
|
|
5779
|
+
name: z44.string().trim().min(1).max(200),
|
|
5780
|
+
description: z44.string().max(2e3).optional(),
|
|
5781
|
+
enabled: z44.boolean().optional(),
|
|
5787
5782
|
kind: automationKindSchema.optional(),
|
|
5788
|
-
events:
|
|
5789
|
-
intervalSeconds:
|
|
5783
|
+
events: z44.array(automationEventSchema).min(1).max(4).optional(),
|
|
5784
|
+
intervalSeconds: z44.number().int().min(60).max(86400).optional(),
|
|
5790
5785
|
filters: storedAutomationFiltersSchema.optional(),
|
|
5791
5786
|
schedule: automationScheduleSchema.optional(),
|
|
5792
|
-
task:
|
|
5787
|
+
task: z44.strictObject(storedAutomationTaskSchema.shape).omit({ variants: true }).refine((task) => !(task.workflow && task.steps), {
|
|
5793
5788
|
message: "task selects either a named workflow or inline steps, not both"
|
|
5794
5789
|
})
|
|
5795
5790
|
}).strict();
|
|
5796
|
-
var automationCreateSchema = automationEditableSchema.extend({ enable:
|
|
5797
|
-
var automationUpdateSchema = automationEditableSchema.extend({ expectedRevision:
|
|
5798
|
-
var automationCheckRequestSchema =
|
|
5799
|
-
var automationLogQuerySchema =
|
|
5800
|
-
automationId:
|
|
5791
|
+
var automationCreateSchema = automationEditableSchema.extend({ enable: z44.boolean().optional() });
|
|
5792
|
+
var automationUpdateSchema = automationEditableSchema.extend({ expectedRevision: z44.number().int().positive() });
|
|
5793
|
+
var automationCheckRequestSchema = z44.object({ mode: z44.enum(["preview", "execute"]) }).strict();
|
|
5794
|
+
var automationLogQuerySchema = z44.object({
|
|
5795
|
+
automationId: z44.string().optional(),
|
|
5801
5796
|
result: automationLogResultSchema.optional(),
|
|
5802
5797
|
event: automationEventSchema.optional(),
|
|
5803
|
-
since:
|
|
5804
|
-
cursor:
|
|
5798
|
+
since: z44.string().datetime().optional(),
|
|
5799
|
+
cursor: z44.coerce.number().int().positive().optional(),
|
|
5805
5800
|
// Optional, not `.default(100)`: `AutomationStore.logs` already clamps `limit ?? 100` into
|
|
5806
5801
|
// 1..100, so the default here was a second copy of it — and a defaulted key is REQUIRED in the
|
|
5807
5802
|
// request type `queryZodValidator` publishes (see validators.ts on why the request side falls
|
|
5808
5803
|
// back to the schema's output), which would have made every caller send a `?limit=` this route
|
|
5809
5804
|
// never needed.
|
|
5810
|
-
limit:
|
|
5805
|
+
limit: z44.coerce.number().int().min(1).max(100).optional()
|
|
5811
5806
|
});
|
|
5812
5807
|
|
|
5813
5808
|
// ../contract/src/workflow-requests.ts
|
|
5814
|
-
import { z as
|
|
5815
|
-
var planSchema =
|
|
5809
|
+
import { z as z45 } from "zod";
|
|
5810
|
+
var planSchema = z45.object({
|
|
5816
5811
|
// Same bound as `createRunInputSchema.task` — this flows into `planChain` (legacy reference 429).
|
|
5817
|
-
task:
|
|
5812
|
+
task: z45.string().trim().min(1).max(1e5, "must be at most 100000 characters"),
|
|
5818
5813
|
/** The account the planner runs on, as `POST /runs` takes it: absent follows the project's
|
|
5819
5814
|
* selection (hearsay-tools/squawk#4116). */
|
|
5820
|
-
agentProfile:
|
|
5815
|
+
agentProfile: z45.string().max(64).optional()
|
|
5821
5816
|
});
|
|
5822
|
-
var parseWorkflowSchema =
|
|
5823
|
-
yaml:
|
|
5817
|
+
var parseWorkflowSchema = z45.object({
|
|
5818
|
+
yaml: z45.string().min(1).max(1e5)
|
|
5824
5819
|
});
|
|
5825
5820
|
|
|
5826
5821
|
// ../contract/src/ui-state-requests.ts
|
|
5827
|
-
import { z as
|
|
5822
|
+
import { z as z46 } from "zod";
|
|
5828
5823
|
var SKILL_USAGE_MAX_ENTRIES = 200;
|
|
5829
5824
|
var UI_STATE_MAX_KEYS = 200;
|
|
5830
5825
|
var uiStateSchema2 = uiStateSchema.extend({
|
|
5831
5826
|
// null records a quick task with no selected skill or workflow.
|
|
5832
|
-
lastTask:
|
|
5833
|
-
source:
|
|
5834
|
-
ref:
|
|
5827
|
+
lastTask: z46.object({
|
|
5828
|
+
source: z46.enum(["workflow", "skill"]),
|
|
5829
|
+
ref: z46.string().min(1).max(200)
|
|
5835
5830
|
}).nullable().optional(),
|
|
5836
5831
|
// Most recent source choices, newest first.
|
|
5837
|
-
recentSources:
|
|
5838
|
-
|
|
5839
|
-
source:
|
|
5840
|
-
ref:
|
|
5832
|
+
recentSources: z46.array(
|
|
5833
|
+
z46.object({
|
|
5834
|
+
source: z46.enum(["workflow", "skill"]),
|
|
5835
|
+
ref: z46.string().min(1).max(200)
|
|
5841
5836
|
})
|
|
5842
5837
|
).max(50).optional(),
|
|
5843
|
-
skillUsage:
|
|
5838
|
+
skillUsage: z46.record(z46.string().min(1).max(200), z46.number().int().min(0).max(1e6)).refine((usage) => Object.keys(usage).length <= SKILL_USAGE_MAX_ENTRIES, {
|
|
5844
5839
|
message: `skillUsage must have at most ${SKILL_USAGE_MAX_ENTRIES} entries`
|
|
5845
5840
|
}).optional(),
|
|
5846
|
-
promptTemplates:
|
|
5847
|
-
|
|
5848
|
-
id:
|
|
5849
|
-
label:
|
|
5850
|
-
text:
|
|
5841
|
+
promptTemplates: z46.array(
|
|
5842
|
+
z46.object({
|
|
5843
|
+
id: z46.string().min(1).max(64),
|
|
5844
|
+
label: z46.string().trim().min(1).max(80),
|
|
5845
|
+
text: z46.string().trim().min(1).max(2e3),
|
|
5851
5846
|
// Skill names this template auto-applies for. Optional and additive: templates
|
|
5852
5847
|
// written before this key existed keep validating, and stay manual-only.
|
|
5853
|
-
skills:
|
|
5848
|
+
skills: z46.array(z46.string().trim().min(1).max(200)).max(50).optional()
|
|
5854
5849
|
})
|
|
5855
5850
|
).max(50).optional()
|
|
5856
5851
|
}).passthrough();
|
|
5857
5852
|
function capUiStateKeys(data, ctx) {
|
|
5858
5853
|
if (Object.keys(data).length > UI_STATE_MAX_KEYS) {
|
|
5859
|
-
ctx.addIssue({ code:
|
|
5854
|
+
ctx.addIssue({ code: z46.ZodIssueCode.custom, message: `ui-state has too many keys (max ${UI_STATE_MAX_KEYS})` });
|
|
5860
5855
|
}
|
|
5861
5856
|
}
|
|
5862
5857
|
var uiStateBody = uiStateSchema2.superRefine(capUiStateKeys);
|
|
5863
5858
|
|
|
5864
5859
|
// ../contract/src/run-requests.ts
|
|
5865
|
-
import { z as
|
|
5866
|
-
var queuedMessagePatchSchema =
|
|
5867
|
-
text:
|
|
5868
|
-
images:
|
|
5860
|
+
import { z as z47 } from "zod";
|
|
5861
|
+
var queuedMessagePatchSchema = z47.object({
|
|
5862
|
+
text: z47.string().max(1e5).optional(),
|
|
5863
|
+
images: z47.array(attachmentInputSchema).max(4).optional()
|
|
5869
5864
|
}).refine((m) => m.text !== void 0 || m.images !== void 0, {
|
|
5870
5865
|
message: "message edit needs text or attachments"
|
|
5871
5866
|
});
|
|
5872
|
-
var continueSchema =
|
|
5873
|
-
text:
|
|
5874
|
-
images:
|
|
5867
|
+
var continueSchema = z47.object({
|
|
5868
|
+
text: z47.string().max(1e5, "must be at most 100000 characters").optional(),
|
|
5869
|
+
images: z47.array(attachmentInputSchema).max(4).optional(),
|
|
5875
5870
|
runner: runnerSchema.optional(),
|
|
5876
|
-
model:
|
|
5871
|
+
model: z47.string().max(200).optional(),
|
|
5877
5872
|
/** Reasoning-effort pin (legacy reference 45). Omitted keeps the run's pin; empty string clears it. */
|
|
5878
|
-
effort:
|
|
5873
|
+
effort: z47.string().max(32).optional()
|
|
5879
5874
|
});
|
|
5880
|
-
var archiveSchema =
|
|
5881
|
-
archived:
|
|
5875
|
+
var archiveSchema = z47.object({
|
|
5876
|
+
archived: z47.boolean().optional()
|
|
5882
5877
|
});
|
|
5883
|
-
var openInSchema =
|
|
5878
|
+
var openInSchema = z47.object({
|
|
5884
5879
|
// A short bound (legacy reference 429): matched against a downstream allowlist, so an editor id is never long.
|
|
5885
|
-
target:
|
|
5886
|
-
path:
|
|
5880
|
+
target: z47.string().trim().min(1, "target required").max(200),
|
|
5881
|
+
path: z47.string().max(1e3).optional()
|
|
5887
5882
|
});
|
|
5888
5883
|
|
|
5889
5884
|
// ../contract/src/query-requests.ts
|
|
5890
|
-
import { z as
|
|
5891
|
-
var queryValue =
|
|
5892
|
-
var refreshQuery =
|
|
5893
|
-
var waitQuery =
|
|
5894
|
-
var queryRunnerSchema =
|
|
5895
|
-
var modelDiscoveryQuerySchema =
|
|
5896
|
-
var strictRefreshQuerySchema =
|
|
5897
|
-
var browseQuerySchema =
|
|
5898
|
-
var worktreeFilesQuerySchema =
|
|
5899
|
-
var commitQuerySchema =
|
|
5885
|
+
import { z as z48 } from "zod";
|
|
5886
|
+
var queryValue = z48.union([z48.string(), z48.array(z48.string()).transform((v) => v[0])]).optional();
|
|
5887
|
+
var refreshQuery = z48.object({ refresh: queryValue });
|
|
5888
|
+
var waitQuery = z48.object({ wait: queryValue });
|
|
5889
|
+
var queryRunnerSchema = z48.union([z48.string(), z48.array(z48.string()).transform((v) => v[0])]).pipe(modelDiscoveryRunnerSchema);
|
|
5890
|
+
var modelDiscoveryQuerySchema = z48.object({ runner: queryRunnerSchema, profileId: z48.string().max(64).optional() });
|
|
5891
|
+
var strictRefreshQuerySchema = z48.object({ refresh: queryValue.refine((v) => v === void 0 || v === "1") });
|
|
5892
|
+
var browseQuerySchema = z48.object({ path: queryValue, showHidden: queryValue });
|
|
5893
|
+
var worktreeFilesQuerySchema = z48.object({ path: queryValue, raw: queryValue });
|
|
5894
|
+
var commitQuerySchema = z48.object({ structured: queryValue });
|
|
5900
5895
|
|
|
5901
5896
|
// ../contract/src/github-requests.ts
|
|
5902
|
-
import { z as
|
|
5903
|
-
var mergeNumberParams =
|
|
5904
|
-
var prChangesParams =
|
|
5905
|
-
var prChangesQuery =
|
|
5906
|
-
var mergeBodySchema =
|
|
5907
|
-
method:
|
|
5908
|
-
expectedHeadSha:
|
|
5909
|
-
overrideRules:
|
|
5897
|
+
import { z as z49 } from "zod";
|
|
5898
|
+
var mergeNumberParams = z49.object({ number: z49.coerce.number().int().positive() });
|
|
5899
|
+
var prChangesParams = z49.object({ number: z49.coerce.number().int().positive().safe() });
|
|
5900
|
+
var prChangesQuery = z49.object({ refresh: queryValue.refine((v) => v === void 0 || v === "1") });
|
|
5901
|
+
var mergeBodySchema = z49.object({
|
|
5902
|
+
method: z49.enum(["merge", "squash", "rebase"]),
|
|
5903
|
+
expectedHeadSha: z49.string().regex(/^[0-9a-f]{40}$/),
|
|
5904
|
+
overrideRules: z49.boolean().optional().default(false)
|
|
5910
5905
|
}).strict();
|
|
5911
|
-
var githubChecksQuerySchema =
|
|
5912
|
-
var githubRefsQuerySchema =
|
|
5906
|
+
var githubChecksQuerySchema = z49.object({ prs: z49.string().min(1) });
|
|
5907
|
+
var githubRefsQuerySchema = z49.object({ prs: z49.string().optional(), issues: z49.string().optional() });
|
|
5913
5908
|
|
|
5914
5909
|
// ../contract/src/repo-requests.ts
|
|
5915
|
-
import { z as
|
|
5916
|
-
var gitCommitSchema =
|
|
5917
|
-
message:
|
|
5910
|
+
import { z as z50 } from "zod";
|
|
5911
|
+
var gitCommitSchema = z50.object({
|
|
5912
|
+
message: z50.string().trim().min(1, "must not be empty").max(5e3)
|
|
5918
5913
|
});
|
|
5919
|
-
var reclaimBodySchema =
|
|
5920
|
-
var repoBranchSchema =
|
|
5921
|
-
name:
|
|
5922
|
-
from:
|
|
5914
|
+
var reclaimBodySchema = z50.object({}).passthrough();
|
|
5915
|
+
var repoBranchSchema = z50.object({
|
|
5916
|
+
name: z50.string().trim().min(1).max(200),
|
|
5917
|
+
from: z50.string().trim().min(1).max(200).optional()
|
|
5923
5918
|
});
|
|
5924
|
-
var reclaimRunParamsSchema =
|
|
5919
|
+
var reclaimRunParamsSchema = z50.object({ runId: z50.string().min(1) });
|
|
5925
5920
|
|
|
5926
5921
|
// ../contract/src/config-requests.ts
|
|
5927
|
-
import { z as
|
|
5922
|
+
import { z as z51 } from "zod";
|
|
5928
5923
|
var setConfigSchema = setConfigInputSchema.extend({
|
|
5929
|
-
systemPrompt:
|
|
5924
|
+
systemPrompt: z51.string().trim().max(2e4, "must be at most 20000 characters").nullable().optional()
|
|
5930
5925
|
});
|
|
5931
|
-
var setAgentConfigSchema =
|
|
5932
|
-
content:
|
|
5933
|
-
version:
|
|
5926
|
+
var setAgentConfigSchema = z51.object({
|
|
5927
|
+
content: z51.string().max(2e6),
|
|
5928
|
+
version: z51.string().nullable()
|
|
5934
5929
|
});
|
|
5935
5930
|
|
|
5936
5931
|
// ../contract/src/workflow-file.ts
|
|
5937
|
-
import { z as
|
|
5938
|
-
var workflowFileSchema =
|
|
5939
|
-
name:
|
|
5940
|
-
description:
|
|
5941
|
-
steps:
|
|
5942
|
-
skills:
|
|
5932
|
+
import { z as z52 } from "zod";
|
|
5933
|
+
var workflowFileSchema = z52.object({
|
|
5934
|
+
name: z52.string().min(1),
|
|
5935
|
+
description: z52.string().optional(),
|
|
5936
|
+
steps: z52.array(workflowStepDefSchema).min(1).optional(),
|
|
5937
|
+
skills: z52.array(z52.string().trim().min(1)).min(1).optional()
|
|
5943
5938
|
}).refine((d) => Boolean(d.steps) !== Boolean(d.skills), {
|
|
5944
5939
|
message: 'a workflow lists either "steps" or "skills", not both'
|
|
5945
5940
|
});
|
|
5946
5941
|
|
|
5947
5942
|
// ../contract/src/reports.ts
|
|
5948
|
-
import { z as
|
|
5943
|
+
import { z as z53 } from "zod";
|
|
5949
5944
|
var REPORTS_QUERY_MAX = 1e3;
|
|
5950
|
-
var cursorSchema =
|
|
5951
|
-
var reportsQuerySchema =
|
|
5952
|
-
q:
|
|
5945
|
+
var cursorSchema = z53.string().min(1).max(1024);
|
|
5946
|
+
var reportsQuerySchema = z53.object({
|
|
5947
|
+
q: z53.string().max(REPORTS_QUERY_MAX).optional(),
|
|
5953
5948
|
before: cursorSchema.optional(),
|
|
5954
|
-
limit:
|
|
5949
|
+
limit: z53.string().regex(/^(?:[1-9]|[1-9][0-9]|100)$/).transform(Number).optional()
|
|
5955
5950
|
}).strict();
|
|
5956
|
-
var reportSchema =
|
|
5957
|
-
id:
|
|
5958
|
-
runId:
|
|
5959
|
-
name:
|
|
5960
|
-
title:
|
|
5961
|
-
createdAt:
|
|
5962
|
-
size:
|
|
5963
|
-
taskTitle:
|
|
5951
|
+
var reportSchema = z53.object({
|
|
5952
|
+
id: z53.uuid(),
|
|
5953
|
+
runId: z53.uuid(),
|
|
5954
|
+
name: z53.string(),
|
|
5955
|
+
title: z53.string(),
|
|
5956
|
+
createdAt: z53.iso.datetime(),
|
|
5957
|
+
size: z53.number().int().nonnegative(),
|
|
5958
|
+
taskTitle: z53.string(),
|
|
5964
5959
|
taskStatus: runStatusSchema
|
|
5965
5960
|
}).strict();
|
|
5966
|
-
var reportsResponseSchema =
|
|
5967
|
-
reports:
|
|
5961
|
+
var reportsResponseSchema = z53.object({
|
|
5962
|
+
reports: z53.array(reportSchema),
|
|
5968
5963
|
nextCursor: cursorSchema.nullable(),
|
|
5969
5964
|
// Counts all matching cached rows with readable source summaries before page content checks.
|
|
5970
5965
|
// A missing-content row dropped while filling this page can lower total on the next request.
|
|
5971
|
-
total:
|
|
5966
|
+
total: z53.number().int().nonnegative()
|
|
5972
5967
|
}).strict();
|
|
5973
|
-
var reportsStateSchema =
|
|
5974
|
-
epoch:
|
|
5975
|
-
generation:
|
|
5976
|
-
metadataGeneration:
|
|
5968
|
+
var reportsStateSchema = z53.object({
|
|
5969
|
+
epoch: z53.uuid(),
|
|
5970
|
+
generation: z53.number().int().nonnegative(),
|
|
5971
|
+
metadataGeneration: z53.number().int().nonnegative()
|
|
5977
5972
|
}).strict();
|
|
5978
|
-
var reportsMetadataSchema =
|
|
5979
|
-
runId:
|
|
5980
|
-
taskTitle:
|
|
5973
|
+
var reportsMetadataSchema = z53.object({
|
|
5974
|
+
runId: z53.uuid(),
|
|
5975
|
+
taskTitle: z53.string(),
|
|
5981
5976
|
taskStatus: runStatusSchema
|
|
5982
5977
|
}).strict();
|
|
5983
|
-
var reportsFrameSchema =
|
|
5984
|
-
reportsStateSchema.extend({ type:
|
|
5985
|
-
reportsStateSchema.extend({ type:
|
|
5986
|
-
reportsStateSchema.extend({ type:
|
|
5978
|
+
var reportsFrameSchema = z53.discriminatedUnion("type", [
|
|
5979
|
+
reportsStateSchema.extend({ type: z53.literal("snapshot") }),
|
|
5980
|
+
reportsStateSchema.extend({ type: z53.literal("content") }),
|
|
5981
|
+
reportsStateSchema.extend({ type: z53.literal("metadata"), runs: z53.array(reportsMetadataSchema) })
|
|
5987
5982
|
]);
|
|
5988
5983
|
|
|
5989
5984
|
// ../contract/src/report-title.ts
|
|
@@ -6005,89 +6000,89 @@ function controlLocation(control, separator = " \u2192 ") {
|
|
|
6005
6000
|
}
|
|
6006
6001
|
|
|
6007
6002
|
// ../contract/src/home-recovery.ts
|
|
6008
|
-
import { z as
|
|
6003
|
+
import { z as z54 } from "zod";
|
|
6009
6004
|
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))$/;
|
|
6010
|
-
var homeFileSchema =
|
|
6011
|
-
var recoveryFile =
|
|
6005
|
+
var homeFileSchema = z54.string().regex(HOME_FILE_PATTERN);
|
|
6006
|
+
var recoveryFile = z54.object({
|
|
6012
6007
|
file: homeFileSchema,
|
|
6013
|
-
detectedAt:
|
|
6014
|
-
canRestore:
|
|
6008
|
+
detectedAt: z54.iso.datetime(),
|
|
6009
|
+
canRestore: z54.boolean()
|
|
6015
6010
|
});
|
|
6016
6011
|
var HOME_RECOVERY_REASONS = ["reset", "outside-write", "legacy-change"];
|
|
6017
|
-
var homeRecoveryFileSchema =
|
|
6018
|
-
recoveryFile.extend({ reason:
|
|
6019
|
-
recoveryFile.extend({ reason:
|
|
6020
|
-
recoveryFile.extend({ reason:
|
|
6012
|
+
var homeRecoveryFileSchema = z54.discriminatedUnion("reason", [
|
|
6013
|
+
recoveryFile.extend({ reason: z54.literal("reset") }),
|
|
6014
|
+
recoveryFile.extend({ reason: z54.literal("outside-write") }),
|
|
6015
|
+
recoveryFile.extend({ reason: z54.literal("legacy-change"), canImport: z54.boolean() })
|
|
6021
6016
|
]);
|
|
6022
|
-
var homeRecoverySchema =
|
|
6017
|
+
var homeRecoverySchema = z54.object({ files: z54.array(homeRecoveryFileSchema) });
|
|
6023
6018
|
function filterHomeRecoveryReasons(value, reasons) {
|
|
6024
6019
|
if (!value || typeof value !== "object" || !("files" in value) || !Array.isArray(value.files)) return value;
|
|
6025
6020
|
return { ...value, files: value.files.filter((row) => !(row && typeof row === "object" && "reason" in row && typeof row.reason === "string" && !reasons.includes(row.reason))) };
|
|
6026
6021
|
}
|
|
6027
|
-
var homeRecoveryReaderSchema =
|
|
6022
|
+
var homeRecoveryReaderSchema = z54.preprocess(
|
|
6028
6023
|
(value) => filterHomeRecoveryReasons(value, HOME_RECOVERY_REASONS),
|
|
6029
6024
|
homeRecoverySchema
|
|
6030
6025
|
);
|
|
6031
|
-
var homeRecoveryActionSchema =
|
|
6026
|
+
var homeRecoveryActionSchema = z54.object({ file: homeFileSchema, detectedAt: z54.iso.datetime() }).strict();
|
|
6032
6027
|
|
|
6033
6028
|
// ../contract/src/runner-skills.ts
|
|
6034
|
-
import { z as
|
|
6035
|
-
var runnerSkillScopeSchema =
|
|
6036
|
-
var runnerSkillsQuerySchema =
|
|
6029
|
+
import { z as z55 } from "zod";
|
|
6030
|
+
var runnerSkillScopeSchema = z55.enum(["repo", "user", "system", "other"]);
|
|
6031
|
+
var runnerSkillsQuerySchema = z55.object({
|
|
6037
6032
|
runner: queryRunnerSchema,
|
|
6038
|
-
account:
|
|
6039
|
-
refresh:
|
|
6033
|
+
account: z55.string().min(1).max(64).optional(),
|
|
6034
|
+
refresh: z55.literal("1").optional()
|
|
6040
6035
|
});
|
|
6041
|
-
var runnerSkillSchema =
|
|
6042
|
-
id:
|
|
6043
|
-
name:
|
|
6044
|
-
description:
|
|
6036
|
+
var runnerSkillSchema = z55.object({
|
|
6037
|
+
id: z55.string(),
|
|
6038
|
+
name: z55.string(),
|
|
6039
|
+
description: z55.string().optional(),
|
|
6045
6040
|
scope: runnerSkillScopeSchema.optional(),
|
|
6046
|
-
plugin:
|
|
6047
|
-
path:
|
|
6041
|
+
plugin: z55.string().optional(),
|
|
6042
|
+
path: z55.string().optional()
|
|
6048
6043
|
});
|
|
6049
|
-
var runnerSkillProblemSchema =
|
|
6050
|
-
var runnerSkillListSchema =
|
|
6044
|
+
var runnerSkillProblemSchema = z55.object({ message: z55.string(), path: z55.string().optional() });
|
|
6045
|
+
var runnerSkillListSchema = z55.object({
|
|
6051
6046
|
runner: runnerSchema,
|
|
6052
|
-
skills:
|
|
6053
|
-
problems:
|
|
6054
|
-
source:
|
|
6055
|
-
reason:
|
|
6047
|
+
skills: z55.array(runnerSkillSchema),
|
|
6048
|
+
problems: z55.array(runnerSkillProblemSchema),
|
|
6049
|
+
source: z55.enum(["live", "cache", "unavailable"]),
|
|
6050
|
+
reason: z55.string().optional()
|
|
6056
6051
|
});
|
|
6057
6052
|
|
|
6058
6053
|
// ../contract/src/runner-install.ts
|
|
6059
|
-
import { z as
|
|
6060
|
-
var runnerInstallParamsSchema =
|
|
6061
|
-
var runnerInstallActionSchema =
|
|
6062
|
-
var runnerInstallPhaseSchema =
|
|
6063
|
-
var runnerInstallStatusSchema =
|
|
6064
|
-
supported:
|
|
6065
|
-
installedVersion:
|
|
6066
|
-
latestVersion:
|
|
6067
|
-
updateAvailable:
|
|
6054
|
+
import { z as z56 } from "zod";
|
|
6055
|
+
var runnerInstallParamsSchema = z56.object({ runner: runnerSchema });
|
|
6056
|
+
var runnerInstallActionSchema = z56.object({ action: z56.enum(["check", "install", "update", "remove"]) });
|
|
6057
|
+
var runnerInstallPhaseSchema = z56.enum(["idle", "checking", "downloading", "verifying", "extracting", "activating", "removing", "failed"]);
|
|
6058
|
+
var runnerInstallStatusSchema = z56.object({
|
|
6059
|
+
supported: z56.boolean(),
|
|
6060
|
+
installedVersion: z56.string().nullable(),
|
|
6061
|
+
latestVersion: z56.string().nullable(),
|
|
6062
|
+
updateAvailable: z56.boolean(),
|
|
6068
6063
|
phase: runnerInstallPhaseSchema,
|
|
6069
|
-
error:
|
|
6064
|
+
error: z56.string().nullable()
|
|
6070
6065
|
});
|
|
6071
6066
|
|
|
6072
6067
|
// ../contract/src/automation-tool.ts
|
|
6073
|
-
import { z as
|
|
6068
|
+
import { z as z57 } from "zod";
|
|
6074
6069
|
var repeatingAutomationInputSchema = automationCreateSchema.omit({ enabled: true, enable: true }).refine((value) => value.schedule?.type !== "once", "Use cezar_schedule_task for a one-time schedule.");
|
|
6075
|
-
var id =
|
|
6076
|
-
var automationToolRequestSchema =
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6070
|
+
var id = z57.string().min(1).max(100);
|
|
6071
|
+
var automationToolRequestSchema = z57.discriminatedUnion("action", [
|
|
6072
|
+
z57.object({ action: z57.literal("create"), definition: repeatingAutomationInputSchema }).strict(),
|
|
6073
|
+
z57.object({ action: z57.literal("show"), id }).strict(),
|
|
6074
|
+
z57.object({ action: z57.literal("preview"), id }).strict(),
|
|
6075
|
+
z57.object({ action: z57.literal("enable"), id, explicit: z57.boolean().optional() }).strict()
|
|
6081
6076
|
]);
|
|
6082
|
-
var automationToolAnswerSchema =
|
|
6083
|
-
|
|
6084
|
-
ok:
|
|
6077
|
+
var automationToolAnswerSchema = z57.union([
|
|
6078
|
+
z57.object({
|
|
6079
|
+
ok: z57.literal(true),
|
|
6085
6080
|
automation: storedAutomationDefinitionSchema,
|
|
6086
|
-
url:
|
|
6087
|
-
next_run_at:
|
|
6088
|
-
preview:
|
|
6081
|
+
url: z57.string().optional(),
|
|
6082
|
+
next_run_at: z57.string().optional(),
|
|
6083
|
+
preview: z57.object({ matches: z57.number().int().nonnegative(), truncated: z57.boolean() }).optional()
|
|
6089
6084
|
}),
|
|
6090
|
-
|
|
6085
|
+
z57.object({ ok: z57.literal(false), code: z57.enum([...scheduledTaskRefusalCodeSchema.options, "explicit_required", "preview_required"]), message: z57.string() })
|
|
6091
6086
|
]);
|
|
6092
6087
|
export {
|
|
6093
6088
|
ACTIVITY_CHECKS_MAX,
|
|
@@ -6133,13 +6128,11 @@ export {
|
|
|
6133
6128
|
LIVE_WORKER_NAME,
|
|
6134
6129
|
MAX_CONVERSATION_REQUEST_SECONDS,
|
|
6135
6130
|
MAX_RESUME_REQUEST_SECONDS,
|
|
6136
|
-
NOTE_MAX,
|
|
6137
6131
|
ONCE_MAX_LATEST_START_MINUTES,
|
|
6138
6132
|
ONCE_MIN_LATEST_START_MINUTES,
|
|
6139
6133
|
ONCE_PAST_DUE_MESSAGE,
|
|
6140
6134
|
PEER_WAIT_DEFAULT_SECONDS,
|
|
6141
6135
|
PEER_WAIT_MAX_SECONDS,
|
|
6142
|
-
PID_MIN,
|
|
6143
6136
|
PREVIEW_MAX_PIXEL_RATIO,
|
|
6144
6137
|
PROCESS_EXIT_FILE_MAX,
|
|
6145
6138
|
PROCESS_TIMEOUT_DEFAULT_SECONDS,
|