@hearsay-tools/squawk 0.19.0-pr4423.8659.2 → 0.19.0-pr4423.8707
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/automations/tools.d.ts +8 -8
- package/dist/contract/index.js +55 -14
- package/dist/contract/runs.d.ts +50 -0
- package/dist/contract/workspace-events.d.ts +18 -0
- package/dist/delegation/routes.d.ts +65 -65
- package/dist/delegation/transport.d.ts +14 -14
- package/dist/preview/chromium.d.ts +3 -2
- package/dist/preview/chromium.js +5 -1
- package/dist/preview/chromium.js.map +1 -1
- package/dist/runs/run-database.d.ts +5 -0
- package/dist/runs/run-database.js +5 -0
- package/dist/runs/run-database.js.map +1 -1
- package/dist/runs/run-queries.d.ts +9 -0
- package/dist/runs/run-queries.js +43 -6
- package/dist/runs/run-queries.js.map +1 -1
- package/dist/runs/store.js +1 -0
- package/dist/runs/store.js.map +1 -1
- package/dist/runs/transcript-facts-queue.d.ts +9 -1
- package/dist/runs/transcript-facts-queue.js +43 -10
- package/dist/runs/transcript-facts-queue.js.map +1 -1
- package/dist/runs/transcript-facts-sidecar.d.ts +22 -0
- package/dist/runs/transcript-facts-sidecar.js +58 -0
- package/dist/runs/transcript-facts-sidecar.js.map +1 -0
- package/dist/runs/transcript-facts-topic.d.ts +2 -0
- package/dist/runs/transcript-facts-topic.js +8 -10
- package/dist/runs/transcript-facts-topic.js.map +1 -1
- package/dist/runs/transcript-facts-worker.d.ts +7 -2
- package/dist/runs/transcript-facts-worker.js +8 -5
- package/dist/runs/transcript-facts-worker.js.map +1 -1
- package/dist/runs/transcript-facts.d.ts +4 -0
- package/dist/runs/transcript-facts.js +36 -16
- package/dist/runs/transcript-facts.js.map +1 -1
- package/dist/server/automations-routes.d.ts +150 -150
- package/dist/server/live-routes.d.ts +6 -6
- package/dist/server/project-settings-routes.d.ts +107 -107
- package/dist/server/runners-routes.d.ts +10 -10
- package/dist/server/runs-routes.d.ts +24 -16
- package/dist/server/server.d.ts +30 -6
- package/dist/server/workspace-live-routes.d.ts +6 -6
- package/dist/server/workspace-routes.d.ts +8 -0
- package/package.json +4 -4
- package/scripts/measure-transcript-facts-health.mjs +10 -5
- package/scripts/measure-transcript-facts-lag.mjs +11 -2
- package/scripts/mock-ci-tool.mjs +4 -5
- package/scripts/transcript-facts-timing.mjs +10 -0
- package/web/dist/assets/accounts-section-Gr9dHZF1.js +1 -0
- package/web/dist/assets/activity-motion-Df3sKtfG.js +2 -0
- package/web/dist/assets/{activity-route-Cq_CQ2qY.js → activity-route-IuO7RLQJ.js} +1 -1
- package/web/dist/assets/{agent-config-section-DzJZJaRC.js → agent-config-section-CiMqNU3r.js} +1 -1
- package/web/dist/assets/agent-defaults-section-CCqxvBHH.js +1 -0
- package/web/dist/assets/{appearance-D-eyPi4y.js → appearance-JHu3FTTN.js} +1 -1
- package/web/dist/assets/{archive-on-merge-field-C7_Fwy2A.js → archive-on-merge-field-g87CG6RL.js} +1 -1
- package/web/dist/assets/attention-80jX8HhC.js +1 -0
- package/web/dist/assets/{automations-route-D-GKrEN-.js → automations-route-BGmnXRqj.js} +2 -2
- package/web/dist/assets/commit-list-Dh09gp2q.js +1 -0
- package/web/dist/assets/diff-DFVWbMfG.js +3 -0
- package/web/dist/assets/{diff-controls-Djy25_O_.js → diff-controls-ijl3lOhI.js} +1 -1
- package/web/dist/assets/diff-stat-C7KB1kDX.js +1 -0
- package/web/dist/assets/{diff-view-CDHDVoee.js → diff-view-CwIbIHzY.js} +1 -1
- package/web/dist/assets/{file-preview-CCJPAIOx.js → file-preview-CHKxJqk6.js} +1 -1
- package/web/dist/assets/{folder-browser-BztRo6t1.js → folder-browser-c9j-j8Jn.js} +1 -1
- package/web/dist/assets/git-toolbar-Ddzku4rs.js +1 -0
- package/web/dist/assets/github-BCbxj9-8.js +1 -0
- package/web/dist/assets/{global-activity-route-DLKRmRUc.js → global-activity-route-ujRgkh9I.js} +1 -1
- package/web/dist/assets/image-preview-DCUeM8u3.js +1 -0
- package/web/dist/assets/index-BN-MTYSA.css +1 -0
- package/web/dist/assets/index-CFSbSWOH.js +21 -0
- package/web/dist/assets/{label-Bt8n7Spq.js → label-o_DsEmPt.js} +1 -1
- package/web/dist/assets/{live-reads-Crd6fVGH.js → live-reads-Cgk2XbiP.js} +1 -1
- package/web/dist/assets/{markdown-C1jbHzFz.js → markdown-Cmc5Y3-I.js} +1 -1
- package/web/dist/assets/{notifications-section-UoGn2x5m.js → notifications-section-Dsss_VBu.js} +1 -1
- package/web/dist/assets/{open-in-menu-BPp88ouw.js → open-in-menu-Bzae69TK.js} +1 -1
- package/web/dist/assets/{preview-pane-connected-CUJzat80.js → preview-pane-connected-DhKcB0Ml.js} +3 -3
- package/web/dist/assets/{project-location-BRxXN249.js → project-location-D6riKh0Z.js} +1 -1
- package/web/dist/assets/{project-router-CLJTc7gv.js → project-router-CZ89wg-5.js} +1 -1
- package/web/dist/assets/{project-scope-context-Rv6S_BXt.js → project-scope-context-DIcqj4jJ.js} +2 -2
- package/web/dist/assets/{projects-section-DmV2We0g.js → projects-section-DPPQ1eF2.js} +1 -1
- package/web/dist/assets/{prompt-templates-section-byuQ5r27.js → prompt-templates-section-BGeiSDCp.js} +1 -1
- package/web/dist/assets/{queries-qCF-eOqZ.js → queries-DZhNVAD_.js} +1 -1
- package/web/dist/assets/{reference-chip-BcgJG9tf.js → reference-chip-c4N3gsDz.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-DhAon4OW.js → remote-settings-notice-C_-3F3IL.js} +1 -1
- package/web/dist/assets/repo-git-CT4_F5Jo.js +1 -0
- package/web/dist/assets/{report-reader-s1bYKFxb.js → report-reader-WXtDa4mH.js} +1 -1
- package/web/dist/assets/{reports-8s-OcBds.js → reports-Br8CYiYO.js} +1 -1
- package/web/dist/assets/{resources-section-D0Jh9A48.js → resources-section-BypuQByM.js} +1 -1
- package/web/dist/assets/{run-header-DMvl2o6K.js → run-header-BZSmHWg_.js} +2 -2
- package/web/dist/assets/{select-DGlSEHav.js → select-DGXBChA-.js} +1 -1
- package/web/dist/assets/{session-context-section-Dm2GppJf.js → session-context-section-KeuIv82F.js} +1 -1
- package/web/dist/assets/{settings-agent-picker-D0IvVSAo.js → settings-agent-picker-B5WKmza-.js} +1 -1
- package/web/dist/assets/{settings-shell-CSzdDva2.js → settings-shell-CABTLbUg.js} +1 -1
- package/web/dist/assets/{sidebar-section-CyF46d9t.js → sidebar-section-BQUF_hNm.js} +1 -1
- package/web/dist/assets/{skills-BtFolia6.js → skills-C5Pp35Tr.js} +1 -1
- package/web/dist/assets/{tab-link-BMcPED_U.js → tab-link-jeLI28w6.js} +1 -1
- package/web/dist/assets/task-changes-ROSEU9Oj.js +1 -0
- package/web/dist/assets/task-commits-BxyB7_ZD.js +1 -0
- package/web/dist/assets/{task-files-COJx_tfF.js → task-files-XcHKZ0FC.js} +1 -1
- package/web/dist/assets/{task-github-item-BH55d2jr.js → task-github-item-DT_dgcwi.js} +1 -1
- package/web/dist/assets/{task-groups-4tzKGROI.js → task-groups-DK0I9p71.js} +1 -1
- package/web/dist/assets/{task-thread-BVLscF_t.js → task-thread-ywwMD7pF.js} +9 -9
- package/web/dist/assets/{tasks-table-C5uoZMFs.js → tasks-table-BNFYIwtc.js} +1 -1
- package/web/dist/assets/{thread-state-CgbFXudX.js → thread-state-D7zL54Y1.js} +1 -1
- package/web/dist/assets/{toaster-BXnLIU3z.js → toaster-0sM0sfWx.js} +1 -1
- package/web/dist/assets/use-hand-to-agent-state-gHO3hS-e.js +1 -0
- package/web/dist/assets/{workflows-CkGKcluD.js → workflows-CEqS-Gu5.js} +3 -3
- package/web/dist/assets/{workspace-tools-BGxpQuQJ.js → workspace-tools-H5GI_eI5.js} +1 -1
- package/web/dist/assets/{worktrees-section-Dx6MnnKw.js → worktrees-section-D-gWDoTz.js} +1 -1
- package/web/dist/index.html +16 -15
- package/web/dist/assets/accounts-section-D3yVNJzn.js +0 -1
- package/web/dist/assets/activity-motion-BMNce0aE.js +0 -2
- package/web/dist/assets/agent-defaults-section-D1v4-Uf8.js +0 -1
- package/web/dist/assets/attention-CBCeJN5w.js +0 -1
- package/web/dist/assets/commit-list-BOxshe8n.js +0 -1
- package/web/dist/assets/diff-CIjV1zsh.js +0 -3
- package/web/dist/assets/git-toolbar-P-Bizd61.js +0 -1
- package/web/dist/assets/github-BwiiZM8H.js +0 -1
- package/web/dist/assets/image-preview-Ci50YcnQ.js +0 -1
- package/web/dist/assets/index-DZhYjGaA.css +0 -1
- package/web/dist/assets/index-ejd2q2ph.js +0 -21
- package/web/dist/assets/repo-git-ZAEQkrKL.js +0 -1
- package/web/dist/assets/task-changes-HzgatpyP.js +0 -1
- package/web/dist/assets/task-commits-BVoxwVRd.js +0 -1
- package/web/dist/assets/use-hand-to-agent-state-oNjdiDkh.js +0 -1
|
@@ -7,10 +7,6 @@ export declare function invokeScheduleTaskTool(input: unknown): Promise<{
|
|
|
7
7
|
}[];
|
|
8
8
|
isError: boolean;
|
|
9
9
|
details: {
|
|
10
|
-
ok: false;
|
|
11
|
-
code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
|
|
12
|
-
message: string;
|
|
13
|
-
} | {
|
|
14
10
|
ok: true;
|
|
15
11
|
task: {
|
|
16
12
|
id: string;
|
|
@@ -22,6 +18,10 @@ export declare function invokeScheduleTaskTool(input: unknown): Promise<{
|
|
|
22
18
|
url?: string | undefined;
|
|
23
19
|
};
|
|
24
20
|
note: string;
|
|
21
|
+
} | {
|
|
22
|
+
ok: false;
|
|
23
|
+
code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
|
|
24
|
+
message: string;
|
|
25
25
|
};
|
|
26
26
|
}>;
|
|
27
27
|
export declare function formatScheduleTaskTool(answer: Awaited<ReturnType<typeof callScheduleTask>>): {
|
|
@@ -31,10 +31,6 @@ export declare function formatScheduleTaskTool(answer: Awaited<ReturnType<typeof
|
|
|
31
31
|
}[];
|
|
32
32
|
isError: boolean;
|
|
33
33
|
details: {
|
|
34
|
-
ok: false;
|
|
35
|
-
code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
|
|
36
|
-
message: string;
|
|
37
|
-
} | {
|
|
38
34
|
ok: true;
|
|
39
35
|
task: {
|
|
40
36
|
id: string;
|
|
@@ -46,6 +42,10 @@ export declare function formatScheduleTaskTool(answer: Awaited<ReturnType<typeof
|
|
|
46
42
|
url?: string | undefined;
|
|
47
43
|
};
|
|
48
44
|
note: string;
|
|
45
|
+
} | {
|
|
46
|
+
ok: false;
|
|
47
|
+
code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
|
|
48
|
+
message: string;
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
51
|
export declare function invokeScheduledTasksTool(input: unknown): Promise<{
|
package/dist/contract/index.js
CHANGED
|
@@ -1482,6 +1482,20 @@ var continuationMessageSchema = queuedMessageSchema.extend({
|
|
|
1482
1482
|
}).optional()
|
|
1483
1483
|
});
|
|
1484
1484
|
|
|
1485
|
+
// ../contract/src/usage-limit-hold.ts
|
|
1486
|
+
function isUsageLimitHold(run) {
|
|
1487
|
+
return run.status === "waiting" && run.autoResumeAt !== void 0;
|
|
1488
|
+
}
|
|
1489
|
+
function usageLimitHoldOf(run) {
|
|
1490
|
+
if (!isUsageLimitHold(run)) return void 0;
|
|
1491
|
+
return {
|
|
1492
|
+
reason: run.autoResumeReason ?? "usage-limit",
|
|
1493
|
+
resumeAt: run.autoResumeAt,
|
|
1494
|
+
...run.autoResumeAttempts === void 0 ? {} : { attempts: run.autoResumeAttempts },
|
|
1495
|
+
...run.error === void 0 ? {} : { error: run.error.slice(0, 2e3) }
|
|
1496
|
+
};
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1485
1499
|
// ../contract/src/waits.ts
|
|
1486
1500
|
import { z as z21 } from "zod";
|
|
1487
1501
|
|
|
@@ -1614,20 +1628,6 @@ var ciWaitReceiptSchema = ciPrIdentitySchema.extend({
|
|
|
1614
1628
|
phase: ciWaitSchema.shape.phase
|
|
1615
1629
|
}).strict();
|
|
1616
1630
|
|
|
1617
|
-
// ../contract/src/usage-limit-hold.ts
|
|
1618
|
-
function isUsageLimitHold(run) {
|
|
1619
|
-
return run.status === "waiting" && run.autoResumeAt !== void 0;
|
|
1620
|
-
}
|
|
1621
|
-
function usageLimitHoldOf(run) {
|
|
1622
|
-
if (!isUsageLimitHold(run)) return void 0;
|
|
1623
|
-
return {
|
|
1624
|
-
reason: run.autoResumeReason ?? "usage-limit",
|
|
1625
|
-
resumeAt: run.autoResumeAt,
|
|
1626
|
-
...run.autoResumeAttempts === void 0 ? {} : { attempts: run.autoResumeAttempts },
|
|
1627
|
-
...run.error === void 0 ? {} : { error: run.error.slice(0, 2e3) }
|
|
1628
|
-
};
|
|
1629
|
-
}
|
|
1630
|
-
|
|
1631
1631
|
// ../contract/src/wait-limits.ts
|
|
1632
1632
|
var WAIT_LIMIT = 16;
|
|
1633
1633
|
var LAST_WAITS_LIMIT = 16;
|
|
@@ -2419,6 +2419,10 @@ var apiRunSchema = runRecordSchema.extend({
|
|
|
2419
2419
|
cliHandoff: z23.literal(false).optional(),
|
|
2420
2420
|
usage: processUsageSchema.optional()
|
|
2421
2421
|
});
|
|
2422
|
+
var runStatePreviewSchema = z23.object({
|
|
2423
|
+
kind: z23.enum(["ask", "permission", "review", "error"]),
|
|
2424
|
+
text: z23.string().min(1).max(240)
|
|
2425
|
+
});
|
|
2422
2426
|
var runSummarySchema = z23.object({
|
|
2423
2427
|
id: z23.string(),
|
|
2424
2428
|
title: z23.string(),
|
|
@@ -2521,6 +2525,8 @@ var runSummarySchema = z23.object({
|
|
|
2521
2525
|
* labels a delegated peer by the agent actually running it, which can differ from `runner`. */
|
|
2522
2526
|
currentStepBackend: runnerSchema.optional(),
|
|
2523
2527
|
error: z23.string().optional(),
|
|
2528
|
+
/** Concise 1-line ask, permission, review, or error preview for urgent/failed task rows. */
|
|
2529
|
+
statePreview: runStatePreviewSchema.optional(),
|
|
2524
2530
|
/** Present while the run's isolated worktree exists — the breadcrumb says "Isolated worktree". */
|
|
2525
2531
|
worktreePath: z23.string().optional()
|
|
2526
2532
|
});
|
|
@@ -2562,6 +2568,37 @@ var SUMMARY_OPTIONAL_KEYS = [
|
|
|
2562
2568
|
"error",
|
|
2563
2569
|
"worktreePath"
|
|
2564
2570
|
];
|
|
2571
|
+
var STATE_PREVIEW_MAX = 240;
|
|
2572
|
+
function oneLinePreview(raw) {
|
|
2573
|
+
if (typeof raw !== "string") return "";
|
|
2574
|
+
const collapsed = raw.replace(/\s+/g, " ").trim();
|
|
2575
|
+
if (collapsed.length <= STATE_PREVIEW_MAX) return collapsed;
|
|
2576
|
+
return `${collapsed.slice(0, STATE_PREVIEW_MAX - 1).trimEnd()}\u2026`;
|
|
2577
|
+
}
|
|
2578
|
+
function deriveRunStatePreview(run, waitingOn) {
|
|
2579
|
+
if (!run.archived) {
|
|
2580
|
+
if (run.hasPendingPermission) return { kind: "permission", text: "Permission requested" };
|
|
2581
|
+
if (waitingOn?.kind === "human") {
|
|
2582
|
+
const openHuman = (Array.isArray(run.waits) ? run.waits : []).filter(
|
|
2583
|
+
(wait) => Boolean(wait) && typeof wait === "object" && wait.phase === "open" && wait.kind === "human"
|
|
2584
|
+
);
|
|
2585
|
+
const question = openHuman.find((wait) => Array.isArray(wait.questions) && wait.questions.length > 0)?.questions?.[0]?.question;
|
|
2586
|
+
const text = oneLinePreview(question);
|
|
2587
|
+
if (text) return { kind: "ask", text };
|
|
2588
|
+
const budget = openHuman.some((wait) => wait.via === "budget");
|
|
2589
|
+
return { kind: "ask", text: budget ? "Automatic wakes used up" : "Waiting for your reply" };
|
|
2590
|
+
}
|
|
2591
|
+
if (run.status === "review") {
|
|
2592
|
+
const text = oneLinePreview(run.doneAccepted?.summary);
|
|
2593
|
+
return { kind: "review", text: text || "Ready for review" };
|
|
2594
|
+
}
|
|
2595
|
+
}
|
|
2596
|
+
if (run.status === "failed" && !isUsageLimitHold(run)) {
|
|
2597
|
+
const text = oneLinePreview(run.error);
|
|
2598
|
+
if (text) return { kind: "error", text };
|
|
2599
|
+
}
|
|
2600
|
+
return void 0;
|
|
2601
|
+
}
|
|
2565
2602
|
function toRunSummary(run) {
|
|
2566
2603
|
const summary = {
|
|
2567
2604
|
id: run.id,
|
|
@@ -2583,6 +2620,8 @@ function toRunSummary(run) {
|
|
|
2583
2620
|
}
|
|
2584
2621
|
const waitingOn = computeWaitingOn({ ...run, delegation: withRootLedger(summary.delegation, run.delegation) });
|
|
2585
2622
|
if (waitingOn) summary.waitingOn = waitingOn;
|
|
2623
|
+
const statePreview = deriveRunStatePreview(run, waitingOn);
|
|
2624
|
+
if (statePreview) summary.statePreview = statePreview;
|
|
2586
2625
|
if (hasResolvedWait(run)) summary.waitWakePending = true;
|
|
2587
2626
|
if (run.usage) summary.usage = run.usage;
|
|
2588
2627
|
const automationId = automationIdOf(run);
|
|
@@ -6607,6 +6646,7 @@ export {
|
|
|
6607
6646
|
deleteRunResponseSchema,
|
|
6608
6647
|
deleteWorkflowResponseSchema,
|
|
6609
6648
|
deriveAttention,
|
|
6649
|
+
deriveRunStatePreview,
|
|
6610
6650
|
deriveWebhookState,
|
|
6611
6651
|
diffStatSchema,
|
|
6612
6652
|
discoveredRunnerSchema,
|
|
@@ -6896,6 +6936,7 @@ export {
|
|
|
6896
6936
|
runPullRequestSchema,
|
|
6897
6937
|
runRecordSchema,
|
|
6898
6938
|
runRelationshipsSchema,
|
|
6939
|
+
runStatePreviewSchema,
|
|
6899
6940
|
runStatusSchema,
|
|
6900
6941
|
runSummariesQuerySchema,
|
|
6901
6942
|
runSummarySchema,
|
package/dist/contract/runs.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { type WaitingOn } from './waits.ts';
|
|
2
3
|
export { runStatusSchema, type RunStatus, stepStatusSchema, type StepStatus, stepKindSchema, type StepKind } from './run-status.ts';
|
|
3
4
|
/**
|
|
4
5
|
* The RUNS family of `/api/v1` — a task's record, its lifecycle mutations, and the artifacts
|
|
@@ -4325,6 +4326,17 @@ export type ApiRun = z.infer<typeof apiRunSchema>;
|
|
|
4325
4326
|
* `toRunSummary` below is the only projection from a record to this shape. The route, the index
|
|
4326
4327
|
* and the cockpit's stream patches all go through it, so a list and its stream cannot disagree.
|
|
4327
4328
|
*/
|
|
4329
|
+
/** Concise 1-line urgent or outcome preview carried on list summaries (hearsay-tools/squawk#4377). */
|
|
4330
|
+
export declare const runStatePreviewSchema: z.ZodObject<{
|
|
4331
|
+
kind: z.ZodEnum<{
|
|
4332
|
+
ask: "ask";
|
|
4333
|
+
error: "error";
|
|
4334
|
+
permission: "permission";
|
|
4335
|
+
review: "review";
|
|
4336
|
+
}>;
|
|
4337
|
+
text: z.ZodString;
|
|
4338
|
+
}, z.core.$strip>;
|
|
4339
|
+
export type RunStatePreview = z.infer<typeof runStatePreviewSchema>;
|
|
4328
4340
|
export declare const runSummarySchema: z.ZodObject<{
|
|
4329
4341
|
id: z.ZodString;
|
|
4330
4342
|
title: z.ZodString;
|
|
@@ -4479,6 +4491,15 @@ export declare const runSummarySchema: z.ZodObject<{
|
|
|
4479
4491
|
currentStepId: z.ZodOptional<z.ZodString>;
|
|
4480
4492
|
currentStepBackend: z.ZodOptional<z.ZodString>;
|
|
4481
4493
|
error: z.ZodOptional<z.ZodString>;
|
|
4494
|
+
statePreview: z.ZodOptional<z.ZodObject<{
|
|
4495
|
+
kind: z.ZodEnum<{
|
|
4496
|
+
ask: "ask";
|
|
4497
|
+
error: "error";
|
|
4498
|
+
permission: "permission";
|
|
4499
|
+
review: "review";
|
|
4500
|
+
}>;
|
|
4501
|
+
text: z.ZodString;
|
|
4502
|
+
}, z.core.$strip>>;
|
|
4482
4503
|
worktreePath: z.ZodOptional<z.ZodString>;
|
|
4483
4504
|
}, z.core.$strip>;
|
|
4484
4505
|
export type RunSummary = z.infer<typeof runSummarySchema>;
|
|
@@ -4641,10 +4662,21 @@ export declare const runIndexEntrySchema: z.ZodObject<{
|
|
|
4641
4662
|
currentStepId: z.ZodOptional<z.ZodString>;
|
|
4642
4663
|
currentStepBackend: z.ZodOptional<z.ZodString>;
|
|
4643
4664
|
error: z.ZodOptional<z.ZodString>;
|
|
4665
|
+
statePreview: z.ZodOptional<z.ZodObject<{
|
|
4666
|
+
kind: z.ZodEnum<{
|
|
4667
|
+
ask: "ask";
|
|
4668
|
+
error: "error";
|
|
4669
|
+
permission: "permission";
|
|
4670
|
+
review: "review";
|
|
4671
|
+
}>;
|
|
4672
|
+
text: z.ZodString;
|
|
4673
|
+
}, z.core.$strip>>;
|
|
4644
4674
|
worktreePath: z.ZodOptional<z.ZodString>;
|
|
4645
4675
|
projectId: z.ZodString;
|
|
4646
4676
|
}, z.core.$strip>;
|
|
4647
4677
|
export type RunIndexEntry = z.infer<typeof runIndexEntrySchema>;
|
|
4678
|
+
/** Derive a concise 1-line preview for urgent (`Needs you`) or failed runs without reading transcripts. */
|
|
4679
|
+
export declare function deriveRunStatePreview(run: Pick<RunRecord, 'status' | 'archived' | 'hasPendingPermission' | 'waits' | 'doneAccepted' | 'error' | 'autoResumeAt'>, waitingOn: WaitingOn | undefined): RunStatePreview | undefined;
|
|
4648
4680
|
/**
|
|
4649
4681
|
* The one projection from a run record to its list row (#817). Optional keys are copied only when
|
|
4650
4682
|
* present, so the wire never carries an `undefined` the schema calls absent; `delegation` goes
|
|
@@ -4882,6 +4914,15 @@ export declare const archivedRunsResponseSchema: z.ZodObject<{
|
|
|
4882
4914
|
currentStepId: z.ZodOptional<z.ZodString>;
|
|
4883
4915
|
currentStepBackend: z.ZodOptional<z.ZodString>;
|
|
4884
4916
|
error: z.ZodOptional<z.ZodString>;
|
|
4917
|
+
statePreview: z.ZodOptional<z.ZodObject<{
|
|
4918
|
+
kind: z.ZodEnum<{
|
|
4919
|
+
ask: "ask";
|
|
4920
|
+
error: "error";
|
|
4921
|
+
permission: "permission";
|
|
4922
|
+
review: "review";
|
|
4923
|
+
}>;
|
|
4924
|
+
text: z.ZodString;
|
|
4925
|
+
}, z.core.$strip>>;
|
|
4885
4926
|
worktreePath: z.ZodOptional<z.ZodString>;
|
|
4886
4927
|
}, z.core.$strip>>;
|
|
4887
4928
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
@@ -5051,6 +5092,15 @@ export declare const runsSearchResponseSchema: z.ZodObject<{
|
|
|
5051
5092
|
currentStepId: z.ZodOptional<z.ZodString>;
|
|
5052
5093
|
currentStepBackend: z.ZodOptional<z.ZodString>;
|
|
5053
5094
|
error: z.ZodOptional<z.ZodString>;
|
|
5095
|
+
statePreview: z.ZodOptional<z.ZodObject<{
|
|
5096
|
+
kind: z.ZodEnum<{
|
|
5097
|
+
ask: "ask";
|
|
5098
|
+
error: "error";
|
|
5099
|
+
permission: "permission";
|
|
5100
|
+
review: "review";
|
|
5101
|
+
}>;
|
|
5102
|
+
text: z.ZodString;
|
|
5103
|
+
}, z.core.$strip>>;
|
|
5054
5104
|
worktreePath: z.ZodOptional<z.ZodString>;
|
|
5055
5105
|
projectId: z.ZodString;
|
|
5056
5106
|
}, z.core.$strip>>;
|
|
@@ -177,6 +177,15 @@ export declare const workspaceRunSummaryEventSchema: z.ZodObject<{
|
|
|
177
177
|
currentStepId: z.ZodOptional<z.ZodString>;
|
|
178
178
|
currentStepBackend: z.ZodOptional<z.ZodString>;
|
|
179
179
|
error: z.ZodOptional<z.ZodString>;
|
|
180
|
+
statePreview: z.ZodOptional<z.ZodObject<{
|
|
181
|
+
kind: z.ZodEnum<{
|
|
182
|
+
ask: "ask";
|
|
183
|
+
error: "error";
|
|
184
|
+
permission: "permission";
|
|
185
|
+
review: "review";
|
|
186
|
+
}>;
|
|
187
|
+
text: z.ZodString;
|
|
188
|
+
}, z.core.$strip>>;
|
|
180
189
|
worktreePath: z.ZodOptional<z.ZodString>;
|
|
181
190
|
}, z.core.$strip>;
|
|
182
191
|
relationships: z.ZodString;
|
|
@@ -367,6 +376,15 @@ export declare const runsIndexResponseSchema: z.ZodObject<{
|
|
|
367
376
|
currentStepId: z.ZodOptional<z.ZodString>;
|
|
368
377
|
currentStepBackend: z.ZodOptional<z.ZodString>;
|
|
369
378
|
error: z.ZodOptional<z.ZodString>;
|
|
379
|
+
statePreview: z.ZodOptional<z.ZodObject<{
|
|
380
|
+
kind: z.ZodEnum<{
|
|
381
|
+
ask: "ask";
|
|
382
|
+
error: "error";
|
|
383
|
+
permission: "permission";
|
|
384
|
+
review: "review";
|
|
385
|
+
}>;
|
|
386
|
+
text: z.ZodString;
|
|
387
|
+
}, z.core.$strip>>;
|
|
370
388
|
worktreePath: z.ZodOptional<z.ZodString>;
|
|
371
389
|
projectId: z.ZodString;
|
|
372
390
|
}, z.core.$strip>>;
|
|
@@ -27,6 +27,18 @@ 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
|
+
} | {
|
|
30
42
|
output: {
|
|
31
43
|
workers: {
|
|
32
44
|
workerId: string;
|
|
@@ -79,18 +91,6 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
79
91
|
offset?: string | undefined;
|
|
80
92
|
};
|
|
81
93
|
};
|
|
82
|
-
} | {
|
|
83
|
-
output: {
|
|
84
|
-
error: string;
|
|
85
|
-
code?: "invalid_input" | undefined;
|
|
86
|
-
};
|
|
87
|
-
outputFormat: "json";
|
|
88
|
-
status: 400;
|
|
89
|
-
input: {
|
|
90
|
-
query: {
|
|
91
|
-
offset?: string | undefined;
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
94
|
};
|
|
95
95
|
};
|
|
96
96
|
} & {
|
|
@@ -677,6 +677,18 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
677
677
|
} & {
|
|
678
678
|
"/:workerId": {
|
|
679
679
|
$get: {
|
|
680
|
+
output: {
|
|
681
|
+
error: string;
|
|
682
|
+
code?: "invalid_input" | undefined;
|
|
683
|
+
};
|
|
684
|
+
outputFormat: "json";
|
|
685
|
+
status: 400;
|
|
686
|
+
input: {
|
|
687
|
+
param: {
|
|
688
|
+
workerId: string;
|
|
689
|
+
};
|
|
690
|
+
};
|
|
691
|
+
} | {
|
|
680
692
|
output: {
|
|
681
693
|
workerId: string;
|
|
682
694
|
settled: boolean;
|
|
@@ -801,7 +813,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
801
813
|
workerId: string;
|
|
802
814
|
};
|
|
803
815
|
};
|
|
804
|
-
}
|
|
816
|
+
};
|
|
817
|
+
};
|
|
818
|
+
} & {
|
|
819
|
+
"/:workerId/collect": {
|
|
820
|
+
$post: {
|
|
805
821
|
output: {
|
|
806
822
|
error: string;
|
|
807
823
|
code?: "invalid_input" | undefined;
|
|
@@ -812,12 +828,10 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
812
828
|
param: {
|
|
813
829
|
workerId: string;
|
|
814
830
|
};
|
|
831
|
+
} & {
|
|
832
|
+
json: Record<string, never>;
|
|
815
833
|
};
|
|
816
|
-
}
|
|
817
|
-
};
|
|
818
|
-
} & {
|
|
819
|
-
"/:workerId/collect": {
|
|
820
|
-
$post: {
|
|
834
|
+
} | {
|
|
821
835
|
output: {
|
|
822
836
|
workerId: string;
|
|
823
837
|
parentRunId: string;
|
|
@@ -940,7 +954,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
940
954
|
} & {
|
|
941
955
|
json: Record<string, never>;
|
|
942
956
|
};
|
|
943
|
-
}
|
|
957
|
+
};
|
|
958
|
+
};
|
|
959
|
+
} & {
|
|
960
|
+
"/:workerId/steer": {
|
|
961
|
+
$post: {
|
|
944
962
|
output: {
|
|
945
963
|
error: string;
|
|
946
964
|
code?: "invalid_input" | undefined;
|
|
@@ -952,13 +970,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
952
970
|
workerId: string;
|
|
953
971
|
};
|
|
954
972
|
} & {
|
|
955
|
-
json:
|
|
973
|
+
json: {
|
|
974
|
+
text: string;
|
|
975
|
+
};
|
|
956
976
|
};
|
|
957
|
-
}
|
|
958
|
-
};
|
|
959
|
-
} & {
|
|
960
|
-
"/:workerId/steer": {
|
|
961
|
-
$post: {
|
|
977
|
+
} | {
|
|
962
978
|
output: {
|
|
963
979
|
workerId: string;
|
|
964
980
|
state: "delivered" | "queued";
|
|
@@ -974,7 +990,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
974
990
|
text: string;
|
|
975
991
|
};
|
|
976
992
|
};
|
|
977
|
-
}
|
|
993
|
+
};
|
|
994
|
+
};
|
|
995
|
+
} & {
|
|
996
|
+
"/:workerId/stop": {
|
|
997
|
+
$post: {
|
|
978
998
|
output: {
|
|
979
999
|
error: string;
|
|
980
1000
|
code?: "invalid_input" | undefined;
|
|
@@ -986,15 +1006,9 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
986
1006
|
workerId: string;
|
|
987
1007
|
};
|
|
988
1008
|
} & {
|
|
989
|
-
json:
|
|
990
|
-
text: string;
|
|
991
|
-
};
|
|
1009
|
+
json: Record<string, never>;
|
|
992
1010
|
};
|
|
993
|
-
}
|
|
994
|
-
};
|
|
995
|
-
} & {
|
|
996
|
-
"/:workerId/stop": {
|
|
997
|
-
$post: {
|
|
1011
|
+
} | {
|
|
998
1012
|
output: {
|
|
999
1013
|
workerId: string;
|
|
1000
1014
|
state: "stopping" | "terminated";
|
|
@@ -1008,7 +1022,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1008
1022
|
} & {
|
|
1009
1023
|
json: Record<string, never>;
|
|
1010
1024
|
};
|
|
1011
|
-
}
|
|
1025
|
+
};
|
|
1026
|
+
};
|
|
1027
|
+
} & {
|
|
1028
|
+
"/:workerId/destroy": {
|
|
1029
|
+
$post: {
|
|
1012
1030
|
output: {
|
|
1013
1031
|
error: string;
|
|
1014
1032
|
code?: "invalid_input" | undefined;
|
|
@@ -1020,13 +1038,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1020
1038
|
workerId: string;
|
|
1021
1039
|
};
|
|
1022
1040
|
} & {
|
|
1023
|
-
json:
|
|
1041
|
+
json: {
|
|
1042
|
+
discardWork?: true | undefined;
|
|
1043
|
+
};
|
|
1024
1044
|
};
|
|
1025
|
-
}
|
|
1026
|
-
};
|
|
1027
|
-
} & {
|
|
1028
|
-
"/:workerId/destroy": {
|
|
1029
|
-
$post: {
|
|
1045
|
+
} | {
|
|
1030
1046
|
output: {
|
|
1031
1047
|
workerId: string;
|
|
1032
1048
|
state: "complete" | "incomplete";
|
|
@@ -1055,22 +1071,6 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1055
1071
|
discardWork?: true | undefined;
|
|
1056
1072
|
};
|
|
1057
1073
|
};
|
|
1058
|
-
} | {
|
|
1059
|
-
output: {
|
|
1060
|
-
error: string;
|
|
1061
|
-
code?: "invalid_input" | undefined;
|
|
1062
|
-
};
|
|
1063
|
-
outputFormat: "json";
|
|
1064
|
-
status: 400;
|
|
1065
|
-
input: {
|
|
1066
|
-
param: {
|
|
1067
|
-
workerId: string;
|
|
1068
|
-
};
|
|
1069
|
-
} & {
|
|
1070
|
-
json: {
|
|
1071
|
-
discardWork?: true | undefined;
|
|
1072
|
-
};
|
|
1073
|
-
};
|
|
1074
1074
|
} | {
|
|
1075
1075
|
output: {
|
|
1076
1076
|
workerId: string;
|
|
@@ -1106,13 +1106,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1106
1106
|
"/:workerId/diff": {
|
|
1107
1107
|
$get: {
|
|
1108
1108
|
output: {
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
diff: string;
|
|
1112
|
-
truncated: boolean;
|
|
1109
|
+
error: string;
|
|
1110
|
+
code?: "invalid_input" | undefined;
|
|
1113
1111
|
};
|
|
1114
1112
|
outputFormat: "json";
|
|
1115
|
-
status:
|
|
1113
|
+
status: 400;
|
|
1116
1114
|
input: {
|
|
1117
1115
|
param: {
|
|
1118
1116
|
workerId: string;
|
|
@@ -1120,11 +1118,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1120
1118
|
};
|
|
1121
1119
|
} | {
|
|
1122
1120
|
output: {
|
|
1123
|
-
|
|
1124
|
-
|
|
1121
|
+
workerId: string;
|
|
1122
|
+
baselineSha: string;
|
|
1123
|
+
diff: string;
|
|
1124
|
+
truncated: boolean;
|
|
1125
1125
|
};
|
|
1126
1126
|
outputFormat: "json";
|
|
1127
|
-
status:
|
|
1127
|
+
status: 200;
|
|
1128
1128
|
input: {
|
|
1129
1129
|
param: {
|
|
1130
1130
|
workerId: string;
|
|
@@ -72,16 +72,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
72
72
|
"/discover": {
|
|
73
73
|
$post: {
|
|
74
74
|
output: {
|
|
75
|
-
scope: "host-default-account";
|
|
76
|
-
runners: {
|
|
77
|
-
requiresAccountHome?: boolean | undefined;
|
|
78
|
-
status: "connected" | "disconnected" | "not-installed" | "unknown";
|
|
79
|
-
enabled?: boolean | undefined;
|
|
80
|
-
hint?: string | undefined;
|
|
81
|
-
authFailureId?: string | undefined;
|
|
82
|
-
runner: string;
|
|
83
|
-
}[];
|
|
84
|
-
} | {
|
|
85
75
|
runner: string;
|
|
86
76
|
models: {
|
|
87
77
|
id: string;
|
|
@@ -92,6 +82,16 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
92
82
|
source: "cache" | "live" | "unavailable";
|
|
93
83
|
stale: boolean;
|
|
94
84
|
reason?: string | undefined;
|
|
85
|
+
} | {
|
|
86
|
+
scope: "host-default-account";
|
|
87
|
+
runners: {
|
|
88
|
+
requiresAccountHome?: boolean | undefined;
|
|
89
|
+
status: "connected" | "disconnected" | "not-installed" | "unknown";
|
|
90
|
+
enabled?: boolean | undefined;
|
|
91
|
+
hint?: string | undefined;
|
|
92
|
+
authFailureId?: string | undefined;
|
|
93
|
+
runner: string;
|
|
94
|
+
}[];
|
|
95
95
|
} | {
|
|
96
96
|
tasks: {
|
|
97
97
|
id: string;
|
|
@@ -222,13 +222,13 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
222
222
|
status: 200;
|
|
223
223
|
input: {
|
|
224
224
|
json: {
|
|
225
|
-
workerIds: string[];
|
|
226
|
-
timeoutSeconds?: number | undefined;
|
|
227
|
-
mode?: "all" | "any" | "one" | undefined;
|
|
228
|
-
} | {
|
|
229
225
|
requestIds: string[];
|
|
230
226
|
mode?: "all" | "any" | "one" | undefined;
|
|
231
227
|
timeoutSeconds?: number | undefined;
|
|
228
|
+
} | {
|
|
229
|
+
workerIds: string[];
|
|
230
|
+
timeoutSeconds?: number | undefined;
|
|
231
|
+
mode?: "all" | "any" | "one" | undefined;
|
|
232
232
|
} | {
|
|
233
233
|
peerIds: string[];
|
|
234
234
|
timeoutSeconds?: number | undefined;
|
|
@@ -77,14 +77,15 @@ export declare const CHROMIUM_PID_FILE = "chromium.pid.json";
|
|
|
77
77
|
/**
|
|
78
78
|
* Starts headless Chromium with its DevTools on a pipe and resolves once the browser answers
|
|
79
79
|
* `Browser.getVersion` on it. A launch that stalls without progress is killed and tried once more
|
|
80
|
-
* (`LAUNCH_ATTEMPTS`); any other failure kills the process and says why at once. While it runs,
|
|
80
|
+
* (`LAUNCH_ATTEMPTS`), and `warn` says so; any other failure kills the process and says why at once. While it runs,
|
|
81
81
|
* `CHROMIUM_PID_FILE` in the profile's parent names it. Leak detection is turned off in the profile
|
|
82
82
|
* Preferences before spawn so Chrome's leaked-password dialog cannot freeze preview input
|
|
83
83
|
* (hearsay-tools/cezarion#972).
|
|
84
84
|
*/
|
|
85
85
|
export declare function launchChromium(bin: string, profileDir: string, env: NodeJS.ProcessEnv, opts?: {
|
|
86
|
-
timeoutMs?: number;
|
|
86
|
+
/** Silence window; the overall hang guard is independent. */ timeoutMs?: number;
|
|
87
87
|
readProgress?: typeof chromiumProcessProgress;
|
|
88
|
+
/** Where a killed and retried launch is reported; the host's log by default. */ warn?: (line: string) => void;
|
|
88
89
|
}): Promise<{
|
|
89
90
|
proc: ChildProcess;
|
|
90
91
|
browser: CdpConnection;
|
package/dist/preview/chromium.js
CHANGED
|
@@ -387,7 +387,7 @@ function disablePasswordManagerLeakDetection(profileDir) {
|
|
|
387
387
|
/**
|
|
388
388
|
* Starts headless Chromium with its DevTools on a pipe and resolves once the browser answers
|
|
389
389
|
* `Browser.getVersion` on it. A launch that stalls without progress is killed and tried once more
|
|
390
|
-
* (`LAUNCH_ATTEMPTS`); any other failure kills the process and says why at once. While it runs,
|
|
390
|
+
* (`LAUNCH_ATTEMPTS`), and `warn` says so; any other failure kills the process and says why at once. While it runs,
|
|
391
391
|
* `CHROMIUM_PID_FILE` in the profile's parent names it. Leak detection is turned off in the profile
|
|
392
392
|
* Preferences before spawn so Chrome's leaked-password dialog cannot freeze preview input
|
|
393
393
|
* (hearsay-tools/cezarion#972).
|
|
@@ -396,7 +396,9 @@ export async function launchChromium(bin, profileDir, env, opts = {}) {
|
|
|
396
396
|
mkdirSync(profileDir, { recursive: true });
|
|
397
397
|
disablePasswordManagerLeakDetection(profileDir);
|
|
398
398
|
const timeoutMs = opts.timeoutMs ?? LAUNCH_SILENCE_MS;
|
|
399
|
+
const warn = opts.warn ?? ((line) => console.warn(line));
|
|
399
400
|
for (let attempt = 1;; attempt++) {
|
|
401
|
+
const startedAt = Date.now();
|
|
400
402
|
try {
|
|
401
403
|
return await launchOnce(bin, profileDir, env, timeoutMs, opts.readProgress);
|
|
402
404
|
}
|
|
@@ -406,6 +408,8 @@ export async function launchChromium(bin, profileDir, env, opts = {}) {
|
|
|
406
408
|
if (attempt >= LAUNCH_ATTEMPTS) {
|
|
407
409
|
throw new ChromiumError('timeout', error.stderrTail, `Chromium was silent for ${timeoutMs / 1000} s, twice (${bin})`);
|
|
408
410
|
}
|
|
411
|
+
const seconds = Math.round((Date.now() - startedAt) / 1000);
|
|
412
|
+
warn(`[hsq] Chromium was silent for ${timeoutMs / 1000} s; killed it ${seconds} s after it started and starting it again (attempt ${attempt + 1} of ${LAUNCH_ATTEMPTS}, ${bin})`);
|
|
409
413
|
}
|
|
410
414
|
}
|
|
411
415
|
}
|