@hearsay-tools/squawk 0.18.0-pr4138.7995 → 0.18.0-pr4144.8002

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 (88) hide show
  1. package/dist/contract/create-run-input.d.ts +59 -0
  2. package/dist/contract/discovery.d.ts +0 -1
  3. package/dist/contract/github.d.ts +0 -18
  4. package/dist/contract/index.d.ts +3 -0
  5. package/dist/contract/index.js +2305 -2294
  6. package/dist/contract/model-choices.d.ts +40 -0
  7. package/dist/contract/reference-status.d.ts +19 -0
  8. package/dist/contract/runs.d.ts +0 -57
  9. package/dist/contract/workspace.d.ts +0 -40
  10. package/dist/delegation/routes.d.ts +75 -75
  11. package/dist/runs/run-archive.d.ts +72 -72
  12. package/dist/runs/wait-phases.d.ts +9 -1
  13. package/dist/runs/wait-phases.js +17 -2
  14. package/dist/runs/wait-phases.js.map +1 -1
  15. package/dist/server/models-routes.d.ts +13 -13
  16. package/dist/server/server.d.ts +1551 -1551
  17. package/dist/workflows/input-acknowledgement.d.ts +24 -24
  18. package/dist/workflows/run/wait-engine.d.ts +72 -72
  19. package/dist/workflows/run-states.d.ts +1 -8
  20. package/dist/workflows/run-states.js +0 -16
  21. package/dist/workflows/run-states.js.map +1 -1
  22. package/package.json +4 -4
  23. package/web/dist/assets/{accounts-section-BvrCdhB1.js → accounts-section-CJ1xR0FN.js} +1 -1
  24. package/web/dist/assets/activity-motion-C01GEN0y.js +2 -0
  25. package/web/dist/assets/{activity-route-BZPRmiNI.js → activity-route-BZ1NIKSY.js} +1 -1
  26. package/web/dist/assets/{agent-config-section-DEeDIcK_.js → agent-config-section-DvFcRRLD.js} +2 -2
  27. package/web/dist/assets/{agent-defaults-section-RYnao4vB.js → agent-defaults-section-BE88c2RN.js} +1 -1
  28. package/web/dist/assets/{appearance-obeD0TrH.js → appearance-B9Z6lNEm.js} +1 -1
  29. package/web/dist/assets/{archive-on-merge-field-DP12N-QW.js → archive-on-merge-field-DtR7twJI.js} +1 -1
  30. package/web/dist/assets/attention-B6NEiTGm.js +1 -0
  31. package/web/dist/assets/{automations-route-bJYe7JKX.js → automations-route-Dpa01C3j.js} +1 -1
  32. package/web/dist/assets/{commit-diff-panel-yCI8kY--.js → commit-diff-panel-CGjhxIPJ.js} +1 -1
  33. package/web/dist/assets/{diff-B9wl20YA.js → diff-DQ18_bA-.js} +2 -2
  34. package/web/dist/assets/{diff-view-C-HieogW.js → diff-view-CMwe_Rx7.js} +1 -1
  35. package/web/dist/assets/{file-preview-BzialgZg.js → file-preview-_lAUlt5u.js} +1 -1
  36. package/web/dist/assets/{folder-browser-B8_lzQT7.js → folder-browser-Cy26Y6YK.js} +1 -1
  37. package/web/dist/assets/{git-toolbar-lvqVHT9o.js → git-toolbar-BJM3pWHY.js} +1 -1
  38. package/web/dist/assets/{github-CQhVzG31.js → github-aO7y0526.js} +1 -1
  39. package/web/dist/assets/{global-activity-route-Cnk7K6kB.js → global-activity-route-BWOfw2C5.js} +1 -1
  40. package/web/dist/assets/index-D-Y1olb1.js +21 -0
  41. package/web/dist/assets/label-CbEJ99h4.js +1 -0
  42. package/web/dist/assets/{markdown-BLWEExIH.js → markdown-BDWII3gy.js} +1 -1
  43. package/web/dist/assets/{notifications-section-Ci4iCnOt.js → notifications-section-Z_4IW83J.js} +1 -1
  44. package/web/dist/assets/{open-in-menu-JhT-c8K6.js → open-in-menu-21vcjK3t.js} +1 -1
  45. package/web/dist/assets/{preview-pane-connected-COUwLzj1.js → preview-pane-connected-CxwvH4pt.js} +2 -2
  46. package/web/dist/assets/{project-location-BMreyTgv.js → project-location-CvJMe_Vp.js} +1 -1
  47. package/web/dist/assets/{project-router-DG3CwEiO.js → project-router-hhGBPlav.js} +1 -1
  48. package/web/dist/assets/project-scope-context-BiijuuWU.js +4 -0
  49. package/web/dist/assets/{projects-section-I4Umh57f.js → projects-section-CQ34YFnT.js} +1 -1
  50. package/web/dist/assets/{prompt-templates-section-Byinr-jH.js → prompt-templates-section-UIxQCLJq.js} +1 -1
  51. package/web/dist/assets/queries-D6ioEk6c.js +1 -0
  52. package/web/dist/assets/{reference-chip-Bphmq8DU.js → reference-chip-B5br2cfV.js} +1 -1
  53. package/web/dist/assets/{remote-settings-notice-CcYe1mbK.js → remote-settings-notice-BWDpTH5W.js} +1 -1
  54. package/web/dist/assets/{repo-git-tmqJIA3Y.js → repo-git-U12bPaG-.js} +1 -1
  55. package/web/dist/assets/{report-reader-GE7zBDlE.js → report-reader-B5vipU-m.js} +1 -1
  56. package/web/dist/assets/{reports-Dzd6o31r.js → reports-Cdk8Dc-w.js} +1 -1
  57. package/web/dist/assets/{resources-section-D6yjk2_7.js → resources-section-BCLu3v1Z.js} +1 -1
  58. package/web/dist/assets/run-header-gOqc0BKa.js +2 -0
  59. package/web/dist/assets/{runners-GyEIYtzT.js → runners-5cgs0qUY.js} +1 -1
  60. package/web/dist/assets/{settings-agent-picker-gDWJBt2q.js → settings-agent-picker-CB7l8AW-.js} +1 -1
  61. package/web/dist/assets/{settings-shell-1kV0mCGg.js → settings-shell-BUHHoCDs.js} +1 -1
  62. package/web/dist/assets/{sidebar-section-bytwajV6.js → sidebar-section-8dTKLdQw.js} +1 -1
  63. package/web/dist/assets/{skills-oC915Joa.js → skills-thuBrq2s.js} +1 -1
  64. package/web/dist/assets/{tab-link-BrrGCBYJ.js → tab-link-DaFUyEhe.js} +1 -1
  65. package/web/dist/assets/{task-changes-CgEF750z.js → task-changes-DSpeg6sX.js} +1 -1
  66. package/web/dist/assets/{task-commits-CmewNVBz.js → task-commits-DRDRswBh.js} +1 -1
  67. package/web/dist/assets/{task-files-x0fUUNIG.js → task-files-Cevz9Mex.js} +1 -1
  68. package/web/dist/assets/{task-github-item-DuwLqcE4.js → task-github-item-DpLkKSKy.js} +1 -1
  69. package/web/dist/assets/{task-groups-Ccol3P2t.js → task-groups-CafTiSSz.js} +1 -1
  70. package/web/dist/assets/{task-thread-DkgKDQSG.js → task-thread-BvM4rEQe.js} +6 -6
  71. package/web/dist/assets/{tasks-table-CbfBNxAB.js → tasks-table-DYjfmofR.js} +1 -1
  72. package/web/dist/assets/{thread-state-Nzl4pHXB.js → thread-state-A3TSuI5v.js} +1 -1
  73. package/web/dist/assets/{use-hand-to-agent-state-BMWlCZBX.js → use-hand-to-agent-state-IepoiFbj.js} +1 -1
  74. package/web/dist/assets/{useInfiniteQuery-C8q14xTE.js → useInfiniteQuery-B20OnjTe.js} +1 -1
  75. package/web/dist/assets/useQuery-BTg3x78A.js +1 -0
  76. package/web/dist/assets/{workflows-BV5oZdB_.js → workflows-B0TaHAzz.js} +2 -2
  77. package/web/dist/assets/{workspace-tools-NWKvRhWg.js → workspace-tools-B8sP_p5c.js} +1 -1
  78. package/web/dist/assets/{worktrees-section--MUxuXUq.js → worktrees-section-BDfwadB6.js} +4 -4
  79. package/web/dist/assets/{ws-BYbBRDfC.js → ws-ExzR2_Yn.js} +1 -1
  80. package/web/dist/index.html +15 -15
  81. package/web/dist/assets/activity-motion-CyQUo8rH.js +0 -2
  82. package/web/dist/assets/attention-CSFsCoi5.js +0 -1
  83. package/web/dist/assets/index-D0DvUgTj.js +0 -21
  84. package/web/dist/assets/label-CYqEyapm.js +0 -1
  85. package/web/dist/assets/project-scope-context-BairiAvs.js +0 -4
  86. package/web/dist/assets/queries-bg9YtgmX.js +0 -1
  87. package/web/dist/assets/run-header-Cc5Flvc9.js +0 -2
  88. package/web/dist/assets/useQuery-Berjv5Ts.js +0 -1
