@hearsay-tools/squawk 0.19.0-pr4422.8666 → 0.19.0-pr4422.8708

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.
Files changed (128) hide show
  1. package/dist/automations/tools.d.ts +8 -8
  2. package/dist/ci-wait/controller.d.ts +7 -7
  3. package/dist/contract/index.js +55 -14
  4. package/dist/contract/runs.d.ts +50 -0
  5. package/dist/contract/workspace-events.d.ts +18 -0
  6. package/dist/delegation/routes.d.ts +65 -65
  7. package/dist/delegation/transport.d.ts +14 -14
  8. package/dist/preview/chromium.d.ts +3 -2
  9. package/dist/preview/chromium.js +5 -1
  10. package/dist/preview/chromium.js.map +1 -1
  11. package/dist/runs/run-database.d.ts +5 -0
  12. package/dist/runs/run-database.js +5 -0
  13. package/dist/runs/run-database.js.map +1 -1
  14. package/dist/runs/run-queries.d.ts +9 -0
  15. package/dist/runs/run-queries.js +43 -6
  16. package/dist/runs/run-queries.js.map +1 -1
  17. package/dist/runs/store.js +1 -0
  18. package/dist/runs/store.js.map +1 -1
  19. package/dist/runs/transcript-facts-queue.d.ts +9 -1
  20. package/dist/runs/transcript-facts-queue.js +43 -10
  21. package/dist/runs/transcript-facts-queue.js.map +1 -1
  22. package/dist/runs/transcript-facts-sidecar.d.ts +22 -0
  23. package/dist/runs/transcript-facts-sidecar.js +58 -0
  24. package/dist/runs/transcript-facts-sidecar.js.map +1 -0
  25. package/dist/runs/transcript-facts-topic.d.ts +2 -0
  26. package/dist/runs/transcript-facts-topic.js +8 -10
  27. package/dist/runs/transcript-facts-topic.js.map +1 -1
  28. package/dist/runs/transcript-facts-worker.d.ts +7 -2
  29. package/dist/runs/transcript-facts-worker.js +8 -5
  30. package/dist/runs/transcript-facts-worker.js.map +1 -1
  31. package/dist/runs/transcript-facts.d.ts +4 -0
  32. package/dist/runs/transcript-facts.js +36 -16
  33. package/dist/runs/transcript-facts.js.map +1 -1
  34. package/dist/server/automations-routes.d.ts +150 -150
  35. package/dist/server/live-routes.d.ts +6 -6
  36. package/dist/server/models-routes.d.ts +12 -12
  37. package/dist/server/project-settings-routes.d.ts +107 -107
  38. package/dist/server/providers-routes.d.ts +57 -57
  39. package/dist/server/repo-routes.d.ts +34 -34
  40. package/dist/server/runner-install-routes.d.ts +10 -10
  41. package/dist/server/runners-routes.d.ts +10 -10
  42. package/dist/server/runs-routes.d.ts +24 -16
  43. package/dist/server/server.d.ts +1622 -1598
  44. package/dist/server/workspace-live-routes.d.ts +6 -6
  45. package/dist/server/workspace-routes.d.ts +92 -84
  46. package/package.json +4 -4
  47. package/scripts/measure-transcript-facts-health.mjs +10 -5
  48. package/scripts/measure-transcript-facts-lag.mjs +11 -2
  49. package/scripts/mock-ci-tool.mjs +4 -5
  50. package/scripts/transcript-facts-timing.mjs +10 -0
  51. package/web/dist/assets/{accounts-section-DrBRvg0M.js → accounts-section-De2qXAo-.js} +1 -1
  52. package/web/dist/assets/activity-motion-EJBR3wlq.js +1 -0
  53. package/web/dist/assets/{activity-route-CRu58Zj9.js → activity-route-6cQ_MX2v.js} +1 -1
  54. package/web/dist/assets/{agent-config-section-DXLXyPzF.js → agent-config-section-DFP2-YWs.js} +1 -1
  55. package/web/dist/assets/{agent-defaults-section-MHwKLUxx.js → agent-defaults-section-D88m66PJ.js} +1 -1
  56. package/web/dist/assets/{appearance-Dk8ikc1j.js → appearance-BwV8iZFM.js} +1 -1
  57. package/web/dist/assets/{archive-on-merge-field-CRGCTE05.js → archive-on-merge-field-BzFhSzxv.js} +1 -1
  58. package/web/dist/assets/attention--Y0CyzCN.js +1 -0
  59. package/web/dist/assets/{automations-route-2Z1J6aVz.js → automations-route-Cuz2CxlC.js} +2 -2
  60. package/web/dist/assets/commit-list-D8yY5bIe.js +1 -0
  61. package/web/dist/assets/diff-BBr7hIpt.js +3 -0
  62. package/web/dist/assets/{diff-controls-U3q_bktr.js → diff-controls-PEQLG-Zu.js} +1 -1
  63. package/web/dist/assets/diff-stat-U7DT4Ilj.js +1 -0
  64. package/web/dist/assets/{diff-view-BaEIMlyb.js → diff-view-Dma7qveY.js} +1 -1
  65. package/web/dist/assets/{file-preview-LgaV6Wwo.js → file-preview-DXB5mwQq.js} +1 -1
  66. package/web/dist/assets/{folder-browser-D_V807qp.js → folder-browser-CF2Sk1aR.js} +1 -1
  67. package/web/dist/assets/git-toolbar-dRjJ3sJQ.js +1 -0
  68. package/web/dist/assets/github-CLbTpdZ7.js +1 -0
  69. package/web/dist/assets/{global-activity-route-CrRAIAo1.js → global-activity-route-BXwZUqR8.js} +2 -2
  70. package/web/dist/assets/image-preview-2S3PEy8S.js +1 -0
  71. package/web/dist/assets/index-1TLdjVro.css +1 -0
  72. package/web/dist/assets/index-7Rg7tdSP.js +21 -0
  73. package/web/dist/assets/{label-C6BpWk0J.js → label-Bgcri58t.js} +1 -1
  74. package/web/dist/assets/{markdown-BVqO9ORd.js → markdown-gNAPnLDC.js} +1 -1
  75. package/web/dist/assets/{notifications-section-CliGeYkh.js → notifications-section-CnjarooH.js} +1 -1
  76. package/web/dist/assets/{open-in-menu-BkmmqWdB.js → open-in-menu-Qylys2X_.js} +1 -1
  77. package/web/dist/assets/{preview-pane-connected-Bg56dRpV.js → preview-pane-connected-CimzK7Qz.js} +2 -2
  78. package/web/dist/assets/{project-location-Z28U6-d1.js → project-location-n15GhUq1.js} +1 -1
  79. package/web/dist/assets/{project-router-B8blqSVo.js → project-router-CT6gVIcC.js} +1 -1
  80. package/web/dist/assets/{projects-section-DSNxCSOR.js → projects-section-DiaRaoyV.js} +1 -1
  81. package/web/dist/assets/{prompt-templates-section-BBGVLRbE.js → prompt-templates-section-5UJStA2u.js} +1 -1
  82. package/web/dist/assets/{queries-BwJVP1so.js → queries-BddxDJyD.js} +1 -1
  83. package/web/dist/assets/{reference-chip-uLQTF-sm.js → reference-chip-BGFxuvs6.js} +1 -1
  84. package/web/dist/assets/{remote-settings-notice-7BteeZ5o.js → remote-settings-notice-ihbrhzlZ.js} +1 -1
  85. package/web/dist/assets/repo-git-DaKHEjDf.js +1 -0
  86. package/web/dist/assets/{report-reader-Be9J9B79.js → report-reader-8B7MnBnV.js} +1 -1
  87. package/web/dist/assets/{report-selection-DBM7S3ha.js → report-selection-BwiY8hK3.js} +1 -1
  88. package/web/dist/assets/{reports-BOiZGsQR.js → reports-BeOzwtBO.js} +1 -1
  89. package/web/dist/assets/{resources-section-B3kPFCJY.js → resources-section-D2tex4pF.js} +1 -1
  90. package/web/dist/assets/review-panel-YwUoKsbu.js +8 -0
  91. package/web/dist/assets/{run-detail-refresh-YR2-iM4z.js → run-detail-refresh-C8P2J7Wq.js} +1 -1
  92. package/web/dist/assets/{run-header-BG-RicJl.js → run-header-CkhPOV1B.js} +2 -2
  93. package/web/dist/assets/{select-Be4wVHHG.js → select-BXpAjbYk.js} +1 -1
  94. package/web/dist/assets/{session-context-section-DdCeADhA.js → session-context-section-DkhGlKdR.js} +2 -2
  95. package/web/dist/assets/{settings-agent-picker-C4hz36AY.js → settings-agent-picker-3cUJmNQz.js} +1 -1
  96. package/web/dist/assets/{settings-shell-BluR2G4L.js → settings-shell-D--QpDPG.js} +1 -1
  97. package/web/dist/assets/{sidebar-section-Bo1FJw3L.js → sidebar-section-BydWRh8S.js} +1 -1
  98. package/web/dist/assets/{skills-DWVky-g5.js → skills-CbEyPyvn.js} +1 -1
  99. package/web/dist/assets/{tab-link-BkHBgpdC.js → tab-link-DE6t7XkG.js} +1 -1
  100. package/web/dist/assets/task-changes-BXDJmZkO.js +1 -0
  101. package/web/dist/assets/task-commits-B4uUhWjt.js +1 -0
  102. package/web/dist/assets/{task-files-BtAxAAcl.js → task-files-vOSCBpIt.js} +1 -1
  103. package/web/dist/assets/{task-github-item-DFD4xHYk.js → task-github-item-BIaOF-Ea.js} +1 -1
  104. package/web/dist/assets/{task-groups-BSovus2j.js → task-groups-CHHLB77I.js} +1 -1
  105. package/web/dist/assets/task-thread-MKnHdrU1.js +2 -0
  106. package/web/dist/assets/{tasks-table-C-wxALy6.js → tasks-table-5GNEZlxs.js} +1 -1
  107. package/web/dist/assets/{thread-state-DyYOz-Ad.js → thread-state-BtUboBbd.js} +1 -1
  108. package/web/dist/assets/{toaster-UvSCLhYx.js → toaster-C-xqAWVX.js} +2 -2
  109. package/web/dist/assets/use-hand-to-agent-state-BwQ45AKw.js +1 -0
  110. package/web/dist/assets/{workflows-C4UY4ka5.js → workflows-DUoxhR8h.js} +3 -3
  111. package/web/dist/assets/{workspace-tools-BMtjV-oC.js → workspace-tools-dwQmpL6C.js} +1 -1
  112. package/web/dist/assets/{worktrees-section-Bntdbzrl.js → worktrees-section-B9LR3yvO.js} +1 -1
  113. package/web/dist/index.html +16 -15
  114. package/web/dist/assets/activity-motion-DyczKxjj.js +0 -1
  115. package/web/dist/assets/attention-CXG_AzDe.js +0 -1
  116. package/web/dist/assets/commit-list-CjmYvVCK.js +0 -1
  117. package/web/dist/assets/diff-B1RHxCxU.js +0 -3
  118. package/web/dist/assets/git-toolbar-DyQaOcLy.js +0 -1
  119. package/web/dist/assets/github-DYLq16Wk.js +0 -1
  120. package/web/dist/assets/image-preview-OjGspLQY.js +0 -1
  121. package/web/dist/assets/index-AgYIT7cV.js +0 -21
  122. package/web/dist/assets/index-DTMSoiHJ.css +0 -1
  123. package/web/dist/assets/repo-git-DiNgzGWX.js +0 -1
  124. package/web/dist/assets/review-panel-CQp83gYh.js +0 -8
  125. package/web/dist/assets/task-changes-2yAaEJQ_.js +0 -1
  126. package/web/dist/assets/task-commits-02w8Ivwi.js +0 -1
  127. package/web/dist/assets/task-thread-Ck75x2Rd.js +0 -2
  128. package/web/dist/assets/use-hand-to-agent-state-BfQx2nM5.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<{
@@ -121,12 +121,9 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
121
121
  } & {
122
122
  "/api/v1/tools/:name": {
123
123
  $post: {
124
- output: {
125
- code: string;
126
- message: string;
127
- };
124
+ output: never;
128
125
  outputFormat: "json";
129
- status: 401;
126
+ status: import("hono/utils/http-status").ContentfulStatusCode;
130
127
  input: {
131
128
  json: unknown;
132
129
  } & {
@@ -149,9 +146,12 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
149
146
  };
150
147
  };
151
148
  } | {
152
- output: never;
149
+ output: {
150
+ code: string;
151
+ message: string;
152
+ };
153
153
  outputFormat: "json";
154
- status: import("hono/utils/http-status").ContentfulStatusCode;
154
+ status: 401;
155
155
  input: {
156
156
  json: unknown;
157
157
  } & {
@@ -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);
@@ -6609,6 +6648,7 @@ export {
6609
6648
  deleteRunResponseSchema,
6610
6649
  deleteWorkflowResponseSchema,
6611
6650
  deriveAttention,
6651
+ deriveRunStatePreview,
6612
6652
  deriveWebhookState,
6613
6653
  diffStatSchema,
6614
6654
  discoveredRunnerSchema,
@@ -6898,6 +6938,7 @@ export {
6898
6938
  runPullRequestSchema,
6899
6939
  runRecordSchema,
6900
6940
  runRelationshipsSchema,
6941
+ runStatePreviewSchema,
6901
6942
  runStatusSchema,
6902
6943
  runSummariesQuerySchema,
6903
6944
  runSummarySchema,
@@ -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,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;
@@ -91,6 +79,18 @@ export declare function createDelegationRoutes(service: DelegationService, crede
91
79
  offset?: string | undefined;
92
80
  };
93
81
  };
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,18 +677,6 @@ 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
- } | {
692
680
  output: {
693
681
  workerId: string;
694
682
  settled: boolean;
@@ -813,11 +801,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
813
801
  workerId: string;
814
802
  };
815
803
  };
816
- };
817
- };
818
- } & {
819
- "/:workerId/collect": {
820
- $post: {
804
+ } | {
821
805
  output: {
822
806
  error: string;
823
807
  code?: "invalid_input" | undefined;
@@ -828,10 +812,12 @@ export declare function createDelegationRoutes(service: DelegationService, crede
828
812
  param: {
829
813
  workerId: string;
830
814
  };
831
- } & {
832
- json: Record<string, never>;
833
815
  };
834
- } | {
816
+ };
817
+ };
818
+ } & {
819
+ "/:workerId/collect": {
820
+ $post: {
835
821
  output: {
836
822
  workerId: string;
837
823
  parentRunId: string;
@@ -954,11 +940,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
954
940
  } & {
955
941
  json: Record<string, never>;
956
942
  };
957
- };
958
- };
959
- } & {
960
- "/:workerId/steer": {
961
- $post: {
943
+ } | {
962
944
  output: {
963
945
  error: string;
964
946
  code?: "invalid_input" | undefined;
@@ -970,11 +952,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
970
952
  workerId: string;
971
953
  };
972
954
  } & {
973
- json: {
974
- text: string;
975
- };
955
+ json: Record<string, never>;
976
956
  };
977
- } | {
957
+ };
958
+ };
959
+ } & {
960
+ "/:workerId/steer": {
961
+ $post: {
978
962
  output: {
979
963
  workerId: string;
980
964
  state: "delivered" | "queued";
@@ -990,11 +974,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
990
974
  text: string;
991
975
  };
992
976
  };
993
- };
994
- };
995
- } & {
996
- "/:workerId/stop": {
997
- $post: {
977
+ } | {
998
978
  output: {
999
979
  error: string;
1000
980
  code?: "invalid_input" | undefined;
@@ -1006,9 +986,15 @@ export declare function createDelegationRoutes(service: DelegationService, crede
1006
986
  workerId: string;
1007
987
  };
1008
988
  } & {
1009
- json: Record<string, never>;
989
+ json: {
990
+ text: string;
991
+ };
1010
992
  };
1011
- } | {
993
+ };
994
+ };
995
+ } & {
996
+ "/:workerId/stop": {
997
+ $post: {
1012
998
  output: {
1013
999
  workerId: string;
1014
1000
  state: "stopping" | "terminated";
@@ -1022,11 +1008,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
1022
1008
  } & {
1023
1009
  json: Record<string, never>;
1024
1010
  };
1025
- };
1026
- };
1027
- } & {
1028
- "/:workerId/destroy": {
1029
- $post: {
1011
+ } | {
1030
1012
  output: {
1031
1013
  error: string;
1032
1014
  code?: "invalid_input" | undefined;
@@ -1038,11 +1020,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
1038
1020
  workerId: string;
1039
1021
  };
1040
1022
  } & {
1041
- json: {
1042
- discardWork?: true | undefined;
1043
- };
1023
+ json: Record<string, never>;
1044
1024
  };
1045
- } | {
1025
+ };
1026
+ };
1027
+ } & {
1028
+ "/:workerId/destroy": {
1029
+ $post: {
1046
1030
  output: {
1047
1031
  workerId: string;
1048
1032
  state: "complete" | "incomplete";
@@ -1071,6 +1055,22 @@ export declare function createDelegationRoutes(service: DelegationService, crede
1071
1055
  discardWork?: true | undefined;
1072
1056
  };
1073
1057
  };
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,11 +1106,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
1106
1106
  "/:workerId/diff": {
1107
1107
  $get: {
1108
1108
  output: {
1109
- error: string;
1110
- code?: "invalid_input" | undefined;
1109
+ workerId: string;
1110
+ baselineSha: string;
1111
+ diff: string;
1112
+ truncated: boolean;
1111
1113
  };
1112
1114
  outputFormat: "json";
1113
- status: 400;
1115
+ status: 200;
1114
1116
  input: {
1115
1117
  param: {
1116
1118
  workerId: string;
@@ -1118,13 +1120,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
1118
1120
  };
1119
1121
  } | {
1120
1122
  output: {
1121
- workerId: string;
1122
- baselineSha: string;
1123
- diff: string;
1124
- truncated: boolean;
1123
+ error: string;
1124
+ code?: "invalid_input" | undefined;
1125
1125
  };
1126
1126
  outputFormat: "json";
1127
- status: 200;
1127
+ status: 400;
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;
@@ -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
  }