@hearsay-tools/squawk 0.18.0-dev.7779 → 0.18.0-dev.7788

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 (46) hide show
  1. package/dist/artifacts/removal-slot.d.ts +3 -0
  2. package/dist/artifacts/removal-slot.js +7 -0
  3. package/dist/artifacts/removal-slot.js.map +1 -0
  4. package/dist/autosave-removal-slots.d.ts +6 -0
  5. package/dist/autosave-removal-slots.js +13 -0
  6. package/dist/autosave-removal-slots.js.map +1 -0
  7. package/dist/built-in-run-slots.d.ts +9 -0
  8. package/dist/built-in-run-slots.js +21 -0
  9. package/dist/built-in-run-slots.js.map +1 -0
  10. package/dist/ci-wait/controller.d.ts +42 -42
  11. package/dist/delegation/family-end.js +5 -1
  12. package/dist/delegation/family-end.js.map +1 -1
  13. package/dist/delegation/removal-slot.d.ts +4 -0
  14. package/dist/delegation/removal-slot.js +20 -0
  15. package/dist/delegation/removal-slot.js.map +1 -0
  16. package/dist/delegation/routes.d.ts +79 -79
  17. package/dist/delegation/transport.d.ts +76 -76
  18. package/dist/index.js +4 -0
  19. package/dist/index.js.map +1 -1
  20. package/dist/jobs/removal-slot.d.ts +4 -0
  21. package/dist/jobs/removal-slot.js +10 -0
  22. package/dist/jobs/removal-slot.js.map +1 -0
  23. package/dist/runs/removal-slots.d.ts +56 -0
  24. package/dist/runs/removal-slots.js +66 -0
  25. package/dist/runs/removal-slots.js.map +1 -0
  26. package/dist/runs/retention.d.ts +10 -7
  27. package/dist/runs/retention.js +8 -19
  28. package/dist/runs/retention.js.map +1 -1
  29. package/dist/runs/store.d.ts +4 -2
  30. package/dist/runs/store.js +18 -20
  31. package/dist/runs/store.js.map +1 -1
  32. package/dist/server/live-routes.d.ts +6 -6
  33. package/dist/server/models-routes.d.ts +13 -13
  34. package/dist/server/provider-sign-in-routes.d.ts +2 -2
  35. package/dist/server/reports-api.d.ts +2 -2
  36. package/dist/server/runner-install-routes.d.ts +10 -10
  37. package/dist/server/server.d.ts +1595 -1595
  38. package/dist/server/workspace-live-routes.d.ts +6 -6
  39. package/package.json +4 -4
  40. package/scripts/benchmark-family-reconcile.ts +2 -0
  41. package/scripts/benchmark-run-store.ts +2 -0
  42. package/scripts/benchmark-stuck-destroys.ts +2 -0
  43. package/scripts/benchmark-worker-lifecycle.ts +2 -0
  44. package/scripts/benchmark-workspace-events.ts +2 -0
  45. package/scripts/benchmark-worktree-retention.ts +2 -0
  46. package/scripts/measure-transcript-facts-health.mjs +4 -1
@@ -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;
@@ -232,13 +232,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
232
232
  status: 200;
