@hearsay-tools/squawk 0.19.0-dev.8724 → 0.19.0-dev.8731

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 (92) hide show
  1. package/dist/contract/index.js +32 -2
  2. package/dist/contract/repo-requests.d.ts +9 -1
  3. package/dist/contract/repo.d.ts +39 -2
  4. package/dist/delegation/routes.d.ts +65 -65
  5. package/dist/delegation/transport.d.ts +65 -65
  6. package/dist/git-worktree.d.ts +9 -0
  7. package/dist/git-worktree.js +118 -3
  8. package/dist/git-worktree.js.map +1 -1
  9. package/dist/runs/retention.d.ts +6 -0
  10. package/dist/runs/retention.js +7 -3
  11. package/dist/runs/retention.js.map +1 -1
  12. package/dist/server/automations-routes.d.ts +150 -150
  13. package/dist/server/project-settings-routes.d.ts +107 -107
  14. package/dist/server/projects-routes.d.ts +45 -45
  15. package/dist/server/repo-routes.d.ts +27 -1
  16. package/dist/server/repo-routes.js +30 -15
  17. package/dist/server/repo-routes.js.map +1 -1
  18. package/dist/server/run-checkout.d.ts +1 -1
  19. package/dist/server/run-checkout.js +20 -7
  20. package/dist/server/run-checkout.js.map +1 -1
  21. package/dist/server/runners-routes.d.ts +10 -10
  22. package/dist/server/runs-routes.d.ts +16 -16
  23. package/dist/server/server.d.ts +54 -2
  24. package/dist/server/worktree-size-cache.d.ts +11 -0
  25. package/dist/server/worktree-size-cache.js +3 -1
  26. package/dist/server/worktree-size-cache.js.map +1 -1
  27. package/package.json +4 -4
  28. package/web/dist/assets/{accounts-section-DDKrIQHV.js → accounts-section-DVJon113.js} +1 -1
  29. package/web/dist/assets/{activity-motion-BTEsjlIe.js → activity-motion-D_Mig_D4.js} +1 -1
  30. package/web/dist/assets/{activity-route-nAfZdSHs.js → activity-route-BvYIEdOs.js} +1 -1
  31. package/web/dist/assets/{agent-config-section-SeeFuvxb.js → agent-config-section-BImy20b0.js} +1 -1
  32. package/web/dist/assets/{agent-defaults-section-BfBT817S.js → agent-defaults-section-D30dOTKu.js} +1 -1
  33. package/web/dist/assets/{appearance-BTm4Q_SI.js → appearance-CHsrT2VO.js} +1 -1
  34. package/web/dist/assets/{archive-on-merge-field-D7-FuLiL.js → archive-on-merge-field-BT4e_k9f.js} +1 -1
  35. package/web/dist/assets/attention-CGsbqL2t.js +1 -0
  36. package/web/dist/assets/{automations-route-CBTOewMF.js → automations-route-BEhmjeVF.js} +1 -1
  37. package/web/dist/assets/{commit-list-DkFgC3zM.js → commit-list-02HM16KN.js} +1 -1
  38. package/web/dist/assets/{diff-is16ZW0n.js → diff-BmDcJsHL.js} +2 -2
  39. package/web/dist/assets/{diff-controls-Bg2hEd-d.js → diff-controls-HmgYRhy7.js} +1 -1
  40. package/web/dist/assets/{diff-view-Cr8XQJSx.js → diff-view-CRx2ZNOd.js} +1 -1
  41. package/web/dist/assets/{file-preview-Bnls5OJY.js → file-preview-B361k1Oo.js} +1 -1
  42. package/web/dist/assets/{folder-browser-6stmlyVQ.js → folder-browser-BJ3aXo9k.js} +1 -1
  43. package/web/dist/assets/{git-toolbar-CNKKRUHu.js → git-toolbar-DsNQUL5f.js} +1 -1
  44. package/web/dist/assets/{github-BqFTLhmt.js → github-DP2REdU5.js} +1 -1
  45. package/web/dist/assets/{global-activity-route-CWe04LvJ.js → global-activity-route-Iv0uN7Wy.js} +1 -1
  46. package/web/dist/assets/index-CVz-Ls8s.css +1 -0
  47. package/web/dist/assets/{index-CZ2f_VDZ.js → index-mCjln54E.js} +5 -5
  48. package/web/dist/assets/{label-BKUl84DF.js → label-CH-a6Jyv.js} +1 -1
  49. package/web/dist/assets/{markdown-BlP4Ruj9.js → markdown-DiMerfHU.js} +1 -1
  50. package/web/dist/assets/{notifications-section-D74r_7fK.js → notifications-section-DGH8tp1N.js} +1 -1
  51. package/web/dist/assets/{open-in-menu-N8rXgYSG.js → open-in-menu-CML2QKil.js} +1 -1
  52. package/web/dist/assets/{preview-pane-connected-Bmczg9HP.js → preview-pane-connected-Cl_6DHNm.js} +1 -1
  53. package/web/dist/assets/{project-location-CcmuGA5W.js → project-location-CZNz3wYW.js} +1 -1
  54. package/web/dist/assets/{project-router-CT6gVIcC.js → project-router-BvBqllk2.js} +1 -1
  55. package/web/dist/assets/{projects-section-nCxUoesH.js → projects-section-D3h_nr6-.js} +1 -1
  56. package/web/dist/assets/{prompt-templates-section-BrLXH68w.js → prompt-templates-section-DelsVm7I.js} +1 -1
  57. package/web/dist/assets/{queries-ClkIgWFx.js → queries-CYWRnyM5.js} +1 -1
  58. package/web/dist/assets/{reference-chip-D_AkXXCW.js → reference-chip-BdikRjql.js} +1 -1
  59. package/web/dist/assets/{remote-settings-notice-DgXTd6s8.js → remote-settings-notice-D2x0qeKt.js} +1 -1
  60. package/web/dist/assets/repo-git-DKkOxBOJ.js +1 -0
  61. package/web/dist/assets/{report-reader-CGmbDHza.js → report-reader-D2b9baRm.js} +1 -1
  62. package/web/dist/assets/{report-selection-D9xJZoKb.js → report-selection-D2RvkiGX.js} +1 -1
  63. package/web/dist/assets/{reports-CTFaCJWS.js → reports-CBP54u9k.js} +1 -1
  64. package/web/dist/assets/{resources-section-BhRQQrVy.js → resources-section-D86nQvrk.js} +1 -1
  65. package/web/dist/assets/{review-panel-DJN1QoGx.js → review-panel-BcuyfiuF.js} +1 -1
  66. package/web/dist/assets/{run-detail-refresh-Bo51TspT.js → run-detail-refresh-BNI7eMgG.js} +1 -1
  67. package/web/dist/assets/{run-header-CRtXOTxt.js → run-header-B2AfxeyZ.js} +1 -1
  68. package/web/dist/assets/{select-BfLaIiyd.js → select-KMLdkF0Y.js} +1 -1
  69. package/web/dist/assets/{session-context-section-CaPupOFU.js → session-context-section-Do5bNw8y.js} +1 -1
  70. package/web/dist/assets/{settings-agent-picker-CzE4qiW7.js → settings-agent-picker-Dtqb26Hz.js} +1 -1
  71. package/web/dist/assets/{settings-shell-CpEw1Yep.js → settings-shell-CWPwhUDh.js} +1 -1
  72. package/web/dist/assets/{sidebar-section-Ct0x6SOQ.js → sidebar-section-pLjtUKHT.js} +1 -1
  73. package/web/dist/assets/{skills-D2HTiFIT.js → skills-CaXsJiUU.js} +1 -1
  74. package/web/dist/assets/{tab-link-BMblA2WK.js → tab-link-B0pNjKxZ.js} +1 -1
  75. package/web/dist/assets/{task-changes-4SjmpLQN.js → task-changes-oogngDub.js} +1 -1
  76. package/web/dist/assets/{task-commits-C6CoCyG9.js → task-commits-_Aa8bkJq.js} +1 -1
  77. package/web/dist/assets/{task-file-scope-BkUJ30q2.js → task-file-scope-DY0ozMDn.js} +1 -1
  78. package/web/dist/assets/{task-files-CCX3HTxx.js → task-files-DxFFK3zI.js} +1 -1
  79. package/web/dist/assets/{task-github-item-DWLVVmvv.js → task-github-item-LSzJuoiu.js} +1 -1
  80. package/web/dist/assets/{task-groups-aquji1Kv.js → task-groups-lh9gz7TP.js} +1 -1
  81. package/web/dist/assets/{task-thread-EBqjZ5Vz.js → task-thread-BlThx_dR.js} +1 -1
  82. package/web/dist/assets/{tasks-table-BkjZYg2J.js → tasks-table-k18AuMR5.js} +1 -1
  83. package/web/dist/assets/{thread-state-DU6OEOIL.js → thread-state-DA2aAkKF.js} +1 -1
  84. package/web/dist/assets/{toaster-C-xqAWVX.js → toaster-B0kvcFif.js} +1 -1
  85. package/web/dist/assets/{use-hand-to-agent-state-DUkm37P-.js → use-hand-to-agent-state-dgiJEULj.js} +1 -1
  86. package/web/dist/assets/{workflows-CGHzfqLC.js → workflows-DNs9e08u.js} +1 -1
  87. package/web/dist/assets/{workspace-tools-9mkf36oR.js → workspace-tools-DHek4GFd.js} +1 -1
  88. package/web/dist/assets/{worktrees-section-B91kPX6V.js → worktrees-section-fLfqff8U.js} +1 -1
  89. package/web/dist/index.html +14 -14
  90. package/web/dist/assets/attention--Y0CyzCN.js +0 -1
  91. package/web/dist/assets/index-DefVZIaB.css +0 -1
  92. package/web/dist/assets/repo-git-kl6QizKC.js +0 -1
