@hearsay-tools/squawk 0.18.0-pr4169.8039 → 0.18.0-pr4170.8048

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 (63) hide show
  1. package/dist/built-in-cli-commands.d.ts +3 -0
  2. package/dist/built-in-cli-commands.js +152 -0
  3. package/dist/built-in-cli-commands.js.map +1 -0
  4. package/dist/built-in-tool-definitions.d.ts +4 -0
  5. package/dist/built-in-tool-definitions.js +61 -0
  6. package/dist/built-in-tool-definitions.js.map +1 -0
  7. package/dist/built-in-tools.d.ts +3 -0
  8. package/dist/built-in-tools.js +9 -0
  9. package/dist/built-in-tools.js.map +1 -0
  10. package/dist/ci-wait/client.d.ts +75 -0
  11. package/dist/ci-wait/client.js +44 -13
  12. package/dist/ci-wait/client.js.map +1 -1
  13. package/dist/ci-wait/controller.d.ts +57 -1153
  14. package/dist/ci-wait/controller.js +56 -175
  15. package/dist/ci-wait/controller.js.map +1 -1
  16. package/dist/ci-wait/mcp.d.ts +1 -1
  17. package/dist/ci-wait/mcp.js +7 -5
  18. package/dist/ci-wait/mcp.js.map +1 -1
  19. package/dist/ci-wait/tool-catalog.d.ts +6 -528
  20. package/dist/ci-wait/tool-catalog.js +3 -7
  21. package/dist/ci-wait/tool-catalog.js.map +1 -1
  22. package/dist/ci-wait/tool-names.d.ts +1 -8
  23. package/dist/ci-wait/tool-names.js +8 -16
  24. package/dist/ci-wait/tool-names.js.map +1 -1
  25. package/dist/ci-wait/tool-registry.d.ts +64 -0
  26. package/dist/ci-wait/tool-registry.js +32 -0
  27. package/dist/ci-wait/tool-registry.js.map +1 -0
  28. package/dist/ci-wait/tools.d.ts +452 -8
  29. package/dist/ci-wait/tools.js +40 -28
  30. package/dist/ci-wait/tools.js.map +1 -1
  31. package/dist/cli-dispatch.js +13 -73
  32. package/dist/cli-dispatch.js.map +1 -1
  33. package/dist/contract/agent-tools.d.ts +51 -0
  34. package/dist/contract/index.d.ts +1 -0
  35. package/dist/contract/index.js +21 -0
  36. package/dist/core/cli-registry.d.ts +50 -0
  37. package/dist/core/cli-registry.js +13 -0
  38. package/dist/core/cli-registry.js.map +1 -0
  39. package/dist/home/backup-args.d.ts +18 -0
  40. package/dist/home/backup-args.js +35 -0
  41. package/dist/home/backup-args.js.map +1 -0
  42. package/dist/home/entry.js +9 -6
  43. package/dist/home/entry.js.map +1 -1
  44. package/dist/index.js +3 -0
  45. package/dist/index.js.map +1 -1
  46. package/dist/runs/run-archive.d.ts +72 -72
  47. package/dist/runs/run-exits.d.ts +336 -336
  48. package/dist/server/server.d.ts +176 -176
  49. package/dist/server/workspace-live-routes.d.ts +6 -6
  50. package/dist/subcommands.d.ts +2 -10
  51. package/dist/subcommands.js +14 -62
  52. package/dist/subcommands.js.map +1 -1
  53. package/dist/workflows/continuation-admission.d.ts +72 -72
  54. package/dist/workspace/backups.d.ts +1 -18
  55. package/dist/workspace/backups.js +2 -34
  56. package/dist/workspace/backups.js.map +1 -1
  57. package/package.json +4 -4
  58. package/scripts/benchmark-runtime.ts +3 -0
  59. package/scripts/measure-transcript-facts-health.mjs +3 -0
  60. package/scripts/mock-ci-tool.mjs +1 -1
  61. package/scripts/mock-wire-tools.mjs +4 -1
  62. package/scripts/omp-ci-wait.mjs +4 -14
  63. package/scripts/pi-ci-wait.mjs +3 -13
@@ -1,3 +1,4 @@
1
+ import { type AgentToolDefinition } from './tool-registry.ts';
1
2
  import { type AutomationToolRequest, type AutomationToolAnswer } from '../contract/index.js';
2
3
  export { ToolsUnavailableError } from './errors.ts';
3
4
  import { type ScheduleTaskAnswer, type ScheduleTaskRequest, type ScheduledTasksAnswer, type ScheduledTasksRequest } from '../contract/index.js';
@@ -24,6 +25,7 @@ type PreviewRegistration = (request: PreviewServeRequest, signal: AbortSignal) =
24
25
  type PreviewStop = (request: PreviewStopRequest, signal: AbortSignal) => Promise<PreviewStopResult>;
25
26
  /** The session's trusted callbacks: run identity comes from here, never from the model's arguments. */
