@hearsay-tools/squawk 0.18.0-dev.8009 → 0.18.0-dev.8014

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 (57) hide show
  1. package/dist/ci-wait/controller.js +1 -1
  2. package/dist/ci-wait/controller.js.map +1 -1
  3. package/dist/ci-wait/tool-catalog.d.ts +0 -10
  4. package/dist/ci-wait/tool-catalog.js +1 -21
  5. package/dist/ci-wait/tool-catalog.js.map +1 -1
  6. package/dist/ci-wait/tool-env.d.ts +4 -0
  7. package/dist/ci-wait/tool-env.js +11 -0
  8. package/dist/ci-wait/tool-env.js.map +1 -0
  9. package/dist/ci-wait/tool-names.d.ts +10 -0
  10. package/dist/ci-wait/tool-names.js +21 -0
  11. package/dist/ci-wait/tool-names.js.map +1 -0
  12. package/dist/ci-wait/tools.d.ts +7 -5
  13. package/dist/ci-wait/tools.js +3 -1
  14. package/dist/ci-wait/tools.js.map +1 -1
  15. package/dist/delegation/routes.d.ts +15 -15
  16. package/dist/delegation/transport.d.ts +21 -21
  17. package/dist/preview/agent-address.js +1 -1
  18. package/dist/preview/agent-address.js.map +1 -1
  19. package/dist/preview/run-tools.js +1 -1
  20. package/dist/preview/run-tools.js.map +1 -1
  21. package/dist/runners/antigravity/antigravity-session.js +1 -1
  22. package/dist/runners/antigravity/antigravity-session.js.map +1 -1
  23. package/dist/runners/claude/claude-cli-runner.js +1 -1
  24. package/dist/runners/claude/claude-cli-runner.js.map +1 -1
  25. package/dist/runners/codex/codex-thread-config.js +1 -1
  26. package/dist/runners/codex/codex-thread-config.js.map +1 -1
  27. package/dist/runners/omp/omp-runner.js +1 -1
  28. package/dist/runners/omp/omp-runner.js.map +1 -1
  29. package/dist/runners/pi/pi-runner.js +1 -1
  30. package/dist/runners/pi/pi-runner.js.map +1 -1
  31. package/dist/runs/archive-family.js +2 -2
  32. package/dist/runs/archive-family.js.map +1 -1
  33. package/dist/runs/outcome-commit.js +6 -7
  34. package/dist/runs/outcome-commit.js.map +1 -1
  35. package/dist/runs/run-archive.d.ts +72 -72
  36. package/dist/runs/wait-helpers.d.ts +28 -0
  37. package/dist/runs/wait-helpers.js +34 -0
  38. package/dist/runs/wait-helpers.js.map +1 -0
  39. package/dist/serve-command.d.ts +1 -1
  40. package/dist/serve-command.js +1 -1
  41. package/dist/serve-command.js.map +1 -1
  42. package/dist/server/preview-cdp-socket.js +1 -1
  43. package/dist/server/preview-cdp-socket.js.map +1 -1
  44. package/dist/server/preview-socket.js +1 -1
  45. package/dist/server/preview-socket.js.map +1 -1
  46. package/dist/server/server.d.ts +1400 -1400
  47. package/dist/server/workspace-live-routes.d.ts +6 -6
  48. package/dist/workflows/continuation-admission.d.ts +72 -72
  49. package/dist/workflows/input-acknowledgement.d.ts +24 -24
  50. package/dist/workflows/run/wait-engine.d.ts +72 -72
  51. package/dist/workflows/run/wait-kinds.d.ts +2 -5
  52. package/dist/workflows/run/wait-kinds.js +17 -21
  53. package/dist/workflows/run/wait-kinds.js.map +1 -1
  54. package/dist/workflows/waits.d.ts +4 -4
  55. package/dist/workflows/waits.js +4 -7
  56. package/dist/workflows/waits.js.map +1 -1
  57. package/package.json +4 -4
