@app-vitals/agent-lib 0.0.1 → 0.1.1

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 (44) hide show
  1. package/admin-types.ts +4097 -0
  2. package/chat-notify.ts +41 -0
  3. package/chat-notify.unit.test.ts +88 -0
  4. package/claim-ttl.ts +12 -0
  5. package/claim-ttl.unit.test.ts +26 -0
  6. package/claude-timeout.ts +10 -0
  7. package/claude-timeout.unit.test.ts +8 -0
  8. package/cli-flags.ts +83 -0
  9. package/cli-flags.unit.test.ts +137 -0
  10. package/clone-plan.ts +73 -0
  11. package/clone-plan.unit.test.ts +69 -0
  12. package/default-account.ts +5 -0
  13. package/default-account.unit.test.ts +8 -0
  14. package/default-agent-env.ts +15 -0
  15. package/default-agent-env.unit.test.ts +19 -0
  16. package/github-login.ts +20 -0
  17. package/github-login.unit.test.ts +78 -0
  18. package/graceful-shutdown.ts +143 -0
  19. package/graceful-shutdown.unit.test.ts +236 -0
  20. package/http.ts +14 -0
  21. package/http.unit.test.ts +42 -0
  22. package/org-repo.ts +9 -0
  23. package/org-repo.unit.test.ts +42 -0
  24. package/package-exports.unit.test.ts +21 -0
  25. package/package.json +36 -4
  26. package/pg-sslmode.ts +66 -0
  27. package/pg-sslmode.unit.test.ts +74 -0
  28. package/pool-observability.ts +209 -0
  29. package/pool-observability.unit.test.ts +233 -0
  30. package/pricing.ts +98 -0
  31. package/pricing.unit.test.ts +214 -0
  32. package/progress-phases.ts +58 -0
  33. package/progress-phases.unit.test.ts +50 -0
  34. package/request-context.ts +23 -0
  35. package/request-context.unit.test.ts +51 -0
  36. package/secret-env-vars.ts +41 -0
  37. package/secret-env-vars.unit.test.ts +62 -0
  38. package/sentry.ts +201 -0
  39. package/sentry.unit.test.ts +294 -0
  40. package/task-store-types.ts +3256 -0
  41. package/task-store-types.unit.test.ts +24 -0
  42. package/web/toolbar.ts +244 -0
  43. package/web/toolbar.unit.test.ts +243 -0
  44. package/README.md +0 -3