233
233
  input: {
234
234
  json: {
235
- requestIds: string[];
236
- mode?: "all" | "any" | "one" | undefined;
237
- timeoutSeconds?: number | undefined;
238
- } | {
239
235
  workerIds: string[];
240
236
  timeoutSeconds?: number | undefined;
241
237
  mode?: "all" | "any" | "one" | undefined;
238
+ } | {
239
+ requestIds: string[];
240
+ mode?: "all" | "any" | "one" | undefined;
241
+ timeoutSeconds?: number | undefined;
242
242
  } | {
243
243
  peerIds: string[];
244
244
  timeoutSeconds?: number | undefined;
@@ -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;
@@ -2,6 +2,18 @@ import type { DelegationRoutes } from './routes.ts';
2
2
  export declare function createDelegationApp(routes: DelegationRoutes): import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, import("hono/types").BlankSchema | import("hono/types").MergeSchemaPath<{
3
3
  "/list": {
4
4
  $get: {
5
+ output: {
6
+ error: string;
7
+ code?: "invalid_input" | undefined;
8
+ };
9
+ outputFormat: "json";
10
+ status: 400;
11
+ input: {
12
+ query: {
13
+ offset?: string | undefined;
14
+ };
15
+ };
16
+ } | {
5
17
  output: {
6
18
  workers: {
7
19
  workerId: string;
@@ -48,24 +60,23 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
48
60
  offset?: string | undefined;
49
61
  };
50
62
  };
51
- } | {
52
- output: {
53
- error: string;
54
- code?: "invalid_input" | undefined;
55
- };
56
- outputFormat: "json";
57
- status: 400;
58
- input: {
59
- query: {
60
- offset?: string | undefined;
61
- };
62
- };
63
63
  };
64
64
  };
65
65
  } & {
66
66
  "/discover": {
67
67
  $post: {
68
68
  output: {
69
+ runner: string;
70
+ models: {
71
+ id: string;
72
+ label: string;
73
+ description: string;
74
+ effortLevels?: ("high" | "low" | "max" | "medium" | "xhigh")[] | undefined;
75
+ }[];
76
+ source: "cache" | "live" | "unavailable";
77
+ stale: boolean;
78
+ reason?: string | undefined;
79
+ } | {
69
80
  scope: "host-default-account";
70
81
  runners: {
71
82
  requiresAccountHome?: boolean | undefined;
@@ -87,17 +98,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
87
98
  reason?: string | undefined;
88
99
  }[];
89
100
  nextOffset?: number | undefined;
90
- } | {
91
- runner: string;
92
- models: {
93
- id: string;
94
- label: string;
95
- description: string;
96
- effortLevels?: ("high" | "low" | "max" | "medium" | "xhigh")[] | undefined;
97
- }[];
98
- source: "cache" | "live" | "unavailable";
99
- stale: boolean;
100
- reason?: string | undefined;
101
101
  };
102
102
  outputFormat: "json";
103
103
  status: 200;
@@ -604,6 +604,18 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
604
604
  } & {
605
605
  "/:workerId": {
606
606
  $get: {
607
+ output: {
608
+ error: string;
609
+ code?: "invalid_input" | undefined;
610
+ };
611
+ outputFormat: "json";
612
+ status: 400;
613
+ input: {
614
+ param: {
615
+ workerId: string;
616
+ };
617
+ };
618
+ } | {
607
619
  output: {
608
620
  workerId: string;
609
621
  settled: boolean;
@@ -721,7 +733,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
721
733
  workerId: string;
722
734
  };
723
735
  };
724
- } | {
736
+ };
737
+ };
738
+ } & {
739
+ "/:workerId/collect": {
740
+ $post: {
725
741
  output: {
726
742
  error: string;
727
743
  code?: "invalid_input" | undefined;
@@ -732,12 +748,10 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
732
748
  param: {
733
749
  workerId: string;
734
750
  };
751
+ } & {
752
+ json: Record<string, never>;
735
753
  };
736
- };
737
- };
738
- } & {
739
- "/:workerId/collect": {
740
- $post: {
754
+ } | {
741
755
  output: {
742
756
  workerId: string;
743
757
  parentRunId: string;
@@ -860,7 +874,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
860
874
  } & {
861
875
  json: Record<string, never>;
862
876
  };
863
- } | {
877
+ };
878
+ };
879
+ } & {
880
+ "/:workerId/steer": {
881
+ $post: {
864
882
  output: {
865
883
  error: string;
866
884
  code?: "invalid_input" | undefined;
@@ -872,13 +890,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
872
890
  workerId: string;
873
891
  };
874
892
  } & {
875
- json: Record<string, never>;
893
+ json: {
894
+ text: string;
895
+ };
876
896
  };
877
- };
878
- };
879
- } & {
880
- "/:workerId/steer": {
881
- $post: {
897
+ } | {
882
898
  output: {
883
899
  workerId: string;
884
900
  state: "delivered" | "queued";
@@ -894,7 +910,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
894
910
  text: string;
895
911
  };
896
912
  };
897
- } | {
913
+ };
914
+ };
915
+ } & {
916
+ "/:workerId/stop": {
917
+ $post: {
898
918
  output: {
899
919
  error: string;
900
920
  code?: "invalid_input" | undefined;
@@ -906,15 +926,9 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
906
926
  workerId: string;
907
927
  };
908
928
  } & {
909
- json: {
910
- text: string;
911
- };
929
+ json: Record<string, never>;
912
930
  };
913
- };
914
- };
915
- } & {
916
- "/:workerId/stop": {
917
- $post: {
931
+ } | {
918
932
  output: {
919
933
  workerId: string;
920
934
  state: "stopping" | "terminated";
@@ -928,7 +942,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
928
942
  } & {
929
943
  json: Record<string, never>;
930
944
  };
931
- } | {
945
+ };
946
+ };
947
+ } & {
948
+ "/:workerId/destroy": {
949
+ $post: {
932
950
  output: {
933
951
  error: string;
934
952
  code?: "invalid_input" | undefined;
@@ -940,13 +958,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
940
958
  workerId: string;
941
959
  };
942
960
  } & {
943
- json: Record<string, never>;
961
+ json: {
962
+ discardWork?: true | undefined;
963
+ };
944
964
  };
945
- };
946
- };
947
- } & {
948
- "/:workerId/destroy": {
949
- $post: {
965
+ } | {
950
966
  output: {
951
967
  workerId: string;
952
968
  state: "complete" | "incomplete";
@@ -975,22 +991,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
975
991
  discardWork?: true | undefined;
976
992
  };
977
993
  };
978
- } | {
979
- output: {
980
- error: string;
981
- code?: "invalid_input" | undefined;
982
- };
983
- outputFormat: "json";
984
- status: 400;
985
- input: {
986
- param: {
987
- workerId: string;
988
- };
989
- } & {
990
- json: {
991
- discardWork?: true | undefined;
992
- };
993
- };
994
994
  } | {
995
995
  output: {
996
996
  workerId: string;
@@ -1026,13 +1026,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
1026
1026
  "/:workerId/diff": {
1027
1027
  $get: {
1028
1028
  output: {
1029
- workerId: string;
1030
- baselineSha: string;
1031
- diff: string;
1032
- truncated: boolean;
1029
+ error: string;
1030
+ code?: "invalid_input" | undefined;
1033
1031
  };
1034
1032
  outputFormat: "json";
1035
- status: 200;
1033
+ status: 400;
1036
1034
  input: {
1037
1035
  param: {
1038
1036
  workerId: string;
@@ -1040,11 +1038,13 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
1040
1038
  };
1041
1039
  } | {
1042
1040
  output: {
1043
- error: string;
1044
- code?: "invalid_input" | undefined;
1041
+ workerId: string;
1042
+ baselineSha: string;
1043
+ diff: string;
1044
+ truncated: boolean;
1045
1045
  };
1046
1046
  outputFormat: "json";
1047
- status: 400;
1047
+ status: 200;
1048
1048
  input: {
1049
1049
  param: {
1050
1050
  workerId: string;
package/dist/index.js CHANGED
@@ -19,11 +19,15 @@ import { workerCleanups } from './delegation/worker-cleanup.js';
19
19
  import { onTerminal } from './serve-listener.js';
20
20
  import { installWindowsIdentityStore } from './delegation/windows-identity-store.js';
21
21
  import { registerBuiltInRunners } from './runners/built-in.js';
22
+ import { registerBuiltInRunSlots } from './built-in-run-slots.js';
22
23
  // Workspace receipts and markers use the host's identity store (ADR 0032).
23
24
  installWindowsIdentityStore();
24
25
  // Every command, the cockpit, a headless task and each child process that reruns this entry read
25
26
  // runner data from the registry (spec 2026-11-18-runner-definitions).
26
27
  registerBuiltInRunners();
28
+ // A deletion, a reclaim or a family archive asks the removal slots, and throws in a process that
29
+ // sealed none (spec 2026-11-21-run-lifecycle-and-store-ports).
30
+ registerBuiltInRunSlots();
27
31
  warnLegacyEnv(process.env);
28
32
  // ---- workspace boot ----------------------------------------------------------
29
33
  /**
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC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C,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAyB,CAAC;QACvG,OAAO,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,OAAO,CAAC;IACjB,CAAC;AACH,CAAC;AAED,IAAI,CAAC;IACH,GAAG,cAAc,EAAE,cAAc,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa;IAChI,YAAY,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,IAAI,EAAE,EAAE,GAAG,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,EAAE,CAAC;CACtK,CAAC,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IACxB,OAAO,CAAC,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { DeletionGate } from '../runs/removal-slots.ts';
2
+ /** Keeps an archived family member's tmp directory while a job runs in it, so the job's log and
3
+ * exit code outlive the task. */
4
+ export declare const jobsDeletionGate: DeletionGate;
@@ -0,0 +1,10 @@
1
+ import { agentTmpDirLocations } from '../runs/agent-tmpdir.js';
2
+ import { jobRunsIn } from './job.js';
3
+ /** Keeps an archived family member's tmp directory while a job runs in it, so the job's log and
4
+ * exit code outlive the task. */
5
+ export const jobsDeletionGate = {
6
+ name: 'jobs',
7
+ refuse: (runId, kind, dataDir) => kind === 'archive-tmp' && jobRunsIn(agentTmpDirLocations(dataDir, runId))
8
+ ? 'a job runs in the task tmp directory' : undefined,
9
+ };
10
+ //# sourceMappingURL=removal-slot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"removal-slot.js","sourceRoot":"","sources":["../../src/jobs/removal-slot.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC;kCACkC;AAClC,MAAM,CAAC,MAAM,gBAAgB,GAAiB;IAC5C,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,IAAI,KAAK,aAAa,IAAI,SAAS,CAAC,oBAAoB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACzG,CAAC,CAAC,sCAAsC,CAAC,CAAC,CAAC,SAAS;CACvD,CAAC"}
@@ -0,0 +1,56 @@
1
+ import type { WorkerResults } from './ports.ts';
2
+ import type { RunRecord } from './store.ts';
3
+ /**
4
+ * The removal slots (spec 2026-11-21-run-lifecycle-and-store-ports, "Removal slots"; owner decision
5
+ * 2): the features that a run deletion, a worktree reclaim or a family archive must ask, as three
6
+ * named slots in one process-wide registry. The core asks the registry and imports no feature. An
7
+ * entry fills the registry with `registerBuiltInRunSlots()` (`built-in-run-slots.ts`) before the CLI
8
+ * dispatch; a test seals it with only the slots it needs (`removal-slots.testkit.ts`).
9
+ *
10
+ * Fail closed: until the registry is sealed, every read throws an error that names the missing
11
+ * registration, and each removal path reads it before its first side effect.
12
+ */
13
+ /** What a deletion removes: a run's history, its worktree or worker resources, or the agent tmp
14
+ * directory of an archived family member. */
15
+ export type DeletionKind = 'history' | 'worktree' | 'archive-tmp';
16
+ /** Refuses a deletion while the feature still needs what it removes. */
17
+ export interface DeletionGate {
18
+ readonly name: string;
19
+ /** A reason refuses the deletion; undefined lets it go ahead. `dataDir` is the run's data dir. */
20
+ refuse(runId: string, kind: DeletionKind, dataDir: string): string | undefined;
21
+ }
22
+ /** What a reclaim preparation gets from the reclaim: the repository and the store it reclaims in. */
23
+ export interface ReclaimContext {
24
+ readonly repoRoot: string;
25
+ /** The store the reclaim runs in. */
26
+ readonly store: WorkerResults;
27
+ }
28
+ /** Work that must finish before a reclaimed worktree goes. A rejection stops the reclaim. */
29
+ export interface ReclaimPreparation {
30
+ readonly name: string;
31
+ prepare(run: RunRecord, context: ReclaimContext): Promise<void>;
32
+ }
33
+ /** Removes what a feature keeps for a run when the run's history goes. */
34
+ export interface RemovalCleanup {
35
+ readonly name: string;
36
+ removed(runId: string, dataDir: string): void;
37
+ }
38
+ export interface RunSlots {
39
+ readonly gates?: readonly DeletionGate[] | undefined;
40
+ readonly preparations?: readonly ReclaimPreparation[] | undefined;
41
+ readonly cleanups?: readonly RemovalCleanup[] | undefined;
42
+ }
43
+ /** Add slots, in call order. Registering the same slot object again does nothing. */
44
+ export declare function registerRunSlots(slots: RunSlots): void;
45
+ /** Close the registry: removals may run, and no new slot may register. */
46
+ export declare function sealRunSlots(): void;
47
+ /** Whether this process sealed its removal slots. Never throws. */
48
+ export declare function runSlotsSealed(): boolean;
49
+ /** Throws unless the registry is sealed. A removal path calls it before its first side effect. */
50
+ export declare function assertRunSlotsSealed(): void;
51
+ /** The first gate's reason to refuse this deletion, in registration order. */
52
+ export declare function deletionRefusal(runId: string, kind: DeletionKind, dataDir: string): string | undefined;
53
+ /** Run every preparation in registration order; the first rejection stops the rest. */
54
+ export declare function prepareReclaim(run: RunRecord, context: ReclaimContext): Promise<void>;
55
+ /** Run every cleanup in registration order, then throw the first failure. */
56
+ export declare function runRemovalCleanups(runId: string, dataDir: string): void;