@ellipsis-dev/sdk 0.16.0 → 0.18.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.
@@ -14,16 +14,11 @@ interface paths {
14
14
  put?: never;
15
15
  /**
16
16
  * Create Agent Config
17
- * @description Create an agent config.
17
+ * @description Create an agent config, managed through the API: no file, live
18
+ * immediately. To put its definition in a repository instead, create
19
+ * it here and then POST /v1/agents/configs/{config_id}/link.
18
20
  *
19
- * Name a repository and Ellipsis opens a pull request adding the
20
- * config file to agents/ there; the agent goes live when it
21
- * merges. Omit it and the agent is created here, with no file,
22
- * live immediately — and every file reference in it must name the
23
- * repository it lives in.
24
- *
25
- * Accepts an inline config or a gallery template slug. 409 when
26
- * another live agent already holds the name.
21
+ * 409 when another live agent already holds the name.
27
22
  */
28
23
  post: operations['create_agent_config'];
29
24
  delete?: never;
@@ -119,51 +114,6 @@ interface paths {
119
114
  patch?: never;
120
115
  trace?: never;
121
116
  };
122
- '/v1/agents/defaults': {
123
- parameters: {
124
- query?: never;
125
- header?: never;
126
- path?: never;
127
- cookie?: never;
128
- };
129
- /**
130
- * List Agent Defaults
131
- * @description Get the default agent configs.
132
- *
133
- * The account-wide default and the per-repository defaults, as config
134
- * ids. Repo rungs are keyed "owner/name"; a repository this
135
- * installation can no longer see is omitted.
136
- */
137
- get: operations['list_agent_defaults'];
138
- /**
139
- * Put Agent Default
140
- * @description Set a default agent config.
141
- *
142
- * Addressed by rung: the account rung (repository omitted) or a
143
- * repository rung ("owner/name"); the config by id or by the
144
- * agent's name. Returns the full resulting ladder.
145
- *
146
- * Refused for sandbox tokens (potentially prompt-injected code
147
- * must not repoint the account's ambient default); an unknown or
148
- * foreign repository is a 404.
149
- */
150
- put: operations['put_agent_default'];
151
- post?: never;
152
- /**
153
- * Delete Agent Default
154
- * @description Clear a default agent config.
155
- *
156
- * Addressed by rung: the account rung (repository omitted) or a
157
- * repository rung.
158
- *
159
- * Refused for sandbox tokens.
160
- */
161
- delete: operations['delete_agent_default'];
162
- options?: never;
163
- head?: never;
164
- patch?: never;
165
- trace?: never;
166
- };
167
117
  '/v1/agents/templates': {
168
118
  parameters: {
169
119
  query?: never;
@@ -418,6 +368,73 @@ interface paths {
418
368
  patch?: never;
419
369
  trace?: never;
420
370
  };
371
+ '/v1/environments': {
372
+ parameters: {
373
+ query?: never;
374
+ header?: never;
375
+ path?: never;
376
+ cookie?: never;
377
+ };
378
+ /**
379
+ * List Environments
380
+ * @description List saved environments.
381
+ */
382
+ get: operations['list_environments'];
383
+ put?: never;
384
+ /**
385
+ * Create Environment
386
+ * @description Create an environment, managed through the API: no file, live
387
+ * immediately. To define it in a repository instead, commit a
388
+ * `kind: environment` YAML under an agents directory.
389
+ *
390
+ * 409 when another live environment already holds the name.
391
+ */
392
+ post: operations['create_environment'];
393
+ delete?: never;
394
+ options?: never;
395
+ head?: never;
396
+ patch?: never;
397
+ trace?: never;
398
+ };
399
+ '/v1/environments/{environment_id}': {
400
+ parameters: {
401
+ query?: never;
402
+ header?: never;
403
+ path?: never;
404
+ cookie?: never;
405
+ };
406
+ /**
407
+ * Get Environment
408
+ * @description Return one saved environment, by id or by name.
409
+ */
410
+ get: operations['get_environment'];
411
+ /**
412
+ * Update Environment
413
+ * @description Replace an environment's definition, by id or by name.
414
+ *
415
+ * The whole definition is replaced, live at once — future sessions
416
+ * resolve the new body; running sessions keep the one frozen at
417
+ * their start. Only for environments managed through this API: one
418
+ * defined by a repository file is a 409.
419
+ */
420
+ put: operations['update_environment'];
421
+ post?: never;
422
+ /**
423
+ * Delete Environment
424
+ * @description Delete an environment, by id or by name.
425
+ *
426
+ * Always succeeds, even while agents still reference it — their next
427
+ * session start fails with a clear error naming the missing
428
+ * environment. Past sessions remain readable. Only for environments
429
+ * managed through this API — delete the file to remove one defined
430
+ * by a repository.
431
+ */
432
+ delete: operations['delete_environment'];
433
+ options?: never;
434
+ head?: never;
435
+ patch?: never;
436
+ trace?: never;
437
+ };
421
438
  '/v1/files': {
422
439
  parameters: {
423
440
  query?: never;
@@ -497,7 +514,7 @@ interface paths {
497
514
  cookie?: never;
498
515
  };
499
516
  /**
500
- * Get Integrations
517
+ * List Integrations
501
518
  * @description List connected integrations.
502
519
  *
503
520
  * A read-only view, so an agent authoring another agent's
@@ -652,7 +669,7 @@ interface paths {
652
669
  cookie?: never;
653
670
  };
654
671
  /**
655
- * Whoami
672
+ * Current Identity
656
673
  * @description Return the identity behind the caller's credential.
657
674
  */
658
675
  get: operations['whoami'];
@@ -851,7 +868,7 @@ interface paths {
851
868
  */
852
869
  get: operations['list_secrets'];
853
870
  /**
854
- * Put Secrets
871
+ * Set Secrets
855
872
  * @description Upsert secrets.
856
873
  *
857
874
  * Returns only the secrets this call wrote, names and timestamps
@@ -911,12 +928,14 @@ interface paths {
911
928
  * Start Agent Session
912
929
  * @description Start a cloud agent session.
913
930
  *
914
- * Provide at most one of config_id (an id or an agent name),
915
- * config, or
916
- * template_id; with none, the account's default-config ladder
917
- * resolves the config. 400 when idle_start is combined with
918
- * prompt or input. 422 when the agent declares an
919
- * input schema and the request's input is absent or invalid.
931
+ * The base is `from_config_id` (an id or an agent name) or, omitted,
932
+ * the bare ad-hoc config; every AgentConfig key on the request
933
+ * deep-merges on top, so the body is both the pointer and the
934
+ * per-session override. `prompt` is the first message; omit it and
935
+ * the session starts idle, waiting for one. 400 when
936
+ * ellipsis.interactive=false and there is no prompt or input. 422
937
+ * when the agent declares an input schema and the request's input
938
+ * is absent or invalid.
920
939
  */
921
940
  post: operations['start_agent_session'];
922
941
  delete?: never;
@@ -933,7 +952,7 @@ interface paths {
933
952
  cookie?: never;
934
953
  };
935
954
  /**
936
- * Search Sessions
955
+ * Search Agent Sessions
937
956
  * @description Search sessions over steps, recaps, and pull requests.
938
957
  *
939
958
  * Grouped by session, over everything a session left behind: step text, recap text, created
@@ -996,8 +1015,7 @@ interface paths {
996
1015
  * instructions + the config's own instructions).
997
1016
  *
998
1017
  * Per execution because each cold wake persists its own launch
999
- * config (a config edit or replay override between wakes changes
1000
- * it).
1018
+ * config (a config edit between wakes changes it).
1001
1019
  */
1002
1020
  get: operations['get_agent_session_executions'];
1003
1021
  put?: never;
@@ -1114,7 +1132,7 @@ interface paths {
1114
1132
  patch?: never;
1115
1133
  trace?: never;
1116
1134
  };
1117
- '/v1/sessions/{session_id}/replay': {
1135
+ '/v1/sessions/{session_id}/stop': {
1118
1136
  parameters: {
1119
1137
  query?: never;
1120
1138
  header?: never;
@@ -1124,22 +1142,20 @@ interface paths {
1124
1142
  get?: never;
1125
1143
  put?: never;
1126
1144
  /**
1127
- * Replay Agent Session
1128
- * @description Replay a session as a new session.
1145
+ * Stop Agent Session
1146
+ * @description Stop an in-flight session and return it.
1129
1147
  *
1130
- * Reuses the original config snapshot unless config_id is given,
1131
- * and accepts the same config_override as session start — e.g.
1132
- * {"claude": {"model": ...}} to replay the same input on a
1133
- * different model.
1148
+ * stopped_by is recorded only when the caller's credential maps
1149
+ * to a GitHub account.
1134
1150
  */
1135
- post: operations['replay_agent_session'];
1151
+ post: operations['stop_agent_session'];
1136
1152
  delete?: never;
1137
1153
  options?: never;
1138
1154
  head?: never;
1139
1155
  patch?: never;
1140
1156
  trace?: never;
1141
1157
  };
1142
- '/v1/sessions/{session_id}/stop': {
1158
+ '/v1/sessions/{session_id}/transcript': {
1143
1159
  parameters: {
1144
1160
  query?: never;
1145
1161
  header?: never;
@@ -1149,38 +1165,47 @@ interface paths {
1149
1165
  get?: never;
1150
1166
  put?: never;
1151
1167
  /**
1152
- * Stop Agent Session
1153
- * @description Stop an in-flight session and return it.
1168
+ * Ingest Agent Session Transcript
1169
+ * @description Append transcript lines to a session's record.
1154
1170
  *
1155
- * stopped_by is recorded only when the caller's credential maps
1156
- * to a GitHub account.
1171
+ * The in-sandbox tailer for interactive sessions.
1172
+ *
1173
+ * A sandbox token may only push its own session's transcript.
1174
+ * Idempotent by transcript line uuid; tolerant of malformed lines.
1157
1175
  */
1158
- post: operations['stop_agent_session'];
1176
+ post: operations['ingest_agent_session_transcript'];
1159
1177
  delete?: never;
1160
1178
  options?: never;
1161
1179
  head?: never;
1162
1180
  patch?: never;
1163
1181
  trace?: never;
1164
1182
  };
1165
- '/v1/sessions/{session_id}/transcript': {
1183
+ '/v1/settings/sessions/defaults': {
1166
1184
  parameters: {
1167
1185
  query?: never;
1168
1186
  header?: never;
1169
1187
  path?: never;
1170
1188
  cookie?: never;
1171
1189
  };
1172
- get?: never;
1173
- put?: never;
1174
1190
  /**
1175
- * Ingest Agent Session Transcript
1176
- * @description Append transcript lines to a session's record.
1191
+ * Get Session Defaults
1192
+ * @description Get the account-wide session defaults.
1177
1193
  *
1178
- * The in-sandbox tailer for interactive sessions.
1194
+ * Today one setting: the default model every session falls back to
1195
+ * when neither its request nor its agent config names one.
1196
+ */
1197
+ get: operations['get_session_defaults'];
1198
+ /**
1199
+ * Set Session Defaults
1200
+ * @description Set the account-wide session defaults.
1179
1201
  *
1180
- * A sandbox token may only push its own session's transcript.
1181
- * Idempotent by transcript line uuid; tolerant of malformed lines.
1202
+ * `model` accepts an alias or canonical id and is stored canonical;
1203
+ * null clears it (sessions then fall back to the platform default).
1204
+ * Refused for sandbox tokens (potentially prompt-injected code must
1205
+ * not repoint the account's default model).
1182
1206
  */
1183
- post: operations['ingest_agent_session_transcript'];
1207
+ put: operations['put_session_defaults'];
1208
+ post?: never;
1184
1209
  delete?: never;
1185
1210
  options?: never;
1186
1211
  head?: never;
@@ -1195,7 +1220,7 @@ interface paths {
1195
1220
  cookie?: never;
1196
1221
  };
1197
1222
  /**
1198
- * Get Usage Endpoint
1223
+ * Get Usage
1199
1224
  * @description Return the caller's usage dashboard data.
1200
1225
  */
1201
1226
  get: operations['get_usage_endpoint'];
@@ -1216,7 +1241,6 @@ interface components {
1216
1241
  budget: components['schemas']['AgentConfigBudget'];
1217
1242
  /**
1218
1243
  * @default {
1219
- * "model": "claude-opus-5",
1220
1244
  * "system": ""
1221
1245
  * }
1222
1246
  */
@@ -1225,7 +1249,6 @@ interface components {
1225
1249
  /**
1226
1250
  * @default {
1227
1251
  * "enabled": true,
1228
- * "interactive": true,
1229
1252
  * "metadata": {
1230
1253
  * "annotations": {},
1231
1254
  * "labels": []
@@ -1235,21 +1258,18 @@ interface components {
1235
1258
  */
1236
1259
  ellipsis: components['schemas']['AgentConfigEllipsis'];
1237
1260
  /**
1261
+ * Environment
1238
1262
  * @default {
1239
1263
  * "compute": {},
1240
1264
  * "hooks": {},
1241
1265
  * "image": {},
1266
+ * "mcp_servers": [],
1242
1267
  * "repositories": [],
1243
1268
  * "variables": []
1244
1269
  * }
1245
1270
  */
1246
- environment: components['schemas']['AgentConfigEnvironment'];
1271
+ environment: string | components['schemas']['AgentConfigEnvironment'];
1247
1272
  input?: components['schemas']['AgentConfigInput'] | null;
1248
- /**
1249
- * Mcp Servers
1250
- * @default []
1251
- */
1252
- mcp_servers: (string | components['schemas']['AgentConfigMcpServer'])[];
1253
1273
  output?: components['schemas']['AgentConfigOutput'] | null;
1254
1274
  /**
1255
1275
  * @default {
@@ -1284,11 +1304,8 @@ interface components {
1284
1304
  fallback_model?: string | null;
1285
1305
  /** Max Turns */
1286
1306
  max_turns?: number | null;
1287
- /**
1288
- * Model
1289
- * @default claude-opus-5
1290
- */
1291
- model: string;
1307
+ /** Model */
1308
+ model?: string | null;
1292
1309
  settings?: components['schemas']['AgentConfigSettingsRef'] | null;
1293
1310
  /**
1294
1311
  * System
@@ -1381,17 +1398,15 @@ interface components {
1381
1398
  * AgentConfigEllipsis
1382
1399
  * @description The Ellipsis product namespace for a config file: which schema this is
1383
1400
  * (`version`), the human-facing identity (`name`/`description`), freeform
1384
- * organizational `metadata`, whether the agent is `enabled`, and the
1385
- * human-access flag `interactive`. The presence of a top-level `ellipsis:`
1386
- * mapping is what marks a YAML file as an Ellipsis agent config (vs arbitrary
1387
- * YAML that merely lives under a config directory) — see
1388
- * `yaml_is_ellipsis_config`.
1401
+ * organizational `metadata`, and whether the agent is `enabled`. The
1402
+ * presence of a top-level `ellipsis:` mapping is what marks a YAML file as
1403
+ * an Ellipsis agent config (vs arbitrary YAML that merely lives under a
1404
+ * config directory) — see `yaml_is_ellipsis_config`.
1389
1405
  *
1390
- * `enabled`/`interactive` are agent behavior, not freeform metadata, so they
1391
- * stay inside the config `sha` (only `metadata` is sha-excluded).
1392
- * `interactive` lets a human `agent session connect` to a live session (CLI
1393
- * relay). It does not decide whether a session is ephemeral or durable — that
1394
- * is the trigger's job.
1406
+ * `enabled` is agent behavior, not freeform metadata, so it stays inside
1407
+ * the config `sha` (only `metadata` is sha-excluded). Whether a session
1408
+ * accepts messages is a per-run choice (POST /v1/sessions `interactive`),
1409
+ * not a config one.
1395
1410
  */
1396
1411
  AgentConfigEllipsis: {
1397
1412
  /** Description */
@@ -1401,11 +1416,6 @@ interface components {
1401
1416
  * @default true
1402
1417
  */
1403
1418
  enabled: boolean;
1404
- /**
1405
- * Interactive
1406
- * @default true
1407
- */
1408
- interactive: boolean;
1409
1419
  /**
1410
1420
  * @default {
1411
1421
  * "annotations": {},
@@ -1453,6 +1463,11 @@ interface components {
1453
1463
  hooks: components['schemas']['AgentConfigEnvironmentHooks'];
1454
1464
  /** @default {} */
1455
1465
  image: components['schemas']['AgentConfigEnvironmentImage'];
1466
+ /**
1467
+ * Mcp Servers
1468
+ * @default []
1469
+ */
1470
+ mcp_servers: (string | components['schemas']['AgentConfigMcpServer'] | components['schemas']['AgentConfigMcpStdioServer'] | components['schemas']['AgentConfigMcpRemoteServer'])[];
1456
1471
  /**
1457
1472
  * Repositories
1458
1473
  * @default []
@@ -1578,19 +1593,69 @@ interface components {
1578
1593
  /** Message */
1579
1594
  message?: string | null;
1580
1595
  };
1596
+ /**
1597
+ * AgentConfigMcpRemoteServer
1598
+ * @description A bring-your-own remote MCP server: the harness talks HTTP to `url`.
1599
+ * Nothing runs in the sandbox image. `headers` carry static auth (e.g.
1600
+ * `Authorization: Bearer ${TOKEN}`); values may embed `${NAME}` secret
1601
+ * references, resolved at run time from the account's secrets store.
1602
+ */
1603
+ AgentConfigMcpRemoteServer: {
1604
+ /**
1605
+ * Headers
1606
+ * @default {}
1607
+ */
1608
+ headers: {
1609
+ [key: string]: string;
1610
+ };
1611
+ /** Name */
1612
+ name: string;
1613
+ /** Url */
1614
+ url: string;
1615
+ };
1581
1616
  /**
1582
1617
  * AgentConfigMcpServer
1583
1618
  * @description One built-in MCP server this agent opts into by name (`linear`/`slack`).
1584
- * This is a name reference over the connected built-in set, NOT a custom-server
1585
- * definition there is no command/url/headers shape (that was the old,
1586
- * removed field, and Ellipsis does not support bring-your-own MCP servers).
1587
- * It only matters when the named integration is set to `opt_in` inclusion; an
1588
- * integration in the default `all_sessions` mode is added regardless.
1619
+ * A name reference over the connected built-in set the platform manages the
1620
+ * server's transport and credentials. It only matters when the named
1621
+ * integration is set to `opt_in` inclusion; an integration in the default
1622
+ * `all_sessions` mode is added regardless. For a server the platform does not
1623
+ * provide, define it instead (`AgentConfigMcpStdioServer` /
1624
+ * `AgentConfigMcpRemoteServer`).
1589
1625
  */
1590
1626
  AgentConfigMcpServer: {
1591
1627
  /** Name */
1592
1628
  name: string;
1593
1629
  };
1630
+ /**
1631
+ * AgentConfigMcpStdioServer
1632
+ * @description A bring-your-own stdio MCP server: the harness spawns `command` inside
1633
+ * the sandbox and speaks JSON-RPC over its stdin/stdout. The command must be
1634
+ * runnable in the sandbox image — install its runtime via `image.setup` /
1635
+ * `image.dockerfile_append` if the base image lacks it.
1636
+ *
1637
+ * `env` values may embed `${NAME}` references, resolved at run time from the
1638
+ * account's secrets store (see `mcp_secret_refs`); everything else is passed
1639
+ * literally.
1640
+ */
1641
+ AgentConfigMcpStdioServer: {
1642
+ /**
1643
+ * Args
1644
+ * @default []
1645
+ */
1646
+ args: string[];
1647
+ /** Command */
1648
+ command: string;
1649
+ /**
1650
+ * Env
1651
+ * @default {}
1652
+ */
1653
+ env: {
1654
+ [key: string]: string;
1655
+ };
1656
+ /** Name */
1657
+ name: string;
1658
+ };
1594
1659
  /**
1595
1660
  * AgentConfigMemorySize
1596
1661
  * @description A memory size as explicit units, summed (binary: 1GB = 1024MB = 1024MiB).
@@ -1606,9 +1671,14 @@ interface components {
1606
1671
  /**
1607
1672
  * AgentConfigMentionPlatform
1608
1673
  * @description The surface an @ellipsis mention can come from.
1674
+ *
1675
+ * No SLACK member: Slack routing is not a trigger on an agent config, it is the
1676
+ * `slack.yaml` routing file (`SlackConfig`), which answers the questions a
1677
+ * platform list cannot — which channel, and whose DM. A mention trigger listing
1678
+ * `slack` is therefore a config error, not a silently-never-fires config.
1609
1679
  * @enum {string}
1610
1680
  */
1611
- AgentConfigMentionPlatform: 'github' | 'slack' | 'linear';
1681
+ AgentConfigMentionPlatform: 'github' | 'linear';
1612
1682
  /** AgentConfigMentionTrigger */
1613
1683
  AgentConfigMentionTrigger: {
1614
1684
  /**
@@ -1779,31 +1849,6 @@ interface components {
1779
1849
  */
1780
1850
  configs: components['schemas']['Config'][];
1781
1851
  };
1782
- /**
1783
- * AgentDefaults
1784
- * @description Which agent config serves sessions started without an explicit config:
1785
- * one account-wide rung, plus a rung per repository.
1786
- *
1787
- * Values are config ids — stable across renames, unlike the agent's name.
1788
- * A repo rung whose repository this installation can no longer see is absent
1789
- * from `repositories`; its row is left in place, so re-installing the repo
1790
- * brings the rung back.
1791
- */
1792
- AgentDefaults: {
1793
- /**
1794
- * Account
1795
- * @description Config id serving sessions with no repository context, or null when no account default is set.
1796
- */
1797
- account?: string | null;
1798
- /**
1799
- * Repositories
1800
- * @description Config id per repository, keyed "owner/name". A repository with no default set is absent.
1801
- * @default {}
1802
- */
1803
- repositories: {
1804
- [key: string]: string;
1805
- };
1806
- };
1807
1852
  /**
1808
1853
  * AgentTemplate
1809
1854
  * @description A built-in agent template: a ready-to-use agent config plus the
@@ -2874,46 +2919,19 @@ interface components {
2874
2919
  };
2875
2920
  /**
2876
2921
  * CreateAgentConfigRequest
2877
- * @description Parameters for creating an agent config. Exactly one of config or
2878
- * template_id must be set.
2922
+ * @description Parameters for creating an agent config.
2879
2923
  */
2880
2924
  CreateAgentConfigRequest: {
2881
- /** @description An inline agent config. */
2882
- config?: components['schemas']['AgentConfig'] | null;
2883
- /**
2884
- * Path
2885
- * @description File path within the repo, when a repository is named. Omit for the default agents/<slug>.yaml; if set it must be a location the config sync scans (a .yaml/.yml file under agents/, .agents/, ellipsis/, or .ellipsis/ at any depth).
2886
- */
2887
- path?: string | null;
2888
- /**
2889
- * Repository
2890
- * @description Define the agent as a file in this repository: Ellipsis opens a pull request adding it, and the agent goes live when that merges. Repository name within the caller's account; the owner is always the account, so pass a bare name (e.g. "my-service"), not "owner/my-service". Omit to create the agent through the API alone, with no file and live immediately.
2891
- */
2892
- repository?: string | null;
2893
- /**
2894
- * Template Id
2895
- * @description A gallery template slug (see GET /v1/agents/templates).
2896
- */
2897
- template_id?: string | null;
2925
+ /** @description The agent's definition. */
2926
+ config: components['schemas']['AgentConfig'];
2898
2927
  };
2899
2928
  /**
2900
- * CreateAgentConfigResponse
2901
- * @description The created agent config, plus the pull request that adds its file when
2902
- * one was opened.
2929
+ * CreateEnvironmentRequest
2930
+ * @description Parameters for creating an environment.
2903
2931
  */
2904
- CreateAgentConfigResponse: {
2905
- /** @description The created agent config. */
2906
- config: components['schemas']['Config'];
2907
- /**
2908
- * Path
2909
- * @description The file path the config was written to, or null when the agent has no file.
2910
- */
2911
- path?: string | null;
2912
- /**
2913
- * Pull Request Url
2914
- * @description The pull request that adds the config file. The agent becomes live once it merges and syncs. Null when no repository was named: the agent is already live.
2915
- */
2916
- pull_request_url?: string | null;
2932
+ CreateEnvironmentRequest: {
2933
+ /** @description The environment's definition. */
2934
+ environment: components['schemas']['EnvironmentConfig'];
2917
2935
  };
2918
2936
  /**
2919
2937
  * CreateFileRequest
@@ -3079,99 +3097,240 @@ interface components {
3079
3097
  /** Match */
3080
3098
  match?: string[] | null;
3081
3099
  };
3082
- /** ErrorInfo */
3083
- ErrorInfo: {
3084
- /**
3085
- * Code
3086
- * @description Stable machine-readable error code. Open vocabulary — handle unknown codes by HTTP status. Known values: account_blocked, conflict, contact_email_required, failed_dependency, file_quota_exceeded, forbidden, internal_error, invalid_request, not_found, rate_limit_exceeded, rate_limited, review_in_flight, session_closed, session_ephemeral_trigger, session_finished, session_harness_single_turn, session_mention_surface, session_non_interactive, unauthorized, unavailable.
3087
- */
3088
- code: string;
3089
- /**
3090
- * Message
3091
- * @description Human-readable explanation. Wording may change at any time; switch on `code`, never on this text.
3092
- */
3093
- message: string;
3094
- /**
3095
- * Request Id
3096
- * @description Present on internal server errors: quote it when contacting support to identify the exact failure.
3097
- */
3098
- request_id?: string | null;
3099
- };
3100
- /**
3101
- * ErrorResponse
3102
- * @description The error envelope every /v1 error returns.
3103
- */
3104
- ErrorResponse: {
3105
- error: components['schemas']['ErrorInfo'];
3106
- };
3107
- /**
3108
- * ExecutionStatus
3109
- * @description Per-execution status ladder (was AgentProcessStatus). Distinct from the
3110
- * session's durable `session_state` and from `agent_sessions.status`, which
3111
- * remains the atomic claim/dispatch guard.
3112
- * @enum {string}
3113
- */
3114
- ExecutionStatus: 'running' | 'failed' | 'done';
3115
3100
  /**
3116
- * File
3117
- * @description A file's metadata the file itself is fetched via a separate
3118
- * download URL.
3101
+ * Environment
3102
+ * @description A saved environment: the machine agents run in (repositories,
3103
+ * variables, MCP servers, image, compute, hooks), defined once and
3104
+ * referenced by name or id from agent configs and session starts.
3119
3105
  */
3120
- File: {
3121
- /**
3122
- * Content Type
3123
- * @description The file's MIME type.
3124
- */
3125
- content_type: string;
3106
+ Environment: {
3126
3107
  /**
3127
3108
  * Created At
3128
3109
  * Format: date-time
3129
- * @description When the file was uploaded.
3110
+ * @description When the environment was created.
3130
3111
  */
3131
3112
  created_at: string;
3132
- /**
3133
- * Filename
3134
- * @description The original file basename, for display.
3135
- */
3136
- filename: string;
3113
+ /** @description The GitHub account that last edited the environment, when known. */
3114
+ edited_by?: components['schemas']['GithubAccountSnippet'] | null;
3115
+ /** @description The environment definition itself, as parsed from its YAML. */
3116
+ environment: components['schemas']['EnvironmentConfig'];
3137
3117
  /**
3138
3118
  * Id
3139
- * @description The file's unique identifier.
3119
+ * @description Unique identifier of the environment.
3140
3120
  */
3141
3121
  id: string;
3142
3122
  /**
3143
- * Session Id
3144
- * @description The agent session that produced this file, when it was uploaded from a sandbox. Null for uploads made outside an agent session.
3123
+ * Last Sync Error
3124
+ * @description The parse or validation error from the most recent sync attempt, or null when it succeeded. A non-null value means sessions run the last good definition, not the YAML currently on the branch.
3145
3125
  */
3146
- session_id?: string | null;
3126
+ last_sync_error?: string | null;
3147
3127
  /**
3148
- * Size Bytes
3149
- * @description The size of the stored file in bytes.
3128
+ * Last Synced Commit Sha
3129
+ * @description The last commit the environment was synced from.
3150
3130
  */
3151
- size_bytes: number;
3152
- };
3153
- /**
3154
- * FilesListResponse
3155
- * @description A page of the calling account's files, newest first. Metadata only —
3156
- * fetch an individual file to get a download URL.
3157
- */
3158
- FilesListResponse: {
3131
+ last_synced_commit_sha?: string | null;
3132
+ /** @description "github" environments are defined by a file in a repository and are changed by editing that file; "api" environments have no file and are changed through this API. */
3133
+ managed_by: components['schemas']['ConfigManagedBy'];
3159
3134
  /**
3160
- * Files
3161
- * @description The account's files, newest first.
3135
+ * Name
3136
+ * @description The environment's customer-unique addressable name; usable anywhere an environment is referenced, interchangeably with the id.
3162
3137
  */
3163
- files: components['schemas']['File'][];
3138
+ name: string;
3164
3139
  /**
3165
- * Has More
3166
- * @description Whether more results exist past this page.
3167
- * @default false
3140
+ * Sha
3141
+ * @description The environment's content identity fingerprint.
3168
3142
  */
3169
- has_more: boolean;
3143
+ sha: string;
3144
+ /** @description The repository, path, and branch the environment syncs from. Null for environments managed through the API. */
3145
+ source_details?: components['schemas']['AgentConfigSourceGithub'] | null;
3170
3146
  /**
3171
- * Next Cursor
3172
- * @description Pass as `cursor` to fetch the next page. Null on the last page. Opaque — echo it back rather than parsing it.
3147
+ * Updated At
3148
+ * Format: date-time
3149
+ * @description When the environment was last updated.
3173
3150
  */
3174
- next_cursor?: string | null;
3151
+ updated_at: string;
3152
+ };
3153
+ /**
3154
+ * EnvironmentConfig
3155
+ * @description A parsed environment document: identity plus the environment body.
3156
+ *
3157
+ * The body fields are flattened to the top level of the file (not nested
3158
+ * under an `environment:` key) — the file *is* the environment, so nesting
3159
+ * would be ceremony. `to_environment()` projects the body for substitution
3160
+ * into an agent config.
3161
+ */
3162
+ EnvironmentConfig: {
3163
+ /** @default {} */
3164
+ compute: components['schemas']['AgentConfigCompute'];
3165
+ ellipsis: components['schemas']['EnvironmentConfigEllipsis'];
3166
+ /** @default {} */
3167
+ hooks: components['schemas']['AgentConfigEnvironmentHooks'];
3168
+ /** @default {} */
3169
+ image: components['schemas']['AgentConfigEnvironmentImage'];
3170
+ /**
3171
+ * Mcp Servers
3172
+ * @default []
3173
+ */
3174
+ mcp_servers: (string | components['schemas']['AgentConfigMcpServer'] | components['schemas']['AgentConfigMcpStdioServer'] | components['schemas']['AgentConfigMcpRemoteServer'])[];
3175
+ /**
3176
+ * Repositories
3177
+ * @default []
3178
+ */
3179
+ repositories: components['schemas']['AgentConfigRepository'][];
3180
+ /**
3181
+ * Variables
3182
+ * @default []
3183
+ */
3184
+ variables: components['schemas']['AgentConfigEnvironmentVariable'][];
3185
+ };
3186
+ /**
3187
+ * EnvironmentConfigEllipsis
3188
+ * @description The Ellipsis namespace of an environment file. `kind: environment` is
3189
+ * what routes a synced YAML here instead of to the agent-config parser —
3190
+ * an agent config carries no `kind` (or `kind: agent`, tolerated nowhere:
3191
+ * absence is the agent marker).
3192
+ */
3193
+ EnvironmentConfigEllipsis: {
3194
+ /** Description */
3195
+ description?: string | null;
3196
+ /**
3197
+ * Kind
3198
+ * @constant
3199
+ */
3200
+ kind: 'environment';
3201
+ /**
3202
+ * @default {
3203
+ * "annotations": {},
3204
+ * "labels": []
3205
+ * }
3206
+ */
3207
+ metadata: components['schemas']['AgentConfigMetadata'];
3208
+ /** Name */
3209
+ name?: string | null;
3210
+ };
3211
+ /**
3212
+ * EnvironmentResponse
3213
+ * @description One saved environment.
3214
+ */
3215
+ EnvironmentResponse: {
3216
+ /** @description The saved environment. */
3217
+ environment: components['schemas']['Environment'];
3218
+ };
3219
+ /**
3220
+ * EnvironmentSource
3221
+ * @description How a session's environment was chosen. None (the field is nullable)
3222
+ * when the config carried an inline environment block and no resolution ran —
3223
+ * an inline environment is not a reference, so there is nothing to record.
3224
+ *
3225
+ * Not derivable from the row: `environment_id` says WHICH environment, not
3226
+ * how it was chosen, and is null for the built-in basic sandbox.
3227
+ * @enum {string}
3228
+ */
3229
+ EnvironmentSource: 'request' | 'agent_config' | 'repo_default' | 'account_default' | 'platform_default';
3230
+ /**
3231
+ * EnvironmentsListResponse
3232
+ * @description The caller's saved environments.
3233
+ */
3234
+ EnvironmentsListResponse: {
3235
+ /**
3236
+ * Environments
3237
+ * @description Saved environments.
3238
+ */
3239
+ environments: components['schemas']['Environment'][];
3240
+ };
3241
+ /** ErrorInfo */
3242
+ ErrorInfo: {
3243
+ /**
3244
+ * Code
3245
+ * @description Stable machine-readable error code. Open vocabulary — handle unknown codes by HTTP status. Known values: account_blocked, conflict, contact_email_required, failed_dependency, file_quota_exceeded, forbidden, internal_error, invalid_request, not_found, rate_limit_exceeded, rate_limited, review_in_flight, session_closed, session_ephemeral_trigger, session_finished, session_harness_single_turn, session_mention_surface, session_non_interactive, unauthorized, unavailable.
3246
+ */
3247
+ code: string;
3248
+ /**
3249
+ * Message
3250
+ * @description Human-readable explanation. Wording may change at any time; switch on `code`, never on this text.
3251
+ */
3252
+ message: string;
3253
+ /**
3254
+ * Request Id
3255
+ * @description Present on internal server errors: quote it when contacting support to identify the exact failure.
3256
+ */
3257
+ request_id?: string | null;
3258
+ };
3259
+ /**
3260
+ * ErrorResponse
3261
+ * @description The error envelope every /v1 error returns.
3262
+ */
3263
+ ErrorResponse: {
3264
+ error: components['schemas']['ErrorInfo'];
3265
+ };
3266
+ /**
3267
+ * ExecutionStatus
3268
+ * @description Per-execution status ladder (was AgentProcessStatus). Distinct from the
3269
+ * session's durable `session_state` and from `agent_sessions.status`, which
3270
+ * remains the atomic claim/dispatch guard.
3271
+ * @enum {string}
3272
+ */
3273
+ ExecutionStatus: 'running' | 'failed' | 'done';
3274
+ /**
3275
+ * File
3276
+ * @description A file's metadata — the file itself is fetched via a separate
3277
+ * download URL.
3278
+ */
3279
+ File: {
3280
+ /**
3281
+ * Content Type
3282
+ * @description The file's MIME type.
3283
+ */
3284
+ content_type: string;
3285
+ /**
3286
+ * Created At
3287
+ * Format: date-time
3288
+ * @description When the file was uploaded.
3289
+ */
3290
+ created_at: string;
3291
+ /**
3292
+ * Filename
3293
+ * @description The original file basename, for display.
3294
+ */
3295
+ filename: string;
3296
+ /**
3297
+ * Id
3298
+ * @description The file's unique identifier.
3299
+ */
3300
+ id: string;
3301
+ /**
3302
+ * Session Id
3303
+ * @description The agent session that produced this file, when it was uploaded from a sandbox. Null for uploads made outside an agent session.
3304
+ */
3305
+ session_id?: string | null;
3306
+ /**
3307
+ * Size Bytes
3308
+ * @description The size of the stored file in bytes.
3309
+ */
3310
+ size_bytes: number;
3311
+ };
3312
+ /**
3313
+ * FilesListResponse
3314
+ * @description A page of the calling account's files, newest first. Metadata only —
3315
+ * fetch an individual file to get a download URL.
3316
+ */
3317
+ FilesListResponse: {
3318
+ /**
3319
+ * Files
3320
+ * @description The account's files, newest first.
3321
+ */
3322
+ files: components['schemas']['File'][];
3323
+ /**
3324
+ * Has More
3325
+ * @description Whether more results exist past this page.
3326
+ * @default false
3327
+ */
3328
+ has_more: boolean;
3329
+ /**
3330
+ * Next Cursor
3331
+ * @description Pass as `cursor` to fetch the next page. Null on the last page. Opaque — echo it back rather than parsing it.
3332
+ */
3333
+ next_cursor?: string | null;
3175
3334
  };
3176
3335
  /**
3177
3336
  * FindingAnchor
@@ -4400,23 +4559,6 @@ interface components {
4400
4559
  */
4401
4560
  prs: number;
4402
4561
  };
4403
- /**
4404
- * PutAgentDefaultRequest
4405
- * @description Parameters for setting a default agent config, at either the account
4406
- * or the repository level.
4407
- */
4408
- PutAgentDefaultRequest: {
4409
- /**
4410
- * Config Id
4411
- * @description The config to make the default: a config id, or the agent's customer-unique `ellipsis.name`.
4412
- */
4413
- config_id: string;
4414
- /**
4415
- * Repository
4416
- * @description The rung to set: "owner/name" for a repo default; omit to set the account default. Unlike session start's silent ignore, an unknown or foreign repo here is a 404.
4417
- */
4418
- repository?: string | null;
4419
- };
4420
4562
  /**
4421
4563
  * PutSecretsRequest
4422
4564
  * @description Store secrets for the account's sandboxes. Each secret is upserted by
@@ -4665,35 +4807,6 @@ interface components {
4665
4807
  * @enum {string}
4666
4808
  */
4667
4809
  RecordSource: 'lifecycle' | 'claude_code' | 'codex';
4668
- /**
4669
- * ReplayAgentSessionRequest
4670
- * @description Parameters for re-running an existing run's original trigger input as
4671
- * a new run.
4672
- */
4673
- ReplayAgentSessionRequest: {
4674
- /**
4675
- * Config Id
4676
- * @description A saved config to replay against. By default the original run's frozen config snapshot is reused.
4677
- */
4678
- config_id?: string | null;
4679
- /**
4680
- * Config Override
4681
- * @description Optional partial-config override merged onto the chosen config and re-validated — e.g. {"claude": {"model": "claude-opus-4-8"}} to replay the run on a different model, or {"budget": {"session": 5.0}} to raise its budget. Mutually exclusive with config_override_yaml.
4682
- */
4683
- config_override?: {
4684
- [key: string]: unknown;
4685
- } | null;
4686
- /**
4687
- * Config Override Yaml
4688
- * @description The same partial-config override as a YAML/JSON string (e.g. read from a file). Mutually exclusive with config_override.
4689
- */
4690
- config_override_yaml?: string | null;
4691
- /**
4692
- * Prompt
4693
- * @description Per-run instructions. Omit to inherit the original run's prompt (a bare replay re-runs the same instructions); pass "" to clear it.
4694
- */
4695
- prompt?: string | null;
4696
- };
4697
4810
  /**
4698
4811
  * RepoFacet
4699
4812
  * @description A repository filter option, counted over the unfiltered window so
@@ -4749,7 +4862,7 @@ interface components {
4749
4862
  * routes; nothing maps to it yet.
4750
4863
  * @enum {string}
4751
4864
  */
4752
- Resource: 'account' | 'alerts' | 'sessions' | 'files' | 'memories' | 'reviews' | 'configs' | 'defaults' | 'secrets' | 'templates' | 'integrations' | 'tokens';
4865
+ Resource: 'account' | 'alerts' | 'sessions' | 'files' | 'memories' | 'reviews' | 'configs' | 'defaults' | 'environments' | 'secrets' | 'templates' | 'integrations' | 'tokens';
4753
4866
  /**
4754
4867
  * Review
4755
4868
  * @description One code review: one pipeline iteration over one commit range of a pull
@@ -5972,6 +6085,8 @@ interface components {
5972
6085
  * @description When the session was created.
5973
6086
  */
5974
6087
  created_at: string;
6088
+ /** @description The environment the session resolved: the saved environment's id and how it was chosen. The environment's frozen body is inside agent.config.environment. */
6089
+ environment?: components['schemas']['SessionEnvironment'];
5975
6090
  /** @description How the session ended; null until it is terminal. */
5976
6091
  exit_status?: components['schemas']['SessionExitStatus'] | null;
5977
6092
  /** @description What the session did to git, one entry per repository in its workspace: the commit and branch it sits on, per-file line counts for its uncommitted changes, and the pull requests it opened. Null if nothing was ever captured. */
@@ -6139,6 +6254,33 @@ interface components {
6139
6254
  */
6140
6255
  total: number;
6141
6256
  };
6257
+ /**
6258
+ * SessionDefaults
6259
+ * @description The account-wide session defaults.
6260
+ */
6261
+ SessionDefaults: {
6262
+ /**
6263
+ * Model
6264
+ * @description Canonical model id every session falls back to when neither the request nor its agent config names one, or null when unset (sessions then run the platform default).
6265
+ */
6266
+ model?: string | null;
6267
+ };
6268
+ /**
6269
+ * SessionEnvironment
6270
+ * @description The environment this session resolved: which saved environment (as it
6271
+ * exists now) and how it was chosen. The environment's frozen BODY rides
6272
+ * inside `agent.config.environment` — substitution happens before the config
6273
+ * snapshot freezes — so this object is provenance, not payload.
6274
+ */
6275
+ SessionEnvironment: {
6276
+ /**
6277
+ * Environment Id
6278
+ * @description Identifier of the saved environment the session's config resolved. Null for an inline environment block or the built-in basic sandbox.
6279
+ */
6280
+ environment_id?: string | null;
6281
+ /** @description How the environment was chosen (request, agent_config, repo_default, account_default, platform_default). Null when the config carried its own inline environment. */
6282
+ source?: components['schemas']['EnvironmentSource'] | null;
6283
+ };
6142
6284
  /**
6143
6285
  * SessionExecution
6144
6286
  * @description One runtime attempt of a session — the initial start, a cold wake of a
@@ -6809,40 +6951,28 @@ interface components {
6809
6951
  };
6810
6952
  /**
6811
6953
  * StartAgentSessionRequest
6812
- * @description Parameters for starting a new agent session.
6954
+ * @description Parameters for starting a new agent session: an optional base config
6955
+ * pointer, the message fields, and any AgentConfig keys to patch on top.
6813
6956
  */
6814
6957
  StartAgentSessionRequest: {
6815
- /** @description An inline agent config to run under. */
6816
- config?: components['schemas']['AgentConfig'] | null;
6817
- /**
6818
- * Config Id
6819
- * @description A saved agent config to run under: its id, or the agent's customer-unique `ellipsis.name`.
6820
- */
6821
- config_id?: string | null;
6822
- /**
6823
- * Config Override
6824
- * @description Optional partial-config override merged onto the chosen config and re-validated (e.g. {"budget": {"session": 5.0}} to raise just this session's budget). Merged onto config_id/template_id or the platform default; with an inline config, set fields directly instead. Mutually exclusive with config_override_yaml.
6825
- */
6826
- config_override?: {
6827
- [key: string]: unknown;
6828
- } | null;
6829
- /**
6830
- * Config Override Yaml
6831
- * @description The same partial-config override as a YAML/JSON string (e.g. read from a file). Mutually exclusive with config_override.
6832
- */
6833
- config_override_yaml?: string | null;
6958
+ /** @description The session's spend limits, e.g. {"session": 5.0}. */
6959
+ budget?: components['schemas']['AgentConfigBudget'] | null;
6960
+ /** @description The Claude-harness block: `{"model": ...}` to pick this session's model, plus system/effort/fallback_model/max_turns/settings. */
6961
+ claude?: components['schemas']['AgentConfigClaude'] | null;
6962
+ /** @description The Codex-harness block. Its presence on the EFFECTIVE config selects the Codex harness, exactly as in a saved config. */
6963
+ codex?: components['schemas']['AgentConfigCodex'] | null;
6964
+ /** @description Platform housekeeping: metadata, interactive, force_rebuild. */
6965
+ ellipsis?: components['schemas']['StartSessionEllipsis'];
6834
6966
  /**
6835
- * Force Rebuild
6836
- * @description Skip the image cache for this session's initial provision: a fresh full build whose snapshot then refreshes the cache for later runs. A wake of a durable session provisions through the cache as usual. The CLI's `--rebuild`.
6837
- * @default false
6967
+ * Environment
6968
+ * @description Where the session runs. A STRING (a saved environment's `env_...` id or name) re-picks that environment wholesale it beats the base config's own reference. An OBJECT deep-merges onto the resolved environment (repositories merge by identity, see above).
6838
6969
  */
6839
- force_rebuild: boolean;
6970
+ environment?: string | components['schemas']['AgentConfigEnvironment'] | null;
6840
6971
  /**
6841
- * Idle Start
6842
- * @description Start the session with no initial message: the sandbox spins up, the agent starts idle at the prompt, and the first message sent to the session opens turn 0. Mutually exclusive with prompt. Ignored when the resolved config is not interactive (an ephemeral run keeps its kickoff it can never receive a message).
6843
- * @default false
6972
+ * From Config Id
6973
+ * @description The saved agent config to use as this session's base: its id, or the agent's customer-unique `ellipsis.name`. Omitted, the base is the bare ad-hoc config an empty system prompt on the account's default model in the basic sandbox so the request's own keys and prompt fully describe the run.
6844
6974
  */
6845
- idle_start: boolean;
6975
+ from_config_id?: string | null;
6846
6976
  /**
6847
6977
  * Input
6848
6978
  * @description The typed payload for an agent that declares input.json_schema: validated against the effective config's schema (422 on mismatch), rendered into the session's initial message (the agent's input.message template, or a JSON block). Required when the agent declares a schema; rejected when it does not.
@@ -6850,29 +6980,20 @@ interface components {
6850
6980
  input?: {
6851
6981
  [key: string]: unknown;
6852
6982
  } | null;
6853
- /**
6854
- * Metadata
6855
- * @description Arbitrary string key/value metadata stored on the session.
6856
- * @default {}
6857
- */
6858
- metadata: {
6859
- [key: string]: string;
6860
- };
6983
+ /** @description The structured-output exit contract for this session. */
6984
+ output?: components['schemas']['AgentConfigOutput'] | null;
6985
+ /** @description What the session may touch, per minted credential. */
6986
+ permissions?: components['schemas']['AgentConfigPermissions'] | null;
6861
6987
  /**
6862
6988
  * Prompt
6863
- * @description Per-run instructions appended to the initial query after the config's shared system prompt. Applies regardless of which config source is used.
6989
+ * @description The session's first message. Omit it and the session starts idle: the sandbox spins up, the agent waits at the prompt, and the first message you send opens turn 0.
6864
6990
  */
6865
6991
  prompt?: string | null;
6866
6992
  /**
6867
- * Repository
6868
- * @description The "owner/name" repository the client is standing in (the CLI's detected git remote). Selects the repo rung of the defaults ladder, and is merged into the sandbox repository set (cloned at its default branch) regardless of which config source is used. An unknown or foreign repo is ignored.
6869
- */
6870
- repository?: string | null;
6871
- /**
6872
- * Template Id
6873
- * @description A maintained run-on-demand template slug (e.g. "ellipsis-helper"), resolved server-side to its config. At most one of config_id, config, or template_id may be set; if none is, the run resolves the account's default-config ladder (repo default, then account default, then the platform default config).
6993
+ * Skills
6994
+ * @description Config-declared skills; replaces the base config's list.
6874
6995
  */
6875
- template_id?: string | null;
6996
+ skills?: components['schemas']['AgentConfigSkill'][] | null;
6876
6997
  };
6877
6998
  /**
6878
6999
  * StartCliAuthResponse
@@ -6911,6 +7032,35 @@ interface components {
6911
7032
  */
6912
7033
  verification_uri_complete: string;
6913
7034
  };
7035
+ /**
7036
+ * StartSessionEllipsis
7037
+ * @description Platform housekeeping for the session — the request-side `ellipsis`
7038
+ * block. Session-scoped: unlike a config file's `ellipsis` block it carries
7039
+ * no `name`/`enabled` (those describe a saved agent, not a run) — and
7040
+ * sending them here is a 422, not a silent drop.
7041
+ */
7042
+ StartSessionEllipsis: {
7043
+ /**
7044
+ * Force Rebuild
7045
+ * @description Skip the image cache for this session's initial provision: a fresh full build whose snapshot then refreshes the cache for later runs. A wake of a durable session provisions through the cache as usual. The CLI's `--rebuild`.
7046
+ * @default false
7047
+ */
7048
+ force_rebuild: boolean;
7049
+ /**
7050
+ * Interactive
7051
+ * @description Whether the session stays open for messages after its first turn. Set false for a one-shot run that does its job and closes without holding a warm sandbox; a one-shot run must carry a prompt (or input), since nothing can ever be sent to it later. Agents on the Codex harness are one-shot regardless.
7052
+ * @default true
7053
+ */
7054
+ interactive: boolean;
7055
+ /**
7056
+ * Metadata
7057
+ * @description Arbitrary string key/value metadata stored on the session.
7058
+ * @default {}
7059
+ */
7060
+ metadata: {
7061
+ [key: string]: string;
7062
+ };
7063
+ };
6914
7064
  /**
6915
7065
  * TokensInfo
6916
7066
  * @description Token/cost usage, per record (one API call's counts, aggregate fields at
@@ -6975,6 +7125,14 @@ interface components {
6975
7125
  /** @description The agent's new definition. Replaces the previous one wholesale — this is not a partial update. */
6976
7126
  config: components['schemas']['AgentConfig'];
6977
7127
  };
7128
+ /**
7129
+ * UpdateEnvironmentRequest
7130
+ * @description A replacement definition for an environment managed through the API.
7131
+ */
7132
+ UpdateEnvironmentRequest: {
7133
+ /** @description The environment's new definition. Replaces the previous one wholesale — this is not a partial update. */
7134
+ environment: components['schemas']['EnvironmentConfig'];
7135
+ };
6978
7136
  /**
6979
7137
  * UsageDailyPoint
6980
7138
  * @description One day's usage: tokens split by type, and cost split into the four
@@ -7162,15 +7320,15 @@ interface operations {
7162
7320
  };
7163
7321
  responses: {
7164
7322
  /** @description Successful Response */
7165
- 200: {
7323
+ 201: {
7166
7324
  headers: {
7167
7325
  [name: string]: unknown;
7168
7326
  };
7169
7327
  content: {
7170
- 'application/json': components['schemas']['CreateAgentConfigResponse'];
7328
+ 'application/json': components['schemas']['AgentConfigResponse'];
7171
7329
  };
7172
7330
  };
7173
- /** @description Provide exactly one of config or template_id; or the config, path, or target branch is invalid. */
7331
+ /** @description The config is invalid. */
7174
7332
  400: {
7175
7333
  headers: {
7176
7334
  [name: string]: unknown;
@@ -7197,16 +7355,7 @@ interface operations {
7197
7355
  'application/json': components['schemas']['ErrorResponse'];
7198
7356
  };
7199
7357
  };
7200
- /** @description The template or repository was not found in your account. */
7201
- 404: {
7202
- headers: {
7203
- [name: string]: unknown;
7204
- };
7205
- content: {
7206
- 'application/json': components['schemas']['ErrorResponse'];
7207
- };
7208
- };
7209
- /** @description An agent with that name already exists, another agent is already synced from that path, or a file already exists there. */
7358
+ /** @description An agent with that name already exists. */
7210
7359
  409: {
7211
7360
  headers: {
7212
7361
  [name: string]: unknown;
@@ -7586,7 +7735,7 @@ interface operations {
7586
7735
  };
7587
7736
  };
7588
7737
  };
7589
- list_agent_defaults: {
7738
+ list_agent_templates: {
7590
7739
  parameters: {
7591
7740
  query?: never;
7592
7741
  header?: {
@@ -7603,7 +7752,7 @@ interface operations {
7603
7752
  [name: string]: unknown;
7604
7753
  };
7605
7754
  content: {
7606
- 'application/json': components['schemas']['AgentDefaults'];
7755
+ 'application/json': components['schemas']['AgentTemplatesListResponse'];
7607
7756
  };
7608
7757
  };
7609
7758
  /** @description The bearer token is missing, invalid, or revoked. */
@@ -7635,20 +7784,18 @@ interface operations {
7635
7784
  };
7636
7785
  };
7637
7786
  };
7638
- put_agent_default: {
7787
+ get_agent_template: {
7639
7788
  parameters: {
7640
7789
  query?: never;
7641
7790
  header?: {
7642
7791
  'user-agent'?: string | null;
7643
7792
  };
7644
- path?: never;
7645
- cookie?: never;
7646
- };
7647
- requestBody: {
7648
- content: {
7649
- 'application/json': components['schemas']['PutAgentDefaultRequest'];
7793
+ path: {
7794
+ template_id: string;
7650
7795
  };
7796
+ cookie?: never;
7651
7797
  };
7798
+ requestBody?: never;
7652
7799
  responses: {
7653
7800
  /** @description Successful Response */
7654
7801
  200: {
@@ -7656,16 +7803,7 @@ interface operations {
7656
7803
  [name: string]: unknown;
7657
7804
  };
7658
7805
  content: {
7659
- 'application/json': components['schemas']['AgentDefaults'];
7660
- };
7661
- };
7662
- /** @description The config is not eligible as a default: its pull request has not merged, or it is disabled. */
7663
- 400: {
7664
- headers: {
7665
- [name: string]: unknown;
7666
- };
7667
- content: {
7668
- 'application/json': components['schemas']['ErrorResponse'];
7806
+ 'application/json': components['schemas']['AgentTemplate'];
7669
7807
  };
7670
7808
  };
7671
7809
  /** @description The bearer token is missing, invalid, or revoked. */
@@ -7686,7 +7824,7 @@ interface operations {
7686
7824
  'application/json': components['schemas']['ErrorResponse'];
7687
7825
  };
7688
7826
  };
7689
- /** @description The config or repository was not found in your account. */
7827
+ /** @description No such template. */
7690
7828
  404: {
7691
7829
  headers: {
7692
7830
  [name: string]: unknown;
@@ -7706,11 +7844,13 @@ interface operations {
7706
7844
  };
7707
7845
  };
7708
7846
  };
7709
- delete_agent_default: {
7847
+ list_alerts: {
7710
7848
  parameters: {
7711
7849
  query?: {
7712
- /** @description Repo rung to clear ("owner/name"); omit to clear the account default. */
7713
- repository?: string | null;
7850
+ status?: components['schemas']['AlertStatus'] | null;
7851
+ source?: components['schemas']['AlertSource'] | null;
7852
+ limit?: number;
7853
+ cursor?: string | null;
7714
7854
  };
7715
7855
  header?: {
7716
7856
  'user-agent'?: string | null;
@@ -7721,11 +7861,13 @@ interface operations {
7721
7861
  requestBody?: never;
7722
7862
  responses: {
7723
7863
  /** @description Successful Response */
7724
- 204: {
7864
+ 200: {
7725
7865
  headers: {
7726
7866
  [name: string]: unknown;
7727
7867
  };
7728
- content?: never;
7868
+ content: {
7869
+ 'application/json': components['schemas']['AlertsListResponse'];
7870
+ };
7729
7871
  };
7730
7872
  /** @description The bearer token is missing, invalid, or revoked. */
7731
7873
  401: {
@@ -7745,15 +7887,6 @@ interface operations {
7745
7887
  'application/json': components['schemas']['ErrorResponse'];
7746
7888
  };
7747
7889
  };
7748
- /** @description No default is set at that rung, or the repository was not found in your account. */
7749
- 404: {
7750
- headers: {
7751
- [name: string]: unknown;
7752
- };
7753
- content: {
7754
- 'application/json': components['schemas']['ErrorResponse'];
7755
- };
7756
- };
7757
7890
  /** @description Validation Error */
7758
7891
  422: {
7759
7892
  headers: {
@@ -7765,13 +7898,15 @@ interface operations {
7765
7898
  };
7766
7899
  };
7767
7900
  };
7768
- list_agent_templates: {
7901
+ get_alert: {
7769
7902
  parameters: {
7770
7903
  query?: never;
7771
7904
  header?: {
7772
7905
  'user-agent'?: string | null;
7773
7906
  };
7774
- path?: never;
7907
+ path: {
7908
+ alert_id: string;
7909
+ };
7775
7910
  cookie?: never;
7776
7911
  };
7777
7912
  requestBody?: never;
@@ -7782,7 +7917,7 @@ interface operations {
7782
7917
  [name: string]: unknown;
7783
7918
  };
7784
7919
  content: {
7785
- 'application/json': components['schemas']['AgentTemplatesListResponse'];
7920
+ 'application/json': components['schemas']['AlertResponse'];
7786
7921
  };
7787
7922
  };
7788
7923
  /** @description The bearer token is missing, invalid, or revoked. */
@@ -7803,6 +7938,15 @@ interface operations {
7803
7938
  'application/json': components['schemas']['ErrorResponse'];
7804
7939
  };
7805
7940
  };
7941
+ /** @description No such alert in your account. */
7942
+ 404: {
7943
+ headers: {
7944
+ [name: string]: unknown;
7945
+ };
7946
+ content: {
7947
+ 'application/json': components['schemas']['ErrorResponse'];
7948
+ };
7949
+ };
7806
7950
  /** @description Validation Error */
7807
7951
  422: {
7808
7952
  headers: {
@@ -7814,14 +7958,14 @@ interface operations {
7814
7958
  };
7815
7959
  };
7816
7960
  };
7817
- get_agent_template: {
7961
+ dismiss_alert: {
7818
7962
  parameters: {
7819
7963
  query?: never;
7820
7964
  header?: {
7821
7965
  'user-agent'?: string | null;
7822
7966
  };
7823
7967
  path: {
7824
- template_id: string;
7968
+ alert_id: string;
7825
7969
  };
7826
7970
  cookie?: never;
7827
7971
  };
@@ -7833,7 +7977,7 @@ interface operations {
7833
7977
  [name: string]: unknown;
7834
7978
  };
7835
7979
  content: {
7836
- 'application/json': components['schemas']['AgentTemplate'];
7980
+ 'application/json': components['schemas']['AlertResponse'];
7837
7981
  };
7838
7982
  };
7839
7983
  /** @description The bearer token is missing, invalid, or revoked. */
@@ -7854,7 +7998,7 @@ interface operations {
7854
7998
  'application/json': components['schemas']['ErrorResponse'];
7855
7999
  };
7856
8000
  };
7857
- /** @description No such template. */
8001
+ /** @description No such alert in your account. */
7858
8002
  404: {
7859
8003
  headers: {
7860
8004
  [name: string]: unknown;
@@ -7863,6 +8007,15 @@ interface operations {
7863
8007
  'application/json': components['schemas']['ErrorResponse'];
7864
8008
  };
7865
8009
  };
8010
+ /** @description The alert is not open. */
8011
+ 409: {
8012
+ headers: {
8013
+ [name: string]: unknown;
8014
+ };
8015
+ content: {
8016
+ 'application/json': components['schemas']['ErrorResponse'];
8017
+ };
8018
+ };
7866
8019
  /** @description Validation Error */
7867
8020
  422: {
7868
8021
  headers: {
@@ -7874,13 +8027,19 @@ interface operations {
7874
8027
  };
7875
8028
  };
7876
8029
  };
7877
- list_alerts: {
8030
+ get_analytics_metrics: {
7878
8031
  parameters: {
7879
8032
  query?: {
7880
- status?: components['schemas']['AlertStatus'] | null;
7881
- source?: components['schemas']['AlertSource'] | null;
7882
- limit?: number;
7883
- cursor?: string | null;
8033
+ days?: number | null;
8034
+ start?: string | null;
8035
+ end?: string | null;
8036
+ /** @description Filter to repositories by "owner/name". */
8037
+ repo?: string[] | null;
8038
+ /** @description Filter by PR-author login(s). */
8039
+ author?: string[] | null;
8040
+ account_type?: string;
8041
+ /** @description Filter by parent-PR status (open|draft|merged|closed). */
8042
+ status?: string[] | null;
7884
8043
  };
7885
8044
  header?: {
7886
8045
  'user-agent'?: string | null;
@@ -7896,7 +8055,16 @@ interface operations {
7896
8055
  [name: string]: unknown;
7897
8056
  };
7898
8057
  content: {
7899
- 'application/json': components['schemas']['AlertsListResponse'];
8058
+ 'application/json': components['schemas']['GetAnalyticsMetricsResponse'];
8059
+ };
8060
+ };
8061
+ /** @description The time window is invalid: days combined with start, a non-positive days, or end not after start. */
8062
+ 400: {
8063
+ headers: {
8064
+ [name: string]: unknown;
8065
+ };
8066
+ content: {
8067
+ 'application/json': components['schemas']['ErrorResponse'];
7900
8068
  };
7901
8069
  };
7902
8070
  /** @description The bearer token is missing, invalid, or revoked. */
@@ -7928,15 +8096,21 @@ interface operations {
7928
8096
  };
7929
8097
  };
7930
8098
  };
7931
- get_alert: {
8099
+ get_analytics_pull_requests: {
7932
8100
  parameters: {
7933
- query?: never;
8101
+ query?: {
8102
+ days?: number | null;
8103
+ start?: string | null;
8104
+ end?: string | null;
8105
+ account_type?: string[] | null;
8106
+ repository_id?: number[] | null;
8107
+ author_id?: number[] | null;
8108
+ status?: string[] | null;
8109
+ };
7934
8110
  header?: {
7935
8111
  'user-agent'?: string | null;
7936
8112
  };
7937
- path: {
7938
- alert_id: string;
7939
- };
8113
+ path?: never;
7940
8114
  cookie?: never;
7941
8115
  };
7942
8116
  requestBody?: never;
@@ -7947,11 +8121,11 @@ interface operations {
7947
8121
  [name: string]: unknown;
7948
8122
  };
7949
8123
  content: {
7950
- 'application/json': components['schemas']['AlertResponse'];
8124
+ 'application/json': components['schemas']['GetAnalyticsPullRequestsResponse'];
7951
8125
  };
7952
8126
  };
7953
- /** @description The bearer token is missing, invalid, or revoked. */
7954
- 401: {
8127
+ /** @description The time window is invalid: days combined with start, a non-positive days, or end not after start. */
8128
+ 400: {
7955
8129
  headers: {
7956
8130
  [name: string]: unknown;
7957
8131
  };
@@ -7959,8 +8133,8 @@ interface operations {
7959
8133
  'application/json': components['schemas']['ErrorResponse'];
7960
8134
  };
7961
8135
  };
7962
- /** @description The credential may not perform this action, or the account is blocked. */
7963
- 403: {
8136
+ /** @description The bearer token is missing, invalid, or revoked. */
8137
+ 401: {
7964
8138
  headers: {
7965
8139
  [name: string]: unknown;
7966
8140
  };
@@ -7968,8 +8142,8 @@ interface operations {
7968
8142
  'application/json': components['schemas']['ErrorResponse'];
7969
8143
  };
7970
8144
  };
7971
- /** @description No such alert in your account. */
7972
- 404: {
8145
+ /** @description The credential may not perform this action, or the account is blocked. */
8146
+ 403: {
7973
8147
  headers: {
7974
8148
  [name: string]: unknown;
7975
8149
  };
@@ -7988,15 +8162,22 @@ interface operations {
7988
8162
  };
7989
8163
  };
7990
8164
  };
7991
- dismiss_alert: {
8165
+ get_analytics_reviews: {
7992
8166
  parameters: {
7993
- query?: never;
8167
+ query?: {
8168
+ days?: number | null;
8169
+ start?: string | null;
8170
+ end?: string | null;
8171
+ repo?: string[] | null;
8172
+ /** @description Filter by reviewer login(s). */
8173
+ author?: string[] | null;
8174
+ account_type?: string;
8175
+ review_state?: string[] | null;
8176
+ };
7994
8177
  header?: {
7995
8178
  'user-agent'?: string | null;
7996
8179
  };
7997
- path: {
7998
- alert_id: string;
7999
- };
8180
+ path?: never;
8000
8181
  cookie?: never;
8001
8182
  };
8002
8183
  requestBody?: never;
@@ -8007,7 +8188,16 @@ interface operations {
8007
8188
  [name: string]: unknown;
8008
8189
  };
8009
8190
  content: {
8010
- 'application/json': components['schemas']['AlertResponse'];
8191
+ 'application/json': components['schemas']['GetAnalyticsReviewsResponse'];
8192
+ };
8193
+ };
8194
+ /** @description The time window is invalid: days combined with start, a non-positive days, or end not after start. */
8195
+ 400: {
8196
+ headers: {
8197
+ [name: string]: unknown;
8198
+ };
8199
+ content: {
8200
+ 'application/json': components['schemas']['ErrorResponse'];
8011
8201
  };
8012
8202
  };
8013
8203
  /** @description The bearer token is missing, invalid, or revoked. */
@@ -8028,8 +8218,41 @@ interface operations {
8028
8218
  'application/json': components['schemas']['ErrorResponse'];
8029
8219
  };
8030
8220
  };
8031
- /** @description No such alert in your account. */
8032
- 404: {
8221
+ /** @description Validation Error */
8222
+ 422: {
8223
+ headers: {
8224
+ [name: string]: unknown;
8225
+ };
8226
+ content: {
8227
+ 'application/json': components['schemas']['HTTPValidationError'];
8228
+ };
8229
+ };
8230
+ };
8231
+ };
8232
+ cli_auth_poll: {
8233
+ parameters: {
8234
+ query?: never;
8235
+ header?: never;
8236
+ path?: never;
8237
+ cookie?: never;
8238
+ };
8239
+ requestBody: {
8240
+ content: {
8241
+ 'application/json': components['schemas']['CliAuthPollRequest'];
8242
+ };
8243
+ };
8244
+ responses: {
8245
+ /** @description Successful Response */
8246
+ 200: {
8247
+ headers: {
8248
+ [name: string]: unknown;
8249
+ };
8250
+ content: {
8251
+ 'application/json': components['schemas']['PollCliAuthResponse'];
8252
+ };
8253
+ };
8254
+ /** @description The bearer token is missing, invalid, or revoked. */
8255
+ 401: {
8033
8256
  headers: {
8034
8257
  [name: string]: unknown;
8035
8258
  };
@@ -8037,8 +8260,17 @@ interface operations {
8037
8260
  'application/json': components['schemas']['ErrorResponse'];
8038
8261
  };
8039
8262
  };
8040
- /** @description The alert is not open. */
8041
- 409: {
8263
+ /** @description The credential may not perform this action, or the account is blocked. */
8264
+ 403: {
8265
+ headers: {
8266
+ [name: string]: unknown;
8267
+ };
8268
+ content: {
8269
+ 'application/json': components['schemas']['ErrorResponse'];
8270
+ };
8271
+ };
8272
+ /** @description Unknown device code. */
8273
+ 404: {
8042
8274
  headers: {
8043
8275
  [name: string]: unknown;
8044
8276
  };
@@ -8057,20 +8289,47 @@ interface operations {
8057
8289
  };
8058
8290
  };
8059
8291
  };
8060
- get_analytics_metrics: {
8292
+ cli_auth_start: {
8061
8293
  parameters: {
8062
- query?: {
8063
- days?: number | null;
8064
- start?: string | null;
8065
- end?: string | null;
8066
- /** @description Filter to repositories by "owner/name". */
8067
- repo?: string[] | null;
8068
- /** @description Filter by PR-author login(s). */
8069
- author?: string[] | null;
8070
- account_type?: string;
8071
- /** @description Filter by parent-PR status (open|draft|merged|closed). */
8072
- status?: string[] | null;
8294
+ query?: never;
8295
+ header?: never;
8296
+ path?: never;
8297
+ cookie?: never;
8298
+ };
8299
+ requestBody?: never;
8300
+ responses: {
8301
+ /** @description Successful Response */
8302
+ 201: {
8303
+ headers: {
8304
+ [name: string]: unknown;
8305
+ };
8306
+ content: {
8307
+ 'application/json': components['schemas']['StartCliAuthResponse'];
8308
+ };
8073
8309
  };
8310
+ /** @description The bearer token is missing, invalid, or revoked. */
8311
+ 401: {
8312
+ headers: {
8313
+ [name: string]: unknown;
8314
+ };
8315
+ content: {
8316
+ 'application/json': components['schemas']['ErrorResponse'];
8317
+ };
8318
+ };
8319
+ /** @description The credential may not perform this action, or the account is blocked. */
8320
+ 403: {
8321
+ headers: {
8322
+ [name: string]: unknown;
8323
+ };
8324
+ content: {
8325
+ 'application/json': components['schemas']['ErrorResponse'];
8326
+ };
8327
+ };
8328
+ };
8329
+ };
8330
+ get_budget: {
8331
+ parameters: {
8332
+ query?: never;
8074
8333
  header?: {
8075
8334
  'user-agent'?: string | null;
8076
8335
  };
@@ -8085,11 +8344,20 @@ interface operations {
8085
8344
  [name: string]: unknown;
8086
8345
  };
8087
8346
  content: {
8088
- 'application/json': components['schemas']['GetAnalyticsMetricsResponse'];
8347
+ 'application/json': components['schemas']['BudgetSummary'];
8089
8348
  };
8090
8349
  };
8091
- /** @description The time window is invalid: days combined with start, a non-positive days, or end not after start. */
8092
- 400: {
8350
+ /** @description The bearer token is missing, invalid, or revoked. */
8351
+ 401: {
8352
+ headers: {
8353
+ [name: string]: unknown;
8354
+ };
8355
+ content: {
8356
+ 'application/json': components['schemas']['ErrorResponse'];
8357
+ };
8358
+ };
8359
+ /** @description The credential may not perform this action, or the account is blocked. */
8360
+ 403: {
8093
8361
  headers: {
8094
8362
  [name: string]: unknown;
8095
8363
  };
@@ -8097,6 +8365,37 @@ interface operations {
8097
8365
  'application/json': components['schemas']['ErrorResponse'];
8098
8366
  };
8099
8367
  };
8368
+ /** @description Validation Error */
8369
+ 422: {
8370
+ headers: {
8371
+ [name: string]: unknown;
8372
+ };
8373
+ content: {
8374
+ 'application/json': components['schemas']['HTTPValidationError'];
8375
+ };
8376
+ };
8377
+ };
8378
+ };
8379
+ list_environments: {
8380
+ parameters: {
8381
+ query?: never;
8382
+ header?: {
8383
+ 'user-agent'?: string | null;
8384
+ };
8385
+ path?: never;
8386
+ cookie?: never;
8387
+ };
8388
+ requestBody?: never;
8389
+ responses: {
8390
+ /** @description Successful Response */
8391
+ 200: {
8392
+ headers: {
8393
+ [name: string]: unknown;
8394
+ };
8395
+ content: {
8396
+ 'application/json': components['schemas']['EnvironmentsListResponse'];
8397
+ };
8398
+ };
8100
8399
  /** @description The bearer token is missing, invalid, or revoked. */
8101
8400
  401: {
8102
8401
  headers: {
@@ -8126,35 +8425,31 @@ interface operations {
8126
8425
  };
8127
8426
  };
8128
8427
  };
8129
- get_analytics_pull_requests: {
8428
+ create_environment: {
8130
8429
  parameters: {
8131
- query?: {
8132
- days?: number | null;
8133
- start?: string | null;
8134
- end?: string | null;
8135
- account_type?: string[] | null;
8136
- repository_id?: number[] | null;
8137
- author_id?: number[] | null;
8138
- status?: string[] | null;
8139
- };
8430
+ query?: never;
8140
8431
  header?: {
8141
8432
  'user-agent'?: string | null;
8142
8433
  };
8143
8434
  path?: never;
8144
8435
  cookie?: never;
8145
8436
  };
8146
- requestBody?: never;
8437
+ requestBody: {
8438
+ content: {
8439
+ 'application/json': components['schemas']['CreateEnvironmentRequest'];
8440
+ };
8441
+ };
8147
8442
  responses: {
8148
8443
  /** @description Successful Response */
8149
- 200: {
8444
+ 201: {
8150
8445
  headers: {
8151
8446
  [name: string]: unknown;
8152
8447
  };
8153
8448
  content: {
8154
- 'application/json': components['schemas']['GetAnalyticsPullRequestsResponse'];
8449
+ 'application/json': components['schemas']['EnvironmentResponse'];
8155
8450
  };
8156
8451
  };
8157
- /** @description The time window is invalid: days combined with start, a non-positive days, or end not after start. */
8452
+ /** @description The environment is invalid. */
8158
8453
  400: {
8159
8454
  headers: {
8160
8455
  [name: string]: unknown;
@@ -8181,33 +8476,35 @@ interface operations {
8181
8476
  'application/json': components['schemas']['ErrorResponse'];
8182
8477
  };
8183
8478
  };
8184
- /** @description Validation Error */
8479
+ /** @description An environment with that name already exists. */
8480
+ 409: {
8481
+ headers: {
8482
+ [name: string]: unknown;
8483
+ };
8484
+ content: {
8485
+ 'application/json': components['schemas']['ErrorResponse'];
8486
+ };
8487
+ };
8488
+ /** @description The environment's name is missing or malformed. */
8185
8489
  422: {
8186
8490
  headers: {
8187
8491
  [name: string]: unknown;
8188
8492
  };
8189
8493
  content: {
8190
- 'application/json': components['schemas']['HTTPValidationError'];
8494
+ 'application/json': components['schemas']['ErrorResponse'];
8191
8495
  };
8192
8496
  };
8193
8497
  };
8194
8498
  };
8195
- get_analytics_reviews: {
8499
+ get_environment: {
8196
8500
  parameters: {
8197
- query?: {
8198
- days?: number | null;
8199
- start?: string | null;
8200
- end?: string | null;
8201
- repo?: string[] | null;
8202
- /** @description Filter by reviewer login(s). */
8203
- author?: string[] | null;
8204
- account_type?: string;
8205
- review_state?: string[] | null;
8206
- };
8501
+ query?: never;
8207
8502
  header?: {
8208
8503
  'user-agent'?: string | null;
8209
8504
  };
8210
- path?: never;
8505
+ path: {
8506
+ environment_id: string;
8507
+ };
8211
8508
  cookie?: never;
8212
8509
  };
8213
8510
  requestBody?: never;
@@ -8218,11 +8515,11 @@ interface operations {
8218
8515
  [name: string]: unknown;
8219
8516
  };
8220
8517
  content: {
8221
- 'application/json': components['schemas']['GetAnalyticsReviewsResponse'];
8518
+ 'application/json': components['schemas']['EnvironmentResponse'];
8222
8519
  };
8223
8520
  };
8224
- /** @description The time window is invalid: days combined with start, a non-positive days, or end not after start. */
8225
- 400: {
8521
+ /** @description The bearer token is missing, invalid, or revoked. */
8522
+ 401: {
8226
8523
  headers: {
8227
8524
  [name: string]: unknown;
8228
8525
  };
@@ -8230,8 +8527,8 @@ interface operations {
8230
8527
  'application/json': components['schemas']['ErrorResponse'];
8231
8528
  };
8232
8529
  };
8233
- /** @description The bearer token is missing, invalid, or revoked. */
8234
- 401: {
8530
+ /** @description The credential may not perform this action, or the account is blocked. */
8531
+ 403: {
8235
8532
  headers: {
8236
8533
  [name: string]: unknown;
8237
8534
  };
@@ -8239,8 +8536,8 @@ interface operations {
8239
8536
  'application/json': components['schemas']['ErrorResponse'];
8240
8537
  };
8241
8538
  };
8242
- /** @description The credential may not perform this action, or the account is blocked. */
8243
- 403: {
8539
+ /** @description No such environment in your account. */
8540
+ 404: {
8244
8541
  headers: {
8245
8542
  [name: string]: unknown;
8246
8543
  };
@@ -8259,16 +8556,20 @@ interface operations {
8259
8556
  };
8260
8557
  };
8261
8558
  };
8262
- cli_auth_poll: {
8559
+ update_environment: {
8263
8560
  parameters: {
8264
8561
  query?: never;
8265
- header?: never;
8266
- path?: never;
8562
+ header?: {
8563
+ 'user-agent'?: string | null;
8564
+ };
8565
+ path: {
8566
+ environment_id: string;
8567
+ };
8267
8568
  cookie?: never;
8268
8569
  };
8269
8570
  requestBody: {
8270
8571
  content: {
8271
- 'application/json': components['schemas']['CliAuthPollRequest'];
8572
+ 'application/json': components['schemas']['UpdateEnvironmentRequest'];
8272
8573
  };
8273
8574
  };
8274
8575
  responses: {
@@ -8278,7 +8579,16 @@ interface operations {
8278
8579
  [name: string]: unknown;
8279
8580
  };
8280
8581
  content: {
8281
- 'application/json': components['schemas']['PollCliAuthResponse'];
8582
+ 'application/json': components['schemas']['EnvironmentResponse'];
8583
+ };
8584
+ };
8585
+ /** @description The environment is invalid. */
8586
+ 400: {
8587
+ headers: {
8588
+ [name: string]: unknown;
8589
+ };
8590
+ content: {
8591
+ 'application/json': components['schemas']['ErrorResponse'];
8282
8592
  };
8283
8593
  };
8284
8594
  /** @description The bearer token is missing, invalid, or revoked. */
@@ -8299,7 +8609,7 @@ interface operations {
8299
8609
  'application/json': components['schemas']['ErrorResponse'];
8300
8610
  };
8301
8611
  };
8302
- /** @description Unknown device code. */
8612
+ /** @description No such environment in your account. */
8303
8613
  404: {
8304
8614
  headers: {
8305
8615
  [name: string]: unknown;
@@ -8308,34 +8618,45 @@ interface operations {
8308
8618
  'application/json': components['schemas']['ErrorResponse'];
8309
8619
  };
8310
8620
  };
8311
- /** @description Validation Error */
8621
+ /** @description The environment is defined by a file in a repository, or another live environment already holds the new name. */
8622
+ 409: {
8623
+ headers: {
8624
+ [name: string]: unknown;
8625
+ };
8626
+ content: {
8627
+ 'application/json': components['schemas']['ErrorResponse'];
8628
+ };
8629
+ };
8630
+ /** @description The environment's name is missing or malformed. */
8312
8631
  422: {
8313
8632
  headers: {
8314
8633
  [name: string]: unknown;
8315
8634
  };
8316
8635
  content: {
8317
- 'application/json': components['schemas']['HTTPValidationError'];
8636
+ 'application/json': components['schemas']['ErrorResponse'];
8318
8637
  };
8319
8638
  };
8320
8639
  };
8321
8640
  };
8322
- cli_auth_start: {
8641
+ delete_environment: {
8323
8642
  parameters: {
8324
8643
  query?: never;
8325
- header?: never;
8326
- path?: never;
8644
+ header?: {
8645
+ 'user-agent'?: string | null;
8646
+ };
8647
+ path: {
8648
+ environment_id: string;
8649
+ };
8327
8650
  cookie?: never;
8328
8651
  };
8329
8652
  requestBody?: never;
8330
8653
  responses: {
8331
8654
  /** @description Successful Response */
8332
- 201: {
8655
+ 204: {
8333
8656
  headers: {
8334
8657
  [name: string]: unknown;
8335
8658
  };
8336
- content: {
8337
- 'application/json': components['schemas']['StartCliAuthResponse'];
8338
- };
8659
+ content?: never;
8339
8660
  };
8340
8661
  /** @description The bearer token is missing, invalid, or revoked. */
8341
8662
  401: {
@@ -8355,30 +8676,8 @@ interface operations {
8355
8676
  'application/json': components['schemas']['ErrorResponse'];
8356
8677
  };
8357
8678
  };
8358
- };
8359
- };
8360
- get_budget: {
8361
- parameters: {
8362
- query?: never;
8363
- header?: {
8364
- 'user-agent'?: string | null;
8365
- };
8366
- path?: never;
8367
- cookie?: never;
8368
- };
8369
- requestBody?: never;
8370
- responses: {
8371
- /** @description Successful Response */
8372
- 200: {
8373
- headers: {
8374
- [name: string]: unknown;
8375
- };
8376
- content: {
8377
- 'application/json': components['schemas']['BudgetSummary'];
8378
- };
8379
- };
8380
- /** @description The bearer token is missing, invalid, or revoked. */
8381
- 401: {
8679
+ /** @description No such environment in your account. */
8680
+ 404: {
8382
8681
  headers: {
8383
8682
  [name: string]: unknown;
8384
8683
  };
@@ -8386,8 +8685,8 @@ interface operations {
8386
8685
  'application/json': components['schemas']['ErrorResponse'];
8387
8686
  };
8388
8687
  };
8389
- /** @description The credential may not perform this action, or the account is blocked. */
8390
- 403: {
8688
+ /** @description The environment is defined by a file in a repository; delete that file instead. */
8689
+ 409: {
8391
8690
  headers: {
8392
8691
  [name: string]: unknown;
8393
8692
  };
@@ -9895,7 +10194,7 @@ interface operations {
9895
10194
  'application/json': components['schemas']['SessionResponse'];
9896
10195
  };
9897
10196
  };
9898
- /** @description The request combines incompatible fields (multiple config sources, idle_start with prompt/input, or both override forms), or the config override is invalid. */
10197
+ /** @description The request is incompatible with itself (a one-shot run with no prompt or input) or its config keys produce an invalid config. */
9899
10198
  400: {
9900
10199
  headers: {
9901
10200
  [name: string]: unknown;
@@ -9922,7 +10221,7 @@ interface operations {
9922
10221
  'application/json': components['schemas']['ErrorResponse'];
9923
10222
  };
9924
10223
  };
9925
- /** @description The named agent or template does not exist in your account. */
10224
+ /** @description The named agent or environment does not exist in your account. */
9926
10225
  404: {
9927
10226
  headers: {
9928
10227
  [name: string]: unknown;
@@ -9931,15 +10230,6 @@ interface operations {
9931
10230
  'application/json': components['schemas']['ErrorResponse'];
9932
10231
  };
9933
10232
  };
9934
- /** @description The resolved default config is broken (deleted, disabled, unmerged, or on an inaccessible repository). */
9935
- 409: {
9936
- headers: {
9937
- [name: string]: unknown;
9938
- };
9939
- content: {
9940
- 'application/json': components['schemas']['ErrorResponse'];
9941
- };
9942
- };
9943
10233
  /** @description The agent requires 'input' matching its input schema (missing or failed validation), or declares no input schema and 'input' was sent. */
9944
10234
  422: {
9945
10235
  headers: {
@@ -10409,7 +10699,7 @@ interface operations {
10409
10699
  };
10410
10700
  };
10411
10701
  };
10412
- replay_agent_session: {
10702
+ stop_agent_session: {
10413
10703
  parameters: {
10414
10704
  query?: never;
10415
10705
  header?: {
@@ -10420,14 +10710,10 @@ interface operations {
10420
10710
  };
10421
10711
  cookie?: never;
10422
10712
  };
10423
- requestBody: {
10424
- content: {
10425
- 'application/json': components['schemas']['ReplayAgentSessionRequest'];
10426
- };
10427
- };
10713
+ requestBody?: never;
10428
10714
  responses: {
10429
10715
  /** @description Successful Response */
10430
- 201: {
10716
+ 200: {
10431
10717
  headers: {
10432
10718
  [name: string]: unknown;
10433
10719
  };
@@ -10435,8 +10721,8 @@ interface operations {
10435
10721
  'application/json': components['schemas']['SessionResponse'];
10436
10722
  };
10437
10723
  };
10438
- /** @description The named config does not exist, or the config override is invalid. */
10439
- 400: {
10724
+ /** @description The bearer token is missing, invalid, or revoked. */
10725
+ 401: {
10440
10726
  headers: {
10441
10727
  [name: string]: unknown;
10442
10728
  };
@@ -10444,8 +10730,8 @@ interface operations {
10444
10730
  'application/json': components['schemas']['ErrorResponse'];
10445
10731
  };
10446
10732
  };
10447
- /** @description The bearer token is missing, invalid, or revoked. */
10448
- 401: {
10733
+ /** @description The credential may not perform this action, or the account is blocked. */
10734
+ 403: {
10449
10735
  headers: {
10450
10736
  [name: string]: unknown;
10451
10737
  };
@@ -10453,8 +10739,8 @@ interface operations {
10453
10739
  'application/json': components['schemas']['ErrorResponse'];
10454
10740
  };
10455
10741
  };
10456
- /** @description The credential may not perform this action, or the account is blocked. */
10457
- 403: {
10742
+ /** @description No such session in your account. */
10743
+ 404: {
10458
10744
  headers: {
10459
10745
  [name: string]: unknown;
10460
10746
  };
@@ -10462,8 +10748,8 @@ interface operations {
10462
10748
  'application/json': components['schemas']['ErrorResponse'];
10463
10749
  };
10464
10750
  };
10465
- /** @description No such session in your account. */
10466
- 404: {
10751
+ /** @description The session has already finished. */
10752
+ 409: {
10467
10753
  headers: {
10468
10754
  [name: string]: unknown;
10469
10755
  };
@@ -10482,7 +10768,7 @@ interface operations {
10482
10768
  };
10483
10769
  };
10484
10770
  };
10485
- stop_agent_session: {
10771
+ ingest_agent_session_transcript: {
10486
10772
  parameters: {
10487
10773
  query?: never;
10488
10774
  header?: {
@@ -10493,7 +10779,11 @@ interface operations {
10493
10779
  };
10494
10780
  cookie?: never;
10495
10781
  };
10496
- requestBody?: never;
10782
+ requestBody: {
10783
+ content: {
10784
+ 'application/json': components['schemas']['IngestTranscriptRequest'];
10785
+ };
10786
+ };
10497
10787
  responses: {
10498
10788
  /** @description Successful Response */
10499
10789
  200: {
@@ -10501,7 +10791,7 @@ interface operations {
10501
10791
  [name: string]: unknown;
10502
10792
  };
10503
10793
  content: {
10504
- 'application/json': components['schemas']['SessionResponse'];
10794
+ 'application/json': components['schemas']['TranscriptIngestResult'];
10505
10795
  };
10506
10796
  };
10507
10797
  /** @description The bearer token is missing, invalid, or revoked. */
@@ -10531,7 +10821,7 @@ interface operations {
10531
10821
  'application/json': components['schemas']['ErrorResponse'];
10532
10822
  };
10533
10823
  };
10534
- /** @description The session has already finished. */
10824
+ /** @description The session has no execution yet to attach transcript records to. */
10535
10825
  409: {
10536
10826
  headers: {
10537
10827
  [name: string]: unknown;
@@ -10551,22 +10841,16 @@ interface operations {
10551
10841
  };
10552
10842
  };
10553
10843
  };
10554
- ingest_agent_session_transcript: {
10844
+ get_session_defaults: {
10555
10845
  parameters: {
10556
10846
  query?: never;
10557
10847
  header?: {
10558
10848
  'user-agent'?: string | null;
10559
10849
  };
10560
- path: {
10561
- session_id: string;
10562
- };
10850
+ path?: never;
10563
10851
  cookie?: never;
10564
10852
  };
10565
- requestBody: {
10566
- content: {
10567
- 'application/json': components['schemas']['IngestTranscriptRequest'];
10568
- };
10569
- };
10853
+ requestBody?: never;
10570
10854
  responses: {
10571
10855
  /** @description Successful Response */
10572
10856
  200: {
@@ -10574,7 +10858,7 @@ interface operations {
10574
10858
  [name: string]: unknown;
10575
10859
  };
10576
10860
  content: {
10577
- 'application/json': components['schemas']['TranscriptIngestResult'];
10861
+ 'application/json': components['schemas']['SessionDefaults'];
10578
10862
  };
10579
10863
  };
10580
10864
  /** @description The bearer token is missing, invalid, or revoked. */
@@ -10595,8 +10879,43 @@ interface operations {
10595
10879
  'application/json': components['schemas']['ErrorResponse'];
10596
10880
  };
10597
10881
  };
10598
- /** @description No such session in your account. */
10599
- 404: {
10882
+ /** @description Validation Error */
10883
+ 422: {
10884
+ headers: {
10885
+ [name: string]: unknown;
10886
+ };
10887
+ content: {
10888
+ 'application/json': components['schemas']['HTTPValidationError'];
10889
+ };
10890
+ };
10891
+ };
10892
+ };
10893
+ put_session_defaults: {
10894
+ parameters: {
10895
+ query?: never;
10896
+ header?: {
10897
+ 'user-agent'?: string | null;
10898
+ };
10899
+ path?: never;
10900
+ cookie?: never;
10901
+ };
10902
+ requestBody: {
10903
+ content: {
10904
+ 'application/json': components['schemas']['SessionDefaults'];
10905
+ };
10906
+ };
10907
+ responses: {
10908
+ /** @description Successful Response */
10909
+ 200: {
10910
+ headers: {
10911
+ [name: string]: unknown;
10912
+ };
10913
+ content: {
10914
+ 'application/json': components['schemas']['SessionDefaults'];
10915
+ };
10916
+ };
10917
+ /** @description The model id is unknown, internal-only, or not runnable on the Claude Code harness. */
10918
+ 400: {
10600
10919
  headers: {
10601
10920
  [name: string]: unknown;
10602
10921
  };
@@ -10604,8 +10923,17 @@ interface operations {
10604
10923
  'application/json': components['schemas']['ErrorResponse'];
10605
10924
  };
10606
10925
  };
10607
- /** @description The session has no execution yet to attach transcript records to. */
10608
- 409: {
10926
+ /** @description The bearer token is missing, invalid, or revoked. */
10927
+ 401: {
10928
+ headers: {
10929
+ [name: string]: unknown;
10930
+ };
10931
+ content: {
10932
+ 'application/json': components['schemas']['ErrorResponse'];
10933
+ };
10934
+ };
10935
+ /** @description The credential may not perform this action, or the account is blocked. */
10936
+ 403: {
10609
10937
  headers: {
10610
10938
  [name: string]: unknown;
10611
10939
  };
@@ -10705,8 +11033,13 @@ type PullRequestAction = 'opened' | 'pushed' | 'merged' | 'closed' | 'review_sub
10705
11033
  type SentryAction = 'issue_alert' | 'metric_alert';
10706
11034
  /**
10707
11035
  * The surface an @ellipsis mention can come from.
11036
+ *
11037
+ * No SLACK member: Slack routing is not a trigger on an agent config, it is the
11038
+ * `slack.yaml` routing file (`SlackConfig`), which answers the questions a
11039
+ * platform list cannot — which channel, and whose DM. A mention trigger listing
11040
+ * `slack` is therefore a config error, not a silently-never-fires config.
10708
11041
  */
10709
- type AgentConfigMentionPlatform = 'github' | 'slack' | 'linear';
11042
+ type AgentConfigMentionPlatform = 'github' | 'linear';
10710
11043
  /**
10711
11044
  * How this session's config was chosen.
10712
11045
  */
@@ -10716,6 +11049,15 @@ type GithubAccountType = 'User' | 'Organization' | 'Bot' | 'Mannequin';
10716
11049
  * Where the resolved budget came from.
10717
11050
  */
10718
11051
  type BudgetSource = 'system' | 'account' | 'config' | 'run';
11052
+ /**
11053
+ * How a session's environment was chosen. None (the field is nullable)
11054
+ * when the config carried an inline environment block and no resolution ran —
11055
+ * an inline environment is not a reference, so there is nothing to record.
11056
+ *
11057
+ * Not derivable from the row: `environment_id` says WHICH environment, not
11058
+ * how it was chosen, and is null for the built-in basic sandbox.
11059
+ */
11060
+ type EnvironmentSource = 'request' | 'agent_config' | 'repo_default' | 'account_default' | 'platform_default';
10719
11061
  /**
10720
11062
  * Why a terminal agent session ended — a finer-grained reason than `status`.
10721
11063
  *
@@ -10851,6 +11193,7 @@ interface Session {
10851
11193
  * When the session was created.
10852
11194
  */
10853
11195
  created_at: string;
11196
+ environment: SessionEnvironment;
10854
11197
  /**
10855
11198
  * How the session ended; null until it is terminal.
10856
11199
  */
@@ -10934,9 +11277,8 @@ interface AgentConfig {
10934
11277
  claude: AgentConfigClaude;
10935
11278
  codex: AgentConfigCodex | null;
10936
11279
  ellipsis: AgentConfigEllipsis;
10937
- environment: AgentConfigEnvironment;
11280
+ environment: string | AgentConfigEnvironment;
10938
11281
  input: AgentConfigInput | null;
10939
- mcp_servers: (string | AgentConfigMcpServer)[];
10940
11282
  output: AgentConfigOutput | null;
10941
11283
  permissions: AgentConfigPermissions;
10942
11284
  skills: AgentConfigSkill[];
@@ -10952,7 +11294,7 @@ interface AgentConfigClaude {
10952
11294
  effort: EffortLevel | null;
10953
11295
  fallback_model: string | null;
10954
11296
  max_turns: number | null;
10955
- model: string;
11297
+ model: string | null;
10956
11298
  settings: AgentConfigSettingsRef | null;
10957
11299
  system: string | AgentConfigSystemFileRef | (string | AgentConfigSystemFileRef)[];
10958
11300
  }
@@ -10997,22 +11339,19 @@ interface AgentConfigCodex {
10997
11339
  /**
10998
11340
  * The Ellipsis product namespace for a config file: which schema this is
10999
11341
  * (`version`), the human-facing identity (`name`/`description`), freeform
11000
- * organizational `metadata`, whether the agent is `enabled`, and the
11001
- * human-access flag `interactive`. The presence of a top-level `ellipsis:`
11002
- * mapping is what marks a YAML file as an Ellipsis agent config (vs arbitrary
11003
- * YAML that merely lives under a config directory) — see
11004
- * `yaml_is_ellipsis_config`.
11342
+ * organizational `metadata`, and whether the agent is `enabled`. The
11343
+ * presence of a top-level `ellipsis:` mapping is what marks a YAML file as
11344
+ * an Ellipsis agent config (vs arbitrary YAML that merely lives under a
11345
+ * config directory) — see `yaml_is_ellipsis_config`.
11005
11346
  *
11006
- * `enabled`/`interactive` are agent behavior, not freeform metadata, so they
11007
- * stay inside the config `sha` (only `metadata` is sha-excluded).
11008
- * `interactive` lets a human `agent session connect` to a live session (CLI
11009
- * relay). It does not decide whether a session is ephemeral or durable — that
11010
- * is the trigger's job.
11347
+ * `enabled` is agent behavior, not freeform metadata, so it stays inside
11348
+ * the config `sha` (only `metadata` is sha-excluded). Whether a session
11349
+ * accepts messages is a per-run choice (POST /v1/sessions `interactive`),
11350
+ * not a config one.
11011
11351
  */
11012
11352
  interface AgentConfigEllipsis {
11013
11353
  description: string | null;
11014
11354
  enabled: boolean;
11015
- interactive: boolean;
11016
11355
  metadata: AgentConfigMetadata;
11017
11356
  name: string | null;
11018
11357
  version: string;
@@ -11040,6 +11379,7 @@ interface AgentConfigEnvironment {
11040
11379
  compute: AgentConfigCompute;
11041
11380
  hooks: AgentConfigEnvironmentHooks;
11042
11381
  image: AgentConfigEnvironmentImage;
11382
+ mcp_servers: (string | AgentConfigMcpServer | AgentConfigMcpStdioServer | AgentConfigMcpRemoteServer)[];
11043
11383
  repositories: AgentConfigRepository[];
11044
11384
  variables: AgentConfigEnvironmentVariable[];
11045
11385
  }
@@ -11130,6 +11470,49 @@ interface AgentConfigEnvironmentImage {
11130
11470
  dockerfile_append: string | null;
11131
11471
  setup: string | null;
11132
11472
  }
11473
+ /**
11474
+ * One built-in MCP server this agent opts into by name (`linear`/`slack`).
11475
+ * A name reference over the connected built-in set — the platform manages the
11476
+ * server's transport and credentials. It only matters when the named
11477
+ * integration is set to `opt_in` inclusion; an integration in the default
11478
+ * `all_sessions` mode is added regardless. For a server the platform does not
11479
+ * provide, define it instead (`AgentConfigMcpStdioServer` /
11480
+ * `AgentConfigMcpRemoteServer`).
11481
+ */
11482
+ interface AgentConfigMcpServer {
11483
+ name: string;
11484
+ }
11485
+ /**
11486
+ * A bring-your-own stdio MCP server: the harness spawns `command` inside
11487
+ * the sandbox and speaks JSON-RPC over its stdin/stdout. The command must be
11488
+ * runnable in the sandbox image — install its runtime via `image.setup` /
11489
+ * `image.dockerfile_append` if the base image lacks it.
11490
+ *
11491
+ * `env` values may embed `${NAME}` references, resolved at run time from the
11492
+ * account's secrets store (see `mcp_secret_refs`); everything else is passed
11493
+ * literally.
11494
+ */
11495
+ interface AgentConfigMcpStdioServer {
11496
+ args: string[];
11497
+ command: string;
11498
+ env: {
11499
+ [k: string]: string;
11500
+ };
11501
+ name: string;
11502
+ }
11503
+ /**
11504
+ * A bring-your-own remote MCP server: the harness talks HTTP to `url`.
11505
+ * Nothing runs in the sandbox image. `headers` carry static auth (e.g.
11506
+ * `Authorization: Bearer ${TOKEN}`); values may embed `${NAME}` secret
11507
+ * references, resolved at run time from the account's secrets store.
11508
+ */
11509
+ interface AgentConfigMcpRemoteServer {
11510
+ headers: {
11511
+ [k: string]: string;
11512
+ };
11513
+ name: string;
11514
+ url: string;
11515
+ }
11133
11516
  /**
11134
11517
  * One environment variable injected into the agent's sandbox.
11135
11518
  *
@@ -11165,17 +11548,6 @@ interface AgentConfigInput {
11165
11548
  } | null;
11166
11549
  message: string | null;
11167
11550
  }
11168
- /**
11169
- * One built-in MCP server this agent opts into by name (`linear`/`slack`).
11170
- * This is a name reference over the connected built-in set, NOT a custom-server
11171
- * definition — there is no command/url/headers shape (that was the old,
11172
- * removed field, and Ellipsis does not support bring-your-own MCP servers).
11173
- * It only matters when the named integration is set to `opt_in` inclusion; an
11174
- * integration in the default `all_sessions` mode is added regardless.
11175
- */
11176
- interface AgentConfigMcpServer {
11177
- name: string;
11178
- }
11179
11551
  /**
11180
11552
  * The typed output contract: the JSON Schema the agent must exit through
11181
11553
  * (the StructuredOutput exit tool). Read back via
@@ -11386,6 +11758,19 @@ interface SessionCost {
11386
11758
  */
11387
11759
  total: number;
11388
11760
  }
11761
+ /**
11762
+ * The environment the session resolved: the saved environment's id and how it was chosen. The environment's frozen body is inside agent.config.environment.
11763
+ */
11764
+ interface SessionEnvironment {
11765
+ /**
11766
+ * Identifier of the saved environment the session's config resolved. Null for an inline environment block or the built-in basic sandbox.
11767
+ */
11768
+ environment_id: string | null;
11769
+ /**
11770
+ * How the environment was chosen (request, agent_config, repo_default, account_default, platform_default). Null when the config carried its own inline environment.
11771
+ */
11772
+ source: EnvironmentSource | null;
11773
+ }
11389
11774
  /**
11390
11775
  * Every repo the session touched. Small enough to ride on `agent_sessions`
11391
11776
  * and be returned by every session read.
@@ -12036,6 +12421,7 @@ interface Session1 {
12036
12421
  * When the session was created.
12037
12422
  */
12038
12423
  created_at: string;
12424
+ environment: SessionEnvironment;
12039
12425
  /**
12040
12426
  * How the session ended; null until it is terminal.
12041
12427
  */