@@ -7,12 +7,6 @@ export declare function createWorkspaceLiveRoutes(live: Parameters<typeof create
7
7
  output: {
8
8
  generation: string;
9
9
  results: ({
10
- projectId: string;
11
- runId: string;
12
- type: "error" | "reset";
13
- status: 400 | 404 | 409 | 413 | 503;
14
- error: string;
15
- } | {
16
10
  projectId: string;
17
11
  runId: string;
18
12
  type: "batch";
@@ -26,6 +20,12 @@ export declare function createWorkspaceLiveRoutes(live: Parameters<typeof create
26
20
  cursor: string;
27
21
  afterSeq: number;
28
22
  hasMore: boolean;
23
+ } | {
24
+ projectId: string;
25
+ runId: string;
26
+ type: "error" | "reset";
27
+ status: 400 | 404 | 409 | 413 | 503;
28
+ error: string;
29
29
  })[];
30
30
  };
31
31
  outputFormat: "json";
@@ -296,6 +296,30 @@ export declare class ContinuationChecks {
296
296
  deadline: string;
297
297
  seconds: number;
298
298
  note?: string | undefined;
299
+ } | {
300
+ id: string;
301
+ source: "agent" | "cezar";
302
+ via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
303
+ registeredAt: string;
304
+ phase: "cancelled" | "delivered" | "open" | "resolved";
305
+ resolvedAt?: string | undefined;
306
+ deliveredAt?: string | undefined;
307
+ cancelledAt?: string | undefined;
308
+ turnId: string;
309
+ kind: "process";
310
+ deadline: string;
311
+ timeoutSeconds: number;
312
+ pid: number;
313
+ startToken?: string | undefined;
314
+ exitFile?: string | undefined;
315
+ note?: string | undefined;
316
+ result?: {
317
+ outcome: "deadline" | "error" | "exit_file" | "exited";
318
+ observedAt: string;
319
+ exitCode?: number | undefined;
320
+ exitFileNote?: "not-an-exit-code" | undefined;
321
+ diagnostic?: string | undefined;
322
+ } | undefined;
299
323
  } | {
300
324
  id: string;
301
325
  source: "agent" | "cezar";
@@ -357,30 +381,6 @@ export declare class ContinuationChecks {
357
381
  reason: "outcome" | "timeout";
358
382
  } | undefined;
359
383
  wakeInputId?: string | undefined;
360
- } | {
361
- id: string;
362
- source: "agent" | "cezar";
363
- via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
364
- registeredAt: string;
365
- phase: "cancelled" | "delivered" | "open" | "resolved";
366
- resolvedAt?: string | undefined;
367
- deliveredAt?: string | undefined;
368
- cancelledAt?: string | undefined;
369
- turnId: string;
370
- kind: "process";
371
- deadline: string;
372
- timeoutSeconds: number;
373
- pid: number;
374
- startToken?: string | undefined;
375
- exitFile?: string | undefined;
376
- note?: string | undefined;
377
- result?: {
378
- outcome: "deadline" | "error" | "exit_file" | "exited";
379
- observedAt: string;
380
- exitCode?: number | undefined;
381
- exitFileNote?: "not-an-exit-code" | undefined;
382
- diagnostic?: string | undefined;
383
- } | undefined;
384
384
  } | {
385
385
  id: string;
386
386
  source: "agent" | "cezar";
@@ -492,6 +492,30 @@ export declare class ContinuationChecks {
492
492
  deadline: string;
493
493
  seconds: number;
494
494
  note?: string | undefined;
495
+ } | {
496
+ id: string;
497
+ source: "agent" | "cezar";
498
+ via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
499
+ registeredAt: string;
500
+ phase: "cancelled" | "delivered" | "open" | "resolved";
501
+ resolvedAt?: string | undefined;
502
+ deliveredAt?: string | undefined;
503
+ cancelledAt?: string | undefined;
504
+ turnId: string;
505
+ kind: "process";
506
+ deadline: string;
507
+ timeoutSeconds: number;
508
+ pid: number;
509
+ startToken?: string | undefined;
510
+ exitFile?: string | undefined;
511
+ note?: string | undefined;
512
+ result?: {
513
+ outcome: "deadline" | "error" | "exit_file" | "exited";
514
+ observedAt: string;
515
+ exitCode?: number | undefined;
516
+ exitFileNote?: "not-an-exit-code" | undefined;
517
+ diagnostic?: string | undefined;
518
+ } | undefined;
495
519
  } | {
496
520
  id: string;
497
521
  source: "agent" | "cezar";
@@ -553,30 +577,6 @@ export declare class ContinuationChecks {
553
577
  reason: "outcome" | "timeout";
554
578
  } | undefined;
555
579
  wakeInputId?: string | undefined;
556
- } | {
557
- id: string;
558
- source: "agent" | "cezar";
559
- via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
560
- registeredAt: string;
561
- phase: "cancelled" | "delivered" | "open" | "resolved";
562
- resolvedAt?: string | undefined;
563
- deliveredAt?: string | undefined;
564
- cancelledAt?: string | undefined;
565
- turnId: string;
566
- kind: "process";
567
- deadline: string;
568
- timeoutSeconds: number;
569
- pid: number;
570
- startToken?: string | undefined;
571
- exitFile?: string | undefined;
572
- note?: string | undefined;
573
- result?: {
574
- outcome: "deadline" | "error" | "exit_file" | "exited";
575
- observedAt: string;
576
- exitCode?: number | undefined;
577
- exitFileNote?: "not-an-exit-code" | undefined;
578
- diagnostic?: string | undefined;
579
- } | undefined;
580
580
  } | {
581
581
  id: string;
582
582
  source: "agent" | "cezar";
@@ -687,6 +687,30 @@ export declare class ContinuationChecks {
687
687
  deadline: string;
688
688
  seconds: number;
689
689
  note?: string | undefined;
690
+ } | {
691
+ id: string;
692
+ source: "agent" | "cezar";
693
+ via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
694
+ registeredAt: string;
695
+ phase: "cancelled" | "delivered" | "open" | "resolved";
696
+ resolvedAt?: string | undefined;
697
+ deliveredAt?: string | undefined;
698
+ cancelledAt?: string | undefined;
699
+ turnId: string;
700
+ kind: "process";
701
+ deadline: string;
702
+ timeoutSeconds: number;
703
+ pid: number;
704
+ startToken?: string | undefined;
705
+ exitFile?: string | undefined;
706
+ note?: string | undefined;
707
+ result?: {
708
+ outcome: "deadline" | "error" | "exit_file" | "exited";
709
+ observedAt: string;
710
+ exitCode?: number | undefined;
711
+ exitFileNote?: "not-an-exit-code" | undefined;
712
+ diagnostic?: string | undefined;
713
+ } | undefined;
690
714
  } | {
691
715
  id: string;
692
716
  source: "agent" | "cezar";
@@ -748,30 +772,6 @@ export declare class ContinuationChecks {
748
772
  reason: "outcome" | "timeout";
749
773
  } | undefined;
750
774
  wakeInputId?: string | undefined;
751
- } | {
752
- id: string;
753
- source: "agent" | "cezar";
754
- via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
755
- registeredAt: string;
756
- phase: "cancelled" | "delivered" | "open" | "resolved";
757
- resolvedAt?: string | undefined;
758
- deliveredAt?: string | undefined;
759
- cancelledAt?: string | undefined;
760
- turnId: string;
761
- kind: "process";
762
- deadline: string;
763
- timeoutSeconds: number;
764
- pid: number;
765
- startToken?: string | undefined;
766
- exitFile?: string | undefined;
767
- note?: string | undefined;
768
- result?: {
769
- outcome: "deadline" | "error" | "exit_file" | "exited";
770
- observedAt: string;
771
- exitCode?: number | undefined;
772
- exitFileNote?: "not-an-exit-code" | undefined;
773
- diagnostic?: string | undefined;
774
- } | undefined;
775
775
  } | {
776
776
  id: string;
777
777
  source: "agent" | "cezar";
@@ -74,30 +74,6 @@ export declare function analyseAcknowledgedInput(runId: string, state: ActiveRun
74
74
  deadline: string;
75
75
  seconds: number;
76
76
  note?: string | undefined;
77
- } | {
78
- id: string;
79
- source: "agent" | "cezar";
80
- via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
81
- registeredAt: string;
82
- phase: "cancelled" | "delivered" | "open" | "resolved";
83
- resolvedAt?: string | undefined;
84
- deliveredAt?: string | undefined;
85
- cancelledAt?: string | undefined;
86
- turnId: string;
87
- kind: "process";
88
- deadline: string;
89
- timeoutSeconds: number;
90
- pid: number;
91
- startToken?: string | undefined;
92
- exitFile?: string | undefined;
93
- note?: string | undefined;
94
- result?: {
95
- outcome: "deadline" | "error" | "exit_file" | "exited";
96
- observedAt: string;
97
- exitCode?: number | undefined;
98
- exitFileNote?: "not-an-exit-code" | undefined;
99
- diagnostic?: string | undefined;
100
- } | undefined;
101
77
  } | {
102
78
  id: string;
103
79
  source: "agent" | "cezar";
@@ -159,6 +135,30 @@ export declare function analyseAcknowledgedInput(runId: string, state: ActiveRun
159
135
  reason: "outcome" | "timeout";
160
136
  } | undefined;
161
137
  wakeInputId?: string | undefined;
138
+ } | {
139
+ id: string;
140
+ source: "agent" | "cezar";
141
+ via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
142
+ registeredAt: string;
143
+ phase: "cancelled" | "delivered" | "open" | "resolved";
144
+ resolvedAt?: string | undefined;
145
+ deliveredAt?: string | undefined;
146
+ cancelledAt?: string | undefined;
147
+ turnId: string;
148
+ kind: "process";
149
+ deadline: string;
150
+ timeoutSeconds: number;
151
+ pid: number;
152
+ startToken?: string | undefined;
153
+ exitFile?: string | undefined;
154
+ note?: string | undefined;
155
+ result?: {
156
+ outcome: "deadline" | "error" | "exit_file" | "exited";
157
+ observedAt: string;
158
+ exitCode?: number | undefined;
159
+ exitFileNote?: "not-an-exit-code" | undefined;
160
+ diagnostic?: string | undefined;
161
+ } | undefined;
162
162
  } | {
163
163
  id: string;
164
164
  source: "agent" | "cezar";
@@ -239,30 +239,6 @@ export declare class WaitEngine {
239
239
  deadline: string;
240
240
  seconds: number;
241
241
  note?: string | undefined;
242
- } | {
243
- id: string;
244
- source: "agent" | "cezar";
245
- via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
246
- registeredAt: string;
247
- phase: "cancelled" | "delivered" | "open" | "resolved";
248
- resolvedAt?: string | undefined;
249
- deliveredAt?: string | undefined;
250
- cancelledAt?: string | undefined;
251
- turnId: string;
252
- kind: "process";
253
- deadline: string;
254
- timeoutSeconds: number;
255
- pid: number;
256
- startToken?: string | undefined;
257
- exitFile?: string | undefined;
258
- note?: string | undefined;
259
- result?: {
260
- outcome: "deadline" | "error" | "exit_file" | "exited";
261
- observedAt: string;
262
- exitCode?: number | undefined;
263
- exitFileNote?: "not-an-exit-code" | undefined;
264
- diagnostic?: string | undefined;
265
- } | undefined;
266
242
  } | {
267
243
  id: string;
268
244
  source: "agent" | "cezar";
@@ -324,6 +300,30 @@ export declare class WaitEngine {
324
300
  reason: "outcome" | "timeout";
325
301
  } | undefined;
326
302
  wakeInputId?: string | undefined;
303
+ } | {
304
+ id: string;
305
+ source: "agent" | "cezar";
306
+ via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
307
+ registeredAt: string;
308
+ phase: "cancelled" | "delivered" | "open" | "resolved";
309
+ resolvedAt?: string | undefined;
310
+ deliveredAt?: string | undefined;
311
+ cancelledAt?: string | undefined;
312
+ turnId: string;
313
+ kind: "process";
314
+ deadline: string;
315
+ timeoutSeconds: number;
316
+ pid: number;
317
+ startToken?: string | undefined;
318
+ exitFile?: string | undefined;
319
+ note?: string | undefined;
320
+ result?: {
321
+ outcome: "deadline" | "error" | "exit_file" | "exited";
322
+ observedAt: string;
323
+ exitCode?: number | undefined;
324
+ exitFileNote?: "not-an-exit-code" | undefined;
325
+ diagnostic?: string | undefined;
326
+ } | undefined;
327
327
  } | {
328
328
  id: string;
329
329
  source: "agent" | "cezar";
@@ -435,30 +435,6 @@ export declare class WaitEngine {
435
435
  deadline: string;
436
436
  seconds: number;
437
437
  note?: string | undefined;
438
- } | {
439
- id: string;
440
- source: "agent" | "cezar";
441
- via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
442
- registeredAt: string;
443
- phase: "cancelled" | "delivered" | "open" | "resolved";
444
- resolvedAt?: string | undefined;
445
- deliveredAt?: string | undefined;
446
- cancelledAt?: string | undefined;
447
- turnId: string;
448
- kind: "process";
449
- deadline: string;
450
- timeoutSeconds: number;
451
- pid: number;
452
- startToken?: string | undefined;
453
- exitFile?: string | undefined;
454
- note?: string | undefined;
455
- result?: {
456
- outcome: "deadline" | "error" | "exit_file" | "exited";
457
- observedAt: string;
458
- exitCode?: number | undefined;
459
- exitFileNote?: "not-an-exit-code" | undefined;
460
- diagnostic?: string | undefined;
461
- } | undefined;
462
438
  } | {
463
439
  id: string;
464
440
  source: "agent" | "cezar";
@@ -520,6 +496,30 @@ export declare class WaitEngine {
520
496
  reason: "outcome" | "timeout";
521
497
  } | undefined;
522
498
  wakeInputId?: string | undefined;
499
+ } | {
500
+ id: string;
501
+ source: "agent" | "cezar";
502
+ via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
503
+ registeredAt: string;
504
+ phase: "cancelled" | "delivered" | "open" | "resolved";
505
+ resolvedAt?: string | undefined;
506
+ deliveredAt?: string | undefined;
507
+ cancelledAt?: string | undefined;
508
+ turnId: string;
509
+ kind: "process";
510
+ deadline: string;
511
+ timeoutSeconds: number;
512
+ pid: number;
513
+ startToken?: string | undefined;
514
+ exitFile?: string | undefined;
515
+ note?: string | undefined;
516
+ result?: {
517
+ outcome: "deadline" | "error" | "exit_file" | "exited";
518
+ observedAt: string;
519
+ exitCode?: number | undefined;
520
+ exitFileNote?: "not-an-exit-code" | undefined;
521
+ diagnostic?: string | undefined;
522
+ } | undefined;
523
523
  } | {
524
524
  id: string;
525
525
  source: "agent" | "cezar";
@@ -630,30 +630,6 @@ export declare class WaitEngine {
630
630
  deadline: string;
631
631
  seconds: number;
632
632
  note?: string | undefined;
633
- } | {
634
- id: string;
635
- source: "agent" | "cezar";
636
- via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
637
- registeredAt: string;
638
- phase: "cancelled" | "delivered" | "open" | "resolved";
639
- resolvedAt?: string | undefined;
640
- deliveredAt?: string | undefined;
641
- cancelledAt?: string | undefined;
642
- turnId: string;
643
- kind: "process";
644
- deadline: string;
645
- timeoutSeconds: number;
646
- pid: number;
647
- startToken?: string | undefined;
648
- exitFile?: string | undefined;
649
- note?: string | undefined;
650
- result?: {
651
- outcome: "deadline" | "error" | "exit_file" | "exited";
652
- observedAt: string;
653
- exitCode?: number | undefined;
654
- exitFileNote?: "not-an-exit-code" | undefined;
655
- diagnostic?: string | undefined;
656
- } | undefined;
657
633
  } | {
658
634
  id: string;
659
635
  source: "agent" | "cezar";
@@ -715,6 +691,30 @@ export declare class WaitEngine {
715
691
  reason: "outcome" | "timeout";
716
692
  } | undefined;
717
693
  wakeInputId?: string | undefined;
694
+ } | {
695
+ id: string;
696
+ source: "agent" | "cezar";
697
+ via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
698
+ registeredAt: string;
699
+ phase: "cancelled" | "delivered" | "open" | "resolved";
700
+ resolvedAt?: string | undefined;
701
+ deliveredAt?: string | undefined;
702
+ cancelledAt?: string | undefined;
703
+ turnId: string;
704
+ kind: "process";
705
+ deadline: string;
706
+ timeoutSeconds: number;
707
+ pid: number;
708
+ startToken?: string | undefined;
709
+ exitFile?: string | undefined;
710
+ note?: string | undefined;
711
+ result?: {
712
+ outcome: "deadline" | "error" | "exit_file" | "exited";
713
+ observedAt: string;
714
+ exitCode?: number | undefined;
715
+ exitFileNote?: "not-an-exit-code" | undefined;
716
+ diagnostic?: string | undefined;
717
+ } | undefined;
718
718
  } | {
719
719
  id: string;
720
720
  source: "agent" | "cezar";
@@ -3,6 +3,7 @@ import type { CiWatcherSupervisor } from '../../ci-wait/supervisor.ts';
3
3
  import type { TimerWaitEntry, PrWaitEntry, ProcessWaitEntry, PeerWaitEntry, WorkerWaitEntry, HumanWaitEntry, SquawkWaitRequestInput, WaitVia, SubagentWaitEntry, SubagentChild } from '../../contract/index.js';
4
4
  import type { Wait, WaitPhase, SquawkWaitRequest } from '../../contract/index.js';
5
5
  import type { FiredBy } from '../run-states.ts';
6
+ import { isSquawkHumanWait } from '../../runs/wait-helpers.ts';
6
7
  /** Each wait kind: its deadline, whether it keeps a slot while it is the top wait, who resolves it. */
7
8
  export type WaitKindSpec = {
8
9
  deadline: 'required' | 'agent-only' | 'none';
@@ -306,10 +307,7 @@ declare function monitoringTimerEntry(via: WaitVia, now: number, delay: number |
306
307
  /** Monitoring timers: the timers Squawk opens for live workers (`monitoring-line`, also the via of
307
308
  * saved `CEZ:MONITORING` timers) and `ScheduleWakeup`. */
308
309
  export declare function isMonitoringTimer(wait: Wait): boolean;
309
- /** Squawk's own human wait (`no-wait`, `budget`): it stands in for a wait the agent never registered
310
- * and is replaced by the agent's own (hearsay-tools/cezarion#1234), so the agent is never told of
311
- * it as one of its waits. */
312
- export declare function isSquawkHumanWait(wait: Wait): boolean;
310
+ export { isSquawkHumanWait };
313
311
  /** The lifecycle input a resolved wait delivers. Its id is the wait's, so duplicates keep it.
314
312
  * `workerStatus` names a worker's current status for a worker wait's text. */
315
313
  export declare function waitResultText(wait: Wait, { workerStatus }?: {
@@ -338,4 +336,3 @@ export type RegistrationRoutes<R> = {
338
336
  };
339
337
  /** Request dispatch follows the typed registration cell of its stored-kind row. */
340
338
  export declare function routeRegistration<R>(request: SquawkWaitRequest, routes: RegistrationRoutes<R>): R;
341
- export {};
@@ -2,6 +2,7 @@ import { commandText } from '../../home/command.js';
2
2
  import { runningSubagents } from '../../contract/index.js';
3
3
  import { SUBAGENT_WAIT_DEADLINE_SECONDS, TIMER_MIN_SECONDS, TIMER_MAX_SECONDS } from '../../contract/index.js';
4
4
  import { randomUUID } from 'node:crypto';
5
+ import { isSquawkHumanWait, isUserAnsweredKind, SUBAGENT_SUPERSEDED_RESULT, waitInputId } from '../../runs/wait-helpers.js';
5
6
  /** What a monitoring timer (Claude's `ScheduleWakeup`, or a saved monitoring-line timer) says when it fires. */
6
7
  export const MONITORING_WAKE_NUDGE = 'Re-check the downstream work you were monitoring. Continue toward the task goal. When the goal is complete and verified, call cezar_done. If the watched work is still pending, call cezar_wait again. If you need the user, call cezar_ask.';
7
8
  /** A PR result that leaves the agent nothing to repair (`failedResult`). */
@@ -31,7 +32,7 @@ export const WAIT_KINDS = {
31
32
  footerItem: wait => { const pr = wait; return `${WAIT_KINDS.pr.untilText[pr.until].footer} wait ${pr.id} for ${pr.repository}#${pr.prNumber}, deadline ${pr.deadline}`; },
32
33
  footerKinds: [{ order: 0, text: 'CI' }],
33
34
  resolve: (latest, result, _observed, resolvedAt) => ({ ...latest, phase: 'resolved', resolvedAt, result: result ?? { outcome: 'deadline', headSha: latest.headSha, observedAt: resolvedAt, checks: [], totalChecks: 0, truncated: false } }),
34
- inputId: wait => wait.id,
35
+ inputId: waitInputId,
35
36
  watch: 'ci', entry: prWaitEntry,
36
37
  duplicate: (wait, request) => request.kind === 'pr' && wait.kind === 'pr' && normalizePrUrl(wait.prUrl) === normalizePrUrl(request.pr) && wait.until === (request.until ?? 'checks') && wait.wakeOnConflict === (request.wake_on_conflict ?? true)
37
38
  && (request.head_sha === undefined || request.head_sha.toLowerCase() === wait.headSha.toLowerCase()),
@@ -43,7 +44,7 @@ export const WAIT_KINDS = {
43
44
  hasDeadline: () => true,
44
45
  registration: 'pr', requestKinds: ['pr'],
45
46
  delegation: false,
46
- userAnswers: false, holdsConversationInput: true, runnerResumeCancels: [],
47
+ userAnswers: isUserAnsweredKind('pr'), holdsConversationInput: true, runnerResumeCancels: [],
47
48
  chargesWake: false, refusesSpentBudget: false, holdsSession: false, cancellable: true, timersDisabled: false,
48
49
  failedResult: wait => !PR_SUCCESS.has(wait.result?.outcome ?? 'deadline'),
49
50
  deadline: 'required', keepsSlot: true, cancels: ENDS_WAITS, resolves: [
@@ -69,7 +70,7 @@ export const WAIT_KINDS = {
69
70
  footerItem: wait => { const timer = wait; return `timer ${timer.id} at ${timer.deadline}${timer.note === undefined ? '' : ` (${timer.note})`}`; },
70
71
  footerKinds: [{ order: 6, text: 'timer' }],
71
72
  resolve: (latest, _result, _observed, resolvedAt) => ({ ...latest, phase: 'resolved', resolvedAt }),
72
- inputId: wait => wait.id,
73
+ inputId: waitInputId,
73
74
  watch: 'timer', entry: timerWaitEntry,
74
75
  monitoringEntry: monitoringTimerEntry,
75
76
  duplicate: (wait, request, turnId) => request.kind === 'timer' && wait.kind === 'timer' && wait.seconds === request.seconds && wait.note === request.note && wait.turnId === turnId,
@@ -81,7 +82,7 @@ export const WAIT_KINDS = {
81
82
  hasDeadline: () => true,
82
83
  registration: 'timer', requestKinds: ['timer'],
83
84
  delegation: false,
84
- userAnswers: false, holdsConversationInput: false, runnerResumeCancels: ['open'],
85
+ userAnswers: isUserAnsweredKind('timer'), holdsConversationInput: false, runnerResumeCancels: ['open'],
85
86
  chargesWake: true, refusesSpentBudget: true, holdsSession: false, cancellable: true, timersDisabled: true,
86
87
  failedResult: () => false,
87
88
  deadline: 'required', keepsSlot: true, cancels: [...ENDS_WAITS, 'the wake budget is spent at its deadline'], resolves: [
@@ -98,7 +99,7 @@ export const WAIT_KINDS = {
98
99
  footerItem: wait => { const process = wait; return `process wait ${process.id} on PID ${process.pid}${process.note === undefined ? '' : ` (${process.note})`}, deadline ${process.deadline}`; },
99
100
  footerKinds: [{ order: 4, text: 'process' }],
100
101
  resolve: (latest, result, _observed, resolvedAt) => ({ ...latest, phase: 'resolved', resolvedAt, result: result ?? { outcome: 'deadline', observedAt: resolvedAt } }),
101
- inputId: wait => wait.id,
102
+ inputId: waitInputId,
102
103
  watch: 'process', entry: processWaitEntry,
103
104
  duplicate: (wait, request, _turnId, context) => request.kind === 'process' && wait.kind === 'process' && wait.pid === request.pid && wait.startToken === context.startToken && wait.exitFile === context.exitFile,
104
105
  canonicalize: () => { },
@@ -108,7 +109,7 @@ export const WAIT_KINDS = {
108
109
  hasDeadline: () => true,
109
110
  registration: 'process', requestKinds: ['process'],
110
111
  delegation: false,
111
- userAnswers: false, holdsConversationInput: false, runnerResumeCancels: [],
112
+ userAnswers: isUserAnsweredKind('process'), holdsConversationInput: false, runnerResumeCancels: [],
112
113
  chargesWake: wait => wait.result?.outcome !== 'deadline', refusesSpentBudget: true, holdsSession: false, cancellable: true, timersDisabled: true,
113
114
  failedResult: wait => { const result = wait.result; return result === undefined || result.outcome === 'deadline' || result.outcome === 'error' || (result.exitCode ?? 0) !== 0; },
114
115
  deadline: 'required', keepsSlot: true, cancels: [...ENDS_WAITS, 'the process is not signalled'], resolves: [
@@ -124,9 +125,9 @@ export const WAIT_KINDS = {
124
125
  resultText: wait => subagentWaitResultText(wait),
125
126
  footerItem: wait => { const subagent = wait; return `subagent wait ${subagent.id} on ${subagentPhrase(subagent)}, deadline ${subagent.deadline}`; },
126
127
  footerKinds: [{ order: 5, text: 'subagent' }],
127
- supersededResult: { reason: 'superseded' },
128
+ supersededResult: SUBAGENT_SUPERSEDED_RESULT,
128
129
  resolve: (latest, result, _observed, resolvedAt) => ({ ...latest, phase: 'resolved', resolvedAt, result: result ?? { reason: 'timeout' } }),
129
- inputId: wait => wait.id,
130
+ inputId: waitInputId,
130
131
  watch: 'subagent', entry: subagentWaitEntry,
131
132
  duplicate: () => false,
132
133
  canonicalize: () => { },
@@ -136,7 +137,7 @@ export const WAIT_KINDS = {
136
137
  hasDeadline: () => true,
137
138
  registration: 'none', requestKinds: [],
138
139
  delegation: false,
139
- userAnswers: false, holdsConversationInput: false, runnerResumeCancels: ['open', 'resolved'],
140
+ userAnswers: isUserAnsweredKind('subagent'), holdsConversationInput: false, runnerResumeCancels: ['open', 'resolved'],
140
141
  chargesWake: wait => wait.result?.reason === 'timeout', refusesSpentBudget: false, holdsSession: true, cancellable: true, timersDisabled: false,
141
142
  failedResult: wait => ['timeout', 'interrupted'].includes(wait.result?.reason ?? ''),
142
143
  deadline: 'required', keepsSlot: true, cancels: [...ENDS_WAITS, 'the runner starts a parent turn itself', 'every child already ended at the turn end', 'the deadline with the wake budget spent'], resolves: [
@@ -155,7 +156,7 @@ export const WAIT_KINDS = {
155
156
  footerItem: wait => { const peer = wait; return `peer wait ${peer.id} on ${peerTargetPhrase(peer)}, deadline ${peer.deadline}`; },
156
157
  footerKinds: [{ order: 3, text: 'peer' }],
157
158
  resolve: (latest, result, _observed, resolvedAt) => ({ ...latest, phase: 'resolved', resolvedAt, result: result ?? { reason: 'timeout' } }),
158
- inputId: wait => wait.id,
159
+ inputId: waitInputId,
159
160
  watch: 'peer', entry: peerWaitBuilder,
160
161
  duplicate: () => false,
161
162
  canonicalize: () => { },
@@ -166,7 +167,7 @@ export const WAIT_KINDS = {
166
167
  hasDeadline: () => true,
167
168
  registration: 'peer', requestKinds: ['peer'],
168
169
  delegation: true,
169
- userAnswers: false, holdsConversationInput: false, runnerResumeCancels: [],
170
+ userAnswers: isUserAnsweredKind('peer'), holdsConversationInput: false, runnerResumeCancels: [],
170
171
  chargesWake: wait => wait.result?.reason !== 'timeout', refusesSpentBudget: false, holdsSession: false, cancellable: true, timersDisabled: false,
171
172
  failedResult: wait => wait.result?.reason === 'timeout',
172
173
  deadline: 'required', keepsSlot: false, cancels: [...ENDS_WAITS, 'the wake budget is spent at its resolution'], resolves: [
@@ -186,7 +187,7 @@ export const WAIT_KINDS = {
186
187
  footerItem: wait => { const worker = wait; return `${worker.requestIds ? 'request' : 'worker'} wait ${worker.id} on ${workerTargetPhrase(worker)}, ${worker.deadline === undefined ? 'no deadline' : `deadline ${worker.deadline}`}`; },
187
188
  footerKinds: [{ order: 1, text: 'worker' }, { order: 2, text: 'request' }],
188
189
  resolve: (latest, _result, observed, resolvedAt) => ({ ...observed ?? latest, phase: 'resolved', resolvedAt, result: observed?.result ?? { reason: 'timeout' } }),
189
- inputId: wait => { return wait.wakeInputId ?? wait.id; },
190
+ inputId: waitInputId,
190
191
  watch: 'worker', entry: workerWaitBuilder,
191
192
  completionEntry: completionWaitEntry,
192
193
  duplicate: () => false,
@@ -200,7 +201,7 @@ export const WAIT_KINDS = {
200
201
  registration: 'worker-list', requestKinds: ['worker', 'request'],
201
202
  delegation: true,
202
203
  workerListTarget: request => ({ ...(request.kind === 'worker' ? { workerIds: request.worker_ids } : { requestIds: request.request_ids }), ...(request.mode === undefined ? {} : { mode: request.mode }), timeoutSeconds: request.timeout_seconds }),
203
- userAnswers: false, holdsConversationInput: false, runnerResumeCancels: [],
204
+ userAnswers: isUserAnsweredKind('worker'), holdsConversationInput: false, runnerResumeCancels: [],
204
205
  chargesWake: false, refusesSpentBudget: false, holdsSession: false, cancellable: true, timersDisabled: false,
205
206
  failedResult: wait => {
206
207
  const worker = wait;
@@ -223,7 +224,7 @@ export const WAIT_KINDS = {
223
224
  footerItem: wait => `your question ${wait.id} to the user`,
224
225
  footerKinds: [],
225
226
  resolve: (latest, _result, _observed, resolvedAt) => ({ ...latest, phase: 'resolved', resolvedAt }),
226
- inputId: wait => wait.id,
227
+ inputId: waitInputId,
227
228
  watch: 'none', entry: askWaitEntry,
228
229
  aliasEntry: humanAliasEntry,
229
230
  recoveredEntry: recoveredAskEntry,
@@ -236,7 +237,7 @@ export const WAIT_KINDS = {
236
237
  hasDeadline: () => false,
237
238
  registration: 'none', requestKinds: [],
238
239
  delegation: false,
239
- userAnswers: true, holdsConversationInput: false, runnerResumeCancels: [],
240
+ userAnswers: isUserAnsweredKind('human'), holdsConversationInput: false, runnerResumeCancels: [],
240
241
  chargesWake: false, refusesSpentBudget: false, holdsSession: false, cancellable: 'unshown', timersDisabled: false,
241
242
  // The user's answer is a human message: its own event withdraws a done (acceptedDoneHolds).
242
243
  failedResult: () => false,
@@ -354,12 +355,7 @@ const SUBAGENT_DEADLINE_MINUTES = SUBAGENT_WAIT_DEADLINE_SECONDS / 60;
354
355
  export function isMonitoringTimer(wait) {
355
356
  return WAIT_KINDS.timer.monitoring(wait);
356
357
  }
357
- /** Squawk's own human wait (`no-wait`, `budget`): it stands in for a wait the agent never registered
358
- * and is replaced by the agent's own (hearsay-tools/cezarion#1234), so the agent is never told of
359
- * it as one of its waits. */
360
- export function isSquawkHumanWait(wait) {
361
- return WAIT_KINDS.human.is(wait) && wait.source === 'cezar';
362
- }
358
+ export { isSquawkHumanWait };
363
359
  function clip(text, max = SUMMARY_MAX) {
364
360
  return text.length <= max ? text : `${text.slice(0, max - 1)}…`;
365
361
  }