@ellipsis-dev/sdk 0.5.0 → 0.7.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,2267 +0,0 @@
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
- };
37
- '/v1/sessions/{session_id}': {
38
- parameters: {
39
- query?: never;
40
- header?: never;
41
- path?: never;
42
- cookie?: never;
43
- };
44
- /** Get Agent Session */
45
- get: operations['get_agent_session_v1_sessions__session_id__get'];
46
- put?: never;
47
- post?: never;
48
- delete?: never;
49
- options?: never;
50
- head?: never;
51
- patch?: never;
52
- trace?: never;
53
- };
54
- '/v1/sessions/{session_id}/executions': {
55
- parameters: {
56
- query?: never;
57
- header?: never;
58
- path?: never;
59
- cookie?: never;
60
- };
61
- /** Get Agent Session Executions */
62
- get: operations['get_agent_session_executions_v1_sessions__session_id__executions_get'];
63
- put?: never;
64
- post?: never;
65
- delete?: never;
66
- options?: never;
67
- head?: never;
68
- patch?: never;
69
- trace?: never;
70
- };
71
- '/v1/sessions/{session_id}/messages': {
72
- parameters: {
73
- query?: never;
74
- header?: never;
75
- path?: never;
76
- cookie?: never;
77
- };
78
- get?: never;
79
- put?: never;
80
- /** Send Agent Session Message */
81
- post: operations['send_agent_session_message_v1_sessions__session_id__messages_post'];
82
- delete?: never;
83
- options?: never;
84
- head?: never;
85
- patch?: never;
86
- trace?: never;
87
- };
88
- '/v1/sessions/{session_id}/records': {
89
- parameters: {
90
- query?: never;
91
- header?: never;
92
- path?: never;
93
- cookie?: never;
94
- };
95
- /** Get Agent Session Records */
96
- get: operations['get_agent_session_records_v1_sessions__session_id__records_get'];
97
- put?: never;
98
- post?: never;
99
- delete?: never;
100
- options?: never;
101
- head?: never;
102
- patch?: never;
103
- trace?: never;
104
- };
105
- '/v1/sessions/{session_id}/turns': {
106
- parameters: {
107
- query?: never;
108
- header?: never;
109
- path?: never;
110
- cookie?: never;
111
- };
112
- /** Get Agent Session Turns */
113
- get: operations['get_agent_session_turns_v1_sessions__session_id__turns_get'];
114
- put?: never;
115
- post?: never;
116
- delete?: never;
117
- options?: never;
118
- head?: never;
119
- patch?: never;
120
- trace?: never;
121
- };
122
- }
123
- interface components {
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 /v1/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
- };
577
- /**
578
- * AgentSessionExitStatus
579
- * @description Why a terminal agent session ended — a finer-grained reason than `status`.
580
- *
581
- * `status` (AgentSessionStatus) is the lifecycle state: COMPLETED / ERROR /
582
- * CANCELLED. `exit_status` explains *why* a run reached that terminal state, so
583
- * the UI and metrics can tell a budget cutoff apart from a crashed tool call or
584
- * a deliberate cancellation. It is None until the run reaches a terminal state.
585
- * @enum {string}
586
- */
587
- AgentSessionExitStatus: 'completed' | 'budget_hit' | 'payment_required' | 'tool_call_failed' | 'lifecycle_hook_failed' | 'missing_repo_access' | 'missing_token_permissions' | 'missing_sandbox_variables' | 'cancelled' | 'interrupted' | 'error' | 'stopped';
588
- /**
589
- * AgentSessionPr
590
- * @description A pull request this session created, denormalized at capture time so
591
- * session surfaces render a labeled link without joining gh_prs. Live PR
592
- * state (open/merged/closed) is not stored here — read it from gh_prs where
593
- * a view needs it.
594
- */
595
- AgentSessionPr: {
596
- /** Gh Pr Id */
597
- gh_pr_id?: number | null;
598
- /** Number */
599
- number: number;
600
- /** Repo Full Name */
601
- repo_full_name: string;
602
- /** Title */
603
- title?: string | null;
604
- /** Url */
605
- url: string;
606
- };
607
- /**
608
- * AgentSessionSource
609
- * @enum {string}
610
- */
611
- AgentSessionSource: 'react' | 'manual' | 'api' | 'cli' | 'mention' | 'cron' | 'laptop';
612
- /**
613
- * AgentSessionStatus
614
- * @enum {string}
615
- */
616
- AgentSessionStatus: 'scheduled' | 'creating_sandbox' | 'running' | 'retrying' | 'completed' | 'error' | 'cancelled' | 'stopped';
617
- /** AgentSessionWire */
618
- AgentSessionWire: {
619
- /** Agent Config Id */
620
- agent_config_id?: string | null;
621
- attributed_user?: components['schemas']['GithubAccountSnippet'] | null;
622
- /** Attribution Id */
623
- attribution_id?: string | null;
624
- attribution_type?: components['schemas']['AttributionType'] | null;
625
- /** Client Version */
626
- client_version?: string | null;
627
- /** Config Override */
628
- config_override?: {
629
- [key: string]: unknown;
630
- } | null;
631
- /** Context Repository */
632
- context_repository?: string | null;
633
- /**
634
- * Cost Fee
635
- * @default 0
636
- */
637
- cost_fee: number;
638
- /**
639
- * Cost Sandbox Cpu
640
- * @default 0
641
- */
642
- cost_sandbox_cpu: number;
643
- /**
644
- * Cost Sandbox Memory
645
- * @default 0
646
- */
647
- cost_sandbox_memory: number;
648
- /** Cost Tokens */
649
- cost_tokens: number;
650
- /**
651
- * Created At
652
- * Format: date-time
653
- */
654
- created_at: string;
655
- /** Customer Id */
656
- customer_id: string;
657
- default_resolution?: components['schemas']['DefaultResolution'] | null;
658
- exit_status?: components['schemas']['AgentSessionExitStatus'] | null;
659
- harness: components['schemas']['Harness'];
660
- /** Id */
661
- id: string;
662
- /** Last Activity At */
663
- last_activity_at?: string | null;
664
- /** Last Message At */
665
- last_message_at?: string | null;
666
- /** Live Summary */
667
- live_summary?: string | null;
668
- /**
669
- * Metadata
670
- * @default {}
671
- */
672
- metadata: {
673
- [key: string]: string;
674
- };
675
- /** Output Prs */
676
- output_prs?: components['schemas']['AgentSessionPr'][] | null;
677
- /** Parent Agent Session Id */
678
- parent_agent_session_id?: string | null;
679
- parent_kind?: components['schemas']['ParentKind'] | null;
680
- /** Prompt */
681
- prompt?: string | null;
682
- prompting: components['schemas']['SessionPrompting'];
683
- /** Replayed From Session Id */
684
- replayed_from_session_id?: string | null;
685
- /** Resolved Budget Cents */
686
- resolved_budget_cents: number;
687
- resolved_budget_source: components['schemas']['BudgetSource'];
688
- /** Sandbox Id */
689
- sandbox_id?: string | null;
690
- /** Session Key */
691
- session_key?: string | null;
692
- session_state?: components['schemas']['SessionState'] | null;
693
- source: components['schemas']['AgentSessionSource'];
694
- status: components['schemas']['AgentSessionStatus'];
695
- /** Status Reason */
696
- status_reason?: string | null;
697
- /** Stopped At */
698
- stopped_at?: string | null;
699
- /** Stopped By */
700
- stopped_by?: number | null;
701
- stopped_by_user?: components['schemas']['GithubAccountSnippet'] | null;
702
- surface?: components['schemas']['SessionSurface'] | null;
703
- /**
704
- * Tokens Cache Creation
705
- * @default 0
706
- */
707
- tokens_cache_creation: number;
708
- /**
709
- * Tokens Cache Read
710
- * @default 0
711
- */
712
- tokens_cache_read: number;
713
- /**
714
- * Tokens Input
715
- * @default 0
716
- */
717
- tokens_input: number;
718
- /** Tokens Model */
719
- tokens_model: string;
720
- /**
721
- * Tokens Output
722
- * @default 0
723
- */
724
- tokens_output: number;
725
- /**
726
- * Tokens Total
727
- * @default 0
728
- */
729
- tokens_total: number;
730
- /**
731
- * Updated At
732
- * Format: date-time
733
- */
734
- updated_at: string;
735
- /** Webhook Id */
736
- webhook_id?: string | null;
737
- webhook_type?: components['schemas']['WebhookType'] | null;
738
- };
739
- /**
740
- * AgentTurn
741
- * @description One exchange within a session: a single Claude Code execution driven by the
742
- * session's inbox. Over subsequent slices this absorbs the per-execution fields
743
- * (status, cost, tokens, exit_status) that currently live on agent_sessions.
744
- */
745
- AgentTurn: {
746
- /** Agent Session Id */
747
- agent_session_id: string;
748
- /** Completed At */
749
- completed_at?: string | null;
750
- /**
751
- * Cost Fee
752
- * @default 0
753
- */
754
- cost_fee: number;
755
- /**
756
- * Cost Sandbox Cpu
757
- * @default 0
758
- */
759
- cost_sandbox_cpu: number;
760
- /**
761
- * Cost Sandbox Memory
762
- * @default 0
763
- */
764
- cost_sandbox_memory: number;
765
- /**
766
- * Cost Tokens
767
- * @default 0
768
- */
769
- cost_tokens: number;
770
- /**
771
- * Created At
772
- * Format: date-time
773
- */
774
- created_at: string;
775
- exit_status?: components['schemas']['AgentSessionExitStatus'] | null;
776
- /** Id */
777
- id: string;
778
- /** React Action */
779
- react_action?: string | null;
780
- /** Sandbox Id */
781
- sandbox_id?: string | null;
782
- /** Session Execution Id */
783
- session_execution_id?: string | null;
784
- /** Started At */
785
- started_at?: string | null;
786
- status: components['schemas']['AgentTurnStatus'];
787
- /** Status Reason */
788
- status_reason?: string | null;
789
- /**
790
- * Tokens Cache Creation
791
- * @default 0
792
- */
793
- tokens_cache_creation: number;
794
- /**
795
- * Tokens Cache Read
796
- * @default 0
797
- */
798
- tokens_cache_read: number;
799
- /**
800
- * Tokens Input
801
- * @default 0
802
- */
803
- tokens_input: number;
804
- /** Tokens Model */
805
- tokens_model?: string | null;
806
- /**
807
- * Tokens Output
808
- * @default 0
809
- */
810
- tokens_output: number;
811
- /**
812
- * Tokens Total
813
- * @default 0
814
- */
815
- tokens_total: number;
816
- /** Turn Index */
817
- turn_index: number;
818
- /**
819
- * Updated At
820
- * Format: date-time
821
- */
822
- updated_at: string;
823
- /** Webhook Id */
824
- webhook_id?: string | null;
825
- webhook_type?: components['schemas']['WebhookType'] | null;
826
- };
827
- /**
828
- * AgentTurnStatus
829
- * @enum {string}
830
- */
831
- AgentTurnStatus: 'scheduled' | 'running' | 'completed' | 'error' | 'cancelled';
832
- /**
833
- * AttributionType
834
- * @enum {string}
835
- */
836
- AttributionType: 'github_user' | 'linear_user' | 'slack_user' | 'api_key';
837
- /**
838
- * BudgetSource
839
- * @description Which layer actually determined the enforced budget.
840
- *
841
- * Not derivable from the run row alone (the run does not store the config
842
- * cents or the customer default), so we persist it for the UI / audit.
843
- * @enum {string}
844
- */
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
- };
895
- /**
896
- * DefaultResolution
897
- * @description How a session that arrived with no explicit config source resolved its
898
- * config (documents/eng/DEFAULT_CONFIGS.md §4). Persisted on the session so
899
- * audit and clients can say "ran under X (repo default)". A session started
900
- * with an explicit config/config_id/template_id never enters resolution and
901
- * stores None.
902
- * @enum {string}
903
- */
904
- DefaultResolution: 'repo_default' | 'account_default' | 'none';
905
- /**
906
- * EffortLevel
907
- * @enum {string}
908
- */
909
- EffortLevel: 'low' | 'medium' | 'high' | 'xhigh' | 'max';
910
- /**
911
- * ExecutionStatus
912
- * @description Per-execution status ladder (was AgentProcessStatus). Distinct from the
913
- * session's durable `session_state` and from `agent_sessions.status`, which
914
- * remains the atomic claim/dispatch guard.
915
- * @enum {string}
916
- */
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';
977
- /**
978
- * GithubAccountSnippet
979
- * @description Sometimes the GitHub API returns a user of github (can include bots)
980
- * using this snippet instead of the full GithubAccount model. One example,
981
- * is when the API returns a pull request.
982
- *
983
- * This is the least amount of info we need to represent a GitHub account.
984
- */
985
- GithubAccountSnippet: {
986
- /** Avatar Url */
987
- avatar_url: string;
988
- /** Id */
989
- id: number;
990
- /** Login */
991
- login: string;
992
- type: components['schemas']['GithubAccountType'];
993
- };
994
- /**
995
- * GithubAccountType
996
- * @enum {string}
997
- */
998
- GithubAccountType: 'User' | 'Organization' | 'Bot' | 'Mannequin';
999
- /** HTTPValidationError */
1000
- HTTPValidationError: {
1001
- /** Detail */
1002
- detail?: components['schemas']['ValidationError'][];
1003
- };
1004
- /**
1005
- * Harness
1006
- * @enum {string}
1007
- */
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
- };
1024
- /** ListSessionExecutionsResponse */
1025
- ListSessionExecutionsResponse: {
1026
- /** Executions */
1027
- executions: components['schemas']['SessionExecutionWire'][];
1028
- };
1029
- /** ListSessionRecordsResponse */
1030
- ListSessionRecordsResponse: {
1031
- /** Earliest Feed Seq */
1032
- earliest_feed_seq?: number | null;
1033
- /**
1034
- * Has More
1035
- * @default false
1036
- */
1037
- has_more: boolean;
1038
- /**
1039
- * Messages
1040
- * @default []
1041
- */
1042
- messages: components['schemas']['SessionMessageWire'][];
1043
- /** Records */
1044
- records: components['schemas']['SessionRecordWire'][];
1045
- };
1046
- /** ListSessionTurnsResponse */
1047
- ListSessionTurnsResponse: {
1048
- /** Messages */
1049
- messages: components['schemas']['SessionMessage'][];
1050
- /** Turns */
1051
- turns: components['schemas']['AgentTurn'][];
1052
- };
1053
- /**
1054
- * ParentKind
1055
- * @description How a session relates to its predecessor (parent_agent_session_id) —
1056
- * the ONE "preceded-by" chain for every predecessor relationship. Routing
1057
- * reads this when the distinction matters.
1058
- *
1059
- * CONTINUATION — a follow-up in the same conversation surface (e.g. a Slack
1060
- * thread reply spawning a fresh session on the same thread).
1061
- * HANDOFF — a session started to take over work from another surface (e.g.
1062
- * laptop → cloud handoff; later phase).
1063
- * RESUME — a conversation re-hosted on a new box after its sandbox was torn
1064
- * down (interactive platform; later phase).
1065
- * @enum {string}
1066
- */
1067
- ParentKind: 'continuation' | 'handoff' | 'resume';
1068
- /**
1069
- * PromptBlockedReason
1070
- * @description Why direct prompting is refused. Absent when prompting is allowed.
1071
- * @enum {string}
1072
- */
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>;
1237
- /**
1238
- * RecordSource
1239
- * @description `session_records.source` — the client render switch. `lifecycle` rows are
1240
- * controller-emitted platform notifications; a harness value means a native
1241
- * transcript record from that harness.
1242
- * @enum {string}
1243
- */
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';
1368
- /**
1369
- * RunStatus
1370
- * @description What the current (or most recent) execution is doing (backs `run`).
1371
- * @enum {string}
1372
- */
1373
- RunStatus: 'scheduled' | 'starting' | 'working' | 'waiting' | 'done' | 'failed' | 'stopped' | 'cancelled' | 'retrying';
1374
- /**
1375
- * SendSessionMessageRequest
1376
- * @description A human message posted into a durable (keyed) session's conversation
1377
- * (documents/eng/SESSION_IDE.md). Delivered to the live Claude Code process
1378
- * at the next turn boundary, or wakes the session when idle. This is what
1379
- * the `agent` CLI's connect composer calls — including from inside the
1380
- * session's own sandbox, where the sandbox token inherits the session's
1381
- * attribution.
1382
- */
1383
- SendSessionMessageRequest: {
1384
- /** Idempotency Key */
1385
- idempotency_key?: string | null;
1386
- /** Message */
1387
- message: string;
1388
- };
1389
- /**
1390
- * SentryAction
1391
- * @enum {string}
1392
- */
1393
- SentryAction: 'issue_alert' | 'metric_alert';
1394
- /** SessionExecutionWire */
1395
- SessionExecutionWire: {
1396
- /** Agent Session Id */
1397
- agent_session_id: string;
1398
- /** Attempt Index */
1399
- attempt_index: number;
1400
- /**
1401
- * Created At
1402
- * Format: date-time
1403
- */
1404
- created_at: string;
1405
- /** Execution Index */
1406
- execution_index: number;
1407
- /** Exit Status */
1408
- exit_status?: string | null;
1409
- /** Id */
1410
- id: string;
1411
- /** Model */
1412
- model?: string | null;
1413
- /** Query */
1414
- query?: string | null;
1415
- /** Resumed */
1416
- resumed: boolean;
1417
- status: components['schemas']['ExecutionStatus'];
1418
- /** System Prompt Append */
1419
- system_prompt_append?: string | null;
1420
- /** Wake Index */
1421
- wake_index: number;
1422
- };
1423
- /**
1424
- * SessionLiveness
1425
- * @description The durable conversation axis (backs the surfaced `session` field).
1426
- * @enum {string}
1427
- */
1428
- SessionLiveness: 'alive' | 'sleeping' | 'closed';
1429
- /**
1430
- * SessionMessage
1431
- * @description One entry in a session's inbox: an event, rendered into a user message,
1432
- * waiting to be consumed by a turn. body is the RENDERED text (pointers to
1433
- * code/events, never embedded diffs), so a turn's initial query is built from
1434
- * the pending messages without re-fetching the trigger.
1435
- */
1436
- SessionMessage: {
1437
- /** Agent Session Id */
1438
- agent_session_id: string;
1439
- /** Author */
1440
- author?: string | null;
1441
- /** Body */
1442
- body: string;
1443
- /**
1444
- * Closes Session
1445
- * @default false
1446
- */
1447
- closes_session: boolean;
1448
- /**
1449
- * Created At
1450
- * Format: date-time
1451
- */
1452
- created_at: string;
1453
- /** Delivered At */
1454
- delivered_at?: string | null;
1455
- /** Delivered Turn Id */
1456
- delivered_turn_id?: string | null;
1457
- /** Feed Seq */
1458
- feed_seq?: number | null;
1459
- /** Id */
1460
- id: string;
1461
- /** Idempotency Key */
1462
- idempotency_key?: string | null;
1463
- /** Platform Ts */
1464
- platform_ts?: string | null;
1465
- /** Sender Attribution Id */
1466
- sender_attribution_id?: string | null;
1467
- sender_attribution_type?: components['schemas']['AttributionType'] | null;
1468
- status: components['schemas']['SessionMessageStatus'];
1469
- /** Webhook Id */
1470
- webhook_id?: string | null;
1471
- webhook_type?: components['schemas']['WebhookType'] | null;
1472
- };
1473
- /**
1474
- * SessionMessageStatus
1475
- * @enum {string}
1476
- */
1477
- SessionMessageStatus: 'pending' | 'delivered';
1478
- /**
1479
- * SessionMessageWire
1480
- * @description The wire shape of one inbox message (§3.3): what a queued chip renders
1481
- * and retires on. `author` is the message's attribution string; the webhook
1482
- * provenance internals stay off the wire.
1483
- */
1484
- SessionMessageWire: {
1485
- /** Agent Session Id */
1486
- agent_session_id: string;
1487
- /** Author */
1488
- author?: string | null;
1489
- /** Body */
1490
- body: string;
1491
- /**
1492
- * Created At
1493
- * Format: date-time
1494
- */
1495
- created_at: string;
1496
- /** Delivered At */
1497
- delivered_at?: string | null;
1498
- /** Delivered Turn Id */
1499
- delivered_turn_id?: string | null;
1500
- /** Feed Seq */
1501
- feed_seq?: number | null;
1502
- /** Id */
1503
- id: string;
1504
- /** Sender Attribution Id */
1505
- sender_attribution_id?: string | null;
1506
- sender_attribution_type?: components['schemas']['AttributionType'] | null;
1507
- status: components['schemas']['SessionMessageStatus'];
1508
- };
1509
- /**
1510
- * SessionPrompting
1511
- * @description The prompt-affordance projection. `enabled` answers "would a send work",
1512
- * and when it wouldn't, `blocked_reason` + `detail` say why.
1513
- *
1514
- * `surface_name` is set only for MENTION_SURFACE, naming where to reply.
1515
- */
1516
- SessionPrompting: {
1517
- blocked_reason?: components['schemas']['PromptBlockedReason'] | null;
1518
- /** Detail */
1519
- detail?: string | null;
1520
- /** Enabled */
1521
- enabled: boolean;
1522
- /** Surface Name */
1523
- surface_name?: string | null;
1524
- };
1525
- /**
1526
- * SessionRecordWire
1527
- * @description The wire shape of one session record (§3.3): the §3.6 stable envelope +
1528
- * the native `payload`, by explicit allowlist. Internal-only columns
1529
- * (`search_text`, `clis`, ingest bookkeeping, attribution denormalizations)
1530
- * are deliberately absent so internal model evolution stays free.
1531
- */
1532
- SessionRecordWire: {
1533
- /** Agent Session Id */
1534
- agent_session_id: string;
1535
- /** Agent Turn Id */
1536
- agent_turn_id?: string | null;
1537
- /** Cost */
1538
- cost?: number | null;
1539
- /**
1540
- * Created At
1541
- * Format: date-time
1542
- */
1543
- created_at: string;
1544
- /** Duration */
1545
- duration?: number | null;
1546
- /** Feed Seq */
1547
- feed_seq: number;
1548
- /** Id */
1549
- id: string;
1550
- /** Model */
1551
- model?: string | null;
1552
- /** Payload */
1553
- payload: {
1554
- [key: string]: unknown;
1555
- };
1556
- /** Record Format */
1557
- record_format: string;
1558
- /** Record Type */
1559
- record_type: string;
1560
- /** Session Message Id */
1561
- session_message_id?: string | null;
1562
- source: components['schemas']['RecordSource'];
1563
- /** Stream Seq */
1564
- stream_seq: number;
1565
- tokens_info?: components['schemas']['TokensInfo'] | null;
1566
- /** Tools */
1567
- tools?: string[] | null;
1568
- };
1569
- /**
1570
- * SessionState
1571
- * @description Lifecycle of a keyed (multi-turn) session — the durable conversation.
1572
- * Distinct from AgentSessionStatus, which is per-execution (one turn's run) and
1573
- * moves to agent_turns in a later slice. IDLE: alive, waiting for the next
1574
- * message. RUNNING: a turn is executing. CLOSED: the conversation is done and
1575
- * its sandbox/snapshots are torn down.
1576
- * @enum {string}
1577
- */
1578
- SessionState: 'idle' | 'running' | 'closed';
1579
- /**
1580
- * SessionSurface
1581
- * @description The three fields we expose. All `None` for an un-keyed (laptop) session.
1582
- *
1583
- * `use_enum_values=True` (from CustomBaseModel) stores the members as their
1584
- * string values, so this serializes to `{"session": "alive", "run": "waiting",
1585
- * "status": "waiting"}` — a plain object, not enum names.
1586
- */
1587
- SessionSurface: {
1588
- run: components['schemas']['RunStatus'] | null;
1589
- session: components['schemas']['SessionLiveness'] | null;
1590
- /** Status */
1591
- status: string | null;
1592
- };
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
- */
1606
- TokensInfo: {
1607
- /**
1608
- * Cache Creation Input Tokens
1609
- * @default 0
1610
- */
1611
- cache_creation_input_tokens: number;
1612
- /**
1613
- * Cache Read Input Tokens
1614
- * @default 0
1615
- */
1616
- cache_read_input_tokens: number;
1617
- /**
1618
- * Cost Usd
1619
- * @default 0
1620
- */
1621
- cost_usd: number;
1622
- /**
1623
- * Input Tokens
1624
- * @default 0
1625
- */
1626
- input_tokens: number;
1627
- /**
1628
- * Num Turns
1629
- * @default 0
1630
- */
1631
- num_turns: number;
1632
- /**
1633
- * Output Tokens
1634
- * @default 0
1635
- */
1636
- output_tokens: number;
1637
- };
1638
- /** ValidationError */
1639
- ValidationError: {
1640
- /** Context */
1641
- ctx?: Record<string, never>;
1642
- /** Input */
1643
- input?: unknown;
1644
- /** Location */
1645
- loc: (string | number)[];
1646
- /** Message */
1647
- msg: string;
1648
- /** Error Type */
1649
- type: string;
1650
- };
1651
- /**
1652
- * WebhookType
1653
- * @enum {string}
1654
- */
1655
- WebhookType: 'github.issue' | 'github.issue_comment' | 'github.push' | 'github.pull_request' | 'github.pull_request_comment' | 'github.pull_request_review' | 'github.pull_request_review_comment' | 'slack.app_mention' | 'slack.message' | 'slack.channel_created' | 'linear.issue' | 'linear.issue_comment' | 'sentry.event_alert' | 'sentry.metric_alert' | 'user.message';
1656
- };
1657
- responses: never;
1658
- parameters: never;
1659
- requestBodies: never;
1660
- headers: never;
1661
- pathItems: never;
1662
- }
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
- };
1770
- get_agent_session_v1_sessions__session_id__get: {
1771
- parameters: {
1772
- query?: never;
1773
- header?: {
1774
- 'user-agent'?: string | null;
1775
- };
1776
- path: {
1777
- session_id: string;
1778
- };
1779
- cookie?: never;
1780
- };
1781
- requestBody?: never;
1782
- responses: {
1783
- /** @description Successful Response */
1784
- 200: {
1785
- headers: {
1786
- [name: string]: unknown;
1787
- };
1788
- content: {
1789
- 'application/json': components['schemas']['AgentSessionWire'];
1790
- };
1791
- };
1792
- /** @description Validation Error */
1793
- 422: {
1794
- headers: {
1795
- [name: string]: unknown;
1796
- };
1797
- content: {
1798
- 'application/json': components['schemas']['HTTPValidationError'];
1799
- };
1800
- };
1801
- };
1802
- };
1803
- get_agent_session_executions_v1_sessions__session_id__executions_get: {
1804
- parameters: {
1805
- query?: never;
1806
- header?: {
1807
- 'user-agent'?: string | null;
1808
- };
1809
- path: {
1810
- session_id: string;
1811
- };
1812
- cookie?: never;
1813
- };
1814
- requestBody?: never;
1815
- responses: {
1816
- /** @description Successful Response */
1817
- 200: {
1818
- headers: {
1819
- [name: string]: unknown;
1820
- };
1821
- content: {
1822
- 'application/json': components['schemas']['ListSessionExecutionsResponse'];
1823
- };
1824
- };
1825
- /** @description Validation Error */
1826
- 422: {
1827
- headers: {
1828
- [name: string]: unknown;
1829
- };
1830
- content: {
1831
- 'application/json': components['schemas']['HTTPValidationError'];
1832
- };
1833
- };
1834
- };
1835
- };
1836
- send_agent_session_message_v1_sessions__session_id__messages_post: {
1837
- parameters: {
1838
- query?: never;
1839
- header?: {
1840
- 'user-agent'?: string | null;
1841
- };
1842
- path: {
1843
- session_id: string;
1844
- };
1845
- cookie?: never;
1846
- };
1847
- requestBody: {
1848
- content: {
1849
- 'application/json': components['schemas']['SendSessionMessageRequest'];
1850
- };
1851
- };
1852
- responses: {
1853
- /** @description Successful Response */
1854
- 200: {
1855
- headers: {
1856
- [name: string]: unknown;
1857
- };
1858
- content: {
1859
- 'application/json': components['schemas']['SessionMessageWire'];
1860
- };
1861
- };
1862
- /** @description Validation Error */
1863
- 422: {
1864
- headers: {
1865
- [name: string]: unknown;
1866
- };
1867
- content: {
1868
- 'application/json': components['schemas']['HTTPValidationError'];
1869
- };
1870
- };
1871
- };
1872
- };
1873
- get_agent_session_records_v1_sessions__session_id__records_get: {
1874
- parameters: {
1875
- query?: {
1876
- after_seq?: number;
1877
- limit?: number | null;
1878
- };
1879
- header?: {
1880
- 'user-agent'?: string | null;
1881
- };
1882
- path: {
1883
- session_id: string;
1884
- };
1885
- cookie?: never;
1886
- };
1887
- requestBody?: never;
1888
- responses: {
1889
- /** @description Successful Response */
1890
- 200: {
1891
- headers: {
1892
- [name: string]: unknown;
1893
- };
1894
- content: {
1895
- 'application/json': components['schemas']['ListSessionRecordsResponse'];
1896
- };
1897
- };
1898
- /** @description Validation Error */
1899
- 422: {
1900
- headers: {
1901
- [name: string]: unknown;
1902
- };
1903
- content: {
1904
- 'application/json': components['schemas']['HTTPValidationError'];
1905
- };
1906
- };
1907
- };
1908
- };
1909
- get_agent_session_turns_v1_sessions__session_id__turns_get: {
1910
- parameters: {
1911
- query?: never;
1912
- header?: {
1913
- 'user-agent'?: string | null;
1914
- };
1915
- path: {
1916
- session_id: string;
1917
- };
1918
- cookie?: never;
1919
- };
1920
- requestBody?: never;
1921
- responses: {
1922
- /** @description Successful Response */
1923
- 200: {
1924
- headers: {
1925
- [name: string]: unknown;
1926
- };
1927
- content: {
1928
- 'application/json': components['schemas']['ListSessionTurnsResponse'];
1929
- };
1930
- };
1931
- /** @description Validation Error */
1932
- 422: {
1933
- headers: {
1934
- [name: string]: unknown;
1935
- };
1936
- content: {
1937
- 'application/json': components['schemas']['HTTPValidationError'];
1938
- };
1939
- };
1940
- };
1941
- };
1942
- }
1943
-
1944
- /**
1945
- * One server-to-client frame of the Ellipsis session stream protocol v3 (WS /v1/sessions/{id}/stream?protocol=3). Clients MUST ignore frames with unknown `type` values — additive frames are not a protocol break.
1946
- */
1947
- type SessionStreamFrame = SnapshotFrame | RecordsAppendFrame | SessionFrame | DeltaFrame | HeartbeatFrame | DoneFrame | ErrorFrame;
1948
- type AttributionType = 'github_user' | 'linear_user' | 'slack_user' | 'api_key';
1949
- type SessionMessageStatus = 'pending' | 'delivered';
1950
- type GithubAccountType = 'User' | 'Organization' | 'Bot' | 'Mannequin';
1951
- /**
1952
- * How a session that arrived with no explicit config source resolved its
1953
- * config (documents/eng/DEFAULT_CONFIGS.md §4). Persisted on the session so
1954
- * audit and clients can say "ran under X (repo default)". A session started
1955
- * with an explicit config/config_id/template_id never enters resolution and
1956
- * stores None.
1957
- */
1958
- type DefaultResolution = 'repo_default' | 'account_default' | 'none';
1959
- /**
1960
- * Why a terminal agent session ended — a finer-grained reason than `status`.
1961
- *
1962
- * `status` (AgentSessionStatus) is the lifecycle state: COMPLETED / ERROR /
1963
- * CANCELLED. `exit_status` explains *why* a run reached that terminal state, so
1964
- * the UI and metrics can tell a budget cutoff apart from a crashed tool call or
1965
- * a deliberate cancellation. It is None until the run reaches a terminal state.
1966
- */
1967
- type AgentSessionExitStatus = 'completed' | 'budget_hit' | 'payment_required' | 'tool_call_failed' | 'lifecycle_hook_failed' | 'missing_repo_access' | 'missing_token_permissions' | 'missing_sandbox_variables' | 'cancelled' | 'interrupted' | 'error' | 'stopped';
1968
- type Harness = 'claude_code';
1969
- /**
1970
- * How a session relates to its predecessor (parent_agent_session_id) —
1971
- * the ONE "preceded-by" chain for every predecessor relationship. Routing
1972
- * reads this when the distinction matters.
1973
- *
1974
- * CONTINUATION — a follow-up in the same conversation surface (e.g. a Slack
1975
- * thread reply spawning a fresh session on the same thread).
1976
- * HANDOFF — a session started to take over work from another surface (e.g.
1977
- * laptop → cloud handoff; later phase).
1978
- * RESUME — a conversation re-hosted on a new box after its sandbox was torn
1979
- * down (interactive platform; later phase).
1980
- */
1981
- type ParentKind = 'continuation' | 'handoff' | 'resume';
1982
- /**
1983
- * Why direct prompting is refused. Absent when prompting is allowed.
1984
- */
1985
- type PromptBlockedReason = 'mention_surface' | 'ephemeral_trigger' | 'non_interactive' | 'closed' | 'laptop';
1986
- /**
1987
- * Which layer actually determined the enforced budget.
1988
- *
1989
- * Not derivable from the run row alone (the run does not store the config
1990
- * cents or the customer default), so we persist it for the UI / audit.
1991
- */
1992
- type BudgetSource = 'system' | 'account' | 'config' | 'run';
1993
- /**
1994
- * Lifecycle of a keyed (multi-turn) session — the durable conversation.
1995
- * Distinct from AgentSessionStatus, which is per-execution (one turn's run) and
1996
- * moves to agent_turns in a later slice. IDLE: alive, waiting for the next
1997
- * message. RUNNING: a turn is executing. CLOSED: the conversation is done and
1998
- * its sandbox/snapshots are torn down.
1999
- */
2000
- type SessionState = 'idle' | 'running' | 'closed';
2001
- type AgentSessionSource = 'react' | 'manual' | 'api' | 'cli' | 'mention' | 'cron' | 'laptop';
2002
- type AgentSessionStatus = 'scheduled' | 'creating_sandbox' | 'running' | 'retrying' | 'completed' | 'error' | 'cancelled' | 'stopped';
2003
- /**
2004
- * What the current (or most recent) execution is doing (backs `run`).
2005
- */
2006
- type RunStatus = 'scheduled' | 'starting' | 'working' | 'waiting' | 'done' | 'failed' | 'stopped' | 'cancelled' | 'retrying';
2007
- /**
2008
- * The durable conversation axis (backs the surfaced `session` field).
2009
- */
2010
- type SessionLiveness = 'alive' | 'sleeping' | 'closed';
2011
- type WebhookType = 'github.issue' | 'github.issue_comment' | 'github.push' | 'github.pull_request' | 'github.pull_request_comment' | 'github.pull_request_review' | 'github.pull_request_review_comment' | 'slack.app_mention' | 'slack.message' | 'slack.channel_created' | 'linear.issue' | 'linear.issue_comment' | 'sentry.event_alert' | 'sentry.metric_alert' | 'user.message';
2012
- /**
2013
- * First frame after accept. Lean: session + open inbox only — records
2014
- * always arrive via records_append (§3.4).
2015
- */
2016
- interface SnapshotFrame {
2017
- earliest_feed_seq: number | null;
2018
- messages: SessionMessageWire[];
2019
- protocol: number;
2020
- session: AgentSessionWire;
2021
- type: 'snapshot';
2022
- }
2023
- /**
2024
- * The wire shape of one inbox message (§3.3): what a queued chip renders
2025
- * and retires on. `author` is the message's attribution string; the webhook
2026
- * provenance internals stay off the wire.
2027
- */
2028
- interface SessionMessageWire {
2029
- agent_session_id: string;
2030
- author: string | null;
2031
- body: string;
2032
- created_at: string;
2033
- delivered_at: string | null;
2034
- delivered_turn_id: string | null;
2035
- feed_seq: number | null;
2036
- id: string;
2037
- sender_attribution_id: string | null;
2038
- sender_attribution_type: AttributionType | null;
2039
- status: SessionMessageStatus;
2040
- }
2041
- interface AgentSessionWire {
2042
- agent_config_id: string | null;
2043
- attributed_user: GithubAccountSnippet | null;
2044
- attribution_id: string | null;
2045
- attribution_type: AttributionType | null;
2046
- client_version: string | null;
2047
- config_override: {
2048
- [k: string]: unknown;
2049
- } | null;
2050
- context_repository: string | null;
2051
- cost_fee: number;
2052
- cost_sandbox_cpu: number;
2053
- cost_sandbox_memory: number;
2054
- cost_tokens: number;
2055
- created_at: string;
2056
- customer_id: string;
2057
- default_resolution: DefaultResolution | null;
2058
- exit_status: AgentSessionExitStatus | null;
2059
- harness: Harness;
2060
- id: string;
2061
- last_activity_at: string | null;
2062
- last_message_at: string | null;
2063
- live_summary: string | null;
2064
- metadata: {
2065
- [k: string]: string;
2066
- };
2067
- output_prs: AgentSessionPr[] | null;
2068
- parent_agent_session_id: string | null;
2069
- parent_kind: ParentKind | null;
2070
- prompt: string | null;
2071
- prompting: SessionPrompting;
2072
- replayed_from_session_id: string | null;
2073
- resolved_budget_cents: number;
2074
- resolved_budget_source: BudgetSource;
2075
- sandbox_id: string | null;
2076
- session_key: string | null;
2077
- session_state: SessionState | null;
2078
- source: AgentSessionSource;
2079
- status: AgentSessionStatus;
2080
- status_reason: string | null;
2081
- stopped_at: string | null;
2082
- stopped_by: number | null;
2083
- stopped_by_user: GithubAccountSnippet | null;
2084
- surface: SessionSurface | null;
2085
- tokens_cache_creation: number;
2086
- tokens_cache_read: number;
2087
- tokens_input: number;
2088
- tokens_model: string;
2089
- tokens_output: number;
2090
- tokens_total: number;
2091
- updated_at: string;
2092
- webhook_id: string | null;
2093
- webhook_type: WebhookType | null;
2094
- }
2095
- /**
2096
- * Sometimes the GitHub API returns a user of github (can include bots)
2097
- * using this snippet instead of the full GithubAccount model. One example,
2098
- * is when the API returns a pull request.
2099
- *
2100
- * This is the least amount of info we need to represent a GitHub account.
2101
- */
2102
- interface GithubAccountSnippet {
2103
- avatar_url: string;
2104
- id: number;
2105
- login: string;
2106
- type: GithubAccountType;
2107
- }
2108
- /**
2109
- * A pull request this session created, denormalized at capture time so
2110
- * session surfaces render a labeled link without joining gh_prs. Live PR
2111
- * state (open/merged/closed) is not stored here — read it from gh_prs where
2112
- * a view needs it.
2113
- */
2114
- interface AgentSessionPr {
2115
- gh_pr_id: number | null;
2116
- number: number;
2117
- repo_full_name: string;
2118
- url: string;
2119
- }
2120
- /**
2121
- * The prompt-affordance projection. `enabled` answers "would a send work",
2122
- * and when it wouldn't, `blocked_reason` + `detail` say why.
2123
- *
2124
- * `surface_name` is set only for MENTION_SURFACE, naming where to reply.
2125
- */
2126
- interface SessionPrompting {
2127
- blocked_reason: PromptBlockedReason | null;
2128
- detail: string | null;
2129
- enabled: boolean;
2130
- surface_name: string | null;
2131
- }
2132
- /**
2133
- * The three fields we expose. All `None` for an un-keyed (laptop) session.
2134
- *
2135
- * `use_enum_values=True` (from CustomBaseModel) stores the members as their
2136
- * string values, so this serializes to `{"session": "alive", "run": "waiting",
2137
- * "status": "waiting"}` — a plain object, not enum names.
2138
- */
2139
- interface SessionSurface {
2140
- run: RunStatus | null;
2141
- session: SessionLiveness | null;
2142
- status: string | null;
2143
- }
2144
- /**
2145
- * Cursored append-only: raw records ordered by feed_seq, all sources.
2146
- * Every record in the frame advances the resume cursor — including ones a
2147
- * client renders as nothing (§3.4).
2148
- */
2149
- interface RecordsAppendFrame {
2150
- records: SessionRecordWire[];
2151
- type: 'records_append';
2152
- }
2153
- /**
2154
- * The wire shape of one session record (§3.3): the §3.6 stable envelope +
2155
- * the native `payload`, by explicit allowlist. Internal-only columns
2156
- * (`search_text`, `clis`, ingest bookkeeping, attribution denormalizations)
2157
- * are deliberately absent so internal model evolution stays free.
2158
- */
2159
- interface SessionRecordWire {
2160
- agent_session_id: string;
2161
- agent_turn_id: string | null;
2162
- cost: number | null;
2163
- created_at: string;
2164
- duration: number | null;
2165
- feed_seq: number;
2166
- id: string;
2167
- model: string | null;
2168
- payload: {
2169
- [k: string]: unknown;
2170
- };
2171
- record_format: string;
2172
- record_type: string;
2173
- session_message_id: string | null;
2174
- /**
2175
- * Who wrote the record. Known values: claude_code (a native harness transcript record) | lifecycle (a platform notification). Open vocabulary: ignore records with unknown sources.
2176
- */
2177
- source: string;
2178
- stream_seq: number;
2179
- tokens_info: TokensInfo | null;
2180
- tools: string[] | null;
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
- */
2194
- interface TokensInfo {
2195
- cache_creation_input_tokens: number;
2196
- cache_read_input_tokens: number;
2197
- cost_usd: number;
2198
- input_tokens: number;
2199
- num_turns: number;
2200
- output_tokens: number;
2201
- }
2202
- /**
2203
- * LWW snapshot of the enriched public session (§4.1) — the only way
2204
- * status/state/cost arrive. Resent whole on any field change.
2205
- */
2206
- interface SessionFrame {
2207
- session: AgentSessionWire;
2208
- type: 'session';
2209
- }
2210
- /**
2211
- * Fire-and-forget partial assistant output for the current response.
2212
- * No seq, never resumable; superseded by the committed record.
2213
- */
2214
- interface DeltaFrame {
2215
- agent_turn_id: string | null;
2216
- /**
2217
- * What the partial text is. Known values: text ('thinking' reserved). Open vocabulary: ignore deltas with unknown kinds.
2218
- */
2219
- kind: string;
2220
- output_tokens: number | null;
2221
- text: string | null;
2222
- type: 'delta';
2223
- }
2224
- /**
2225
- * Sent after HEARTBEAT_SECONDS of idleness; doubles as the dead-socket
2226
- * probe.
2227
- */
2228
- interface HeartbeatFrame {
2229
- ts: string;
2230
- type: 'heartbeat';
2231
- }
2232
- /**
2233
- * Terminal marker: the conversation is over, after the final session frame
2234
- * carried the end state. Followed by close 1000.
2235
- */
2236
- interface DoneFrame {
2237
- type: 'done';
2238
- }
2239
- /**
2240
- * Terminal error marker, before close 1011. Curated copy only.
2241
- */
2242
- interface ErrorFrame {
2243
- message: string;
2244
- type: 'error';
2245
- }
2246
-
2247
- type StreamFrame = SessionStreamFrame | {
2248
- type: string;
2249
- [key: string]: unknown;
2250
- };
2251
- type SendSessionMessageRequest = components['schemas']['SendSessionMessageRequest'];
2252
- type ListSessionRecordsResponse = components['schemas']['ListSessionRecordsResponse'];
2253
- type ListSessionTurnsResponse = components['schemas']['ListSessionTurnsResponse'];
2254
- type AgentTurn = components['schemas']['AgentTurn'];
2255
- type AgentTurnStatus = components['schemas']['AgentTurnStatus'];
2256
- type ListSessionExecutionsResponse = components['schemas']['ListSessionExecutionsResponse'];
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'];
2266
-
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 };