@cat-factory/sdk 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,698 @@
1
+ // GENERATED by `pnpm gen:sdk` from docs/openapi.json — DO NOT EDIT BY HAND.
2
+ // Regenerate after any change to the `/api/v1` contracts; `pnpm check:sdk` fails CI on drift.
3
+ import { encodePathSegment } from './http.js';
4
+ import { repeatedCursorError } from './errors.js';
5
+ /** Headless jobs (a public, inline pipeline run against a brief): start, poll or stream one. */
6
+ export class JobsResource {
7
+ #transport;
8
+ constructor(transport) {
9
+ this.#transport = transport;
10
+ }
11
+ /**
12
+ * Cancel a job
13
+ * Stop a headless job run, freeing its concurrency slot. Idempotent — an already-finished job is returned as-is. Use this to abandon a run parked on a decision you do not intend to answer.
14
+ * `POST /api/v1/jobs/{id}/cancel` — operation `cancelPublicJob`.
15
+ */
16
+ cancel(id, options = {}) {
17
+ return this.#transport.request({
18
+ method: 'POST',
19
+ path: `/api/v1/jobs/${encodePathSegment(id)}/cancel`,
20
+ options,
21
+ });
22
+ }
23
+ /**
24
+ * Start a headless job
25
+ * Start a public, inline pipeline headlessly against a supplied brief. Returns a job id to poll or stream. Nothing is pushed to GitHub.
26
+ * `POST /api/v1/jobs` — operation `createPublicJob`.
27
+ */
28
+ create(body, options = {}) {
29
+ return this.#transport.request({
30
+ method: 'POST',
31
+ path: `/api/v1/jobs`,
32
+ body,
33
+ options,
34
+ });
35
+ }
36
+ /**
37
+ * Get a job
38
+ * Poll a headless job started through this surface: its status and, once finished, its result.
39
+ * `GET /api/v1/jobs/{id}` — operation `getPublicJob`.
40
+ */
41
+ get(id, options = {}) {
42
+ return this.#transport.request({
43
+ method: 'GET',
44
+ path: `/api/v1/jobs/${encodePathSegment(id)}`,
45
+ options,
46
+ });
47
+ }
48
+ /**
49
+ * List the workspace's jobs
50
+ * List the headless runs THIS surface created, newest first and keyset-paginated. Scoped to internal-anchored runs exactly like the single-job read, so an external key can never enumerate the workspace’s ordinary board runs.
51
+ * `GET /api/v1/jobs` — operation `listPublicJobs`.
52
+ */
53
+ list(query = {}, options = {}) {
54
+ return this.#transport.request({
55
+ method: 'GET',
56
+ path: `/api/v1/jobs`,
57
+ query,
58
+ options,
59
+ });
60
+ }
61
+ /**
62
+ * Every `jobs` across every page of `list()`.
63
+ * Follows `nextCursor` until the server reports no further page. The cursor is opaque
64
+ * and carries a position, never authority — each page re-applies the key's full scope.
65
+ */
66
+ async *listAll(query = {}, options = {}) {
67
+ let cursor = query.cursor;
68
+ for (;;) {
69
+ const page = await this.list({ ...query, cursor }, options);
70
+ for (const item of page.jobs)
71
+ yield item;
72
+ if (!page.nextCursor)
73
+ return;
74
+ if (page.nextCursor === cursor)
75
+ throw repeatedCursorError();
76
+ cursor = page.nextCursor;
77
+ }
78
+ }
79
+ /**
80
+ * Stream a job (SSE)
81
+ * Server-sent events for a headless job run: `progress` frames until a terminal `done`/`error`/`stopped`/`timeout` event. Authenticated by the API key header.
82
+ * `GET /api/v1/jobs/{id}/events` — operation `streamPublicJobEvents`.
83
+ */
84
+ stream(id, options = {}) {
85
+ return this.#transport.stream({
86
+ method: 'GET',
87
+ path: `/api/v1/jobs/${encodePathSegment(id)}/events`,
88
+ options,
89
+ });
90
+ }
91
+ }
92
+ /** The workspace's board services — the frames tasks are created under. */
93
+ export class ServicesResource {
94
+ #transport;
95
+ constructor(transport) {
96
+ this.#transport = transport;
97
+ }
98
+ /**
99
+ * List the workspace's services
100
+ * List the board service frames in the key’s workspace, so a caller can discover the serviceId to create/list tasks under.
101
+ * `GET /api/v1/services` — operation `listPublicServices`.
102
+ */
103
+ list(options = {}) {
104
+ return this.#transport.request({
105
+ method: 'GET',
106
+ path: `/api/v1/services`,
107
+ options,
108
+ });
109
+ }
110
+ }
111
+ /** A board task's whole lifecycle: create, edit, start, stop, retry, watch, delete. */
112
+ export class TasksResource {
113
+ #transport;
114
+ constructor(transport) {
115
+ this.#transport = transport;
116
+ }
117
+ /**
118
+ * Create a task under a service
119
+ * Create a task inside a service frame the key’s workspace owns. The task starts in the `planned` state; start it with the start endpoint.
120
+ * `POST /api/v1/services/{serviceId}/tasks` — operation `createPublicTask`.
121
+ */
122
+ create(serviceId, body, options = {}) {
123
+ return this.#transport.request({
124
+ method: 'POST',
125
+ path: `/api/v1/services/${encodePathSegment(serviceId)}/tasks`,
126
+ body,
127
+ options,
128
+ });
129
+ }
130
+ /**
131
+ * Delete a task
132
+ * Delete a task and its run history. Destructive, so it sits at the top of the scope ladder: requires an `admin`-scoped key.
133
+ * `DELETE /api/v1/tasks/{taskId}` — operation `deletePublicTask`.
134
+ */
135
+ delete(taskId, options = {}) {
136
+ return this.#transport.requestNoContent({
137
+ method: 'DELETE',
138
+ path: `/api/v1/tasks/${encodePathSegment(taskId)}`,
139
+ options,
140
+ });
141
+ }
142
+ /**
143
+ * Get a task's status
144
+ * Read a task’s current lifecycle status, run progress, run id, and PR URL (once one exists).
145
+ * `GET /api/v1/tasks/{taskId}` — operation `getPublicTask`.
146
+ */
147
+ get(taskId, options = {}) {
148
+ return this.#transport.request({
149
+ method: 'GET',
150
+ path: `/api/v1/tasks/${encodePathSegment(taskId)}`,
151
+ options,
152
+ });
153
+ }
154
+ /**
155
+ * Get a task's run (rich projection)
156
+ * Read a task’s run in detail: per-step status/progress/subtasks, the failure kind and message, and the PR (url + branch).
157
+ * `GET /api/v1/tasks/{taskId}/run` — operation `getPublicRun`.
158
+ */
159
+ getRun(taskId, options = {}) {
160
+ return this.#transport.request({
161
+ method: 'GET',
162
+ path: `/api/v1/tasks/${encodePathSegment(taskId)}/run`,
163
+ options,
164
+ });
165
+ }
166
+ /**
167
+ * List a service's tasks
168
+ * List every task under a service (the whole subtree — tasks directly under the frame and under its modules).
169
+ * `GET /api/v1/services/{serviceId}/tasks` — operation `listPublicServiceTasks`.
170
+ */
171
+ listByService(serviceId, query = {}, options = {}) {
172
+ return this.#transport.request({
173
+ method: 'GET',
174
+ path: `/api/v1/services/${encodePathSegment(serviceId)}/tasks`,
175
+ query,
176
+ options,
177
+ });
178
+ }
179
+ /**
180
+ * Every `tasks` across every page of `listByService()`.
181
+ * Follows `nextCursor` until the server reports no further page. The cursor is opaque
182
+ * and carries a position, never authority — each page re-applies the key's full scope.
183
+ */
184
+ async *listByServiceAll(serviceId, query = {}, options = {}) {
185
+ let cursor = query.cursor;
186
+ for (;;) {
187
+ const page = await this.listByService(serviceId, { ...query, cursor }, options);
188
+ for (const item of page.tasks)
189
+ yield item;
190
+ if (!page.nextCursor)
191
+ return;
192
+ if (page.nextCursor === cursor)
193
+ throw repeatedCursorError();
194
+ cursor = page.nextCursor;
195
+ }
196
+ }
197
+ /**
198
+ * Retry a task's failed run
199
+ * Retry a task’s failed run. A task on an individual-usage model cannot be retried through the API (no headless personal-credential unlock).
200
+ * `POST /api/v1/tasks/{taskId}/retry` — operation `retryPublicTask`.
201
+ */
202
+ retry(taskId, options = {}) {
203
+ return this.#transport.request({
204
+ method: 'POST',
205
+ path: `/api/v1/tasks/${encodePathSegment(taskId)}/retry`,
206
+ options,
207
+ });
208
+ }
209
+ /**
210
+ * Start (run) a task
211
+ * Start a task’s pipeline. Uses the request’s pipelineId, else the task’s pinned pipeline. A pipeline that can park on a human decision requires a `decide`-scope key. A task on an individual-usage model cannot be started through the API (no headless personal-credential unlock).
212
+ * `POST /api/v1/tasks/{taskId}/start` — operation `startPublicTask`.
213
+ */
214
+ start(taskId, body, options = {}) {
215
+ return this.#transport.request({
216
+ method: 'POST',
217
+ path: `/api/v1/tasks/${encodePathSegment(taskId)}/start`,
218
+ body,
219
+ options,
220
+ });
221
+ }
222
+ /**
223
+ * Stop a task's run
224
+ * Stop a task’s in-flight run. Records a `cancelled` terminal state, leaving the run retryable.
225
+ * `POST /api/v1/tasks/{taskId}/stop` — operation `stopPublicTask`.
226
+ */
227
+ stop(taskId, options = {}) {
228
+ return this.#transport.request({
229
+ method: 'POST',
230
+ path: `/api/v1/tasks/${encodePathSegment(taskId)}/stop`,
231
+ options,
232
+ });
233
+ }
234
+ /**
235
+ * Stream a task run (SSE)
236
+ * Server-sent events for a board task run: `progress` frames (the rich run projection) until a terminal `done`/`error` event, or a `timeout` when the connection cap is reached. Authenticated by the API key header.
237
+ * `GET /api/v1/tasks/{taskId}/events` — operation `streamPublicTaskRun`.
238
+ */
239
+ stream(taskId, options = {}) {
240
+ return this.#transport.stream({
241
+ method: 'GET',
242
+ path: `/api/v1/tasks/${encodePathSegment(taskId)}/events`,
243
+ options,
244
+ });
245
+ }
246
+ /**
247
+ * Edit a task's title/description
248
+ * Edit a task’s human-authored fields (title/description) before it runs. Both fields are optional.
249
+ * `PATCH /api/v1/tasks/{taskId}` — operation `updatePublicTask`.
250
+ */
251
+ update(taskId, body, options = {}) {
252
+ return this.#transport.request({
253
+ method: 'PATCH',
254
+ path: `/api/v1/tasks/${encodePathSegment(taskId)}`,
255
+ body,
256
+ options,
257
+ });
258
+ }
259
+ }
260
+ /** The pipelines a task can be started with, and whether each is headless-startable. */
261
+ export class PipelinesResource {
262
+ #transport;
263
+ constructor(transport) {
264
+ this.#transport = transport;
265
+ }
266
+ /**
267
+ * List the workspace's pipelines
268
+ * List the pipelines in the key’s workspace — id/name/steps plus whether each is public and safe to run headlessly — so a caller can pick a pipelineId to start a task with.
269
+ * `GET /api/v1/pipelines` — operation `listPublicPipelines`.
270
+ */
271
+ list(options = {}) {
272
+ return this.#transport.request({
273
+ method: 'GET',
274
+ path: `/api/v1/pipelines`,
275
+ options,
276
+ });
277
+ }
278
+ }
279
+ /** The workspace's human-actionable inbox: list, act on, or dismiss a run tail. */
280
+ export class NotificationsResource {
281
+ #transport;
282
+ constructor(transport) {
283
+ this.#transport = transport;
284
+ }
285
+ /**
286
+ * Act on a notification
287
+ * Run a notification’s typed side-effect and resolve it: merge the PR (merge_review / pipeline_complete) or retry the run (ci_failed / test_failed). Performs a real GitHub merge, so it requires an admin-scoped key. Only these automated-action types are actionable through the API — a notification that parks a run on an interactive human decision cannot be acted on headlessly (dismiss it instead). A card that would retry a run on an individual-usage model likewise cannot be acted on through the API.
288
+ * `POST /api/v1/notifications/{id}/act` — operation `actPublicNotification`.
289
+ */
290
+ act(id, options = {}) {
291
+ return this.#transport.request({
292
+ method: 'POST',
293
+ path: `/api/v1/notifications/${encodePathSegment(id)}/act`,
294
+ options,
295
+ });
296
+ }
297
+ /**
298
+ * Dismiss a notification
299
+ * Dismiss a notification without acting on it.
300
+ * `POST /api/v1/notifications/{id}/dismiss` — operation `dismissPublicNotification`.
301
+ */
302
+ dismiss(id, options = {}) {
303
+ return this.#transport.request({
304
+ method: 'POST',
305
+ path: `/api/v1/notifications/${encodePathSegment(id)}/dismiss`,
306
+ options,
307
+ });
308
+ }
309
+ /**
310
+ * List the workspace's open notifications
311
+ * List the open, human-actionable notifications in the key’s workspace (merge reviews, pipeline-complete confirmations, CI/test failures, and informational cards).
312
+ * `GET /api/v1/notifications` — operation `listPublicNotifications`.
313
+ */
314
+ list(options = {}) {
315
+ return this.#transport.request({
316
+ method: 'GET',
317
+ path: `/api/v1/notifications`,
318
+ options,
319
+ });
320
+ }
321
+ }
322
+ /** The billing period's metered budget position and the per-model breakdown behind it. */
323
+ export class UsageResource {
324
+ #transport;
325
+ constructor(transport) {
326
+ this.#transport = transport;
327
+ }
328
+ /**
329
+ * Read the workspace's usage for the current period
330
+ * Read this billing period’s METERED spend against the workspace budget (including whether it is exceeded, which pauses runs) plus the per-(billing, vendor, provider, model) token breakdown behind it. Costs on `subscription` rows are illustrative — a flat-rate plan bills nothing per token — so branch on `billing` before summing. Workspace-scoped: the account- and user-tier budgets are not reachable through this surface.
331
+ * `GET /api/v1/usage` — operation `getPublicUsage`.
332
+ */
333
+ get(options = {}) {
334
+ return this.#transport.request({
335
+ method: 'GET',
336
+ path: `/api/v1/usage`,
337
+ options,
338
+ });
339
+ }
340
+ }
341
+ /** A parked run's human decisions — requirement findings, forks and judge verdicts. */
342
+ export class DecisionsResource {
343
+ #transport;
344
+ constructor(transport) {
345
+ this.#transport = transport;
346
+ }
347
+ /**
348
+ * Choose an implementation approach
349
+ * Pick one of the proposed implementation forks (by id) or submit your own approach. The Coder then runs with the choice folded in as a binding directive. Requires a `decide`-scope key.
350
+ * `POST /api/v1/runs/{runId}/decisions/fork/choose` — operation `choosePublicRunFork`.
351
+ */
352
+ chooseFork(runId, body, options = {}) {
353
+ return this.#transport.request({
354
+ method: 'POST',
355
+ path: `/api/v1/runs/${encodePathSegment(runId)}/decisions/fork/choose`,
356
+ body,
357
+ options,
358
+ });
359
+ }
360
+ /**
361
+ * Incorporate the answers
362
+ * Fold the recorded answers into one standardized requirements document. Asynchronous — the run re-reviews in the background, so the response shows the review `incorporating`. Requires a `decide`-scope key.
363
+ * `POST /api/v1/runs/{runId}/decisions/requirements/incorporate` — operation `incorporatePublicRunRequirements`.
364
+ */
365
+ incorporate(runId, body, options = {}) {
366
+ return this.#transport.request({
367
+ method: 'POST',
368
+ path: `/api/v1/runs/${encodePathSegment(runId)}/decisions/requirements/incorporate`,
369
+ body,
370
+ options,
371
+ });
372
+ }
373
+ /**
374
+ * List a run's parked decisions
375
+ * Read what a run is currently asking a human: requirement-review findings (with the stable item ids a reply addresses) and any implementation-fork choice. `parked` is true while the run is blocked awaiting one of them.
376
+ * `GET /api/v1/runs/{runId}/decisions` — operation `listPublicRunDecisions`.
377
+ */
378
+ list(runId, options = {}) {
379
+ return this.#transport.request({
380
+ method: 'GET',
381
+ path: `/api/v1/runs/${encodePathSegment(runId)}/decisions`,
382
+ options,
383
+ });
384
+ }
385
+ /**
386
+ * Proceed with the current requirements
387
+ * Settle the requirements phase and advance the parked run (used when nothing is outstanding). Requires a `decide`-scope key.
388
+ * `POST /api/v1/runs/{runId}/decisions/requirements/proceed` — operation `proceedPublicRunRequirements`.
389
+ */
390
+ proceed(runId, options = {}) {
391
+ return this.#transport.request({
392
+ method: 'POST',
393
+ path: `/api/v1/runs/${encodePathSegment(runId)}/decisions/requirements/proceed`,
394
+ options,
395
+ });
396
+ }
397
+ /**
398
+ * Answer a review finding
399
+ * Record an answer to one reviewer finding. Returns the run's updated decision list. Requires a `decide`-scope key.
400
+ * `POST /api/v1/runs/{runId}/decisions/requirements/findings/{itemId}/reply` — operation `replyPublicRunFinding`.
401
+ */
402
+ replyToFinding(runId, itemId, body, options = {}) {
403
+ return this.#transport.request({
404
+ method: 'POST',
405
+ path: `/api/v1/runs/${encodePathSegment(runId)}/decisions/requirements/findings/${encodePathSegment(itemId)}/reply`,
406
+ body,
407
+ options,
408
+ });
409
+ }
410
+ /**
411
+ * Re-review the incorporated document
412
+ * Run one more reviewer pass over the incorporated document. On convergence the parked run advances. Requires a `decide`-scope key.
413
+ * `POST /api/v1/runs/{runId}/decisions/requirements/re-review` — operation `reReviewPublicRunRequirements`.
414
+ */
415
+ reReview(runId, options = {}) {
416
+ return this.#transport.request({
417
+ method: 'POST',
418
+ path: `/api/v1/runs/${encodePathSegment(runId)}/decisions/requirements/re-review`,
419
+ options,
420
+ });
421
+ }
422
+ /**
423
+ * Resolve a review at its iteration cap
424
+ * Pick how a review that exhausted its reviewer-pass budget proceeds: one more round, proceed with the last incorporated document, or stop and reset the task. Requires a `decide`-scope key.
425
+ * `POST /api/v1/runs/{runId}/decisions/requirements/resolve-exceeded` — operation `resolvePublicRunRequirementsExceeded`.
426
+ */
427
+ resolveExceeded(runId, body, options = {}) {
428
+ return this.#transport.request({
429
+ method: 'POST',
430
+ path: `/api/v1/runs/${encodePathSegment(runId)}/decisions/requirements/resolve-exceeded`,
431
+ body,
432
+ options,
433
+ });
434
+ }
435
+ /**
436
+ * Resolve a parked judge verdict
437
+ * Settle a run parked on a judge verdict: proceed anyway, bounce the producing step for rework, or stop the run. Requires a `decide`-scope key.
438
+ * `POST /api/v1/runs/{runId}/decisions/judge/resolve` — operation `resolvePublicRunJudge`.
439
+ */
440
+ resolveJudge(runId, body, options = {}) {
441
+ return this.#transport.request({
442
+ method: 'POST',
443
+ path: `/api/v1/runs/${encodePathSegment(runId)}/decisions/judge/resolve`,
444
+ body,
445
+ options,
446
+ });
447
+ }
448
+ /**
449
+ * Dismiss or reopen a finding
450
+ * Dismiss a finding as not applicable, or reopen one dismissed by mistake. Requires a `decide`-scope key.
451
+ * `PATCH /api/v1/runs/{runId}/decisions/requirements/findings/{itemId}` — operation `setPublicRunFindingStatus`.
452
+ */
453
+ setFindingStatus(runId, itemId, body, options = {}) {
454
+ return this.#transport.request({
455
+ method: 'PATCH',
456
+ path: `/api/v1/runs/${encodePathSegment(runId)}/decisions/requirements/findings/${encodePathSegment(itemId)}`,
457
+ body,
458
+ options,
459
+ });
460
+ }
461
+ }
462
+ /** A run's recorded telemetry: LLM calls, the context each agent was given, infra logs. */
463
+ export class DebugResource {
464
+ #transport;
465
+ constructor(transport) {
466
+ this.#transport = transport;
467
+ }
468
+ /**
469
+ * Get one agent-context snapshot
470
+ * The complete context one dispatch was PROVIDED: system and user prompts, the folded standards fragments, and the injected `.cat-context/*` files an agent reads through tools (which therefore appear in no proxy telemetry). Windowed by `bodyOffset`/`bodyChars`.
471
+ * `GET /api/v1/debug/agent-context/{snapshotId}` — operation `getDebugAgentContext`.
472
+ */
473
+ getAgentContext(snapshotId, query = {}, options = {}) {
474
+ return this.#transport.request({
475
+ method: 'GET',
476
+ path: `/api/v1/debug/agent-context/${encodePathSegment(snapshotId)}`,
477
+ query,
478
+ options,
479
+ });
480
+ }
481
+ /**
482
+ * Get one LLM call
483
+ * One recorded model call with its budgeted prompt delta, response and reasoning. `bodyOffset`/`bodyChars` window the bodies, so an arbitrarily long transcript is readable in bounded pages.
484
+ * `GET /api/v1/debug/llm-calls/{callId}` — operation `getDebugLlmCall`.
485
+ */
486
+ getLlmCall(callId, query = {}, options = {}) {
487
+ return this.#transport.request({
488
+ method: 'GET',
489
+ path: `/api/v1/debug/llm-calls/${encodePathSegment(callId)}`,
490
+ query,
491
+ options,
492
+ });
493
+ }
494
+ /**
495
+ * Get a run's diagnostic map
496
+ * One run’s diagnostic overview: its steps, which telemetry sinks this deployment retains (and how much each holds), the LLM cost/latency rollups, and the derived signals worth looking at first.
497
+ * `GET /api/v1/debug/runs/{runId}` — operation `getDebugRun`.
498
+ */
499
+ getRun(runId, options = {}) {
500
+ return this.#transport.request({
501
+ method: 'GET',
502
+ path: `/api/v1/debug/runs/${encodePathSegment(runId)}`,
503
+ options,
504
+ });
505
+ }
506
+ /**
507
+ * List a run's agent-context dispatches
508
+ * Every dispatch whose provided context was captured, with SIZES only (no bodies) so the list stays bounded. Read one in full through the snapshot endpoint.
509
+ * `GET /api/v1/debug/runs/{runId}/agent-context` — operation `listDebugAgentContext`.
510
+ */
511
+ listAgentContext(runId, query = {}, options = {}) {
512
+ return this.#transport.request({
513
+ method: 'GET',
514
+ path: `/api/v1/debug/runs/${encodePathSegment(runId)}/agent-context`,
515
+ query,
516
+ options,
517
+ });
518
+ }
519
+ /**
520
+ * Every `snapshots` across every page of `listAgentContext()`.
521
+ * Follows `nextCursor` until the server reports no further page. The cursor is opaque
522
+ * and carries a position, never authority — each page re-applies the key's full scope.
523
+ */
524
+ async *listAgentContextAll(runId, query = {}, options = {}) {
525
+ let cursor = query.cursor;
526
+ for (;;) {
527
+ const page = await this.listAgentContext(runId, { ...query, cursor }, options);
528
+ for (const item of page.snapshots)
529
+ yield item;
530
+ if (!page.nextCursor)
531
+ return;
532
+ if (page.nextCursor === cursor)
533
+ throw repeatedCursorError();
534
+ cursor = page.nextCursor;
535
+ }
536
+ }
537
+ /**
538
+ * List a run's LLM calls
539
+ * The model calls a run made, keyset-paginated and filterable by agent kind, phase, outcome or a substring of the bodies. Bodies are returned only when `bodyChars` asks for them.
540
+ * `GET /api/v1/debug/runs/{runId}/llm-calls` — operation `listDebugLlmCalls`.
541
+ */
542
+ listLlmCalls(runId, query = {}, options = {}) {
543
+ return this.#transport.request({
544
+ method: 'GET',
545
+ path: `/api/v1/debug/runs/${encodePathSegment(runId)}/llm-calls`,
546
+ query,
547
+ options,
548
+ });
549
+ }
550
+ /**
551
+ * Every `calls` across every page of `listLlmCalls()`.
552
+ * Follows `nextCursor` until the server reports no further page. The cursor is opaque
553
+ * and carries a position, never authority — each page re-applies the key's full scope.
554
+ */
555
+ async *listLlmCallsAll(runId, query = {}, options = {}) {
556
+ let cursor = query.cursor;
557
+ for (;;) {
558
+ const page = await this.listLlmCalls(runId, { ...query, cursor }, options);
559
+ for (const item of page.calls)
560
+ yield item;
561
+ if (!page.nextCursor)
562
+ return;
563
+ if (page.nextCursor === cursor)
564
+ throw repeatedCursorError();
565
+ cursor = page.nextCursor;
566
+ }
567
+ }
568
+ /**
569
+ * List a run's infrastructure log
570
+ * The run’s provisioning event log — how its environment, runner pool and containers came up, or why they did not.
571
+ * `GET /api/v1/debug/runs/{runId}/logs` — operation `listDebugLogs`.
572
+ */
573
+ listLogs(runId, query = {}, options = {}) {
574
+ return this.#transport.request({
575
+ method: 'GET',
576
+ path: `/api/v1/debug/runs/${encodePathSegment(runId)}/logs`,
577
+ query,
578
+ options,
579
+ });
580
+ }
581
+ /**
582
+ * Every `entries` across every page of `listLogs()`.
583
+ * Follows `nextCursor` until the server reports no further page. The cursor is opaque
584
+ * and carries a position, never authority — each page re-applies the key's full scope.
585
+ */
586
+ async *listLogsAll(runId, query = {}, options = {}) {
587
+ let cursor = query.cursor;
588
+ for (;;) {
589
+ const page = await this.listLogs(runId, { ...query, cursor }, options);
590
+ for (const item of page.entries)
591
+ yield item;
592
+ if (!page.nextCursor)
593
+ return;
594
+ if (page.nextCursor === cursor)
595
+ throw repeatedCursorError();
596
+ cursor = page.nextCursor;
597
+ }
598
+ }
599
+ /**
600
+ * List the workspace's runs
601
+ * The triage entry point: the workspace’s runs, newest first and keyset-paginated, with an optional status and `since` filter.
602
+ * `GET /api/v1/debug/runs` — operation `listDebugRuns`.
603
+ */
604
+ listRuns(query = {}, options = {}) {
605
+ return this.#transport.request({
606
+ method: 'GET',
607
+ path: `/api/v1/debug/runs`,
608
+ query,
609
+ options,
610
+ });
611
+ }
612
+ /**
613
+ * Every `runs` across every page of `listRuns()`.
614
+ * Follows `nextCursor` until the server reports no further page. The cursor is opaque
615
+ * and carries a position, never authority — each page re-applies the key's full scope.
616
+ */
617
+ async *listRunsAll(query = {}, options = {}) {
618
+ let cursor = query.cursor;
619
+ for (;;) {
620
+ const page = await this.listRuns({ ...query, cursor }, options);
621
+ for (const item of page.runs)
622
+ yield item;
623
+ if (!page.nextCursor)
624
+ return;
625
+ if (page.nextCursor === cursor)
626
+ throw repeatedCursorError();
627
+ cursor = page.nextCursor;
628
+ }
629
+ }
630
+ /**
631
+ * List a run's web searches
632
+ * The web searches the run’s agents actually performed, keyset-paginated. Retained only when the deployment records agent context.
633
+ * `GET /api/v1/debug/runs/{runId}/search-queries` — operation `listDebugSearchQueries`.
634
+ */
635
+ listSearchQueries(runId, query = {}, options = {}) {
636
+ return this.#transport.request({
637
+ method: 'GET',
638
+ path: `/api/v1/debug/runs/${encodePathSegment(runId)}/search-queries`,
639
+ query,
640
+ options,
641
+ });
642
+ }
643
+ /**
644
+ * Every `queries` across every page of `listSearchQueries()`.
645
+ * Follows `nextCursor` until the server reports no further page. The cursor is opaque
646
+ * and carries a position, never authority — each page re-applies the key's full scope.
647
+ */
648
+ async *listSearchQueriesAll(runId, query = {}, options = {}) {
649
+ let cursor = query.cursor;
650
+ for (;;) {
651
+ const page = await this.listSearchQueries(runId, { ...query, cursor }, options);
652
+ for (const item of page.queries)
653
+ yield item;
654
+ if (!page.nextCursor)
655
+ return;
656
+ if (page.nextCursor === cursor)
657
+ throw repeatedCursorError();
658
+ cursor = page.nextCursor;
659
+ }
660
+ }
661
+ }
662
+ /**
663
+ * The resource clients a `CatFactoryClient` exposes, one per tag of the published OpenAPI surface.
664
+ *
665
+ * Generated and INHERITED by the client rather than re-listed on it: a resource group added to the
666
+ * SDK surface table would otherwise generate, compile, and simply not be reachable from the client
667
+ * anyone actually constructs. (A declaration-merged interface would do the same job, but TypeScript
668
+ * cannot see that such properties are initialised — so a real base class it is.)
669
+ */
670
+ export class CatFactoryResources {
671
+ /** Headless jobs (a public, inline pipeline run against a brief): start, poll or stream one. */
672
+ jobs;
673
+ /** The workspace's board services — the frames tasks are created under. */
674
+ services;
675
+ /** A board task's whole lifecycle: create, edit, start, stop, retry, watch, delete. */
676
+ tasks;
677
+ /** The pipelines a task can be started with, and whether each is headless-startable. */
678
+ pipelines;
679
+ /** The workspace's human-actionable inbox: list, act on, or dismiss a run tail. */
680
+ notifications;
681
+ /** The billing period's metered budget position and the per-model breakdown behind it. */
682
+ usage;
683
+ /** A parked run's human decisions — requirement findings, forks and judge verdicts. */
684
+ decisions;
685
+ /** A run's recorded telemetry: LLM calls, the context each agent was given, infra logs. */
686
+ debug;
687
+ constructor(transport) {
688
+ this.jobs = new JobsResource(transport);
689
+ this.services = new ServicesResource(transport);
690
+ this.tasks = new TasksResource(transport);
691
+ this.pipelines = new PipelinesResource(transport);
692
+ this.notifications = new NotificationsResource(transport);
693
+ this.usage = new UsageResource(transport);
694
+ this.decisions = new DecisionsResource(transport);
695
+ this.debug = new DebugResource(transport);
696
+ }
697
+ }
698
+ //# sourceMappingURL=operations.generated.js.map