@hearsay-tools/squawk 0.18.0-dev.8063 → 0.18.0-dev.8072
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/contract/conversations.d.ts +2 -0
- package/dist/contract/delegation.d.ts +57 -0
- package/dist/contract/index.js +187 -144
- package/dist/contract/run-predicates.d.ts +9 -0
- package/dist/contract/usage-limit-hold.d.ts +7 -0
- package/dist/contract/waits.d.ts +2 -2
- package/dist/delegation/cli.js +8 -4
- package/dist/delegation/cli.js.map +1 -1
- package/dist/delegation/conversation-send.js +15 -4
- package/dist/delegation/conversation-send.js.map +1 -1
- package/dist/delegation/conversations.js +6 -0
- package/dist/delegation/conversations.js.map +1 -1
- package/dist/delegation/execution-identity.d.ts +53 -9
- package/dist/delegation/execution-identity.js +165 -9
- package/dist/delegation/execution-identity.js.map +1 -1
- package/dist/delegation/park-notice.d.ts +29 -3
- package/dist/delegation/park-notice.js +32 -4
- package/dist/delegation/park-notice.js.map +1 -1
- package/dist/delegation/provision.js +3 -3
- package/dist/delegation/provision.js.map +1 -1
- package/dist/delegation/routes.d.ts +19 -0
- package/dist/delegation/service.d.ts +5 -0
- package/dist/delegation/service.js +93 -14
- package/dist/delegation/service.js.map +1 -1
- package/dist/delegation/transport.d.ts +23 -4
- package/dist/delegation/worker-executions.d.ts +2 -0
- package/dist/delegation/worker-executions.js +5 -1
- package/dist/delegation/worker-executions.js.map +1 -1
- package/dist/runs/ports.d.ts +2 -0
- package/dist/server/provider-action-gate.d.ts +8 -0
- package/dist/server/provider-action-gate.js +19 -2
- package/dist/server/provider-action-gate.js.map +1 -1
- package/dist/server/run-accounts.d.ts +4 -3
- package/dist/server/run-accounts.js +20 -5
- package/dist/server/run-accounts.js.map +1 -1
- package/dist/server/server.d.ts +14 -0
- package/dist/server/server.js +3 -9
- package/dist/server/server.js.map +1 -1
- package/dist/workflows/continuation-admission.d.ts +7 -0
- package/dist/workflows/continuation-admission.js +21 -8
- package/dist/workflows/continuation-admission.js.map +1 -1
- package/dist/workflows/input-acknowledgement.d.ts +24 -24
- package/dist/workflows/run/continuation-acceptance.d.ts +5 -1
- package/dist/workflows/run/continuation-acceptance.js +94 -29
- package/dist/workflows/run/continuation-acceptance.js.map +1 -1
- package/dist/workflows/run/launch-read-resolver.d.ts +6 -0
- package/dist/workflows/run/launch-read-resolver.js +13 -2
- package/dist/workflows/run/launch-read-resolver.js.map +1 -1
- package/dist/workflows/run/run-settlement.js +6 -0
- package/dist/workflows/run/run-settlement.js.map +1 -1
- package/dist/workflows/run/worker-questions.d.ts +4 -0
- package/dist/workflows/run/worker-questions.js +42 -8
- package/dist/workflows/run/worker-questions.js.map +1 -1
- package/dist/workflows/step-kind-ids.d.ts +9 -0
- package/dist/workflows/step-kind-ids.js +10 -0
- package/dist/workflows/step-kind-ids.js.map +1 -0
- package/dist/workflows/wait-kind-ids.d.ts +11 -0
- package/dist/workflows/wait-kind-ids.js +34 -0
- package/dist/workflows/wait-kind-ids.js.map +1 -0
- package/package.json +4 -4
- package/web/dist/assets/{accounts-section-D3P_Z-Nu.js → accounts-section-BkKQ8sVH.js} +1 -1
- package/web/dist/assets/{activity-motion-BW-0k8s7.js → activity-motion-D80Uv4-Z.js} +1 -1
- package/web/dist/assets/{activity-route-Bpgblioe.js → activity-route-DVT8IWTR.js} +1 -1
- package/web/dist/assets/{agent-config-section-Cj3w7UIn.js → agent-config-section-BbwkJunW.js} +1 -1
- package/web/dist/assets/{agent-defaults-section-BJ4poe9c.js → agent-defaults-section-BLNTIZT_.js} +1 -1
- package/web/dist/assets/{appearance-BUsUTPF0.js → appearance-B6YBsmTo.js} +1 -1
- package/web/dist/assets/{archive-on-merge-field-D_kgBFNv.js → archive-on-merge-field-Bx1bEmI8.js} +1 -1
- package/web/dist/assets/attention-otQlgfRj.js +1 -0
- package/web/dist/assets/{automation-format-1lHzRTbq.js → automation-format-BsnXeUET.js} +1 -1
- package/web/dist/assets/automations-route-BOcGwfd4.js +1 -0
- package/web/dist/assets/{cez-idle-BY3rjM_y.js → cez-idle-Crszm9Ts.js} +1 -1
- package/web/dist/assets/{commit-diff-panel-xwLW6Ydr.js → commit-diff-panel-DKUnniap.js} +1 -1
- package/web/dist/assets/{diff-BB8SoL-s.js → diff-DUbLBjbg.js} +2 -2
- package/web/dist/assets/{diff-view-O8lx1ztb.js → diff-view-D_bjQyDl.js} +1 -1
- package/web/dist/assets/{file-preview-BS6M2tBo.js → file-preview-glEH09z8.js} +1 -1
- package/web/dist/assets/{folder-browser-Dsqz0Z1z.js → folder-browser-G_9ZgDjg.js} +1 -1
- package/web/dist/assets/{git-toolbar-DoPFA36c.js → git-toolbar-CTsmGICA.js} +1 -1
- package/web/dist/assets/{github-Bjy3WBvf.js → github-BqW9PaQO.js} +1 -1
- package/web/dist/assets/{global-activity-route-BXBZKz_9.js → global-activity-route-BP_Z7HNc.js} +1 -1
- package/web/dist/assets/index-DXIRYobS.js +21 -0
- package/web/dist/assets/{label-CZp8t0zE.js → label-BWld23ke.js} +1 -1
- package/web/dist/assets/live-protocol-BXzu6cSE.js +64 -0
- package/web/dist/assets/{markdown-KHcncamw.js → markdown-CT65TA_B.js} +1 -1
- package/web/dist/assets/{notifications-section-DD21Sd79.js → notifications-section-DuSzYLwP.js} +1 -1
- package/web/dist/assets/{open-in-menu-DdKs6X5r.js → open-in-menu-D03osLGE.js} +1 -1
- package/web/dist/assets/{preview-pane-connected-BvTZv2SQ.js → preview-pane-connected-DHmgDHId.js} +1 -1
- package/web/dist/assets/{project-location-B3LBvkz2.js → project-location-BM-6wMI3.js} +1 -1
- package/web/dist/assets/{project-router-CIKODSHW.js → project-router-DtTvMbeA.js} +1 -1
- package/web/dist/assets/project-scope-context-Dgq8_2JZ.js +4 -0
- package/web/dist/assets/{projects-section-C0k8kyb-.js → projects-section-Dr0xJWTm.js} +1 -1
- package/web/dist/assets/{prompt-templates-section-DNkosCni.js → prompt-templates-section-COKMgKMw.js} +1 -1
- package/web/dist/assets/queries-yuG-mM6_.js +1 -0
- package/web/dist/assets/{reference-chip-BWViAFIN.js → reference-chip-DTKtEtWv.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-DPCENbhz.js → remote-settings-notice-BV_sPAXc.js} +1 -1
- package/web/dist/assets/{repo-git-jKOnO3ba.js → repo-git-BgXC4opq.js} +1 -1
- package/web/dist/assets/{report-reader-DXYiKNcg.js → report-reader-CtHvvSln.js} +1 -1
- package/web/dist/assets/{reports-DEE0bHNv.js → reports-CdbDUzkK.js} +1 -1
- package/web/dist/assets/{resources-section-lqXgYTrv.js → resources-section-C8KZ4hre.js} +1 -1
- package/web/dist/assets/{run-header-CXlUbvDO.js → run-header-RQYKdIMw.js} +1 -1
- package/web/dist/assets/runners-CDw7wLfd.js +1 -0
- package/web/dist/assets/{settings-agent-picker-BRvZn4kM.js → settings-agent-picker-3uuSf9LK.js} +1 -1
- package/web/dist/assets/{settings-shell-DTtd-vIa.js → settings-shell-DnYRfclU.js} +1 -1
- package/web/dist/assets/{sidebar-section-BFW4ZfBR.js → sidebar-section-CCg4QGtg.js} +1 -1
- package/web/dist/assets/{skills-AImMlT1T.js → skills-L01dfEnP.js} +1 -1
- package/web/dist/assets/{tab-link-CM6SDBtV.js → tab-link-Dl5Mmavw.js} +1 -1
- package/web/dist/assets/{task-changes-01Z_ppIw.js → task-changes-DWPWp6ZV.js} +1 -1
- package/web/dist/assets/{task-commits-DRNIum3J.js → task-commits-D576LERH.js} +1 -1
- package/web/dist/assets/{task-files-Crz7Fo3C.js → task-files-1EjplVVb.js} +1 -1
- package/web/dist/assets/{task-github-item-psG2V47c.js → task-github-item-BubKlTej.js} +1 -1
- package/web/dist/assets/task-groups-D4RYW5I_.js +1 -0
- package/web/dist/assets/task-thread-yWACZZAo.js +9 -0
- package/web/dist/assets/{tasks-table-DHTEGteC.js → tasks-table-DTNcYbbN.js} +1 -1
- package/web/dist/assets/{thread-state-BWJ2YyXo.js → thread-state-BiS8rKQ-.js} +1 -1
- package/web/dist/assets/{use-hand-to-agent-state-DNROQerR.js → use-hand-to-agent-state-BFx3SZia.js} +1 -1
- package/web/dist/assets/{useInfiniteQuery-qJeCNhM7.js → useInfiniteQuery-BnyaEFle.js} +1 -1
- package/web/dist/assets/useQuery-BUslvRIM.js +1 -0
- package/web/dist/assets/{workflows-Cx9lgrEo.js → workflows-DbuTPPz7.js} +1 -1
- package/web/dist/assets/{workspace-tools-CVitt3kE.js → workspace-tools-DPnEZoDL.js} +1 -1
- package/web/dist/assets/{worktrees-section-DxUg4l9n.js → worktrees-section-Vr8s9cio.js} +1 -1
- package/web/dist/assets/{ws-BisMp6U5.js → ws-Bal5BUy2.js} +1 -1
- package/web/dist/index.html +17 -17
- package/web/dist/live-worker.js +1 -1
- package/web/dist/assets/attention-lvUYNNvV.js +0 -1
- package/web/dist/assets/automations-route-CZaUrmDs.js +0 -1
- package/web/dist/assets/index-CmadQXcg.js +0 -21
- package/web/dist/assets/live-protocol-D9ji1YCl.js +0 -64
- package/web/dist/assets/project-scope-context-D1bpJixc.js +0 -4
- package/web/dist/assets/queries-dHXhD3Hc.js +0 -1
- package/web/dist/assets/runners-CGQjSsir.js +0 -1
- package/web/dist/assets/task-groups-DF0XoB6U.js +0 -1
- package/web/dist/assets/task-thread-Bqg91ZVZ.js +0 -9
- package/web/dist/assets/useQuery-C3CQhXsT.js +0 -1
|
@@ -314,6 +314,8 @@ export declare const conversationSendRequestSchema: z.ZodObject<{
|
|
|
314
314
|
text: z.ZodString;
|
|
315
315
|
timeoutSeconds: z.ZodDefault<z.ZodNumber>;
|
|
316
316
|
resume: z.ZodOptional<z.ZodBoolean>;
|
|
317
|
+
model: z.ZodOptional<z.ZodString>;
|
|
318
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
317
319
|
}, z.core.$strict>;
|
|
318
320
|
export type ConversationSendRequest = z.infer<typeof conversationSendRequestSchema>;
|
|
319
321
|
/** Effect of this call, independent of the stored delivery receipt and request outcome.
|
|
@@ -1251,6 +1251,16 @@ export declare const workerWaitRequestSchema: z.ZodObject<{
|
|
|
1251
1251
|
}>>;
|
|
1252
1252
|
}, z.core.$strict>;
|
|
1253
1253
|
export type WorkerWaitRequest = z.infer<typeof workerWaitRequestSchema>;
|
|
1254
|
+
export declare const workerHoldSchema: z.ZodObject<{
|
|
1255
|
+
reason: z.ZodEnum<{
|
|
1256
|
+
"provider-error": "provider-error";
|
|
1257
|
+
"usage-limit": "usage-limit";
|
|
1258
|
+
}>;
|
|
1259
|
+
resumeAt: z.ZodISODateTime;
|
|
1260
|
+
attempts: z.ZodOptional<z.ZodNumber>;
|
|
1261
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1262
|
+
}, z.core.$strict>;
|
|
1263
|
+
export type WorkerHold = z.infer<typeof workerHoldSchema>;
|
|
1254
1264
|
export declare const workerInspectionSchema: z.ZodObject<{
|
|
1255
1265
|
workerId: z.ZodUUID;
|
|
1256
1266
|
settled: z.ZodBoolean;
|
|
@@ -1283,6 +1293,16 @@ export declare const workerInspectionSchema: z.ZodObject<{
|
|
|
1283
1293
|
}, z.core.$strict>], "kind">;
|
|
1284
1294
|
backend: z.ZodOptional<z.ZodString>;
|
|
1285
1295
|
model: z.ZodOptional<z.ZodString>;
|
|
1296
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
1297
|
+
hold: z.ZodOptional<z.ZodObject<{
|
|
1298
|
+
reason: z.ZodEnum<{
|
|
1299
|
+
"provider-error": "provider-error";
|
|
1300
|
+
"usage-limit": "usage-limit";
|
|
1301
|
+
}>;
|
|
1302
|
+
resumeAt: z.ZodISODateTime;
|
|
1303
|
+
attempts: z.ZodOptional<z.ZodNumber>;
|
|
1304
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1305
|
+
}, z.core.$strict>>;
|
|
1286
1306
|
inputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1287
1307
|
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1288
1308
|
kind: z.ZodLiteral<"baseline-file">;
|
|
@@ -1468,6 +1488,15 @@ export declare const workerListEntrySchema: z.ZodObject<{
|
|
|
1468
1488
|
hostRunId: z.ZodUUID;
|
|
1469
1489
|
baselineSha: z.ZodString;
|
|
1470
1490
|
}, z.core.$strict>], "kind">;
|
|
1491
|
+
hold: z.ZodOptional<z.ZodObject<{
|
|
1492
|
+
reason: z.ZodEnum<{
|
|
1493
|
+
"provider-error": "provider-error";
|
|
1494
|
+
"usage-limit": "usage-limit";
|
|
1495
|
+
}>;
|
|
1496
|
+
resumeAt: z.ZodISODateTime;
|
|
1497
|
+
attempts: z.ZodOptional<z.ZodNumber>;
|
|
1498
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1499
|
+
}, z.core.$strict>>;
|
|
1471
1500
|
destroy: z.ZodOptional<z.ZodObject<{
|
|
1472
1501
|
requestedAt: z.ZodISODateTime;
|
|
1473
1502
|
phase: z.ZodEnum<{
|
|
@@ -1523,6 +1552,15 @@ export declare const workerListResultSchema: z.ZodObject<{
|
|
|
1523
1552
|
hostRunId: z.ZodUUID;
|
|
1524
1553
|
baselineSha: z.ZodString;
|
|
1525
1554
|
}, z.core.$strict>], "kind">;
|
|
1555
|
+
hold: z.ZodOptional<z.ZodObject<{
|
|
1556
|
+
reason: z.ZodEnum<{
|
|
1557
|
+
"provider-error": "provider-error";
|
|
1558
|
+
"usage-limit": "usage-limit";
|
|
1559
|
+
}>;
|
|
1560
|
+
resumeAt: z.ZodISODateTime;
|
|
1561
|
+
attempts: z.ZodOptional<z.ZodNumber>;
|
|
1562
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1563
|
+
}, z.core.$strict>>;
|
|
1526
1564
|
destroy: z.ZodOptional<z.ZodObject<{
|
|
1527
1565
|
requestedAt: z.ZodISODateTime;
|
|
1528
1566
|
phase: z.ZodEnum<{
|
|
@@ -1585,6 +1623,15 @@ export declare const workerListPageSchema: z.ZodObject<{
|
|
|
1585
1623
|
hostRunId: z.ZodUUID;
|
|
1586
1624
|
baselineSha: z.ZodString;
|
|
1587
1625
|
}, z.core.$strict>], "kind">;
|
|
1626
|
+
hold: z.ZodOptional<z.ZodObject<{
|
|
1627
|
+
reason: z.ZodEnum<{
|
|
1628
|
+
"provider-error": "provider-error";
|
|
1629
|
+
"usage-limit": "usage-limit";
|
|
1630
|
+
}>;
|
|
1631
|
+
resumeAt: z.ZodISODateTime;
|
|
1632
|
+
attempts: z.ZodOptional<z.ZodNumber>;
|
|
1633
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1634
|
+
}, z.core.$strict>>;
|
|
1588
1635
|
destroy: z.ZodOptional<z.ZodObject<{
|
|
1589
1636
|
requestedAt: z.ZodISODateTime;
|
|
1590
1637
|
phase: z.ZodEnum<{
|
|
@@ -1724,6 +1771,16 @@ export declare const runRelationshipsSchema: z.ZodObject<{
|
|
|
1724
1771
|
}, z.core.$strict>], "kind">;
|
|
1725
1772
|
backend: z.ZodOptional<z.ZodString>;
|
|
1726
1773
|
model: z.ZodOptional<z.ZodString>;
|
|
1774
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
1775
|
+
hold: z.ZodOptional<z.ZodObject<{
|
|
1776
|
+
reason: z.ZodEnum<{
|
|
1777
|
+
"provider-error": "provider-error";
|
|
1778
|
+
"usage-limit": "usage-limit";
|
|
1779
|
+
}>;
|
|
1780
|
+
resumeAt: z.ZodISODateTime;
|
|
1781
|
+
attempts: z.ZodOptional<z.ZodNumber>;
|
|
1782
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1783
|
+
}, z.core.$strict>>;
|
|
1727
1784
|
inputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1728
1785
|
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1729
1786
|
kind: z.ZodLiteral<"baseline-file">;
|
package/dist/contract/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// ../contract/src/events.ts
|
|
2
|
-
import { z as
|
|
2
|
+
import { z as z6 } from "zod";
|
|
3
3
|
|
|
4
4
|
// ../contract/src/conversations.ts
|
|
5
|
-
import { z as
|
|
5
|
+
import { z as z3 } from "zod";
|
|
6
6
|
|
|
7
7
|
// ../contract/src/ask-schema.ts
|
|
8
8
|
import { z } from "zod";
|
|
@@ -35,38 +35,50 @@ var askRequestSchema = z.object({
|
|
|
35
35
|
})
|
|
36
36
|
}).strict();
|
|
37
37
|
|
|
38
|
+
// ../contract/src/effort.ts
|
|
39
|
+
import { z as z2 } from "zod";
|
|
40
|
+
var EFFORT_LEVELS = ["low", "medium", "high", "xhigh", "max"];
|
|
41
|
+
var effortLevelSchema = z2.enum(EFFORT_LEVELS);
|
|
42
|
+
var effortFieldSchema = z2.string().max(32).optional();
|
|
43
|
+
function parseEffort(value) {
|
|
44
|
+
const trimmed = value?.trim().toLowerCase();
|
|
45
|
+
if (!trimmed || trimmed === "auto") return void 0;
|
|
46
|
+
const parsed = effortLevelSchema.safeParse(trimmed);
|
|
47
|
+
return parsed.success ? parsed.data : void 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
38
50
|
// ../contract/src/conversations.ts
|
|
39
|
-
var conversationRelationshipSchema =
|
|
40
|
-
var conversationAttributionSchema =
|
|
41
|
-
senderRunId:
|
|
42
|
-
recipientRunId:
|
|
43
|
-
kind:
|
|
44
|
-
requestId:
|
|
51
|
+
var conversationRelationshipSchema = z3.enum(["family", "peer"]);
|
|
52
|
+
var conversationAttributionSchema = z3.object({
|
|
53
|
+
senderRunId: z3.uuid(),
|
|
54
|
+
recipientRunId: z3.uuid(),
|
|
55
|
+
kind: z3.enum(["request", "progress", "follow-up", "reply"]),
|
|
56
|
+
requestId: z3.uuid().optional(),
|
|
45
57
|
relationship: conversationRelationshipSchema.optional()
|
|
46
58
|
}).strict();
|
|
47
59
|
var conversationMessageSchema = conversationAttributionSchema.extend({
|
|
48
|
-
id:
|
|
49
|
-
text:
|
|
50
|
-
createdAt:
|
|
51
|
-
deadline:
|
|
52
|
-
requestHash:
|
|
53
|
-
state:
|
|
60
|
+
id: z3.uuid(),
|
|
61
|
+
text: z3.string().min(1).max(1e5),
|
|
62
|
+
createdAt: z3.iso.datetime(),
|
|
63
|
+
deadline: z3.iso.datetime().optional(),
|
|
64
|
+
requestHash: z3.string().regex(/^[0-9a-f]{64}$/),
|
|
65
|
+
state: z3.enum(["accepted", "continuation-required", "destroyed", "late"]),
|
|
54
66
|
/** A parent-authorized new execution; retained on exact message retries. */
|
|
55
|
-
resumed:
|
|
56
|
-
instruction:
|
|
67
|
+
resumed: z3.literal(true).optional(),
|
|
68
|
+
instruction: z3.string().max(2048).optional(),
|
|
57
69
|
/** A worker's question routed to its parent (#505): answered only by a reply naming it. */
|
|
58
70
|
question: askRequestSchema.optional()
|
|
59
71
|
});
|
|
60
|
-
var requestOutcomeSchema =
|
|
61
|
-
requestId:
|
|
72
|
+
var requestOutcomeSchema = z3.object({
|
|
73
|
+
requestId: z3.uuid(),
|
|
62
74
|
/** `deleted`: a peer recipient's record was deleted while the request was open. */
|
|
63
|
-
status:
|
|
64
|
-
observedAt:
|
|
65
|
-
replyId:
|
|
75
|
+
status: z3.enum(["replied", "replied-late", "completed-without-reply", "failed", "cancelled", "destroyed", "timed-out", "sender-closed", "human-fallback", "deleted"]),
|
|
76
|
+
observedAt: z3.iso.datetime(),
|
|
77
|
+
replyId: z3.uuid().optional()
|
|
66
78
|
}).strict();
|
|
67
|
-
var conversationStateSchema =
|
|
79
|
+
var conversationStateSchema = z3.object({ messages: z3.array(conversationMessageSchema).max(1024), outcomes: z3.array(requestOutcomeSchema).max(1024) }).strict();
|
|
68
80
|
var CURSOR = /^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z)~([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/i;
|
|
69
|
-
var conversationCursorSchema =
|
|
81
|
+
var conversationCursorSchema = z3.string().max(128).regex(CURSOR, "Not a history cursor; pass nextBefore from an earlier page");
|
|
70
82
|
function encodeConversationCursor(message2) {
|
|
71
83
|
return `${message2.createdAt}~${message2.id}`;
|
|
72
84
|
}
|
|
@@ -77,180 +89,182 @@ function decodeConversationCursor(cursor) {
|
|
|
77
89
|
}
|
|
78
90
|
var CONVERSATION_PAGE_MESSAGES = 1024;
|
|
79
91
|
var conversationInspectResultSchema = conversationStateSchema.extend({
|
|
80
|
-
hint:
|
|
92
|
+
hint: z3.string().optional(),
|
|
81
93
|
/** Present when older messages exist: pass it as `before` to read the page before this one. */
|
|
82
94
|
nextBefore: conversationCursorSchema.optional()
|
|
83
95
|
});
|
|
84
|
-
var inboxReserveResultSchema =
|
|
85
|
-
messages:
|
|
86
|
-
outcomes:
|
|
87
|
-
receiptId:
|
|
88
|
-
expiresAt:
|
|
96
|
+
var inboxReserveResultSchema = z3.object({
|
|
97
|
+
messages: z3.array(conversationMessageSchema).max(32),
|
|
98
|
+
outcomes: z3.array(requestOutcomeSchema).max(32),
|
|
99
|
+
receiptId: z3.uuid().optional(),
|
|
100
|
+
expiresAt: z3.iso.datetime().optional()
|
|
89
101
|
}).strict().refine(
|
|
90
102
|
(value) => value.messages.length > 0 ? value.receiptId !== void 0 && value.expiresAt !== void 0 : value.receiptId === void 0 && value.expiresAt === void 0,
|
|
91
103
|
{ message: "A nonempty inbox batch requires a receipt and expiry" }
|
|
92
104
|
);
|
|
93
|
-
var inboxReceiptRequestSchema =
|
|
94
|
-
var inboxReceiptResultSchema =
|
|
95
|
-
receiptId:
|
|
96
|
-
status:
|
|
105
|
+
var inboxReceiptRequestSchema = z3.object({ receiptId: z3.uuid() }).strict();
|
|
106
|
+
var inboxReceiptResultSchema = z3.object({
|
|
107
|
+
receiptId: z3.uuid(),
|
|
108
|
+
status: z3.enum(["acknowledged", "already-acknowledged", "released"])
|
|
97
109
|
}).strict();
|
|
98
110
|
var MAX_RESUME_REQUEST_SECONDS = 86400;
|
|
99
111
|
var MAX_CONVERSATION_REQUEST_SECONDS = 7200;
|
|
100
112
|
var DEFAULT_CONVERSATION_REQUEST_SECONDS = 600;
|
|
101
|
-
var conversationSendRequestSchema =
|
|
102
|
-
id:
|
|
103
|
-
recipientRunId:
|
|
113
|
+
var conversationSendRequestSchema = z3.object({
|
|
114
|
+
id: z3.uuid(),
|
|
115
|
+
recipientRunId: z3.uuid(),
|
|
104
116
|
kind: conversationAttributionSchema.shape.kind,
|
|
105
|
-
requestId:
|
|
106
|
-
text:
|
|
107
|
-
timeoutSeconds:
|
|
108
|
-
resume:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
var
|
|
113
|
-
var
|
|
114
|
-
var
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
117
|
+
requestId: z3.uuid().optional(),
|
|
118
|
+
text: z3.string().min(1).max(1e5).refine((text) => text.trim().length > 0),
|
|
119
|
+
timeoutSeconds: z3.number().int().min(1).max(MAX_RESUME_REQUEST_SECONDS).default(DEFAULT_CONVERSATION_REQUEST_SECONDS),
|
|
120
|
+
resume: z3.boolean().optional(),
|
|
121
|
+
model: z3.string().trim().min(1).max(512).optional(),
|
|
122
|
+
effort: effortFieldSchema
|
|
123
|
+
}).strict().refine((value) => value.timeoutSeconds <= MAX_CONVERSATION_REQUEST_SECONDS || value.resume === true && value.kind === "request", { path: ["timeoutSeconds"], message: "Only --resume requests accept deadlines above 7200 seconds (maximum 86400)" }).refine((value) => (value.kind === "reply" || value.kind === "follow-up") === (value.requestId !== void 0), { message: "Replies and follow-ups require a request ID; new messages must omit it" }).refine((value) => !value.resume || value.kind === "request" || value.kind === "progress", { message: "--resume requires a new request or progress instruction" }).refine((value) => value.resume === true || value.model === void 0 && value.effort === void 0, { message: "--model and --effort require --resume" });
|
|
124
|
+
var conversationSendEffectSchema = z3.enum(["applied", "unchanged", "refused", "unknown"]);
|
|
125
|
+
var conversationSendResultSchema = z3.object({ message: conversationMessageSchema, delivery: z3.enum(["queued", "delivered", "consumed", "not-delivered"]), outcome: requestOutcomeSchema.optional(), effect: conversationSendEffectSchema.optional() }).strict();
|
|
126
|
+
var conversationInspectRequestSchema = z3.object({ recipientRunId: z3.uuid(), before: conversationCursorSchema.optional() }).strict();
|
|
127
|
+
var conversationCancelRequestSchema = z3.object({ requestId: z3.uuid() }).strict();
|
|
128
|
+
var requestWaitRequestSchema = z3.object({
|
|
129
|
+
requestIds: z3.array(z3.uuid()).min(1).max(32).refine((ids) => new Set(ids).size === ids.length),
|
|
130
|
+
mode: z3.enum(["one", "any", "all"]).optional(),
|
|
131
|
+
timeoutSeconds: z3.number().int().min(1).max(7200).default(600)
|
|
118
132
|
}).strict().refine((value) => value.mode !== "one" || value.requestIds.length === 1, { message: "one requires exactly one request" });
|
|
119
133
|
|
|
120
134
|
// ../contract/src/agent-input.ts
|
|
121
|
-
import { z as
|
|
122
|
-
var inboxClaimSchema =
|
|
123
|
-
receiptId:
|
|
124
|
-
generation:
|
|
125
|
-
expiresAt:
|
|
126
|
-
acknowledgedAt:
|
|
135
|
+
import { z as z4 } from "zod";
|
|
136
|
+
var inboxClaimSchema = z4.object({
|
|
137
|
+
receiptId: z4.uuid(),
|
|
138
|
+
generation: z4.uuid(),
|
|
139
|
+
expiresAt: z4.iso.datetime(),
|
|
140
|
+
acknowledgedAt: z4.iso.datetime().optional(),
|
|
127
141
|
/** Optional on read for receipts persisted before member manifests existed. */
|
|
128
|
-
memberIds:
|
|
142
|
+
memberIds: z4.array(z4.uuid()).min(1).max(32).refine((ids) => new Set(ids).size === ids.length).optional()
|
|
129
143
|
}).strict();
|
|
130
|
-
var agentInputSchema =
|
|
144
|
+
var agentInputSchema = z4.object({
|
|
131
145
|
conversation: conversationAttributionSchema.optional(),
|
|
132
|
-
id:
|
|
133
|
-
source:
|
|
134
|
-
parentRunId:
|
|
135
|
-
text:
|
|
136
|
-
createdAt:
|
|
137
|
-
deliveredAt:
|
|
146
|
+
id: z4.uuid(),
|
|
147
|
+
source: z4.enum(["agent", "lifecycle"]),
|
|
148
|
+
parentRunId: z4.uuid(),
|
|
149
|
+
text: z4.string().min(1).max(1e5),
|
|
150
|
+
createdAt: z4.iso.datetime(),
|
|
151
|
+
deliveredAt: z4.iso.datetime().optional(),
|
|
138
152
|
/** The model received it, when the harness can show that (#505). Absent on
|
|
139
153
|
* unobservable backends and on records written before #505. */
|
|
140
|
-
consumedAt:
|
|
154
|
+
consumedAt: z4.iso.datetime().optional(),
|
|
141
155
|
/** Accepted by a harness that reports reading, and not read yet. A restart replays
|
|
142
156
|
* such input; records written before #505 never carry it, so nothing historical replays. */
|
|
143
|
-
awaitingRead:
|
|
157
|
+
awaitingRead: z4.literal(true).optional(),
|
|
144
158
|
inboxClaim: inboxClaimSchema.optional(),
|
|
145
159
|
/** A completion refusal Squawk queued for a closed session (hearsay-tools/cezarion#1301): its
|
|
146
160
|
* delivery is the nudge's turn, bounded by the nudge's reply bound, and a session that closes
|
|
147
161
|
* before it is a failed delivery. `undelivered-question` is Squawk's answer to a worker question
|
|
148
162
|
* that could not reach its live parent (hearsay-tools/cezarion#2410). Absent on every other input
|
|
149
163
|
* and on records written before. */
|
|
150
|
-
purpose:
|
|
164
|
+
purpose: z4.enum(["completion-refusal", "undelivered-question"]).optional(),
|
|
151
165
|
/** A peer message's own hash and request deadline (hearsay-tools/cezarion#1990): the sender's
|
|
152
166
|
* ledger can be deleted before the recipient reads it. Absent on family and lifecycle inputs. */
|
|
153
|
-
requestHash:
|
|
154
|
-
deadline:
|
|
167
|
+
requestHash: z4.string().regex(/^[0-9a-f]{64}$/).optional(),
|
|
168
|
+
deadline: z4.iso.datetime().optional()
|
|
155
169
|
}).strict();
|
|
156
170
|
|
|
157
171
|
// ../contract/src/worker-outcome.ts
|
|
158
|
-
import { z as
|
|
159
|
-
var workerOutcomeSchema =
|
|
160
|
-
workerId:
|
|
161
|
-
status:
|
|
162
|
-
observedAt:
|
|
163
|
-
summary:
|
|
164
|
-
revision:
|
|
172
|
+
import { z as z5 } from "zod";
|
|
173
|
+
var workerOutcomeSchema = z5.object({
|
|
174
|
+
workerId: z5.uuid(),
|
|
175
|
+
status: z5.enum(["review", "done", "failed", "cancelled"]),
|
|
176
|
+
observedAt: z5.iso.datetime(),
|
|
177
|
+
summary: z5.string().max(4e3).optional(),
|
|
178
|
+
revision: z5.number().int().nonnegative().optional()
|
|
165
179
|
}).strict();
|
|
166
|
-
var workerWaitModeSchema =
|
|
180
|
+
var workerWaitModeSchema = z5.enum(["one", "any", "all"]);
|
|
167
181
|
|
|
168
182
|
// ../contract/src/events.ts
|
|
169
|
-
var runEventSchema =
|
|
170
|
-
seq:
|
|
171
|
-
ts:
|
|
172
|
-
stepId:
|
|
173
|
-
type:
|
|
174
|
-
});
|
|
175
|
-
var conversationMessageEventSchema = runEventSchema.extend({ type:
|
|
176
|
-
var requestOutcomeEventSchema = runEventSchema.extend({ type:
|
|
183
|
+
var runEventSchema = z6.looseObject({
|
|
184
|
+
seq: z6.number(),
|
|
185
|
+
ts: z6.string(),
|
|
186
|
+
stepId: z6.string().optional(),
|
|
187
|
+
type: z6.string()
|
|
188
|
+
});
|
|
189
|
+
var conversationMessageEventSchema = runEventSchema.extend({ type: z6.literal("conversation-message"), message: conversationMessageSchema, delivery: z6.enum(["queued", "delivered", "consumed", "not-delivered"]), deliveredAt: z6.iso.datetime().optional(), consumedAt: z6.iso.datetime().optional() });
|
|
190
|
+
var requestOutcomeEventSchema = runEventSchema.extend({ type: z6.literal("request-outcome"), outcome: requestOutcomeSchema });
|
|
177
191
|
var agentInputEventSchema = runEventSchema.extend({
|
|
178
|
-
type:
|
|
192
|
+
type: z6.literal("agent-input"),
|
|
179
193
|
input: agentInputSchema
|
|
180
194
|
});
|
|
181
195
|
var humanInputDeliveredEventSchema = runEventSchema.extend({
|
|
182
|
-
type:
|
|
183
|
-
askSeq:
|
|
196
|
+
type: z6.literal("human-input-delivered"),
|
|
197
|
+
askSeq: z6.number().int().nonnegative(),
|
|
184
198
|
/** Who answered: absent (records before #505) or `human` is a person; `parent` is the
|
|
185
199
|
* owning parent's reply to a routed worker question; `cezar` is Squawk's notice that the question
|
|
186
200
|
* could not reach a live parent (hearsay-tools/cezarion#2410). */
|
|
187
|
-
source:
|
|
201
|
+
source: z6.enum(["human", "parent", "cezar"]).optional()
|
|
188
202
|
});
|
|
189
203
|
var humanAskClosedEventSchema = runEventSchema.extend({
|
|
190
|
-
type:
|
|
191
|
-
askSeq:
|
|
192
|
-
reason:
|
|
204
|
+
type: z6.literal("human-ask-closed"),
|
|
205
|
+
askSeq: z6.number().int().nonnegative(),
|
|
206
|
+
reason: z6.enum(["finish", "superseded", "parent-stopped", "worker-stopped", "undeliverable"])
|
|
193
207
|
});
|
|
194
208
|
var workerQuestionRoutedEventSchema = runEventSchema.extend({
|
|
195
|
-
type:
|
|
196
|
-
askSeq:
|
|
197
|
-
messageId:
|
|
198
|
-
parentRunId:
|
|
209
|
+
type: z6.literal("worker-question-routed"),
|
|
210
|
+
askSeq: z6.number().int().nonnegative(),
|
|
211
|
+
messageId: z6.uuid(),
|
|
212
|
+
parentRunId: z6.uuid()
|
|
199
213
|
});
|
|
200
214
|
var workerQuestionFallbackEventSchema = runEventSchema.extend({
|
|
201
|
-
type:
|
|
202
|
-
askSeq:
|
|
203
|
-
reason:
|
|
215
|
+
type: z6.literal("worker-question-fallback"),
|
|
216
|
+
askSeq: z6.number().int().nonnegative(),
|
|
217
|
+
reason: z6.string().min(1).max(200)
|
|
204
218
|
});
|
|
205
219
|
var workerQuestionUndeliveredEventSchema = runEventSchema.extend({
|
|
206
|
-
type:
|
|
207
|
-
askSeq:
|
|
208
|
-
reason:
|
|
220
|
+
type: z6.literal("worker-question-undelivered"),
|
|
221
|
+
askSeq: z6.number().int().nonnegative(),
|
|
222
|
+
reason: z6.string().min(1).max(200)
|
|
209
223
|
});
|
|
210
224
|
var workerOutcomeEventSchema = runEventSchema.extend({
|
|
211
|
-
type:
|
|
225
|
+
type: z6.literal("worker-outcome"),
|
|
212
226
|
outcome: workerOutcomeSchema
|
|
213
227
|
});
|
|
214
228
|
var RUN_HISTORY_PAGE_ITEMS = 100;
|
|
215
|
-
var runIdParamSchema =
|
|
216
|
-
id:
|
|
229
|
+
var runIdParamSchema = z6.object({
|
|
230
|
+
id: z6.string().min(1).max(128).regex(/^[A-Za-z0-9._-]+$/)
|
|
217
231
|
});
|
|
218
|
-
var runHistoryCursorSchema =
|
|
219
|
-
var runHistoryQuerySchema =
|
|
232
|
+
var runHistoryCursorSchema = z6.string().min(1).max(2048);
|
|
233
|
+
var runHistoryQuerySchema = z6.object({
|
|
220
234
|
cursor: runHistoryCursorSchema.optional()
|
|
221
235
|
});
|
|
222
|
-
var runEventsQuerySchema =
|
|
236
|
+
var runEventsQuerySchema = z6.object({
|
|
223
237
|
cursor: runHistoryCursorSchema.optional(),
|
|
224
|
-
afterSeq:
|
|
225
|
-
});
|
|
226
|
-
var runHistoryEventSchema =
|
|
227
|
-
seq:
|
|
228
|
-
ts:
|
|
229
|
-
stepId:
|
|
230
|
-
type:
|
|
231
|
-
}).catchall(
|
|
232
|
-
var runHistoryPageSchema =
|
|
233
|
-
events:
|
|
234
|
-
itemCount:
|
|
238
|
+
afterSeq: z6.coerce.number().int().nonnegative().optional()
|
|
239
|
+
});
|
|
240
|
+
var runHistoryEventSchema = z6.object({
|
|
241
|
+
seq: z6.number(),
|
|
242
|
+
ts: z6.string(),
|
|
243
|
+
stepId: z6.string().optional(),
|
|
244
|
+
type: z6.string()
|
|
245
|
+
}).catchall(z6.any());
|
|
246
|
+
var runHistoryPageSchema = z6.object({
|
|
247
|
+
events: z6.array(runHistoryEventSchema),
|
|
248
|
+
itemCount: z6.number().int().min(0).max(RUN_HISTORY_PAGE_ITEMS),
|
|
235
249
|
olderCursor: runHistoryCursorSchema.optional(),
|
|
236
250
|
newerCursor: runHistoryCursorSchema.optional(),
|
|
237
251
|
liveCursor: runHistoryCursorSchema,
|
|
238
|
-
asOfSeq:
|
|
239
|
-
hasOlder:
|
|
240
|
-
});
|
|
241
|
-
var runHistoryContextSchema =
|
|
242
|
-
contextEvents:
|
|
243
|
-
asOfSeq:
|
|
244
|
-
});
|
|
245
|
-
var checkoutProgressEventSchema =
|
|
246
|
-
checkoutId:
|
|
247
|
-
name:
|
|
248
|
-
phase:
|
|
249
|
-
line:
|
|
250
|
-
error:
|
|
252
|
+
asOfSeq: z6.number().int().nonnegative(),
|
|
253
|
+
hasOlder: z6.boolean()
|
|
254
|
+
});
|
|
255
|
+
var runHistoryContextSchema = z6.object({
|
|
256
|
+
contextEvents: z6.array(runHistoryEventSchema),
|
|
257
|
+
asOfSeq: z6.number().int().nonnegative()
|
|
258
|
+
});
|
|
259
|
+
var checkoutProgressEventSchema = z6.object({
|
|
260
|
+
checkoutId: z6.string().optional(),
|
|
261
|
+
name: z6.string(),
|
|
262
|
+
phase: z6.enum(["cloning", "done", "error"]),
|
|
263
|
+
line: z6.string().optional(),
|
|
264
|
+
error: z6.string().optional(),
|
|
251
265
|
/** On `done` only: the project was created and registered, but a later step did not finish
|
|
252
266
|
* (new-project flow, spec 2026-10-15-create-new-project). Names what exists and how to finish. */
|
|
253
|
-
warning:
|
|
267
|
+
warning: z6.string().optional()
|
|
254
268
|
});
|
|
255
269
|
|
|
256
270
|
// ../contract/src/ask.ts
|
|
@@ -300,18 +314,6 @@ function askCardOf(ask) {
|
|
|
300
314
|
// ../contract/src/delegation.ts
|
|
301
315
|
import { z as z10 } from "zod";
|
|
302
316
|
|
|
303
|
-
// ../contract/src/effort.ts
|
|
304
|
-
import { z as z6 } from "zod";
|
|
305
|
-
var EFFORT_LEVELS = ["low", "medium", "high", "xhigh", "max"];
|
|
306
|
-
var effortLevelSchema = z6.enum(EFFORT_LEVELS);
|
|
307
|
-
var effortFieldSchema = z6.string().max(32).optional();
|
|
308
|
-
function parseEffort(value) {
|
|
309
|
-
const trimmed = value?.trim().toLowerCase();
|
|
310
|
-
if (!trimmed || trimmed === "auto") return void 0;
|
|
311
|
-
const parsed = effortLevelSchema.safeParse(trimmed);
|
|
312
|
-
return parsed.success ? parsed.data : void 0;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
317
|
// ../contract/src/run-status.ts
|
|
316
318
|
import { z as z7 } from "zod";
|
|
317
319
|
var runStatusSchema = z7.enum([
|
|
@@ -706,6 +708,12 @@ var workerWaitRequestSchema = z10.object({
|
|
|
706
708
|
timeoutSeconds: z10.number().int().min(1).max(7200).default(600),
|
|
707
709
|
mode: workerWaitModeSchema.optional()
|
|
708
710
|
}).strict().refine((request) => request.mode !== "one" || request.workerIds.length === 1, { message: "one mode requires exactly one worker" });
|
|
711
|
+
var workerHoldSchema = z10.object({
|
|
712
|
+
reason: z10.enum(["usage-limit", "provider-error"]),
|
|
713
|
+
resumeAt: z10.iso.datetime(),
|
|
714
|
+
attempts: z10.number().int().min(0).optional(),
|
|
715
|
+
error: z10.string().max(2e3).optional()
|
|
716
|
+
}).strict();
|
|
709
717
|
var workerInspectionSchema = z10.object({
|
|
710
718
|
workerId: z10.uuid(),
|
|
711
719
|
settled: z10.boolean(),
|
|
@@ -718,6 +726,8 @@ var workerInspectionSchema = z10.object({
|
|
|
718
726
|
workspace: workerWorkspaceSchema,
|
|
719
727
|
backend: workerBackendSchema.optional(),
|
|
720
728
|
model: z10.string().max(512).optional(),
|
|
729
|
+
effort: effortFieldSchema,
|
|
730
|
+
hold: workerHoldSchema.optional(),
|
|
721
731
|
inputs: z10.array(workerInputSchema).max(32).optional(),
|
|
722
732
|
wait: workerWaitSchema.optional(),
|
|
723
733
|
/** The parent's deadline-less completion wait on this worker (hearsay-tools/cezarion#1301). */
|
|
@@ -734,6 +744,7 @@ var workerListEntrySchema = workerInspectionSchema.pick({
|
|
|
734
744
|
supervisorRunId: true,
|
|
735
745
|
status: true,
|
|
736
746
|
workspace: true,
|
|
747
|
+
hold: true,
|
|
737
748
|
destroy: true
|
|
738
749
|
}).extend({
|
|
739
750
|
revision: z10.number().int().nonnegative(),
|
|
@@ -1567,6 +1578,15 @@ var ciWaitReceiptSchema = ciPrIdentitySchema.extend({
|
|
|
1567
1578
|
function isUsageLimitHold(run) {
|
|
1568
1579
|
return run.status === "waiting" && run.autoResumeAt !== void 0;
|
|
1569
1580
|
}
|
|
1581
|
+
function usageLimitHoldOf(run) {
|
|
1582
|
+
if (!isUsageLimitHold(run)) return void 0;
|
|
1583
|
+
return {
|
|
1584
|
+
reason: run.autoResumeReason ?? "usage-limit",
|
|
1585
|
+
resumeAt: run.autoResumeAt,
|
|
1586
|
+
...run.autoResumeAttempts === void 0 ? {} : { attempts: run.autoResumeAttempts },
|
|
1587
|
+
...run.error === void 0 ? {} : { error: run.error.slice(0, 2e3) }
|
|
1588
|
+
};
|
|
1589
|
+
}
|
|
1570
1590
|
|
|
1571
1591
|
// ../contract/src/wait-limits.ts
|
|
1572
1592
|
var WAIT_LIMIT = 16;
|
|
@@ -4799,6 +4819,26 @@ function latestSession(run) {
|
|
|
4799
4819
|
const step = removedRunnerStepAfter(run.steps, latest?.sessionId) ? void 0 : latest;
|
|
4800
4820
|
return { sessionId: step?.sessionId, backend: sessionRunner(step, run), profileId: step?.profileId };
|
|
4801
4821
|
}
|
|
4822
|
+
function isAgentWorkflowStep(step) {
|
|
4823
|
+
return step.command === void 0 && step.kind !== "plugin";
|
|
4824
|
+
}
|
|
4825
|
+
function workerContinuationStepId(run) {
|
|
4826
|
+
const cursorId = run.workflowCursor?.mode === "resume" ? run.workflowCursor.stepId : void 0;
|
|
4827
|
+
if (cursorId && run.steps.find((step) => step.id === cursorId)?.status === "failed") return cursorId;
|
|
4828
|
+
const session = latestSessionStep(run.steps);
|
|
4829
|
+
if (!session) return void 0;
|
|
4830
|
+
if (session.synthetic === "continuation" && session.continuesStepId !== void 0) return session.continuesStepId;
|
|
4831
|
+
return run.steps.find((step) => step.sessionId === session.sessionId)?.id ?? session.id;
|
|
4832
|
+
}
|
|
4833
|
+
function workerContinuationStep(run, untouched = false) {
|
|
4834
|
+
if (run.delegation?.role !== "worker") return void 0;
|
|
4835
|
+
const steps = run.workflowDef?.steps;
|
|
4836
|
+
if (!steps?.length) return void 0;
|
|
4837
|
+
if (untouched) return steps.find(isAgentWorkflowStep);
|
|
4838
|
+
const targetId = workerContinuationStepId(run);
|
|
4839
|
+
const targeted = targetId ? steps.find((step) => step.id === targetId && isAgentWorkflowStep(step)) : void 0;
|
|
4840
|
+
return targeted ?? [...steps].reverse().find(isAgentWorkflowStep);
|
|
4841
|
+
}
|
|
4802
4842
|
var LIVE_STATUSES = /* @__PURE__ */ new Set(["queued", "running", "waiting"]);
|
|
4803
4843
|
function isLiveStatus(status) {
|
|
4804
4844
|
return LIVE_STATUSES.has(status);
|
|
@@ -6837,6 +6877,7 @@ export {
|
|
|
6837
6877
|
updateProjectInputSchema,
|
|
6838
6878
|
updateProjectResponseSchema,
|
|
6839
6879
|
updateProjectWebhookInputSchema,
|
|
6880
|
+
usageLimitHoldOf,
|
|
6840
6881
|
userMcpListingSchema,
|
|
6841
6882
|
utcMinute,
|
|
6842
6883
|
waitErrorCodeSchema,
|
|
@@ -6860,6 +6901,7 @@ export {
|
|
|
6860
6901
|
workerCompletionWaitSchema,
|
|
6861
6902
|
workerContextReferenceSchema,
|
|
6862
6903
|
workerContextSchema,
|
|
6904
|
+
workerContinuationStep,
|
|
6863
6905
|
workerCreationReceiptSchema,
|
|
6864
6906
|
workerDestroyRequestSchema,
|
|
6865
6907
|
workerDestroyResultSchema,
|
|
@@ -6869,6 +6911,7 @@ export {
|
|
|
6869
6911
|
workerDestroyWorkSchema,
|
|
6870
6912
|
workerDiffSchema,
|
|
6871
6913
|
workerEmptyRequestSchema,
|
|
6914
|
+
workerHoldSchema,
|
|
6872
6915
|
workerIdsSchema,
|
|
6873
6916
|
workerInputRecipeSchema,
|
|
6874
6917
|
workerInputSchema,
|
|
@@ -32,6 +32,15 @@ export declare function latestSession(run: {
|
|
|
32
32
|
backend: NonNullable<RunRecord['runner']>;
|
|
33
33
|
profileId: string | undefined;
|
|
34
34
|
};
|
|
35
|
+
type WorkerContinuationRun = Partial<Pick<RunRecord, 'delegation' | 'workflowDef' | 'workflowCursor'>> & {
|
|
36
|
+
steps: readonly Pick<StepState, 'id' | 'sessionId' | 'startedAt' | 'continuesStepId' | 'synthetic' | 'status'>[];
|
|
37
|
+
};
|
|
38
|
+
type WorkflowStepEntry = NonNullable<RunRecord['workflowDef']>['steps'][number];
|
|
39
|
+
/**
|
|
40
|
+
* The workflow agent step an owned worker's Continue extends: the first agent step when untouched,
|
|
41
|
+
* else the resumed cursor step, else the step owning the latest session, else the last agent step.
|
|
42
|
+
*/
|
|
43
|
+
export declare function workerContinuationStep(run: WorkerContinuationRun, untouched?: boolean): WorkflowStepEntry | undefined;
|
|
35
44
|
/** Status-only live predicate: queued, running or waiting. */
|
|
36
45
|
export declare function isLiveStatus(status: string): boolean;
|
|
37
46
|
type OwnershipInput = Pick<RunRecord, 'status'> & Partial<Pick<RunRecord, 'autoResumeAt'>>;
|
|
@@ -13,3 +13,10 @@ import type { RunRecord } from './runs.ts';
|
|
|
13
13
|
export declare function isUsageLimitHold<T extends Partial<Pick<RunRecord, 'status' | 'autoResumeAt'>>>(run: T): run is T & {
|
|
14
14
|
autoResumeAt: string;
|
|
15
15
|
};
|
|
16
|
+
/** Structured hold details when a run is on a usage-limit or provider-error hold; undefined otherwise. */
|
|
17
|
+
export declare function usageLimitHoldOf(run: Partial<Pick<RunRecord, 'status' | 'autoResumeAt' | 'autoResumeReason' | 'autoResumeAttempts' | 'error'>>): {
|
|
18
|
+
reason: 'usage-limit' | 'provider-error';
|
|
19
|
+
resumeAt: string;
|
|
20
|
+
attempts?: number;
|
|
21
|
+
error?: string;
|
|
22
|
+
} | undefined;
|
package/dist/contract/waits.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { PeerWaitView, WorkerCompletionWait, WorkerWait } from './delegation.ts';
|
|
3
3
|
import type { RunRecord } from './runs.ts';
|
|
4
|
-
import { isUsageLimitHold } from './usage-limit-hold.ts';
|
|
4
|
+
import { isUsageLimitHold, usageLimitHoldOf } from './usage-limit-hold.ts';
|
|
5
5
|
import { WAIT_LIMIT, LAST_WAITS_LIMIT, TIMER_MIN_SECONDS, TIMER_MAX_SECONDS, PROCESS_TIMEOUT_DEFAULT_SECONDS, PROCESS_TIMEOUT_MAX_SECONDS, PROCESS_EXIT_FILE_MAX, PEER_WAIT_DEFAULT_SECONDS, PEER_WAIT_MAX_SECONDS, SUBAGENT_WAIT_DEADLINE_SECONDS, SUBAGENT_WAIT_GRACE_SECONDS, SUBAGENT_WAIT_CHILD_LIMIT, WAIT_MESSAGE_MAX, NOTE_MAX, PID_MIN } from './wait-limits.ts';
|
|
6
6
|
export { withRootLedger, requestsToPeers, workerWaitTargets, computeWaitingOn, asksHuman, asksQuestion, hasResolvedWait, resolveWaitingOn, type WaitingOnInput, type WorkerWaitTarget, } from './waiting-on.ts';
|
|
7
|
-
export { isUsageLimitHold, WAIT_LIMIT, LAST_WAITS_LIMIT, TIMER_MIN_SECONDS, TIMER_MAX_SECONDS, PROCESS_TIMEOUT_DEFAULT_SECONDS, PROCESS_TIMEOUT_MAX_SECONDS, PROCESS_EXIT_FILE_MAX, PEER_WAIT_DEFAULT_SECONDS, PEER_WAIT_MAX_SECONDS, SUBAGENT_WAIT_DEADLINE_SECONDS, SUBAGENT_WAIT_GRACE_SECONDS, SUBAGENT_WAIT_CHILD_LIMIT, WAIT_MESSAGE_MAX, NOTE_MAX, PID_MIN, };
|
|
7
|
+
export { isUsageLimitHold, usageLimitHoldOf, WAIT_LIMIT, LAST_WAITS_LIMIT, TIMER_MIN_SECONDS, TIMER_MAX_SECONDS, PROCESS_TIMEOUT_DEFAULT_SECONDS, PROCESS_TIMEOUT_MAX_SECONDS, PROCESS_EXIT_FILE_MAX, PEER_WAIT_DEFAULT_SECONDS, PEER_WAIT_MAX_SECONDS, SUBAGENT_WAIT_DEADLINE_SECONDS, SUBAGENT_WAIT_GRACE_SECONDS, SUBAGENT_WAIT_CHILD_LIMIT, WAIT_MESSAGE_MAX, NOTE_MAX, PID_MIN, };
|
|
8
8
|
/** `open` → `resolved` (its event fired or its deadline passed) → `delivered`, or `cancelled`. */
|
|
9
9
|
export declare const waitPhaseSchema: z.ZodEnum<{
|
|
10
10
|
cancelled: "cancelled";
|