@hearsay-tools/squawk 0.18.0-dev.8318 → 0.18.0-dev.8321

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.
@@ -0,0 +1,509 @@
1
+ import type { Capabilities } from '../contract/index.js';
2
+ import type { Home } from '../home/home.ts';
3
+ import type { PreviewHost } from '../preview/host.ts';
4
+ import type { ForgeFactory } from './forge/index.ts';
5
+ import { type openInApp } from './open-in-app.ts';
6
+ import { type BranchForge } from './repo-branches.ts';
7
+ import type { ProjectApiEnv } from './server-types.ts';
8
+ export interface OpenTargetsRouteDeps {
9
+ capabilities: () => Capabilities;
10
+ openApp: typeof openInApp;
11
+ }
12
+ export declare function createOpenTargetsRoutes(deps: OpenTargetsRouteDeps): import("hono/hono-base").HonoBase<ProjectApiEnv, {
13
+ "/open-targets": {
14
+ $get: {
15
+ output: {
16
+ targets: {
17
+ id: string;
18
+ label: string;
19
+ icon?: string;
20
+ }[];
21
+ };
22
+ outputFormat: "json";
23
+ status: import("hono/utils/http-status").ContentfulStatusCode;
24
+ input: {};
25
+ };
26
+ };
27
+ } & {
28
+ "/open-in": {
29
+ $post: {
30
+ output: {
31
+ error: string;
32
+ };
33
+ outputFormat: "json";
34
+ status: 409;
35
+ input: {
36
+ json: {
37
+ target: string;
38
+ };
39
+ };
40
+ } | {
41
+ output: {
42
+ error: string;
43
+ };
44
+ outputFormat: "json";
45
+ status: 400;
46
+ input: {
47
+ json: {
48
+ target: string;
49
+ };
50
+ };
51
+ } | {
52
+ output: {
53
+ opened: true;
54
+ path: string;
55
+ };
56
+ outputFormat: "json";
57
+ status: import("hono/utils/http-status").ContentfulStatusCode;
58
+ input: {
59
+ json: {
60
+ target: string;
61
+ };
62
+ };
63
+ };
64
+ };
65
+ }, "/", "/open-in">;
66
+ export interface WorktreesRouteDeps {
67
+ home: Home;
68
+ previewHost?: PreviewHost | undefined;
69
+ }
70
+ export declare function createWorktreesRoutes(deps: WorktreesRouteDeps): import("hono/hono-base").HonoBase<ProjectApiEnv, {
71
+ "/worktrees": {
72
+ $get: {
73
+ output: {
74
+ worktrees: {
75
+ runId: string;
76
+ title: string;
77
+ status: "cancelled" | "done" | "failed" | "queued" | "review" | "running" | "waiting";
78
+ branch: string | null;
79
+ sizeBytes: number | null;
80
+ finishedAt: string | null;
81
+ reclaimable: boolean;
82
+ pastKeep: boolean;
83
+ }[];
84
+ totalBytes: number | null;
85
+ keep: number;
86
+ };
87
+ outputFormat: "json";
88
+ status: import("hono/utils/http-status").ContentfulStatusCode;
89
+ input: {};
90
+ };
91
+ };
92
+ } & {
93
+ "/worktrees/reclaim": {
94
+ $post: {
95
+ output: {
96
+ reclaimed: string[];
97
+ };
98
+ outputFormat: "json";
99
+ status: import("hono/utils/http-status").ContentfulStatusCode;
100
+ input: {
101
+ json: {
102
+ [x: string]: unknown;
103
+ };
104
+ };
105
+ };
106
+ };
107
+ } & {
108
+ "/worktrees/:runId/reclaim": {
109
+ $post: {
110
+ output: {
111
+ error: string;
112
+ code?: "invalid_input" | undefined;
113
+ };
114
+ outputFormat: "json";
115
+ status: 400;
116
+ input: {
117
+ param: {
118
+ runId: string;
119
+ };
120
+ };
121
+ } | {
122
+ output: {
123
+ error: string;
124
+ };
125
+ outputFormat: "json";
126
+ status: 404 | 409;
127
+ input: {
128
+ param: {
129
+ runId: string;
130
+ };
131
+ };
132
+ } | {
133
+ output: {
134
+ runId: string;
135
+ worktreeReclaimedAt: string;
136
+ };
137
+ outputFormat: "json";
138
+ status: import("hono/utils/http-status").ContentfulStatusCode;
139
+ input: {
140
+ param: {
141
+ runId: string;
142
+ };
143
+ };
144
+ };
145
+ };
146
+ }, "/", "/worktrees/:runId/reclaim">;
147
+ export interface RepoRouteDeps {
148
+ home: Home;
149
+ forgeFactory?: ForgeFactory | undefined;
150
+ branchForge?: BranchForge | undefined;
151
+ }
152
+ export declare function createRepoRoutes(deps: RepoRouteDeps): import("hono/hono-base").HonoBase<ProjectApiEnv, {
153
+ "/repo": {
154
+ $get: {
155
+ output: {
156
+ info: null;
157
+ status: never[];
158
+ log: never[];
159
+ branches: never[];
160
+ baseBranch: null;
161
+ tracking: null;
162
+ };
163
+ outputFormat: "json";
164
+ status: import("hono/utils/http-status").ContentfulStatusCode;
165
+ input: {};
166
+ } | {
167
+ output: {
168
+ info: {
169
+ root: string;
170
+ branch: string;
171
+ remote?: string | undefined;
172
+ };
173
+ status: {
174
+ status: string;
175
+ path: string;
176
+ }[];
177
+ log: ({
178
+ hash: string;
179
+ subject: string;
180
+ author: string;
181
+ when: string;
182
+ at: string;
183
+ } | {
184
+ hash: string;
185
+ subject: string;
186
+ author: string;
187
+ when: string;
188
+ at: string;
189
+ source: {
190
+ runId: string;
191
+ title: string;
192
+ prNumber: number | null;
193
+ };
194
+ })[];
195
+ branches: string[];
196
+ baseBranch: string | null;
197
+ tracking: {
198
+ ref: string;
199
+ ahead: number;
200
+ behind: number;
201
+ fetchedAt: string | null;
202
+ } | null;
203
+ };
204
+ outputFormat: "json";
205
+ status: import("hono/utils/http-status").ContentfulStatusCode;
206
+ input: {};
207
+ };
208
+ };
209
+ } & {
210
+ "/repo/branches": {
211
+ $get: {
212
+ output: {
213
+ base: string;
214
+ prStateKnown: boolean;
215
+ branches: {
216
+ name: string;
217
+ class: "active" | "empty" | "merged" | "not-landed" | "orphan" | "other";
218
+ runId: string | null;
219
+ title: string | null;
220
+ runStatus: "cancelled" | "done" | "failed" | "queued" | "review" | "running" | "waiting" | null;
221
+ ahead: number;
222
+ lastCommit: {
223
+ sha: string;
224
+ subject: string;
225
+ at: string;
226
+ };
227
+ diffStat: {
228
+ additions: number;
229
+ deletions: number;
230
+ } | null;
231
+ pr: {
232
+ number: number;
233
+ url: string;
234
+ state: "closed" | "draft" | "merged" | "open";
235
+ } | null;
236
+ keptReason?: string | undefined;
237
+ parentRunId?: string | undefined;
238
+ }[];
239
+ counts: {
240
+ notLanded: number;
241
+ cleanup: number;
242
+ };
243
+ };
244
+ outputFormat: "json";
245
+ status: import("hono/utils/http-status").ContentfulStatusCode;
246
+ input: {};
247
+ };
248
+ };
249
+ } & {
250
+ "/repo/branches/counts": {
251
+ $get: {
252
+ output: {
253
+ base: string;
254
+ prStateKnown: boolean;
255
+ counts: {
256
+ notLanded: number;
257
+ cleanup: number;
258
+ };
259
+ allBranches: number;
260
+ };
261
+ outputFormat: "json";
262
+ status: import("hono/utils/http-status").ContentfulStatusCode;
263
+ input: {};
264
+ };
265
+ };
266
+ } & {
267
+ "/repo/branches/delete": {
268
+ $post: {
269
+ output: {
270
+ error: string;
271
+ refused: {
272
+ name: string;
273
+ reason: string;
274
+ }[];
275
+ };
276
+ outputFormat: "json";
277
+ status: 409;
278
+ input: {
279
+ json: {
280
+ names: string[];
281
+ confirm?: string | undefined;
282
+ };
283
+ };
284
+ } | {
285
+ output: {
286
+ deleted: string[];
287
+ refused: {
288
+ name: string;
289
+ reason: string;
290
+ }[];
291
+ dropped?: {
292
+ sha: string;
293
+ subject: string;
294
+ }[] | undefined;
295
+ };
296
+ outputFormat: "json";
297
+ status: 200;
298
+ input: {
299
+ json: {
300
+ names: string[];
301
+ confirm?: string | undefined;
302
+ };
303
+ };
304
+ };
305
+ };
306
+ } & {
307
+ "/repo/diff": {
308
+ $get: {
309
+ output: string;
310
+ outputFormat: "text";
311
+ status: import("hono/utils/http-status").ContentfulStatusCode;
312
+ input: {};
313
+ };
314
+ };
315
+ } & {
316
+ "/repo/commit/:sha": {
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
+ } | {
331
+ output: {
332
+ error: string;
333
+ code?: "invalid_input" | undefined;
334
+ };
335
+ outputFormat: "json";
336
+ status: 400;
337
+ input: {
338
+ query: {
339
+ structured?: string | undefined;
340
+ };
341
+ } & {
342
+ param: {
343
+ sha: string;
344
+ };
345
+ };
346
+ } | {
347
+ output: {
348
+ error: string;
349
+ };
350
+ outputFormat: "json";
351
+ status: 409;
352
+ input: {
353
+ query: {
354
+ structured?: string | undefined;
355
+ };
356
+ } & {
357
+ param: {
358
+ sha: string;
359
+ };
360
+ };
361
+ } | {
362
+ output: {
363
+ sha: string;
364
+ subject: string;
365
+ author: string;
366
+ when: string;
367
+ files: {
368
+ path: string;
369
+ oldPath?: string;
370
+ status: 'added' | 'modified' | 'deleted' | 'renamed' | 'copied';
371
+ adds: number;
372
+ dels: number;
373
+ binary: boolean;
374
+ image?: boolean;
375
+ patch: string;
376
+ }[];
377
+ stat: {
378
+ adds: number;
379
+ dels: number;
380
+ files: number;
381
+ };
382
+ };
383
+ outputFormat: "json";
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
+ };
395
+ };
396
+ } & {
397
+ "/repo/changes": {
398
+ $get: {
399
+ output: {
400
+ error: string;
401
+ };
402
+ outputFormat: "json";
403
+ status: 409;
404
+ input: {};
405
+ } | {
406
+ output: {
407
+ files: {
408
+ path: string;
409
+ oldPath?: string;
410
+ status: 'added' | 'modified' | 'deleted' | 'renamed' | 'copied';
411
+ adds: number;
412
+ dels: number;
413
+ binary: boolean;
414
+ image?: boolean;
415
+ patch: string;
416
+ }[];
417
+ stat: {
418
+ adds: number;
419
+ dels: number;
420
+ files: number;
421
+ };
422
+ repointedHead?: {
423
+ headBranch: string;
424
+ taskBranch: string;
425
+ } | undefined;
426
+ };
427
+ outputFormat: "json";
428
+ status: import("hono/utils/http-status").ContentfulStatusCode;
429
+ input: {};
430
+ };
431
+ };
432
+ } & {
433
+ "/repo/pull": {
434
+ $get: {
435
+ output: {
436
+ error: string;
437
+ };
438
+ outputFormat: "json";
439
+ status: 409;
440
+ input: {};
441
+ } | {
442
+ output: {
443
+ branches: string[];
444
+ };
445
+ outputFormat: "json";
446
+ status: import("hono/utils/http-status").ContentfulStatusCode;
447
+ input: {};
448
+ };
449
+ };
450
+ } & {
451
+ "/repo/pull": {
452
+ $post: {
453
+ output: {
454
+ error: string;
455
+ };
456
+ outputFormat: "json";
457
+ status: 409;
458
+ input: {
459
+ json: {
460
+ branch?: string | undefined;
461
+ confirm?: boolean | undefined;
462
+ };
463
+ };
464
+ } | {
465
+ output: {
466
+ branch: string;
467
+ pulled: true;
468
+ summary: string;
469
+ };
470
+ outputFormat: "json";
471
+ status: 200;
472
+ input: {
473
+ json: {
474
+ branch?: string | undefined;
475
+ confirm?: boolean | undefined;
476
+ };
477
+ };
478
+ };
479
+ };
480
+ } & {
481
+ "/repo/branch": {
482
+ $post: {
483
+ output: {
484
+ error: string;
485
+ };
486
+ outputFormat: "json";
487
+ status: 409;
488
+ input: {
489
+ json: {
490
+ name: string;
491
+ from?: string | undefined;
492
+ };
493
+ };
494
+ } | {
495
+ output: {
496
+ branch: string;
497
+ created: boolean;
498
+ };
499
+ outputFormat: "json";
500
+ status: import("hono/utils/http-status").ContentfulStatusCode;
501
+ input: {
502
+ json: {
503
+ name: string;
504
+ from?: string | undefined;
505
+ };
506
+ };
507
+ };
508
+ };
509
+ }, "/", "/repo/branch">;