@@ -0,0 +1,40 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * A runner whose model list is discovered from the host: every registered runner has a model
4
+ * catalog (its definition's `loadModelCatalog`). The route's query validator and the picker use it.
5
+ */
6
+ export declare const modelDiscoveryRunnerSchema: z.ZodString;
7
+ export type ModelDiscoveryRunner = z.infer<typeof modelDiscoveryRunnerSchema>;
8
+ export declare const runnerModelOptionSchema: z.ZodObject<{
9
+ id: z.ZodString;
10
+ label: z.ZodString;
11
+ description: z.ZodString;
12
+ effortLevels: z.ZodOptional<z.ZodArray<z.ZodEnum<{
13
+ high: "high";
14
+ low: "low";
15
+ max: "max";
16
+ medium: "medium";
17
+ xhigh: "xhigh";
18
+ }>>>;
19
+ }, z.core.$strip>;
20
+ export type RunnerModelOption = z.infer<typeof runnerModelOptionSchema>;
21
+ /** The models a spawn could pin instead of an unknown one, in a delegation error. It lives in its
22
+ * own leaf module so `delegation.ts` does not load `workspace.ts` (hearsay-tools/squawk#3935). */
23
+ export declare const modelChoicesSchema: z.ZodObject<{
24
+ runner: z.ZodString;
25
+ requestedModel: z.ZodString;
26
+ availableModels: z.ZodArray<z.ZodObject<{
27
+ id: z.ZodString;
28
+ label: z.ZodString;
29
+ description: z.ZodString;
30
+ effortLevels: z.ZodOptional<z.ZodArray<z.ZodEnum<{
31
+ high: "high";
32
+ low: "low";
33
+ max: "max";
34
+ medium: "medium";
35
+ xhigh: "xhigh";
36
+ }>>>;
37
+ }, z.core.$strip>>;
38
+ otherRunners: z.ZodArray<z.ZodString>;
39
+ }, z.core.$strip>;
40
+ export type ModelChoices = z.infer<typeof modelChoicesSchema>;
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Shared reference-status vocabulary for PRs and issues. Closed PR and completed issue remain
4
+ * distinct outcomes. Server ranking describes the next action; merge conflict is independent.
5
+ */
6
+ export declare const referenceStatusSchema: z.ZodEnum<{
7
+ "changes-requested": "changes-requested";
8
+ "checks-failing": "checks-failing";
9
+ "checks-pending": "checks-pending";
10
+ closed: "closed";
11
+ completed: "completed";
12
+ draft: "draft";
13
+ merged: "merged";
14
+ "not-planned": "not-planned";
15
+ open: "open";
16
+ ready: "ready";
17
+ "review-required": "review-required";
18
+ }>;
19
+ export type ReferenceStatus = z.infer<typeof referenceStatusSchema>;
@@ -7008,63 +7008,6 @@ export declare const attachmentFileParamSchema: z.ZodObject<{
7008
7008
  file: z.ZodString;
7009
7009
  }, z.core.$strip>;
7010
7010
  export type AttachmentFileParam = z.infer<typeof attachmentFileParamSchema>;
7011
- export declare const attachmentInputSchema: z.ZodObject<{
7012
- mediaType: z.ZodString;
7013
- data: z.ZodString;
7014
- }, z.core.$strip>;
7015
- export type AttachmentInput = z.input<typeof attachmentInputSchema>;
7016
- /** @deprecated Attachments are no longer images only — use `attachmentInputSchema`. Kept because
7017
- * the `images` key it validates is the wire contract and did not change name. */
7018
- export declare const imageInputSchema: z.ZodObject<{
7019
- mediaType: z.ZodString;
7020
- data: z.ZodString;
7021
- }, z.core.$strip>;
7022
- export type ImageInput = AttachmentInput;
7023
- /**
7024
- * The KEYS of `POST /runs`' body, before the XOR refinement that `createRunInputSchema` adds.
7025
- *
7026
- * Split out for one reason: `./automations.ts` builds an automation's task on top of this shape
7027
- * (a task IS a run-creation body minus the three keys an automation supplies itself), and zod
7028
- * refuses `.omit()` on a schema that carries refinements. Validate with `createRunInputSchema`
7029
- * below — this half accepts a body naming both `workflow` and `steps`, which the server does not.
7030
- */
7031
- export declare const createRunInputBaseSchema: z.ZodObject<{
7032
- archiveWhenDone: z.ZodOptional<z.ZodBoolean>;
7033
- autoMergePr: z.ZodOptional<z.ZodBoolean>;
7034
- allowWorkers: z.ZodOptional<z.ZodBoolean>;
7035
- allowMessaging: z.ZodOptional<z.ZodBoolean>;
7036
- workflow: z.ZodOptional<z.ZodString>;
7037
- steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
7038
- id: z.ZodString;
7039
- name: z.ZodOptional<z.ZodString>;
7040
- prompt: z.ZodOptional<z.ZodString>;
7041
- skill: z.ZodOptional<z.ZodString>;
7042
- model: z.ZodOptional<z.ZodString>;
7043
- effort: z.ZodOptional<z.ZodString>;
7044
- timeoutMs: z.ZodOptional<z.ZodNumber>;
7045
- runner: z.ZodOptional<z.ZodString>;
7046
- agentProfile: z.ZodOptional<z.ZodString>;
7047
- allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
7048
- bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
7049
- command: z.ZodOptional<z.ZodString>;
7050
- onFail: z.ZodOptional<z.ZodObject<{
7051
- retry: z.ZodString;
7052
- max: z.ZodDefault<z.ZodNumber>;
7053
- }, z.core.$strip>>;
7054
- }, z.core.$strip>>>;
7055
- task: z.ZodString;
7056
- model: z.ZodOptional<z.ZodString>;
7057
- effort: z.ZodOptional<z.ZodString>;
7058
- runner: z.ZodOptional<z.ZodString>;
7059
- agentProfile: z.ZodOptional<z.ZodString>;
7060
- worktree: z.ZodOptional<z.ZodBoolean>;
7061
- autonomous: z.ZodOptional<z.ZodBoolean>;
7062
- systemPrompt: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string | undefined, string | undefined>>;
7063
- images: z.ZodOptional<z.ZodArray<z.ZodObject<{
7064
- mediaType: z.ZodString;
7065
- data: z.ZodString;
7066
- }, z.core.$strip>>>;
7067
- }, z.core.$strip>;
7068
7011
  /**
7069
7012
  * `POST /runs`. Exactly one of `workflow` / `steps` — the server rejects both or neither.
7070
7013
  *
@@ -446,25 +446,6 @@ export declare const providerSignInSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
446
446
  error: z.ZodString;
447
447
  }, z.core.$strip>], "state">;
448
448
  export type ProviderSignIn = z.infer<typeof providerSignInSchema>;
449
- /**
450
- * A runner whose model list is discovered from the host: every registered runner has a model
451
- * catalog (its definition's `loadModelCatalog`). The route's query validator and the picker use it.
452
- */
453
- export declare const modelDiscoveryRunnerSchema: z.ZodString;
454
- export type ModelDiscoveryRunner = z.infer<typeof modelDiscoveryRunnerSchema>;
455
- export declare const runnerModelOptionSchema: z.ZodObject<{
456
- id: z.ZodString;
457
- label: z.ZodString;
458
- description: z.ZodString;
459
- effortLevels: z.ZodOptional<z.ZodArray<z.ZodEnum<{
460
- high: "high";
461
- low: "low";
462
- max: "max";
463
- medium: "medium";
464
- xhigh: "xhigh";
465
- }>>>;
466
- }, z.core.$strip>;
467
- export type RunnerModelOption = z.infer<typeof runnerModelOptionSchema>;
468
449
  /** `GET /api/v1/models?runner=codex|opencode|pi` — the models discovered from that runner's own
469
450
  * host installation, plus how fresh the answer is. Never an error: an unavailable CLI degrades
470
451
  * to `source: 'unavailable'` with a `reason`. Claude has no host-local catalog and is rejected. */
