@hearsay-tools/squawk 0.18.0-pr4174.8066 → 0.18.0-pr4178.8069
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 +0 -2
- package/dist/contract/delegation.d.ts +0 -57
- package/dist/contract/index.js +144 -187
- package/dist/contract/run-predicates.d.ts +0 -9
- package/dist/contract/usage-limit-hold.d.ts +0 -7
- package/dist/contract/waits.d.ts +2 -2
- package/dist/delegation/cli.js +4 -8
- package/dist/delegation/cli.js.map +1 -1
- package/dist/delegation/conversation-send.js +4 -15
- package/dist/delegation/conversation-send.js.map +1 -1
- package/dist/delegation/conversations.js +0 -6
- package/dist/delegation/conversations.js.map +1 -1
- package/dist/delegation/execution-identity.d.ts +9 -53
- package/dist/delegation/execution-identity.js +9 -165
- package/dist/delegation/execution-identity.js.map +1 -1
- package/dist/delegation/park-notice.d.ts +3 -29
- package/dist/delegation/park-notice.js +4 -32
- 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 +0 -19
- package/dist/delegation/service.d.ts +0 -5
- package/dist/delegation/service.js +14 -93
- package/dist/delegation/service.js.map +1 -1
- package/dist/delegation/transport.d.ts +4 -23
- package/dist/delegation/worker-executions.d.ts +0 -2
- package/dist/delegation/worker-executions.js +1 -5
- package/dist/delegation/worker-executions.js.map +1 -1
- package/dist/runs/ports.d.ts +0 -2
- package/dist/server/provider-action-gate.js +1 -2
- package/dist/server/provider-action-gate.js.map +1 -1
- package/dist/server/run-accounts.d.ts +3 -4
- package/dist/server/run-accounts.js +5 -20
- package/dist/server/run-accounts.js.map +1 -1
- package/dist/server/runner-install-routes.d.ts +10 -10
- package/dist/server/server.d.ts +58 -72
- package/dist/server/server.js +1 -1
- package/dist/server/server.js.map +1 -1
- package/dist/workflows/continuation-admission.d.ts +0 -7
- package/dist/workflows/continuation-admission.js +8 -21
- 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 +1 -5
- package/dist/workflows/run/continuation-acceptance.js +29 -94
- package/dist/workflows/run/continuation-acceptance.js.map +1 -1
- package/dist/workflows/run/launch-read-resolver.d.ts +0 -6
- package/dist/workflows/run/launch-read-resolver.js +2 -13
- package/dist/workflows/run/launch-read-resolver.js.map +1 -1
- package/dist/workflows/run/run-settlement.js +0 -1
- package/dist/workflows/run/run-settlement.js.map +1 -1
- package/dist/workflows/run/worker-questions.d.ts +0 -4
- package/dist/workflows/run/worker-questions.js +8 -42
- 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-TDhV5kKW.js → accounts-section-D3P_Z-Nu.js} +1 -1
- package/web/dist/assets/{activity-motion-BfE9wCn7.js → activity-motion-BW-0k8s7.js} +1 -1
- package/web/dist/assets/{activity-route-DSBv6t6R.js → activity-route-Bpgblioe.js} +1 -1
- package/web/dist/assets/{agent-config-section-3bIgmLYR.js → agent-config-section-Cj3w7UIn.js} +1 -1
- package/web/dist/assets/{agent-defaults-section-Bfu8Tma5.js → agent-defaults-section-BJ4poe9c.js} +1 -1
- package/web/dist/assets/{appearance-DPE7X6-a.js → appearance-BUsUTPF0.js} +1 -1
- package/web/dist/assets/{archive-on-merge-field-Bx1bEmI8.js → archive-on-merge-field-D_kgBFNv.js} +1 -1
- package/web/dist/assets/attention-lvUYNNvV.js +1 -0
- package/web/dist/assets/{automation-format-BsnXeUET.js → automation-format-1lHzRTbq.js} +1 -1
- package/web/dist/assets/automations-route-CZaUrmDs.js +1 -0
- package/web/dist/assets/{cez-idle-Crszm9Ts.js → cez-idle-BY3rjM_y.js} +1 -1
- package/web/dist/assets/{commit-diff-panel-CLg6vURE.js → commit-diff-panel-xwLW6Ydr.js} +1 -1
- package/web/dist/assets/{diff-DE0Xb0Z5.js → diff-BB8SoL-s.js} +2 -2
- package/web/dist/assets/{diff-view-CGETvhPt.js → diff-view-O8lx1ztb.js} +1 -1
- package/web/dist/assets/{file-preview-DVQ7eTcT.js → file-preview-BS6M2tBo.js} +1 -1
- package/web/dist/assets/{folder-browser-G_9ZgDjg.js → folder-browser-Dsqz0Z1z.js} +1 -1
- package/web/dist/assets/{git-toolbar-DOvJwlcb.js → git-toolbar-DoPFA36c.js} +1 -1
- package/web/dist/assets/{github-3XgNmHF-.js → github-Bjy3WBvf.js} +1 -1
- package/web/dist/assets/{global-activity-route-7aoJOaT9.js → global-activity-route-BXBZKz_9.js} +1 -1
- package/web/dist/assets/index-CmadQXcg.js +21 -0
- package/web/dist/assets/{label-BWld23ke.js → label-CZp8t0zE.js} +1 -1
- package/web/dist/assets/live-protocol-D9ji1YCl.js +64 -0
- package/web/dist/assets/{markdown-63jCKOob.js → markdown-KHcncamw.js} +1 -1
- package/web/dist/assets/{notifications-section-fQ-nbk6G.js → notifications-section-DD21Sd79.js} +1 -1
- package/web/dist/assets/{open-in-menu-D03osLGE.js → open-in-menu-DdKs6X5r.js} +1 -1
- package/web/dist/assets/{preview-pane-connected-C_LORmfr.js → preview-pane-connected-BvTZv2SQ.js} +1 -1
- package/web/dist/assets/{project-location-BM-6wMI3.js → project-location-B3LBvkz2.js} +1 -1
- package/web/dist/assets/{project-router-DtTvMbeA.js → project-router-CIKODSHW.js} +1 -1
- package/web/dist/assets/project-scope-context-D1bpJixc.js +4 -0
- package/web/dist/assets/{projects-section-WlDXEr2U.js → projects-section-C0k8kyb-.js} +1 -1
- package/web/dist/assets/{prompt-templates-section-BrRD9W-C.js → prompt-templates-section-DNkosCni.js} +1 -1
- package/web/dist/assets/queries-dHXhD3Hc.js +1 -0
- package/web/dist/assets/{reference-chip-DeqB7ZMB.js → reference-chip-BWViAFIN.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-Dsz5ly3b.js → remote-settings-notice-DPCENbhz.js} +1 -1
- package/web/dist/assets/{repo-git-Bjx30PIk.js → repo-git-jKOnO3ba.js} +1 -1
- package/web/dist/assets/{report-reader-BIDMrkji.js → report-reader-DXYiKNcg.js} +1 -1
- package/web/dist/assets/{reports-CJmqlXn7.js → reports-DEE0bHNv.js} +1 -1
- package/web/dist/assets/{resources-section-C8KZ4hre.js → resources-section-lqXgYTrv.js} +1 -1
- package/web/dist/assets/{run-header-BzuB68Yq.js → run-header-CXlUbvDO.js} +1 -1
- package/web/dist/assets/runners-CGQjSsir.js +1 -0
- package/web/dist/assets/{settings-agent-picker-CSyeml1b.js → settings-agent-picker-BRvZn4kM.js} +1 -1
- package/web/dist/assets/{settings-shell-Cni3kHc9.js → settings-shell-DTtd-vIa.js} +1 -1
- package/web/dist/assets/{sidebar-section-CCg4QGtg.js → sidebar-section-BFW4ZfBR.js} +1 -1
- package/web/dist/assets/{skills-C-in30dy.js → skills-AImMlT1T.js} +1 -1
- package/web/dist/assets/{tab-link-Dl5Mmavw.js → tab-link-CM6SDBtV.js} +1 -1
- package/web/dist/assets/{task-changes-Bo4ZjMI9.js → task-changes-01Z_ppIw.js} +1 -1
- package/web/dist/assets/{task-commits-Ca0v06Ow.js → task-commits-DRNIum3J.js} +1 -1
- package/web/dist/assets/{task-files-1XZzDBKI.js → task-files-Crz7Fo3C.js} +1 -1
- package/web/dist/assets/{task-github-item-vJHng0ie.js → task-github-item-psG2V47c.js} +1 -1
- package/web/dist/assets/task-groups-DF0XoB6U.js +1 -0
- package/web/dist/assets/task-thread-Bqg91ZVZ.js +9 -0
- package/web/dist/assets/{tasks-table-DUrhAh4g.js → tasks-table-DHTEGteC.js} +1 -1
- package/web/dist/assets/{thread-state-CF0SB2iW.js → thread-state-BWJ2YyXo.js} +1 -1
- package/web/dist/assets/{use-hand-to-agent-state-B3y26akX.js → use-hand-to-agent-state-DNROQerR.js} +1 -1
- package/web/dist/assets/{useInfiniteQuery-BnyaEFle.js → useInfiniteQuery-qJeCNhM7.js} +1 -1
- package/web/dist/assets/useQuery-C3CQhXsT.js +1 -0
- package/web/dist/assets/{workflows-C6YdW7RT.js → workflows-Cx9lgrEo.js} +1 -1
- package/web/dist/assets/{workspace-tools-BDdrgrCg.js → workspace-tools-CVitt3kE.js} +1 -1
- package/web/dist/assets/{worktrees-section-DO1e87cC.js → worktrees-section-DxUg4l9n.js} +1 -1
- package/web/dist/assets/{ws-Bal5BUy2.js → ws-BisMp6U5.js} +1 -1
- package/web/dist/index.html +17 -17
- package/web/dist/live-worker.js +1 -1
- package/web/dist/assets/attention-otQlgfRj.js +0 -1
- package/web/dist/assets/automations-route-YYPPidII.js +0 -1
- package/web/dist/assets/index-CYYWiYLX.js +0 -21
- package/web/dist/assets/live-protocol-BXzu6cSE.js +0 -64
- package/web/dist/assets/project-scope-context-Dgq8_2JZ.js +0 -4
- package/web/dist/assets/queries-yuG-mM6_.js +0 -1
- package/web/dist/assets/runners-CDw7wLfd.js +0 -1
- package/web/dist/assets/task-groups-3jn_VZOd.js +0 -1
- package/web/dist/assets/task-thread-Cfgc4Wvc.js +0 -9
- package/web/dist/assets/useQuery-BUslvRIM.js +0 -1
|
@@ -314,8 +314,6 @@ 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>;
|
|
319
317
|
}, z.core.$strict>;
|
|
320
318
|
export type ConversationSendRequest = z.infer<typeof conversationSendRequestSchema>;
|
|
321
319
|
/** Effect of this call, independent of the stored delivery receipt and request outcome.
|
|
@@ -1251,16 +1251,6 @@ 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>;
|
|
1264
1254
|
export declare const workerInspectionSchema: z.ZodObject<{
|
|
1265
1255
|
workerId: z.ZodUUID;
|
|
1266
1256
|
settled: z.ZodBoolean;
|
|
@@ -1293,16 +1283,6 @@ export declare const workerInspectionSchema: z.ZodObject<{
|
|
|
1293
1283
|
}, z.core.$strict>], "kind">;
|
|
1294
1284
|
backend: z.ZodOptional<z.ZodString>;
|
|
1295
1285
|
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>>;
|
|
1306
1286
|
inputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1307
1287
|
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1308
1288
|
kind: z.ZodLiteral<"baseline-file">;
|
|
@@ -1488,15 +1468,6 @@ export declare const workerListEntrySchema: z.ZodObject<{
|
|
|
1488
1468
|
hostRunId: z.ZodUUID;
|
|
1489
1469
|
baselineSha: z.ZodString;
|
|
1490
1470
|
}, 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>>;
|
|
1500
1471
|
destroy: z.ZodOptional<z.ZodObject<{
|
|
1501
1472
|
requestedAt: z.ZodISODateTime;
|
|
1502
1473
|
phase: z.ZodEnum<{
|
|
@@ -1552,15 +1523,6 @@ export declare const workerListResultSchema: z.ZodObject<{
|
|
|
1552
1523
|
hostRunId: z.ZodUUID;
|
|
1553
1524
|
baselineSha: z.ZodString;
|
|
1554
1525
|
}, 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>>;
|
|
1564
1526
|
destroy: z.ZodOptional<z.ZodObject<{
|
|
1565
1527
|
requestedAt: z.ZodISODateTime;
|
|
1566
1528
|
phase: z.ZodEnum<{
|
|
@@ -1623,15 +1585,6 @@ export declare const workerListPageSchema: z.ZodObject<{
|
|
|
1623
1585
|
hostRunId: z.ZodUUID;
|
|
1624
1586
|
baselineSha: z.ZodString;
|
|
1625
1587
|
}, 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>>;
|
|
1635
1588
|
destroy: z.ZodOptional<z.ZodObject<{
|
|
1636
1589
|
requestedAt: z.ZodISODateTime;
|
|
1637
1590
|
phase: z.ZodEnum<{
|
|
@@ -1771,16 +1724,6 @@ export declare const runRelationshipsSchema: z.ZodObject<{
|
|
|
1771
1724
|
}, z.core.$strict>], "kind">;
|
|
1772
1725
|
backend: z.ZodOptional<z.ZodString>;
|
|
1773
1726
|
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>>;
|
|
1784
1727
|
inputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1785
1728
|
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1786
1729
|
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 z5 } from "zod";
|
|
3
3
|
|
|
4
4
|
// ../contract/src/conversations.ts
|
|
5
|
-
import { z as
|
|
5
|
+
import { z as z2 } from "zod";
|
|
6
6
|
|
|
7
7
|
// ../contract/src/ask-schema.ts
|
|
8
8
|
import { z } from "zod";
|
|
@@ -35,50 +35,38 @@ 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
|
-
|
|
50
38
|
// ../contract/src/conversations.ts
|
|
51
|
-
var conversationRelationshipSchema =
|
|
52
|
-
var conversationAttributionSchema =
|
|
53
|
-
senderRunId:
|
|
54
|
-
recipientRunId:
|
|
55
|
-
kind:
|
|
56
|
-
requestId:
|
|
39
|
+
var conversationRelationshipSchema = z2.enum(["family", "peer"]);
|
|
40
|
+
var conversationAttributionSchema = z2.object({
|
|
41
|
+
senderRunId: z2.uuid(),
|
|
42
|
+
recipientRunId: z2.uuid(),
|
|
43
|
+
kind: z2.enum(["request", "progress", "follow-up", "reply"]),
|
|
44
|
+
requestId: z2.uuid().optional(),
|
|
57
45
|
relationship: conversationRelationshipSchema.optional()
|
|
58
46
|
}).strict();
|
|
59
47
|
var conversationMessageSchema = conversationAttributionSchema.extend({
|
|
60
|
-
id:
|
|
61
|
-
text:
|
|
62
|
-
createdAt:
|
|
63
|
-
deadline:
|
|
64
|
-
requestHash:
|
|
65
|
-
state:
|
|
48
|
+
id: z2.uuid(),
|
|
49
|
+
text: z2.string().min(1).max(1e5),
|
|
50
|
+
createdAt: z2.iso.datetime(),
|
|
51
|
+
deadline: z2.iso.datetime().optional(),
|
|
52
|
+
requestHash: z2.string().regex(/^[0-9a-f]{64}$/),
|
|
53
|
+
state: z2.enum(["accepted", "continuation-required", "destroyed", "late"]),
|
|
66
54
|
/** A parent-authorized new execution; retained on exact message retries. */
|
|
67
|
-
resumed:
|
|
68
|
-
instruction:
|
|
55
|
+
resumed: z2.literal(true).optional(),
|
|
56
|
+
instruction: z2.string().max(2048).optional(),
|
|
69
57
|
/** A worker's question routed to its parent (#505): answered only by a reply naming it. */
|
|
70
58
|
question: askRequestSchema.optional()
|
|
71
59
|
});
|
|
72
|
-
var requestOutcomeSchema =
|
|
73
|
-
requestId:
|
|
60
|
+
var requestOutcomeSchema = z2.object({
|
|
61
|
+
requestId: z2.uuid(),
|
|
74
62
|
/** `deleted`: a peer recipient's record was deleted while the request was open. */
|
|
75
|
-
status:
|
|
76
|
-
observedAt:
|
|
77
|
-
replyId:
|
|
63
|
+
status: z2.enum(["replied", "replied-late", "completed-without-reply", "failed", "cancelled", "destroyed", "timed-out", "sender-closed", "human-fallback", "deleted"]),
|
|
64
|
+
observedAt: z2.iso.datetime(),
|
|
65
|
+
replyId: z2.uuid().optional()
|
|
78
66
|
}).strict();
|
|
79
|
-
var conversationStateSchema =
|
|
67
|
+
var conversationStateSchema = z2.object({ messages: z2.array(conversationMessageSchema).max(1024), outcomes: z2.array(requestOutcomeSchema).max(1024) }).strict();
|
|
80
68
|
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;
|
|
81
|
-
var conversationCursorSchema =
|
|
69
|
+
var conversationCursorSchema = z2.string().max(128).regex(CURSOR, "Not a history cursor; pass nextBefore from an earlier page");
|
|
82
70
|
function encodeConversationCursor(message2) {
|
|
83
71
|
return `${message2.createdAt}~${message2.id}`;
|
|
84
72
|
}
|
|
@@ -89,182 +77,180 @@ function decodeConversationCursor(cursor) {
|
|
|
89
77
|
}
|
|
90
78
|
var CONVERSATION_PAGE_MESSAGES = 1024;
|
|
91
79
|
var conversationInspectResultSchema = conversationStateSchema.extend({
|
|
92
|
-
hint:
|
|
80
|
+
hint: z2.string().optional(),
|
|
93
81
|
/** Present when older messages exist: pass it as `before` to read the page before this one. */
|
|
94
82
|
nextBefore: conversationCursorSchema.optional()
|
|
95
83
|
});
|
|
96
|
-
var inboxReserveResultSchema =
|
|
97
|
-
messages:
|
|
98
|
-
outcomes:
|
|
99
|
-
receiptId:
|
|
100
|
-
expiresAt:
|
|
84
|
+
var inboxReserveResultSchema = z2.object({
|
|
85
|
+
messages: z2.array(conversationMessageSchema).max(32),
|
|
86
|
+
outcomes: z2.array(requestOutcomeSchema).max(32),
|
|
87
|
+
receiptId: z2.uuid().optional(),
|
|
88
|
+
expiresAt: z2.iso.datetime().optional()
|
|
101
89
|
}).strict().refine(
|
|
102
90
|
(value) => value.messages.length > 0 ? value.receiptId !== void 0 && value.expiresAt !== void 0 : value.receiptId === void 0 && value.expiresAt === void 0,
|
|
103
91
|
{ message: "A nonempty inbox batch requires a receipt and expiry" }
|
|
104
92
|
);
|
|
105
|
-
var inboxReceiptRequestSchema =
|
|
106
|
-
var inboxReceiptResultSchema =
|
|
107
|
-
receiptId:
|
|
108
|
-
status:
|
|
93
|
+
var inboxReceiptRequestSchema = z2.object({ receiptId: z2.uuid() }).strict();
|
|
94
|
+
var inboxReceiptResultSchema = z2.object({
|
|
95
|
+
receiptId: z2.uuid(),
|
|
96
|
+
status: z2.enum(["acknowledged", "already-acknowledged", "released"])
|
|
109
97
|
}).strict();
|
|
110
98
|
var MAX_RESUME_REQUEST_SECONDS = 86400;
|
|
111
99
|
var MAX_CONVERSATION_REQUEST_SECONDS = 7200;
|
|
112
100
|
var DEFAULT_CONVERSATION_REQUEST_SECONDS = 600;
|
|
113
|
-
var conversationSendRequestSchema =
|
|
114
|
-
id:
|
|
115
|
-
recipientRunId:
|
|
101
|
+
var conversationSendRequestSchema = z2.object({
|
|
102
|
+
id: z2.uuid(),
|
|
103
|
+
recipientRunId: z2.uuid(),
|
|
116
104
|
kind: conversationAttributionSchema.shape.kind,
|
|
117
|
-
requestId:
|
|
118
|
-
text:
|
|
119
|
-
timeoutSeconds:
|
|
120
|
-
resume:
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
var
|
|
125
|
-
var
|
|
126
|
-
var
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
mode: z3.enum(["one", "any", "all"]).optional(),
|
|
131
|
-
timeoutSeconds: z3.number().int().min(1).max(7200).default(600)
|
|
105
|
+
requestId: z2.uuid().optional(),
|
|
106
|
+
text: z2.string().min(1).max(1e5).refine((text) => text.trim().length > 0),
|
|
107
|
+
timeoutSeconds: z2.number().int().min(1).max(MAX_RESUME_REQUEST_SECONDS).default(DEFAULT_CONVERSATION_REQUEST_SECONDS),
|
|
108
|
+
resume: z2.boolean().optional()
|
|
109
|
+
}).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" });
|
|
110
|
+
var conversationSendEffectSchema = z2.enum(["applied", "unchanged", "refused", "unknown"]);
|
|
111
|
+
var conversationSendResultSchema = z2.object({ message: conversationMessageSchema, delivery: z2.enum(["queued", "delivered", "consumed", "not-delivered"]), outcome: requestOutcomeSchema.optional(), effect: conversationSendEffectSchema.optional() }).strict();
|
|
112
|
+
var conversationInspectRequestSchema = z2.object({ recipientRunId: z2.uuid(), before: conversationCursorSchema.optional() }).strict();
|
|
113
|
+
var conversationCancelRequestSchema = z2.object({ requestId: z2.uuid() }).strict();
|
|
114
|
+
var requestWaitRequestSchema = z2.object({
|
|
115
|
+
requestIds: z2.array(z2.uuid()).min(1).max(32).refine((ids) => new Set(ids).size === ids.length),
|
|
116
|
+
mode: z2.enum(["one", "any", "all"]).optional(),
|
|
117
|
+
timeoutSeconds: z2.number().int().min(1).max(7200).default(600)
|
|
132
118
|
}).strict().refine((value) => value.mode !== "one" || value.requestIds.length === 1, { message: "one requires exactly one request" });
|
|
133
119
|
|
|
134
120
|
// ../contract/src/agent-input.ts
|
|
135
|
-
import { z as
|
|
136
|
-
var inboxClaimSchema =
|
|
137
|
-
receiptId:
|
|
138
|
-
generation:
|
|
139
|
-
expiresAt:
|
|
140
|
-
acknowledgedAt:
|
|
121
|
+
import { z as z3 } from "zod";
|
|
122
|
+
var inboxClaimSchema = z3.object({
|
|
123
|
+
receiptId: z3.uuid(),
|
|
124
|
+
generation: z3.uuid(),
|
|
125
|
+
expiresAt: z3.iso.datetime(),
|
|
126
|
+
acknowledgedAt: z3.iso.datetime().optional(),
|
|
141
127
|
/** Optional on read for receipts persisted before member manifests existed. */
|
|
142
|
-
memberIds:
|
|
128
|
+
memberIds: z3.array(z3.uuid()).min(1).max(32).refine((ids) => new Set(ids).size === ids.length).optional()
|
|
143
129
|
}).strict();
|
|
144
|
-
var agentInputSchema =
|
|
130
|
+
var agentInputSchema = z3.object({
|
|
145
131
|
conversation: conversationAttributionSchema.optional(),
|
|
146
|
-
id:
|
|
147
|
-
source:
|
|
148
|
-
parentRunId:
|
|
149
|
-
text:
|
|
150
|
-
createdAt:
|
|
151
|
-
deliveredAt:
|
|
132
|
+
id: z3.uuid(),
|
|
133
|
+
source: z3.enum(["agent", "lifecycle"]),
|
|
134
|
+
parentRunId: z3.uuid(),
|
|
135
|
+
text: z3.string().min(1).max(1e5),
|
|
136
|
+
createdAt: z3.iso.datetime(),
|
|
137
|
+
deliveredAt: z3.iso.datetime().optional(),
|
|
152
138
|
/** The model received it, when the harness can show that (#505). Absent on
|
|
153
139
|
* unobservable backends and on records written before #505. */
|
|
154
|
-
consumedAt:
|
|
140
|
+
consumedAt: z3.iso.datetime().optional(),
|
|
155
141
|
/** Accepted by a harness that reports reading, and not read yet. A restart replays
|
|
156
142
|
* such input; records written before #505 never carry it, so nothing historical replays. */
|
|
157
|
-
awaitingRead:
|
|
143
|
+
awaitingRead: z3.literal(true).optional(),
|
|
158
144
|
inboxClaim: inboxClaimSchema.optional(),
|
|
159
145
|
/** A completion refusal Squawk queued for a closed session (hearsay-tools/cezarion#1301): its
|
|
160
146
|
* delivery is the nudge's turn, bounded by the nudge's reply bound, and a session that closes
|
|
161
147
|
* before it is a failed delivery. `undelivered-question` is Squawk's answer to a worker question
|
|
162
148
|
* that could not reach its live parent (hearsay-tools/cezarion#2410). Absent on every other input
|
|
163
149
|
* and on records written before. */
|
|
164
|
-
purpose:
|
|
150
|
+
purpose: z3.enum(["completion-refusal", "undelivered-question"]).optional(),
|
|
165
151
|
/** A peer message's own hash and request deadline (hearsay-tools/cezarion#1990): the sender's
|
|
166
152
|
* ledger can be deleted before the recipient reads it. Absent on family and lifecycle inputs. */
|
|
167
|
-
requestHash:
|
|
168
|
-
deadline:
|
|
153
|
+
requestHash: z3.string().regex(/^[0-9a-f]{64}$/).optional(),
|
|
154
|
+
deadline: z3.iso.datetime().optional()
|
|
169
155
|
}).strict();
|
|
170
156
|
|
|
171
157
|
// ../contract/src/worker-outcome.ts
|
|
172
|
-
import { z as
|
|
173
|
-
var workerOutcomeSchema =
|
|
174
|
-
workerId:
|
|
175
|
-
status:
|
|
176
|
-
observedAt:
|
|
177
|
-
summary:
|
|
178
|
-
revision:
|
|
158
|
+
import { z as z4 } from "zod";
|
|
159
|
+
var workerOutcomeSchema = z4.object({
|
|
160
|
+
workerId: z4.uuid(),
|
|
161
|
+
status: z4.enum(["review", "done", "failed", "cancelled"]),
|
|
162
|
+
observedAt: z4.iso.datetime(),
|
|
163
|
+
summary: z4.string().max(4e3).optional(),
|
|
164
|
+
revision: z4.number().int().nonnegative().optional()
|
|
179
165
|
}).strict();
|
|
180
|
-
var workerWaitModeSchema =
|
|
166
|
+
var workerWaitModeSchema = z4.enum(["one", "any", "all"]);
|
|
181
167
|
|
|
182
168
|
// ../contract/src/events.ts
|
|
183
|
-
var runEventSchema =
|
|
184
|
-
seq:
|
|
185
|
-
ts:
|
|
186
|
-
stepId:
|
|
187
|
-
type:
|
|
188
|
-
});
|
|
189
|
-
var conversationMessageEventSchema = runEventSchema.extend({ type:
|
|
190
|
-
var requestOutcomeEventSchema = runEventSchema.extend({ type:
|
|
169
|
+
var runEventSchema = z5.looseObject({
|
|
170
|
+
seq: z5.number(),
|
|
171
|
+
ts: z5.string(),
|
|
172
|
+
stepId: z5.string().optional(),
|
|
173
|
+
type: z5.string()
|
|
174
|
+
});
|
|
175
|
+
var conversationMessageEventSchema = runEventSchema.extend({ type: z5.literal("conversation-message"), message: conversationMessageSchema, delivery: z5.enum(["queued", "delivered", "consumed", "not-delivered"]), deliveredAt: z5.iso.datetime().optional(), consumedAt: z5.iso.datetime().optional() });
|
|
176
|
+
var requestOutcomeEventSchema = runEventSchema.extend({ type: z5.literal("request-outcome"), outcome: requestOutcomeSchema });
|
|
191
177
|
var agentInputEventSchema = runEventSchema.extend({
|
|
192
|
-
type:
|
|
178
|
+
type: z5.literal("agent-input"),
|
|
193
179
|
input: agentInputSchema
|
|
194
180
|
});
|
|
195
181
|
var humanInputDeliveredEventSchema = runEventSchema.extend({
|
|
196
|
-
type:
|
|
197
|
-
askSeq:
|
|
182
|
+
type: z5.literal("human-input-delivered"),
|
|
183
|
+
askSeq: z5.number().int().nonnegative(),
|
|
198
184
|
/** Who answered: absent (records before #505) or `human` is a person; `parent` is the
|
|
199
185
|
* owning parent's reply to a routed worker question; `cezar` is Squawk's notice that the question
|
|
200
186
|
* could not reach a live parent (hearsay-tools/cezarion#2410). */
|
|
201
|
-
source:
|
|
187
|
+
source: z5.enum(["human", "parent", "cezar"]).optional()
|
|
202
188
|
});
|
|
203
189
|
var humanAskClosedEventSchema = runEventSchema.extend({
|
|
204
|
-
type:
|
|
205
|
-
askSeq:
|
|
206
|
-
reason:
|
|
190
|
+
type: z5.literal("human-ask-closed"),
|
|
191
|
+
askSeq: z5.number().int().nonnegative(),
|
|
192
|
+
reason: z5.enum(["finish", "superseded", "parent-stopped", "worker-stopped", "undeliverable"])
|
|
207
193
|
});
|
|
208
194
|
var workerQuestionRoutedEventSchema = runEventSchema.extend({
|
|
209
|
-
type:
|
|
210
|
-
askSeq:
|
|
211
|
-
messageId:
|
|
212
|
-
parentRunId:
|
|
195
|
+
type: z5.literal("worker-question-routed"),
|
|
196
|
+
askSeq: z5.number().int().nonnegative(),
|
|
197
|
+
messageId: z5.uuid(),
|
|
198
|
+
parentRunId: z5.uuid()
|
|
213
199
|
});
|
|
214
200
|
var workerQuestionFallbackEventSchema = runEventSchema.extend({
|
|
215
|
-
type:
|
|
216
|
-
askSeq:
|
|
217
|
-
reason:
|
|
201
|
+
type: z5.literal("worker-question-fallback"),
|
|
202
|
+
askSeq: z5.number().int().nonnegative(),
|
|
203
|
+
reason: z5.string().min(1).max(200)
|
|
218
204
|
});
|
|
219
205
|
var workerQuestionUndeliveredEventSchema = runEventSchema.extend({
|
|
220
|
-
type:
|
|
221
|
-
askSeq:
|
|
222
|
-
reason:
|
|
206
|
+
type: z5.literal("worker-question-undelivered"),
|
|
207
|
+
askSeq: z5.number().int().nonnegative(),
|
|
208
|
+
reason: z5.string().min(1).max(200)
|
|
223
209
|
});
|
|
224
210
|
var workerOutcomeEventSchema = runEventSchema.extend({
|
|
225
|
-
type:
|
|
211
|
+
type: z5.literal("worker-outcome"),
|
|
226
212
|
outcome: workerOutcomeSchema
|
|
227
213
|
});
|
|
228
214
|
var RUN_HISTORY_PAGE_ITEMS = 100;
|
|
229
|
-
var runIdParamSchema =
|
|
230
|
-
id:
|
|
215
|
+
var runIdParamSchema = z5.object({
|
|
216
|
+
id: z5.string().min(1).max(128).regex(/^[A-Za-z0-9._-]+$/)
|
|
231
217
|
});
|
|
232
|
-
var runHistoryCursorSchema =
|
|
233
|
-
var runHistoryQuerySchema =
|
|
218
|
+
var runHistoryCursorSchema = z5.string().min(1).max(2048);
|
|
219
|
+
var runHistoryQuerySchema = z5.object({
|
|
234
220
|
cursor: runHistoryCursorSchema.optional()
|
|
235
221
|
});
|
|
236
|
-
var runEventsQuerySchema =
|
|
222
|
+
var runEventsQuerySchema = z5.object({
|
|
237
223
|
cursor: runHistoryCursorSchema.optional(),
|
|
238
|
-
afterSeq:
|
|
239
|
-
});
|
|
240
|
-
var runHistoryEventSchema =
|
|
241
|
-
seq:
|
|
242
|
-
ts:
|
|
243
|
-
stepId:
|
|
244
|
-
type:
|
|
245
|
-
}).catchall(
|
|
246
|
-
var runHistoryPageSchema =
|
|
247
|
-
events:
|
|
248
|
-
itemCount:
|
|
224
|
+
afterSeq: z5.coerce.number().int().nonnegative().optional()
|
|
225
|
+
});
|
|
226
|
+
var runHistoryEventSchema = z5.object({
|
|
227
|
+
seq: z5.number(),
|
|
228
|
+
ts: z5.string(),
|
|
229
|
+
stepId: z5.string().optional(),
|
|
230
|
+
type: z5.string()
|
|
231
|
+
}).catchall(z5.any());
|
|
232
|
+
var runHistoryPageSchema = z5.object({
|
|
233
|
+
events: z5.array(runHistoryEventSchema),
|
|
234
|
+
itemCount: z5.number().int().min(0).max(RUN_HISTORY_PAGE_ITEMS),
|
|
249
235
|
olderCursor: runHistoryCursorSchema.optional(),
|
|
250
236
|
newerCursor: runHistoryCursorSchema.optional(),
|
|
251
237
|
liveCursor: runHistoryCursorSchema,
|
|
252
|
-
asOfSeq:
|
|
253
|
-
hasOlder:
|
|
254
|
-
});
|
|
255
|
-
var runHistoryContextSchema =
|
|
256
|
-
contextEvents:
|
|
257
|
-
asOfSeq:
|
|
258
|
-
});
|
|
259
|
-
var checkoutProgressEventSchema =
|
|
260
|
-
checkoutId:
|
|
261
|
-
name:
|
|
262
|
-
phase:
|
|
263
|
-
line:
|
|
264
|
-
error:
|
|
238
|
+
asOfSeq: z5.number().int().nonnegative(),
|
|
239
|
+
hasOlder: z5.boolean()
|
|
240
|
+
});
|
|
241
|
+
var runHistoryContextSchema = z5.object({
|
|
242
|
+
contextEvents: z5.array(runHistoryEventSchema),
|
|
243
|
+
asOfSeq: z5.number().int().nonnegative()
|
|
244
|
+
});
|
|
245
|
+
var checkoutProgressEventSchema = z5.object({
|
|
246
|
+
checkoutId: z5.string().optional(),
|
|
247
|
+
name: z5.string(),
|
|
248
|
+
phase: z5.enum(["cloning", "done", "error"]),
|
|
249
|
+
line: z5.string().optional(),
|
|
250
|
+
error: z5.string().optional(),
|
|
265
251
|
/** On `done` only: the project was created and registered, but a later step did not finish
|
|
266
252
|
* (new-project flow, spec 2026-10-15-create-new-project). Names what exists and how to finish. */
|
|
267
|
-
warning:
|
|
253
|
+
warning: z5.string().optional()
|
|
268
254
|
});
|
|
269
255
|
|
|
270
256
|
// ../contract/src/ask.ts
|
|
@@ -314,6 +300,18 @@ function askCardOf(ask) {
|
|
|
314
300
|
// ../contract/src/delegation.ts
|
|
315
301
|
import { z as z10 } from "zod";
|
|
316
302
|
|
|
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
|
+
|
|
317
315
|
// ../contract/src/run-status.ts
|
|
318
316
|
import { z as z7 } from "zod";
|
|
319
317
|
var runStatusSchema = z7.enum([
|
|
@@ -708,12 +706,6 @@ var workerWaitRequestSchema = z10.object({
|
|
|
708
706
|
timeoutSeconds: z10.number().int().min(1).max(7200).default(600),
|
|
709
707
|
mode: workerWaitModeSchema.optional()
|
|
710
708
|
}).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();
|
|
717
709
|
var workerInspectionSchema = z10.object({
|
|
718
710
|
workerId: z10.uuid(),
|
|
719
711
|
settled: z10.boolean(),
|
|
@@ -726,8 +718,6 @@ var workerInspectionSchema = z10.object({
|
|
|
726
718
|
workspace: workerWorkspaceSchema,
|
|
727
719
|
backend: workerBackendSchema.optional(),
|
|
728
720
|
model: z10.string().max(512).optional(),
|
|
729
|
-
effort: effortFieldSchema,
|
|
730
|
-
hold: workerHoldSchema.optional(),
|
|
731
721
|
inputs: z10.array(workerInputSchema).max(32).optional(),
|
|
732
722
|
wait: workerWaitSchema.optional(),
|
|
733
723
|
/** The parent's deadline-less completion wait on this worker (hearsay-tools/cezarion#1301). */
|
|
@@ -744,7 +734,6 @@ var workerListEntrySchema = workerInspectionSchema.pick({
|
|
|
744
734
|
supervisorRunId: true,
|
|
745
735
|
status: true,
|
|
746
736
|
workspace: true,
|
|
747
|
-
hold: true,
|
|
748
737
|
destroy: true
|
|
749
738
|
}).extend({
|
|
750
739
|
revision: z10.number().int().nonnegative(),
|
|
@@ -1578,15 +1567,6 @@ var ciWaitReceiptSchema = ciPrIdentitySchema.extend({
|
|
|
1578
1567
|
function isUsageLimitHold(run) {
|
|
1579
1568
|
return run.status === "waiting" && run.autoResumeAt !== void 0;
|
|
1580
1569
|
}
|
|
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
|
-
}
|
|
1590
1570
|
|
|
1591
1571
|
// ../contract/src/wait-limits.ts
|
|
1592
1572
|
var WAIT_LIMIT = 16;
|
|
@@ -4819,26 +4799,6 @@ function latestSession(run) {
|
|
|
4819
4799
|
const step = removedRunnerStepAfter(run.steps, latest?.sessionId) ? void 0 : latest;
|
|
4820
4800
|
return { sessionId: step?.sessionId, backend: sessionRunner(step, run), profileId: step?.profileId };
|
|
4821
4801
|
}
|
|
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 !== "done") 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
|
-
}
|
|
4842
4802
|
var LIVE_STATUSES = /* @__PURE__ */ new Set(["queued", "running", "waiting"]);
|
|
4843
4803
|
function isLiveStatus(status) {
|
|
4844
4804
|
return LIVE_STATUSES.has(status);
|
|
@@ -6877,7 +6837,6 @@ export {
|
|
|
6877
6837
|
updateProjectInputSchema,
|
|
6878
6838
|
updateProjectResponseSchema,
|
|
6879
6839
|
updateProjectWebhookInputSchema,
|
|
6880
|
-
usageLimitHoldOf,
|
|
6881
6840
|
userMcpListingSchema,
|
|
6882
6841
|
utcMinute,
|
|
6883
6842
|
waitErrorCodeSchema,
|
|
@@ -6901,7 +6860,6 @@ export {
|
|
|
6901
6860
|
workerCompletionWaitSchema,
|
|
6902
6861
|
workerContextReferenceSchema,
|
|
6903
6862
|
workerContextSchema,
|
|
6904
|
-
workerContinuationStep,
|
|
6905
6863
|
workerCreationReceiptSchema,
|
|
6906
6864
|
workerDestroyRequestSchema,
|
|
6907
6865
|
workerDestroyResultSchema,
|
|
@@ -6911,7 +6869,6 @@ export {
|
|
|
6911
6869
|
workerDestroyWorkSchema,
|
|
6912
6870
|
workerDiffSchema,
|
|
6913
6871
|
workerEmptyRequestSchema,
|
|
6914
|
-
workerHoldSchema,
|
|
6915
6872
|
workerIdsSchema,
|
|
6916
6873
|
workerInputRecipeSchema,
|
|
6917
6874
|
workerInputSchema,
|
|
@@ -32,15 +32,6 @@ 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;
|
|
44
35
|
/** Status-only live predicate: queued, running or waiting. */
|
|
45
36
|
export declare function isLiveStatus(status: string): boolean;
|
|
46
37
|
type OwnershipInput = Pick<RunRecord, 'status'> & Partial<Pick<RunRecord, 'autoResumeAt'>>;
|
|
@@ -13,10 +13,3 @@ 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
|
|
4
|
+
import { isUsageLimitHold } 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,
|
|
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, };
|
|
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";
|