package/admin-types.ts ADDED
@@ -0,0 +1,4097 @@
1
+ /**
2
+ * This file was auto-generated by openapi-typescript.
3
+ * Do not make direct changes to the file.
4
+ */
5
+
6
+ export interface paths {
7
+ "/agents/reconcile": {
8
+ parameters: {
9
+ query?: never;
10
+ header?: never;
11
+ path?: never;
12
+ cookie?: never;
13
+ };
14
+ get?: never;
15
+ put?: never;
16
+ /**
17
+ * Reconcile all agents' K8s state
18
+ * @description Admin-only. Reconciles Kubernetes Deployment state against all managed (non-self-hosted) agents in the DB, returning the recreated/updated deployments plus any orphaned deployments or per-agent failures. In perAgent Anthropic identity mode it also creates the missing identity of each existing agent that has an owner and moves its Deployment off the shared ServiceAccount (`migrated`); agents with no owner are listed in `noOwner` and left alone. Pass `dryRun=true` to only report: nothing is created, saved or patched.
19
+ */
20
+ post: {
21
+ parameters: {
22
+ query?: {
23
+ /** @description Defaults to false (reconcile for real). Pass true to report what would be recreated, updated and moved to per-agent identity without changing anything. */
24
+ dryRun?: "true" | "false";
25
+ };
26
+ header?: never;
27
+ path?: never;
28
+ cookie?: never;
29
+ };
30
+ requestBody?: never;
31
+ responses: {
32
+ /** @description Reconciliation summary */
33
+ 200: {
34
+ headers: {
35
+ [name: string]: unknown;
36
+ };
37
+ content: {
38
+ "application/json": components["schemas"]["ReconcileAgentsResult"];
39
+ };
40
+ };
41
+ /** @description Forbidden */
42
+ 403: {
43
+ headers: {
44
+ [name: string]: unknown;
45
+ };
46
+ content: {
47
+ "application/json": components["schemas"]["Error"];
48
+ };
49
+ };
50
+ };
51
+ };
52
+ delete?: never;
53
+ options?: never;
54
+ head?: never;
55
+ patch?: never;
56
+ trace?: never;
57
+ };
58
+ "/agents/federation/strip-credentials": {
59
+ parameters: {
60
+ query?: never;
61
+ header?: never;
62
+ path?: never;
63
+ cookie?: never;
64
+ };
65
+ get?: never;
66
+ put?: never;
67
+ /**
68
+ * Strip Anthropic credentials from agents' saved env bundles
69
+ * @description Admin-only, one-off migration (WIF-2.2) for moving a deployment to Anthropic workload identity federation. Deletes CLAUDE_CODE_OAUTH_TOKEN, ANTHROPIC_API_KEY and ANTHROPIC_AUTH_TOKEN from every non-self-hosted agent's stored env bundle. `dryRun` defaults to true: nothing is deleted and the response lists what would be. Only agents holding at least one of the keys are listed, so a second applied call returns an empty list. Values are never returned or logged.
70
+ */
71
+ post: {
72
+ parameters: {
73
+ query?: {
74
+ /** @description Defaults to true (report only). Pass false to delete the keys. */
75
+ dryRun?: "true" | "false";
76
+ };
77
+ header?: never;
78
+ path?: never;
79
+ cookie?: never;
80
+ };
81
+ requestBody?: never;
82
+ responses: {
83
+ /** @description Agents (and key names) removed, or that would be removed */
84
+ 200: {
85
+ headers: {
86
+ [name: string]: unknown;
87
+ };
88
+ content: {
89
+ "application/json": components["schemas"]["StripCredentialsResult"];
90
+ };
91
+ };
92
+ /** @description Unauthorized */
93
+ 401: {
94
+ headers: {
95
+ [name: string]: unknown;
96
+ };
97
+ content: {
98
+ "application/json": components["schemas"]["Error"];
99
+ };
100
+ };
101
+ /** @description Forbidden */
102
+ 403: {
103
+ headers: {
104
+ [name: string]: unknown;
105
+ };
106
+ content: {
107
+ "application/json": components["schemas"]["Error"];
108
+ };
109
+ };
110
+ };
111
+ };
112
+ delete?: never;
113
+ options?: never;
114
+ head?: never;
115
+ patch?: never;
116
+ trace?: never;
117
+ };
118
+ "/agents/{id}/provision": {
119
+ parameters: {
120
+ query?: never;
121
+ header?: never;
122
+ path?: never;
123
+ cookie?: never;
124
+ };
125
+ get?: never;
126
+ put?: never;
127
+ /**
128
+ * Provision an agent's K8s workload
129
+ * @description Admin-only. Provisions or re-provisions the Kubernetes workload for a single managed agent — idempotent, safe to call on an already-provisioned agent. For self-hosted agents, returns `{ skipped: true, reason: "self-hosted" }` with no K8s changes.
130
+ */
131
+ post: {
132
+ parameters: {
133
+ query?: never;
134
+ header?: never;
135
+ path: {
136
+ id: string;
137
+ };
138
+ cookie?: never;
139
+ };
140
+ requestBody?: never;
141
+ responses: {
142
+ /** @description Agent provisioned (or already-provisioned — idempotent), or skipped for self-hosted agents */
143
+ 200: {
144
+ headers: {
145
+ [name: string]: unknown;
146
+ };
147
+ content: {
148
+ "application/json": components["schemas"]["ProvisionAgentResult"] | components["schemas"]["ProvisionSkippedResult"];
149
+ };
150
+ };
151
+ /** @description Forbidden */
152
+ 403: {
153
+ headers: {
154
+ [name: string]: unknown;
155
+ };
156
+ content: {
157
+ "application/json": components["schemas"]["Error"];
158
+ };
159
+ };
160
+ /** @description Agent not found */
161
+ 404: {
162
+ headers: {
163
+ [name: string]: unknown;
164
+ };
165
+ content: {
166
+ "application/json": components["schemas"]["Error"];
167
+ };
168
+ };
169
+ };
170
+ };
171
+ delete?: never;
172
+ options?: never;
173
+ head?: never;
174
+ patch?: never;
175
+ trace?: never;
176
+ };
177
+ "/agents/{id}": {
178
+ parameters: {
179
+ query?: never;
180
+ header?: never;
181
+ path?: never;
182
+ cookie?: never;
183
+ };
184
+ /**
185
+ * Get an agent
186
+ * @description Admin-only. Returns the full agent record including `selfHosted`, `repos`, `reviewAuthorAllowlist`, `patchAuthorAllowlist`, `restrictSlackToMembers`, `typeName`, `accountId` (null for unassigned agents), and `missingRequiredEnv` — required env keys declared by the agent's type manifest with no corresponding AgentEnv row yet (informational only).
187
+ */
188
+ get: {
189
+ parameters: {
190
+ query?: never;
191
+ header?: never;
192
+ path: {
193
+ id: string;
194
+ };
195
+ cookie?: never;
196
+ };
197
+ requestBody?: never;
198
+ responses: {
199
+ /** @description Full agent record */
200
+ 200: {
201
+ headers: {
202
+ [name: string]: unknown;
203
+ };
204
+ content: {
205
+ "application/json": components["schemas"]["GetAgentResult"];
206
+ };
207
+ };
208
+ /** @description Forbidden */
209
+ 403: {
210
+ headers: {
211
+ [name: string]: unknown;
212
+ };
213
+ content: {
214
+ "application/json": components["schemas"]["Error"];
215
+ };
216
+ };
217
+ /** @description Agent not found */
218
+ 404: {
219
+ headers: {
220
+ [name: string]: unknown;
221
+ };
222
+ content: {
223
+ "application/json": components["schemas"]["Error"];
224
+ };
225
+ };
226
+ };
227
+ };
228
+ put?: never;
229
+ post?: never;
230
+ /**
231
+ * Delete an agent
232
+ * @description Admin-only. Runs the full deleteAgentFully() teardown: deprovisions the K8s workload, removes the agent's per-agent Anthropic identity when it has one (federation rule, then Anthropic service account, then Kubernetes ServiceAccount), revokes task-store and chat-service tokens, deletes chat threads, and — if an `xoxpToken` is supplied — deletes the Slack app. The Agent row (and its cascade-deleted child records) is deleted last, only if every automatable step succeeded; `agentDeleted: false` means the row was preserved and the call is safe to retry.
233
+ */
234
+ delete: {
235
+ parameters: {
236
+ query?: never;
237
+ header?: never;
238
+ path: {
239
+ id: string;
240
+ };
241
+ cookie?: never;
242
+ };
243
+ requestBody?: {
244
+ content: {
245
+ "application/json": components["schemas"]["DeleteAgentBody"];
246
+ };
247
+ };
248
+ responses: {
249
+ /** @description Delete outcome — agentDeleted is false when a cleanup step failed; the Agent row is preserved for retry */
250
+ 200: {
251
+ headers: {
252
+ [name: string]: unknown;
253
+ };
254
+ content: {
255
+ "application/json": components["schemas"]["DeleteAgentResult"];
256
+ };
257
+ };
258
+ /** @description Forbidden */
259
+ 403: {
260
+ headers: {
261
+ [name: string]: unknown;
262
+ };
263
+ content: {
264
+ "application/json": components["schemas"]["Error"];
265
+ };
266
+ };
267
+ /** @description Agent not found */
268
+ 404: {
269
+ headers: {
270
+ [name: string]: unknown;
271
+ };
272
+ content: {
273
+ "application/json": components["schemas"]["Error"];
274
+ };
275
+ };
276
+ };
277
+ };
278
+ options?: never;
279
+ head?: never;
280
+ /**
281
+ * Update an agent
282
+ * @description Admin-only. Updates `selfHosted`, `repos`, `reviewAuthorAllowlist`, `patchAuthorAllowlist`, `restrictSlackToMembers`, `slackId`, `trialExpiresAt`, and/or `accountId` (platform admin only — 403 for session members; `null` clears it; reconciles the workload of in-cluster agents; does not move historical task-store rows). `typeName` and `trialExpiryWarnedAt` are not updatable via this route. `repos` here REPLACES the whole list; for incremental changes use `POST /agents/{id}/repos` (add) and `DELETE /agents/{id}/repos/{owner}/{name}` (remove). Returns the updated agent, including a `warning` field when `restrictSlackToMembers` is set true on an agent with zero members.
283
+ */
284
+ patch: {
285
+ parameters: {
286
+ query?: never;
287
+ header?: never;
288
+ path: {
289
+ id: string;
290
+ };
291
+ cookie?: never;
292
+ };
293
+ requestBody?: {
294
+ content: {
295
+ "application/json": components["schemas"]["PatchAgentBody"];
296
+ };
297
+ };
298
+ responses: {
299
+ /** @description Agent updated */
300
+ 200: {
301
+ headers: {
302
+ [name: string]: unknown;
303
+ };
304
+ content: {
305
+ "application/json": components["schemas"]["GetAgentResult"];
306
+ };
307
+ };
308
+ /** @description Bad request */
309
+ 400: {
310
+ headers: {
311
+ [name: string]: unknown;
312
+ };
313
+ content: {
314
+ "application/json": components["schemas"]["Error"];
315
+ };
316
+ };
317
+ /** @description Forbidden */
318
+ 403: {
319
+ headers: {
320
+ [name: string]: unknown;
321
+ };
322
+ content: {
323
+ "application/json": components["schemas"]["Error"];
324
+ };
325
+ };
326
+ /** @description Agent not found */
327
+ 404: {
328
+ headers: {
329
+ [name: string]: unknown;
330
+ };
331
+ content: {
332
+ "application/json": components["schemas"]["Error"];
333
+ };
334
+ };
335
+ };
336
+ };
337
+ trace?: never;
338
+ };
339
+ "/agents/{id}/repos": {
340
+ parameters: {
341
+ query?: never;
342
+ header?: never;
343
+ path?: never;
344
+ cookie?: never;
345
+ };
346
+ get?: never;
347
+ put?: never;
348
+ /**
349
+ * Add repos to an agent
350
+ * @description Admin, the agent's own key, or platform.ops. Additive alternative to `PATCH /agents/{id}` (which replaces the whole `repos` array): unions the given `org/repo` entries into the agent's current list, preserving the order of existing entries and appending new ones. Idempotent — adding a repo the agent already has is a no-op. 400 when the resulting list has two repos sharing a basename. Returns the full updated agent.
351
+ */
352
+ post: {
353
+ parameters: {
354
+ query?: never;
355
+ header?: never;
356
+ path: {
357
+ id: string;
358
+ };
359
+ cookie?: never;
360
+ };
361
+ requestBody?: {
362
+ content: {
363
+ "application/json": components["schemas"]["AddAgentReposBody"];
364
+ };
365
+ };
366
+ responses: {
367
+ /** @description Repos added (or already present) */
368
+ 200: {
369
+ headers: {
370
+ [name: string]: unknown;
371
+ };
372
+ content: {
373
+ "application/json": components["schemas"]["GetAgentResult"];
374
+ };
375
+ };
376
+ /** @description Bad request */
377
+ 400: {
378
+ headers: {
379
+ [name: string]: unknown;
380
+ };
381
+ content: {
382
+ "application/json": components["schemas"]["Error"];
383
+ };
384
+ };
385
+ /** @description Forbidden */
386
+ 403: {
387
+ headers: {
388
+ [name: string]: unknown;
389
+ };
390
+ content: {
391
+ "application/json": components["schemas"]["Error"];
392
+ };
393
+ };
394
+ /** @description Agent not found */
395
+ 404: {
396
+ headers: {
397
+ [name: string]: unknown;
398
+ };
399
+ content: {
400
+ "application/json": components["schemas"]["Error"];
401
+ };
402
+ };
403
+ };
404
+ };
405
+ delete?: never;
406
+ options?: never;
407
+ head?: never;
408
+ patch?: never;
409
+ trace?: never;
410
+ };
411
+ "/agents/{id}/repos/{owner}/{name}": {
412
+ parameters: {
413
+ query?: never;
414
+ header?: never;
415
+ path?: never;
416
+ cookie?: never;
417
+ };
418
+ get?: never;
419
+ put?: never;
420
+ post?: never;
421
+ /**
422
+ * Remove a repo from an agent
423
+ * @description Admin, the agent's own key, or platform.ops. Removes one `owner/name` repo from the agent's `repos`, preserving the order of the rest. 404 when the agent does not have that repo. Returns the full updated agent.
424
+ */
425
+ delete: {
426
+ parameters: {
427
+ query?: never;
428
+ header?: never;
429
+ path: {
430
+ id: string;
431
+ owner: string;
432
+ name: string;
433
+ };
434
+ cookie?: never;
435
+ };
436
+ requestBody?: never;
437
+ responses: {
438
+ /** @description Repo removed */
439
+ 200: {
440
+ headers: {
441
+ [name: string]: unknown;
442
+ };
443
+ content: {
444
+ "application/json": components["schemas"]["GetAgentResult"];
445
+ };
446
+ };
447
+ /** @description Forbidden */
448
+ 403: {
449
+ headers: {
450
+ [name: string]: unknown;
451
+ };
452
+ content: {
453
+ "application/json": components["schemas"]["Error"];
454
+ };
455
+ };
456
+ /** @description Agent or repo not found */
457
+ 404: {
458
+ headers: {
459
+ [name: string]: unknown;
460
+ };
461
+ content: {
462
+ "application/json": components["schemas"]["Error"];
463
+ };
464
+ };
465
+ };
466
+ };
467
+ options?: never;
468
+ head?: never;
469
+ patch?: never;
470
+ trace?: never;
471
+ };
472
+ "/agents": {
473
+ parameters: {
474
+ query?: never;
475
+ header?: never;
476
+ path?: never;
477
+ cookie?: never;
478
+ };
479
+ /**
480
+ * List all agents
481
+ * @description Admin-only. Returns every agent's `id`, `name`, `selfHosted`, and `typeName` — used for metrics name resolution.
482
+ */
483
+ get: {
484
+ parameters: {
485
+ query?: never;
486
+ header?: never;
487
+ path?: never;
488
+ cookie?: never;
489
+ };
490
+ requestBody?: never;
491
+ responses: {
492
+ /** @description List of agents */
493
+ 200: {
494
+ headers: {
495
+ [name: string]: unknown;
496
+ };
497
+ content: {
498
+ "application/json": components["schemas"]["AgentSummary"][];
499
+ };
500
+ };
501
+ /** @description Forbidden */
502
+ 403: {
503
+ headers: {
504
+ [name: string]: unknown;
505
+ };
506
+ content: {
507
+ "application/json": components["schemas"]["Error"];
508
+ };
509
+ };
510
+ };
511
+ };
512
+ put?: never;
513
+ /**
514
+ * Create an agent
515
+ * @description Admin-only. Validates name/typeName, creates the Agent row, seeds AgentTool/AgentPlugin rows from the resolved type manifest, attaches repos/allowlists/members, patches Claude credentials, and provisions Kubernetes when `runtime` is "in-cluster" — the same createAgent() implementation (APA-1.1) the web UI form at /admin/agents/new uses. Transactional: on any failure zero rows persist, and this route never returns a partial-success 200. Returns the created agent in the same shape as GET /agents/:id.
516
+ */
517
+ post: {
518
+ parameters: {
519
+ query?: never;
520
+ header?: never;
521
+ path?: never;
522
+ cookie?: never;
523
+ };
524
+ requestBody?: {
525
+ content: {
526
+ "application/json": components["schemas"]["CreateAgentBody"];
527
+ };
528
+ };
529
+ responses: {
530
+ /** @description Agent created */
531
+ 200: {
532
+ headers: {
533
+ [name: string]: unknown;
534
+ };
535
+ content: {
536
+ "application/json": components["schemas"]["GetAgentResult"];
537
+ };
538
+ };
539
+ /** @description Bad request */
540
+ 400: {
541
+ headers: {
542
+ [name: string]: unknown;
543
+ };
544
+ content: {
545
+ "application/json": components["schemas"]["Error"];
546
+ };
547
+ };
548
+ /** @description Forbidden */
549
+ 403: {
550
+ headers: {
551
+ [name: string]: unknown;
552
+ };
553
+ content: {
554
+ "application/json": components["schemas"]["Error"];
555
+ };
556
+ };
557
+ };
558
+ };
559
+ delete?: never;
560
+ options?: never;
561
+ head?: never;
562
+ patch?: never;
563
+ trace?: never;
564
+ };
565
+ "/agents/{id}/envs": {
566
+ parameters: {
567
+ query?: never;
568
+ header?: never;
569
+ path?: never;
570
+ cookie?: never;
571
+ };
572
+ /**
573
+ * Get env vars
574
+ * @description Returns the agent's env vars. Non-secret values are decrypted; values flagged secret are masked as `***` and their keys listed in `secretKeys`.
575
+ */
576
+ get: {
577
+ parameters: {
578
+ query?: never;
579
+ header?: never;
580
+ path: {
581
+ id: string;
582
+ };
583
+ cookie?: never;
584
+ };
585
+ requestBody?: never;
586
+ responses: {
587
+ /** @description Decrypted env vars */
588
+ 200: {
589
+ headers: {
590
+ [name: string]: unknown;
591
+ };
592
+ content: {
593
+ "application/json": components["schemas"]["AgentEnvResponse"];
594
+ };
595
+ };
596
+ };
597
+ };
598
+ put?: never;
599
+ /**
600
+ * Replace all env vars
601
+ * @description Bulk-replaces all env vars for the agent atomically. Values are stored encrypted (AES-256-GCM).
602
+ */
603
+ post: {
604
+ parameters: {
605
+ query?: never;
606
+ header?: never;
607
+ path: {
608
+ id: string;
609
+ };
610
+ cookie?: never;
611
+ };
612
+ requestBody?: {
613
+ content: {
614
+ "application/json": components["schemas"]["AgentEnvBody"];
615
+ };
616
+ };
617
+ responses: {
618
+ /** @description Env vars replaced */
619
+ 201: {
620
+ headers: {
621
+ [name: string]: unknown;
622
+ };
623
+ content: {
624
+ "application/json": components["schemas"]["Ok"];
625
+ };
626
+ };
627
+ /** @description Bad request */
628
+ 400: {
629
+ headers: {
630
+ [name: string]: unknown;
631
+ };
632
+ content: {
633
+ "application/json": components["schemas"]["Error"];
634
+ };
635
+ };
636
+ };
637
+ };
638
+ delete?: never;
639
+ options?: never;
640
+ head?: never;
641
+ /**
642
+ * Update specific env vars
643
+ * @description Updates only the specified keys, leaving other existing env vars untouched.
644
+ */
645
+ patch: {
646
+ parameters: {
647
+ query?: never;
648
+ header?: never;
649
+ path: {
650
+ id: string;
651
+ };
652
+ cookie?: never;
653
+ };
654
+ requestBody?: {
655
+ content: {
656
+ "application/json": components["schemas"]["AgentEnvPatchBody"];
657
+ };
658
+ };
659
+ responses: {
660
+ /** @description Env vars updated */
661
+ 200: {
662
+ headers: {
663
+ [name: string]: unknown;
664
+ };
665
+ content: {
666
+ "application/json": components["schemas"]["Ok"];
667
+ };
668
+ };
669
+ /** @description Bad request */
670
+ 400: {
671
+ headers: {
672
+ [name: string]: unknown;
673
+ };
674
+ content: {
675
+ "application/json": components["schemas"]["Error"];
676
+ };
677
+ };
678
+ };
679
+ };
680
+ trace?: never;
681
+ };
682
+ "/agents/{id}/envs/{key}": {
683
+ parameters: {
684
+ query?: never;
685
+ header?: never;
686
+ path?: never;
687
+ cookie?: never;
688
+ };
689
+ get?: never;
690
+ put?: never;
691
+ post?: never;
692
+ /**
693
+ * Delete an env var
694
+ * @description Deletes a single env var by key.
695
+ */
696
+ delete: {
697
+ parameters: {
698
+ query?: never;
699
+ header?: never;
700
+ path: {
701
+ id: string;
702
+ key: string;
703
+ };
704
+ cookie?: never;
705
+ };
706
+ requestBody?: never;
707
+ responses: {
708
+ /** @description Key deleted */
709
+ 204: {
710
+ headers: {
711
+ [name: string]: unknown;
712
+ };
713
+ content?: never;
714
+ };
715
+ };
716
+ };
717
+ options?: never;
718
+ head?: never;
719
+ patch?: never;
720
+ trace?: never;
721
+ };
722
+ "/agents/{id}/crons": {
723
+ parameters: {
724
+ query?: never;
725
+ header?: never;
726
+ path?: never;
727
+ cookie?: never;
728
+ };
729
+ /**
730
+ * List agent cron jobs
731
+ * @description Returns the agent's cron jobs as a plain array (not wrapped), used by the agent harness's scheduler. Returns 404 if the agent doesn't exist.
732
+ */
733
+ get: {
734
+ parameters: {
735
+ query?: never;
736
+ header?: never;
737
+ path: {
738
+ id: string;
739
+ };
740
+ cookie?: never;
741
+ };
742
+ requestBody?: never;
743
+ responses: {
744
+ /** @description Array of cron jobs */
745
+ 200: {
746
+ headers: {
747
+ [name: string]: unknown;
748
+ };
749
+ content: {
750
+ "application/json": components["schemas"]["AgentCronJob"][];
751
+ };
752
+ };
753
+ /** @description Unauthorized */
754
+ 401: {
755
+ headers: {
756
+ [name: string]: unknown;
757
+ };
758
+ content: {
759
+ "application/json": components["schemas"]["RuntimeError"];
760
+ };
761
+ };
762
+ /** @description Agent not found */
763
+ 404: {
764
+ headers: {
765
+ [name: string]: unknown;
766
+ };
767
+ content: {
768
+ "application/json": components["schemas"]["RuntimeError"];
769
+ };
770
+ };
771
+ };
772
+ };
773
+ put?: never;
774
+ /**
775
+ * Create a cron job
776
+ * @description Creates a cron job for the agent. `channel` and `user` are mutually exclusive delivery targets. Returns the created job including system-managed read-only fields (`id`, `system`, `parentCronId`, `createdAt`, `updatedAt`) — `parentCronId` is never settable by the caller.
777
+ */
778
+ post: {
779
+ parameters: {
780
+ query?: never;
781
+ header?: never;
782
+ path: {
783
+ id: string;
784
+ };
785
+ cookie?: never;
786
+ };
787
+ requestBody?: {
788
+ content: {
789
+ "application/json": components["schemas"]["CreateAgentCronJobBody"];
790
+ };
791
+ };
792
+ responses: {
793
+ /** @description Cron job created */
794
+ 201: {
795
+ headers: {
796
+ [name: string]: unknown;
797
+ };
798
+ content: {
799
+ "application/json": components["schemas"]["CronWrapper"];
800
+ };
801
+ };
802
+ /** @description Bad request */
803
+ 400: {
804
+ headers: {
805
+ [name: string]: unknown;
806
+ };
807
+ content: {
808
+ "application/json": components["schemas"]["Error"];
809
+ };
810
+ };
811
+ };
812
+ };
813
+ delete?: never;
814
+ options?: never;
815
+ head?: never;
816
+ patch?: never;
817
+ trace?: never;
818
+ };
819
+ "/agents/{id}/crons/reconcile": {
820
+ parameters: {
821
+ query?: never;
822
+ header?: never;
823
+ path?: never;
824
+ cookie?: never;
825
+ };
826
+ get?: never;
827
+ put?: never;
828
+ /**
829
+ * Reconcile system crons
830
+ * @description Reconciles the agent's system crons against the cron list declared by its Specialty manifest. Runs in three passes within a single transaction: create-or-update matched-by-name system crons (preserving IDs so run history survives), link/unlink parent-child cron relationships, and delete orphaned system crons no longer in the manifest. Called automatically on agent startup; returns created/updated/deleted counts.
831
+ */
832
+ post: {
833
+ parameters: {
834
+ query?: never;
835
+ header?: never;
836
+ path: {
837
+ id: string;
838
+ };
839
+ cookie?: never;
840
+ };
841
+ requestBody?: never;
842
+ responses: {
843
+ /** @description Reconciliation summary */
844
+ 200: {
845
+ headers: {
846
+ [name: string]: unknown;
847
+ };
848
+ content: {
849
+ "application/json": components["schemas"]["ReconcileCronResult"];
850
+ };
851
+ };
852
+ };
853
+ };
854
+ delete?: never;
855
+ options?: never;
856
+ head?: never;
857
+ patch?: never;
858
+ trace?: never;
859
+ };
860
+ "/agents/{id}/crons/{cronId}": {
861
+ parameters: {
862
+ query?: never;
863
+ header?: never;
864
+ path?: never;
865
+ cookie?: never;
866
+ };
867
+ get?: never;
868
+ put?: never;
869
+ post?: never;
870
+ /**
871
+ * Delete a cron job
872
+ * @description Deletes a cron job. System crons (`system: true`) cannot be deleted and return 403.
873
+ */
874
+ delete: {
875
+ parameters: {
876
+ query?: never;
877
+ header?: never;
878
+ path: {
879
+ id: string;
880
+ cronId: string;
881
+ };
882
+ cookie?: never;
883
+ };
884
+ requestBody?: never;
885
+ responses: {
886
+ /** @description Cron job deleted */
887
+ 204: {
888
+ headers: {
889
+ [name: string]: unknown;
890
+ };
891
+ content?: never;
892
+ };
893
+ /** @description Forbidden */
894
+ 403: {
895
+ headers: {
896
+ [name: string]: unknown;
897
+ };
898
+ content: {
899
+ "application/json": components["schemas"]["Error"];
900
+ };
901
+ };
902
+ };
903
+ };
904
+ options?: never;
905
+ head?: never;
906
+ /**
907
+ * Update a cron job
908
+ * @description Updates a cron job. `schedule` and `prompt` must be provided together for a content update; `enabled` and `preCheck` are orthogonal and may be sent alone or combined with any other field. At least one field must be present — an empty body returns 400. System crons (`system: true`) reject `schedule`, `prompt`, and/or `preCheck` changes with 403; an enabled-only body is allowed and toggles the cron via the same path used for non-system crons.
909
+ */
910
+ patch: {
911
+ parameters: {
912
+ query?: never;
913
+ header?: never;
914
+ path: {
915
+ id: string;
916
+ cronId: string;
917
+ };
918
+ cookie?: never;
919
+ };
920
+ requestBody?: {
921
+ content: {
922
+ "application/json": components["schemas"]["PatchAgentCronJobBody"];
923
+ };
924
+ };
925
+ responses: {
926
+ /** @description Cron job updated */
927
+ 200: {
928
+ headers: {
929
+ [name: string]: unknown;
930
+ };
931
+ content: {
932
+ "application/json": components["schemas"]["CronWrapper"];
933
+ };
934
+ };
935
+ /** @description Bad request */
936
+ 400: {
937
+ headers: {
938
+ [name: string]: unknown;
939
+ };
940
+ content: {
941
+ "application/json": components["schemas"]["Error"];
942
+ };
943
+ };
944
+ };
945
+ };
946
+ trace?: never;
947
+ };
948
+ "/agents/{id}/crons/summary": {
949
+ parameters: {
950
+ query?: never;
951
+ header?: never;
952
+ path?: never;
953
+ cookie?: never;
954
+ };
955
+ /**
956
+ * List cron jobs with run summary
957
+ * @description Returns each cron job's last-run timestamp, outcome, and today's run count alongside its config — without full prompt text. Useful for dashboards.
958
+ */
959
+ get: {
960
+ parameters: {
961
+ query?: never;
962
+ header?: never;
963
+ path: {
964
+ id: string;
965
+ };
966
+ cookie?: never;
967
+ };
968
+ requestBody?: never;
969
+ responses: {
970
+ /** @description List of cron jobs with run summary */
971
+ 200: {
972
+ headers: {
973
+ [name: string]: unknown;
974
+ };
975
+ content: {
976
+ "application/json": components["schemas"]["CronsWithSummaryWrapper"];
977
+ };
978
+ };
979
+ /** @description Forbidden */
980
+ 403: {
981
+ headers: {
982
+ [name: string]: unknown;
983
+ };
984
+ content: {
985
+ "application/json": components["schemas"]["Error"];
986
+ };
987
+ };
988
+ };
989
+ };
990
+ put?: never;
991
+ post?: never;
992
+ delete?: never;
993
+ options?: never;
994
+ head?: never;
995
+ patch?: never;
996
+ trace?: never;
997
+ };
998
+ "/agents/{id}/crons/{cronId}/runs": {
999
+ parameters: {
1000
+ query?: never;
1001
+ header?: never;
1002
+ path?: never;
1003
+ cookie?: never;
1004
+ };
1005
+ /**
1006
+ * List cron runs
1007
+ * @description Returns a paginated list of runs for a cron job (`limit` default 20, `offset` default 0). `itemId` and `phaseId` are optional server-side filters that combine with AND when both are supplied.
1008
+ */
1009
+ get: {
1010
+ parameters: {
1011
+ query?: {
1012
+ limit?: string;
1013
+ offset?: string;
1014
+ itemId?: string;
1015
+ phaseId?: string;
1016
+ };
1017
+ header?: never;
1018
+ path: {
1019
+ id: string;
1020
+ cronId: string;
1021
+ };
1022
+ cookie?: never;
1023
+ };
1024
+ requestBody?: never;
1025
+ responses: {
1026
+ /** @description Paginated list of cron runs */
1027
+ 200: {
1028
+ headers: {
1029
+ [name: string]: unknown;
1030
+ };
1031
+ content: {
1032
+ "application/json": components["schemas"]["CronRunsList"];
1033
+ };
1034
+ };
1035
+ /** @description Cron job not found */
1036
+ 404: {
1037
+ headers: {
1038
+ [name: string]: unknown;
1039
+ };
1040
+ content: {
1041
+ "application/json": components["schemas"]["Error"];
1042
+ };
1043
+ };
1044
+ };
1045
+ };
1046
+ put?: never;
1047
+ /**
1048
+ * Create a cron run record
1049
+ * @description Records the start of a cron job execution, including optional skip/outcome data and dispatch attribution (`itemType`/`itemId`, write-once at creation).
1050
+ */
1051
+ post: {
1052
+ parameters: {
1053
+ query?: never;
1054
+ header?: never;
1055
+ path: {
1056
+ id: string;
1057
+ cronId: string;
1058
+ };
1059
+ cookie?: never;
1060
+ };
1061
+ requestBody?: {
1062
+ content: {
1063
+ "application/json": components["schemas"]["CreateAgentCronRunBody"];
1064
+ };
1065
+ };
1066
+ responses: {
1067
+ /** @description Run record created */
1068
+ 201: {
1069
+ headers: {
1070
+ [name: string]: unknown;
1071
+ };
1072
+ content: {
1073
+ "application/json": components["schemas"]["CronRunWrapper"];
1074
+ };
1075
+ };
1076
+ /** @description Bad request */
1077
+ 400: {
1078
+ headers: {
1079
+ [name: string]: unknown;
1080
+ };
1081
+ content: {
1082
+ "application/json": components["schemas"]["Error"];
1083
+ };
1084
+ };
1085
+ /** @description Cron job not found */
1086
+ 404: {
1087
+ headers: {
1088
+ [name: string]: unknown;
1089
+ };
1090
+ content: {
1091
+ "application/json": components["schemas"]["Error"];
1092
+ };
1093
+ };
1094
+ };
1095
+ };
1096
+ delete?: never;
1097
+ options?: never;
1098
+ head?: never;
1099
+ patch?: never;
1100
+ trace?: never;
1101
+ };
1102
+ "/agents/{id}/crons/{cronId}/runs/{runId}": {
1103
+ parameters: {
1104
+ query?: never;
1105
+ header?: never;
1106
+ path?: never;
1107
+ cookie?: never;
1108
+ };
1109
+ get?: never;
1110
+ put?: never;
1111
+ post?: never;
1112
+ delete?: never;
1113
+ options?: never;
1114
+ head?: never;
1115
+ /**
1116
+ * Update a cron run record
1117
+ * @description Records completion data after a run finishes — `completedAt`, `outcome`, `error`, `skipped`, `skipReason`, `sessionId`, and `modelBreakdown` (per-model token/cost entries, upserted per `[cronRunId, model]`). At least one field must be provided.
1118
+ */
1119
+ patch: {
1120
+ parameters: {
1121
+ query?: never;
1122
+ header?: never;
1123
+ path: {
1124
+ id: string;
1125
+ cronId: string;
1126
+ runId: string;
1127
+ };
1128
+ cookie?: never;
1129
+ };
1130
+ requestBody?: {
1131
+ content: {
1132
+ "application/json": components["schemas"]["PatchAgentCronRunBody"];
1133
+ };
1134
+ };
1135
+ responses: {
1136
+ /** @description Run record updated */
1137
+ 200: {
1138
+ headers: {
1139
+ [name: string]: unknown;
1140
+ };
1141
+ content: {
1142
+ "application/json": components["schemas"]["PatchCronRunWrapper"];
1143
+ };
1144
+ };
1145
+ /** @description Bad request */
1146
+ 400: {
1147
+ headers: {
1148
+ [name: string]: unknown;
1149
+ };
1150
+ content: {
1151
+ "application/json": components["schemas"]["Error"];
1152
+ };
1153
+ };
1154
+ /** @description Run not found or not owned by agent */
1155
+ 404: {
1156
+ headers: {
1157
+ [name: string]: unknown;
1158
+ };
1159
+ content: {
1160
+ "application/json": components["schemas"]["Error"];
1161
+ };
1162
+ };
1163
+ };
1164
+ };
1165
+ trace?: never;
1166
+ };
1167
+ "/agents/{id}/tools": {
1168
+ parameters: {
1169
+ query?: never;
1170
+ header?: never;
1171
+ path?: never;
1172
+ cookie?: never;
1173
+ };
1174
+ /**
1175
+ * List tool patterns
1176
+ * @description Returns every allowed-tool entry for the agent, each with `id`, `pattern`, and `enabled`.
1177
+ */
1178
+ get: {
1179
+ parameters: {
1180
+ query?: never;
1181
+ header?: never;
1182
+ path: {
1183
+ id: string;
1184
+ };
1185
+ cookie?: never;
1186
+ };
1187
+ requestBody?: never;
1188
+ responses: {
1189
+ /** @description List of tool patterns */
1190
+ 200: {
1191
+ headers: {
1192
+ [name: string]: unknown;
1193
+ };
1194
+ content: {
1195
+ "application/json": components["schemas"]["ToolsWrapper"];
1196
+ };
1197
+ };
1198
+ };
1199
+ };
1200
+ put?: never;
1201
+ /**
1202
+ * Add a tool pattern
1203
+ * @description Adds an allowed-tool entry — a glob or exact Claude Code tool name (e.g. "Read", "Bash", "mcp__*") the agent can call.
1204
+ */
1205
+ post: {
1206
+ parameters: {
1207
+ query?: never;
1208
+ header?: never;
1209
+ path: {
1210
+ id: string;
1211
+ };
1212
+ cookie?: never;
1213
+ };
1214
+ requestBody?: {
1215
+ content: {
1216
+ "application/json": components["schemas"]["CreateAgentToolBody"];
1217
+ };
1218
+ };
1219
+ responses: {
1220
+ /** @description Tool added */
1221
+ 201: {
1222
+ headers: {
1223
+ [name: string]: unknown;
1224
+ };
1225
+ content: {
1226
+ "application/json": components["schemas"]["ToolWrapper"];
1227
+ };
1228
+ };
1229
+ /** @description Bad request */
1230
+ 400: {
1231
+ headers: {
1232
+ [name: string]: unknown;
1233
+ };
1234
+ content: {
1235
+ "application/json": components["schemas"]["Error"];
1236
+ };
1237
+ };
1238
+ };
1239
+ };
1240
+ delete?: never;
1241
+ options?: never;
1242
+ head?: never;
1243
+ patch?: never;
1244
+ trace?: never;
1245
+ };
1246
+ "/agents/{id}/tools/{toolId}": {
1247
+ parameters: {
1248
+ query?: never;
1249
+ header?: never;
1250
+ path?: never;
1251
+ cookie?: never;
1252
+ };
1253
+ get?: never;
1254
+ put?: never;
1255
+ post?: never;
1256
+ /**
1257
+ * Remove a tool pattern
1258
+ * @description Deletes a tool entry from the agent's allowed-tools list.
1259
+ */
1260
+ delete: {
1261
+ parameters: {
1262
+ query?: never;
1263
+ header?: never;
1264
+ path: {
1265
+ id: string;
1266
+ toolId: string;
1267
+ };
1268
+ cookie?: never;
1269
+ };
1270
+ requestBody?: never;
1271
+ responses: {
1272
+ /** @description Tool removed */
1273
+ 204: {
1274
+ headers: {
1275
+ [name: string]: unknown;
1276
+ };
1277
+ content?: never;
1278
+ };
1279
+ };
1280
+ };
1281
+ options?: never;
1282
+ head?: never;
1283
+ /**
1284
+ * Enable or disable a tool pattern
1285
+ * @description Updates a tool entry's `pattern` and/or `enabled` state.
1286
+ */
1287
+ patch: {
1288
+ parameters: {
1289
+ query?: never;
1290
+ header?: never;
1291
+ path: {
1292
+ id: string;
1293
+ toolId: string;
1294
+ };
1295
+ cookie?: never;
1296
+ };
1297
+ requestBody?: {
1298
+ content: {
1299
+ "application/json": components["schemas"]["PatchAgentToolBody"];
1300
+ };
1301
+ };
1302
+ responses: {
1303
+ /** @description Tool toggled */
1304
+ 200: {
1305
+ headers: {
1306
+ [name: string]: unknown;
1307
+ };
1308
+ content: {
1309
+ "application/json": components["schemas"]["ToolWrapper"];
1310
+ };
1311
+ };
1312
+ /** @description Bad request */
1313
+ 400: {
1314
+ headers: {
1315
+ [name: string]: unknown;
1316
+ };
1317
+ content: {
1318
+ "application/json": components["schemas"]["Error"];
1319
+ };
1320
+ };
1321
+ };
1322
+ };
1323
+ trace?: never;
1324
+ };
1325
+ "/agents/{id}/tokens": {
1326
+ parameters: {
1327
+ query?: never;
1328
+ header?: never;
1329
+ path?: never;
1330
+ cookie?: never;
1331
+ };
1332
+ /**
1333
+ * List API tokens
1334
+ * @description Returns token metadata (hash excluded) for the agent — raw token values are never returned after creation.
1335
+ */
1336
+ get: {
1337
+ parameters: {
1338
+ query?: never;
1339
+ header?: never;
1340
+ path: {
1341
+ id: string;
1342
+ };
1343
+ cookie?: never;
1344
+ };
1345
+ requestBody?: never;
1346
+ responses: {
1347
+ /** @description List of token metadata */
1348
+ 200: {
1349
+ headers: {
1350
+ [name: string]: unknown;
1351
+ };
1352
+ content: {
1353
+ "application/json": components["schemas"]["TokensWrapper"];
1354
+ };
1355
+ };
1356
+ };
1357
+ };
1358
+ put?: never;
1359
+ /**
1360
+ * Create an API token
1361
+ * @description Creates a per-agent bearer token for scoped API access. The raw token value is returned once in this response — only its SHA-256 hash is persisted, so it must be saved immediately.
1362
+ */
1363
+ post: {
1364
+ parameters: {
1365
+ query?: never;
1366
+ header?: never;
1367
+ path: {
1368
+ id: string;
1369
+ };
1370
+ cookie?: never;
1371
+ };
1372
+ requestBody?: {
1373
+ content: {
1374
+ "application/json": components["schemas"]["CreateAgentTokenBody"];
1375
+ };
1376
+ };
1377
+ responses: {
1378
+ /** @description Token created (raw value returned once) */
1379
+ 201: {
1380
+ headers: {
1381
+ [name: string]: unknown;
1382
+ };
1383
+ content: {
1384
+ "application/json": components["schemas"]["CreateAgentTokenResponse"];
1385
+ };
1386
+ };
1387
+ };
1388
+ };
1389
+ delete?: never;
1390
+ options?: never;
1391
+ head?: never;
1392
+ patch?: never;
1393
+ trace?: never;
1394
+ };
1395
+ "/agents/{id}/tokens/{tokenId}": {
1396
+ parameters: {
1397
+ query?: never;
1398
+ header?: never;
1399
+ path?: never;
1400
+ cookie?: never;
1401
+ };
1402
+ get?: never;
1403
+ put?: never;
1404
+ post?: never;
1405
+ /**
1406
+ * Revoke an API token
1407
+ * @description Soft-deletes the token by setting `revokedAt`.
1408
+ */
1409
+ delete: {
1410
+ parameters: {
1411
+ query?: never;
1412
+ header?: never;
1413
+ path: {
1414
+ id: string;
1415
+ tokenId: string;
1416
+ };
1417
+ cookie?: never;
1418
+ };
1419
+ requestBody?: never;
1420
+ responses: {
1421
+ /** @description Token revoked */
1422
+ 204: {
1423
+ headers: {
1424
+ [name: string]: unknown;
1425
+ };
1426
+ content?: never;
1427
+ };
1428
+ };
1429
+ };
1430
+ options?: never;
1431
+ head?: never;
1432
+ patch?: never;
1433
+ trace?: never;
1434
+ };
1435
+ "/agents/{id}/plugins": {
1436
+ parameters: {
1437
+ query?: never;
1438
+ header?: never;
1439
+ path?: never;
1440
+ cookie?: never;
1441
+ };
1442
+ /**
1443
+ * List plugins
1444
+ * @description Returns every plugin installed for the agent.
1445
+ */
1446
+ get: {
1447
+ parameters: {
1448
+ query?: never;
1449
+ header?: never;
1450
+ path: {
1451
+ id: string;
1452
+ };
1453
+ cookie?: never;
1454
+ };
1455
+ requestBody?: never;
1456
+ responses: {
1457
+ /** @description List of plugins */
1458
+ 200: {
1459
+ headers: {
1460
+ [name: string]: unknown;
1461
+ };
1462
+ content: {
1463
+ "application/json": components["schemas"]["PluginsWrapper"];
1464
+ };
1465
+ };
1466
+ };
1467
+ };
1468
+ put?: never;
1469
+ /**
1470
+ * Install a plugin
1471
+ * @description Adds a Claude Code marketplace plugin for the agent.
1472
+ */
1473
+ post: {
1474
+ parameters: {
1475
+ query?: never;
1476
+ header?: never;
1477
+ path: {
1478
+ id: string;
1479
+ };
1480
+ cookie?: never;
1481
+ };
1482
+ requestBody?: {
1483
+ content: {
1484
+ "application/json": components["schemas"]["CreateAgentPluginBody"];
1485
+ };
1486
+ };
1487
+ responses: {
1488
+ /** @description Plugin added */
1489
+ 201: {
1490
+ headers: {
1491
+ [name: string]: unknown;
1492
+ };
1493
+ content: {
1494
+ "application/json": components["schemas"]["PluginWrapper"];
1495
+ };
1496
+ };
1497
+ /** @description Bad request */
1498
+ 400: {
1499
+ headers: {
1500
+ [name: string]: unknown;
1501
+ };
1502
+ content: {
1503
+ "application/json": components["schemas"]["Error"];
1504
+ };
1505
+ };
1506
+ };
1507
+ };
1508
+ /**
1509
+ * Remove a plugin
1510
+ * @description Removes the plugin identified by the required `name` query param.
1511
+ */
1512
+ delete: {
1513
+ parameters: {
1514
+ query: {
1515
+ name: string;
1516
+ };
1517
+ header?: never;
1518
+ path: {
1519
+ id: string;
1520
+ };
1521
+ cookie?: never;
1522
+ };
1523
+ requestBody?: never;
1524
+ responses: {
1525
+ /** @description Plugin removed */
1526
+ 204: {
1527
+ headers: {
1528
+ [name: string]: unknown;
1529
+ };
1530
+ content?: never;
1531
+ };
1532
+ /** @description Bad request */
1533
+ 400: {
1534
+ headers: {
1535
+ [name: string]: unknown;
1536
+ };
1537
+ content: {
1538
+ "application/json": components["schemas"]["Error"];
1539
+ };
1540
+ };
1541
+ };
1542
+ };
1543
+ options?: never;
1544
+ head?: never;
1545
+ /**
1546
+ * Update a plugin
1547
+ * @description Re-upserts the plugin identified by the required `name` query param with a new `version` and/or `enabled` state. Uses a query param rather than a path segment because a canonical plugin spec like "my-plugin@org/my-marketplace" can contain a literal "/" that would break path matching.
1548
+ */
1549
+ patch: {
1550
+ parameters: {
1551
+ query: {
1552
+ name: string;
1553
+ };
1554
+ header?: never;
1555
+ path: {
1556
+ id: string;
1557
+ };
1558
+ cookie?: never;
1559
+ };
1560
+ requestBody?: {
1561
+ content: {
1562
+ "application/json": components["schemas"]["PatchAgentPluginBody"];
1563
+ };
1564
+ };
1565
+ responses: {
1566
+ /** @description Plugin version updated */
1567
+ 200: {
1568
+ headers: {
1569
+ [name: string]: unknown;
1570
+ };
1571
+ content: {
1572
+ "application/json": components["schemas"]["PluginWrapper"];
1573
+ };
1574
+ };
1575
+ /** @description Bad request */
1576
+ 400: {
1577
+ headers: {
1578
+ [name: string]: unknown;
1579
+ };
1580
+ content: {
1581
+ "application/json": components["schemas"]["Error"];
1582
+ };
1583
+ };
1584
+ };
1585
+ };
1586
+ trace?: never;
1587
+ };
1588
+ "/agents/{id}/phase-methodology": {
1589
+ parameters: {
1590
+ query?: never;
1591
+ header?: never;
1592
+ path?: never;
1593
+ cookie?: never;
1594
+ };
1595
+ /**
1596
+ * List phase-methodology overrides
1597
+ * @description Returns every phase-methodology override configured for the agent — which subagent type handles each pipeline phase (prd, plan-session, review, patch, deploy, dev-task). A phase with no explicit override is simply absent from this list; see GET /agents/:id/config's `phaseMethodology` map for the full six-phase view with defaults filled in.
1598
+ */
1599
+ get: {
1600
+ parameters: {
1601
+ query?: never;
1602
+ header?: never;
1603
+ path: {
1604
+ id: string;
1605
+ };
1606
+ cookie?: never;
1607
+ };
1608
+ requestBody?: never;
1609
+ responses: {
1610
+ /** @description List of phase-methodology overrides */
1611
+ 200: {
1612
+ headers: {
1613
+ [name: string]: unknown;
1614
+ };
1615
+ content: {
1616
+ "application/json": components["schemas"]["PhaseMethodologyListWrapper"];
1617
+ };
1618
+ };
1619
+ /** @description Agent not found */
1620
+ 404: {
1621
+ headers: {
1622
+ [name: string]: unknown;
1623
+ };
1624
+ content: {
1625
+ "application/json": components["schemas"]["Error"];
1626
+ };
1627
+ };
1628
+ };
1629
+ };
1630
+ put?: never;
1631
+ post?: never;
1632
+ delete?: never;
1633
+ options?: never;
1634
+ head?: never;
1635
+ patch?: never;
1636
+ trace?: never;
1637
+ };
1638
+ "/agents/{id}/phase-methodology/{phase}": {
1639
+ parameters: {
1640
+ query?: never;
1641
+ header?: never;
1642
+ path?: never;
1643
+ cookie?: never;
1644
+ };
1645
+ get?: never;
1646
+ /**
1647
+ * Set a phase's subagent-type override
1648
+ * @description Upserts the `subagentType` override for one pipeline phase. Passing `subagentType: null` clears the override (the phase falls back to its default methodology). `phase` must be one of prd, plan-session, review, patch, deploy, dev-task.
1649
+ */
1650
+ put: {
1651
+ parameters: {
1652
+ query?: never;
1653
+ header?: never;
1654
+ path: {
1655
+ id: string;
1656
+ phase: "prd" | "plan-session" | "review" | "patch" | "deploy" | "dev-task";
1657
+ };
1658
+ cookie?: never;
1659
+ };
1660
+ requestBody?: {
1661
+ content: {
1662
+ "application/json": components["schemas"]["PutAgentPhaseMethodologyBody"];
1663
+ };
1664
+ };
1665
+ responses: {
1666
+ /** @description Phase-methodology override upserted */
1667
+ 200: {
1668
+ headers: {
1669
+ [name: string]: unknown;
1670
+ };
1671
+ content: {
1672
+ "application/json": components["schemas"]["PhaseMethodologyWrapper"];
1673
+ };
1674
+ };
1675
+ /** @description Bad request — invalid phase */
1676
+ 400: {
1677
+ headers: {
1678
+ [name: string]: unknown;
1679
+ };
1680
+ content: {
1681
+ "application/json": components["schemas"]["Error"];
1682
+ };
1683
+ };
1684
+ /** @description Agent not found */
1685
+ 404: {
1686
+ headers: {
1687
+ [name: string]: unknown;
1688
+ };
1689
+ content: {
1690
+ "application/json": components["schemas"]["Error"];
1691
+ };
1692
+ };
1693
+ };
1694
+ };
1695
+ post?: never;
1696
+ delete?: never;
1697
+ options?: never;
1698
+ head?: never;
1699
+ patch?: never;
1700
+ trace?: never;
1701
+ };
1702
+ "/agents/all/cron-runs/stats": {
1703
+ parameters: {
1704
+ query?: never;
1705
+ header?: never;
1706
+ path?: never;
1707
+ cookie?: never;
1708
+ };
1709
+ /**
1710
+ * Get aggregated cron-run token stats
1711
+ * @description Admin-only. Returns token usage and cost aggregated across all agents' cron runs, broken down by agent, cron, model, day, and pipeline phase. Optional `from`/`to` ISO datetime query params bound the range.
1712
+ */
1713
+ get: {
1714
+ parameters: {
1715
+ query?: {
1716
+ from?: string;
1717
+ to?: string;
1718
+ };
1719
+ header?: never;
1720
+ path?: never;
1721
+ cookie?: never;
1722
+ };
1723
+ requestBody?: never;
1724
+ responses: {
1725
+ /** @description Aggregated cron-run token stats across all agents */
1726
+ 200: {
1727
+ headers: {
1728
+ [name: string]: unknown;
1729
+ };
1730
+ content: {
1731
+ "application/json": components["schemas"]["CronRunTokenStats"];
1732
+ };
1733
+ };
1734
+ /** @description Unauthorized */
1735
+ 401: {
1736
+ headers: {
1737
+ [name: string]: unknown;
1738
+ };
1739
+ content: {
1740
+ "application/json": components["schemas"]["Error"];
1741
+ };
1742
+ };
1743
+ /** @description Forbidden — requires admin scope */
1744
+ 403: {
1745
+ headers: {
1746
+ [name: string]: unknown;
1747
+ };
1748
+ content: {
1749
+ "application/json": components["schemas"]["Error"];
1750
+ };
1751
+ };
1752
+ };
1753
+ };
1754
+ put?: never;
1755
+ post?: never;
1756
+ delete?: never;
1757
+ options?: never;
1758
+ head?: never;
1759
+ patch?: never;
1760
+ trace?: never;
1761
+ };
1762
+ "/agents/all/cron-runs/outcomes": {
1763
+ parameters: {
1764
+ query?: never;
1765
+ header?: never;
1766
+ path?: never;
1767
+ cookie?: never;
1768
+ };
1769
+ /**
1770
+ * Get cron-run outcomes per phase and context fingerprint
1771
+ * @description Admin-only. Returns, per (phase, contextFingerprint): run, completed, failed, and skipped counts, a skipReasons histogram, avg and p50 duration, avg turns, avg tool calls, and avg first-turn context tokens. Optional `from`/`to` ISO datetime query params bound the range on startedAt.
1772
+ */
1773
+ get: {
1774
+ parameters: {
1775
+ query?: {
1776
+ from?: string;
1777
+ to?: string;
1778
+ };
1779
+ header?: never;
1780
+ path?: never;
1781
+ cookie?: never;
1782
+ };
1783
+ requestBody?: never;
1784
+ responses: {
1785
+ /** @description Outcome series per (phase, contextFingerprint) */
1786
+ 200: {
1787
+ headers: {
1788
+ [name: string]: unknown;
1789
+ };
1790
+ content: {
1791
+ "application/json": components["schemas"]["CronRunOutcomes"];
1792
+ };
1793
+ };
1794
+ /** @description Unauthorized */
1795
+ 401: {
1796
+ headers: {
1797
+ [name: string]: unknown;
1798
+ };
1799
+ content: {
1800
+ "application/json": components["schemas"]["Error"];
1801
+ };
1802
+ };
1803
+ /** @description Forbidden — requires admin scope */
1804
+ 403: {
1805
+ headers: {
1806
+ [name: string]: unknown;
1807
+ };
1808
+ content: {
1809
+ "application/json": components["schemas"]["Error"];
1810
+ };
1811
+ };
1812
+ };
1813
+ };
1814
+ put?: never;
1815
+ post?: never;
1816
+ delete?: never;
1817
+ options?: never;
1818
+ head?: never;
1819
+ patch?: never;
1820
+ trace?: never;
1821
+ };
1822
+ "/agents/{id}/cron-runs/stats": {
1823
+ parameters: {
1824
+ query?: never;
1825
+ header?: never;
1826
+ path?: never;
1827
+ cookie?: never;
1828
+ };
1829
+ /**
1830
+ * Get aggregated cron-run token stats for one agent
1831
+ * @description Same shape as GET /agents/all/cron-runs/stats, scoped to the given agent's runs. An agent's own bearer token may read its own stats; other agents' tokens are rejected. Optional `from`/`to` ISO datetime query params bound the range.
1832
+ */
1833
+ get: {
1834
+ parameters: {
1835
+ query?: {
1836
+ from?: string;
1837
+ to?: string;
1838
+ };
1839
+ header?: never;
1840
+ path: {
1841
+ id: string;
1842
+ };
1843
+ cookie?: never;
1844
+ };
1845
+ requestBody?: never;
1846
+ responses: {
1847
+ /** @description Aggregated cron-run token stats for the agent */
1848
+ 200: {
1849
+ headers: {
1850
+ [name: string]: unknown;
1851
+ };
1852
+ content: {
1853
+ "application/json": components["schemas"]["CronRunTokenStats"];
1854
+ };
1855
+ };
1856
+ /** @description Unauthorized */
1857
+ 401: {
1858
+ headers: {
1859
+ [name: string]: unknown;
1860
+ };
1861
+ content: {
1862
+ "application/json": components["schemas"]["Error"];
1863
+ };
1864
+ };
1865
+ /** @description Forbidden */
1866
+ 403: {
1867
+ headers: {
1868
+ [name: string]: unknown;
1869
+ };
1870
+ content: {
1871
+ "application/json": components["schemas"]["Error"];
1872
+ };
1873
+ };
1874
+ };
1875
+ };
1876
+ put?: never;
1877
+ post?: never;
1878
+ delete?: never;
1879
+ options?: never;
1880
+ head?: never;
1881
+ patch?: never;
1882
+ trace?: never;
1883
+ };
1884
+ "/agents/{id}/cron-runs/outcomes": {
1885
+ parameters: {
1886
+ query?: never;
1887
+ header?: never;
1888
+ path?: never;
1889
+ cookie?: never;
1890
+ };
1891
+ /**
1892
+ * Get cron-run outcomes per phase and context fingerprint for one agent
1893
+ * @description Same shape as GET /agents/all/cron-runs/outcomes, scoped to the given agent's runs. An agent's own bearer token may read its own outcomes; other agents' tokens are rejected. Optional `from`/`to` ISO datetime query params bound the range on startedAt.
1894
+ */
1895
+ get: {
1896
+ parameters: {
1897
+ query?: {
1898
+ from?: string;
1899
+ to?: string;
1900
+ };
1901
+ header?: never;
1902
+ path: {
1903
+ id: string;
1904
+ };
1905
+ cookie?: never;
1906
+ };
1907
+ requestBody?: never;
1908
+ responses: {
1909
+ /** @description Outcome series per (phase, contextFingerprint) for the agent */
1910
+ 200: {
1911
+ headers: {
1912
+ [name: string]: unknown;
1913
+ };
1914
+ content: {
1915
+ "application/json": components["schemas"]["CronRunOutcomes"];
1916
+ };
1917
+ };
1918
+ /** @description Unauthorized */
1919
+ 401: {
1920
+ headers: {
1921
+ [name: string]: unknown;
1922
+ };
1923
+ content: {
1924
+ "application/json": components["schemas"]["Error"];
1925
+ };
1926
+ };
1927
+ /** @description Forbidden */
1928
+ 403: {
1929
+ headers: {
1930
+ [name: string]: unknown;
1931
+ };
1932
+ content: {
1933
+ "application/json": components["schemas"]["Error"];
1934
+ };
1935
+ };
1936
+ };
1937
+ };
1938
+ put?: never;
1939
+ post?: never;
1940
+ delete?: never;
1941
+ options?: never;
1942
+ head?: never;
1943
+ patch?: never;
1944
+ trace?: never;
1945
+ };
1946
+ "/agents/all/cron-runs/dev-task-adherence": {
1947
+ parameters: {
1948
+ query?: never;
1949
+ header?: never;
1950
+ path?: never;
1951
+ cookie?: never;
1952
+ };
1953
+ /**
1954
+ * Get dev-task adherence report
1955
+ * @description Admin-only. Per dev-task run, compares skill-usage subagent dispatches against the required-steps table and reports per-step ran/skipped, with per-step adherence rates overall, per variant (contextFingerprint) and per commandVariant (default vs alternate). Rates cover task-bearing runs only (dispatched against a work item); `counts` separates them from silent no-ready-task ticks. A dispatch proves a step started, not that it was done well. Optional `from`/`to` ISO datetime params bound startedAt.
1956
+ */
1957
+ get: {
1958
+ parameters: {
1959
+ query?: {
1960
+ from?: string;
1961
+ to?: string;
1962
+ };
1963
+ header?: never;
1964
+ path?: never;
1965
+ cookie?: never;
1966
+ };
1967
+ requestBody?: never;
1968
+ responses: {
1969
+ /** @description Dev-task adherence report */
1970
+ 200: {
1971
+ headers: {
1972
+ [name: string]: unknown;
1973
+ };
1974
+ content: {
1975
+ "application/json": {
1976
+ [key: string]: unknown;
1977
+ };
1978
+ };
1979
+ };
1980
+ /** @description Unauthorized */
1981
+ 401: {
1982
+ headers: {
1983
+ [name: string]: unknown;
1984
+ };
1985
+ content: {
1986
+ "application/json": components["schemas"]["Error"];
1987
+ };
1988
+ };
1989
+ /** @description Forbidden — requires admin scope */
1990
+ 403: {
1991
+ headers: {
1992
+ [name: string]: unknown;
1993
+ };
1994
+ content: {
1995
+ "application/json": components["schemas"]["Error"];
1996
+ };
1997
+ };
1998
+ /** @description Adherence reporting not configured */
1999
+ 404: {
2000
+ headers: {
2001
+ [name: string]: unknown;
2002
+ };
2003
+ content: {
2004
+ "application/json": components["schemas"]["Error"];
2005
+ };
2006
+ };
2007
+ };
2008
+ };
2009
+ put?: never;
2010
+ post?: never;
2011
+ delete?: never;
2012
+ options?: never;
2013
+ head?: never;
2014
+ patch?: never;
2015
+ trace?: never;
2016
+ };
2017
+ "/agents/{id}/dev-task-adherence": {
2018
+ parameters: {
2019
+ query?: never;
2020
+ header?: never;
2021
+ path?: never;
2022
+ cookie?: never;
2023
+ };
2024
+ /**
2025
+ * Get this agent's dev-task adherence report
2026
+ * @description Self-serve variant of the fleet-wide dev-task adherence report, scoped to the agent in the path. Access is gated by the generic agent-route auth (an agent's own bearer token, an admin, or a member session) — no admin scope required. Same report shape and optional `from`/`to` params as GET /agents/all/cron-runs/dev-task-adherence.
2027
+ */
2028
+ get: {
2029
+ parameters: {
2030
+ query?: {
2031
+ from?: string;
2032
+ to?: string;
2033
+ };
2034
+ header?: never;
2035
+ path: {
2036
+ id: string;
2037
+ };
2038
+ cookie?: never;
2039
+ };
2040
+ requestBody?: never;
2041
+ responses: {
2042
+ /** @description Dev-task adherence report for this agent's runs only */
2043
+ 200: {
2044
+ headers: {
2045
+ [name: string]: unknown;
2046
+ };
2047
+ content: {
2048
+ "application/json": {
2049
+ [key: string]: unknown;
2050
+ };
2051
+ };
2052
+ };
2053
+ /** @description Unauthorized */
2054
+ 401: {
2055
+ headers: {
2056
+ [name: string]: unknown;
2057
+ };
2058
+ content: {
2059
+ "application/json": components["schemas"]["Error"];
2060
+ };
2061
+ };
2062
+ /** @description Forbidden */
2063
+ 403: {
2064
+ headers: {
2065
+ [name: string]: unknown;
2066
+ };
2067
+ content: {
2068
+ "application/json": components["schemas"]["Error"];
2069
+ };
2070
+ };
2071
+ /** @description Adherence reporting not configured */
2072
+ 404: {
2073
+ headers: {
2074
+ [name: string]: unknown;
2075
+ };
2076
+ content: {
2077
+ "application/json": components["schemas"]["Error"];
2078
+ };
2079
+ };
2080
+ };
2081
+ };
2082
+ put?: never;
2083
+ post?: never;
2084
+ delete?: never;
2085
+ options?: never;
2086
+ head?: never;
2087
+ patch?: never;
2088
+ trace?: never;
2089
+ };
2090
+ "/agents/chat-tokens/daily/stats": {
2091
+ parameters: {
2092
+ query?: never;
2093
+ header?: never;
2094
+ path?: never;
2095
+ cookie?: never;
2096
+ };
2097
+ /**
2098
+ * Get aggregated chat token daily stats
2099
+ * @description Admin-only. Returns Slack chat token usage aggregated across all agents, broken down by agent, model, and day. Optional `from`/`to` YYYY-MM-DD query params bound the range.
2100
+ */
2101
+ get: {
2102
+ parameters: {
2103
+ query?: {
2104
+ from?: string;
2105
+ to?: string;
2106
+ };
2107
+ header?: never;
2108
+ path?: never;
2109
+ cookie?: never;
2110
+ };
2111
+ requestBody?: never;
2112
+ responses: {
2113
+ /** @description Aggregated chat token daily stats across all agents */
2114
+ 200: {
2115
+ headers: {
2116
+ [name: string]: unknown;
2117
+ };
2118
+ content: {
2119
+ "application/json": components["schemas"]["ChatTokenStats"];
2120
+ };
2121
+ };
2122
+ /** @description Unauthorized */
2123
+ 401: {
2124
+ headers: {
2125
+ [name: string]: unknown;
2126
+ };
2127
+ content: {
2128
+ "application/json": components["schemas"]["Error"];
2129
+ };
2130
+ };
2131
+ /** @description Forbidden — requires admin scope */
2132
+ 403: {
2133
+ headers: {
2134
+ [name: string]: unknown;
2135
+ };
2136
+ content: {
2137
+ "application/json": components["schemas"]["Error"];
2138
+ };
2139
+ };
2140
+ };
2141
+ };
2142
+ put?: never;
2143
+ post?: never;
2144
+ delete?: never;
2145
+ options?: never;
2146
+ head?: never;
2147
+ patch?: never;
2148
+ trace?: never;
2149
+ };
2150
+ "/agents/{id}/chat-tokens/daily/stats": {
2151
+ parameters: {
2152
+ query?: never;
2153
+ header?: never;
2154
+ path?: never;
2155
+ cookie?: never;
2156
+ };
2157
+ /**
2158
+ * Get this agent's chat token daily stats
2159
+ * @description Self-serve variant of the fleet-wide chat token daily stats, scoped to the agent in the path. Access is gated by the generic agent-route auth (an agent's own bearer token, an admin, or a member session) — no admin scope required. Same response shape and optional `from`/`to` params as GET /agents/chat-tokens/daily/stats.
2160
+ */
2161
+ get: {
2162
+ parameters: {
2163
+ query?: {
2164
+ from?: string;
2165
+ to?: string;
2166
+ };
2167
+ header?: never;
2168
+ path: {
2169
+ id: string;
2170
+ };
2171
+ cookie?: never;
2172
+ };
2173
+ requestBody?: never;
2174
+ responses: {
2175
+ /** @description Chat token daily stats for this agent only */
2176
+ 200: {
2177
+ headers: {
2178
+ [name: string]: unknown;
2179
+ };
2180
+ content: {
2181
+ "application/json": components["schemas"]["ChatTokenStats"];
2182
+ };
2183
+ };
2184
+ /** @description Unauthorized */
2185
+ 401: {
2186
+ headers: {
2187
+ [name: string]: unknown;
2188
+ };
2189
+ content: {
2190
+ "application/json": components["schemas"]["Error"];
2191
+ };
2192
+ };
2193
+ /** @description Forbidden */
2194
+ 403: {
2195
+ headers: {
2196
+ [name: string]: unknown;
2197
+ };
2198
+ content: {
2199
+ "application/json": components["schemas"]["Error"];
2200
+ };
2201
+ };
2202
+ };
2203
+ };
2204
+ put?: never;
2205
+ post?: never;
2206
+ delete?: never;
2207
+ options?: never;
2208
+ head?: never;
2209
+ patch?: never;
2210
+ trace?: never;
2211
+ };
2212
+ "/agents/{id}/chat-tokens/daily": {
2213
+ parameters: {
2214
+ query?: never;
2215
+ header?: never;
2216
+ path?: never;
2217
+ cookie?: never;
2218
+ };
2219
+ get?: never;
2220
+ put?: never;
2221
+ /**
2222
+ * Record daily chat token usage
2223
+ * @description Atomically accumulates Slack chat token usage into the existing rows for each `(agentId, date, model)` tuple, creating them if absent. Supply a `modelBreakdown` array to split a single day's usage across multiple models. Returns the updated daily rows, one per model.
2224
+ */
2225
+ post: {
2226
+ parameters: {
2227
+ query?: never;
2228
+ header?: never;
2229
+ path: {
2230
+ id: string;
2231
+ };
2232
+ cookie?: never;
2233
+ };
2234
+ requestBody?: {
2235
+ content: {
2236
+ "application/json": components["schemas"]["UpsertChatTokenDailyBody"];
2237
+ };
2238
+ };
2239
+ responses: {
2240
+ /** @description Updated daily chat token usage rows (one per model) */
2241
+ 200: {
2242
+ headers: {
2243
+ [name: string]: unknown;
2244
+ };
2245
+ content: {
2246
+ "application/json": components["schemas"]["AgentChatTokenUsageDailyByModel"][];
2247
+ };
2248
+ };
2249
+ /** @description Bad request */
2250
+ 400: {
2251
+ headers: {
2252
+ [name: string]: unknown;
2253
+ };
2254
+ content: {
2255
+ "application/json": components["schemas"]["Error"];
2256
+ };
2257
+ };
2258
+ /** @description Agent not found */
2259
+ 404: {
2260
+ headers: {
2261
+ [name: string]: unknown;
2262
+ };
2263
+ content: {
2264
+ "application/json": components["schemas"]["Error"];
2265
+ };
2266
+ };
2267
+ };
2268
+ };
2269
+ delete?: never;
2270
+ options?: never;
2271
+ head?: never;
2272
+ patch?: never;
2273
+ trace?: never;
2274
+ };
2275
+ "/agents/{id}/work-queue": {
2276
+ parameters: {
2277
+ query?: never;
2278
+ header?: never;
2279
+ path?: never;
2280
+ cookie?: never;
2281
+ };
2282
+ /**
2283
+ * Get the latest work-queue snapshot
2284
+ * @description Returns the most recently pushed work-queue snapshot, or 404 if the agent has never pushed one.
2285
+ */
2286
+ get: {
2287
+ parameters: {
2288
+ query?: never;
2289
+ header?: never;
2290
+ path: {
2291
+ id: string;
2292
+ };
2293
+ cookie?: never;
2294
+ };
2295
+ requestBody?: never;
2296
+ responses: {
2297
+ /** @description Latest work-queue snapshot */
2298
+ 200: {
2299
+ headers: {
2300
+ [name: string]: unknown;
2301
+ };
2302
+ content: {
2303
+ "application/json": components["schemas"]["WorkQueueSnapshotWrapper"];
2304
+ };
2305
+ };
2306
+ /** @description No snapshot pushed yet */
2307
+ 404: {
2308
+ headers: {
2309
+ [name: string]: unknown;
2310
+ };
2311
+ content: {
2312
+ "application/json": components["schemas"]["Error"];
2313
+ };
2314
+ };
2315
+ };
2316
+ };
2317
+ put?: never;
2318
+ /**
2319
+ * Push a work-queue snapshot
2320
+ * @description Upserts the agent's single ranked work-queue snapshot (tasks/PRs across pipeline phases), overwriting any prior snapshot — there is no history.
2321
+ */
2322
+ post: {
2323
+ parameters: {
2324
+ query?: never;
2325
+ header?: never;
2326
+ path: {
2327
+ id: string;
2328
+ };
2329
+ cookie?: never;
2330
+ };
2331
+ requestBody?: {
2332
+ content: {
2333
+ "application/json": components["schemas"]["PushWorkQueueSnapshotBody"];
2334
+ };
2335
+ };
2336
+ responses: {
2337
+ /** @description Snapshot upserted (overwrites any prior snapshot for this agent) */
2338
+ 200: {
2339
+ headers: {
2340
+ [name: string]: unknown;
2341
+ };
2342
+ content: {
2343
+ "application/json": components["schemas"]["WorkQueueSnapshotWrapper"];
2344
+ };
2345
+ };
2346
+ /** @description Bad request */
2347
+ 400: {
2348
+ headers: {
2349
+ [name: string]: unknown;
2350
+ };
2351
+ content: {
2352
+ "application/json": components["schemas"]["Error"];
2353
+ };
2354
+ };
2355
+ };
2356
+ };
2357
+ delete?: never;
2358
+ options?: never;
2359
+ head?: never;
2360
+ patch?: never;
2361
+ trace?: never;
2362
+ };
2363
+ "/agents/{id}/github-installations": {
2364
+ parameters: {
2365
+ query?: never;
2366
+ header?: never;
2367
+ path?: never;
2368
+ cookie?: never;
2369
+ };
2370
+ /**
2371
+ * Get the latest GitHub installations snapshot
2372
+ * @description Returns the most recently reported GitHub installations snapshot, or 404 if the agent has never reported one.
2373
+ */
2374
+ get: {
2375
+ parameters: {
2376
+ query?: never;
2377
+ header?: never;
2378
+ path: {
2379
+ id: string;
2380
+ };
2381
+ cookie?: never;
2382
+ };
2383
+ requestBody?: never;
2384
+ responses: {
2385
+ /** @description Latest GitHub installations snapshot */
2386
+ 200: {
2387
+ headers: {
2388
+ [name: string]: unknown;
2389
+ };
2390
+ content: {
2391
+ "application/json": components["schemas"]["GitHubInstallationsSnapshotWrapper"];
2392
+ };
2393
+ };
2394
+ /** @description Unauthorized */
2395
+ 401: {
2396
+ headers: {
2397
+ [name: string]: unknown;
2398
+ };
2399
+ content: {
2400
+ "application/json": components["schemas"]["Error"];
2401
+ };
2402
+ };
2403
+ /** @description Forbidden — token does not own this agent */
2404
+ 403: {
2405
+ headers: {
2406
+ [name: string]: unknown;
2407
+ };
2408
+ content: {
2409
+ "application/json": components["schemas"]["Error"];
2410
+ };
2411
+ };
2412
+ /** @description No snapshot reported yet */
2413
+ 404: {
2414
+ headers: {
2415
+ [name: string]: unknown;
2416
+ };
2417
+ content: {
2418
+ "application/json": components["schemas"]["Error"];
2419
+ };
2420
+ };
2421
+ };
2422
+ };
2423
+ /**
2424
+ * Replace the agent's GitHub installations snapshot
2425
+ * @description Upserts the agent's single GitHub App installations snapshot (owner, installation id, state, sanitized lastError), replacing the prior list wholesale — an installation absent from the body is dropped. The body schema is closed: unknown fields (e.g. tokens) are rejected with 400.
2426
+ */
2427
+ put: {
2428
+ parameters: {
2429
+ query?: never;
2430
+ header?: never;
2431
+ path: {
2432
+ id: string;
2433
+ };
2434
+ cookie?: never;
2435
+ };
2436
+ requestBody?: {
2437
+ content: {
2438
+ "application/json": components["schemas"]["PutGitHubInstallationsBody"];
2439
+ };
2440
+ };
2441
+ responses: {
2442
+ /** @description Snapshot replaced */
2443
+ 200: {
2444
+ headers: {
2445
+ [name: string]: unknown;
2446
+ };
2447
+ content: {
2448
+ "application/json": components["schemas"]["GitHubInstallationsSnapshotWrapper"];
2449
+ };
2450
+ };
2451
+ /** @description Bad request */
2452
+ 400: {
2453
+ headers: {
2454
+ [name: string]: unknown;
2455
+ };
2456
+ content: {
2457
+ "application/json": components["schemas"]["Error"];
2458
+ };
2459
+ };
2460
+ /** @description Unauthorized */
2461
+ 401: {
2462
+ headers: {
2463
+ [name: string]: unknown;
2464
+ };
2465
+ content: {
2466
+ "application/json": components["schemas"]["Error"];
2467
+ };
2468
+ };
2469
+ /** @description Forbidden — token does not own this agent */
2470
+ 403: {
2471
+ headers: {
2472
+ [name: string]: unknown;
2473
+ };
2474
+ content: {
2475
+ "application/json": components["schemas"]["Error"];
2476
+ };
2477
+ };
2478
+ };
2479
+ };
2480
+ post?: never;
2481
+ delete?: never;
2482
+ options?: never;
2483
+ head?: never;
2484
+ patch?: never;
2485
+ trace?: never;
2486
+ };
2487
+ "/agents/{id}/config": {
2488
+ parameters: {
2489
+ query?: never;
2490
+ header?: never;
2491
+ path?: never;
2492
+ cookie?: never;
2493
+ };
2494
+ /**
2495
+ * Get agent config bundle
2496
+ * @description Returns the agent's full runtime config bundle — decrypted env vars, allowed-tools patterns, installed plugins (with derived marketplace), scoped repos, review/patch author allowlists, and Slack membership-restriction settings. Polled by the agent harness on startup and during its config sync loop. Returns 404 if the agent doesn't exist.
2497
+ */
2498
+ get: {
2499
+ parameters: {
2500
+ query?: never;
2501
+ header?: never;
2502
+ path: {
2503
+ id: string;
2504
+ };
2505
+ cookie?: never;
2506
+ };
2507
+ requestBody?: never;
2508
+ responses: {
2509
+ /** @description Agent config bundle */
2510
+ 200: {
2511
+ headers: {
2512
+ [name: string]: unknown;
2513
+ };
2514
+ content: {
2515
+ "application/json": components["schemas"]["AgentConfigResponse"];
2516
+ };
2517
+ };
2518
+ /** @description Unauthorized */
2519
+ 401: {
2520
+ headers: {
2521
+ [name: string]: unknown;
2522
+ };
2523
+ content: {
2524
+ "application/json": components["schemas"]["RuntimeError"];
2525
+ };
2526
+ };
2527
+ /** @description Agent not found */
2528
+ 404: {
2529
+ headers: {
2530
+ [name: string]: unknown;
2531
+ };
2532
+ content: {
2533
+ "application/json": components["schemas"]["RuntimeError"];
2534
+ };
2535
+ };
2536
+ };
2537
+ };
2538
+ put?: never;
2539
+ post?: never;
2540
+ delete?: never;
2541
+ options?: never;
2542
+ head?: never;
2543
+ patch?: never;
2544
+ trace?: never;
2545
+ };
2546
+ "/agents/{id}/chat-credentials": {
2547
+ parameters: {
2548
+ query?: never;
2549
+ header?: never;
2550
+ path?: never;
2551
+ cookie?: never;
2552
+ };
2553
+ /**
2554
+ * List chat credentials
2555
+ * @description Lists the chat-service tokens scoped to the agent (id and label only — raw values are never returned). `*` or `platform.ops` callers only.
2556
+ */
2557
+ get: {
2558
+ parameters: {
2559
+ query?: never;
2560
+ header?: never;
2561
+ path: {
2562
+ id: string;
2563
+ };
2564
+ cookie?: never;
2565
+ };
2566
+ requestBody?: never;
2567
+ responses: {
2568
+ /** @description Chat credential metadata */
2569
+ 200: {
2570
+ headers: {
2571
+ [name: string]: unknown;
2572
+ };
2573
+ content: {
2574
+ "application/json": components["schemas"]["ChatCredentialsWrapper"];
2575
+ };
2576
+ };
2577
+ /** @description Forbidden */
2578
+ 403: {
2579
+ headers: {
2580
+ [name: string]: unknown;
2581
+ };
2582
+ content: {
2583
+ "application/json": components["schemas"]["Error"];
2584
+ };
2585
+ };
2586
+ /** @description Not found, or chat-credential minting disabled */
2587
+ 404: {
2588
+ headers: {
2589
+ [name: string]: unknown;
2590
+ };
2591
+ content: {
2592
+ "application/json": components["schemas"]["Error"];
2593
+ };
2594
+ };
2595
+ /** @description Chat service not configured */
2596
+ 503: {
2597
+ headers: {
2598
+ [name: string]: unknown;
2599
+ };
2600
+ content: {
2601
+ "application/json": components["schemas"]["Error"];
2602
+ };
2603
+ };
2604
+ };
2605
+ };
2606
+ put?: never;
2607
+ /**
2608
+ * Mint a chat credential
2609
+ * @description Mints a chat-service token scoped to the agent in the path. `*` or `platform.ops` callers only — never the agent's own key. The body is closed: an `agentId` field is rejected with 400, so an unrestricted chat admin token cannot be minted here. The raw token is returned once and is never logged or stored by admin. 404 unless SHIPWRIGHT_CHAT_TOKEN_MINT_ENABLED is `enabled`.
2610
+ */
2611
+ post: {
2612
+ parameters: {
2613
+ query?: never;
2614
+ header?: never;
2615
+ path: {
2616
+ id: string;
2617
+ };
2618
+ cookie?: never;
2619
+ };
2620
+ requestBody?: {
2621
+ content: {
2622
+ "application/json": components["schemas"]["CreateChatCredentialBody"];
2623
+ };
2624
+ };
2625
+ responses: {
2626
+ /** @description Credential minted (raw token returned once) */
2627
+ 201: {
2628
+ headers: {
2629
+ [name: string]: unknown;
2630
+ };
2631
+ content: {
2632
+ "application/json": components["schemas"]["CreateChatCredentialResponse"];
2633
+ };
2634
+ };
2635
+ /** @description Bad request */
2636
+ 400: {
2637
+ headers: {
2638
+ [name: string]: unknown;
2639
+ };
2640
+ content: {
2641
+ "application/json": components["schemas"]["Error"];
2642
+ };
2643
+ };
2644
+ /** @description Forbidden */
2645
+ 403: {
2646
+ headers: {
2647
+ [name: string]: unknown;
2648
+ };
2649
+ content: {
2650
+ "application/json": components["schemas"]["Error"];
2651
+ };
2652
+ };
2653
+ /** @description Not found, or chat-credential minting disabled */
2654
+ 404: {
2655
+ headers: {
2656
+ [name: string]: unknown;
2657
+ };
2658
+ content: {
2659
+ "application/json": components["schemas"]["Error"];
2660
+ };
2661
+ };
2662
+ /** @description Chat service not configured */
2663
+ 503: {
2664
+ headers: {
2665
+ [name: string]: unknown;
2666
+ };
2667
+ content: {
2668
+ "application/json": components["schemas"]["Error"];
2669
+ };
2670
+ };
2671
+ };
2672
+ };
2673
+ delete?: never;
2674
+ options?: never;
2675
+ head?: never;
2676
+ patch?: never;
2677
+ trace?: never;
2678
+ };
2679
+ "/agents/{id}/chat-credentials/{tokenId}": {
2680
+ parameters: {
2681
+ query?: never;
2682
+ header?: never;
2683
+ path?: never;
2684
+ cookie?: never;
2685
+ };
2686
+ get?: never;
2687
+ put?: never;
2688
+ post?: never;
2689
+ /**
2690
+ * Revoke a chat credential
2691
+ * @description Revokes a chat-service token. 404 when the token is not scoped to the agent in the path. `*` or `platform.ops` callers only.
2692
+ */
2693
+ delete: {
2694
+ parameters: {
2695
+ query?: never;
2696
+ header?: never;
2697
+ path: {
2698
+ id: string;
2699
+ tokenId: string;
2700
+ };
2701
+ cookie?: never;
2702
+ };
2703
+ requestBody?: never;
2704
+ responses: {
2705
+ /** @description Credential revoked */
2706
+ 204: {
2707
+ headers: {
2708
+ [name: string]: unknown;
2709
+ };
2710
+ content?: never;
2711
+ };
2712
+ /** @description Forbidden */
2713
+ 403: {
2714
+ headers: {
2715
+ [name: string]: unknown;
2716
+ };
2717
+ content: {
2718
+ "application/json": components["schemas"]["Error"];
2719
+ };
2720
+ };
2721
+ /** @description Not found, or chat-credential minting disabled */
2722
+ 404: {
2723
+ headers: {
2724
+ [name: string]: unknown;
2725
+ };
2726
+ content: {
2727
+ "application/json": components["schemas"]["Error"];
2728
+ };
2729
+ };
2730
+ /** @description Chat service not configured */
2731
+ 503: {
2732
+ headers: {
2733
+ [name: string]: unknown;
2734
+ };
2735
+ content: {
2736
+ "application/json": components["schemas"]["Error"];
2737
+ };
2738
+ };
2739
+ };
2740
+ };
2741
+ options?: never;
2742
+ head?: never;
2743
+ patch?: never;
2744
+ trace?: never;
2745
+ };
2746
+ "/agents/{id}/ask": {
2747
+ parameters: {
2748
+ query?: never;
2749
+ header?: never;
2750
+ path?: never;
2751
+ cookie?: never;
2752
+ };
2753
+ get?: never;
2754
+ put?: never;
2755
+ /**
2756
+ * Ask another agent a question
2757
+ * @description Posts `question` from agent `from` into a new `kind: ask` chat thread of agent `{id}` (always created with `askDepth: 1`), then, when `waitMs > 0`, polls once per second until the agent replies or the budget ends. Callers: `*`, `platform.ops`, or the agent key whose id equals `from` (never impersonation). The `from>{id}` pair must be on SHIPWRIGHT_AGENT_ASK_ALLOWLIST. Every ask writes an AgentAsk audit row (no question text). 404 unless SHIPWRIGHT_AGENT_ASK_ENABLED is `enabled`; 503 when the chat service is not configured.
2758
+ */
2759
+ post: {
2760
+ parameters: {
2761
+ query?: never;
2762
+ header?: never;
2763
+ path: {
2764
+ id: string;
2765
+ };
2766
+ cookie?: never;
2767
+ };
2768
+ requestBody?: {
2769
+ content: {
2770
+ "application/json": components["schemas"]["AgentAskBody"];
2771
+ };
2772
+ };
2773
+ responses: {
2774
+ /** @description Ask posted; `replied` with the reply, or `pending` */
2775
+ 201: {
2776
+ headers: {
2777
+ [name: string]: unknown;
2778
+ };
2779
+ content: {
2780
+ "application/json": components["schemas"]["AgentAskResponse"];
2781
+ };
2782
+ };
2783
+ /** @description Bad request (including depth other than 1) */
2784
+ 400: {
2785
+ headers: {
2786
+ [name: string]: unknown;
2787
+ };
2788
+ content: {
2789
+ "application/json": components["schemas"]["Error"];
2790
+ };
2791
+ };
2792
+ /** @description Caller not allowed, or the pair is not allowlisted */
2793
+ 403: {
2794
+ headers: {
2795
+ [name: string]: unknown;
2796
+ };
2797
+ content: {
2798
+ "application/json": components["schemas"]["Error"];
2799
+ };
2800
+ };
2801
+ /** @description Agent not found, or agent ask disabled */
2802
+ 404: {
2803
+ headers: {
2804
+ [name: string]: unknown;
2805
+ };
2806
+ content: {
2807
+ "application/json": components["schemas"]["Error"];
2808
+ };
2809
+ };
2810
+ /** @description Chat service not configured */
2811
+ 503: {
2812
+ headers: {
2813
+ [name: string]: unknown;
2814
+ };
2815
+ content: {
2816
+ "application/json": components["schemas"]["Error"];
2817
+ };
2818
+ };
2819
+ };
2820
+ };
2821
+ delete?: never;
2822
+ options?: never;
2823
+ head?: never;
2824
+ patch?: never;
2825
+ trace?: never;
2826
+ };
2827
+ "/agents/{id}/asks": {
2828
+ parameters: {
2829
+ query?: never;
2830
+ header?: never;
2831
+ path?: never;
2832
+ cookie?: never;
2833
+ };
2834
+ /**
2835
+ * List agent asks
2836
+ * @description Lists the AgentAsk audit rows the agent sent or received, newest first. `*`, `platform.read` and `platform.ops` callers only. 404 unless SHIPWRIGHT_AGENT_ASK_ENABLED is `enabled`.
2837
+ */
2838
+ get: {
2839
+ parameters: {
2840
+ query?: {
2841
+ limit?: number;
2842
+ offset?: number | null;
2843
+ };
2844
+ header?: never;
2845
+ path: {
2846
+ id: string;
2847
+ };
2848
+ cookie?: never;
2849
+ };
2850
+ requestBody?: never;
2851
+ responses: {
2852
+ /** @description Audit rows */
2853
+ 200: {
2854
+ headers: {
2855
+ [name: string]: unknown;
2856
+ };
2857
+ content: {
2858
+ "application/json": components["schemas"]["AgentAskList"];
2859
+ };
2860
+ };
2861
+ /** @description Bad request */
2862
+ 400: {
2863
+ headers: {
2864
+ [name: string]: unknown;
2865
+ };
2866
+ content: {
2867
+ "application/json": components["schemas"]["Error"];
2868
+ };
2869
+ };
2870
+ /** @description Forbidden */
2871
+ 403: {
2872
+ headers: {
2873
+ [name: string]: unknown;
2874
+ };
2875
+ content: {
2876
+ "application/json": components["schemas"]["Error"];
2877
+ };
2878
+ };
2879
+ /** @description Agent ask disabled */
2880
+ 404: {
2881
+ headers: {
2882
+ [name: string]: unknown;
2883
+ };
2884
+ content: {
2885
+ "application/json": components["schemas"]["Error"];
2886
+ };
2887
+ };
2888
+ };
2889
+ };
2890
+ put?: never;
2891
+ post?: never;
2892
+ delete?: never;
2893
+ options?: never;
2894
+ head?: never;
2895
+ patch?: never;
2896
+ trace?: never;
2897
+ };
2898
+ }
2899
+ export type webhooks = Record<string, never>;
2900
+ export interface components {
2901
+ schemas: {
2902
+ ReconcileAgentsResult: {
2903
+ recreated: string[];
2904
+ updated: string[];
2905
+ orphans: string[];
2906
+ failed: {
2907
+ agentId: string;
2908
+ error: string;
2909
+ }[];
2910
+ /** @description perAgent identity mode: agents moved (or, in a dry run, that would be moved) onto their own newly created identity */
2911
+ migrated: string[];
2912
+ /** @description perAgent identity mode: agents skipped because they have no owner; left unmodified */
2913
+ noOwner: string[];
2914
+ dryRun: boolean;
2915
+ };
2916
+ Error: {
2917
+ /** @example not found */
2918
+ error: string;
2919
+ };
2920
+ StripCredentialsResult: {
2921
+ dryRun: boolean;
2922
+ agents: {
2923
+ agentId: string;
2924
+ keys: string[];
2925
+ }[];
2926
+ };
2927
+ ProvisionAgentResult: {
2928
+ resourceName: string;
2929
+ secretName: string;
2930
+ deploymentName: string;
2931
+ };
2932
+ ProvisionSkippedResult: {
2933
+ /** @enum {boolean} */
2934
+ skipped: true;
2935
+ reason: string;
2936
+ };
2937
+ GetAgentResult: {
2938
+ id: string;
2939
+ name: string;
2940
+ slackId?: string | null;
2941
+ selfHosted: boolean;
2942
+ repos: string[];
2943
+ reviewAuthorAllowlist: string[];
2944
+ patchAuthorAllowlist: string[];
2945
+ restrictSlackToMembers: boolean;
2946
+ typeName: string;
2947
+ accountId: string | null;
2948
+ /** Format: date-time */
2949
+ createdAt: string;
2950
+ /** Format: date-time */
2951
+ updatedAt: string;
2952
+ missingRequiredEnv: string[];
2953
+ warning?: string;
2954
+ /** Format: date-time */
2955
+ trialExpiresAt?: string | null;
2956
+ /** Format: date-time */
2957
+ trialExpiryWarnedAt?: string | null;
2958
+ /** @example true */
2959
+ autoPostReviews: boolean;
2960
+ /** @example false */
2961
+ allowSelfReview: boolean;
2962
+ /** @example 75 */
2963
+ minConfidence: number;
2964
+ /** @example 5 */
2965
+ maxFindings: number;
2966
+ /** @example true */
2967
+ cleanupMergedWorktrees: boolean;
2968
+ /** @example 14 */
2969
+ cleanupAfterDays: number;
2970
+ /** @example jane.doe@example.com */
2971
+ ownerEmail: string | null;
2972
+ /** @example shipwright-my-agent */
2973
+ anthropicIdentityName: string | null;
2974
+ /** @example svac_01ABC */
2975
+ anthropicServiceAccountId: string | null;
2976
+ /** @example fdrl_01XYZ */
2977
+ anthropicFederationRuleId: string | null;
2978
+ };
2979
+ PatchAgentBody: {
2980
+ /** @example U0AALR8M69X */
2981
+ slackId?: string | null;
2982
+ /** @example false */
2983
+ selfHosted?: boolean;
2984
+ /**
2985
+ * @example [
2986
+ * "my-org/my-repo"
2987
+ * ]
2988
+ */
2989
+ repos?: string[];
2990
+ /**
2991
+ * @example [
2992
+ * "octocat"
2993
+ * ]
2994
+ */
2995
+ reviewAuthorAllowlist?: string[];
2996
+ /**
2997
+ * @example [
2998
+ * "octocat"
2999
+ * ]
3000
+ */
3001
+ patchAuthorAllowlist?: string[];
3002
+ /** @example false */
3003
+ restrictSlackToMembers?: boolean;
3004
+ /** @example acct_123 */
3005
+ accountId?: string | null;
3006
+ /**
3007
+ * Format: date-time
3008
+ * @example 2026-12-01T00:00:00.000Z
3009
+ */
3010
+ trialExpiresAt?: string | null;
3011
+ /** @example true */
3012
+ autoPostReviews?: boolean;
3013
+ /** @example false */
3014
+ allowSelfReview?: boolean;
3015
+ /** @example 75 */
3016
+ minConfidence?: number;
3017
+ /** @example 5 */
3018
+ maxFindings?: number;
3019
+ /** @example true */
3020
+ cleanupMergedWorktrees?: boolean;
3021
+ /** @example 14 */
3022
+ cleanupAfterDays?: number;
3023
+ };
3024
+ AddAgentReposBody: {
3025
+ /**
3026
+ * @example [
3027
+ * "my-org/my-repo"
3028
+ * ]
3029
+ */
3030
+ repos: string[];
3031
+ };
3032
+ DeleteAgentResult: {
3033
+ /** @example true */
3034
+ agentDeleted: boolean;
3035
+ /**
3036
+ * @example [
3037
+ * "k8s",
3038
+ * "task-store-tokens",
3039
+ * "chat-service-tokens-and-threads"
3040
+ * ]
3041
+ */
3042
+ completed: string[];
3043
+ failed: components["schemas"]["FailedStep"][];
3044
+ manualStepsRequired: components["schemas"]["ManualStep"][];
3045
+ };
3046
+ FailedStep: {
3047
+ /** @example k8s */
3048
+ step: string;
3049
+ /** @example k8s API timeout */
3050
+ error: string;
3051
+ };
3052
+ ManualStep: {
3053
+ /** @example GH_TOKEN */
3054
+ key: string;
3055
+ /** @example GH_TOKEN was not automatically revoked — rotate or revoke it manually. */
3056
+ message: string;
3057
+ };
3058
+ DeleteAgentBody: {
3059
+ /** @example xoxp-user-token */
3060
+ xoxpToken?: string;
3061
+ };
3062
+ AgentSummary: {
3063
+ /** @example clx1234567890 */
3064
+ id: string;
3065
+ /** @example Bodhi */
3066
+ name: string;
3067
+ /** @example false */
3068
+ selfHosted: boolean;
3069
+ /** @example coding */
3070
+ typeName: string;
3071
+ };
3072
+ CreateAgentBody: {
3073
+ /** @example Bodhi */
3074
+ name: string;
3075
+ /** @example coding */
3076
+ typeName: string;
3077
+ /** @example in-cluster */
3078
+ runtime?: string;
3079
+ /** @example my-org/my-repo */
3080
+ reposRaw?: string;
3081
+ /** @example octocat */
3082
+ authorAllowlistRaw?: string;
3083
+ /** @example octocat */
3084
+ patchAuthorAllowlistRaw?: string;
3085
+ /** @example dev@example.com */
3086
+ memberEmailsRaw?: string;
3087
+ /** @example true */
3088
+ restrictSlackToMembersRaw?: string;
3089
+ claudeCodeOauthToken?: string;
3090
+ anthropicApiKey?: string;
3091
+ };
3092
+ Ok: {
3093
+ /** @enum {boolean} */
3094
+ ok: true;
3095
+ };
3096
+ AgentEnvBody: {
3097
+ [key: string]: string;
3098
+ };
3099
+ AgentEnvResponse: {
3100
+ /**
3101
+ * @example {
3102
+ * "MY_VAR": "value"
3103
+ * }
3104
+ */
3105
+ env: {
3106
+ [key: string]: string;
3107
+ };
3108
+ /**
3109
+ * @example [
3110
+ * "MY_SECRET"
3111
+ * ]
3112
+ */
3113
+ secretKeys: string[];
3114
+ };
3115
+ AgentEnvPatchBody: {
3116
+ /**
3117
+ * @example {
3118
+ * "MY_VAR": "value"
3119
+ * }
3120
+ */
3121
+ env: {
3122
+ [key: string]: string;
3123
+ };
3124
+ /**
3125
+ * @example [
3126
+ * "MY_SECRET"
3127
+ * ]
3128
+ */
3129
+ secretKeys?: string[];
3130
+ };
3131
+ CronWrapper: {
3132
+ cron: components["schemas"]["AgentCronJob"];
3133
+ };
3134
+ AgentCronJob: {
3135
+ /** @example clx1234567890 */
3136
+ id: string;
3137
+ /** @example clx1234567890 */
3138
+ agentId: string;
3139
+ /** @example 0 9 * * 1-5 */
3140
+ schedule: string;
3141
+ /** @example Run the morning brief. */
3142
+ prompt: string;
3143
+ /** @example C01234567 */
3144
+ channel: string | null;
3145
+ /** @example U0AALR8M69X */
3146
+ user: string | null;
3147
+ /** @example false */
3148
+ silent: boolean;
3149
+ /** @example true */
3150
+ enabled: boolean;
3151
+ /** @example shipwright:check-dev-task.ts */
3152
+ preCheck: string | null;
3153
+ /** @example morning-brief */
3154
+ name: string | null;
3155
+ /** @example false */
3156
+ system: boolean;
3157
+ /** @example null */
3158
+ parentCronId: string | null;
3159
+ /**
3160
+ * Format: date-time
3161
+ * @example 2026-01-01T00:00:00.000Z
3162
+ */
3163
+ createdAt: string;
3164
+ /**
3165
+ * Format: date-time
3166
+ * @example 2026-01-01T00:00:00.000Z
3167
+ */
3168
+ updatedAt: string;
3169
+ };
3170
+ CreateAgentCronJobBody: {
3171
+ /** @example 0 9 * * 1-5 */
3172
+ schedule: string;
3173
+ /** @example Run the morning brief. */
3174
+ prompt: string;
3175
+ /** @example C01234567 */
3176
+ channel?: string | null;
3177
+ /** @example U0AALR8M69X */
3178
+ user?: string | null;
3179
+ /** @example false */
3180
+ silent?: boolean;
3181
+ /** @example true */
3182
+ enabled?: boolean;
3183
+ /** @example shipwright:check-dev-task.ts */
3184
+ preCheck?: string | null;
3185
+ /** @example morning-brief */
3186
+ name?: string | null;
3187
+ };
3188
+ ReconcileCronResult: {
3189
+ created: number;
3190
+ updated: number;
3191
+ deleted: number;
3192
+ };
3193
+ PatchAgentCronJobBody: {
3194
+ /** @example 0 9 * * 1-5 */
3195
+ schedule?: string;
3196
+ /** @example Run the morning brief. */
3197
+ prompt?: string;
3198
+ /** @example C01234567 */
3199
+ channel?: string | null;
3200
+ /** @example U0AALR8M69X */
3201
+ user?: string | null;
3202
+ /** @example false */
3203
+ silent?: boolean;
3204
+ /** @example shipwright:check-dev-task.ts */
3205
+ preCheck?: string | null;
3206
+ /** @example true */
3207
+ enabled?: boolean;
3208
+ };
3209
+ CronsWithSummaryWrapper: {
3210
+ crons: components["schemas"]["AgentCronJobWithRunSummary"][];
3211
+ };
3212
+ AgentCronJobWithRunSummary: components["schemas"]["AgentCronJob"] & {
3213
+ lastRun: components["schemas"]["CronRunLastRun"];
3214
+ /** @example 3 */
3215
+ runCountToday: number;
3216
+ };
3217
+ /** @example null */
3218
+ CronRunLastRun: {
3219
+ /**
3220
+ * Format: date-time
3221
+ * @example 2026-01-01T08:00:00.000Z
3222
+ */
3223
+ startedAt: string;
3224
+ /**
3225
+ * Format: date-time
3226
+ * @example null
3227
+ */
3228
+ completedAt: string | null;
3229
+ /** @example false */
3230
+ skipped: boolean;
3231
+ /** @example success */
3232
+ outcome: string | null;
3233
+ } | null;
3234
+ CronRunWrapper: {
3235
+ run: components["schemas"]["AgentCronRun"];
3236
+ };
3237
+ AgentCronRun: {
3238
+ /** @example clx1234567890 */
3239
+ id: string;
3240
+ /** @example clx0987654321 */
3241
+ cronId: string;
3242
+ /** @example clx1234567890 */
3243
+ agentId: string;
3244
+ /**
3245
+ * Format: date-time
3246
+ * @example 2026-01-01T08:00:00.000Z
3247
+ */
3248
+ startedAt: string;
3249
+ /**
3250
+ * Format: date-time
3251
+ * @example 2026-01-01T08:00:05.000Z
3252
+ */
3253
+ completedAt: string | null;
3254
+ /** @example false */
3255
+ skipped: boolean;
3256
+ /** @example pre-check returned false */
3257
+ skipReason: string | null;
3258
+ /** @example success */
3259
+ outcome: string | null;
3260
+ /** @example null */
3261
+ error: string | null;
3262
+ /**
3263
+ * @description Child AgentCronJob id (FK) of the pipeline phase this run served (dev-task/review/patch/deploy). Null for legacy five-job crons or ticks with no phase attribution.
3264
+ * @example clx0987654321
3265
+ */
3266
+ phaseId: string | null;
3267
+ /**
3268
+ * @description Work item type this run was dispatched against ("task" | "pr"). Null when the tick had no dispatch (skipped tick, empty queue).
3269
+ * @example task
3270
+ */
3271
+ itemType: string | null;
3272
+ /**
3273
+ * @description Work item id this run was dispatched against (e.g. "WLS-2.2" or "acme/x#123"). Null when the tick had no dispatch.
3274
+ * @example WLS-2.2
3275
+ */
3276
+ itemId: string | null;
3277
+ /**
3278
+ * @description Slash-command variant this dispatch ran ("default" | "alternate"). Null when the run had no variant attribution.
3279
+ * @example default
3280
+ */
3281
+ commandVariant: string | null;
3282
+ /** @example 1234 */
3283
+ inputTokens: number | null;
3284
+ /** @example 567 */
3285
+ outputTokens: number | null;
3286
+ /** @example 89 */
3287
+ cacheReadTokens: number | null;
3288
+ /** @example 10 */
3289
+ cacheCreationTokens: number | null;
3290
+ /**
3291
+ * @description Agent session id this run was executed under. Null for runs with no recorded session.
3292
+ * @example session-abc-123
3293
+ */
3294
+ sessionId: string | null;
3295
+ /**
3296
+ * Format: date-time
3297
+ * @description Most recent debounced progress-push (recordProgress()) timestamp, sourced from the agent's injected Clock. Null for runs that never reported progress (short/legacy runs).
3298
+ * @example 2026-01-01T08:00:03.000Z
3299
+ */
3300
+ lastHeartbeatAt: string | null;
3301
+ /**
3302
+ * Format: date-time
3303
+ * @example 2026-01-01T08:00:00.000Z
3304
+ */
3305
+ createdAt: string;
3306
+ modelBreakdown?: components["schemas"]["ModelBreakdownEntry"][];
3307
+ /** @description First-turn context baseline (null for resumed sessions and runs from older agent builds). */
3308
+ contextBaseline?: {
3309
+ /** @example claude-sonnet-4-6 */
3310
+ model: string;
3311
+ /** @example 79188 */
3312
+ contextTokens: number;
3313
+ /** @example 2 */
3314
+ inputTokens: number;
3315
+ /** @example 41415 */
3316
+ cacheCreationTokens: number;
3317
+ /** @example 37771 */
3318
+ cacheReadTokens: number;
3319
+ } | null;
3320
+ /** @example 12 */
3321
+ turns?: number | null;
3322
+ /** @example 7 */
3323
+ toolCalls?: number | null;
3324
+ /** @example abc123def456 */
3325
+ contextFingerprint?: string | null;
3326
+ /** @example 1.363.0 */
3327
+ pluginVersion?: string | null;
3328
+ /** @example 2.1.285 */
3329
+ claudeCodeVersion?: string | null;
3330
+ };
3331
+ ModelBreakdownEntry: {
3332
+ /** @example claude-sonnet-4-5 */
3333
+ model: string;
3334
+ /**
3335
+ * @default 0
3336
+ * @example 200
3337
+ */
3338
+ inputTokens: number;
3339
+ /**
3340
+ * @default 0
3341
+ * @example 100
3342
+ */
3343
+ outputTokens: number;
3344
+ /**
3345
+ * @default 0
3346
+ * @example 8
3347
+ */
3348
+ cacheReadTokens: number;
3349
+ /**
3350
+ * @default 0
3351
+ * @example 4
3352
+ */
3353
+ cacheCreationTokens: number;
3354
+ /**
3355
+ * @default 0
3356
+ * @example 0.002
3357
+ */
3358
+ costUsd: number;
3359
+ };
3360
+ CreateAgentCronRunBody: {
3361
+ /**
3362
+ * Format: date-time
3363
+ * @example 2026-01-01T08:00:00.000Z
3364
+ */
3365
+ startedAt: string;
3366
+ /**
3367
+ * Format: date-time
3368
+ * @example null
3369
+ */
3370
+ completedAt?: string | null;
3371
+ /** @example false */
3372
+ skipped?: boolean;
3373
+ /** @example pre-check returned false */
3374
+ skipReason?: string | null;
3375
+ /** @example success */
3376
+ outcome?: string | null;
3377
+ /** @example null */
3378
+ error?: string | null;
3379
+ /**
3380
+ * @description Child AgentCronJob id (FK) of the pipeline phase this run served (dev-task/review/patch/deploy)
3381
+ * @example clx0987654321
3382
+ */
3383
+ phaseId?: string | null;
3384
+ /**
3385
+ * @description Work item type this run was dispatched against ("task" | "pr")
3386
+ * @example task
3387
+ */
3388
+ itemType?: string | null;
3389
+ /**
3390
+ * @description Work item id this run was dispatched against (e.g. "WLS-2.2" or "acme/x#123")
3391
+ * @example WLS-2.2
3392
+ */
3393
+ itemId?: string | null;
3394
+ /**
3395
+ * @description Slash-command variant this dispatch ran ("default" | "alternate")
3396
+ * @example alternate
3397
+ */
3398
+ commandVariant?: string | null;
3399
+ };
3400
+ CronRunsList: {
3401
+ items: components["schemas"]["AgentCronRun"][];
3402
+ /** @example 42 */
3403
+ total: number;
3404
+ /** @example 20 */
3405
+ limit: number;
3406
+ /** @example 0 */
3407
+ offset: number;
3408
+ };
3409
+ PatchCronRunWrapper: {
3410
+ run: components["schemas"]["AgentCronRun"];
3411
+ };
3412
+ PatchAgentCronRunBody: {
3413
+ /**
3414
+ * Format: date-time
3415
+ * @example 2026-01-01T08:05:00.000Z
3416
+ */
3417
+ completedAt?: string | null;
3418
+ /** @example success */
3419
+ outcome?: string | null;
3420
+ /** @example null */
3421
+ error?: string | null;
3422
+ /** @example false */
3423
+ skipped?: boolean;
3424
+ /** @example pre-check returned false */
3425
+ skipReason?: string | null;
3426
+ /** @example 1234 */
3427
+ inputTokens?: number | null;
3428
+ /** @example 567 */
3429
+ outputTokens?: number | null;
3430
+ /** @example 89 */
3431
+ cacheReadTokens?: number | null;
3432
+ /** @example 10 */
3433
+ cacheCreationTokens?: number | null;
3434
+ /**
3435
+ * @description Agent session id this run was executed under.
3436
+ * @example session-abc-123
3437
+ */
3438
+ sessionId?: string | null;
3439
+ /**
3440
+ * Format: date-time
3441
+ * @description Most recent debounced progress-push (recordProgress()) timestamp, sourced from the agent's injected Clock.
3442
+ * @example 2026-01-01T08:00:03.000Z
3443
+ */
3444
+ lastHeartbeatAt?: string | null;
3445
+ /** @description Per-model token breakdown for this run */
3446
+ modelBreakdown?: components["schemas"]["ModelBreakdownEntry"][];
3447
+ contextBaseline?: components["schemas"]["ContextBaselineEntry"];
3448
+ /**
3449
+ * @description Distinct usage-bearing assistant turns in the run.
3450
+ * @example 12
3451
+ */
3452
+ turns?: number | null;
3453
+ /**
3454
+ * @description Distinct tool_use blocks in the run.
3455
+ * @example 7
3456
+ */
3457
+ toolCalls?: number | null;
3458
+ /**
3459
+ * @description sha256[:12] over the workspace's always-loaded markdown (CLAUDE.md, its @imports, no-`paths` rules) + plugin version. Groups runs by what the model was given.
3460
+ * @example abc123def456
3461
+ */
3462
+ contextFingerprint?: string | null;
3463
+ /** @example 1.363.0 */
3464
+ pluginVersion?: string | null;
3465
+ /** @example 2.1.285 */
3466
+ claudeCodeVersion?: string | null;
3467
+ /** @description Per-skill / per-subagent token attribution rows for this run; upserted per [kind, name]. */
3468
+ skillUsage?: components["schemas"]["SkillUsageEntry"][];
3469
+ };
3470
+ /** @description First-turn context baseline: usage of the run's first assistant message. contextTokens = input + cacheCreation + cacheRead — the full always-loaded context independent of cache warmth. Omitted for resumed sessions. */
3471
+ ContextBaselineEntry: {
3472
+ /** @example claude-sonnet-4-6 */
3473
+ model: string;
3474
+ /** @example 79188 */
3475
+ contextTokens: number;
3476
+ /** @example 2 */
3477
+ inputTokens: number;
3478
+ /** @example 41415 */
3479
+ cacheCreationTokens: number;
3480
+ /** @example 37771 */
3481
+ cacheReadTokens: number;
3482
+ };
3483
+ SkillUsageEntry: {
3484
+ /**
3485
+ * @example skill
3486
+ * @enum {string}
3487
+ */
3488
+ kind: "skill" | "agent" | "root";
3489
+ /** @example shipwright:task-store */
3490
+ name: string;
3491
+ /** @example 1 */
3492
+ invocations: number;
3493
+ /** @example 3 */
3494
+ turns: number;
3495
+ /** @example 12 */
3496
+ inputTokens: number;
3497
+ /** @example 100 */
3498
+ outputTokens: number;
3499
+ /** @example 219200 */
3500
+ cacheReadTokens: number;
3501
+ /** @example 9300 */
3502
+ cacheCreationTokens: number;
3503
+ /**
3504
+ * @description input + cacheCreation of the first usage-bearing turn after the skill's first invoke — the new context admitted when its body loaded. Null for root/agent rows.
3505
+ * @example 9103
3506
+ */
3507
+ invokeContextDelta?: number | null;
3508
+ };
3509
+ ToolWrapper: {
3510
+ tool: components["schemas"]["AgentTool"];
3511
+ };
3512
+ AgentTool: {
3513
+ /** @example clx1234567890 */
3514
+ id: string;
3515
+ /** @example clx1234567890 */
3516
+ agentId: string;
3517
+ /** @example Read */
3518
+ pattern: string;
3519
+ /** @example true */
3520
+ enabled: boolean;
3521
+ /**
3522
+ * Format: date-time
3523
+ * @example 2026-01-01T00:00:00.000Z
3524
+ */
3525
+ createdAt: string;
3526
+ };
3527
+ CreateAgentToolBody: {
3528
+ /** @example Bash */
3529
+ pattern: string;
3530
+ };
3531
+ ToolsWrapper: {
3532
+ tools: components["schemas"]["AgentTool"][];
3533
+ };
3534
+ PatchAgentToolBody: {
3535
+ /** @example false */
3536
+ enabled: boolean;
3537
+ };
3538
+ CreateAgentTokenResponse: {
3539
+ token: components["schemas"]["AgentToken"];
3540
+ /** @example swt_v1_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */
3541
+ rawToken: string;
3542
+ };
3543
+ AgentToken: {
3544
+ /** @example clx1234567890 */
3545
+ id: string;
3546
+ /** @example clx1234567890 */
3547
+ agentId: string;
3548
+ /** @example ci-runner */
3549
+ label?: string | null;
3550
+ /**
3551
+ * Format: date-time
3552
+ * @example 2026-01-01T00:00:00.000Z
3553
+ */
3554
+ createdAt: string;
3555
+ /**
3556
+ * Format: date-time
3557
+ * @example null
3558
+ */
3559
+ revokedAt?: string | null;
3560
+ };
3561
+ CreateAgentTokenBody: {
3562
+ /** @example ci-runner */
3563
+ label?: string;
3564
+ };
3565
+ TokensWrapper: {
3566
+ tokens: components["schemas"]["AgentToken"][];
3567
+ };
3568
+ PluginWrapper: {
3569
+ plugin: components["schemas"]["AgentPlugin"];
3570
+ };
3571
+ AgentPlugin: {
3572
+ /** @example clx1234567890 */
3573
+ id: string;
3574
+ /** @example clx1234567890 */
3575
+ agentId: string;
3576
+ /** @example @shipwright/plugin */
3577
+ name: string;
3578
+ /** @example 1.2.3 */
3579
+ version?: string | null;
3580
+ /** @example true */
3581
+ enabled: boolean;
3582
+ /**
3583
+ * Format: date-time
3584
+ * @example 2026-01-01T00:00:00.000Z
3585
+ */
3586
+ createdAt: string;
3587
+ /**
3588
+ * Format: date-time
3589
+ * @example 2026-01-01T00:00:00.000Z
3590
+ */
3591
+ updatedAt: string;
3592
+ };
3593
+ CreateAgentPluginBody: {
3594
+ /** @example @shipwright/plugin */
3595
+ name: string;
3596
+ /** @example 1.2.3 */
3597
+ version?: string | null;
3598
+ };
3599
+ PluginsWrapper: {
3600
+ plugins: components["schemas"]["AgentPlugin"][];
3601
+ };
3602
+ PatchAgentPluginBody: {
3603
+ /** @example 1.3.0 */
3604
+ version?: string | null;
3605
+ };
3606
+ PhaseMethodologyListWrapper: {
3607
+ phaseMethodology: components["schemas"]["AgentPhaseMethodology"][];
3608
+ };
3609
+ AgentPhaseMethodology: {
3610
+ /** @example clx1234567890 */
3611
+ id: string;
3612
+ /** @example clx1234567890 */
3613
+ agentId: string;
3614
+ /**
3615
+ * @example review
3616
+ * @enum {string}
3617
+ */
3618
+ phase: "prd" | "plan-session" | "review" | "patch" | "deploy" | "dev-task";
3619
+ /** @example shipwright:code-reviewer */
3620
+ subagentType: string | null;
3621
+ /**
3622
+ * Format: date-time
3623
+ * @example 2026-01-01T00:00:00.000Z
3624
+ */
3625
+ updatedAt: string;
3626
+ };
3627
+ PhaseMethodologyWrapper: {
3628
+ phaseMethodology: components["schemas"]["AgentPhaseMethodology"];
3629
+ };
3630
+ PutAgentPhaseMethodologyBody: {
3631
+ /** @example shipwright:code-reviewer */
3632
+ subagentType: string | null;
3633
+ };
3634
+ CronRunTokenStats: {
3635
+ totals: components["schemas"]["TokenAggregate"];
3636
+ byAgent: components["schemas"]["KeyedTokenAggregate"][];
3637
+ byCron: components["schemas"]["DoubleKeyedTokenAggregate"][];
3638
+ byModel: components["schemas"]["DoubleKeyedTokenAggregate"][];
3639
+ daily: components["schemas"]["DailyTokenAggregate"][];
3640
+ byCronModel: components["schemas"]["DoubleKeyedTokenAggregate"][];
3641
+ byPhase: components["schemas"]["KeyedTokenAggregate"][];
3642
+ bySkill?: components["schemas"]["SkillUsageAggregate"][];
3643
+ baselines?: components["schemas"]["ContextBaselineAggregate"][];
3644
+ };
3645
+ TokenAggregate: {
3646
+ /** @example 600 */
3647
+ input: number;
3648
+ /** @example 300 */
3649
+ output: number;
3650
+ /** @example 60 */
3651
+ cacheRead: number;
3652
+ /** @example 30 */
3653
+ cacheCreation: number;
3654
+ /** @example 990 */
3655
+ total: number;
3656
+ /** @example 0.006 */
3657
+ costUsd?: number;
3658
+ };
3659
+ KeyedTokenAggregate: components["schemas"]["TokenAggregate"] & {
3660
+ /** @example agent-id-123 */
3661
+ key: string;
3662
+ };
3663
+ DoubleKeyedTokenAggregate: components["schemas"]["TokenAggregate"] & {
3664
+ /** @example agent-id-123 */
3665
+ key1: string;
3666
+ /** @example morning-brief */
3667
+ key2: string;
3668
+ /** @example dev-task */
3669
+ phase?: string | null;
3670
+ };
3671
+ DailyTokenAggregate: components["schemas"]["TokenAggregate"] & {
3672
+ /** @example 2026-01-10 */
3673
+ period: string;
3674
+ };
3675
+ SkillUsageAggregate: {
3676
+ /** @example skill */
3677
+ kind: string;
3678
+ /** @example shipwright:dev-task */
3679
+ name: string;
3680
+ /** @example 4 */
3681
+ runs: number;
3682
+ /** @example 5 */
3683
+ invocations: number;
3684
+ /** @example 40 */
3685
+ turns: number;
3686
+ /** @example 600 */
3687
+ input: number;
3688
+ /** @example 300 */
3689
+ output: number;
3690
+ /** @example 60 */
3691
+ cacheRead: number;
3692
+ /** @example 30 */
3693
+ cacheCreation: number;
3694
+ /** @example 1200 */
3695
+ avgInvokeContextDelta: number | null;
3696
+ };
3697
+ ContextBaselineAggregate: {
3698
+ /** @example a1b2c3 */
3699
+ contextFingerprint: string | null;
3700
+ /** @example claude-sonnet-5-5 */
3701
+ baselineModel: string | null;
3702
+ /** @example dev-task */
3703
+ phase: string | null;
3704
+ /** @example 12 */
3705
+ runs: number;
3706
+ /** @example 24000 */
3707
+ avgContextTokens: number;
3708
+ /** @example 23000 */
3709
+ minContextTokens: number;
3710
+ /** @example 25000 */
3711
+ maxContextTokens: number;
3712
+ /** @example 30 */
3713
+ avgTurns: number | null;
3714
+ /** @example 55 */
3715
+ avgToolCalls: number | null;
3716
+ /** @example 2026-01-10T09:00:00.000Z */
3717
+ firstSeen: string;
3718
+ /** @example 2026-01-15T09:00:00.000Z */
3719
+ lastSeen: string;
3720
+ };
3721
+ CronRunOutcomes: {
3722
+ series: components["schemas"]["CronRunOutcomeSeries"][];
3723
+ };
3724
+ CronRunOutcomeSeries: {
3725
+ /** @example dev-task */
3726
+ phase: string | null;
3727
+ /** @example a1b2c3d4e5f6 */
3728
+ contextFingerprint: string | null;
3729
+ runs: number;
3730
+ completed: number;
3731
+ failed: number;
3732
+ skipped: number;
3733
+ /**
3734
+ * @example {
3735
+ * "no-ready-task": 3
3736
+ * }
3737
+ */
3738
+ skipReasons: {
3739
+ [key: string]: number;
3740
+ };
3741
+ avgDurationMs: number | null;
3742
+ p50DurationMs: number | null;
3743
+ avgTurns: number | null;
3744
+ avgToolCalls: number | null;
3745
+ avgContextTokens: number | null;
3746
+ };
3747
+ ChatTokenStats: {
3748
+ totals: components["schemas"]["TokenAggregate"];
3749
+ byAgent: components["schemas"]["KeyedTokenAggregate"][];
3750
+ byModel: components["schemas"]["DoubleKeyedTokenAggregate"][];
3751
+ daily: components["schemas"]["DailyTokenAggregate"][];
3752
+ };
3753
+ AgentChatTokenUsageDailyByModel: {
3754
+ /** @example clx1234567890 */
3755
+ id: string;
3756
+ /** @example clx1234567890 */
3757
+ agentId: string;
3758
+ /** @example 2026-01-15 */
3759
+ date: string;
3760
+ /** @example claude-sonnet-4-5 */
3761
+ model: string;
3762
+ /** @example 100 */
3763
+ inputTokens: number;
3764
+ /** @example 50 */
3765
+ outputTokens: number;
3766
+ /** @example 10 */
3767
+ cacheReadTokens: number;
3768
+ /** @example 5 */
3769
+ cacheCreationTokens: number;
3770
+ /** @example 0.0012 */
3771
+ costUsd: number;
3772
+ /**
3773
+ * Format: date-time
3774
+ * @example 2026-01-15T00:00:00.000Z
3775
+ */
3776
+ createdAt: string;
3777
+ /**
3778
+ * Format: date-time
3779
+ * @example 2026-01-15T12:00:00.000Z
3780
+ */
3781
+ updatedAt: string;
3782
+ };
3783
+ UpsertChatTokenDailyBody: {
3784
+ /** @example 2026-01-15 */
3785
+ date: string;
3786
+ /** @description Per-model token usage increments */
3787
+ modelBreakdown: components["schemas"]["ChatTokenModelEntry"][];
3788
+ };
3789
+ ChatTokenModelEntry: {
3790
+ /** @example claude-sonnet-4-5 */
3791
+ model: string;
3792
+ /** @example 100 */
3793
+ inputTokens: number;
3794
+ /** @example 50 */
3795
+ outputTokens: number;
3796
+ /** @example 10 */
3797
+ cacheReadTokens: number;
3798
+ /** @example 5 */
3799
+ cacheCreationTokens: number;
3800
+ /** @example 0.0012 */
3801
+ costUsd: number;
3802
+ };
3803
+ WorkQueueSnapshotWrapper: {
3804
+ snapshot: components["schemas"]["AgentWorkQueueSnapshot"];
3805
+ };
3806
+ AgentWorkQueueSnapshot: {
3807
+ /** @example clx1234567890 */
3808
+ id: string;
3809
+ /** @example clx1234567890 */
3810
+ agentId: string;
3811
+ /**
3812
+ * Format: date-time
3813
+ * @example 2026-01-01T00:00:00.000Z
3814
+ */
3815
+ computedAt: string;
3816
+ items: components["schemas"]["RankedWorkItem"][];
3817
+ /**
3818
+ * Format: date-time
3819
+ * @example 2026-01-01T00:00:00.000Z
3820
+ */
3821
+ createdAt: string;
3822
+ };
3823
+ RankedWorkItem: {
3824
+ /**
3825
+ * @example task
3826
+ * @enum {string}
3827
+ */
3828
+ type: "task" | "pr";
3829
+ /** @example WLS-2.2 */
3830
+ id: string;
3831
+ /** @example Add work queue snapshot endpoints */
3832
+ title?: string;
3833
+ /**
3834
+ * @example dev-task
3835
+ * @enum {string}
3836
+ */
3837
+ phase: "dev-task" | "plan" | "review" | "patch" | "deploy";
3838
+ /**
3839
+ * @description ISO timestamp
3840
+ * @example 2026-01-01T00:00:00.000Z
3841
+ */
3842
+ age: string;
3843
+ };
3844
+ PushWorkQueueSnapshotBody: {
3845
+ /**
3846
+ * Format: date-time
3847
+ * @example 2026-01-01T00:00:00.000Z
3848
+ */
3849
+ computedAt: string;
3850
+ items: components["schemas"]["RankedWorkItem"][];
3851
+ };
3852
+ GitHubInstallationsSnapshotWrapper: {
3853
+ snapshot: components["schemas"]["AgentGitHubInstallationsSnapshot"];
3854
+ };
3855
+ AgentGitHubInstallationsSnapshot: {
3856
+ /** @example clx1234567890 */
3857
+ id: string;
3858
+ /** @example clx1234567890 */
3859
+ agentId: string;
3860
+ /**
3861
+ * Format: date-time
3862
+ * @example 2026-01-01T00:00:00.000Z
3863
+ */
3864
+ reportedAt: string;
3865
+ installations: components["schemas"]["GitHubInstallation"][];
3866
+ /**
3867
+ * Format: date-time
3868
+ * @example 2026-01-01T00:00:00.000Z
3869
+ */
3870
+ createdAt: string;
3871
+ };
3872
+ GitHubInstallation: {
3873
+ /** @example app-vitals */
3874
+ owner: string;
3875
+ /** @example 12345678 */
3876
+ installationId: number;
3877
+ /** @example active */
3878
+ state: string;
3879
+ /**
3880
+ * @description Sanitized last error message (max 500 chars). Must not contain credentials.
3881
+ * @example installation suspended
3882
+ */
3883
+ lastError?: string | null;
3884
+ };
3885
+ PutGitHubInstallationsBody: {
3886
+ /**
3887
+ * Format: date-time
3888
+ * @example 2026-01-01T00:00:00.000Z
3889
+ */
3890
+ reportedAt: string;
3891
+ installations: components["schemas"]["GitHubInstallation"][];
3892
+ };
3893
+ AgentConfigResponse: {
3894
+ /**
3895
+ * @example {
3896
+ * "SLACK_BOT_TOKEN": "xoxb-..."
3897
+ * }
3898
+ */
3899
+ env: {
3900
+ [key: string]: string;
3901
+ };
3902
+ /**
3903
+ * @example [
3904
+ * "Read",
3905
+ * "Write"
3906
+ * ]
3907
+ */
3908
+ allowedTools: string[];
3909
+ plugins: components["schemas"]["AgentConfigPlugin"][];
3910
+ /**
3911
+ * @example [
3912
+ * "org/repo1",
3913
+ * "org/repo2"
3914
+ * ]
3915
+ */
3916
+ repos: string[];
3917
+ /**
3918
+ * @example [
3919
+ * "octocat"
3920
+ * ]
3921
+ */
3922
+ reviewAuthorAllowlist: string[];
3923
+ /**
3924
+ * @example [
3925
+ * "octocat"
3926
+ * ]
3927
+ */
3928
+ patchAuthorAllowlist: string[];
3929
+ /** @example true */
3930
+ autoPostReviews: boolean;
3931
+ /** @example false */
3932
+ allowSelfReview: boolean;
3933
+ /** @example 75 */
3934
+ minConfidence: number;
3935
+ /** @example 5 */
3936
+ maxFindings: number;
3937
+ /** @example true */
3938
+ cleanupMergedWorktrees: boolean;
3939
+ /** @example 14 */
3940
+ cleanupAfterDays: number;
3941
+ /** @example false */
3942
+ restrictSlackToMembers: boolean;
3943
+ /**
3944
+ * @example [
3945
+ * "dev@example.com"
3946
+ * ]
3947
+ */
3948
+ memberEmails: string[];
3949
+ /**
3950
+ * Format: date-time
3951
+ * @example 2026-12-01T00:00:00.000Z
3952
+ */
3953
+ trialExpiresAt?: string | null;
3954
+ /** @example active */
3955
+ accountStatus?: string | null;
3956
+ /** @example coding */
3957
+ typeName?: string;
3958
+ /**
3959
+ * @example {
3960
+ * "prd": null,
3961
+ * "plan-session": null,
3962
+ * "review": "shipwright:code-reviewer",
3963
+ * "patch": null,
3964
+ * "deploy": null,
3965
+ * "dev-task": null
3966
+ * }
3967
+ */
3968
+ phaseMethodology: {
3969
+ [key: string]: string | null;
3970
+ };
3971
+ };
3972
+ AgentConfigPlugin: {
3973
+ /** @example shipwright */
3974
+ marketplace: string;
3975
+ /** @example shipwright */
3976
+ plugin: string;
3977
+ };
3978
+ RuntimeError: {
3979
+ /** @example Not found */
3980
+ error: string;
3981
+ };
3982
+ CreateChatCredentialResponse: {
3983
+ /** @example clx0987654321 */
3984
+ tokenId: string;
3985
+ /** @example ct_xxxxxxxxxxxxxxxxxxxxxxxx */
3986
+ rawToken: string;
3987
+ /** @example ask-caller */
3988
+ label: string;
3989
+ /** @example clx1234567890 */
3990
+ agentId: string;
3991
+ };
3992
+ CreateChatCredentialBody: {
3993
+ /** @example ask-caller */
3994
+ label: string;
3995
+ };
3996
+ ChatCredentialsWrapper: {
3997
+ credentials: components["schemas"]["ChatCredential"][];
3998
+ };
3999
+ ChatCredential: {
4000
+ /** @example clx0987654321 */
4001
+ tokenId: string;
4002
+ /** @example ask-caller */
4003
+ label: string | null;
4004
+ /** @example clx1234567890 */
4005
+ agentId: string;
4006
+ };
4007
+ AgentAskResponse: {
4008
+ /** @example clx1111111111 */
4009
+ askId: string;
4010
+ /** @example clx2222222222 */
4011
+ threadId: string;
4012
+ /**
4013
+ * @example pending
4014
+ * @enum {string}
4015
+ */
4016
+ status: "replied" | "pending";
4017
+ /**
4018
+ * @description The agent's reply body; present only when status is `replied`.
4019
+ * @example acme/web is deployed and green.
4020
+ */
4021
+ reply?: string;
4022
+ };
4023
+ AgentAskBody: {
4024
+ /**
4025
+ * @description Id of the asking agent. An agent key may only ask as itself (`from` must equal its own id).
4026
+ * @example clx0987654321
4027
+ */
4028
+ from: string;
4029
+ /**
4030
+ * @description The question, posted as the thread's user message. Never stored or logged by admin.
4031
+ * @example What is the deploy status of acme/web?
4032
+ */
4033
+ question: string;
4034
+ /**
4035
+ * @description How long to wait for the reply, polling once per second. 0 (default) returns `pending` immediately.
4036
+ * @default 0
4037
+ * @example 0
4038
+ */
4039
+ waitMs: number;
4040
+ /**
4041
+ * @description Ask chain depth. Capped at 1: any other value is a 400.
4042
+ * @default 1
4043
+ * @example 1
4044
+ */
4045
+ depth: number;
4046
+ /**
4047
+ * @description How long the ask stays relevant, in seconds. Recorded on the audit row.
4048
+ * @default 600
4049
+ * @example 600
4050
+ */
4051
+ ttlSeconds: number;
4052
+ };
4053
+ AgentAskList: {
4054
+ asks: components["schemas"]["AgentAskRecord"][];
4055
+ /** @example 1 */
4056
+ total: number;
4057
+ /** @example 50 */
4058
+ limit: number;
4059
+ /** @example 0 */
4060
+ offset: number;
4061
+ };
4062
+ AgentAskRecord: {
4063
+ /** @example clx1111111111 */
4064
+ id: string;
4065
+ /** @example clx0987654321 */
4066
+ fromAgentId: string;
4067
+ /** @example clx1234567890 */
4068
+ toAgentId: string;
4069
+ /** @example clx2222222222 */
4070
+ threadId: string | null;
4071
+ /** @example 1 */
4072
+ depth: number;
4073
+ /** @example 0 */
4074
+ waitMs: number;
4075
+ /** @example 600 */
4076
+ ttlSeconds: number;
4077
+ /**
4078
+ * @description created | pending | replied | failed
4079
+ * @example pending
4080
+ */
4081
+ status: string;
4082
+ /** @example ops (platform.ops) [platform-ops] */
4083
+ callerLabel: string;
4084
+ /** @example 2026-10-25T12:00:00.000Z */
4085
+ createdAt: string;
4086
+ /** @example null */
4087
+ repliedAt: string | null;
4088
+ };
4089
+ };
4090
+ responses: never;
4091
+ parameters: never;
4092
+ requestBodies: never;
4093
+ headers: never;
4094
+ pathItems: never;
4095
+ }
4096
+ export type $defs = Record<string, never>;
4097
+ export type operations = Record<string, never>;