@ellipsis-dev/sdk 0.2.3 → 0.4.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.
@@ -1,4 +1,39 @@
1
1
  interface paths {
2
+ '/v1/reviews': {
3
+ parameters: {
4
+ query?: never;
5
+ header?: never;
6
+ path?: never;
7
+ cookie?: never;
8
+ };
9
+ /** List Reviews */
10
+ get: operations['list_reviews_v1_reviews_get'];
11
+ put?: never;
12
+ /** Create Review */
13
+ post: operations['create_review_v1_reviews_post'];
14
+ delete?: never;
15
+ options?: never;
16
+ head?: never;
17
+ patch?: never;
18
+ trace?: never;
19
+ };
20
+ '/v1/reviews/{review_id}': {
21
+ parameters: {
22
+ query?: never;
23
+ header?: never;
24
+ path?: never;
25
+ cookie?: never;
26
+ };
27
+ /** Get Review */
28
+ get: operations['get_review_v1_reviews__review_id__get'];
29
+ put?: never;
30
+ post?: never;
31
+ delete?: never;
32
+ options?: never;
33
+ head?: never;
34
+ patch?: never;
35
+ trace?: never;
36
+ };
2
37
  '/v1/sessions/{session_id}': {
3
38
  parameters: {
4
39
  query?: never;
@@ -87,6 +122,458 @@ interface paths {
87
122
  }
88
123
  interface components {
89
124
  schemas: {
125
+ /** AgentConfig */
126
+ AgentConfig: {
127
+ /** @default {} */
128
+ budget: components['schemas']['AgentConfigBudget'];
129
+ /**
130
+ * @default {
131
+ * "model": "claude-opus-5",
132
+ * "system": ""
133
+ * }
134
+ */
135
+ claude: components['schemas']['AgentConfigClaude'];
136
+ /**
137
+ * @default {
138
+ * "enabled": true,
139
+ * "ide": true,
140
+ * "interactive": true,
141
+ * "metadata": {
142
+ * "annotations": {},
143
+ * "labels": []
144
+ * },
145
+ * "version": "v1"
146
+ * }
147
+ */
148
+ ellipsis: components['schemas']['AgentConfigEllipsis'];
149
+ /**
150
+ * Mcp Servers
151
+ * @default []
152
+ */
153
+ mcp_servers: (string | components['schemas']['AgentConfigMcpServer'])[];
154
+ /**
155
+ * @default {
156
+ * "compute": {},
157
+ * "github": {},
158
+ * "hooks": {},
159
+ * "image": {},
160
+ * "ports": [
161
+ * 3000,
162
+ * 5173,
163
+ * 8000,
164
+ * 8080
165
+ * ],
166
+ * "repositories": [],
167
+ * "variables": []
168
+ * }
169
+ */
170
+ sandbox: components['schemas']['AgentConfigSandbox'];
171
+ /**
172
+ * Skills
173
+ * @default []
174
+ */
175
+ skills: components['schemas']['AgentConfigSkill'][];
176
+ structured_output?: components['schemas']['AgentConfigStructuredOutput'] | null;
177
+ /** Trigger */
178
+ trigger?: (components['schemas']['AgentConfigCronTrigger'] | components['schemas']['AgentConfigReactTrigger'] | components['schemas']['AgentConfigMentionTrigger']) | null;
179
+ };
180
+ /** AgentConfigBudget */
181
+ AgentConfigBudget: {
182
+ /** Day */
183
+ day?: number | null;
184
+ /** Month */
185
+ month?: number | null;
186
+ /** Session */
187
+ session?: number | null;
188
+ /** Week */
189
+ week?: number | null;
190
+ };
191
+ /** AgentConfigClaude */
192
+ AgentConfigClaude: {
193
+ effort?: components['schemas']['EffortLevel'] | null;
194
+ /** Fallback Model */
195
+ fallback_model?: string | null;
196
+ /** Max Turns */
197
+ max_turns?: number | null;
198
+ /**
199
+ * Model
200
+ * @default claude-opus-5
201
+ */
202
+ model: string;
203
+ settings?: components['schemas']['AgentConfigSettingsRef'] | null;
204
+ /**
205
+ * System
206
+ * @default
207
+ */
208
+ system: string | components['schemas']['AgentConfigSystemFileRef'] | (string | components['schemas']['AgentConfigSystemFileRef'])[];
209
+ };
210
+ /**
211
+ * AgentConfigCompute
212
+ * @description Sandbox compute sizing. Every field is optional; None inherits the
213
+ * platform default (1 vCPU / 4096 MiB / 3600s — see DEFAULT_MODAL_* in
214
+ * models/ellipsis/sandboxes/sandbox.py). A resolved value outside the platform
215
+ * bounds fails validation loudly (a sync error on the config) rather than
216
+ * being clamped silently.
217
+ *
218
+ * `memory` and `timeout` each accept a shorthand string ("8GB", "30m") or an
219
+ * explicit units object ({gb: 8}, {minutes: 30}); the `memory_mib` /
220
+ * `timeout_seconds` properties resolve either form to the canonical integer
221
+ * the sandbox driver consumes.
222
+ *
223
+ * `timeout` is the max wall-clock the agent may run before the sandbox is
224
+ * killed, capped at 1h (MAX_SANDBOX_TIMEOUT_SECONDS — equal to the default, so
225
+ * today the knob only shortens a session; the cap matches the 1-hour validity
226
+ * of the sandbox's GitHub token). The worker's lease/visibility heartbeat
227
+ * ceiling is derived from that cap, so a run at the max stays owned by its
228
+ * worker for its whole life.
229
+ *
230
+ * Compute is billed on the requested allocation over the sandbox's
231
+ * wall-clock lifetime, so a bigger/longer box costs proportionally more.
232
+ */
233
+ AgentConfigCompute: {
234
+ /** Cpu */
235
+ cpu?: number | null;
236
+ /** Memory */
237
+ memory?: string | components['schemas']['AgentConfigMemorySize'] | null;
238
+ /** Timeout */
239
+ timeout?: string | components['schemas']['AgentConfigDuration'] | null;
240
+ };
241
+ /** AgentConfigCronTrigger */
242
+ AgentConfigCronTrigger: {
243
+ /** Schedule */
244
+ schedule: string;
245
+ /**
246
+ * @description discriminator enum property added by openapi-typescript
247
+ * @enum {string}
248
+ */
249
+ type: 'cron';
250
+ };
251
+ /**
252
+ * AgentConfigDuration
253
+ * @description A duration as explicit units, summed. Set any of `hours`/`minutes`/
254
+ * `seconds` (at least one). The alternative to the `30m`-style shorthand
255
+ * string wherever a duration is accepted.
256
+ */
257
+ AgentConfigDuration: {
258
+ /** Hours */
259
+ hours?: number | null;
260
+ /** Minutes */
261
+ minutes?: number | null;
262
+ /** Seconds */
263
+ seconds?: number | null;
264
+ };
265
+ /**
266
+ * AgentConfigEllipsis
267
+ * @description The Ellipsis product namespace for a config file: which schema this is
268
+ * (`version`), the human-facing identity (`name`/`description`), freeform
269
+ * organizational `metadata`, whether the agent is `enabled`, and the two
270
+ * human-access flags (`interactive`/`ide`). The presence of a top-level
271
+ * `ellipsis:` mapping is what marks a YAML file as an Ellipsis agent config (vs
272
+ * arbitrary YAML that merely lives under a config directory) — see
273
+ * `yaml_is_ellipsis_config`.
274
+ *
275
+ * `enabled`/`interactive`/`ide` are agent behavior, not freeform metadata, so
276
+ * they stay inside the config `sha` (only `metadata` is sha-excluded).
277
+ * `interactive` and `ide` are sibling human-access flags: `interactive` lets a
278
+ * human `agent session connect` to a live session (CLI relay); `ide` lets a
279
+ * human open an editor / a port URL into the sandbox. Neither decides whether a
280
+ * session is ephemeral or durable — that is the trigger's job.
281
+ */
282
+ AgentConfigEllipsis: {
283
+ /** Description */
284
+ description?: string | null;
285
+ /**
286
+ * Enabled
287
+ * @default true
288
+ */
289
+ enabled: boolean;
290
+ /**
291
+ * Ide
292
+ * @default true
293
+ */
294
+ ide: boolean;
295
+ /**
296
+ * Interactive
297
+ * @default true
298
+ */
299
+ interactive: boolean;
300
+ /**
301
+ * @default {
302
+ * "annotations": {},
303
+ * "labels": []
304
+ * }
305
+ */
306
+ metadata: components['schemas']['AgentConfigMetadata'];
307
+ /** Name */
308
+ name?: string | null;
309
+ /**
310
+ * Version
311
+ * @default v1
312
+ */
313
+ version: string;
314
+ };
315
+ /**
316
+ * AgentConfigMcpServer
317
+ * @description One built-in MCP server this agent opts into by name (`linear`/`slack`).
318
+ * This is a name reference over the connected built-in set, NOT a custom-server
319
+ * definition — there is no command/url/headers shape (that was the old,
320
+ * removed field, and Ellipsis does not support bring-your-own MCP servers).
321
+ * It only matters when the named integration is set to `opt_in` inclusion; an
322
+ * integration in the default `all_sessions` mode is added regardless.
323
+ */
324
+ AgentConfigMcpServer: {
325
+ /** Name */
326
+ name: string;
327
+ };
328
+ /**
329
+ * AgentConfigMemorySize
330
+ * @description A memory size as explicit units, summed (binary: 1GB = 1024MB = 1024MiB).
331
+ * Set any of `gb`/`mb` (at least one). The alternative to the `8GB`-style
332
+ * shorthand string.
333
+ */
334
+ AgentConfigMemorySize: {
335
+ /** Gb */
336
+ gb?: number | null;
337
+ /** Mb */
338
+ mb?: number | null;
339
+ };
340
+ /**
341
+ * AgentConfigMentionPlatform
342
+ * @description The surface an @ellipsis mention can come from.
343
+ * @enum {string}
344
+ */
345
+ AgentConfigMentionPlatform: 'github' | 'slack' | 'linear';
346
+ /** AgentConfigMentionTrigger */
347
+ AgentConfigMentionTrigger: {
348
+ /**
349
+ * Platforms
350
+ * @default []
351
+ */
352
+ platforms: components['schemas']['AgentConfigMentionPlatform'][];
353
+ /**
354
+ * @description discriminator enum property added by openapi-typescript
355
+ * @enum {string}
356
+ */
357
+ type: 'mention';
358
+ };
359
+ /** AgentConfigMetadata */
360
+ AgentConfigMetadata: {
361
+ /**
362
+ * Annotations
363
+ * @default {}
364
+ */
365
+ annotations: {
366
+ [key: string]: string;
367
+ };
368
+ /**
369
+ * Labels
370
+ * @default []
371
+ */
372
+ labels: string[];
373
+ };
374
+ /** AgentConfigReactTrigger */
375
+ AgentConfigReactTrigger: {
376
+ code_review?: components['schemas']['ReactCodeReview'] | null;
377
+ issue?: components['schemas']['ReactIssue'] | null;
378
+ linear_issue?: components['schemas']['ReactLinearIssue'] | null;
379
+ pull_request?: components['schemas']['ReactPullRequest'] | null;
380
+ push?: components['schemas']['ReactPush'] | null;
381
+ sentry?: components['schemas']['ReactSentry'] | null;
382
+ slack_channel?: components['schemas']['ReactSlackChannel'] | null;
383
+ /**
384
+ * @description discriminator enum property added by openapi-typescript
385
+ * @enum {string}
386
+ */
387
+ type: 'react';
388
+ };
389
+ /** AgentConfigRepository */
390
+ AgentConfigRepository: {
391
+ /** Name */
392
+ name: string;
393
+ /** Owner */
394
+ owner?: string | null;
395
+ /** Ref */
396
+ ref?: string | null;
397
+ };
398
+ /**
399
+ * AgentConfigSandbox
400
+ * @description Everything about the sandbox the agent runs in: which `repositories` are
401
+ * cloned into it, which environment `variables` it gets, its `compute` sizing,
402
+ * how its `image` is customized, and lifecycle `hooks`.
403
+ *
404
+ * Each `variables` entry names a variable to inject; with an inline `value` it
405
+ * is hardcoded, without one it is resolved from the customer's sandbox-variables
406
+ * store. Only the named variables reach this agent; the rest of the customer's
407
+ * stored variables never do. This is how a config brings in the config and
408
+ * credentials a custom CLI needs.
409
+ */
410
+ AgentConfigSandbox: {
411
+ /** @default {} */
412
+ compute: components['schemas']['AgentConfigCompute'];
413
+ /** @default {} */
414
+ github: components['schemas']['AgentConfigSandboxGithub'];
415
+ /** @default {} */
416
+ hooks: components['schemas']['AgentConfigSandboxHooks'];
417
+ /** @default {} */
418
+ image: components['schemas']['AgentConfigSandboxImage'];
419
+ /**
420
+ * Ports
421
+ * @default [
422
+ * 3000,
423
+ * 5173,
424
+ * 8000,
425
+ * 8080
426
+ * ]
427
+ */
428
+ ports: number[];
429
+ /**
430
+ * Repositories
431
+ * @default []
432
+ */
433
+ repositories: components['schemas']['AgentConfigRepository'][];
434
+ /**
435
+ * Variables
436
+ * @default []
437
+ */
438
+ variables: components['schemas']['AgentConfigSandboxVariable'][];
439
+ };
440
+ /**
441
+ * AgentConfigSandboxGithub
442
+ * @description The agent's GitHub access: the scope of the installation token minted for
443
+ * its sandbox — the credential `git`, `gh`, and the GitHub MCP server
444
+ * authenticate with.
445
+ *
446
+ * By default the token carries the installation's full permissions, scoped to
447
+ * the repositories in the sandbox. `permissions` narrows what it may do:
448
+ * the string `read_only` grants read access to contents, issues, metadata and
449
+ * pull requests; a map requests explicit levels per GitHub App permission
450
+ * scope (e.g. `{contents: read, pull_requests: write}`) and may never exceed
451
+ * what the installation granted. `repositories` narrows which repos the token
452
+ * can touch to a subset, by name (they must belong to the installation).
453
+ *
454
+ * Restriction is enforced by GitHub, not by Ellipsis: the token itself is
455
+ * minted with the reduced scope, so nothing running in the sandbox can
456
+ * exceed it.
457
+ */
458
+ AgentConfigSandboxGithub: {
459
+ /** Permissions */
460
+ permissions?: 'read_only' | {
461
+ [key: string]: string;
462
+ } | null;
463
+ /** Repositories */
464
+ repositories?: string[] | null;
465
+ };
466
+ /**
467
+ * AgentConfigSandboxHooks
468
+ * @description Shell scripts run at points in the sandbox lifecycle, each as the sandbox
469
+ * user with the sandbox's environment variables available. A non-zero exit
470
+ * fails the run (exit_status = LIFECYCLE_HOOK_FAILED) and is not retried.
471
+ *
472
+ * `post_start` runs after the container starts, before any repo is cloned —
473
+ * repo-independent setup (authenticate a CLI, e.g. `doppler setup`). On Modal
474
+ * the repo is baked into the image so it is incidentally present, but
475
+ * `post_start` must not depend on repo contents (that's `post_clone`).
476
+ *
477
+ * `post_clone` runs after all repos are cloned/checked out, before the agent —
478
+ * repo-dependent setup (`pip install -r requirements.txt`, codegen).
479
+ *
480
+ * Hooks run on every run and their output is never cached. A dependency
481
+ * install whose result should be reused across runs belongs in `image.setup`
482
+ * (baked into the cached image) instead; keep hooks for per-run work — e.g.
483
+ * anything that touches run-scoped credentials.
484
+ */
485
+ AgentConfigSandboxHooks: {
486
+ /** Post Clone */
487
+ post_clone?: string | null;
488
+ /** Post Start */
489
+ post_start?: string | null;
490
+ };
491
+ /**
492
+ * AgentConfigSandboxImage
493
+ * @description How to customize the container image the agent runs in. The customer
494
+ * contributes appended layers (`dockerfile_append`) and a build-time script
495
+ * (`setup`) only — Ellipsis owns FROM / base tooling / entrypoint / user.
496
+ * Today only inline bodies are supported; a file reference (resolved at the
497
+ * run's SHA) will come later.
498
+ *
499
+ * The split: `dockerfile_append` runs when the image is assembled, before any
500
+ * repo exists — toolchain installs (a package manager binary, apt packages).
501
+ * `setup` runs at image-build time *after* the configured repositories are
502
+ * checked out, and its output is captured by the filesystem snapshot that
503
+ * becomes the cached image — dependency installs (`poetry install`,
504
+ * `npm install`), so later runs start with deps already on disk. Neither runs
505
+ * per run; that's `hooks.post_start` / `hooks.post_clone`.
506
+ */
507
+ AgentConfigSandboxImage: {
508
+ /** Dockerfile Append */
509
+ dockerfile_append?: string | null;
510
+ /** Setup */
511
+ setup?: string | null;
512
+ };
513
+ /**
514
+ * AgentConfigSandboxVariable
515
+ * @description One environment variable injected into the agent's sandbox.
516
+ *
517
+ * `value`, when set, is a literal injected as-is — use it for non-secret
518
+ * config (LOG_LEVEL, an API base URL). When `value` is omitted the value is
519
+ * resolved at run time from the customer's sandbox-variables store (dashboard
520
+ * / `PUT /sandboxes/variables`) by `name`, so a secret can be injected without
521
+ * ever putting it in the config file. Either way the variable only reaches
522
+ * agents that name it.
523
+ */
524
+ AgentConfigSandboxVariable: {
525
+ /** Name */
526
+ name: string;
527
+ /** Value */
528
+ value?: string | null;
529
+ };
530
+ /**
531
+ * AgentConfigSettingsRef
532
+ * @description A config-declared Claude Code settings.json, resolved at run start and
533
+ * passed to `claude --settings <path>`. That is the CLI settings tier — BELOW
534
+ * Ellipsis's managed-settings.json floor — so it customizes behavior (model
535
+ * permissions, includeCoAuthoredBy, statusLine, ...) but can never weaken a
536
+ * security setting. Lets a team point the cloud agent at the same settings file
537
+ * they already use with Claude Code locally instead of re-encoding it as YAML.
538
+ */
539
+ AgentConfigSettingsRef: {
540
+ /** Path */
541
+ path: string;
542
+ repository?: components['schemas']['AgentConfigRepository'] | null;
543
+ };
544
+ /**
545
+ * AgentConfigSkill
546
+ * @description One config-declared Claude Code skill: a repository directory containing
547
+ * a SKILL.md, resolved at run start and installed at the sandbox's personal
548
+ * skill level (`~/.claude/skills/<basename(path)>/`). This is how a config
549
+ * brings in skills its cloned repositories don't provide — cross-repo refs
550
+ * (an org-wide skills repo), public third-party repos, and repo-less runs.
551
+ * Skills under a cloned repo's own `.claude/skills/` load by themselves and
552
+ * don't need an entry here.
553
+ */
554
+ AgentConfigSkill: {
555
+ /** Path */
556
+ path: string;
557
+ repository?: components['schemas']['AgentConfigRepository'] | null;
558
+ };
559
+ /** AgentConfigStructuredOutput */
560
+ AgentConfigStructuredOutput: {
561
+ /** Json Schema */
562
+ json_schema: {
563
+ [key: string]: unknown;
564
+ };
565
+ /**
566
+ * Type
567
+ * @default json_schema
568
+ * @constant
569
+ */
570
+ type: 'json_schema';
571
+ };
572
+ /** AgentConfigSystemFileRef */
573
+ AgentConfigSystemFileRef: {
574
+ /** File */
575
+ file: string;
576
+ };
90
577
  /**
91
578
  * AgentSessionExitStatus
92
579
  * @description Why a terminal agent session ended — a finer-grained reason than `status`.
@@ -356,6 +843,55 @@ interface components {
356
843
  * @enum {string}
357
844
  */
358
845
  BudgetSource: 'system' | 'account' | 'config' | 'run';
846
+ /**
847
+ * CreateReviewRequest
848
+ * @description Two targets, distinguished by which fields are present: an existing PR
849
+ * (`pull_request_number`) or a pushed branch (`branch` + `sha`, the local
850
+ * path — the platform finds-or-creates the draft PR).
851
+ */
852
+ CreateReviewRequest: {
853
+ /** Branch */
854
+ branch?: string | null;
855
+ /** Budget */
856
+ budget?: number | null;
857
+ config?: components['schemas']['AgentConfig'] | null;
858
+ /** Config Id */
859
+ config_id?: string | null;
860
+ /** Config Override */
861
+ config_override?: {
862
+ [key: string]: unknown;
863
+ } | null;
864
+ /** Config Override Yaml */
865
+ config_override_yaml?: string | null;
866
+ /**
867
+ * Metadata
868
+ * @default {}
869
+ */
870
+ metadata: {
871
+ [key: string]: string;
872
+ };
873
+ /** Model */
874
+ model?: string | null;
875
+ /** Owner */
876
+ owner: string;
877
+ /**
878
+ * Post
879
+ * @default true
880
+ */
881
+ post: boolean;
882
+ /** Pull Request Number */
883
+ pull_request_number?: number | null;
884
+ /** Repo */
885
+ repo: string;
886
+ /**
887
+ * @default {
888
+ * "kind": "incremental"
889
+ * }
890
+ */
891
+ scope: components['schemas']['ReviewScope'];
892
+ /** Sha */
893
+ sha?: string | null;
894
+ };
359
895
  /**
360
896
  * DefaultResolution
361
897
  * @description How a session that arrived with no explicit config source resolved its
@@ -366,6 +902,11 @@ interface components {
366
902
  * @enum {string}
367
903
  */
368
904
  DefaultResolution: 'repo_default' | 'account_default' | 'none';
905
+ /**
906
+ * EffortLevel
907
+ * @enum {string}
908
+ */
909
+ EffortLevel: 'low' | 'medium' | 'high' | 'xhigh' | 'max';
369
910
  /**
370
911
  * ExecutionStatus
371
912
  * @description Per-execution status ladder (was AgentProcessStatus). Distinct from the
@@ -374,6 +915,65 @@ interface components {
374
915
  * @enum {string}
375
916
  */
376
917
  ExecutionStatus: 'running' | 'failed' | 'done';
918
+ /**
919
+ * Finding
920
+ * @description One parsed finding (shape v1). Line anchors are file line numbers on
921
+ * `side` (RIGHT = the new file, LEFT = the old file — a finding on deleted
922
+ * code).
923
+ */
924
+ Finding: {
925
+ /** @default not_commentable */
926
+ anchor: components['schemas']['FindingAnchor'];
927
+ /**
928
+ * Category
929
+ * @default other
930
+ */
931
+ category: string;
932
+ /** Claim */
933
+ claim: string;
934
+ /** Confidence */
935
+ confidence?: number | null;
936
+ /** End Line */
937
+ end_line: number;
938
+ /**
939
+ * Evidence
940
+ * @default
941
+ */
942
+ evidence: string;
943
+ /**
944
+ * Extra
945
+ * @default {}
946
+ */
947
+ extra: {
948
+ [key: string]: unknown;
949
+ };
950
+ /** In Scope */
951
+ in_scope?: boolean | null;
952
+ /** Path */
953
+ path: string;
954
+ /**
955
+ * Severity
956
+ * @default 3
957
+ */
958
+ severity: number;
959
+ /**
960
+ * Side
961
+ * @default RIGHT
962
+ */
963
+ side: string;
964
+ /** Snapped From */
965
+ snapped_from?: [number, number] | null;
966
+ /** Start Line */
967
+ start_line: number;
968
+ /** Suggested Fix */
969
+ suggested_fix?: string | null;
970
+ };
971
+ /**
972
+ * FindingAnchor
973
+ * @description Where a finding's line anchor landed relative to the PR diff.
974
+ * @enum {string}
975
+ */
976
+ FindingAnchor: 'valid' | 'snapped' | 'not_commentable';
377
977
  /**
378
978
  * GithubAccountSnippet
379
979
  * @description Sometimes the GitHub API returns a user of github (can include bots)
@@ -406,6 +1006,21 @@ interface components {
406
1006
  * @enum {string}
407
1007
  */
408
1008
  Harness: 'claude_code';
1009
+ /**
1010
+ * IssueAction
1011
+ * @enum {string}
1012
+ */
1013
+ IssueAction: 'opened' | 'closed' | 'commented';
1014
+ /**
1015
+ * LinearIssueAction
1016
+ * @enum {string}
1017
+ */
1018
+ LinearIssueAction: 'opened';
1019
+ /** ListReviewsResponse */
1020
+ ListReviewsResponse: {
1021
+ /** Reviews */
1022
+ reviews: components['schemas']['Review'][];
1023
+ };
409
1024
  /** ListSessionExecutionsResponse */
410
1025
  ListSessionExecutionsResponse: {
411
1026
  /** Executions */
@@ -435,34 +1050,6 @@ interface components {
435
1050
  /** Turns */
436
1051
  turns: components['schemas']['AgentTurn'][];
437
1052
  };
438
- /** ModelTokensInfo */
439
- ModelTokensInfo: {
440
- /**
441
- * Cache Creation Input Tokens
442
- * @default 0
443
- */
444
- cache_creation_input_tokens: number;
445
- /**
446
- * Cache Read Input Tokens
447
- * @default 0
448
- */
449
- cache_read_input_tokens: number;
450
- /**
451
- * Cost Usd
452
- * @default 0
453
- */
454
- cost_usd: number;
455
- /**
456
- * Input Tokens
457
- * @default 0
458
- */
459
- input_tokens: number;
460
- /**
461
- * Output Tokens
462
- * @default 0
463
- */
464
- output_tokens: number;
465
- };
466
1053
  /**
467
1054
  * ParentKind
468
1055
  * @description How a session relates to its predecessor (parent_agent_session_id) —
@@ -484,6 +1071,169 @@ interface components {
484
1071
  * @enum {string}
485
1072
  */
486
1073
  PromptBlockedReason: 'mention_surface' | 'ephemeral_trigger' | 'non_interactive' | 'closed' | 'laptop';
1074
+ /**
1075
+ * PullRequestAction
1076
+ * @enum {string}
1077
+ */
1078
+ PullRequestAction: 'opened' | 'pushed' | 'merged' | 'closed' | 'review_submitted' | 'commented';
1079
+ /**
1080
+ * ReactAudience
1081
+ * @description Who may trigger a react surface, classified on the stable entity author
1082
+ * (the pusher for `push`). The set is include minus exclude: an author matches
1083
+ * iff they are in the include set (`users`/`bots`) AND not in an exclude set.
1084
+ *
1085
+ * `users`/`bots` each accept `True` (all humans / all bots), a list of logins,
1086
+ * or `[]`/`False` (none). Logins are resolved to account ids at save time.
1087
+ */
1088
+ ReactAudience: {
1089
+ /**
1090
+ * Bots
1091
+ * @default false
1092
+ */
1093
+ bots: string[] | boolean;
1094
+ /**
1095
+ * Exclude Bots
1096
+ * @default []
1097
+ */
1098
+ exclude_bots: string[];
1099
+ /**
1100
+ * Exclude Users
1101
+ * @default []
1102
+ */
1103
+ exclude_users: string[];
1104
+ /**
1105
+ * Users
1106
+ * @default true
1107
+ */
1108
+ users: string[] | boolean;
1109
+ };
1110
+ /**
1111
+ * ReactCodeReview
1112
+ * @description Action-less: reviews the unreviewed delta (watermark...head) on every head
1113
+ * advance of a matched PR, never re-commenting reviewed lines. Its entity is
1114
+ * the pull request; it reuses the `pull_request` filter set minus `on`.
1115
+ */
1116
+ ReactCodeReview: {
1117
+ /**
1118
+ * Base
1119
+ * @default []
1120
+ */
1121
+ base: string[];
1122
+ /** Draft */
1123
+ draft?: boolean | null;
1124
+ for?: components['schemas']['ReactAudience'];
1125
+ /**
1126
+ * Head
1127
+ * @default []
1128
+ */
1129
+ head: string[];
1130
+ /**
1131
+ * Labels
1132
+ * @default []
1133
+ */
1134
+ labels: string[];
1135
+ /**
1136
+ * Paths
1137
+ * @default []
1138
+ */
1139
+ paths: string[];
1140
+ /**
1141
+ * Repositories
1142
+ * @default []
1143
+ */
1144
+ repositories: string[];
1145
+ };
1146
+ /** ReactIssue */
1147
+ ReactIssue: {
1148
+ for?: components['schemas']['ReactAudience'];
1149
+ /**
1150
+ * Labels
1151
+ * @default []
1152
+ */
1153
+ labels: string[];
1154
+ /** On */
1155
+ on: components['schemas']['IssueAction'][];
1156
+ /**
1157
+ * Repositories
1158
+ * @default []
1159
+ */
1160
+ repositories: string[];
1161
+ };
1162
+ /** ReactLinearIssue */
1163
+ ReactLinearIssue: {
1164
+ for?: components['schemas']['ReactAudience'];
1165
+ /**
1166
+ * On
1167
+ * @default [
1168
+ * "opened"
1169
+ * ]
1170
+ */
1171
+ on: components['schemas']['LinearIssueAction'][];
1172
+ };
1173
+ /** ReactPullRequest */
1174
+ ReactPullRequest: {
1175
+ /**
1176
+ * Base
1177
+ * @default []
1178
+ */
1179
+ base: string[];
1180
+ /** Draft */
1181
+ draft?: boolean | null;
1182
+ for?: components['schemas']['ReactAudience'];
1183
+ /**
1184
+ * Head
1185
+ * @default []
1186
+ */
1187
+ head: string[];
1188
+ /**
1189
+ * Labels
1190
+ * @default []
1191
+ */
1192
+ labels: string[];
1193
+ /** On */
1194
+ on: components['schemas']['PullRequestAction'][];
1195
+ /**
1196
+ * Paths
1197
+ * @default []
1198
+ */
1199
+ paths: string[];
1200
+ /**
1201
+ * Repositories
1202
+ * @default []
1203
+ */
1204
+ repositories: string[];
1205
+ };
1206
+ /** ReactPush */
1207
+ ReactPush: {
1208
+ /**
1209
+ * Branch
1210
+ * @default []
1211
+ */
1212
+ branch: string[];
1213
+ for?: components['schemas']['ReactAudience'];
1214
+ /**
1215
+ * Paths
1216
+ * @default []
1217
+ */
1218
+ paths: string[];
1219
+ /**
1220
+ * Repositories
1221
+ * @default []
1222
+ */
1223
+ repositories: string[];
1224
+ };
1225
+ /** ReactSentry */
1226
+ ReactSentry: {
1227
+ /** On */
1228
+ on: components['schemas']['SentryAction'][];
1229
+ /**
1230
+ * Projects
1231
+ * @default []
1232
+ */
1233
+ projects: string[];
1234
+ };
1235
+ /** ReactSlackChannel */
1236
+ ReactSlackChannel: Record<string, never>;
487
1237
  /**
488
1238
  * RecordSource
489
1239
  * @description `session_records.source` — the client render switch. `lifecycle` rows are
@@ -492,6 +1242,129 @@ interface components {
492
1242
  * @enum {string}
493
1243
  */
494
1244
  RecordSource: 'lifecycle' | 'claude_code';
1245
+ /**
1246
+ * ResolvedReviewScope
1247
+ * @description The range a minted review actually covers, read back off the (possibly
1248
+ * doctored) PR so it can never disagree with what the session was handed.
1249
+ */
1250
+ ResolvedReviewScope: {
1251
+ /** Empty */
1252
+ empty: boolean;
1253
+ /** Head */
1254
+ head: string;
1255
+ kind: components['schemas']['ReviewScopeKind'];
1256
+ /** Watermark */
1257
+ watermark: string | null;
1258
+ };
1259
+ /**
1260
+ * Review
1261
+ * @description One review = one `code_review` session over one range. `id` IS the
1262
+ * session id, so `/v1/sessions/{id}/stream`, `/records`, `/ide`, and stop all
1263
+ * work on it unchanged.
1264
+ *
1265
+ * `review_body`, `findings`, and `counters` come from the
1266
+ * `code_review_outbox` row, which only exists after finalize — while a review
1267
+ * runs they are null/[]/null with `status: "running"`. That is why a client
1268
+ * streams the session and then re-GETs the review, the same two-step
1269
+ * `agent asset get` uses.
1270
+ */
1271
+ Review: {
1272
+ /** Completed At */
1273
+ completed_at?: string | null;
1274
+ /**
1275
+ * Cost Millicents
1276
+ * @default 0
1277
+ */
1278
+ cost_millicents: number;
1279
+ counters?: components['schemas']['ReviewCounters'] | null;
1280
+ /** Created At */
1281
+ created_at?: string | null;
1282
+ /**
1283
+ * Findings
1284
+ * @default []
1285
+ */
1286
+ findings: components['schemas']['Finding'][];
1287
+ /** Id */
1288
+ id: string;
1289
+ /** Post Error */
1290
+ post_error?: string | null;
1291
+ /** Posted Review Id */
1292
+ posted_review_id?: number | null;
1293
+ pull_request: components['schemas']['ReviewPullRequest'];
1294
+ repository: components['schemas']['ReviewRepository'];
1295
+ /** Review Body */
1296
+ review_body?: string | null;
1297
+ scope: components['schemas']['ResolvedReviewScope'];
1298
+ /** Status */
1299
+ status: string;
1300
+ /** Trigger */
1301
+ trigger: string;
1302
+ };
1303
+ /**
1304
+ * ReviewCounters
1305
+ * @description Parser and anchor reliability for one review, straight off the outbox
1306
+ * row. `parser_version` records which parser rules produced the findings, so
1307
+ * a parser change can re-parse from the raw files offline.
1308
+ */
1309
+ ReviewCounters: {
1310
+ /** N Anchor Valid */
1311
+ n_anchor_valid: number;
1312
+ /** N Coerced */
1313
+ n_coerced: number;
1314
+ /** N Dropped */
1315
+ n_dropped: number;
1316
+ /** N Not Commentable */
1317
+ n_not_commentable: number;
1318
+ /** N Parsed */
1319
+ n_parsed: number;
1320
+ /** N Raw Lines */
1321
+ n_raw_lines: number;
1322
+ /** N Snapped */
1323
+ n_snapped: number;
1324
+ /** Parser Version */
1325
+ parser_version: string;
1326
+ };
1327
+ /** ReviewPullRequest */
1328
+ ReviewPullRequest: {
1329
+ /**
1330
+ * Manufactured
1331
+ * @default false
1332
+ */
1333
+ manufactured: boolean;
1334
+ /** Number */
1335
+ number: number;
1336
+ /** Url */
1337
+ url: string;
1338
+ };
1339
+ /** ReviewRepository */
1340
+ ReviewRepository: {
1341
+ /** Id */
1342
+ id: number;
1343
+ /** Name */
1344
+ name: string;
1345
+ /** Owner */
1346
+ owner: string;
1347
+ };
1348
+ /**
1349
+ * ReviewScope
1350
+ * @description Which range to review. `watermark`/`head` pin it explicitly (the
1351
+ * harness's `--watermark`/`--head` promoted to the API — the doctored-PR path
1352
+ * that lets you evaluate a reviewer over a historical range). Values are SHAs
1353
+ * only; resolving a 1-based commit index stays a CLI/pyscript nicety.
1354
+ */
1355
+ ReviewScope: {
1356
+ /** Head */
1357
+ head?: string | null;
1358
+ /** @default incremental */
1359
+ kind: components['schemas']['ReviewScopeKind'];
1360
+ /** Watermark */
1361
+ watermark?: string | null;
1362
+ };
1363
+ /**
1364
+ * ReviewScopeKind
1365
+ * @enum {string}
1366
+ */
1367
+ ReviewScopeKind: 'incremental' | 'full';
495
1368
  /**
496
1369
  * RunStatus
497
1370
  * @description What the current (or most recent) execution is doing (backs `run`).
@@ -513,6 +1386,11 @@ interface components {
513
1386
  /** Message */
514
1387
  message: string;
515
1388
  };
1389
+ /**
1390
+ * SentryAction
1391
+ * @enum {string}
1392
+ */
1393
+ SentryAction: 'issue_alert' | 'metric_alert';
516
1394
  /** SessionExecutionWire */
517
1395
  SessionExecutionWire: {
518
1396
  /** Agent Session Id */
@@ -712,7 +1590,19 @@ interface components {
712
1590
  /** Status */
713
1591
  status: string | null;
714
1592
  };
715
- /** TokensInfo */
1593
+ /**
1594
+ * TokensInfo
1595
+ * @description Token/cost usage, per record (one API call's counts, aggregate fields at
1596
+ * their zero defaults) or aggregated per execution/session
1597
+ * (compute_spend_from_records derives num_turns and cost_usd).
1598
+ *
1599
+ * Strict on purpose: this is our own persisted schema, so an unknown key is a
1600
+ * writer bug (the num_turns=0 bug shipped because a Claude Code usage dict
1601
+ * validated leniently against this model, silently zeroing every
1602
+ * non-overlapping field). Legacy keys were dropped from persisted blobs by
1603
+ * the 2026-07-26 tokens_info migration; per-model usage lives on
1604
+ * `execution.model_usage` (CC's modelUsage, verbatim).
1605
+ */
716
1606
  TokensInfo: {
717
1607
  /**
718
1608
  * Cache Creation Input Tokens
@@ -729,11 +1619,6 @@ interface components {
729
1619
  * @default 0
730
1620
  */
731
1621
  cost_usd: number;
732
- /**
733
- * Initial System Prompt Tokens
734
- * @default 0
735
- */
736
- initial_system_prompt_tokens: number;
737
1622
  /**
738
1623
  * Input Tokens
739
1624
  * @default 0
@@ -749,46 +1634,6 @@ interface components {
749
1634
  * @default 0
750
1635
  */
751
1636
  output_tokens: number;
752
- /**
753
- * Per Model
754
- * @default {}
755
- */
756
- per_model: {
757
- [key: string]: components['schemas']['ModelTokensInfo'];
758
- };
759
- /**
760
- * Per Turn
761
- * @default []
762
- */
763
- per_turn: components['schemas']['TurnTokensInfo'][];
764
- /**
765
- * Thinking Tokens
766
- * @default 0
767
- */
768
- thinking_tokens: number;
769
- };
770
- /** TurnTokensInfo */
771
- TurnTokensInfo: {
772
- /**
773
- * Cache Creation Input Tokens
774
- * @default 0
775
- */
776
- cache_creation_input_tokens: number;
777
- /**
778
- * Cache Read Input Tokens
779
- * @default 0
780
- */
781
- cache_read_input_tokens: number;
782
- /**
783
- * Input Tokens
784
- * @default 0
785
- */
786
- input_tokens: number;
787
- /**
788
- * Output Tokens
789
- * @default 0
790
- */
791
- output_tokens: number;
792
1637
  };
793
1638
  /** ValidationError */
794
1639
  ValidationError: {
@@ -816,6 +1661,112 @@ interface components {
816
1661
  pathItems: never;
817
1662
  }
818
1663
  interface operations {
1664
+ list_reviews_v1_reviews_get: {
1665
+ parameters: {
1666
+ query?: {
1667
+ owner?: string | null;
1668
+ repo?: string | null;
1669
+ pull_request_number?: number | null;
1670
+ pull_request_id?: string | null;
1671
+ status?: components['schemas']['AgentSessionStatus'] | null;
1672
+ limit?: number;
1673
+ };
1674
+ header?: {
1675
+ 'user-agent'?: string | null;
1676
+ };
1677
+ path?: never;
1678
+ cookie?: never;
1679
+ };
1680
+ requestBody?: never;
1681
+ responses: {
1682
+ /** @description Successful Response */
1683
+ 200: {
1684
+ headers: {
1685
+ [name: string]: unknown;
1686
+ };
1687
+ content: {
1688
+ 'application/json': components['schemas']['ListReviewsResponse'];
1689
+ };
1690
+ };
1691
+ /** @description Validation Error */
1692
+ 422: {
1693
+ headers: {
1694
+ [name: string]: unknown;
1695
+ };
1696
+ content: {
1697
+ 'application/json': components['schemas']['HTTPValidationError'];
1698
+ };
1699
+ };
1700
+ };
1701
+ };
1702
+ create_review_v1_reviews_post: {
1703
+ parameters: {
1704
+ query?: never;
1705
+ header?: {
1706
+ 'user-agent'?: string | null;
1707
+ };
1708
+ path?: never;
1709
+ cookie?: never;
1710
+ };
1711
+ requestBody: {
1712
+ content: {
1713
+ 'application/json': components['schemas']['CreateReviewRequest'];
1714
+ };
1715
+ };
1716
+ responses: {
1717
+ /** @description Successful Response */
1718
+ 201: {
1719
+ headers: {
1720
+ [name: string]: unknown;
1721
+ };
1722
+ content: {
1723
+ 'application/json': components['schemas']['Review'];
1724
+ };
1725
+ };
1726
+ /** @description Validation Error */
1727
+ 422: {
1728
+ headers: {
1729
+ [name: string]: unknown;
1730
+ };
1731
+ content: {
1732
+ 'application/json': components['schemas']['HTTPValidationError'];
1733
+ };
1734
+ };
1735
+ };
1736
+ };
1737
+ get_review_v1_reviews__review_id__get: {
1738
+ parameters: {
1739
+ query?: never;
1740
+ header?: {
1741
+ 'user-agent'?: string | null;
1742
+ };
1743
+ path: {
1744
+ review_id: string;
1745
+ };
1746
+ cookie?: never;
1747
+ };
1748
+ requestBody?: never;
1749
+ responses: {
1750
+ /** @description Successful Response */
1751
+ 200: {
1752
+ headers: {
1753
+ [name: string]: unknown;
1754
+ };
1755
+ content: {
1756
+ 'application/json': components['schemas']['Review'];
1757
+ };
1758
+ };
1759
+ /** @description Validation Error */
1760
+ 422: {
1761
+ headers: {
1762
+ [name: string]: unknown;
1763
+ };
1764
+ content: {
1765
+ 'application/json': components['schemas']['HTTPValidationError'];
1766
+ };
1767
+ };
1768
+ };
1769
+ };
819
1770
  get_agent_session_v1_sessions__session_id__get: {
820
1771
  parameters: {
821
1772
  query?: never;
@@ -1228,32 +2179,25 @@ interface SessionRecordWire {
1228
2179
  tokens_info: TokensInfo | null;
1229
2180
  tools: string[] | null;
1230
2181
  }
2182
+ /**
2183
+ * Token/cost usage, per record (one API call's counts, aggregate fields at
2184
+ * their zero defaults) or aggregated per execution/session
2185
+ * (compute_spend_from_records derives num_turns and cost_usd).
2186
+ *
2187
+ * Strict on purpose: this is our own persisted schema, so an unknown key is a
2188
+ * writer bug (the num_turns=0 bug shipped because a Claude Code usage dict
2189
+ * validated leniently against this model, silently zeroing every
2190
+ * non-overlapping field). Legacy keys were dropped from persisted blobs by
2191
+ * the 2026-07-26 tokens_info migration; per-model usage lives on
2192
+ * `execution.model_usage` (CC's modelUsage, verbatim).
2193
+ */
1231
2194
  interface TokensInfo {
1232
2195
  cache_creation_input_tokens: number;
1233
2196
  cache_read_input_tokens: number;
1234
2197
  cost_usd: number;
1235
- initial_system_prompt_tokens: number;
1236
2198
  input_tokens: number;
1237
2199
  num_turns: number;
1238
2200
  output_tokens: number;
1239
- per_model: {
1240
- [k: string]: ModelTokensInfo;
1241
- };
1242
- per_turn: TurnTokensInfo[];
1243
- thinking_tokens: number;
1244
- }
1245
- interface ModelTokensInfo {
1246
- cache_creation_input_tokens: number;
1247
- cache_read_input_tokens: number;
1248
- cost_usd: number;
1249
- input_tokens: number;
1250
- output_tokens: number;
1251
- }
1252
- interface TurnTokensInfo {
1253
- cache_creation_input_tokens: number;
1254
- cache_read_input_tokens: number;
1255
- input_tokens: number;
1256
- output_tokens: number;
1257
2201
  }
1258
2202
  /**
1259
2203
  * LWW snapshot of the enriched public session (§4.1) — the only way
@@ -1311,5 +2255,13 @@ type AgentTurn = components['schemas']['AgentTurn'];
1311
2255
  type AgentTurnStatus = components['schemas']['AgentTurnStatus'];
1312
2256
  type ListSessionExecutionsResponse = components['schemas']['ListSessionExecutionsResponse'];
1313
2257
  type SessionExecutionWire = components['schemas']['SessionExecutionWire'];
2258
+ type CreateReviewRequest = components['schemas']['CreateReviewRequest'];
2259
+ type Review = components['schemas']['Review'];
2260
+ type ListReviewsResponse = components['schemas']['ListReviewsResponse'];
2261
+ type ReviewScope = components['schemas']['ReviewScope'];
2262
+ type ReviewScopeKind = components['schemas']['ReviewScopeKind'];
2263
+ type ResolvedReviewScope = components['schemas']['ResolvedReviewScope'];
2264
+ type ReviewCounters = components['schemas']['ReviewCounters'];
2265
+ type Finding = components['schemas']['Finding'];
1314
2266
 
1315
- export type { AgentSessionWire as A, BudgetSource as B, TurnTokensInfo as C, DefaultResolution as D, ErrorFrame as E, components as F, GithubAccountSnippet as G, Harness as H, paths as I, ListSessionRecordsResponse as L, ModelTokensInfo as M, ParentKind as P, RecordsAppendFrame as R, SessionMessageWire as S, TokensInfo as T, ListSessionTurnsResponse as a, ListSessionExecutionsResponse as b, AgentSessionExitStatus as c, AgentSessionPr as d, AgentSessionSource as e, AgentSessionStatus as f, AgentTurn as g, AgentTurnStatus as h, AttributionType as i, DeltaFrame as j, DoneFrame as k, GithubAccountType as l, HeartbeatFrame as m, PromptBlockedReason as n, SendSessionMessageRequest as o, SessionExecutionWire as p, SessionFrame as q, SessionLiveness as r, SessionMessageStatus as s, SessionPrompting as t, SessionRecordWire as u, SessionState as v, SessionStreamFrame as w, SessionSurface as x, SnapshotFrame as y, StreamFrame as z };
2267
+ export type { AgentSessionWire as A, BudgetSource as B, CreateReviewRequest as C, DefaultResolution as D, ErrorFrame as E, Finding as F, GithubAccountSnippet as G, Harness as H, SessionRecordWire as I, SessionState as J, SessionStreamFrame as K, ListSessionRecordsResponse as L, SessionSurface as M, SnapshotFrame as N, StreamFrame as O, ParentKind as P, components as Q, Review as R, SessionMessageWire as S, TokensInfo as T, paths as U, ListSessionTurnsResponse as a, ListSessionExecutionsResponse as b, ListReviewsResponse as c, AgentSessionExitStatus as d, AgentSessionPr as e, AgentSessionSource as f, AgentSessionStatus as g, AgentTurn as h, AgentTurnStatus as i, AttributionType as j, DeltaFrame as k, DoneFrame as l, GithubAccountType as m, HeartbeatFrame as n, PromptBlockedReason as o, RecordsAppendFrame as p, ResolvedReviewScope as q, ReviewCounters as r, ReviewScope as s, ReviewScopeKind as t, SendSessionMessageRequest as u, SessionExecutionWire as v, SessionFrame as w, SessionLiveness as x, SessionMessageStatus as y, SessionPrompting as z };