@@ -113,42 +113,10 @@ export declare function createUiStateRoutes(): import("hono/hono-base").HonoBase
113
113
  "/ui-state": {
114
114
  $put: {
115
115
  output: {
116
- [x: string]: import("hono/utils/types").JSONValue;
117
- sidebarLimits?: {
118
- overall?: number | null | undefined;
119
- needsYou?: number | null | undefined;
120
- finished?: number | null | undefined;
121
- working?: number | null | undefined;
122
- } | undefined;
123
- lastTask?: {
124
- source: "skill" | "workflow";
125
- ref: string;
126
- } | null | undefined;
127
- recentSources?: {
128
- source: "skill" | "workflow";
129
- ref: string;
130
- }[] | undefined;
131
- lastWorktree?: boolean | undefined;
132
- lastAutonomous?: boolean | undefined;
133
- skillUsage?: {
134
- [x: string]: number;
135
- } | undefined;
136
- runsView?: "list" | "table" | undefined;
137
- githubView?: "issues" | "prs" | undefined;
138
- appearance?: {
139
- accent?: "cezarion" | "lime" | "violet" | undefined;
140
- density?: "comfortable" | "compact" | "ultra" | undefined;
141
- width?: "narrow" | "wide" | undefined;
142
- } | undefined;
143
- promptTemplates?: {
144
- id: string;
145
- label: string;
146
- text: string;
147
- skills?: string[] | undefined;
148
- }[] | undefined;
116
+ error: string;
149
117
  };
150
118
  outputFormat: "json";
151
- status: import("hono/utils/http-status").ContentfulStatusCode;
119
+ status: 500;
152
120
  input: {
153
121
  json: {
154
122
  [x: string]: unknown;
@@ -186,10 +154,42 @@ export declare function createUiStateRoutes(): import("hono/hono-base").HonoBase
186
154
  };
187
155
  } | {
188
156
  output: {
189
- error: string;
157
+ [x: string]: import("hono/utils/types").JSONValue;
158
+ sidebarLimits?: {
159
+ overall?: number | null | undefined;
160
+ needsYou?: number | null | undefined;
161
+ finished?: number | null | undefined;
162
+ working?: number | null | undefined;
163
+ } | undefined;
164
+ lastTask?: {
165
+ source: "skill" | "workflow";
166
+ ref: string;
167
+ } | null | undefined;
168
+ recentSources?: {
169
+ source: "skill" | "workflow";
170
+ ref: string;
171
+ }[] | undefined;
172
+ lastWorktree?: boolean | undefined;
173
+ lastAutonomous?: boolean | undefined;
174
+ skillUsage?: {
175
+ [x: string]: number;
176
+ } | undefined;
177
+ runsView?: "list" | "table" | undefined;
178
+ githubView?: "issues" | "prs" | undefined;
179
+ appearance?: {
180
+ accent?: "cezarion" | "lime" | "violet" | undefined;
181
+ density?: "comfortable" | "compact" | "ultra" | undefined;
182
+ width?: "narrow" | "wide" | undefined;
183
+ } | undefined;
184
+ promptTemplates?: {
185
+ id: string;
186
+ label: string;
187
+ text: string;
188
+ skills?: string[] | undefined;
189
+ }[] | undefined;
190
190
  };
191
191
  outputFormat: "json";
192
- status: 500;
192
+ status: import("hono/utils/http-status").ContentfulStatusCode;
193
193
  input: {
194
194
  json: {
195
195
  [x: string]: unknown;
@@ -275,10 +275,11 @@ export declare function createWorkflowsRoutes(): import("hono/hono-base").HonoBa
275
275
  "/workflows": {
276
276
  $post: {
277
277
  output: {
278
- error: string;
278
+ path: string;
279
+ name: string;
279
280
  };
280
281
  outputFormat: "json";
281
- status: 400;
282
+ status: 201;
282
283
  input: {
283
284
  json: {
284
285
  name: string;
@@ -311,10 +312,9 @@ export declare function createWorkflowsRoutes(): import("hono/hono-base").HonoBa
311
312
  } | {
312
313
  output: {
313
314
  error: string;
314
- exists: true;
315
315
  };
316
316
  outputFormat: "json";
317
- status: 409;
317
+ status: 400;
318
318
  input: {
319
319
  json: {
320
320
  name: string;
@@ -347,9 +347,10 @@ export declare function createWorkflowsRoutes(): import("hono/hono-base").HonoBa
347
347
  } | {
348
348
  output: {
349
349
  error: string;
350
+ exists: true;
350
351
  };
351
352
  outputFormat: "json";
352
- status: 500;
353
+ status: 409;
353
354
  input: {
354
355
  json: {
355
356
  name: string;
@@ -381,11 +382,10 @@ export declare function createWorkflowsRoutes(): import("hono/hono-base").HonoBa
381
382
  };
382
383
  } | {
383
384
  output: {
384
- path: string;
385
- name: string;
385
+ error: string;
386
386
  };
387
387
  outputFormat: "json";
388
- status: 201;
388
+ status: 500;
389
389
  input: {
390
390
  json: {
391
391
  name: string;
@@ -421,10 +421,11 @@ export declare function createWorkflowsRoutes(): import("hono/hono-base").HonoBa
421
421
  "/workflows/:name": {
422
422
  $delete: {
423
423
  output: {
424
- error: string;
424
+ ok: true;
425
+ path: string;
425
426
  };
426
427
  outputFormat: "json";
427
- status: 400 | 404 | 409 | 500;
428
+ status: import("hono/utils/http-status").ContentfulStatusCode;
428
429
  input: {
429
430
  param: {
430
431
  name: string;
@@ -432,11 +433,10 @@ export declare function createWorkflowsRoutes(): import("hono/hono-base").HonoBa
432
433
  };
433
434
  } | {
434
435
  output: {
435
- ok: true;
436
- path: string;
436
+ error: string;
437
437
  };
438
438
  outputFormat: "json";
439
- status: import("hono/utils/http-status").ContentfulStatusCode;
439
+ status: 400 | 404 | 409 | 500;
440
440
  input: {
441
441
  param: {
442
442
  name: string;
@@ -504,18 +504,6 @@ export interface PlanRouteDeps {
504
504
  export declare function createPlanRoutes(deps: PlanRouteDeps): import("hono/hono-base").HonoBase<ProjectApiEnv, {
505
505
  "/plan": {
506
506
  $post: {
507
- output: {
508
- error: string;
509
- };
510
- outputFormat: "json";
511
- status: 400 | 404 | 409;
512
- input: {
513
- json: {
514
- task: string;
515
- agentProfile?: string | undefined;
516
- };
517
- };
518
- } | {
519
507
  output: {
520
508
  name?: string;
521
509
  steps: {
@@ -552,6 +540,18 @@ export declare function createPlanRoutes(deps: PlanRouteDeps): import("hono/hono
552
540
  agentProfile?: string | undefined;
553
541
  };
554
542
  };
543
+ } | {
544
+ output: {
545
+ error: string;
546
+ };
547
+ outputFormat: "json";
548
+ status: 400 | 404 | 409;
549
+ input: {
550
+ json: {
551
+ task: string;
552
+ agentProfile?: string | undefined;
553
+ };
554
+ };
555
555
  };
556
556
  };
557
557
  }, "/", "/plan">;
@@ -599,34 +599,10 @@ export declare function createConfigRoutes(deps: ConfigRouteDeps): import("hono/
599
599
  "/config": {
600
600
  $put: {
601
601
  output: {
602
- archiveOnMerge: boolean | null;
603
- effectiveArchiveOnMerge: boolean;
604
- archiveOnMergeSource: "default" | "environment" | "global" | "project";
605
- baseBranch: string | null;
606
- defaultRunner: string;
607
- systemPrompt: string | null;
608
- defaultModels: {
609
- [x: string]: string | undefined;
610
- };
611
- modelsLocked: boolean;
612
- maxParallel: number;
613
- memoryLimitMb: number | null;
614
- worktreeRetention: number;
615
- liveTitleUpdates: boolean | null;
616
- reviewGate: boolean | null;
617
- worktreeSetup: {
618
- commands: string[];
619
- timeoutSeconds: number;
620
- } | null;
621
- worktreeSetupIssue: string | null;
622
- worktreeTeardown: {
623
- commands: string[];
624
- timeoutSeconds: number;
625
- } | null;
626
- worktreeTeardownIssue: string | null;
602
+ error: string;
627
603
  };
628
604
  outputFormat: "json";
629
- status: import("hono/utils/http-status").ContentfulStatusCode;
605
+ status: 409;
630
606
  input: {
631
607
  json: {
632
608
  archiveOnMerge?: boolean | null | undefined;
@@ -654,7 +630,7 @@ export declare function createConfigRoutes(deps: ConfigRouteDeps): import("hono/
654
630
  error: string;
655
631
  };
656
632
  outputFormat: "json";
657
- status: 409;
633
+ status: 500;
658
634
  input: {
659
635
  json: {
660
636
  archiveOnMerge?: boolean | null | undefined;
@@ -679,10 +655,34 @@ export declare function createConfigRoutes(deps: ConfigRouteDeps): import("hono/
679
655
  };
680
656
  } | {
681
657
  output: {
682
- error: string;
658
+ archiveOnMerge: boolean | null;
659
+ effectiveArchiveOnMerge: boolean;
660
+ archiveOnMergeSource: "default" | "environment" | "global" | "project";
661
+ baseBranch: string | null;
662
+ defaultRunner: string;
663
+ systemPrompt: string | null;
664
+ defaultModels: {
665
+ [x: string]: string | undefined;
666
+ };
667
+ modelsLocked: boolean;
668
+ maxParallel: number;
669
+ memoryLimitMb: number | null;
670
+ worktreeRetention: number;
671
+ liveTitleUpdates: boolean | null;
672
+ reviewGate: boolean | null;
673
+ worktreeSetup: {
674
+ commands: string[];
675
+ timeoutSeconds: number;
676
+ } | null;
677
+ worktreeSetupIssue: string | null;
678
+ worktreeTeardown: {
679
+ commands: string[];
680
+ timeoutSeconds: number;
681
+ } | null;
682
+ worktreeTeardownIssue: string | null;
683
683
  };
684
684
  outputFormat: "json";
685
- status: 500;
685
+ status: import("hono/utils/http-status").ContentfulStatusCode;
686
686
  input: {
687
687
  json: {
688
688
  archiveOnMerge?: boolean | null | undefined;
@@ -796,14 +796,10 @@ export declare function createAgentConfigRoutes(capabilities: ServerCapabilities
796
796
  "/agent-config/:id": {
797
797
  $put: {
798
798
  output: {
799
- id: string;
800
- path: string;
801
- exists: boolean;
802
- content: string;
803
- version: string | null;
799
+ error: string;
804
800
  };
805
801
  outputFormat: "json";
806
- status: import("hono/utils/http-status").ContentfulStatusCode;
802
+ status: 404;
807
803
  input: {
808
804
  json: {
809
805
  content: string;
@@ -816,10 +812,14 @@ export declare function createAgentConfigRoutes(capabilities: ServerCapabilities
816
812
  };
817
813
  } | {
818
814
  output: {
819
- error: string;
815
+ id: string;
816
+ path: string;
817
+ exists: boolean;
818
+ content: string;
819
+ version: string | null;
820
820
  };
821
821
  outputFormat: "json";
822
- status: 404;
822
+ status: import("hono/utils/http-status").ContentfulStatusCode;
823
823
  input: {
824
824
  json: {
825
825
  content: string;
@@ -941,9 +941,12 @@ export declare function createAgentWebhooksRoutes(deps: AgentWebhooksRouteDeps):
941
941
  export declare function createSseRoutes(): import("hono/hono-base").HonoBase<ProjectApiEnv, {
942
942
  "/runs/:id/events": {
943
943
  $get: {
944
- output: {};
945
- outputFormat: string;
946
- status: import("hono/utils/http-status").StatusCode;
944
+ output: {
945
+ error: string;
946
+ code?: "invalid_input" | undefined;
947
+ };
948
+ outputFormat: "json";
949
+ status: 400;
947
950
  input: {
948
951
  param: {
949
952
  id: string;
@@ -955,12 +958,9 @@ export declare function createSseRoutes(): import("hono/hono-base").HonoBase<Pro
955
958
  };
956
959
  };
957
960
  } | {
958
- output: {
959
- error: string;
960
- code?: "invalid_input" | undefined;
961
- };
962
- outputFormat: "json";
963
- status: 400;
961
+ output: {};
962
+ outputFormat: string;
963
+ status: import("hono/utils/http-status").StatusCode;
964
964
  input: {
965
965
  param: {
966
966
  id: string;
@@ -63,6 +63,17 @@ export declare function createProjectsRoutes(deps: ProjectsRouteDeps): import("h
63
63
  } & {
64
64
  "/projects": {
65
65
  $post: {
66
+ output: {
67
+ error: string;
68
+ };
69
+ outputFormat: "json";
70
+ status: 400 | 500;
71
+ input: {
72
+ json: {
73
+ root: string;
74
+ };
75
+ };
76
+ } | {
66
77
  output: {
67
78
  project: {
68
79
  id: string;
@@ -93,10 +104,10 @@ export declare function createProjectsRoutes(deps: ProjectsRouteDeps): import("h
93
104
  agent: boolean;
94
105
  }[] | undefined;
95
106
  };
96
- error?: string | undefined;
107
+ error: string;
97
108
  };
98
109
  outputFormat: "json";
99
- status: 200;
110
+ status: 409;
100
111
  input: {
101
112
  json: {
102
113
  root: string;
@@ -133,21 +144,10 @@ export declare function createProjectsRoutes(deps: ProjectsRouteDeps): import("h
133
144
  agent: boolean;
134
145
  }[] | undefined;
135
146
  };
136
- error: string;
137
- };
138
- outputFormat: "json";
139
- status: 409;
140
- input: {
141
- json: {
142
- root: string;
143
- };
144
- };
145
- } | {
146
- output: {
147
- error: string;
147
+ error?: string | undefined;
148
148
  };
149
149
  outputFormat: "json";
150
- status: 400 | 500;
150
+ status: 200;
151
151
  input: {
152
152
  json: {
153
153
  root: string;
@@ -306,7 +306,7 @@ export declare function createProjectsRoutes(deps: ProjectsRouteDeps): import("h
306
306
  error: string;
307
307
  };
308
308
  outputFormat: "json";
309
- status: 400;
309
+ status: 404;
310
310
  input: {
311
311
  param: {
312
312
  projectId: string;
@@ -317,7 +317,7 @@ export declare function createProjectsRoutes(deps: ProjectsRouteDeps): import("h
317
317
  error: string;
318
318
  };
319
319
  outputFormat: "json";
320
- status: 404;
320
+ status: 400;
321
321
  input: {
322
322
  param: {
323
323
  projectId: string;
@@ -342,6 +342,27 @@ export declare function createProjectsRoutes(deps: ProjectsRouteDeps): import("h
342
342
  } & {
343
343
  "/projects/:projectId/webhooks": {
344
344
  $post: {
345
+ output: {
346
+ error: string;
347
+ };
348
+ outputFormat: "json";
349
+ status: 400 | 404 | 409 | 500;
350
+ input: {
351
+ json: {
352
+ name: string;
353
+ description?: string | undefined;
354
+ url: string;
355
+ token?: string | undefined;
356
+ tasks?: boolean | undefined;
357
+ triggers?: ("cancelled" | "done" | "failed" | "needs-you" | "running" | "waiting-ci" | "waiting-other" | "waiting-timer" | "waiting-workers")[] | undefined;
358
+ agent?: boolean | undefined;
359
+ };
360
+ } & {
361
+ param: {
362
+ projectId: string;
363
+ };
364
+ };
365
+ } | {
345
366
  output: {
346
367
  project: {
347
368
  id: string;
@@ -400,27 +421,6 @@ export declare function createProjectsRoutes(deps: ProjectsRouteDeps): import("h
400
421
  projectId: string;
401
422
  };
402
423
  };
403
- } | {
404
- output: {
405
- error: string;
406
- };
407
- outputFormat: "json";
408
- status: 400 | 404 | 409 | 500;
409
- input: {
410
- json: {
411
- name: string;
412
- description?: string | undefined;
413
- url: string;
414
- token?: string | undefined;
415
- tasks?: boolean | undefined;
416
- triggers?: ("cancelled" | "done" | "failed" | "needs-you" | "running" | "waiting-ci" | "waiting-other" | "waiting-timer" | "waiting-workers")[] | undefined;
417
- agent?: boolean | undefined;
418
- };
419
- } & {
420
- param: {
421
- projectId: string;
422
- };
423
- };
424
424
  };
425
425
  };
426
426
  } & {
@@ -618,10 +618,13 @@ export declare function createProjectsRoutes(deps: ProjectsRouteDeps): import("h
618
618
  };
619
619
  } | {
620
620
  output: {
621
- error: string;
621
+ ok: boolean;
622
+ status?: number | undefined;
623
+ error?: string | undefined;
624
+ dryRun?: boolean | undefined;
622
625
  };
623
626
  outputFormat: "json";
624
- status: 404;
627
+ status: import("hono/utils/http-status").ContentfulStatusCode;
625
628
  input: {
626
629
  param: {
627
630
  projectId: string;
@@ -630,13 +633,10 @@ export declare function createProjectsRoutes(deps: ProjectsRouteDeps): import("h
630
633
  };
631
634
  } | {
632
635
  output: {
633
- ok: boolean;
634
- status?: number | undefined;
635
- error?: string | undefined;
636
- dryRun?: boolean | undefined;
636
+ error: string;
637
637
  };
638
638
  outputFormat: "json";
639
- status: import("hono/utils/http-status").ContentfulStatusCode;
639
+ status: 404;
640
640
  input: {
641
641
  param: {
642
642
  projectId: string;
@@ -80,6 +80,17 @@ export declare function createWorktreesRoutes(deps: WorktreesRouteDeps): import(
80
80
  finishedAt: string | null;
81
81
  reclaimable: boolean;
82
82
  pastKeep: boolean;
83
+ reclaimBlocker: {
84
+ kind: "dirty";
85
+ uncommittedFiles: number;
86
+ detachedHead: boolean;
87
+ } | {
88
+ kind: "detached-head";
89
+ } | {
90
+ kind: "submodules";
91
+ } | {
92
+ kind: "invalid";
93
+ } | null;
83
94
  }[];
84
95
  totalBytes: number | null;
85
96
  keep: number;
@@ -99,7 +110,10 @@ export declare function createWorktreesRoutes(deps: WorktreesRouteDeps): import(
99
110
  status: import("hono/utils/http-status").ContentfulStatusCode;
100
111
  input: {
101
112
  json: {
102
- [x: string]: unknown;
113
+ discardWork: true;
114
+ runIds: string[];
115
+ } | {
116
+ discardWork?: false | undefined;
103
117
  };
104
118
  };
105
119
  };
@@ -117,6 +131,10 @@ export declare function createWorktreesRoutes(deps: WorktreesRouteDeps): import(
117
131
  param: {
118
132
  runId: string;
119
133
  };
134
+ } & {
135
+ json: {
136
+ discardWork?: boolean | undefined;
137
+ };
120
138
  };
121
139
  } | {
122
140
  output: {
@@ -128,6 +146,10 @@ export declare function createWorktreesRoutes(deps: WorktreesRouteDeps): import(
128
146
  param: {
129
147
  runId: string;
130
148
  };
149
+ } & {
150
+ json: {
151
+ discardWork?: boolean | undefined;
152
+ };
131
153
  };
132
154
  } | {
133
155
  output: {
@@ -140,6 +162,10 @@ export declare function createWorktreesRoutes(deps: WorktreesRouteDeps): import(
140
162
  param: {
141
163
  runId: string;
142
164
  };
165
+ } & {
166
+ json: {
167
+ discardWork?: boolean | undefined;
168
+ };
143
169
  };
144
170
  };
145
171
  };
@@ -2,7 +2,7 @@ import { existsSync } from 'node:fs';
2
2
  import { Hono } from 'hono';
3
3
  import { commitQuerySchema } from '../contract/index.js';
4
4
  import { deleteBranchesInputSchema, repoPullInputSchema } from '../contract/index.js';
5
- import { reclaimBodySchema, reclaimRunParamsSchema, repoBranchSchema } from '../contract/index.js';
5
+ import { reclaimBodySchema, reclaimRunParamsSchema, reclaimWorktreeBodySchema, repoBranchSchema } from '../contract/index.js';
6
6
  import { openProjectInSchema } from '../contract/index.js';
7
7
  import { loadConfig, resolveWorktreeRetention } from '../config.js';
8
8
  import { isReclaimable, reclaimWorktree, reclaimWorktrees, selectReclaimableWorktrees } from '../runs/retention.js';
@@ -17,7 +17,7 @@ import { claimRepoGitMutation, localPullBranches, pullRepoCheckout } from './rep
17
17
  import { forgetRepoRead, readRepoRefs } from './repo-read-cache.js';
18
18
  import { reclaimCheckoutError, runCheckout } from './run-checkout.js';
19
19
  import { jsonZodValidator, paramZodValidator, queryZodValidator } from './validators.js';
20
- import { cachedWorktreeSizeBytes } from './worktree-size-cache.js';
20
+ import { cachedWorktreeSizeBytes, queuedWorktreeReclaimBlocker } from './worktree-size-cache.js';
21
21
  export function createOpenTargetsRoutes(deps) {
22
22
  const { capabilities, openApp } = deps;
23
23
  return new Hono()
@@ -50,16 +50,25 @@ export function createWorktreesRoutes(deps) {
50
50
  const getRun = memoizeRead((id) => store.getRun(id));
51
51
  const workersOf = memoizeRead((id) => store.queries.listWorkersOf(id));
52
52
  const pastKeep = new Set(selectReclaimableWorktrees(withWorktree, keep, getRun, workersOf));
53
- const worktrees = await Promise.all(runs.map(async (r) => ({
54
- runId: r.id,
55
- title: r.title ?? r.id,
56
- status: r.status,
57
- branch: r.branch ?? null,
58
- sizeBytes: await cachedWorktreeSizeBytes(r.worktreePath),
59
- finishedAt: r.finishedAt ?? null,
60
- reclaimable: isReclaimable(r, getRun, workersOf),
61
- pastKeep: pastKeep.has(r.id),
62
- })));
53
+ const worktrees = await Promise.all(runs.map(async (r) => {
54
+ const reclaimable = isReclaimable(r, getRun, workersOf);
55
+ const worktreePath = r.worktreePath;
56
+ const [sizeBytes, reclaimBlocker] = await Promise.all([
57
+ cachedWorktreeSizeBytes(worktreePath),
58
+ reclaimable ? queuedWorktreeReclaimBlocker(repoRoot, worktreePath) : Promise.resolve(null),
59
+ ]);
60
+ return {
61
+ runId: r.id,
62
+ title: r.title ?? r.id,
63
+ status: r.status,
64
+ branch: r.branch ?? null,
65
+ sizeBytes,
66
+ finishedAt: r.finishedAt ?? null,
67
+ reclaimable,
68
+ pastKeep: pastKeep.has(r.id),
69
+ reclaimBlocker,
70
+ };
71
+ }));
63
72
  const totalBytes = worktrees.some((w) => w.sizeBytes === null)
64
73
  ? null
65
74
  : worktrees.reduce((sum, w) => sum + (w.sizeBytes ?? 0), 0);
@@ -67,9 +76,11 @@ export function createWorktreesRoutes(deps) {
67
76
  })
68
77
  .post('/worktrees/reclaim', jsonZodValidator(() => reclaimBodySchema, { absent: ({}), message: 'invalid body' }), async (c) => {
69
78
  const { root: repoRoot, store, manager } = c.get('project');
79
+ const body = c.req.valid('json');
70
80
  const reclaimed = await reclaimWorktrees(repoRoot, store, await resolveWorktreeRetention(repoRoot, deps.home), {
71
81
  claim: (run) => manager.claimWorktreeReclaim(run.id),
72
82
  previewHost: deps.previewHost,
83
+ ...(body.discardWork ? { discardWork: true, runIds: body.runIds } : {}),
73
84
  });
74
85
  if (reclaimed.length > 0) {
75
86
  forgetRepoBranches(repoRoot);
@@ -77,8 +88,9 @@ export function createWorktreesRoutes(deps) {
77
88
  }
78
89
  return c.json({ reclaimed });
79
90
  })
80
- .post('/worktrees/:runId/reclaim', paramZodValidator(reclaimRunParamsSchema), async (c) => {
91
+ .post('/worktrees/:runId/reclaim', paramZodValidator(reclaimRunParamsSchema), jsonZodValidator(() => reclaimWorktreeBodySchema, { absent: ({}), message: 'invalid body' }), async (c) => {
81
92
  const { root: repoRoot, store } = c.get('project');
93
+ const { discardWork } = c.req.valid('json');
82
94
  const checkout = runCheckout(c.get('project'), c.req.valid('param').runId, 'remove', {
83
95
  claim: 'reclaim',
84
96
  checksActive: false,
@@ -88,9 +100,12 @@ export function createWorktreesRoutes(deps) {
88
100
  if ('status' in checkout)
89
101
  return c.json(checkout.body, checkout.status);
90
102
  const { run, release } = checkout;
91
- const worktreeReclaimedAt = await reclaimWorktree(repoRoot, store, run, { previewHost: deps.previewHost }).finally(release);
103
+ const worktreeReclaimedAt = await reclaimWorktree(repoRoot, store, run, {
104
+ previewHost: deps.previewHost,
105
+ discardWork,
106
+ }).finally(release);
92
107
  if (!worktreeReclaimedAt) {
93
- return c.json({ error: await reclaimCheckoutError(run) }, 409);
108
+ return c.json({ error: await reclaimCheckoutError(repoRoot, run) }, 409);
94
109
  }
95
110
  forgetRepoBranches(repoRoot);
96
111
  forgetRepoRead(repoRoot);