26
27
  export type SquawkToolHandlers = {
28
+ tools?: Record<string, (input: unknown, signal: AbortSignal) => Promise<unknown>>;
27
29
  /** `via` names the tool that opened the wait. */
28
30
  registerWait: (request: SquawkWaitRequestInput, via: WaitVia, signal: AbortSignal) => Promise<WaitRegistration>;
29
31
  /** `cezar_ask` (hearsay-tools/cezarion#1234): opens the run's human wait with its card. */
@@ -41,6 +43,7 @@ export type SquawkToolHandlers = {
41
43
  };
42
44
  type Capability = SquawkToolHandlers & {
43
45
  lifetime: AbortController;
46
+ env: NodeJS.ProcessEnv;
44
47
  };
45
48
  export type CiToolSession = {
46
49
  descriptor: NonNullable<AgentRunSpec['squawkTools']>;
@@ -60,1211 +63,112 @@ export declare class CiToolController {
60
63
  provision(handlers: SquawkToolHandlers): CiToolSession;
61
64
  close(): Promise<void>;
62
65
  }
63
- /**
64
- * Typed private route inventory: GET ci-wait holds adapter lifetime (the path is historical; its POST
65
- * went with `cezar_wait_for_ci` in hearsay-tools/cezarion#1236); POST wait opens a CI, worker or
66
- * timer wait and POST cancel-wait closes one (hearsay-tools/cezarion#1233); POST ask opens the human
67
- * wait and POST done finishes the task at the turn's end (hearsay-tools/cezarion#1234); POST
68
- * preview-serve registers a dev server (#781); preview-stop controls its approved process (#803);
69
- * POST schedule-task and scheduled-tasks create and manage one-time schedules (hearsay-tools/cezarion#1465).
70
- */
66
+ /** The private IPC catalog and registered dispatch share the capability boundary. */
71
67
  export declare function ciToolRoutes(capabilities: Map<string, Capability>): import("hono/hono-base").HonoBase<{
72
68
  Variables: {
73
69
  capability: Capability;
70
+ tool: AgentToolDefinition;
74
71
  };
75
72
  } & {
76
73
  Variables: {
77
74
  capability: Capability;
75
+ tool: AgentToolDefinition;
78
76
  };
79
77
  }, {
80
- "/api/v1/tools/ci-wait": {
78
+ "/api/v1/tools": {
81
79
  $get: {
82
- output: {};
83
- outputFormat: string;
84
- status: import("hono/utils/http-status").StatusCode;
85
- input: {};
86
- };
87
- };
88
- } & {
89
- "/api/v1/tools/wait": {
90
- $post: {
91
80
  output: {
92
- code: 'capability_revoked';
93
- message: string;
94
- };
95
- outputFormat: "json";
96
- status: 401;
97
- input: {
98
- json: {
99
- pr: string;
100
- until?: "checks" | "merge" | "merge_or_blocked" | undefined;
101
- wake_on_conflict?: boolean | undefined;
102
- timeout_seconds?: number | undefined;
103
- head_sha?: string | undefined;
104
- operation_id?: string | undefined;
105
- kind: "pr";
106
- } | {
107
- operation_id?: string | undefined;
108
- kind: "worker";
109
- worker_ids: string[];
110
- mode?: "all" | "any" | "one" | undefined;
111
- timeout_seconds?: number | undefined;
112
- } | {
113
- operation_id?: string | undefined;
114
- kind: "request";
115
- request_ids: string[];
116
- mode?: "all" | "any" | "one" | undefined;
117
- timeout_seconds?: number | undefined;
118
- } | {
119
- operation_id?: string | undefined;
120
- kind: "peer";
121
- peer_ids: string[];
122
- timeout_seconds?: number | undefined;
123
- } | {
124
- operation_id?: string | undefined;
125
- kind: "timer";
126
- seconds: number;
127
- note?: string | undefined;
128
- } | {
129
- operation_id?: string | undefined;
130
- kind: "process";
131
- pid: number;
132
- exit_file?: string | undefined;
133
- timeout_seconds?: number | undefined;
134
- note?: string | undefined;
135
- } | {
136
- [x: string]: unknown;
137
- operation_id?: string | undefined;
138
- kind: string;
139
- };
140
- };
141
- } | {
142
- output: {
143
- operation_id?: string | undefined;
144
- ok: true;
145
- effect?: "applied" | "unchanged" | undefined;
146
- deduplicated?: boolean | undefined;
147
- replayed?: boolean | undefined;
148
- wait_phase?: "cancelled" | "delivered" | "open" | "resolved" | "unavailable" | undefined;
149
- wait_id: string;
150
- kind: string;
151
- deadline?: string | undefined;
152
- open_waits: ({
153
- wait_id: string;
154
- summary: string;
155
- kind: "peer" | "pr" | "process" | "subagent" | "timer" | "worker";
156
- deadline: string;
157
- } | {
158
- wait_id: string;
159
- summary: string;
160
- kind: "human";
161
- } | {
162
- wait_id: string;
163
- summary: string;
164
- kind: "plugin";
165
- pluginKind: string;
166
- deadline?: string | undefined;
167
- })[];
168
- } | {
169
- operation_id?: string | undefined;
170
- ok: false;
171
- effect?: "refused" | "unknown" | undefined;
172
- retained_wait?: {
173
- wait_id: string;
174
- summary: string;
175
- kind: "peer" | "pr" | "process" | "subagent" | "timer" | "worker";
176
- deadline: string;
177
- } | {
178
- wait_id: string;
179
- summary: string;
180
- kind: "human";
181
- } | {
182
- wait_id: string;
183
- summary: string;
184
- kind: "plugin";
185
- pluginKind: string;
186
- deadline?: string | undefined;
187
- } | undefined;
188
- code: "authentication" | "capability_revoked" | "capacity" | "command_failed" | "denied_scope" | "duplicate_deadline" | "exit_file_outside" | "finish_requested" | "generation_mismatch" | "gh_missing" | "inaccessible_pr" | "invalid_request" | "malformed_data" | "manager_disposed" | "messaging_off" | "operation_conflict" | "outcome_unknown" | "output_limit" | "persistence" | "process_not_allowed" | "process_not_owned" | "query_timeout" | "registration_aborted" | "root_finish_pending" | "run_cancelled" | "run_missing" | "run_not_running" | "run_stopping" | "session_closed" | "session_replaced" | "timers_disabled" | "turn_changed" | "unauthorized" | "unavailable" | "unsupported_host" | "wait_conflict" | "wake_budget_spent" | "worker_execution_stopped" | "worker_wait_pending";
189
- message: string;
190
- open_waits?: ({
191
- wait_id: string;
192
- summary: string;
193
- kind: "peer" | "pr" | "process" | "subagent" | "timer" | "worker";
194
- deadline: string;
195
- } | {
196
- wait_id: string;
197
- summary: string;
198
- kind: "human";
199
- } | {
200
- wait_id: string;
201
- summary: string;
202
- kind: "plugin";
203
- pluginKind: string;
204
- deadline?: string | undefined;
205
- })[] | undefined;
206
- };
207
- outputFormat: "json";
208
- status: import("hono/utils/http-status").ContentfulStatusCode;
209
- input: {
210
- json: {
211
- pr: string;
212
- until?: "checks" | "merge" | "merge_or_blocked" | undefined;
213
- wake_on_conflict?: boolean | undefined;
214
- timeout_seconds?: number | undefined;
215
- head_sha?: string | undefined;
216
- operation_id?: string | undefined;
217
- kind: "pr";
218
- } | {
219
- operation_id?: string | undefined;
220
- kind: "worker";
221
- worker_ids: string[];
222
- mode?: "all" | "any" | "one" | undefined;
223
- timeout_seconds?: number | undefined;
224
- } | {
225
- operation_id?: string | undefined;
226
- kind: "request";
227
- request_ids: string[];
228
- mode?: "all" | "any" | "one" | undefined;
229
- timeout_seconds?: number | undefined;
230
- } | {
231
- operation_id?: string | undefined;
232
- kind: "peer";
233
- peer_ids: string[];
234
- timeout_seconds?: number | undefined;
235
- } | {
236
- operation_id?: string | undefined;
237
- kind: "timer";
238
- seconds: number;
239
- note?: string | undefined;
240
- } | {
241
- operation_id?: string | undefined;
242
- kind: "process";
243
- pid: number;
244
- exit_file?: string | undefined;
245
- timeout_seconds?: number | undefined;
246
- note?: string | undefined;
247
- } | {
248
- [x: string]: unknown;
249
- operation_id?: string | undefined;
250
- kind: string;
251
- };
252
- };
253
- } | {
254
- output: {
255
- ok: false;
256
- effect: 'refused';
257
- code: "authentication" | "capability_revoked" | "capacity" | "command_failed" | "finish_requested" | "generation_mismatch" | "gh_missing" | "inaccessible_pr" | "invalid_request" | "malformed_data" | "manager_disposed" | "output_limit" | "persistence" | "query_timeout" | "registration_aborted" | "root_finish_pending" | "run_cancelled" | "run_missing" | "run_not_running" | "run_stopping" | "session_closed" | "session_replaced" | "turn_changed" | "unauthorized" | "unavailable" | "unsupported_host" | "wait_conflict" | "worker_execution_stopped" | "worker_wait_pending";
258
- message: string;
259
- operation_id: string | undefined;
260
- } | {
261
- ok: false;
262
- effect: 'unknown';
263
- code: 'outcome_unknown';
264
- message: string;
265
- operation_id: string | undefined;
266
- };
267
- outputFormat: "json";
268
- status: import("hono/utils/http-status").ContentfulStatusCode;
269
- input: {
270
- json: {
271
- pr: string;
272
- until?: "checks" | "merge" | "merge_or_blocked" | undefined;
273
- wake_on_conflict?: boolean | undefined;
274
- timeout_seconds?: number | undefined;
275
- head_sha?: string | undefined;
276
- operation_id?: string | undefined;
277
- kind: "pr";
278
- } | {
279
- operation_id?: string | undefined;
280
- kind: "worker";
281
- worker_ids: string[];
282
- mode?: "all" | "any" | "one" | undefined;
283
- timeout_seconds?: number | undefined;
284
- } | {
285
- operation_id?: string | undefined;
286
- kind: "request";
287
- request_ids: string[];
288
- mode?: "all" | "any" | "one" | undefined;
289
- timeout_seconds?: number | undefined;
290
- } | {
291
- operation_id?: string | undefined;
292
- kind: "peer";
293
- peer_ids: string[];
294
- timeout_seconds?: number | undefined;
295
- } | {
296
- operation_id?: string | undefined;
297
- kind: "timer";
298
- seconds: number;
299
- note?: string | undefined;
300
- } | {
301
- operation_id?: string | undefined;
302
- kind: "process";
303
- pid: number;
304
- exit_file?: string | undefined;
305
- timeout_seconds?: number | undefined;
306
- note?: string | undefined;
307
- } | {
308
- [x: string]: unknown;
309
- operation_id?: string | undefined;
310
- kind: string;
311
- };
312
- };
313
- };
314
- };
315
- } & {
316
- "/api/v1/tools/ask": {
317
- $post: {
318
- output: {
319
- ok: false;
320
- code: 'unavailable';
321
- message: string;
322
- };
323
- outputFormat: "json";
324
- status: import("hono/utils/http-status").ContentfulStatusCode;
325
- input: {
326
- json: {
327
- questions: {
328
- id?: string | undefined;
329
- header: string;
330
- question: string;
331
- options?: {
332
- label: string;
333
- description?: string | undefined;
334
- }[] | undefined;
335
- multiSelect?: boolean | undefined;
336
- allowFreeText?: boolean | undefined;
337
- }[];
338
- context: string;
339
- };
340
- };
341
- } | {
342
- output: {
343
- code: 'capability_revoked';
344
- message: string;
345
- };
346
- outputFormat: "json";
347
- status: 401;
348
- input: {
349
- json: {
350
- questions: {
351
- id?: string | undefined;
352
- header: string;
353
- question: string;
354
- options?: {
355
- label: string;
356
- description?: string | undefined;
357
- }[] | undefined;
358
- multiSelect?: boolean | undefined;
359
- allowFreeText?: boolean | undefined;
360
- }[];
361
- context: string;
362
- };
363
- };
364
- } | {
365
- output: {
366
- ok: true;
367
- wait_id: string;
368
- open_waits: ({
369
- wait_id: string;
370
- summary: string;
371
- kind: "peer" | "pr" | "process" | "subagent" | "timer" | "worker";
372
- deadline: string;
373
- } | {
374
- wait_id: string;
375
- summary: string;
376
- kind: "human";
377
- } | {
378
- wait_id: string;
379
- summary: string;
380
- kind: "plugin";
381
- pluginKind: string;
382
- deadline?: string | undefined;
383
- })[];
384
- } | {
385
- ok: false;
386
- code: "autonomous_run" | "capability_revoked" | "capacity" | "finish_requested" | "generation_mismatch" | "invalid_request" | "manager_disposed" | "persistence" | "root_finish_pending" | "run_cancelled" | "run_missing" | "run_not_running" | "run_stopping" | "session_closed" | "session_replaced" | "supervisor_is_worker" | "unauthorized" | "unavailable" | "worker_execution_stopped" | "worker_wait_pending";
387
- message: string;
388
- open_waits?: ({
389
- wait_id: string;
390
- summary: string;
391
- kind: "peer" | "pr" | "process" | "subagent" | "timer" | "worker";
392
- deadline: string;
393
- } | {
394
- wait_id: string;
395
- summary: string;
396
- kind: "human";
397
- } | {
398
- wait_id: string;
399
- summary: string;
400
- kind: "plugin";
401
- pluginKind: string;
402
- deadline?: string | undefined;
403
- })[] | undefined;
404
- };
405
- outputFormat: "json";
406
- status: import("hono/utils/http-status").ContentfulStatusCode;
407
- input: {
408
- json: {
409
- questions: {
410
- id?: string | undefined;
411
- header: string;
412
- question: string;
413
- options?: {
414
- label: string;
415
- description?: string | undefined;
416
- }[] | undefined;
417
- multiSelect?: boolean | undefined;
418
- allowFreeText?: boolean | undefined;
419
- }[];
420
- context: string;
421
- };
422
- };
423
- };
424
- };
425
- } & {
426
- "/api/v1/tools/cancel-wait": {
427
- $post: {
428
- output: {
429
- cancelled: false;
430
- code: 'unavailable';
431
- message: string;
432
- };
433
- outputFormat: "json";
434
- status: import("hono/utils/http-status").ContentfulStatusCode;
435
- input: {
436
- json: {
437
- wait_id: string;
438
- };
439
- };
440
- } | {
441
- output: {
442
- code: 'capability_revoked';
443
- message: string;
444
- };
445
- outputFormat: "json";
446
- status: 401;
447
- input: {
448
- json: {
449
- wait_id: string;
450
- };
451
- };
452
- } | {
453
- output: {
454
- cancelled: true;
455
- wait_id: string;
456
- open_waits: ({
457
- wait_id: string;
458
- summary: string;
459
- kind: "peer" | "pr" | "process" | "subagent" | "timer" | "worker";
460
- deadline: string;
461
- } | {
462
- wait_id: string;
463
- summary: string;
464
- kind: "human";
465
- } | {
466
- wait_id: string;
467
- summary: string;
468
- kind: "plugin";
469
- pluginKind: string;
470
- deadline?: string | undefined;
471
- })[];
472
- } | {
473
- cancelled: false;
474
- code: "already_resolved" | "human_question" | "invalid_request" | "not_found" | "unavailable";
475
- message: string;
476
- open_waits?: ({
477
- wait_id: string;
478
- summary: string;
479
- kind: "peer" | "pr" | "process" | "subagent" | "timer" | "worker";
480
- deadline: string;
481
- } | {
482
- wait_id: string;
483
- summary: string;
484
- kind: "human";
485
- } | {
486
- wait_id: string;
487
- summary: string;
488
- kind: "plugin";
489
- pluginKind: string;
490
- deadline?: string | undefined;
491
- })[] | undefined;
492
- };
493
- outputFormat: "json";
494
- status: import("hono/utils/http-status").ContentfulStatusCode;
495
- input: {
496
- json: {
497
- wait_id: string;
498
- };
499
- };
500
- };
501
- };
502
- } & {
503
- "/api/v1/tools/done": {
504
- $post: {
505
- output: {
506
- ok: false;
507
- code: 'unavailable';
508
- message: string;
509
- };
510
- outputFormat: "json";
511
- status: import("hono/utils/http-status").ContentfulStatusCode;
512
- input: {
513
- json: {
514
- summary?: string | undefined;
515
- };
516
- };
517
- } | {
518
- output: {
519
- code: 'capability_revoked';
520
- message: string;
521
- };
522
- outputFormat: "json";
523
- status: 401;
524
- input: {
525
- json: {
526
- summary?: string | undefined;
527
- };
528
- };
529
- } | {
530
- output: {
531
- ok: true;
532
- finishes: "at_turn_end";
533
- open_waits: ({
534
- wait_id: string;
535
- summary: string;
536
- kind: "peer" | "pr" | "process" | "subagent" | "timer" | "worker";
537
- deadline: string;
538
- } | {
539
- wait_id: string;
540
- summary: string;
541
- kind: "human";
542
- } | {
543
- wait_id: string;
544
- summary: string;
545
- kind: "plugin";
546
- pluginKind: string;
547
- deadline?: string | undefined;
548
- })[];
549
- completes: "task";
550
- } | {
551
- ok: true;
552
- finishes: "at_turn_end";
553
- open_waits: ({
554
- wait_id: string;
555
- summary: string;
556
- kind: "peer" | "pr" | "process" | "subagent" | "timer" | "worker";
557
- deadline: string;
558
- } | {
559
- wait_id: string;
560
- summary: string;
561
- kind: "human";
562
- } | {
563
- wait_id: string;
564
- summary: string;
565
- kind: "plugin";
566
- pluginKind: string;
567
- deadline?: string | undefined;
568
- })[];
569
- completes: "step";
570
- next_step: string;
571
- } | {
572
- ok: false;
573
- code: "capability_revoked" | "finish_requested" | "generation_mismatch" | "human_question_pending" | "input_pending" | "invalid_request" | "manager_disposed" | "not_final_step" | "requests_outstanding" | "requests_unanswered" | "root_finish_pending" | "run_cancelled" | "run_missing" | "run_not_running" | "run_stopping" | "session_closed" | "session_replaced" | "unavailable" | "worker_questions" | "worker_wait_pending" | "workers_outstanding" | "workers_uncollected";
574
- message: string;
575
- workers?: {
576
- worker_id: string;
577
- reason: "outstanding" | "question" | "uncollected";
578
- }[] | undefined;
579
- open_waits?: ({
580
- wait_id: string;
581
- summary: string;
582
- kind: "peer" | "pr" | "process" | "subagent" | "timer" | "worker";
583
- deadline: string;
584
- } | {
585
- wait_id: string;
586
- summary: string;
587
- kind: "human";
588
- } | {
589
- wait_id: string;
590
- summary: string;
591
- kind: "plugin";
592
- pluginKind: string;
593
- deadline?: string | undefined;
594
- })[] | undefined;
595
- owed?: ({
596
- kind: "wait_result";
597
- wait_id: string;
598
- wait_kind: string;
599
- } | {
600
- kind: "queued";
601
- input_id?: string | undefined;
602
- source: string;
603
- } | {
604
- kind: "in_flight";
605
- input_id: string;
606
- } | {
607
- kind: "unread";
608
- input_id: string;
609
- })[] | undefined;
610
- };
611
- outputFormat: "json";
612
- status: import("hono/utils/http-status").ContentfulStatusCode;
613
- input: {
614
- json: {
615
- summary?: string | undefined;
616
- };
617
- };
618
- };
619
- };
620
- } & {
621
- "/api/v1/tools/preview-stop": {
622
- $post: {
623
- output: {
624
- ok: boolean;
625
- code: "adopted" | "approval_required" | "headless" | "invalid_input" | "not_registered" | "port_held" | "port_in_use" | "preview_disabled" | "restarted" | "stopped" | "unavailable" | "worktree_missing";
626
- message: string;
627
- hint: string;
81
+ tools: {
82
+ name: string;
83
+ description: string;
84
+ inputSchema: {
85
+ [x: string]: import("hono/utils/types").JSONValue;
86
+ type: 'object';
87
+ properties?: {
88
+ [x: string]: import("hono/utils/types").JSONValue;
89
+ } | undefined;
90
+ };
91
+ trigger: string;
92
+ label: string;
93
+ timeoutMs: number;
94
+ unavailable: {
95
+ content: {
96
+ type: 'text';
97
+ text: string;
98
+ }[];
99
+ isError?: boolean | undefined;
100
+ details: import("hono/utils/types").JSONValue;
101
+ };
102
+ }[];
103
+ instructions: string;
628
104
  };
629
105
  outputFormat: "json";
630
106
  status: import("hono/utils/http-status").ContentfulStatusCode;
631
- input: {
632
- json: {
633
- port: number;
634
- restart?: boolean | undefined;
635
- };
636
- };
637
- } | {
638
- output: {
639
- code: 'capability_revoked';
640
- message: string;
641
- };
642
- outputFormat: "json";
643
- status: 401;
644
- input: {
645
- json: {
646
- port: number;
647
- restart?: boolean | undefined;
648
- };
649
- };
107
+ input: {};
650
108
  };
651
109
  };
652
110
  } & {
653
- "/api/v1/tools/preview-serve": {
654
- $post: {
655
- output: {
656
- ok: boolean;
657
- code: "cezar_port" | "cwd_outside_worktree" | "headless" | "invalid_input" | "port_held" | "preview_disabled" | "registered" | "replaced" | "too_many" | "unavailable" | "worktree_missing";
658
- message: string;
659
- hint: string;
660
- };
661
- outputFormat: "json";
662
- status: import("hono/utils/http-status").ContentfulStatusCode;
663
- input: {
664
- json: {
665
- command: string;
666
- port: number;
667
- cwd?: string | undefined;
668
- label?: string | undefined;
669
- path?: string | undefined;
670
- };
671
- };
672
- } | {
673
- output: {
674
- code: 'capability_revoked';
675
- message: string;
676
- };
677
- outputFormat: "json";
678
- status: 401;
679
- input: {
680
- json: {
681
- command: string;
682
- port: number;
683
- cwd?: string | undefined;
684
- label?: string | undefined;
685
- path?: string | undefined;
686
- };
687
- };
111
+ "/api/v1/tools/ci-wait": {
112
+ $get: {
113
+ output: {};
114
+ outputFormat: string;
115
+ status: import("hono/utils/http-status").StatusCode;
116
+ input: {};
688
117
  };
689
118
  };
690
119
  } & {
691
- "/api/v1/tools/automation": {
120
+ "/api/v1/tools/:name": {
692
121
  $post: {
693
- output: {
694
- ok: false;
695
- code: import('../contract/index.js').ScheduledTaskRefusalCode;
696
- message: string;
697
- };
122
+ output: never;
698
123
  outputFormat: "json";
699
124
  status: import("hono/utils/http-status").ContentfulStatusCode;
700
125
  input: {
701
- json: {
702
- action: "create";
703
- definition: {
704
- name: string;
705
- description?: string | undefined;
706
- kind?: "github" | "schedule" | undefined;
707
- events?: ("issue.labeled" | "issue.opened" | "issue.unlabeled" | "pull_request.opened")[] | undefined;
708
- intervalSeconds?: number | undefined;
709
- filters?: {
710
- [x: string]: unknown;
711
- includeExisting?: boolean | undefined;
712
- requireCurrentLabels?: boolean | undefined;
713
- authors?: string[] | undefined;
714
- assignees?: string[] | undefined;
715
- allLabels?: string[] | undefined;
716
- anyLabels?: string[] | undefined;
717
- excludeLabels?: string[] | undefined;
718
- changedLabels?: string[] | undefined;
719
- lookbackDays?: number | undefined;
720
- maxRecords?: number | undefined;
721
- } | undefined;
722
- schedule?: {
723
- type: "daily" | "hours" | "once" | "weekdays" | "weekly";
724
- hour?: number | undefined;
725
- minute?: number | undefined;
726
- day?: number | undefined;
727
- every?: 1 | 2 | 3 | 4 | 6 | 8 | 12 | undefined;
728
- at?: string | undefined;
729
- timeZone?: string | undefined;
730
- latestStartMinutes?: number | undefined;
731
- } | undefined;
732
- task: {
733
- archiveWhenDone?: boolean | undefined;
734
- autoMergePr?: boolean | undefined;
735
- allowWorkers?: boolean | undefined;
736
- allowMessaging?: boolean | undefined;
737
- prompt: string;
738
- workflow?: string | undefined;
739
- steps?: {
740
- id: string;
741
- name?: string | undefined;
742
- prompt?: string | undefined;
743
- skill?: string | undefined;
744
- model?: string | undefined;
745
- effort?: string | undefined;
746
- timeoutMs?: number | undefined;
747
- runner?: string | undefined;
748
- agentProfile?: string | undefined;
749
- allowedTools?: string[] | undefined;
750
- bashAllowlist?: string[] | undefined;
751
- kind?: "plugin" | undefined;
752
- pluginKind?: string | undefined;
753
- config?: Record<string, unknown> | undefined;
754
- command?: string | undefined;
755
- onFail?: {
756
- retry: string;
757
- max?: number | undefined;
758
- } | undefined;
759
- }[] | undefined;
760
- runner?: string | undefined;
761
- model?: string | undefined;
762
- effort?: string | undefined;
763
- worktree?: boolean | undefined;
764
- autonomous?: boolean | undefined;
765
- systemPrompt?: string | undefined;
766
- };
767
- };
768
- } | {
769
- action: "show";
770
- id: string;
771
- } | {
772
- action: "preview";
773
- id: string;
774
- } | {
775
- action: "enable";
776
- id: string;
777
- explicit?: boolean | undefined;
778
- };
779
- };
780
- } | {
781
- output: {
782
- code: 'capability_revoked';
783
- message: string;
784
- };
785
- outputFormat: "json";
786
- status: 401;
787
- input: {
788
- json: {
789
- action: "create";
790
- definition: {
791
- name: string;
792
- description?: string | undefined;
793
- kind?: "github" | "schedule" | undefined;
794
- events?: ("issue.labeled" | "issue.opened" | "issue.unlabeled" | "pull_request.opened")[] | undefined;
795
- intervalSeconds?: number | undefined;
796
- filters?: {
797
- [x: string]: unknown;
798
- includeExisting?: boolean | undefined;
799
- requireCurrentLabels?: boolean | undefined;
800
- authors?: string[] | undefined;
801
- assignees?: string[] | undefined;
802
- allLabels?: string[] | undefined;
803
- anyLabels?: string[] | undefined;
804
- excludeLabels?: string[] | undefined;
805
- changedLabels?: string[] | undefined;
806
- lookbackDays?: number | undefined;
807
- maxRecords?: number | undefined;
808
- } | undefined;
809
- schedule?: {
810
- type: "daily" | "hours" | "once" | "weekdays" | "weekly";
811
- hour?: number | undefined;
812
- minute?: number | undefined;
813
- day?: number | undefined;
814
- every?: 1 | 2 | 3 | 4 | 6 | 8 | 12 | undefined;
815
- at?: string | undefined;
816
- timeZone?: string | undefined;
817
- latestStartMinutes?: number | undefined;
818
- } | undefined;
819
- task: {
820
- archiveWhenDone?: boolean | undefined;
821
- autoMergePr?: boolean | undefined;
822
- allowWorkers?: boolean | undefined;
823
- allowMessaging?: boolean | undefined;
824
- prompt: string;
825
- workflow?: string | undefined;
826
- steps?: {
827
- id: string;
828
- name?: string | undefined;
829
- prompt?: string | undefined;
830
- skill?: string | undefined;
831
- model?: string | undefined;
832
- effort?: string | undefined;
833
- timeoutMs?: number | undefined;
834
- runner?: string | undefined;
835
- agentProfile?: string | undefined;
836
- allowedTools?: string[] | undefined;
837
- bashAllowlist?: string[] | undefined;
838
- kind?: "plugin" | undefined;
839
- pluginKind?: string | undefined;
840
- config?: Record<string, unknown> | undefined;
841
- command?: string | undefined;
842
- onFail?: {
843
- retry: string;
844
- max?: number | undefined;
845
- } | undefined;
846
- }[] | undefined;
847
- runner?: string | undefined;
848
- model?: string | undefined;
849
- effort?: string | undefined;
850
- worktree?: boolean | undefined;
851
- autonomous?: boolean | undefined;
852
- systemPrompt?: string | undefined;
853
- };
854
- };
855
- } | {
856
- action: "show";
857
- id: string;
858
- } | {
859
- action: "preview";
860
- id: string;
861
- } | {
862
- action: "enable";
863
- id: string;
864
- explicit?: boolean | undefined;
865
- };
866
- };
867
- } | {
868
- output: {
869
- ok: true;
870
- automation: {
871
- [x: string]: import("hono/utils/types").JSONValue;
872
- id: string;
873
- revision: number;
126
+ json: unknown;
127
+ } & {
128
+ param: {
874
129
  name: string;
875
- description?: string | undefined;
876
- enabled: boolean;
877
- kind: "github" | "schedule";
878
- events?: ("issue.labeled" | "issue.opened" | "issue.unlabeled" | "pull_request.opened")[] | undefined;
879
- intervalSeconds?: number | undefined;
880
- filters?: {
881
- [x: string]: import("hono/utils/types").JSONValue;
882
- includeExisting?: boolean | undefined;
883
- requireCurrentLabels?: boolean | undefined;
884
- authors?: string[] | undefined;
885
- assignees?: string[] | undefined;
886
- allLabels?: string[] | undefined;
887
- anyLabels?: string[] | undefined;
888
- excludeLabels?: string[] | undefined;
889
- changedLabels?: string[] | undefined;
890
- lookbackDays: number;
891
- maxRecords: number;
892
- } | undefined;
893
- schedule?: {
894
- [x: string]: import("hono/utils/types").JSONValue;
895
- type: "daily" | "hours" | "once" | "weekdays" | "weekly";
896
- hour?: number | undefined;
897
- minute?: number | undefined;
898
- day?: number | undefined;
899
- every?: 1 | 2 | 3 | 4 | 6 | 8 | 12 | undefined;
900
- at?: string | undefined;
901
- timeZone?: string | undefined;
902
- latestStartMinutes?: number | undefined;
903
- } | undefined;
904
- task: {
905
- [x: string]: import("hono/utils/types").JSONValue;
906
- archiveWhenDone?: boolean | undefined;
907
- autoMergePr?: boolean | undefined;
908
- allowWorkers?: boolean | undefined;
909
- allowMessaging?: boolean | undefined;
910
- prompt: string;
911
- workflow?: string | undefined;
912
- steps?: {
913
- id: string;
914
- name?: string | undefined;
915
- prompt?: string | undefined;
916
- skill?: string | undefined;
917
- model?: string | undefined;
918
- effort?: string | undefined;
919
- timeoutMs?: number | undefined;
920
- runner?: string | undefined;
921
- agentProfile?: string | undefined;
922
- allowedTools?: string[] | undefined;
923
- bashAllowlist?: string[] | undefined;
924
- kind?: "plugin" | undefined;
925
- pluginKind?: string | undefined;
926
- config?: {
927
- [x: string]: import("hono/utils/types").JSONValue;
928
- } | undefined;
929
- command?: string | undefined;
930
- onFail?: {
931
- retry: string;
932
- max: number;
933
- } | undefined;
934
- }[] | undefined;
935
- runner?: string | undefined;
936
- model?: string | undefined;
937
- effort?: string | undefined;
938
- variants?: 1 | 2 | 3 | undefined;
939
- worktree?: boolean | undefined;
940
- autonomous?: boolean | undefined;
941
- systemPrompt?: string | undefined;
942
- };
943
- archived?: {
944
- [x: string]: import("hono/utils/types").JSONValue;
945
- at: string;
946
- outcome: "cancelled" | "launched";
947
- runId?: string | undefined;
948
- receiptId?: string | undefined;
949
- trigger?: "late" | "manual" | "retry" | "schedule" | undefined;
950
- } | undefined;
951
- createdAt: string;
952
- updatedAt: string;
953
- };
954
- url?: string | undefined;
955
- next_run_at?: string | undefined;
956
- preview?: {
957
- matches: number;
958
- truncated: boolean;
959
- } | undefined;
960
- } | {
961
- ok: false;
962
- code: "automations_off" | "conflict" | "explicit_required" | "invalid_request" | "not_found" | "preview_required" | "unavailable";
963
- message: string;
964
- };
965
- outputFormat: "json";
966
- status: import("hono/utils/http-status").ContentfulStatusCode;
967
- input: {
968
- json: {
969
- action: "create";
970
- definition: {
971
- name: string;
972
- description?: string | undefined;
973
- kind?: "github" | "schedule" | undefined;
974
- events?: ("issue.labeled" | "issue.opened" | "issue.unlabeled" | "pull_request.opened")[] | undefined;
975
- intervalSeconds?: number | undefined;
976
- filters?: {
977
- [x: string]: unknown;
978
- includeExisting?: boolean | undefined;
979
- requireCurrentLabels?: boolean | undefined;
980
- authors?: string[] | undefined;
981
- assignees?: string[] | undefined;
982
- allLabels?: string[] | undefined;
983
- anyLabels?: string[] | undefined;
984
- excludeLabels?: string[] | undefined;
985
- changedLabels?: string[] | undefined;
986
- lookbackDays?: number | undefined;
987
- maxRecords?: number | undefined;
988
- } | undefined;
989
- schedule?: {
990
- type: "daily" | "hours" | "once" | "weekdays" | "weekly";
991
- hour?: number | undefined;
992
- minute?: number | undefined;
993
- day?: number | undefined;
994
- every?: 1 | 2 | 3 | 4 | 6 | 8 | 12 | undefined;
995
- at?: string | undefined;
996
- timeZone?: string | undefined;
997
- latestStartMinutes?: number | undefined;
998
- } | undefined;
999
- task: {
1000
- archiveWhenDone?: boolean | undefined;
1001
- autoMergePr?: boolean | undefined;
1002
- allowWorkers?: boolean | undefined;
1003
- allowMessaging?: boolean | undefined;
1004
- prompt: string;
1005
- workflow?: string | undefined;
1006
- steps?: {
1007
- id: string;
1008
- name?: string | undefined;
1009
- prompt?: string | undefined;
1010
- skill?: string | undefined;
1011
- model?: string | undefined;
1012
- effort?: string | undefined;
1013
- timeoutMs?: number | undefined;
1014
- runner?: string | undefined;
1015
- agentProfile?: string | undefined;
1016
- allowedTools?: string[] | undefined;
1017
- bashAllowlist?: string[] | undefined;
1018
- kind?: "plugin" | undefined;
1019
- pluginKind?: string | undefined;
1020
- config?: Record<string, unknown> | undefined;
1021
- command?: string | undefined;
1022
- onFail?: {
1023
- retry: string;
1024
- max?: number | undefined;
1025
- } | undefined;
1026
- }[] | undefined;
1027
- runner?: string | undefined;
1028
- model?: string | undefined;
1029
- effort?: string | undefined;
1030
- worktree?: boolean | undefined;
1031
- autonomous?: boolean | undefined;
1032
- systemPrompt?: string | undefined;
1033
- };
1034
- };
1035
- } | {
1036
- action: "show";
1037
- id: string;
1038
- } | {
1039
- action: "preview";
1040
- id: string;
1041
- } | {
1042
- action: "enable";
1043
- id: string;
1044
- explicit?: boolean | undefined;
1045
130
  };
1046
131
  };
1047
- };
1048
- };
1049
- } & {
1050
- "/api/v1/tools/schedule-task": {
1051
- $post: {
132
+ } | {
1052
133
  output: {
1053
- ok: false;
1054
- code: import('../contract/index.js').ScheduledTaskRefusalCode;
134
+ code: string;
1055
135
  message: string;
1056
136
  };
1057
137
  outputFormat: "json";
1058
- status: import("hono/utils/http-status").ContentfulStatusCode;
138
+ status: 404;
1059
139
  input: {
1060
- json: {
1061
- at?: string | undefined;
1062
- delay?: string | undefined;
1063
- latest_start?: string | undefined;
1064
- workflow?: string | undefined;
1065
- runner?: string | undefined;
1066
- model?: string | undefined;
1067
- effort?: string | undefined;
140
+ json: unknown;
141
+ } & {
142
+ param: {
1068
143
  name: string;
1069
- prompt: string;
1070
- enable?: boolean | undefined;
1071
144
  };
1072
145
  };
1073
146
  } | {
1074
147
  output: {
1075
- code: 'capability_revoked';
148
+ code: string;
1076
149
  message: string;
1077
150
  };
1078
151
  outputFormat: "json";
1079
152
  status: 401;
1080
153
  input: {
1081
- json: {
1082
- at?: string | undefined;
1083
- delay?: string | undefined;
1084
- latest_start?: string | undefined;
1085
- workflow?: string | undefined;
1086
- runner?: string | undefined;
1087
- model?: string | undefined;
1088
- effort?: string | undefined;
154
+ json: unknown;
155
+ } & {
156
+ param: {
1089
157
  name: string;
1090
- prompt: string;
1091
- enable?: boolean | undefined;
1092
158
  };
1093
159
  };
1094
160
  } | {
1095
- output: {
1096
- ok: true;
1097
- task: {
1098
- id: string;
1099
- name: string;
1100
- status: "archived" | "failed" | "missed" | "paused" | "waiting";
1101
- due_at: string;
1102
- latest_start_minutes?: number | undefined;
1103
- run_id?: string | undefined;
1104
- url?: string | undefined;
1105
- };
1106
- note: string;
1107
- } | {
1108
- ok: false;
1109
- code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
1110
- message: string;
1111
- };
1112
- outputFormat: "json";
1113
- status: import("hono/utils/http-status").ContentfulStatusCode;
1114
- input: {
1115
- json: {
1116
- at?: string | undefined;
1117
- delay?: string | undefined;
1118
- latest_start?: string | undefined;
1119
- workflow?: string | undefined;
1120
- runner?: string | undefined;
1121
- model?: string | undefined;
1122
- effort?: string | undefined;
1123
- name: string;
1124
- prompt: string;
1125
- enable?: boolean | undefined;
1126
- };
1127
- };
1128
- };
1129
- };
1130
- } & {
1131
- "/api/v1/tools/scheduled-tasks": {
1132
- $post: {
1133
- output: {
1134
- ok: false;
1135
- code: import('../contract/index.js').ScheduledTaskRefusalCode;
1136
- message: string;
1137
- };
161
+ output: import("hono/utils/types").JSONValue;
1138
162
  outputFormat: "json";
1139
163
  status: import("hono/utils/http-status").ContentfulStatusCode;
1140
164
  input: {
1141
- json: {
1142
- at?: string | undefined;
1143
- delay?: string | undefined;
1144
- latest_start?: string | undefined;
1145
- workflow?: string | undefined;
1146
- runner?: string | undefined;
1147
- model?: string | undefined;
1148
- effort?: string | undefined;
1149
- action: "update";
1150
- id: string;
1151
- name?: string | undefined;
1152
- prompt?: string | undefined;
1153
- } | {
1154
- action: "list";
1155
- archived?: "include" | "only" | undefined;
1156
- } | {
1157
- action: "show";
1158
- id: string;
1159
- } | {
1160
- action: "pause";
1161
- id: string;
1162
- } | {
1163
- action: "enable";
1164
- id: string;
1165
- } | {
1166
- action: "cancel";
1167
- id: string;
1168
- };
1169
- };
1170
- } | {
1171
- output: {
1172
- code: 'capability_revoked';
1173
- message: string;
1174
- };
1175
- outputFormat: "json";
1176
- status: 401;
1177
- input: {
1178
- json: {
1179
- at?: string | undefined;
1180
- delay?: string | undefined;
1181
- latest_start?: string | undefined;
1182
- workflow?: string | undefined;
1183
- runner?: string | undefined;
1184
- model?: string | undefined;
1185
- effort?: string | undefined;
1186
- action: "update";
1187
- id: string;
1188
- name?: string | undefined;
1189
- prompt?: string | undefined;
1190
- } | {
1191
- action: "list";
1192
- archived?: "include" | "only" | undefined;
1193
- } | {
1194
- action: "show";
1195
- id: string;
1196
- } | {
1197
- action: "pause";
1198
- id: string;
1199
- } | {
1200
- action: "enable";
1201
- id: string;
1202
- } | {
1203
- action: "cancel";
1204
- id: string;
1205
- };
1206
- };
1207
- } | {
1208
- output: {
1209
- ok: false;
1210
- code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
1211
- message: string;
1212
- } | {
1213
- ok: true;
1214
- tasks: {
1215
- id: string;
1216
- name: string;
1217
- status: "archived" | "failed" | "missed" | "paused" | "waiting";
1218
- due_at: string;
1219
- latest_start_minutes?: number | undefined;
1220
- run_id?: string | undefined;
1221
- url?: string | undefined;
1222
- }[];
1223
- } | {
1224
- ok: true;
1225
- task: {
1226
- id: string;
165
+ json: unknown;
166
+ } & {
167
+ param: {
1227
168
  name: string;
1228
- status: "archived" | "failed" | "missed" | "paused" | "waiting";
1229
- due_at: string;
1230
- latest_start_minutes?: number | undefined;
1231
- run_id?: string | undefined;
1232
- url?: string | undefined;
1233
- };
1234
- };
1235
- outputFormat: "json";
1236
- status: import("hono/utils/http-status").ContentfulStatusCode;
1237
- input: {
1238
- json: {
1239
- at?: string | undefined;
1240
- delay?: string | undefined;
1241
- latest_start?: string | undefined;
1242
- workflow?: string | undefined;
1243
- runner?: string | undefined;
1244
- model?: string | undefined;
1245
- effort?: string | undefined;
1246
- action: "update";
1247
- id: string;
1248
- name?: string | undefined;
1249
- prompt?: string | undefined;
1250
- } | {
1251
- action: "list";
1252
- archived?: "include" | "only" | undefined;
1253
- } | {
1254
- action: "show";
1255
- id: string;
1256
- } | {
1257
- action: "pause";
1258
- id: string;
1259
- } | {
1260
- action: "enable";
1261
- id: string;
1262
- } | {
1263
- action: "cancel";
1264
- id: string;
1265
169
  };
1266
170
  };
1267
171
  };
1268
172
  };
1269
- }, "/", "/api/v1/tools/scheduled-tasks">;
173
+ }, "/", "/api/v1/tools/:name">;
1270
174
  export type CiToolApp = ReturnType<typeof ciToolRoutes>;