@@ -491,27 +472,6 @@ export declare const runnerModelCatalogResponseSchema: z.ZodObject<{
491
472
  reason: z.ZodOptional<z.ZodString>;
492
473
  }, z.core.$strip>;
493
474
  export type RunnerModelCatalogResponse = z.infer<typeof runnerModelCatalogResponseSchema>;
494
- /** The models a spawn could pin instead of an unknown one, in a delegation error. It lives here,
495
- * beside its parts, so `delegation.ts` does not load `discovery.ts` (hearsay-tools/cezarion#3241);
496
- * `discovery.ts` re-exports it. */
497
- export declare const modelChoicesSchema: z.ZodObject<{
498
- runner: z.ZodString;
499
- requestedModel: z.ZodString;
500
- availableModels: z.ZodArray<z.ZodObject<{
501
- id: z.ZodString;
502
- label: z.ZodString;
503
- description: z.ZodString;
504
- effortLevels: z.ZodOptional<z.ZodArray<z.ZodEnum<{
505
- high: "high";
506
- low: "low";
507
- max: "max";
508
- medium: "medium";
509
- xhigh: "xhigh";
510
- }>>>;
511
- }, z.core.$strip>>;
512
- otherRunners: z.ZodArray<z.ZodString>;
513
- }, z.core.$strip>;
514
- export type ModelChoices = z.infer<typeof modelChoicesSchema>;
515
475
  /** A local app a worktree can be opened in (#open-in): editor, file manager, or terminal. */
