@hearsay-tools/squawk 0.18.0-pr4300.8344 → 0.18.0-pr4301.8357

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.
@@ -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;
@@ -54,18 +66,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
54
66
  offset?: string | undefined;
55
67
  };
56
68
  };
57
- } | {
58
- output: {
59
- error: string;
60
- code?: "invalid_input" | undefined;
61
- };
62
- outputFormat: "json";
63
- status: 400;
64
- input: {
65
- query: {
66
- offset?: string | undefined;
67
- };
68
- };
69
69
  };
70
70
  };
71
71
  } & {
@@ -652,6 +652,18 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
652
652
  } & {
653
653
  "/:workerId": {
654
654
  $get: {
655
+ output: {
656
+ error: string;
657
+ code?: "invalid_input" | undefined;
658
+ };
659
+ outputFormat: "json";
660
+ status: 400;
661
+ input: {
662
+ param: {
663
+ workerId: string;
664
+ };
665
+ };
666
+ } | {
655
667
  output: {
656
668
  workerId: string;
657
669
  settled: boolean;
@@ -776,7 +788,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
776
788
  workerId: string;
777
789
  };
778
790
  };
779
- } | {
791
+ };
792
+ };
793
+ } & {
794
+ "/:workerId/collect": {
795
+ $post: {
780
796
  output: {
781
797
  error: string;
782
798
  code?: "invalid_input" | undefined;
@@ -787,12 +803,10 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
787
803
  param: {
788
804
  workerId: string;
789
805
  };
806
+ } & {
807
+ json: Record<string, never>;
790
808
  };
791
- };
792
- };
793
- } & {
794
- "/:workerId/collect": {
795
- $post: {
809
+ } | {
796
810
  output: {
797
811
  workerId: string;
798
812
  parentRunId: string;
@@ -915,7 +929,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
915
929
  } & {
916
930
  json: Record<string, never>;
917
931
  };
918
- } | {
932
+ };
933
+ };
934
+ } & {
935
+ "/:workerId/steer": {
936
+ $post: {
919
937
  output: {
920
938
  error: string;
921
939
  code?: "invalid_input" | undefined;
@@ -927,13 +945,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
927
945
  workerId: string;
928
946
  };
929
947
  } & {
930
- json: Record<string, never>;
948
+ json: {
949
+ text: string;
950
+ };
931
951
  };
932
- };
933
- };
934
- } & {
935
- "/:workerId/steer": {
936
- $post: {
952
+ } | {
937
953
  output: {
938
954
  workerId: string;
939
955
  state: "delivered" | "queued";
@@ -949,7 +965,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
949
965
  text: string;
950
966
  };
951
967
  };
952
- } | {
968
+ };
969
+ };
970
+ } & {
971
+ "/:workerId/stop": {
972
+ $post: {
953
973
  output: {
954
974
  error: string;
955
975
  code?: "invalid_input" | undefined;
@@ -961,15 +981,9 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
961
981
  workerId: string;
962
982
  };
963
983
  } & {
964
- json: {
965
- text: string;
966
- };
984
+ json: Record<string, never>;
967
985
  };
968
- };
969
- };
970
- } & {
971
- "/:workerId/stop": {
972
- $post: {
986
+ } | {
973
987
  output: {
974
988
  workerId: string;
975
989
  state: "stopping" | "terminated";
@@ -983,7 +997,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
983
997
  } & {
984
998
  json: Record<string, never>;
985
999
  };
986
- } | {
1000
+ };
1001
+ };
1002
+ } & {
1003
+ "/:workerId/destroy": {
1004
+ $post: {
987
1005
  output: {
988
1006
  error: string;
989
1007
  code?: "invalid_input" | undefined;
@@ -995,13 +1013,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
995
1013
  workerId: string;
996
1014
  };
997
1015
  } & {
998
- json: Record<string, never>;
1016
+ json: {
1017
+ discardWork?: true | undefined;
1018
+ };
999
1019
  };
1000
- };
1001
- };
1002
- } & {
1003
- "/:workerId/destroy": {
1004
- $post: {
1020
+ } | {
1005
1021
  output: {
1006
1022
  workerId: string;
1007
1023
  state: "complete" | "incomplete";
@@ -1030,22 +1046,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
1030
1046
  discardWork?: true | undefined;
1031
1047
  };
1032
1048
  };
1033
- } | {
1034
- output: {
1035
- error: string;
1036
- code?: "invalid_input" | undefined;
1037
- };
1038
- outputFormat: "json";
1039
- status: 400;
1040
- input: {
1041
- param: {
1042
- workerId: string;
1043
- };
1044
- } & {
1045
- json: {
1046
- discardWork?: true | undefined;
1047
- };
1048
- };
1049
1049
  } | {
1050
1050
  output: {
1051
1051
  workerId: string;
@@ -1081,13 +1081,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
1081
1081
  "/:workerId/diff": {
1082
1082
  $get: {
1083
1083
  output: {
1084
- workerId: string;
1085
- baselineSha: string;
1086
- diff: string;
1087
- truncated: boolean;
1084
+ error: string;
1085
+ code?: "invalid_input" | undefined;
1088
1086
  };
1089
1087
  outputFormat: "json";
1090
- status: 200;
1088
+ status: 400;
1091
1089
  input: {
1092
1090
  param: {
1093
1091
  workerId: string;
@@ -1095,11 +1093,13 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
1095
1093
  };
1096
1094
  } | {
1097
1095
  output: {
1098
- error: string;
1099
- code?: "invalid_input" | undefined;
1096
+ workerId: string;
1097
+ baselineSha: string;
1098
+ diff: string;
1099
+ truncated: boolean;
1100
1100
  };
1101
1101
  outputFormat: "json";
1102
- status: 400;
1102
+ status: 200;
1103
1103
  input: {
1104
1104
  param: {
1105
1105
  workerId: string;
@@ -13,6 +13,7 @@ import { fileURLToPath } from 'node:url';
13
13
  */
14
14
  /** The entry files of a bundled runner folder, in lookup order: built `dist/` has `index.js`, the source checkout `index.ts`. */
15
15
  export const BUNDLED_RUNNER_ENTRY_FILES = ['index.mjs', 'index.js', 'index.ts'];
16
+ // oxlint-disable-next-line cez/regex-module-syntax -- reads the one-line declaration the entry contract above fixes, fails closed, and production code has no parser
16
17
  const DISPLAY_ORDER = /^export const displayOrder = (\d+);$/gm;
17
18
  /** The `runners/` folder next to this module's folder, in the source checkout and in `dist/`. */
18
19
  export function bundledRunnersDir() {
@@ -1 +1 @@
1
- {"version":3,"file":"bundled-runners.js","sourceRoot":"","sources":["../../src/plugin/bundled-runners.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;;;;;;GASG;AAEH,iIAAiI;AACjI,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,WAAW,EAAE,UAAU,EAAE,UAAU,CAAU,CAAC;AAUzF,MAAM,aAAa,GAAG,wCAAwC,CAAC;AAE/D,iGAAiG;AACjG,MAAM,UAAU,iBAAiB;IAC/B,OAAO,aAAa,CAAC,IAAI,GAAG,CAAC,aAAa,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAChE,CAAC;AAED,SAAS,MAAM,CAAC,IAAY;IAC1B,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;IACjC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,SAAS,cAAc,CAAC,KAAa;IACnC,MAAM,MAAM,GAAG,CAAC,GAAG,YAAY,CAAC,KAA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C,OAAO,oBAAoB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAC5D,CAAC"}
@@ -58,6 +58,29 @@ export declare function ciProgressPlugs(): {
58
58
  export declare function createActivityRoutes(routeDeps: ActivityRouteDeps): import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, {
59
59
  "/workspace/activity": {
60
60
  $get: {
61
+ output: {
62
+ error: string;
63
+ code?: "invalid_input" | undefined;
64
+ };
65
+ outputFormat: "json";
66
+ status: 400;
67
+ input: {
68
+ query: {
69
+ project?: string | undefined;
70
+ };
71
+ };
72
+ } | {
73
+ output: {
74
+ error: string;
75
+ };
76
+ outputFormat: "json";
77
+ status: 404 | 409 | 503;
78
+ input: {
79
+ query: {
80
+ project?: string | undefined;
81
+ };
82
+ };
83
+ } | {
61
84
  output: {
62
85
  generatedAt: string;
63
86
  projects: {
@@ -304,29 +327,6 @@ export declare function createActivityRoutes(routeDeps: ActivityRouteDeps): impo
304
327
  project?: string | undefined;
305
328
  };
306
329
  };
307
- } | {
308
- output: {
309
- error: string;
310
- code?: "invalid_input" | undefined;
311
- };
312
- outputFormat: "json";
313
- status: 400;
314
- input: {
315
- query: {
316
- project?: string | undefined;
317
- };
318
- };
319
- } | {
320
- output: {
321
- error: string;
322
- };
323
- outputFormat: "json";
324
- status: 404 | 409 | 503;
325
- input: {
326
- query: {
327
- project?: string | undefined;
328
- };
329
- };
330
330
  };
331
331
  };
332
332
  }, "/", "/workspace/activity">;
@@ -22,18 +22,6 @@ export declare function createModelsRoutes(options: {
22
22
  profileId?: string | undefined;
23
23
  };
24
24
  };
25
- } | {
26
- output: {
27
- error: string;
28
- };
29
- outputFormat: "json";
30
- status: 400;
31
- input: {
32
- query: {
33
- runner: string | string[];
34
- profileId?: string | undefined;
35
- };
36
- };
37
25
  } | {
38
26
  output: {
39
27
  runner: string;
@@ -55,6 +43,18 @@ export declare function createModelsRoutes(options: {
55
43
  profileId?: string | undefined;
56
44
  };
57
45
  };
46
+ } | {
47
+ output: {
48
+ error: string;
49
+ };
50
+ outputFormat: "json";
51
+ status: 400;
52
+ input: {
53
+ query: {
54
+ runner: string | string[];
55
+ profileId?: string | undefined;
56
+ };
57
+ };
58
58
  };
59
59
  };
60
60
  }, "/", "/models">;
@@ -70,10 +70,18 @@ export declare function createProvidersRoutes(deps: ProvidersRouteDeps): import(
70
70
  };
71
71
  } | {
72
72
  output: {
73
- error: string;
73
+ providers: {
74
+ requiresAccountHome?: boolean | undefined;
75
+ provider: string;
76
+ status: "connected" | "disconnected" | "not-installed" | "unknown";
77
+ enabled?: boolean | undefined;
78
+ hint?: string | undefined;
79
+ authFailureId?: string | undefined;
80
+ profileId?: string | undefined;
81
+ }[];
74
82
  };
75
83
  outputFormat: "json";
76
- status: 500;
84
+ status: import("hono/utils/http-status").ContentfulStatusCode;
77
85
  input: {
78
86
  param: {
79
87
  provider: string;
@@ -85,18 +93,10 @@ export declare function createProvidersRoutes(deps: ProvidersRouteDeps): import(
85
93
  };
86
94
  } | {
87
95
  output: {
88
- providers: {
89
- requiresAccountHome?: boolean | undefined;
90
- provider: string;
91
- status: "connected" | "disconnected" | "not-installed" | "unknown";
92
- enabled?: boolean | undefined;
93
- hint?: string | undefined;
94
- authFailureId?: string | undefined;
95
- profileId?: string | undefined;
96
- }[];
96
+ error: string;
97
97
  };
98
98
  outputFormat: "json";
99
- status: import("hono/utils/http-status").ContentfulStatusCode;
99
+ status: 500;
100
100
  input: {
101
101
  param: {
102
102
  provider: string;
@@ -128,10 +128,18 @@ export declare function createProvidersRoutes(deps: ProvidersRouteDeps): import(
128
128
  };
129
129
  } | {
130
130
  output: {
131
- error: string;
131
+ providers: {
132
+ requiresAccountHome?: boolean | undefined;
133
+ provider: string;
134
+ status: "connected" | "disconnected" | "not-installed" | "unknown";
135
+ enabled?: boolean | undefined;
136
+ hint?: string | undefined;
137
+ authFailureId?: string | undefined;
138
+ profileId?: string | undefined;
139
+ }[];
132
140
  };
133
141
  outputFormat: "json";
134
- status: 409;
142
+ status: import("hono/utils/http-status").ContentfulStatusCode;
135
143
  input: {
136
144
  param: {
137
145
  provider: string;
@@ -143,18 +151,10 @@ export declare function createProvidersRoutes(deps: ProvidersRouteDeps): import(
143
151
  };
144
152
  } | {
145
153
  output: {
146
- providers: {
147
- requiresAccountHome?: boolean | undefined;
148
- provider: string;
149
- status: "connected" | "disconnected" | "not-installed" | "unknown";
150
- enabled?: boolean | undefined;
151
- hint?: string | undefined;
152
- authFailureId?: string | undefined;
153
- profileId?: string | undefined;
154
- }[];
154
+ error: string;
155
155
  };
156
156
  outputFormat: "json";
157
- status: import("hono/utils/http-status").ContentfulStatusCode;
157
+ status: 409;
158
158
  input: {
159
159
  param: {
160
160
  provider: string;
@@ -173,7 +173,7 @@ export declare function createProvidersRoutes(deps: ProvidersRouteDeps): import(
173
173
  error: string;
174
174
  };
175
175
  outputFormat: "json";
176
- status: 400;
176
+ status: 409;
177
177
  input: {
178
178
  json: {
179
179
  provider: string;
@@ -185,7 +185,7 @@ export declare function createProvidersRoutes(deps: ProvidersRouteDeps): import(
185
185
  error: string;
186
186
  };
187
187
  outputFormat: "json";
188
- status: 409;
188
+ status: 400;
189
189
  input: {
190
190
  json: {
191
191
  provider: string;
@@ -290,28 +290,10 @@ export declare function createAgentProfilesRoutes(deps: AgentProfilesRouteDeps):
290
290
  "/workspace/agent-profiles": {
291
291
  $post: {
292
292
  output: {
293
- profile: {
294
- id: string;
295
- provider: string;
296
- label: string;
297
- configDir?: string | undefined;
298
- path?: string | undefined;
299
- exists: boolean;
300
- looksValid: boolean;
301
- isDefault: boolean;
302
- status?: {
303
- requiresAccountHome?: boolean | undefined;
304
- provider: string;
305
- status: "connected" | "disconnected" | "not-installed" | "unknown";
306
- enabled?: boolean | undefined;
307
- hint?: string | undefined;
308
- authFailureId?: string | undefined;
309
- profileId?: string | undefined;
310
- } | undefined;
311
- };
293
+ error: string;
312
294
  };
313
295
  outputFormat: "json";
314
- status: 201;
296
+ status: 409;
315
297
  input: {
316
298
  json: {
317
299
  provider: string;
@@ -337,7 +319,7 @@ export declare function createAgentProfilesRoutes(deps: AgentProfilesRouteDeps):
337
319
  error: string;
338
320
  };
339
321
  outputFormat: "json";
340
- status: 409;
322
+ status: 500;
341
323
  input: {
342
324
  json: {
343
325
  provider: string;
@@ -347,10 +329,28 @@ export declare function createAgentProfilesRoutes(deps: AgentProfilesRouteDeps):
347
329
  };
348
330
  } | {
349
331
  output: {
350
- error: string;
332
+ profile: {
333
+ id: string;
334
+ provider: string;
335
+ label: string;
336
+ configDir?: string | undefined;
337
+ path?: string | undefined;
338
+ exists: boolean;
339
+ looksValid: boolean;
340
+ isDefault: boolean;
341
+ status?: {
342
+ requiresAccountHome?: boolean | undefined;
343
+ provider: string;
344
+ status: "connected" | "disconnected" | "not-installed" | "unknown";
345
+ enabled?: boolean | undefined;
346
+ hint?: string | undefined;
347
+ authFailureId?: string | undefined;
348
+ profileId?: string | undefined;
349
+ } | undefined;
350
+ };
351
351
  };
352
352
  outputFormat: "json";
353
- status: 500;
353
+ status: 201;
354
354
  input: {
355
355
  json: {
356
356
  provider: string;
@@ -384,7 +384,7 @@ export declare function createAgentProfilesRoutes(deps: AgentProfilesRouteDeps):
384
384
  error: string;
385
385
  };
386
386
  outputFormat: "json";
387
- status: 400;
387
+ status: 409;
388
388
  input: {
389
389
  param: {
390
390
  id: string;
@@ -400,7 +400,7 @@ export declare function createAgentProfilesRoutes(deps: AgentProfilesRouteDeps):
400
400
  error: string;
401
401
  };
402
402
  outputFormat: "json";
403
- status: 404;
403
+ status: 400;
404
404
  input: {
405
405
  param: {
406
406
  id: string;
@@ -416,7 +416,7 @@ export declare function createAgentProfilesRoutes(deps: AgentProfilesRouteDeps):
416
416
  error: string;
417
417
  };
418
418
  outputFormat: "json";
419
- status: 409;
419
+ status: 404;
420
420
  input: {
421
421
  param: {
422
422
  id: string;
@@ -544,7 +544,7 @@ export declare function createAgentProfilesRoutes(deps: AgentProfilesRouteDeps):
544
544
  error: string;
545
545
  };
546
546
  outputFormat: "json";
547
- status: 400;
547
+ status: 404;
548
548
  input: {
549
549
  json: {
550
550
  projectId: string;
@@ -557,7 +557,7 @@ export declare function createAgentProfilesRoutes(deps: AgentProfilesRouteDeps):
557
557
  error: string;
558
558
  };
559
559
  outputFormat: "json";
560
- status: 404;
560
+ status: 400;
561
561
  input: {
562
562
  json: {
563
563
  projectId: string;
@@ -621,7 +621,7 @@ export declare function createAgentProfilesRoutes(deps: AgentProfilesRouteDeps):
621
621
  error: string;
622
622
  };
623
623
  outputFormat: "json";
624
- status: 404;
624
+ status: 409;
625
625
  input: {
626
626
  param: {
627
627
  id: string;
@@ -632,7 +632,7 @@ export declare function createAgentProfilesRoutes(deps: AgentProfilesRouteDeps):
632
632
  error: string;
633
633
  };
634
634
  outputFormat: "json";
635
- status: 409;
635
+ status: 500;
636
636
  input: {
637
637
  param: {
638
638
  id: string;
@@ -643,7 +643,7 @@ export declare function createAgentProfilesRoutes(deps: AgentProfilesRouteDeps):
643
643
  error: string;
644
644
  };
645
645
  outputFormat: "json";
646
- status: 500;
646
+ status: 404;
647
647
  input: {
648
648
  param: {
649
649
  id: string;
@@ -31,7 +31,7 @@ export declare function createOpenTargetsRoutes(deps: OpenTargetsRouteDeps): imp
31
31
  error: string;
32
32
  };
33
33
  outputFormat: "json";
34
- status: 400;
34
+ status: 409;
35
35
  input: {
36
36
  json: {
37
37
  target: string;
@@ -42,7 +42,7 @@ export declare function createOpenTargetsRoutes(deps: OpenTargetsRouteDeps): imp
42
42
  error: string;
43
43
  };
44
44
  outputFormat: "json";
45
- status: 409;
45
+ status: 400;
46
46
  input: {
47
47
  json: {
48
48
  target: string;
@@ -120,11 +120,10 @@ export declare function createWorktreesRoutes(deps: WorktreesRouteDeps): import(
120
120
  };
121
121
  } | {
122
122
  output: {
123
- runId: string;
124
- worktreeReclaimedAt: string;
123
+ error: string;
125
124
  };
126
125
  outputFormat: "json";
127
- status: import("hono/utils/http-status").ContentfulStatusCode;
126
+ status: 404 | 409;
128
127
  input: {
129
128
  param: {
130
129
  runId: string;
@@ -132,10 +131,11 @@ export declare function createWorktreesRoutes(deps: WorktreesRouteDeps): import(
132
131
  };
133
132
  } | {
134
133
  output: {
135
- error: string;
134
+ runId: string;
135
+ worktreeReclaimedAt: string;
136
136
  };
137
137
  outputFormat: "json";
138
- status: 404 | 409;
138
+ status: import("hono/utils/http-status").ContentfulStatusCode;
139
139
  input: {
140
140
  param: {
141
141
  runId: string;
@@ -267,18 +267,14 @@ export declare function createRepoRoutes(deps: RepoRouteDeps): import("hono/hono
267
267
  "/repo/branches/delete": {
268
268
  $post: {
269
269
  output: {
270
- deleted: string[];
270
+ error: string;
271
271
  refused: {
272
272
  name: string;
273
273
  reason: string;
274
274
  }[];
275
- dropped?: {
276
- sha: string;
277
- subject: string;
278
- }[] | undefined;
279
275
  };
280
276
  outputFormat: "json";
281
- status: 200;
277
+ status: 409;
282
278
  input: {
283
279
  json: {
284
280
  names: string[];
@@ -287,14 +283,18 @@ export declare function createRepoRoutes(deps: RepoRouteDeps): import("hono/hono
287
283
  };
288
284
  } | {
289
285
  output: {
290
- error: string;
286
+ deleted: string[];
291
287
  refused: {
292
288
  name: string;
293
289
  reason: string;
294
290
  }[];
291
+ dropped?: {
292
+ sha: string;
293
+ subject: string;
294
+ }[] | undefined;
295
295
  };
296
296
  outputFormat: "json";
297
- status: 409;
297
+ status: 200;
298
298
  input: {
299
299
  json: {
300
300
  names: string[];
@@ -315,6 +315,19 @@ export declare function createRepoRoutes(deps: RepoRouteDeps): import("hono/hono
315
315
  } & {
316
316
  "/repo/commit/:sha": {
317
317
  $get: {
318
+ output: string;
319
+ outputFormat: "text";
320
+ status: import("hono/utils/http-status").ContentfulStatusCode;
321
+ input: {
322
+ query: {
323
+ structured?: string | undefined;
324
+ };
325
+ } & {
326
+ param: {
327
+ sha: string;
328
+ };
329
+ };
330
+ } | {
318
331
  output: {
319
332
  error: string;
320
333
  code?: "invalid_input" | undefined;
@@ -378,19 +391,6 @@ export declare function createRepoRoutes(deps: RepoRouteDeps): import("hono/hono
378
391
  sha: string;
379
392
  };
380
393
  };
381
- } | {
382
- output: string;
383
- outputFormat: "text";
384
- status: import("hono/utils/http-status").ContentfulStatusCode;
385
- input: {
386
- query: {
387
- structured?: string | undefined;
388
- };
389
- } & {
390
- param: {
391
- sha: string;
392
- };
393
- };
394
394
  };
395
395
  };
396
396
  } & {
@@ -451,12 +451,10 @@ export declare function createRepoRoutes(deps: RepoRouteDeps): import("hono/hono
451
451
  "/repo/pull": {
452
452
  $post: {
453
453
  output: {
454
- branch: string;
455
- pulled: true;
456
- summary: string;
454
+ error: string;
457
455
  };
458
456
  outputFormat: "json";
459
- status: 200;
457
+ status: 409;
460
458
  input: {
461
459
  json: {
462
460
  branch?: string | undefined;
@@ -465,10 +463,12 @@ export declare function createRepoRoutes(deps: RepoRouteDeps): import("hono/hono
465
463
  };
466
464
  } | {
467
465
  output: {
468
- error: string;
466
+ branch: string;
467
+ pulled: true;
468
+ summary: string;
469
469
  };
470
470
  outputFormat: "json";
471
- status: 409;
471
+ status: 200;
472
472
  input: {
473
473
  json: {
474
474
  branch?: string | undefined;
@@ -40,7 +40,7 @@ export declare const reportsRoutes: import("hono/hono-base").HonoBase<ProjectApi
40
40
  error: string;
41
41
  };
42
42
  outputFormat: "json";
43
- status: 400;
43
+ status: 409;
44
44
  input: {
45
45
  query: {
46
46
  q?: string | undefined;
@@ -53,7 +53,7 @@ export declare const reportsRoutes: import("hono/hono-base").HonoBase<ProjectApi
53
53
  error: string;
54
54
  };
55
55
  outputFormat: "json";
56
- status: 409;
56
+ status: 400;
57
57
  input: {
58
58
  query: {
59
59
  q?: string | undefined;
@@ -51,10 +51,34 @@ export declare function createWorkspaceConfigRoutes(deps: WorkspaceConfigRouteDe
51
51
  "/workspace/config": {
52
52
  $put: {
53
53
  output: {
54
- error: string;
54
+ browseRoot: string;
55
+ projectsDir: string;
56
+ archiveOnMerge: boolean | null;
57
+ effectiveArchiveOnMerge: boolean;
58
+ archiveOnMergeSource: "default" | "environment" | "global";
59
+ composerDefaults: {
60
+ autonomous: boolean | null;
61
+ worktree: boolean | null;
62
+ inheritedAutonomous: "source-dependent" | boolean;
63
+ inheritedWorktree: boolean;
64
+ };
65
+ resources: {
66
+ maxParallel: number;
67
+ maxMonitoringSessions: number;
68
+ monitoringWakeIntervalMinutes: number | null;
69
+ autoResumeOnUsageLimit: boolean;
70
+ memoryLimitMb: number | null;
71
+ worktreeRetentionDefault: number;
72
+ };
73
+ agentDefaults: {
74
+ runner?: string | undefined;
75
+ models?: {
76
+ [x: string]: string | undefined;
77
+ } | undefined;
78
+ };
55
79
  };
56
80
  outputFormat: "json";
57
- status: 400;
81
+ status: import("hono/utils/http-status").ContentfulStatusCode;
58
82
  input: {
59
83
  json: {
60
84
  browseRoot?: string | undefined;
@@ -83,7 +107,7 @@ export declare function createWorkspaceConfigRoutes(deps: WorkspaceConfigRouteDe
83
107
  error: string;
84
108
  };
85
109
  outputFormat: "json";
86
- status: 500;
110
+ status: 400;
87
111
  input: {
88
112
  json: {
89
113
  browseRoot?: string | undefined;
@@ -109,34 +133,10 @@ export declare function createWorkspaceConfigRoutes(deps: WorkspaceConfigRouteDe
109
133
  };
110
134
  } | {
111
135
  output: {
112
- browseRoot: string;
113
- projectsDir: string;
114
- archiveOnMerge: boolean | null;
115
- effectiveArchiveOnMerge: boolean;
116
- archiveOnMergeSource: "default" | "environment" | "global";
117
- composerDefaults: {
118
- autonomous: boolean | null;
119
- worktree: boolean | null;
120
- inheritedAutonomous: "source-dependent" | boolean;
121
- inheritedWorktree: boolean;
122
- };
123
- resources: {
124
- maxParallel: number;
125
- maxMonitoringSessions: number;
126
- monitoringWakeIntervalMinutes: number | null;
127
- autoResumeOnUsageLimit: boolean;
128
- memoryLimitMb: number | null;
129
- worktreeRetentionDefault: number;
130
- };
131
- agentDefaults: {
132
- runner?: string | undefined;
133
- models?: {
134
- [x: string]: string | undefined;
135
- } | undefined;
136
- };
136
+ error: string;
137
137
  };
138
138
  outputFormat: "json";
139
- status: import("hono/utils/http-status").ContentfulStatusCode;
139
+ status: 500;
140
140
  input: {
141
141
  json: {
142
142
  browseRoot?: string | undefined;
@@ -208,10 +208,41 @@ export declare function createWorkspaceConfigRoutes(deps: WorkspaceConfigRouteDe
208
208
  "/workspace/ui-state": {
209
209
  $put: {
210
210
  output: {
211
- error: string;
211
+ [x: string]: import("hono/utils/types").JSONValue;
212
+ sidebar?: {
213
+ [x: string]: import("hono/utils/types").JSONValue;
214
+ collapsed?: {
215
+ [x: string]: boolean;
216
+ } | undefined;
217
+ projectOrder?: string[] | undefined;
218
+ } | undefined;
219
+ dismissedProviderAuthFailures?: {
220
+ [x: string]: string | undefined;
221
+ } | undefined;
222
+ appearance?: {
223
+ accent?: "cezarion" | "lime" | "violet" | undefined;
224
+ density?: "comfortable" | "compact" | "ultra" | undefined;
225
+ width?: "narrow" | "wide" | undefined;
226
+ } | undefined;
227
+ notifications?: {
228
+ [x: string]: import("hono/utils/types").JSONValue;
229
+ enabled?: boolean | undefined;
230
+ } | undefined;
231
+ taskTable?: {
232
+ [x: string]: import("hono/utils/types").JSONValue;
233
+ expandedColumns?: {
234
+ [x: string]: boolean;
235
+ } | undefined;
236
+ } | undefined;
237
+ lastLocation?: {
238
+ projectId: string;
239
+ pathname: string;
240
+ search?: string | undefined;
241
+ hash?: string | undefined;
242
+ } | undefined;
212
243
  };
213
244
  outputFormat: "json";
214
- status: 500;
245
+ status: import("hono/utils/http-status").ContentfulStatusCode;
215
246
  input: {
216
247
  json: {
217
248
  [x: string]: unknown;
@@ -244,41 +275,10 @@ export declare function createWorkspaceConfigRoutes(deps: WorkspaceConfigRouteDe
244
275
  };
245
276
  } | {
246
277
  output: {
247
- [x: string]: import("hono/utils/types").JSONValue;
248
- sidebar?: {
249
- [x: string]: import("hono/utils/types").JSONValue;
250
- collapsed?: {
251
- [x: string]: boolean;
252
- } | undefined;
253
- projectOrder?: string[] | undefined;
254
- } | undefined;
255
- dismissedProviderAuthFailures?: {
256
- [x: string]: string | undefined;
257
- } | undefined;
258
- appearance?: {
259
- accent?: "cezarion" | "lime" | "violet" | undefined;
260
- density?: "comfortable" | "compact" | "ultra" | undefined;
261
- width?: "narrow" | "wide" | undefined;
262
- } | undefined;
263
- notifications?: {
264
- [x: string]: import("hono/utils/types").JSONValue;
265
- enabled?: boolean | undefined;
266
- } | undefined;
267
- taskTable?: {
268
- [x: string]: import("hono/utils/types").JSONValue;
269
- expandedColumns?: {
270
- [x: string]: boolean;
271
- } | undefined;
272
- } | undefined;
273
- lastLocation?: {
274
- projectId: string;
275
- pathname: string;
276
- search?: string | undefined;
277
- hash?: string | undefined;
278
- } | undefined;
278
+ error: string;
279
279
  };
280
280
  outputFormat: "json";
281
- status: import("hono/utils/http-status").ContentfulStatusCode;
281
+ status: 500;
282
282
  input: {
283
283
  json: {
284
284
  [x: string]: unknown;
@@ -329,17 +329,10 @@ export declare function createFsBrowseRoutes(workspaceBrowseRoot: () => Promise<
329
329
  };
330
330
  } | {
331
331
  output: {
332
- path: string;
333
- parent: string | null;
334
- dirs: {
335
- name: string;
336
- path: string;
337
- isRepo: boolean;
338
- }[];
339
- truncated: boolean;
332
+ error: string;
340
333
  };
341
334
  outputFormat: "json";
342
- status: import("hono/utils/http-status").ContentfulStatusCode;
335
+ status: 400 | 403 | 404;
343
336
  input: {
344
337
  query: {
345
338
  path?: string | undefined;
@@ -348,10 +341,17 @@ export declare function createFsBrowseRoutes(workspaceBrowseRoot: () => Promise<
348
341
  };
349
342
  } | {
350
343
  output: {
351
- error: string;
344
+ path: string;
345
+ parent: string | null;
346
+ dirs: {
347
+ name: string;
348
+ path: string;
349
+ isRepo: boolean;
350
+ }[];
351
+ truncated: boolean;
352
352
  };
353
353
  outputFormat: "json";
354
- status: 400 | 403 | 404;
354
+ status: import("hono/utils/http-status").ContentfulStatusCode;
355
355
  input: {
356
356
  query: {
357
357
  path?: string | undefined;
@@ -370,21 +370,21 @@ export interface WorkspaceEventsRouteDeps {
370
370
  export declare function createWorkspaceEventsRoutes(deps: WorkspaceEventsRouteDeps): import("hono/hono-base").HonoBase<ProjectApiEnv, {
371
371
  "/workspace/events": {
372
372
  $get: {
373
- output: {
374
- error: string;
375
- code?: "invalid_input" | undefined;
376
- };
377
- outputFormat: "json";
378
- status: 400;
373
+ output: {};
374
+ outputFormat: string;
375
+ status: import("hono/utils/http-status").StatusCode;
379
376
  input: {
380
377
  query: {
381
378
  runs?: "summary" | undefined;
382
379
  };
383
380
  };
384
381
  } | {
385
- output: {};
386
- outputFormat: string;
387
- status: import("hono/utils/http-status").StatusCode;
382
+ output: {
383
+ error: string;
384
+ code?: "invalid_input" | undefined;
385
+ };
386
+ outputFormat: "json";
387
+ status: 400;
388
388
  input: {
389
389
  query: {
390
390
  runs?: "summary" | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hearsay-tools/squawk",
3
- "version": "0.18.0-pr4300.8344",
3
+ "version": "0.18.0-pr4301.8357",
4
4
  "description": "Local cockpit for running and tracking AI agent tasks in your repo. Uses your logged-in `claude` CLI and `gh` — zero config, zero database.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -68,8 +68,8 @@
68
68
  "devDependencies": {
69
69
  "@babel/parser": "^8.0.8",
70
70
  "@babel/types": "^8.0.8",
71
- "@open-mercato/cezar-api-client": "0.18.0-pr4300.8344",
72
- "@open-mercato/cezar-contract": "0.18.0-pr4300.8344",
71
+ "@open-mercato/cezar-api-client": "0.18.0-pr4301.8357",
72
+ "@open-mercato/cezar-contract": "0.18.0-pr4301.8357",
73
73
  "@types/node": "^24.19.1",
74
74
  "@types/ws": "^8.18.1",
75
75
  "esbuild": "^0.28.1",
@@ -86,5 +86,5 @@
86
86
  "publishConfig": {
87
87
  "access": "public"
88
88
  },
89
- "gitHead": "f49e6055bd641181d8e715eaa2209f91e033903a"
89
+ "gitHead": "a7f7d6871fe63306961c0868e3f43b6b8b707434"
90
90
  }
@@ -13,6 +13,8 @@ import { createRequire } from 'node:module';
13
13
  import { existsSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
14
14
  import { basename, dirname, join, relative, resolve } from 'node:path';
15
15
  import { fileURLToPath } from 'node:url';
16
+ import { parse } from '@babel/parser';
17
+ import { traverse } from '@babel/types';
16
18
  import { build } from 'esbuild';
17
19
 
18
20
  const here = dirname(fileURLToPath(import.meta.url));
@@ -44,7 +46,17 @@ scan(dist);
44
46
  // specifiers (`from`, `import(...)`, side-effect `import`) to the sibling `dist/plugin/<stem>.js`
45
47
  // declaration without touching string-literal type constants; `.js` runtime imports stay on the
46
48
  // package specifier and resolve through `installPluginResolveHook()`.
47
- const PLUGIN_SPEC = /(from\s+|import\s*\(\s*|import\s+)(['"])@hearsay-tools\/squawk\/plugin(?:\/(runtime|model-settings|managed-cli|pi-rpc))?\2/g;
49
+ const PLUGIN_PACKAGE = '@hearsay-tools/squawk/plugin';
50
+ const PLUGIN_SPEC = /^@hearsay-tools\/squawk\/plugin(?:\/(runtime|model-settings|managed-cli|pi-rpc))?$/;
51
+ /** The module specifier literals of a declaration file: `from`, side-effect `import` and `import(...)` types. */
52
+ function declarationSpecifiers(text) {
53
+ const found = [];
54
+ traverse(parse(text, { sourceType: 'module', plugins: [['typescript', { dts: true }]] }), (node) => {
55
+ if ((node.type === 'ImportDeclaration' || node.type === 'ExportNamedDeclaration' || node.type === 'ExportAllDeclaration'
56
+ || node.type === 'TSImportType' || node.type === 'ImportExpression') && node.source?.type === 'StringLiteral') found.push(node.source);
57
+ });
58
+ return found;
59
+ }
48
60
  const pluginDir = join(dist, 'plugin');
49
61
  function repointPluginDecls() {
50
62
  if (!existsSync(join(pluginDir, 'index.d.ts'))) return 0;
@@ -56,13 +68,19 @@ function repointPluginDecls() {
56
68
  if (p !== outdir) walk(p);
57
69
  } else if (item.name.endsWith('.d.ts')) {
58
70
  const text = readFileSync(p, 'utf8');
59
- PLUGIN_SPEC.lastIndex = 0;
60
- if (!PLUGIN_SPEC.test(text)) continue;
61
- const next = text.replace(PLUGIN_SPEC, (_match, prefix, _quote, sub) => {
71
+ if (!text.includes(PLUGIN_PACKAGE)) continue;
72
+ const targets = declarationSpecifiers(text).flatMap((literal) => {
73
+ const match = PLUGIN_SPEC.exec(literal.value);
74
+ return match ? [{ literal, sub: match[1] }] : [];
75
+ });
76
+ if (targets.length === 0) continue;
77
+ let next = text;
78
+ // Replace from the end, so the offsets of earlier literals stay valid.
79
+ for (const { literal, sub } of targets.reverse()) {
62
80
  let rel = relative(dirname(p), join(pluginDir, `${sub ?? 'index'}.js`)).replaceAll('\\', '/');
63
81
  if (!rel.startsWith('.')) rel = `./${rel}`;
64
- return `${prefix}'${rel}'`;
65
- });
82
+ next = `${next.slice(0, literal.start)}'${rel}'${next.slice(literal.end)}`;
83
+ }
66
84
  writeFileSync(p, next, 'utf8');
67
85
  count++;
68
86
  }
@@ -97,8 +115,12 @@ const bundled = await build({
97
115
  // root bundle's unrelated exports (hearsay-tools/cezarion#1813).
98
116
  const rootExports = new Set(Object.values(bundled.metafile.outputs).flatMap((output) => output.exports));
99
117
  for (const file of referrers.filter((name) => name.endsWith('.js'))) {
100
- for (const match of readFileSync(file, 'utf8').matchAll(/export\s+\*\s+from\s+['"](@open-mercato\/cezar-contract\/([^'"]+))['"]/g)) {
101
- const source = join(contractRoot, 'src', `${match[2]}.ts`);
118
+ const wildcards = [];
119
+ traverse(parse(readFileSync(file, 'utf8'), { sourceType: 'module' }), (node) => {
120
+ if (node.type === 'ExportAllDeclaration' && node.source.value.startsWith('@open-mercato/cezar-contract/')) wildcards.push(node.source.value);
121
+ });
122
+ for (const specifier of wildcards) {
123
+ const source = join(contractRoot, 'src', `${specifier.slice('@open-mercato/cezar-contract/'.length)}.ts`);
102
124
  const original = await build({
103
125
  entryPoints: [source], bundle: true, write: false, metafile: true,
104
126
  format: 'esm', platform: 'neutral', external: ['zod'],
@@ -106,7 +128,7 @@ for (const file of referrers.filter((name) => name.endsWith('.js'))) {
106
128
  const missing = Object.values(original.metafile.outputs).flatMap((output) => output.exports)
107
129
  .filter((name) => !rootExports.has(name));
108
130
  if (missing.length) {
109
- console.error(`inline-contract: ${relative(dist, file)} wildcard re-export of "${match[1]}" loses root exports: ${missing.join(', ')}`);
131
+ console.error(`inline-contract: ${relative(dist, file)} wildcard re-export of "${specifier}" loses root exports: ${missing.join(', ')}`);
110
132
  process.exit(1);
111
133
  }
112
134
  }
@@ -147,6 +169,7 @@ const gaps = importers.length === 0 ? [] : await build({
147
169
  if (gaps.length > 0) {
148
170
  for (const { text, location } of gaps) {
149
171
  const where = location ? `${join(basename(dist), location.file)}:${location.line}` : basename(dist);
172
+ // oxlint-disable-next-line cez/regex-module-syntax -- reads esbuild's error message text, not module source.
150
173
  const name = /import "([^"]+)"/i.exec(text)?.[1];
151
174
  const subpath = /"contract:([^"]+)"/.exec(text)?.[1];
152
175
  console.error(name && subpath