@hearsay-tools/squawk 0.18.0-dev.7412 → 0.18.0-dev.7420
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/activity/wait.js.map +1 -1
- package/dist/automations/github-poller.d.ts +3 -0
- package/dist/automations/github-poller.js +5 -1
- package/dist/automations/github-poller.js.map +1 -1
- package/dist/automations/github-repository.d.ts +2 -2
- package/dist/automations/github-repository.js +7 -1
- package/dist/automations/github-repository.js.map +1 -1
- package/dist/automations/scheduler.d.ts +2 -0
- package/dist/automations/scheduler.js +26 -2
- package/dist/automations/scheduler.js.map +1 -1
- package/dist/ci-wait/controller.d.ts +46 -46
- package/dist/ci-wait/errors.d.ts +1 -1
- package/dist/ci-wait/errors.js.map +1 -1
- package/dist/ci-wait/github.d.ts +8 -12
- package/dist/ci-wait/github.js +14 -49
- package/dist/ci-wait/github.js.map +1 -1
- package/dist/ci-wait/supervisor.js +4 -3
- package/dist/ci-wait/supervisor.js.map +1 -1
- package/dist/ci-wait/tools.d.ts +4 -4
- package/dist/contract/agent-input.d.ts +56 -0
- package/dist/contract/delegation.d.ts +2 -68
- package/dist/contract/index.js +2571 -2561
- package/dist/contract/wait-limits.d.ts +22 -0
- package/dist/contract/waiting-on.d.ts +46 -0
- package/dist/contract/waits.d.ts +4 -74
- package/dist/contract/worker-outcome.d.ts +24 -0
- package/dist/delegation/input.js.map +1 -1
- package/dist/delegation/routes.d.ts +71 -71
- package/dist/delegation/transport.d.ts +77 -77
- package/dist/runs/delegation-state.d.ts +2 -1
- package/dist/runs/delegation-state.js.map +1 -1
- package/dist/runs/legacy-waits.js.map +1 -1
- package/dist/runs/live-tasks.js.map +1 -1
- package/dist/runs/outcome-commit.js.map +1 -1
- package/dist/runs/record-write-rules.js +2 -1
- package/dist/runs/record-write-rules.js.map +1 -1
- package/dist/runs/store.d.ts +72 -72
- package/dist/runs/store.js +4 -2
- package/dist/runs/store.js.map +1 -1
- package/dist/runs/wait-capacity.js.map +1 -1
- package/dist/runs/wait-registration-write.js.map +1 -1
- package/dist/runs/webhook.js.map +1 -1
- package/dist/server/activity-routes.d.ts +23 -23
- package/dist/server/archive-on-merge.js +6 -1
- package/dist/server/archive-on-merge.js.map +1 -1
- package/dist/server/forge/github-merged-pr-chunk.d.ts +5 -0
- package/dist/server/forge/github-merged-pr-chunk.js +45 -0
- package/dist/server/forge/github-merged-pr-chunk.js.map +1 -0
- package/dist/server/forge/github-repo-handle.d.ts +3 -2
- package/dist/server/forge/github-repo-handle.js +4 -3
- package/dist/server/forge/github-repo-handle.js.map +1 -1
- package/dist/server/forge/github-request-gate.d.ts +64 -0
- package/dist/server/forge/github-request-gate.js +152 -0
- package/dist/server/forge/github-request-gate.js.map +1 -0
- package/dist/server/forge/github.js +4 -44
- package/dist/server/forge/github.js.map +1 -1
- package/dist/server/live-routes.d.ts +6 -6
- package/dist/server/reports-api.d.ts +2 -2
- package/dist/server/run-checkout.js.map +1 -1
- package/dist/server/server.d.ts +1598 -1598
- package/dist/task-cli/cli.js.map +1 -1
- package/dist/workflows/completion-policy.js.map +1 -1
- package/dist/workflows/continuation-admission.js.map +1 -1
- package/dist/workflows/run/auto-resume.js.map +1 -1
- package/dist/workflows/run/continuation-acceptance.js.map +1 -1
- package/dist/workflows/run/run-cancel.js +2 -1
- package/dist/workflows/run/run-cancel.js.map +1 -1
- package/dist/workflows/run/run-line.js.map +1 -1
- package/dist/workflows/run/run-recovery.js.map +1 -1
- package/dist/workflows/run/subagent-waits.d.ts +1 -1
- package/dist/workflows/run/subagent-waits.js.map +1 -1
- package/dist/workflows/run/turn-settler.js.map +1 -1
- package/dist/workflows/run/wait-kinds.js +2 -1
- package/dist/workflows/run/wait-kinds.js.map +1 -1
- package/dist/workflows/run/wake-admission.d.ts +1 -1
- package/dist/workflows/run/wake-admission.js +2 -1
- package/dist/workflows/run/wake-admission.js.map +1 -1
- package/dist/workflows/run-scheduling.js.map +1 -1
- package/dist/workflows/run-states.js.map +1 -1
- package/dist/workflows/run.d.ts +2 -1
- package/dist/workflows/run.js.map +1 -1
- package/dist/workflows/wait-scope.js.map +1 -1
- package/dist/workflows/waits.d.ts +2 -1
- package/dist/workflows/waits.js.map +1 -1
- package/package.json +4 -4
- package/web/dist/assets/activity-motion-CFD_Hwe7.js +2 -0
- package/web/dist/assets/{activity-route-1W0U2NqM.js → activity-route-BbwWWjLu.js} +1 -1
- package/web/dist/assets/agent-accounts-DuPt97Nw.js +1 -0
- package/web/dist/assets/attention-BmEhfFZ0.js +1 -0
- package/web/dist/assets/cez-idle-C7yy2Oqo.js +1 -0
- package/web/dist/assets/{commit-diff-panel-DkvsBvlr.js → commit-diff-panel-Bnvq61J-.js} +1 -1
- package/web/dist/assets/{diff-BCSgE1l6.js → diff-B8GNyr9F.js} +2 -2
- package/web/dist/assets/{diff-view-B3eMq9Uw.js → diff-view-tvmfpdwD.js} +1 -1
- package/web/dist/assets/{file-preview-BIHQ0YTn.js → file-preview-DyJ7pa7M.js} +1 -1
- package/web/dist/assets/{git-toolbar-BtU7xtmD.js → git-toolbar-BEwf9FAg.js} +1 -1
- package/web/dist/assets/{github-INQcTy36.js → github-065AS6rF.js} +1 -1
- package/web/dist/assets/{global-activity-route-B3-2eIFG.js → global-activity-route-BTzn2tW0.js} +1 -1
- package/web/dist/assets/index-B1a7IUEx.js +14 -0
- package/web/dist/assets/live-protocol-CjfZMf1X.js +64 -0
- package/web/dist/assets/{markdown-DcRzCfVU.js → markdown-WEuLU4Vx.js} +1 -1
- package/web/dist/assets/picker-pill-S8ZHSbEz.js +15 -0
- package/web/dist/assets/{preview-pane-connected-CCHDk6rz.js → preview-pane-connected-8L_L03y-.js} +2 -2
- package/web/dist/assets/{project-router-_V9XDi3p.js → project-router-DghsITyi.js} +1 -1
- package/web/dist/assets/project-scope-context-DNKOo_im.js +4 -0
- package/web/dist/assets/{prompt-template-menu-C60uqznw.js → prompt-template-menu-CWB1yVtQ.js} +1 -1
- package/web/dist/assets/queries-bxk8LCaR.js +1 -0
- package/web/dist/assets/{reference-chip-GElOouoU.js → reference-chip-BPDNXClC.js} +1 -1
- package/web/dist/assets/repo-git-C8f2sO_m.js +1 -0
- package/web/dist/assets/{report-reader-y4t2Prir.js → report-reader-DfsQnNMV.js} +1 -1
- package/web/dist/assets/reports-DnROeG5A.js +1 -0
- package/web/dist/assets/run-header-HqBmAMyy.js +2 -0
- package/web/dist/assets/{skills-C6V0Yo95.js → skills-B06yAjnR.js} +1 -1
- package/web/dist/assets/{tab-link-CuL027Wh.js → tab-link-CJVHsPcP.js} +1 -1
- package/web/dist/assets/{task-changes-Dx9OTRkk.js → task-changes-DwKiWfHR.js} +1 -1
- package/web/dist/assets/{task-commits-ClWR4wQR.js → task-commits-DDh8b5KF.js} +1 -1
- package/web/dist/assets/{task-files-DCkrdsrz.js → task-files--h7-YLZ5.js} +1 -1
- package/web/dist/assets/{task-github-item-C3D4vDw7.js → task-github-item-Djf7nc-_.js} +1 -1
- package/web/dist/assets/task-thread-B_Oe62EY.js +9 -0
- package/web/dist/assets/thread-state-C0SrNkfb.js +4 -0
- package/web/dist/assets/use-desktop-DPqRiTb2.js +1 -0
- package/web/dist/assets/{use-hand-to-agent-state-VmvgZIh6.js → use-hand-to-agent-state-BnOqq8ll.js} +1 -1
- package/web/dist/assets/{useInfiniteQuery-DbCUWSLK.js → useInfiniteQuery-DiYIgx71.js} +1 -1
- package/web/dist/assets/useQuery-DbMHYDKn.js +1 -0
- package/web/dist/assets/{workflows-B_HWC2FT.js → workflows-3Sy7hfUX.js} +2 -2
- package/web/dist/assets/{ws-jytXIi1s.js → ws-C09Vt-Eu.js} +1 -1
- package/web/dist/index.html +15 -15
- package/web/dist/live-worker.js +1 -1
- package/web/dist/assets/activity-motion-CjiZJB7H.js +0 -2
- package/web/dist/assets/agent-accounts-DJbSC2sB.js +0 -1
- package/web/dist/assets/attention-BdI3xSwD.js +0 -1
- package/web/dist/assets/cez-idle-CKE0WtrH.js +0 -1
- package/web/dist/assets/index-DUuc-42H.js +0 -14
- package/web/dist/assets/live-protocol-B5jzpJgG.js +0 -64
- package/web/dist/assets/picker-pill-x0hXGTLP.js +0 -15
- package/web/dist/assets/project-scope-context-VENshCVj.js +0 -4
- package/web/dist/assets/queries-r1Fc1fWN.js +0 -1
- package/web/dist/assets/repo-git-B09hWAxY.js +0 -1
- package/web/dist/assets/reports-BU3a_4kU.js +0 -1
- package/web/dist/assets/run-header-BZukpHEK.js +0 -2
- package/web/dist/assets/task-thread-D0sTMg9h.js +0 -9
- package/web/dist/assets/thread-state-BHSYtS79.js +0 -4
- package/web/dist/assets/use-desktop-BnWAyH1e.js +0 -1
- package/web/dist/assets/useQuery-CxWGWuW4.js +0 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bounds of the wait list in `waits.ts`. Many Squawk modules read only these numbers, so they
|
|
3
|
+
* live in a module with no runtime imports; `waits.ts` re-exports them (hearsay-tools/squawk#3245).
|
|
4
|
+
*/
|
|
5
|
+
export declare const WAIT_LIMIT = 16;
|
|
6
|
+
export declare const LAST_WAITS_LIMIT = 16;
|
|
7
|
+
export declare const TIMER_MIN_SECONDS = 60;
|
|
8
|
+
export declare const TIMER_MAX_SECONDS = 7200;
|
|
9
|
+
/** A process wait's bounds (hearsay-tools/cezarion#1446): the CI wait's timeout range. */
|
|
10
|
+
export declare const PROCESS_TIMEOUT_DEFAULT_SECONDS = 1800;
|
|
11
|
+
export declare const PROCESS_TIMEOUT_MAX_SECONDS = 7200;
|
|
12
|
+
export declare const PROCESS_EXIT_FILE_MAX = 4096;
|
|
13
|
+
/** A peer wait's deadline, and a request or worker wait's (hearsay-tools/cezarion#1995). */
|
|
14
|
+
export declare const PEER_WAIT_DEFAULT_SECONDS = 600;
|
|
15
|
+
export declare const PEER_WAIT_MAX_SECONDS = 7200;
|
|
16
|
+
/** A subagent wait (hearsay-tools/cezarion#2431): its safety deadline after the last child event,
|
|
17
|
+
* the grace after the last child ends before Squawk wakes the parent, and its child bound. */
|
|
18
|
+
export declare const SUBAGENT_WAIT_DEADLINE_SECONDS = 1800;
|
|
19
|
+
export declare const SUBAGENT_WAIT_GRACE_SECONDS = 15;
|
|
20
|
+
export declare const SUBAGENT_WAIT_CHILD_LIMIT = 32;
|
|
21
|
+
/** The bound on every wait and done refusal's `message`; the run manager fits its own to it. */
|
|
22
|
+
export declare const WAIT_MESSAGE_MAX = 4096;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { DelegationState, RunDelegationSummary } from './delegation.ts';
|
|
2
|
+
import type { RunRecord } from './runs.ts';
|
|
3
|
+
import type { WaitingOn, WorkerWaitEntry } from './waits.ts';
|
|
4
|
+
/**
|
|
5
|
+
* What a run waits on, read from its wait list in `waits.ts`. The attention ladder, the run
|
|
6
|
+
* summary and many Squawk modules read these functions without the wait schemas, so they live in
|
|
7
|
+
* a module whose only runtime import is `usage-limit-hold.ts`; `waits.ts` re-exports them
|
|
8
|
+
* (hearsay-tools/squawk#3245).
|
|
9
|
+
*/
|
|
10
|
+
/** Full records carry the full delegation state; summaries and index rows the slim projection. */
|
|
11
|
+
export type WaitingOnInput = Partial<Pick<RunRecord, 'status' | 'waits' | 'autoResumeAt'>> & {
|
|
12
|
+
delegation?: DelegationState | RunDelegationSummary | undefined;
|
|
13
|
+
};
|
|
14
|
+
/** A summary's slim root delegation with the root's own ledger, which the slim one drops, so
|
|
15
|
+
* `computeWaitingOn` still marks a wait on a peer's reply (hearsay-tools/cezarion#1995). The ledger
|
|
16
|
+
* is unparsed; `peerRequestIds` reads it defensively. */
|
|
17
|
+
export declare function withRootLedger(slim: RunDelegationSummary | undefined, raw: unknown): WaitingOnInput['delegation'];
|
|
18
|
+
/** Whether one of these requests went to a peer task: its wait reads "waiting on replies", never
|
|
19
|
+
* "worker replies" (hearsay-tools/cezarion#1995). */
|
|
20
|
+
export declare function requestsToPeers(delegation: WaitingOnInput['delegation'], requestIds: readonly string[] | undefined): boolean;
|
|
21
|
+
/** One target of a worker entry: a request when the entry waits on replies, else a worker. Its key
|
|
22
|
+
* names the kind, so every count over several entries (`computeWaitingOn`, the activity view)
|
|
23
|
+
* counts each target once with the same keys (hearsay-tools/cezarion#2588). */
|
|
24
|
+
export interface WorkerWaitTarget {
|
|
25
|
+
key: string;
|
|
26
|
+
settled: boolean;
|
|
27
|
+
}
|
|
28
|
+
export declare function workerWaitTargets(wait: Pick<WorkerWaitEntry, 'requestIds' | 'requestOutcomes' | 'workerIds' | 'outcomes'>): WorkerWaitTarget[];
|
|
29
|
+
/** Reads only `open` waits; among several of one kind the earliest deadline wins. */
|
|
30
|
+
export declare function computeWaitingOn(run: WaitingOnInput): WaitingOn | undefined;
|
|
31
|
+
/** Whether the run waits on the user: an open human wait (phase 4b, hearsay-tools/cezarion#1236). */
|
|
32
|
+
export declare function asksHuman(run: Pick<WaitingOnInput, 'waits'>): boolean;
|
|
33
|
+
/** Whether a question waits on the user: an open human wait the agent opened, or one of Squawk's
|
|
34
|
+
* that carries a card (a worker's fallback question to its parent). Squawk's other waits
|
|
35
|
+
* (`no-wait`, `budget`, `completion`) wait for the user without a question. */
|
|
36
|
+
export declare function asksQuestion(run: Pick<WaitingOnInput, 'waits'>): boolean;
|
|
37
|
+
/** A resolved wait is a wake owed to the agent: its result is in, its turn has not started.
|
|
38
|
+
* Rung 10 of the attention ladder ("waiting for capacity"); a summary carries it as
|
|
39
|
+
* `waitWakePending`. */
|
|
40
|
+
export declare function hasResolvedWait(run: {
|
|
41
|
+
waitWakePending?: true | undefined;
|
|
42
|
+
} & Pick<WaitingOnInput, 'waits'>): boolean;
|
|
43
|
+
/** A summary's `waitingOn` when it has one; a full or stream-patched record computes it. */
|
|
44
|
+
export declare function resolveWaitingOn(run: {
|
|
45
|
+
waitingOn?: WaitingOn | undefined;
|
|
46
|
+
} & WaitingOnInput): WaitingOn | undefined;
|
package/dist/contract/waits.d.ts
CHANGED
|
@@ -1,41 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PeerWaitView, WorkerCompletionWait, WorkerWait } from './delegation.ts';
|
|
3
3
|
import type { RunRecord } from './runs.ts';
|
|
4
4
|
import { isUsageLimitHold } from './usage-limit-hold.ts';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* hearsay-tools/cezarion#1233). A run holds its open and recently settled waits in
|
|
9
|
-
* `RunRecord.waits`; the agent opens one with `cezar_wait` and closes it with
|
|
10
|
-
* `cezar_cancel_wait`. A wait ends only when its own event fires, its deadline passes, or someone
|
|
11
|
-
* cancels it. Phase 1 carries the `ci` and `timer` kinds; phase 2 (hearsay-tools/cezarion#1234)
|
|
12
|
-
* adds `human`, which the agent opens with `cezar_ask` and which has no deadline: it ends when
|
|
13
|
-
* the user answers or the agent cancels it.
|
|
14
|
-
* Phase 3a (hearsay-tools/cezarion#1235) adds `worker`, which waits on workers' outcomes or on
|
|
15
|
-
* replies to requests and has a deadline. Phase 3b (hearsay-tools/cezarion#1301) moves the
|
|
16
|
-
* completion gate's own wait into the list as a `source: 'cezar'`, `via: 'completion'` worker
|
|
17
|
-
* entry with no deadline, so the list is all `computeWaitingOn` reads.
|
|
18
|
-
* hearsay-tools/cezarion#1995 adds `peer` (spec `2026-10-27-task-communication-protocol` § 7): a root
|
|
19
|
-
* task waits for named peer root tasks to write or to settle, with a deadline.
|
|
20
|
-
* hearsay-tools/cezarion#2431 adds `subagent`: Squawk's own wait on the native subagents a turn left
|
|
21
|
-
* running, with a safety deadline.
|
|
22
|
-
*/
|
|
23
|
-
export declare const WAIT_LIMIT = 16;
|
|
24
|
-
export declare const LAST_WAITS_LIMIT = 16;
|
|
25
|
-
export declare const TIMER_MIN_SECONDS = 60;
|
|
26
|
-
export declare const TIMER_MAX_SECONDS = 7200;
|
|
27
|
-
/** A process wait's bounds (hearsay-tools/cezarion#1446): the CI wait's timeout range. */
|
|
28
|
-
export declare const PROCESS_TIMEOUT_DEFAULT_SECONDS = 1800;
|
|
29
|
-
export declare const PROCESS_TIMEOUT_MAX_SECONDS = 7200;
|
|
30
|
-
export declare const PROCESS_EXIT_FILE_MAX = 4096;
|
|
31
|
-
/** A peer wait's deadline, and a request or worker wait's (hearsay-tools/cezarion#1995). */
|
|
32
|
-
export declare const PEER_WAIT_DEFAULT_SECONDS = 600;
|
|
33
|
-
export declare const PEER_WAIT_MAX_SECONDS = 7200;
|
|
34
|
-
/** A subagent wait (hearsay-tools/cezarion#2431): its safety deadline after the last child event,
|
|
35
|
-
* the grace after the last child ends before Squawk wakes the parent, and its child bound. */
|
|
36
|
-
export declare const SUBAGENT_WAIT_DEADLINE_SECONDS = 1800;
|
|
37
|
-
export declare const SUBAGENT_WAIT_GRACE_SECONDS = 15;
|
|
38
|
-
export declare const SUBAGENT_WAIT_CHILD_LIMIT = 32;
|
|
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 } from './wait-limits.ts';
|
|
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, };
|
|
39
8
|
/** `open` → `resolved` (its event fired or its deadline passed) → `delivered`, or `cancelled`. */
|
|
40
9
|
export declare const waitPhaseSchema: z.ZodEnum<{
|
|
41
10
|
cancelled: "cancelled";
|
|
@@ -1072,8 +1041,6 @@ export declare const waitErrorCodeSchema: z.ZodEnum<{
|
|
|
1072
1041
|
worker_wait_pending: "worker_wait_pending";
|
|
1073
1042
|
}>;
|
|
1074
1043
|
export type WaitErrorCode = z.infer<typeof waitErrorCodeSchema>;
|
|
1075
|
-
/** The bound on every wait and done refusal's `message`; the run manager fits its own to it. */
|
|
1076
|
-
export declare const WAIT_MESSAGE_MAX = 4096;
|
|
1077
1044
|
export declare const waitRegistrationReceiptSchema: z.ZodObject<{
|
|
1078
1045
|
operationId: z.ZodUUID;
|
|
1079
1046
|
requestHash: z.ZodString;
|
|
@@ -1965,43 +1932,6 @@ export declare const waitingOnSchema: z.ZodPreprocess<z.ZodDiscriminatedUnion<[z
|
|
|
1965
1932
|
note: z.ZodOptional<z.ZodString>;
|
|
1966
1933
|
}, z.core.$strip>], "kind">>;
|
|
1967
1934
|
export type WaitingOn = z.infer<typeof waitingOnSchema>;
|
|
1968
|
-
/** Full records carry the full delegation state; summaries and index rows the slim projection. */
|
|
1969
|
-
export type WaitingOnInput = Partial<Pick<RunRecord, 'status' | 'waits' | 'autoResumeAt'>> & {
|
|
1970
|
-
delegation?: DelegationState | RunDelegationSummary | undefined;
|
|
1971
|
-
};
|
|
1972
|
-
/** A summary's slim root delegation with the root's own ledger, which the slim one drops, so
|
|
1973
|
-
* `computeWaitingOn` still marks a wait on a peer's reply (hearsay-tools/cezarion#1995). The ledger
|
|
1974
|
-
* is unparsed; `peerRequestIds` reads it defensively. */
|
|
1975
|
-
export declare function withRootLedger(slim: RunDelegationSummary | undefined, raw: unknown): WaitingOnInput['delegation'];
|
|
1976
|
-
/** Whether one of these requests went to a peer task: its wait reads "waiting on replies", never
|
|
1977
|
-
* "worker replies" (hearsay-tools/cezarion#1995). */
|
|
1978
|
-
export declare function requestsToPeers(delegation: WaitingOnInput['delegation'], requestIds: readonly string[] | undefined): boolean;
|
|
1979
|
-
/** One target of a worker entry: a request when the entry waits on replies, else a worker. Its key
|
|
1980
|
-
* names the kind, so every count over several entries (`computeWaitingOn`, the activity view)
|
|
1981
|
-
* counts each target once with the same keys (hearsay-tools/cezarion#2588). */
|
|
1982
|
-
export interface WorkerWaitTarget {
|
|
1983
|
-
key: string;
|
|
1984
|
-
settled: boolean;
|
|
1985
|
-
}
|
|
1986
|
-
export declare function workerWaitTargets(wait: Pick<WorkerWaitEntry, 'requestIds' | 'requestOutcomes' | 'workerIds' | 'outcomes'>): WorkerWaitTarget[];
|
|
1987
|
-
/** Reads only `open` waits; among several of one kind the earliest deadline wins. */
|
|
1988
|
-
export declare function computeWaitingOn(run: WaitingOnInput): WaitingOn | undefined;
|
|
1989
|
-
/** Whether the run waits on the user: an open human wait (phase 4b, hearsay-tools/cezarion#1236). */
|
|
1990
|
-
export declare function asksHuman(run: Pick<WaitingOnInput, 'waits'>): boolean;
|
|
1991
|
-
/** Whether a question waits on the user: an open human wait the agent opened, or one of Squawk's
|
|
1992
|
-
* that carries a card (a worker's fallback question to its parent). Squawk's other waits
|
|
1993
|
-
* (`no-wait`, `budget`, `completion`) wait for the user without a question. */
|
|
1994
|
-
export declare function asksQuestion(run: Pick<WaitingOnInput, 'waits'>): boolean;
|
|
1995
|
-
/** A resolved wait is a wake owed to the agent: its result is in, its turn has not started.
|
|
1996
|
-
* Rung 10 of the attention ladder ("waiting for capacity"); a summary carries it as
|
|
1997
|
-
* `waitWakePending`. */
|
|
1998
|
-
export declare function hasResolvedWait(run: {
|
|
1999
|
-
waitWakePending?: true | undefined;
|
|
2000
|
-
} & Pick<WaitingOnInput, 'waits'>): boolean;
|
|
2001
|
-
/** A summary's `waitingOn` when it has one; a full or stream-patched record computes it. */
|
|
2002
|
-
export declare function resolveWaitingOn(run: {
|
|
2003
|
-
waitingOn?: WaitingOn | undefined;
|
|
2004
|
-
} & WaitingOnInput): WaitingOn | undefined;
|
|
2005
1935
|
/**
|
|
2006
1936
|
* A run's worker wait in the old `WorkerWait` shape, for views that still show one: the newest
|
|
2007
1937
|
* open or owed `worker` entry the agent registered (hearsay-tools/cezarion#1235). Squawk's
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* A worker's settled outcome and the worker wait modes. The run events, the activity feed and the
|
|
4
|
+
* wait list read them without the rest of `delegation.ts`, which re-exports them
|
|
5
|
+
* (hearsay-tools/squawk#3245).
|
|
6
|
+
*/
|
|
7
|
+
export declare const workerOutcomeSchema: z.ZodObject<{
|
|
8
|
+
workerId: z.ZodUUID;
|
|
9
|
+
status: z.ZodEnum<{
|
|
10
|
+
cancelled: "cancelled";
|
|
11
|
+
done: "done";
|
|
12
|
+
failed: "failed";
|
|
13
|
+
review: "review";
|
|
14
|
+
}>;
|
|
15
|
+
observedAt: z.ZodISODateTime;
|
|
16
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
17
|
+
revision: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
}, z.core.$strict>;
|
|
19
|
+
export type WorkerOutcome = z.infer<typeof workerOutcomeSchema>;
|
|
20
|
+
export declare const workerWaitModeSchema: z.ZodEnum<{
|
|
21
|
+
all: "all";
|
|
22
|
+
any: "any";
|
|
23
|
+
one: "one";
|
|
24
|
+
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/delegation/input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAmB,MAAM,
|
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/delegation/input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0CAA0C,CAAC;AAE7F,OAA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M,KAAK,EAAE;YAAE,MAAM;IAClC,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AAC1E,CAAC"}
|
|
@@ -27,18 +27,6 @@ export declare function delegationFailure(error: unknown): {
|
|
|
27
27
|
export declare function createDelegationRoutes(service: DelegationService, credentials: CredentialRegistry): import("hono/hono-base").HonoBase<Env, {
|
|
28
28
|
"/list": {
|
|
29
29
|
$get: {
|
|
30
|
-
output: {
|
|
31
|
-
error: string;
|
|
32
|
-
code?: "invalid_input" | undefined;
|
|
33
|
-
};
|
|
34
|
-
outputFormat: "json";
|
|
35
|
-
status: 400;
|
|
36
|
-
input: {
|
|
37
|
-
query: {
|
|
38
|
-
offset?: string | undefined;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
} | {
|
|
42
30
|
output: {
|
|
43
31
|
workers: {
|
|
44
32
|
workerId: string;
|
|
@@ -83,12 +71,33 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
83
71
|
offset?: string | undefined;
|
|
84
72
|
};
|
|
85
73
|
};
|
|
74
|
+
} | {
|
|
75
|
+
output: {
|
|
76
|
+
error: string;
|
|
77
|
+
code?: "invalid_input" | undefined;
|
|
78
|
+
};
|
|
79
|
+
outputFormat: "json";
|
|
80
|
+
status: 400;
|
|
81
|
+
input: {
|
|
82
|
+
query: {
|
|
83
|
+
offset?: string | undefined;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
86
|
};
|
|
87
87
|
};
|
|
88
88
|
} & {
|
|
89
89
|
"/discover": {
|
|
90
90
|
$post: {
|
|
91
91
|
output: {
|
|
92
|
+
scope: "host-default-account";
|
|
93
|
+
runners: {
|
|
94
|
+
status: "connected" | "disconnected" | "not-installed" | "unknown";
|
|
95
|
+
enabled?: boolean | undefined;
|
|
96
|
+
hint?: string | undefined;
|
|
97
|
+
authFailureId?: string | undefined;
|
|
98
|
+
runner: "claude" | "codex" | "omp" | "opencode" | "pi";
|
|
99
|
+
}[];
|
|
100
|
+
} | {
|
|
92
101
|
runner: "claude" | "codex" | "omp" | "opencode" | "pi";
|
|
93
102
|
models: {
|
|
94
103
|
id: string;
|
|
@@ -99,15 +108,6 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
99
108
|
source: "cache" | "live" | "unavailable";
|
|
100
109
|
stale: boolean;
|
|
101
110
|
reason?: string | undefined;
|
|
102
|
-
} | {
|
|
103
|
-
scope: "host-default-account";
|
|
104
|
-
runners: {
|
|
105
|
-
status: "connected" | "disconnected" | "not-installed" | "unknown";
|
|
106
|
-
enabled?: boolean | undefined;
|
|
107
|
-
hint?: string | undefined;
|
|
108
|
-
authFailureId?: string | undefined;
|
|
109
|
-
runner: "claude" | "codex" | "omp" | "opencode" | "pi";
|
|
110
|
-
}[];
|
|
111
111
|
} | {
|
|
112
112
|
tasks: {
|
|
113
113
|
id: string;
|
|
@@ -621,18 +621,6 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
621
621
|
} & {
|
|
622
622
|
"/:workerId": {
|
|
623
623
|
$get: {
|
|
624
|
-
output: {
|
|
625
|
-
error: string;
|
|
626
|
-
code?: "invalid_input" | undefined;
|
|
627
|
-
};
|
|
628
|
-
outputFormat: "json";
|
|
629
|
-
status: 400;
|
|
630
|
-
input: {
|
|
631
|
-
param: {
|
|
632
|
-
workerId: string;
|
|
633
|
-
};
|
|
634
|
-
};
|
|
635
|
-
} | {
|
|
636
624
|
output: {
|
|
637
625
|
workerId: string;
|
|
638
626
|
settled: boolean;
|
|
@@ -748,11 +736,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
748
736
|
workerId: string;
|
|
749
737
|
};
|
|
750
738
|
};
|
|
751
|
-
}
|
|
752
|
-
};
|
|
753
|
-
} & {
|
|
754
|
-
"/:workerId/collect": {
|
|
755
|
-
$post: {
|
|
739
|
+
} | {
|
|
756
740
|
output: {
|
|
757
741
|
error: string;
|
|
758
742
|
code?: "invalid_input" | undefined;
|
|
@@ -763,10 +747,12 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
763
747
|
param: {
|
|
764
748
|
workerId: string;
|
|
765
749
|
};
|
|
766
|
-
} & {
|
|
767
|
-
json: Record<string, never>;
|
|
768
750
|
};
|
|
769
|
-
}
|
|
751
|
+
};
|
|
752
|
+
};
|
|
753
|
+
} & {
|
|
754
|
+
"/:workerId/collect": {
|
|
755
|
+
$post: {
|
|
770
756
|
output: {
|
|
771
757
|
workerId: string;
|
|
772
758
|
parentRunId: string;
|
|
@@ -889,11 +875,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
889
875
|
} & {
|
|
890
876
|
json: Record<string, never>;
|
|
891
877
|
};
|
|
892
|
-
}
|
|
893
|
-
};
|
|
894
|
-
} & {
|
|
895
|
-
"/:workerId/steer": {
|
|
896
|
-
$post: {
|
|
878
|
+
} | {
|
|
897
879
|
output: {
|
|
898
880
|
error: string;
|
|
899
881
|
code?: "invalid_input" | undefined;
|
|
@@ -905,11 +887,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
905
887
|
workerId: string;
|
|
906
888
|
};
|
|
907
889
|
} & {
|
|
908
|
-
json:
|
|
909
|
-
text: string;
|
|
910
|
-
};
|
|
890
|
+
json: Record<string, never>;
|
|
911
891
|
};
|
|
912
|
-
}
|
|
892
|
+
};
|
|
893
|
+
};
|
|
894
|
+
} & {
|
|
895
|
+
"/:workerId/steer": {
|
|
896
|
+
$post: {
|
|
913
897
|
output: {
|
|
914
898
|
workerId: string;
|
|
915
899
|
state: "delivered" | "queued";
|
|
@@ -925,11 +909,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
925
909
|
text: string;
|
|
926
910
|
};
|
|
927
911
|
};
|
|
928
|
-
}
|
|
929
|
-
};
|
|
930
|
-
} & {
|
|
931
|
-
"/:workerId/stop": {
|
|
932
|
-
$post: {
|
|
912
|
+
} | {
|
|
933
913
|
output: {
|
|
934
914
|
error: string;
|
|
935
915
|
code?: "invalid_input" | undefined;
|
|
@@ -941,9 +921,15 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
941
921
|
workerId: string;
|
|
942
922
|
};
|
|
943
923
|
} & {
|
|
944
|
-
json:
|
|
924
|
+
json: {
|
|
925
|
+
text: string;
|
|
926
|
+
};
|
|
945
927
|
};
|
|
946
|
-
}
|
|
928
|
+
};
|
|
929
|
+
};
|
|
930
|
+
} & {
|
|
931
|
+
"/:workerId/stop": {
|
|
932
|
+
$post: {
|
|
947
933
|
output: {
|
|
948
934
|
workerId: string;
|
|
949
935
|
state: "stopping" | "terminated";
|
|
@@ -957,11 +943,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
957
943
|
} & {
|
|
958
944
|
json: Record<string, never>;
|
|
959
945
|
};
|
|
960
|
-
}
|
|
961
|
-
};
|
|
962
|
-
} & {
|
|
963
|
-
"/:workerId/destroy": {
|
|
964
|
-
$post: {
|
|
946
|
+
} | {
|
|
965
947
|
output: {
|
|
966
948
|
error: string;
|
|
967
949
|
code?: "invalid_input" | undefined;
|
|
@@ -975,7 +957,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
975
957
|
} & {
|
|
976
958
|
json: Record<string, never>;
|
|
977
959
|
};
|
|
978
|
-
}
|
|
960
|
+
};
|
|
961
|
+
};
|
|
962
|
+
} & {
|
|
963
|
+
"/:workerId/destroy": {
|
|
964
|
+
$post: {
|
|
979
965
|
output: {
|
|
980
966
|
workerId: string;
|
|
981
967
|
state: "complete" | "incomplete";
|
|
@@ -998,6 +984,20 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
998
984
|
} & {
|
|
999
985
|
json: Record<string, never>;
|
|
1000
986
|
};
|
|
987
|
+
} | {
|
|
988
|
+
output: {
|
|
989
|
+
error: string;
|
|
990
|
+
code?: "invalid_input" | undefined;
|
|
991
|
+
};
|
|
992
|
+
outputFormat: "json";
|
|
993
|
+
status: 400;
|
|
994
|
+
input: {
|
|
995
|
+
param: {
|
|
996
|
+
workerId: string;
|
|
997
|
+
};
|
|
998
|
+
} & {
|
|
999
|
+
json: Record<string, never>;
|
|
1000
|
+
};
|
|
1001
1001
|
} | {
|
|
1002
1002
|
output: {
|
|
1003
1003
|
workerId: string;
|
|
@@ -1027,11 +1027,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1027
1027
|
"/:workerId/diff": {
|
|
1028
1028
|
$get: {
|
|
1029
1029
|
output: {
|
|
1030
|
-
|
|
1031
|
-
|
|
1030
|
+
workerId: string;
|
|
1031
|
+
baselineSha: string;
|
|
1032
|
+
diff: string;
|
|
1033
|
+
truncated: boolean;
|
|
1032
1034
|
};
|
|
1033
1035
|
outputFormat: "json";
|
|
1034
|
-
status:
|
|
1036
|
+
status: 200;
|
|
1035
1037
|
input: {
|
|
1036
1038
|
param: {
|
|
1037
1039
|
workerId: string;
|
|
@@ -1039,13 +1041,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1039
1041
|
};
|
|
1040
1042
|
} | {
|
|
1041
1043
|
output: {
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
diff: string;
|
|
1045
|
-
truncated: boolean;
|
|
1044
|
+
error: string;
|
|
1045
|
+
code?: "invalid_input" | undefined;
|
|
1046
1046
|
};
|
|
1047
1047
|
outputFormat: "json";
|
|
1048
|
-
status:
|
|
1048
|
+
status: 400;
|
|
1049
1049
|
input: {
|
|
1050
1050
|
param: {
|
|
1051
1051
|
workerId: string;
|