516
476
  export declare const openTargetSchema: z.ZodObject<{
517
477
  id: z.ZodString;
@@ -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;
@@ -73,24 +85,22 @@ export declare function createDelegationRoutes(service: DelegationService, crede
73
85
  offset?: string | undefined;
74
86
  };
75
87
  };
76
- } | {
77
- output: {
78
- error: string;
79
- code?: "invalid_input" | undefined;
80
- };
81
- outputFormat: "json";
82
- status: 400;
83
- input: {
84
- query: {
85
- offset?: string | undefined;
86
- };
87
- };
88
88
  };
89
89
  };
90
90
  } & {
91
91
  "/discover": {
92
92
  $post: {
93
93
  output: {
94
+ scope: "host-default-account";
95
+ runners: {
96
+ requiresAccountHome?: boolean | undefined;
97
+ status: "connected" | "disconnected" | "not-installed" | "unknown";
98
+ enabled?: boolean | undefined;
99
+ hint?: string | undefined;
100
+ authFailureId?: string | undefined;
101
+ runner: string;
102
+ }[];
103
+ } | {
94
104
  runner: string;
95
105
  models: {
96
106
  id: string;
@@ -101,16 +111,6 @@ export declare function createDelegationRoutes(service: DelegationService, crede
101
111
  source: "cache" | "live" | "unavailable";
102
112
  stale: boolean;
103
113
  reason?: string | undefined;
104
- } | {
105
- scope: "host-default-account";
106
- runners: {
107
- requiresAccountHome?: boolean | undefined;
108
- status: "connected" | "disconnected" | "not-installed" | "unknown";
109
- enabled?: boolean | undefined;
110
- hint?: string | undefined;
111
- authFailureId?: string | undefined;
112
- runner: string;
113
- }[];
114
114
  } | {
115
115
  tasks: {
116
116
  id: string;
@@ -629,6 +629,18 @@ export declare function createDelegationRoutes(service: DelegationService, crede
629
629
  } & {
630
630
  "/:workerId": {
631
631
  $get: {
632
+ output: {
633
+ error: string;
634
+ code?: "invalid_input" | undefined;
635
+ };
636
+ outputFormat: "json";
637
+ status: 400;
638
+ input: {
639
+ param: {
640
+ workerId: string;
641
+ };
642
+ };
643
+ } | {
632
644
  output: {
633
645
  workerId: string;
634
646
  settled: boolean;
@@ -746,7 +758,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
746
758
  workerId: string;
747
759
  };
748
760
  };
749
- } | {
761
+ };
762
+ };
763
+ } & {
764
+ "/:workerId/collect": {
765
+ $post: {
750
766
  output: {
751
767
  error: string;
752
768
  code?: "invalid_input" | undefined;
@@ -757,12 +773,10 @@ export declare function createDelegationRoutes(service: DelegationService, crede
757
773
  param: {
758
774
  workerId: string;
759
775
  };
776
+ } & {
777
+ json: Record<string, never>;
760
778
  };
761
- };
762
- };
763
- } & {
764
- "/:workerId/collect": {
765
- $post: {
779
+ } | {
766
780
  output: {
767
781
  workerId: string;
768
782
  parentRunId: string;
@@ -885,7 +899,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
885
899
  } & {
886
900
  json: Record<string, never>;
887
901
  };
888
- } | {
902
+ };
903
+ };
904
+ } & {
905
+ "/:workerId/steer": {
906
+ $post: {
889
907
  output: {
890
908
  error: string;
891
909
  code?: "invalid_input" | undefined;
@@ -897,13 +915,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
897
915
  workerId: string;
898
916
  };
899
917
  } & {
900
- json: Record<string, never>;
918
+ json: {
919
+ text: string;
920
+ };
901
921
  };
902
- };
903
- };
904
- } & {
905
- "/:workerId/steer": {
906
- $post: {
922
+ } | {
907
923
  output: {
908
924
  workerId: string;
909
925
  state: "delivered" | "queued";
@@ -919,7 +935,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
919
935
  text: string;
920
936
  };
921
937
  };
922
- } | {
938
+ };
939
+ };
940
+ } & {
941
+ "/:workerId/stop": {
942
+ $post: {
923
943
  output: {
924
944
  error: string;
925
945
  code?: "invalid_input" | undefined;
@@ -931,15 +951,9 @@ export declare function createDelegationRoutes(service: DelegationService, crede
931
951
  workerId: string;
932
952
  };
933
953
  } & {
934
- json: {
935
- text: string;
936
- };
954
+ json: Record<string, never>;
937
955
  };
938
- };
939
- };
940
- } & {
941
- "/:workerId/stop": {
942
- $post: {
956
+ } | {
943
957
  output: {
944
958
  workerId: string;
945
959
  state: "stopping" | "terminated";
@@ -953,7 +967,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
953
967
  } & {
954
968
  json: Record<string, never>;
955
969
  };
956
- } | {
970
+ };
971
+ };
972
+ } & {
973
+ "/:workerId/destroy": {
974
+ $post: {
957
975
  output: {
958
976
  error: string;
959
977
  code?: "invalid_input" | undefined;
@@ -965,13 +983,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
965
983
  workerId: string;
966
984
  };
967
985
  } & {
968
- json: Record<string, never>;
986
+ json: {
987
+ discardWork?: true | undefined;
988
+ };
969
989
  };
970
- };
971
- };
972
- } & {
973
- "/:workerId/destroy": {
974
- $post: {
990
+ } | {
975
991
  output: {
976
992
  workerId: string;
977
993
  state: "complete" | "incomplete";
@@ -1000,22 +1016,6 @@ export declare function createDelegationRoutes(service: DelegationService, crede
1000
1016
  discardWork?: true | undefined;
1001
1017
  };
1002
1018
  };
1003
- } | {
1004
- output: {
1005
- error: string;
1006
- code?: "invalid_input" | undefined;
1007
- };
1008
- outputFormat: "json";
1009
- status: 400;
1010
- input: {
1011
- param: {
1012
- workerId: string;
1013
- };
1014
- } & {
1015
- json: {
1016
- discardWork?: true | undefined;
1017
- };
1018
- };
1019
1019
  } | {
1020
1020
  output: {
1021
1021
  workerId: string;
@@ -1051,13 +1051,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
1051
1051
  "/:workerId/diff": {
1052
1052
  $get: {
1053
1053
  output: {
1054
- workerId: string;
1055
- baselineSha: string;
1056
- diff: string;
1057
- truncated: boolean;
1054
+ error: string;
1055
+ code?: "invalid_input" | undefined;
1058
1056
  };
1059
1057
  outputFormat: "json";
1060
- status: 200;
1058
+ status: 400;
1061
1059
  input: {
1062
1060
  param: {
1063
1061
  workerId: string;
@@ -1065,11 +1063,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
1065
1063
  };
1066
1064
  } | {
1067
1065
  output: {
1068
- error: string;
1069
- code?: "invalid_input" | undefined;
1066
+ workerId: string;
1067
+ baselineSha: string;
1068
+ diff: string;
1069
+ truncated: boolean;
1070
1070
  };
1071
1071
  outputFormat: "json";
1072
- status: 400;
1072
+ status: 200;
1073
1073
  input: {
1074
1074
  param: {
1075
1075
  workerId: string;
@@ -228,6 +228,30 @@ export declare class RunArchiveTopic implements RunArchive, RunCompletionActions
228
228
  deadline: string;
229
229
  seconds: number;
230
230
  note?: string | undefined;
231
+ } | {
232
+ id: string;
233
+ source: "agent" | "cezar";
234
+ 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";
235
+ registeredAt: string;
236
+ phase: "cancelled" | "delivered" | "open" | "resolved";
237
+ resolvedAt?: string | undefined;
238
+ deliveredAt?: string | undefined;
239
+ cancelledAt?: string | undefined;
240
+ turnId: string;
241
+ kind: "process";
242
+ deadline: string;
243
+ timeoutSeconds: number;
244
+ pid: number;
245
+ startToken?: string | undefined;
246
+ exitFile?: string | undefined;
247
+ note?: string | undefined;
248
+ result?: {
249
+ outcome: "deadline" | "error" | "exit_file" | "exited";
250
+ observedAt: string;
251
+ exitCode?: number | undefined;
252
+ exitFileNote?: "not-an-exit-code" | undefined;
253
+ diagnostic?: string | undefined;
254
+ } | undefined;
231
255
  } | {
232
256
  id: string;
233
257
  source: "agent" | "cezar";
@@ -289,30 +313,6 @@ export declare class RunArchiveTopic implements RunArchive, RunCompletionActions
289
313
  reason: "outcome" | "timeout";
290
314
  } | undefined;
291
315
  wakeInputId?: string | undefined;
292
- } | {
293
- id: string;
294
- source: "agent" | "cezar";
295
- 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";
296
- registeredAt: string;
297
- phase: "cancelled" | "delivered" | "open" | "resolved";
298
- resolvedAt?: string | undefined;
299
- deliveredAt?: string | undefined;
300
- cancelledAt?: string | undefined;
301
- turnId: string;
302
- kind: "process";
303
- deadline: string;
304
- timeoutSeconds: number;
305
- pid: number;
306
- startToken?: string | undefined;
307
- exitFile?: string | undefined;
308
- note?: string | undefined;
309
- result?: {
310
- outcome: "deadline" | "error" | "exit_file" | "exited";
311
- observedAt: string;
312
- exitCode?: number | undefined;
313
- exitFileNote?: "not-an-exit-code" | undefined;
314
- diagnostic?: string | undefined;
315
- } | undefined;
316
316
  } | {
317
317
  id: string;
318
318
  source: "agent" | "cezar";
@@ -424,6 +424,30 @@ export declare class RunArchiveTopic implements RunArchive, RunCompletionActions
424
424
  deadline: string;
425
425
  seconds: number;
426
426
  note?: string | undefined;
427
+ } | {
428
+ id: string;
429
+ source: "agent" | "cezar";
430
+ 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";
431
+ registeredAt: string;
432
+ phase: "cancelled" | "delivered" | "open" | "resolved";
433
+ resolvedAt?: string | undefined;
434
+ deliveredAt?: string | undefined;
435
+ cancelledAt?: string | undefined;
436
+ turnId: string;
437
+ kind: "process";
438
+ deadline: string;
439
+ timeoutSeconds: number;
440
+ pid: number;
441
+ startToken?: string | undefined;
442
+ exitFile?: string | undefined;
443
+ note?: string | undefined;
444
+ result?: {
445
+ outcome: "deadline" | "error" | "exit_file" | "exited";
446
+ observedAt: string;
447
+ exitCode?: number | undefined;
448
+ exitFileNote?: "not-an-exit-code" | undefined;
449
+ diagnostic?: string | undefined;
450
+ } | undefined;
427
451
  } | {
428
452
  id: string;
429
453
  source: "agent" | "cezar";
@@ -485,30 +509,6 @@ export declare class RunArchiveTopic implements RunArchive, RunCompletionActions
485
509
  reason: "outcome" | "timeout";
486
510
  } | undefined;
487
511
  wakeInputId?: string | undefined;
488
- } | {
489
- id: string;
490
- source: "agent" | "cezar";
491
- 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";
492
- registeredAt: string;
493
- phase: "cancelled" | "delivered" | "open" | "resolved";
494
- resolvedAt?: string | undefined;
495
- deliveredAt?: string | undefined;
496
- cancelledAt?: string | undefined;
497
- turnId: string;
498
- kind: "process";
499
- deadline: string;
500
- timeoutSeconds: number;
501
- pid: number;
502
- startToken?: string | undefined;
503
- exitFile?: string | undefined;
504
- note?: string | undefined;
505
- result?: {
506
- outcome: "deadline" | "error" | "exit_file" | "exited";
507
- observedAt: string;
508
- exitCode?: number | undefined;
509
- exitFileNote?: "not-an-exit-code" | undefined;
510
- diagnostic?: string | undefined;
511
- } | undefined;
512
512
  } | {
513
513
  id: string;
514
514
  source: "agent" | "cezar";
@@ -619,6 +619,30 @@ export declare class RunArchiveTopic implements RunArchive, RunCompletionActions
619
619
  deadline: string;
620
620
  seconds: number;
621
621
  note?: string | undefined;
622
+ } | {
623
+ id: string;
624
+ source: "agent" | "cezar";
625
+ 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";
626
+ registeredAt: string;
627
+ phase: "cancelled" | "delivered" | "open" | "resolved";
628
+ resolvedAt?: string | undefined;
629
+ deliveredAt?: string | undefined;
630
+ cancelledAt?: string | undefined;
631
+ turnId: string;
632
+ kind: "process";
633
+ deadline: string;
634
+ timeoutSeconds: number;
635
+ pid: number;
636
+ startToken?: string | undefined;
637
+ exitFile?: string | undefined;
638
+ note?: string | undefined;
639
+ result?: {
640
+ outcome: "deadline" | "error" | "exit_file" | "exited";
641
+ observedAt: string;
642
+ exitCode?: number | undefined;
643
+ exitFileNote?: "not-an-exit-code" | undefined;
644
+ diagnostic?: string | undefined;
645
+ } | undefined;
622
646
  } | {
623
647
  id: string;
624
648
  source: "agent" | "cezar";
@@ -680,30 +704,6 @@ export declare class RunArchiveTopic implements RunArchive, RunCompletionActions
680
704
  reason: "outcome" | "timeout";
681
705
  } | undefined;
682
706
  wakeInputId?: string | undefined;
683
- } | {
684
- id: string;
685
- source: "agent" | "cezar";
686
- 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";
687
- registeredAt: string;
688
- phase: "cancelled" | "delivered" | "open" | "resolved";
689
- resolvedAt?: string | undefined;
690
- deliveredAt?: string | undefined;
691
- cancelledAt?: string | undefined;
692
- turnId: string;
693
- kind: "process";
694
- deadline: string;
695
- timeoutSeconds: number;
696
- pid: number;
697
- startToken?: string | undefined;
698
- exitFile?: string | undefined;
699
- note?: string | undefined;
700
- result?: {
701
- outcome: "deadline" | "error" | "exit_file" | "exited";
702
- observedAt: string;
703
- exitCode?: number | undefined;
704
- exitFileNote?: "not-an-exit-code" | undefined;
705
- diagnostic?: string | undefined;
706
- } | undefined;
707
707
  } | {
708
708
  id: string;
709
709
  source: "agent" | "cezar";
@@ -1,4 +1,12 @@
1
- import type { Wait } from '../contract/index.js';
1
+ import type { Wait, WaitPhase } from '../contract/index.js';
2
+ import type { FiredBy } from '../workflows/run-states.ts';
2
3
  import type { RunRecord } from './store.ts';
4
+ /** The phases a wait entry moves through. Their writes go through RunStore.commitOutcome (hearsay-tools/cezarion#1805). */
5
+ export declare const WAIT_PHASES: {
6
+ readonly [P in WaitPhase]: readonly {
7
+ to: WaitPhase;
8
+ firedBy: readonly FiredBy[];
9
+ }[];
10
+ };
3
11
  /** Check the entry a store write puts in place; an undeclared write still lands. */
4
12
  export declare function checkWaitWrite(run: Pick<RunRecord, 'waits' | 'lastWaits'>, entry: Wait): void;
@@ -1,11 +1,26 @@
1
- import { WAIT_PHASES } from '../workflows/run-states.js';
2
1
  import { reportStoreViolation } from './run-exits.js';
2
+ /** The phases a wait entry moves through. Their writes go through RunStore.commitOutcome (hearsay-tools/cezarion#1805). */
3
+ export const WAIT_PHASES = {
4
+ open: [
5
+ { to: 'open', firedBy: ['agent', 'human', 'engine', 'runner', 'worker'] },
6
+ { to: 'delivered', firedBy: ['human'] },
7
+ { to: 'resolved', firedBy: ['watcher', 'timer', 'worker', 'peer', 'human', 'parent', 'runner', 'recovery'] },
8
+ { to: 'cancelled', firedBy: ['agent', 'human', 'engine', 'runner'] },
9
+ ],
10
+ resolved: [
11
+ { to: 'resolved', firedBy: ['recovery'] },
12
+ { to: 'delivered', firedBy: ['runner'] },
13
+ { to: 'cancelled', firedBy: ['human', 'engine'] },
14
+ ],
15
+ delivered: [],
16
+ cancelled: [],
17
+ };
3
18
  /** Check the entry a store write puts in place; an undeclared write still lands. */
4
19
  export function checkWaitWrite(run, entry) {
5
20
  const prior = run.waits?.find(wait => wait.id === entry.id);
6
21
  const from = prior?.phase ?? (run.lastWaits?.some(wait => wait.id === entry.id) ? 'settled' : 'new');
7
22
  if (prior ? WAIT_PHASES[prior.phase].some(row => row.to === entry.phase) : from === 'new' && entry.phase === 'open')
8
23
  return;
9
- reportStoreViolation(`undeclared wait transition: ${entry.kind} wait ${entry.id} from ${from} to ${entry.phase} (declare it in workflows/run-states.ts WAIT_PHASES)`);
24
+ reportStoreViolation(`undeclared wait transition: ${entry.kind} wait ${entry.id} from ${from} to ${entry.phase} (declare it in runs/wait-phases.ts WAIT_PHASES)`);
10
25
  }
11
26
  //# sourceMappingURL=wait-phases.js.map