@ellipsis-dev/sdk 0.35.0 → 0.37.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.
@@ -1420,8 +1420,7 @@ interface paths {
1420
1420
  * @description List cloud agent sessions, newest first.
1421
1421
  *
1422
1422
  * Optionally filtered by agent (id or name), source, service, handler, time
1423
- * window, attributed author, repository, and whether the session is
1424
- * still going.
1423
+ * window, attributed author, repository, and status.
1425
1424
  */
1426
1425
  get: operations['list_sessions'];
1427
1426
  put?: never;
@@ -1642,8 +1641,9 @@ interface paths {
1642
1641
  * @description Send a message to a session.
1643
1642
  *
1644
1643
  * 409 for mention, non-interactive, closed, and out-of-budget
1645
- * sessions. Returns the created message and its turn; a retried send
1646
- * with the same idempotency_key returns the original ones.
1644
+ * sessions. Returns the created message; a retried send with the
1645
+ * same idempotency_key returns the original one. The message is
1646
+ * answered once the session's status is `idle` or `closed`.
1647
1647
  */
1648
1648
  post: operations['send_session_message'];
1649
1649
  delete?: never;
@@ -1712,11 +1712,11 @@ interface paths {
1712
1712
  put?: never;
1713
1713
  /**
1714
1714
  * Stop Session
1715
- * @description Stop the turn in progress and return the session.
1715
+ * @description Stop the session's work and return it.
1716
1716
  *
1717
- * The turn ends `stopped`; the conversation stays open. 409 when no
1718
- * turn is queued, preparing, or running. The stopping user is recorded only
1719
- * when the caller's credential maps to a GitHub account.
1717
+ * The running message ends `stopped` and every queued message is
1718
+ * cancelled, so the session goes `idle` (or `closed` when it was
1719
+ * not interactive). 409 when the session is idle or closed already.
1720
1720
  */
1721
1721
  post: operations['stop_session'];
1722
1722
  delete?: never;
@@ -1768,53 +1768,6 @@ interface paths {
1768
1768
  patch?: never;
1769
1769
  trace?: never;
1770
1770
  };
1771
- '/v1/sessions/{id}/turns': {
1772
- parameters: {
1773
- query?: never;
1774
- header?: never;
1775
- path?: never;
1776
- cookie?: never;
1777
- };
1778
- /**
1779
- * Get Session Turns
1780
- * @description Return the session's turns and messages, oldest first.
1781
- *
1782
- * One turn per message: pending until the agent starts on it,
1783
- * running while it works, then completed, failed, stopped, or
1784
- * cancelled.
1785
- */
1786
- get: operations['get_session_turns'];
1787
- put?: never;
1788
- post?: never;
1789
- delete?: never;
1790
- options?: never;
1791
- head?: never;
1792
- patch?: never;
1793
- trace?: never;
1794
- };
1795
- '/v1/sessions/{session_id}/turns/{id}': {
1796
- parameters: {
1797
- query?: never;
1798
- header?: never;
1799
- path?: never;
1800
- cookie?: never;
1801
- };
1802
- /**
1803
- * Get Session Turn
1804
- * @description Return one turn.
1805
- *
1806
- * Poll this after sending a message: the message is answered when
1807
- * the turn's status is completed, failed, stopped, or cancelled.
1808
- */
1809
- get: operations['get_session_turn'];
1810
- put?: never;
1811
- post?: never;
1812
- delete?: never;
1813
- options?: never;
1814
- head?: never;
1815
- patch?: never;
1816
- trace?: never;
1817
- };
1818
1771
  '/v1/support/slack': {
1819
1772
  parameters: {
1820
1773
  query?: never;
@@ -3269,7 +3222,7 @@ interface components {
3269
3222
  model: string;
3270
3223
  /**
3271
3224
  * Prompt
3272
- * @description The initial user message, passed verbatim. Omit to start an interactive session with no turn, waiting for a message.
3225
+ * @description The initial user message, passed verbatim. Omit to start an interactive session with no message, waiting for one.
3273
3226
  */
3274
3227
  prompt?: string | null;
3275
3228
  settings?: components['schemas']['SettingsRef-Input'] | null;
@@ -3291,7 +3244,7 @@ interface components {
3291
3244
  model: string;
3292
3245
  /**
3293
3246
  * Prompt
3294
- * @description The initial user message, passed verbatim. Omit to start an interactive session with no turn, waiting for a message.
3247
+ * @description The initial user message, passed verbatim. Omit to start an interactive session with no message, waiting for one.
3295
3248
  */
3296
3249
  prompt: string | null;
3297
3250
  settings: components['schemas']['SettingsRef-Output'] | null;
@@ -3342,6 +3295,11 @@ interface components {
3342
3295
  * @constant
3343
3296
  */
3344
3297
  kind: 'claude_code';
3298
+ /**
3299
+ * Message Id
3300
+ * @description The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
3301
+ */
3302
+ message_id: string | null;
3345
3303
  /** Model */
3346
3304
  model: string | null;
3347
3305
  /** Payload */
@@ -3362,11 +3320,6 @@ interface components {
3362
3320
  * @description Session containing this record.
3363
3321
  */
3364
3322
  session_id: string;
3365
- /**
3366
- * Session Message Id
3367
- * @description Message this record receives, delivers, requeues, or echoes.
3368
- */
3369
- session_message_id: string | null;
3370
3323
  /**
3371
3324
  * Source
3372
3325
  * @default claude_code
@@ -3376,11 +3329,6 @@ interface components {
3376
3329
  tokens_info: components['schemas']['TokensInfo'] | null;
3377
3330
  /** Tools */
3378
3331
  tools: string[] | null;
3379
- /**
3380
- * Turn Id
3381
- * @description Turn containing this record, when applicable.
3382
- */
3383
- turn_id: string | null;
3384
3332
  };
3385
3333
  /** ClaudeNativeUsage */
3386
3334
  ClaudeNativeUsage: {
@@ -3426,7 +3374,7 @@ interface components {
3426
3374
  model?: string | null;
3427
3375
  /**
3428
3376
  * Prompt
3429
- * @description The initial user message, passed verbatim. Omit to start an interactive session with no turn, waiting for a message.
3377
+ * @description The initial user message, passed verbatim. Omit to start an interactive session with no message, waiting for one.
3430
3378
  */
3431
3379
  prompt?: string | null;
3432
3380
  settings?: components['schemas']['SettingsRef-Input'] | null;
@@ -3534,6 +3482,11 @@ interface components {
3534
3482
  * @constant
3535
3483
  */
3536
3484
  kind: 'claude_sdk';
3485
+ /**
3486
+ * Message Id
3487
+ * @description The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
3488
+ */
3489
+ message_id: string | null;
3537
3490
  /** Model */
3538
3491
  model: string | null;
3539
3492
  /** Payload */
@@ -3554,11 +3507,6 @@ interface components {
3554
3507
  * @description Session containing this record.
3555
3508
  */
3556
3509
  session_id: string;
3557
- /**
3558
- * Session Message Id
3559
- * @description Message this record receives, delivers, requeues, or echoes.
3560
- */
3561
- session_message_id: string | null;
3562
3510
  /**
3563
3511
  * Source
3564
3512
  * @default claude_code
@@ -3568,11 +3516,6 @@ interface components {
3568
3516
  tokens_info: components['schemas']['TokensInfo'] | null;
3569
3517
  /** Tools */
3570
3518
  tools: string[] | null;
3571
- /**
3572
- * Turn Id
3573
- * @description Turn containing this record, when applicable.
3574
- */
3575
- turn_id: string | null;
3576
3519
  };
3577
3520
  /** ClaudeSystemEvent */
3578
3521
  ClaudeSystemEvent: {
@@ -3777,7 +3720,7 @@ interface components {
3777
3720
  } & {
3778
3721
  [key: string]: unknown;
3779
3722
  };
3780
- CodexAppServerItem: components['schemas']['CodexUserMessage'] | components['schemas']['CodexAgentMessage'] | components['schemas']['CodexReasoning'] | components['schemas']['CodexPlan'] | components['schemas']['CodexCommandExecution'] | components['schemas']['CodexFileChange'] | components['schemas']['CodexWebSearch'] | components['schemas']['CodexMcpToolCall'] | components['schemas']['CodexContextCompaction'];
3723
+ CodexAppServerItem: components['schemas']['CodexUserMessage'] | components['schemas']['CodexAgentMessage'] | components['schemas']['CodexReasoning'] | components['schemas']['CodexPlan'] | components['schemas']['CodexCommandExecution'] | components['schemas']['CodexFileChange'] | components['schemas']['CodexWebSearch'] | components['schemas']['CodexMcpToolCall'] | components['schemas']['CodexContextCompaction'] | components['schemas']['CodexSubAgentActivity'] | components['schemas']['CodexCollabAgentToolCall'];
3781
3724
  CodexAppServerNotification: components['schemas']['CodexThreadStarted'] | components['schemas']['CodexTurnStarted'] | components['schemas']['CodexTurnCompleted'] | components['schemas']['CodexItemStarted'] | components['schemas']['CodexItemCompleted'] | components['schemas']['CodexTokenUsageUpdated'] | components['schemas']['CodexAppServerError'];
3782
3725
  /** CodexAppServerSessionRecord */
3783
3726
  CodexAppServerSessionRecord: {
@@ -3806,6 +3749,11 @@ interface components {
3806
3749
  * @constant
3807
3750
  */
3808
3751
  kind: 'codex_app_server';
3752
+ /**
3753
+ * Message Id
3754
+ * @description The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
3755
+ */
3756
+ message_id: string | null;
3809
3757
  /** Model */
3810
3758
  model: string | null;
3811
3759
  payload: components['schemas']['CodexAppServerNotification'];
@@ -3825,11 +3773,6 @@ interface components {
3825
3773
  * @description Session containing this record.
3826
3774
  */
3827
3775
  session_id: string;
3828
- /**
3829
- * Session Message Id
3830
- * @description Message this record receives, delivers, requeues, or echoes.
3831
- */
3832
- session_message_id: string | null;
3833
3776
  /**
3834
3777
  * Source
3835
3778
  * @default codex
@@ -3839,11 +3782,31 @@ interface components {
3839
3782
  tokens_info: components['schemas']['TokensInfo'] | null;
3840
3783
  /** Tools */
3841
3784
  tools: string[] | null;
3785
+ };
3786
+ /** CodexCollabAgentToolCall */
3787
+ CodexCollabAgentToolCall: {
3788
+ /** Id */
3789
+ id: string;
3790
+ /** Prompt */
3791
+ prompt?: string | null;
3792
+ /** Receiverthreadids */
3793
+ receiverThreadIds: string[];
3794
+ /** Senderthreadid */
3795
+ senderThreadId: string;
3796
+ /**
3797
+ * Status
3798
+ * @enum {string}
3799
+ */
3800
+ status: 'inProgress' | 'completed' | 'failed';
3801
+ /** Tool */
3802
+ tool: string;
3842
3803
  /**
3843
- * Turn Id
3844
- * @description Turn containing this record, when applicable.
3804
+ * @description discriminator enum property added by openapi-typescript
3805
+ * @enum {string}
3845
3806
  */
3846
- turn_id: string | null;
3807
+ type: 'collabAgentToolCall';
3808
+ } & {
3809
+ [key: string]: unknown;
3847
3810
  };
3848
3811
  /** CodexCommandExecution */
3849
3812
  CodexCommandExecution: {
@@ -3906,7 +3869,7 @@ interface components {
3906
3869
  * @description Native options supported by the current Codex adapter.
3907
3870
  */
3908
3871
  'CodexConfig-Input': {
3909
- /** @description Reasoning effort for every turn. Omit to use the model default. */
3872
+ /** @description Reasoning effort for every message. Omit to use the model default. */
3910
3873
  effort?: components['schemas']['CodexEffortLevel'] | null;
3911
3874
  /**
3912
3875
  * Model
@@ -3915,7 +3878,7 @@ interface components {
3915
3878
  model: string;
3916
3879
  /**
3917
3880
  * Prompt
3918
- * @description The initial user message, passed verbatim. Omit to start an interactive session with no turn, waiting for a message.
3881
+ * @description The initial user message, passed verbatim. Omit to start an interactive session with no message, waiting for one.
3919
3882
  */
3920
3883
  prompt?: string | null;
3921
3884
  };
@@ -3924,7 +3887,7 @@ interface components {
3924
3887
  * @description Native options supported by the current Codex adapter.
3925
3888
  */
3926
3889
  'CodexConfig-Output': {
3927
- /** @description Reasoning effort for every turn. Omit to use the model default. */
3890
+ /** @description Reasoning effort for every message. Omit to use the model default. */
3928
3891
  effort: components['schemas']['CodexEffortLevel'] | null;
3929
3892
  /**
3930
3893
  * Model
@@ -3933,7 +3896,7 @@ interface components {
3933
3896
  model: string;
3934
3897
  /**
3935
3898
  * Prompt
3936
- * @description The initial user message, passed verbatim. Omit to start an interactive session with no turn, waiting for a message.
3899
+ * @description The initial user message, passed verbatim. Omit to start an interactive session with no message, waiting for one.
3937
3900
  */
3938
3901
  prompt: string | null;
3939
3902
  };
@@ -4216,13 +4179,13 @@ interface components {
4216
4179
  * Unknown options are rejected instead of silently ignored.
4217
4180
  */
4218
4181
  CodexOverrides: {
4219
- /** @description Reasoning effort for every turn. Omit to use the model default. */
4182
+ /** @description Reasoning effort for every message. Omit to use the model default. */
4220
4183
  effort?: components['schemas']['CodexEffortLevel'] | null;
4221
4184
  /** Model */
4222
4185
  model?: string | null;
4223
4186
  /**
4224
4187
  * Prompt
4225
- * @description The initial user message, passed verbatim. Omit to start an interactive session with no turn, waiting for a message.
4188
+ * @description The initial user message, passed verbatim. Omit to start an interactive session with no message, waiting for one.
4226
4189
  */
4227
4190
  prompt?: string | null;
4228
4191
  };
@@ -4305,6 +4268,11 @@ interface components {
4305
4268
  * @constant
4306
4269
  */
4307
4270
  kind: 'codex';
4271
+ /**
4272
+ * Message Id
4273
+ * @description The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
4274
+ */
4275
+ message_id: string | null;
4308
4276
  /** Model */
4309
4277
  model: string | null;
4310
4278
  /** Payload */
@@ -4325,11 +4293,6 @@ interface components {
4325
4293
  * @description Session containing this record.
4326
4294
  */
4327
4295
  session_id: string;
4328
- /**
4329
- * Session Message Id
4330
- * @description Message this record receives, delivers, requeues, or echoes.
4331
- */
4332
- session_message_id: string | null;
4333
4296
  /**
4334
4297
  * Source
4335
4298
  * @default codex
@@ -4339,11 +4302,27 @@ interface components {
4339
4302
  tokens_info: components['schemas']['TokensInfo'] | null;
4340
4303
  /** Tools */
4341
4304
  tools: string[] | null;
4305
+ };
4306
+ /**
4307
+ * CodexSubAgentActivity
4308
+ * @description A subagent's spawn or completion, recorded on the spawning thread.
4309
+ */
4310
+ CodexSubAgentActivity: {
4311
+ /** Agentpath */
4312
+ agentPath?: string | null;
4313
+ /** Agentthreadid */
4314
+ agentThreadId: string;
4315
+ /** Id */
4316
+ id: string;
4317
+ /** Kind */
4318
+ kind: string;
4342
4319
  /**
4343
- * Turn Id
4344
- * @description Turn containing this record, when applicable.
4320
+ * @description discriminator enum property added by openapi-typescript
4321
+ * @enum {string}
4345
4322
  */
4346
- turn_id: string | null;
4323
+ type: 'subAgentActivity';
4324
+ } & {
4325
+ [key: string]: unknown;
4347
4326
  };
4348
4327
  /** CodexTextInput */
4349
4328
  CodexTextInput: {
@@ -5577,8 +5556,8 @@ interface components {
5577
5556
  /**
5578
5557
  * EnvironmentOutputPayload
5579
5558
  * @description environment_output: one chunk of output from preparing the environment,
5580
- * including the customer's own hooks. Many fire per turn; `chunk` orders them
5581
- * within a step.
5559
+ * including the customer's own hooks. Many fire per message; `chunk` orders
5560
+ * them within a step.
5582
5561
  */
5583
5562
  EnvironmentOutputPayload: {
5584
5563
  /** Chunk */
@@ -5624,6 +5603,11 @@ interface components {
5624
5603
  * @constant
5625
5604
  */
5626
5605
  kind: 'platform';
5606
+ /**
5607
+ * Message Id
5608
+ * @description The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
5609
+ */
5610
+ message_id: string | null;
5627
5611
  /** Model */
5628
5612
  model: string | null;
5629
5613
  payload: components['schemas']['EnvironmentOutputPayload'];
@@ -5643,11 +5627,6 @@ interface components {
5643
5627
  * @description Session containing this record.
5644
5628
  */
5645
5629
  session_id: string;
5646
- /**
5647
- * Session Message Id
5648
- * @description Message this record receives, delivers, requeues, or echoes.
5649
- */
5650
- session_message_id: string | null;
5651
5630
  /**
5652
5631
  * Source
5653
5632
  * @default lifecycle
@@ -5657,11 +5636,6 @@ interface components {
5657
5636
  tokens_info: components['schemas']['TokensInfo'] | null;
5658
5637
  /** Tools */
5659
5638
  tools: string[] | null;
5660
- /**
5661
- * Turn Id
5662
- * @description Turn containing this record, when applicable.
5663
- */
5664
- turn_id: string | null;
5665
5639
  };
5666
5640
  /**
5667
5641
  * EnvironmentPhasePayload
@@ -5712,6 +5686,11 @@ interface components {
5712
5686
  * @constant
5713
5687
  */
5714
5688
  kind: 'platform';
5689
+ /**
5690
+ * Message Id
5691
+ * @description The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
5692
+ */
5693
+ message_id: string | null;
5715
5694
  /** Model */
5716
5695
  model: string | null;
5717
5696
  payload: components['schemas']['EnvironmentPhasePayload'];
@@ -5731,11 +5710,6 @@ interface components {
5731
5710
  * @description Session containing this record.
5732
5711
  */
5733
5712
  session_id: string;
5734
- /**
5735
- * Session Message Id
5736
- * @description Message this record receives, delivers, requeues, or echoes.
5737
- */
5738
- session_message_id: string | null;
5739
5713
  /**
5740
5714
  * Source
5741
5715
  * @default lifecycle
@@ -5745,11 +5719,6 @@ interface components {
5745
5719
  tokens_info: components['schemas']['TokensInfo'] | null;
5746
5720
  /** Tools */
5747
5721
  tools: string[] | null;
5748
- /**
5749
- * Turn Id
5750
- * @description Turn containing this record, when applicable.
5751
- */
5752
- turn_id: string | null;
5753
5722
  };
5754
5723
  /**
5755
5724
  * EnvironmentReadyPayload
@@ -5791,6 +5760,11 @@ interface components {
5791
5760
  * @constant
5792
5761
  */
5793
5762
  kind: 'platform';
5763
+ /**
5764
+ * Message Id
5765
+ * @description The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
5766
+ */
5767
+ message_id: string | null;
5794
5768
  /** Model */
5795
5769
  model: string | null;
5796
5770
  payload: components['schemas']['EnvironmentReadyPayload'];
@@ -5810,11 +5784,6 @@ interface components {
5810
5784
  * @description Session containing this record.
5811
5785
  */
5812
5786
  session_id: string;
5813
- /**
5814
- * Session Message Id
5815
- * @description Message this record receives, delivers, requeues, or echoes.
5816
- */
5817
- session_message_id: string | null;
5818
5787
  /**
5819
5788
  * Source
5820
5789
  * @default lifecycle
@@ -5824,11 +5793,6 @@ interface components {
5824
5793
  tokens_info: components['schemas']['TokensInfo'] | null;
5825
5794
  /** Tools */
5826
5795
  tools: string[] | null;
5827
- /**
5828
- * Turn Id
5829
- * @description Turn containing this record, when applicable.
5830
- */
5831
- turn_id: string | null;
5832
5796
  };
5833
5797
  /**
5834
5798
  * EnvironmentResponse
@@ -5924,6 +5888,12 @@ interface components {
5924
5888
  */
5925
5889
  request_id?: string | null;
5926
5890
  };
5891
+ /**
5892
+ * ErrorReason
5893
+ * @description Why a message failed, was stopped, or was cancelled.
5894
+ * @enum {string}
5895
+ */
5896
+ ErrorReason: 'error' | 'tool_call_failed' | 'budget_hit' | 'payment_required' | 'blocked' | 'contact_email_required' | 'lifecycle_hook_failed' | 'missing_repo_access' | 'missing_token_permissions' | 'missing_environment_variables' | 'missing_github_integration' | 'agent_unavailable' | 'upstream_unavailable' | 'unsupported_configuration' | 'execution_disabled' | 'interrupted' | 'stopped';
5927
5897
  /**
5928
5898
  * ErrorResponse
5929
5899
  * @description The error envelope every /v1 error returns.
@@ -5947,7 +5917,7 @@ interface components {
5947
5917
  model: string;
5948
5918
  /**
5949
5919
  * Prompt
5950
- * @description The initial user message, passed verbatim. Omit to start an interactive session with no turn, waiting for a message.
5920
+ * @description The initial user message, passed verbatim. Omit to start an interactive session with no message, waiting for one.
5951
5921
  */
5952
5922
  prompt?: string | null;
5953
5923
  };
@@ -5963,7 +5933,7 @@ interface components {
5963
5933
  model: string;
5964
5934
  /**
5965
5935
  * Prompt
5966
- * @description The initial user message, passed verbatim. Omit to start an interactive session with no turn, waiting for a message.
5936
+ * @description The initial user message, passed verbatim. Omit to start an interactive session with no message, waiting for one.
5967
5937
  */
5968
5938
  prompt: string | null;
5969
5939
  };
@@ -6060,7 +6030,7 @@ interface components {
6060
6030
  model?: string | null;
6061
6031
  /**
6062
6032
  * Prompt
6063
- * @description The initial user message, passed verbatim. Omit to start an interactive session with no turn, waiting for a message.
6033
+ * @description The initial user message, passed verbatim. Omit to start an interactive session with no message, waiting for one.
6064
6034
  */
6065
6035
  prompt?: string | null;
6066
6036
  };
@@ -6110,6 +6080,11 @@ interface components {
6110
6080
  * @constant
6111
6081
  */
6112
6082
  kind: 'gemini';
6083
+ /**
6084
+ * Message Id
6085
+ * @description The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
6086
+ */
6087
+ message_id: string | null;
6113
6088
  /** Model */
6114
6089
  model: string | null;
6115
6090
  payload: components['schemas']['GeminiStreamEvent'];
@@ -6129,11 +6104,6 @@ interface components {
6129
6104
  * @description Session containing this record.
6130
6105
  */
6131
6106
  session_id: string;
6132
- /**
6133
- * Session Message Id
6134
- * @description Message this record receives, delivers, requeues, or echoes.
6135
- */
6136
- session_message_id: string | null;
6137
6107
  /**
6138
6108
  * Source
6139
6109
  * @default gemini
@@ -6143,11 +6113,6 @@ interface components {
6143
6113
  tokens_info: components['schemas']['TokensInfo'] | null;
6144
6114
  /** Tools */
6145
6115
  tools: string[] | null;
6146
- /**
6147
- * Turn Id
6148
- * @description Turn containing this record, when applicable.
6149
- */
6150
- turn_id: string | null;
6151
6116
  };
6152
6117
  GeminiStreamEvent: components['schemas']['GeminiInitEvent'] | components['schemas']['GeminiMessageEvent'] | components['schemas']['GeminiToolUseEvent'] | components['schemas']['GeminiToolResultEvent'] | components['schemas']['GeminiErrorEvent'] | components['schemas']['GeminiResultEvent'];
6153
6118
  /** GeminiStreamStats */
@@ -8085,19 +8050,28 @@ interface components {
8085
8050
  trigger_on_user_mention_public_repo: boolean;
8086
8051
  };
8087
8052
  /**
8088
- * MessageDeliveredPayload
8089
- * @description message_delivered: the agent started on the message.
8053
+ * MessageEndedPayload
8054
+ * @description message_ended: the message was answered, or its answer failed, was
8055
+ * stopped, or was cancelled. `error` is the same object as the session's
8056
+ * `error`, null when the message was answered. `cost` and `tokens` are what
8057
+ * answering it spent. Messages answered together report the spend once, on
8058
+ * the last of them.
8090
8059
  */
8091
- MessageDeliveredPayload: {
8060
+ MessageEndedPayload: {
8061
+ cost?: components['schemas']['Cost'];
8062
+ /** Duration Ms */
8063
+ duration_ms?: number | null;
8064
+ error?: components['schemas']['SessionError'] | null;
8092
8065
  /** Message Id */
8093
8066
  message_id: string;
8094
- /** Turn Id */
8095
- turn_id: string;
8067
+ /** Status */
8068
+ status: string;
8069
+ tokens?: components['schemas']['Tokens'];
8096
8070
  } & {
8097
8071
  [key: string]: unknown;
8098
8072
  };
8099
- /** MessageDeliveredRecord */
8100
- MessageDeliveredRecord: {
8073
+ /** MessageEndedRecord */
8074
+ MessageEndedRecord: {
8101
8075
  /** Cost */
8102
8076
  cost: number | null;
8103
8077
  /**
@@ -8123,9 +8097,14 @@ interface components {
8123
8097
  * @constant
8124
8098
  */
8125
8099
  kind: 'platform';
8100
+ /**
8101
+ * Message Id
8102
+ * @description The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
8103
+ */
8104
+ message_id: string | null;
8126
8105
  /** Model */
8127
8106
  model: string | null;
8128
- payload: components['schemas']['MessageDeliveredPayload'];
8107
+ payload: components['schemas']['MessageEndedPayload'];
8129
8108
  /**
8130
8109
  * Record Format
8131
8110
  * @default ellipsis_lifecycle@1
@@ -8136,17 +8115,12 @@ interface components {
8136
8115
  * @description discriminator enum property added by openapi-typescript
8137
8116
  * @enum {string}
8138
8117
  */
8139
- record_type: 'message_delivered';
8118
+ record_type: 'message_ended';
8140
8119
  /**
8141
8120
  * Session Id
8142
8121
  * @description Session containing this record.
8143
8122
  */
8144
8123
  session_id: string;
8145
- /**
8146
- * Session Message Id
8147
- * @description Message this record receives, delivers, requeues, or echoes.
8148
- */
8149
- session_message_id: string | null;
8150
8124
  /**
8151
8125
  * Source
8152
8126
  * @default lifecycle
@@ -8156,40 +8130,24 @@ interface components {
8156
8130
  tokens_info: components['schemas']['TokensInfo'] | null;
8157
8131
  /** Tools */
8158
8132
  tools: string[] | null;
8159
- /**
8160
- * Turn Id
8161
- * @description Turn containing this record, when applicable.
8162
- */
8163
- turn_id: string | null;
8164
8133
  };
8165
8134
  /**
8166
- * MessageReceivedPayload
8167
- * @description message_received: a message landed in the session inbox and its turn was
8168
- * created. `turn_id` is the turn that will answer it.
8135
+ * MessageQueuedPayload
8136
+ * @description message_queued: the message waits because the account already has
8137
+ * `sessions_alive` sessions alive, its limit.
8169
8138
  */
8170
- MessageReceivedPayload: {
8171
- /** Author */
8172
- author?: string | null;
8173
- /** Body */
8174
- body: string;
8175
- /**
8176
- * Closes Session
8177
- * @default false
8178
- */
8179
- closes_session: boolean;
8139
+ MessageQueuedPayload: {
8140
+ /** Limit */
8141
+ limit: number;
8180
8142
  /** Message Id */
8181
8143
  message_id: string;
8182
- /** Sender Attribution Id */
8183
- sender_attribution_id?: string | null;
8184
- /** Sender Attribution Type */
8185
- sender_attribution_type?: string | null;
8186
- /** Turn Id */
8187
- turn_id?: string | null;
8144
+ /** Sessions Alive */
8145
+ sessions_alive: number;
8188
8146
  } & {
8189
8147
  [key: string]: unknown;
8190
8148
  };
8191
- /** MessageReceivedRecord */
8192
- MessageReceivedRecord: {
8149
+ /** MessageQueuedRecord */
8150
+ MessageQueuedRecord: {
8193
8151
  /** Cost */
8194
8152
  cost: number | null;
8195
8153
  /**
@@ -8215,9 +8173,14 @@ interface components {
8215
8173
  * @constant
8216
8174
  */
8217
8175
  kind: 'platform';
8176
+ /**
8177
+ * Message Id
8178
+ * @description The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
8179
+ */
8180
+ message_id: string | null;
8218
8181
  /** Model */
8219
8182
  model: string | null;
8220
- payload: components['schemas']['MessageReceivedPayload'];
8183
+ payload: components['schemas']['MessageQueuedPayload'];
8221
8184
  /**
8222
8185
  * Record Format
8223
8186
  * @default ellipsis_lifecycle@1
@@ -8228,17 +8191,12 @@ interface components {
8228
8191
  * @description discriminator enum property added by openapi-typescript
8229
8192
  * @enum {string}
8230
8193
  */
8231
- record_type: 'message_received';
8194
+ record_type: 'message_queued';
8232
8195
  /**
8233
8196
  * Session Id
8234
8197
  * @description Session containing this record.
8235
8198
  */
8236
8199
  session_id: string;
8237
- /**
8238
- * Session Message Id
8239
- * @description Message this record receives, delivers, requeues, or echoes.
8240
- */
8241
- session_message_id: string | null;
8242
8200
  /**
8243
8201
  * Source
8244
8202
  * @default lifecycle
@@ -8248,24 +8206,76 @@ interface components {
8248
8206
  tokens_info: components['schemas']['TokensInfo'] | null;
8249
8207
  /** Tools */
8250
8208
  tools: string[] | null;
8209
+ };
8210
+ /** MessageRecord */
8211
+ MessageRecord: {
8212
+ /** Cost */
8213
+ cost: number | null;
8214
+ /**
8215
+ * Created At
8216
+ * Format: date-time
8217
+ */
8218
+ created_at: string;
8219
+ /** Duration */
8220
+ duration: number | null;
8221
+ /**
8222
+ * Feed Seq
8223
+ * @description Position in the session feed and the stream's resume cursor.
8224
+ */
8225
+ feed_seq: number;
8226
+ /**
8227
+ * Id
8228
+ * @description Unique identifier of the record.
8229
+ */
8230
+ id: string;
8231
+ /**
8232
+ * Kind
8233
+ * @default platform
8234
+ * @constant
8235
+ */
8236
+ kind: 'platform';
8237
+ /**
8238
+ * Message Id
8239
+ * @description The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
8240
+ */
8241
+ message_id: string | null;
8242
+ /** Model */
8243
+ model: string | null;
8244
+ payload: components['schemas']['SessionMessage'];
8245
+ /**
8246
+ * Record Format
8247
+ * @default ellipsis_lifecycle@1
8248
+ * @constant
8249
+ */
8250
+ record_format: 'ellipsis_lifecycle@1';
8251
+ /**
8252
+ * @description discriminator enum property added by openapi-typescript
8253
+ * @enum {string}
8254
+ */
8255
+ record_type: 'message';
8256
+ /**
8257
+ * Session Id
8258
+ * @description Session containing this record.
8259
+ */
8260
+ session_id: string;
8251
8261
  /**
8252
- * Turn Id
8253
- * @description Turn containing this record, when applicable.
8262
+ * Source
8263
+ * @default lifecycle
8264
+ * @constant
8254
8265
  */
8255
- turn_id: string | null;
8266
+ source: 'lifecycle';
8267
+ tokens_info: components['schemas']['TokensInfo'] | null;
8268
+ /** Tools */
8269
+ tools: string[] | null;
8256
8270
  };
8257
8271
  /**
8258
8272
  * MessageRequeuedPayload
8259
- * @description message_requeued: a turn was interrupted before answering, so the
8260
- * message goes back to the inbox with a new queued turn.
8273
+ * @description message_requeued: the agent was interrupted before answering, so the
8274
+ * message goes back to the inbox and starts again on a fresh environment.
8261
8275
  */
8262
8276
  MessageRequeuedPayload: {
8263
8277
  /** Message Id */
8264
8278
  message_id: string;
8265
- /** Requeued Turn Id */
8266
- requeued_turn_id?: string | null;
8267
- /** Turn Id */
8268
- turn_id: string;
8269
8279
  } & {
8270
8280
  [key: string]: unknown;
8271
8281
  };
@@ -8296,6 +8306,11 @@ interface components {
8296
8306
  * @constant
8297
8307
  */
8298
8308
  kind: 'platform';
8309
+ /**
8310
+ * Message Id
8311
+ * @description The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
8312
+ */
8313
+ message_id: string | null;
8299
8314
  /** Model */
8300
8315
  model: string | null;
8301
8316
  payload: components['schemas']['MessageRequeuedPayload'];
@@ -8315,11 +8330,6 @@ interface components {
8315
8330
  * @description Session containing this record.
8316
8331
  */
8317
8332
  session_id: string;
8318
- /**
8319
- * Session Message Id
8320
- * @description Message this record receives, delivers, requeues, or echoes.
8321
- */
8322
- session_message_id: string | null;
8323
8333
  /**
8324
8334
  * Source
8325
8335
  * @default lifecycle
@@ -8329,11 +8339,77 @@ interface components {
8329
8339
  tokens_info: components['schemas']['TokensInfo'] | null;
8330
8340
  /** Tools */
8331
8341
  tools: string[] | null;
8342
+ };
8343
+ /**
8344
+ * MessageStartedPayload
8345
+ * @description message_started: the agent started on the message.
8346
+ */
8347
+ MessageStartedPayload: {
8348
+ /** Message Id */
8349
+ message_id: string;
8350
+ } & {
8351
+ [key: string]: unknown;
8352
+ };
8353
+ /** MessageStartedRecord */
8354
+ MessageStartedRecord: {
8355
+ /** Cost */
8356
+ cost: number | null;
8357
+ /**
8358
+ * Created At
8359
+ * Format: date-time
8360
+ */
8361
+ created_at: string;
8362
+ /** Duration */
8363
+ duration: number | null;
8364
+ /**
8365
+ * Feed Seq
8366
+ * @description Position in the session feed and the stream's resume cursor.
8367
+ */
8368
+ feed_seq: number;
8369
+ /**
8370
+ * Id
8371
+ * @description Unique identifier of the record.
8372
+ */
8373
+ id: string;
8374
+ /**
8375
+ * Kind
8376
+ * @default platform
8377
+ * @constant
8378
+ */
8379
+ kind: 'platform';
8380
+ /**
8381
+ * Message Id
8382
+ * @description The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
8383
+ */
8384
+ message_id: string | null;
8385
+ /** Model */
8386
+ model: string | null;
8387
+ payload: components['schemas']['MessageStartedPayload'];
8332
8388
  /**
8333
- * Turn Id
8334
- * @description Turn containing this record, when applicable.
8389
+ * Record Format
8390
+ * @default ellipsis_lifecycle@1
8391
+ * @constant
8392
+ */
8393
+ record_format: 'ellipsis_lifecycle@1';
8394
+ /**
8395
+ * @description discriminator enum property added by openapi-typescript
8396
+ * @enum {string}
8397
+ */
8398
+ record_type: 'message_started';
8399
+ /**
8400
+ * Session Id
8401
+ * @description Session containing this record.
8402
+ */
8403
+ session_id: string;
8404
+ /**
8405
+ * Source
8406
+ * @default lifecycle
8407
+ * @constant
8335
8408
  */
8336
- turn_id: string | null;
8409
+ source: 'lifecycle';
8410
+ tokens_info: components['schemas']['TokensInfo'] | null;
8411
+ /** Tools */
8412
+ tools: string[] | null;
8337
8413
  };
8338
8414
  /** Model */
8339
8415
  Model: {
@@ -8603,7 +8679,7 @@ interface components {
8603
8679
  /** @default {} */
8604
8680
  github: components['schemas']['GithubPermissions-Output'];
8605
8681
  };
8606
- PlatformSessionRecord: components['schemas']['SessionClosedRecord'] | components['schemas']['MessageReceivedRecord'] | components['schemas']['MessageDeliveredRecord'] | components['schemas']['MessageRequeuedRecord'] | components['schemas']['TurnQueuedRecord'] | components['schemas']['TurnStartedRecord'] | components['schemas']['TurnEndedRecord'] | components['schemas']['EnvironmentPhaseRecord'] | components['schemas']['EnvironmentOutputRecord'] | components['schemas']['EnvironmentReadyRecord'];
8682
+ PlatformSessionRecord: components['schemas']['SessionClosedRecord'] | components['schemas']['MessageRecord'] | components['schemas']['MessageQueuedRecord'] | components['schemas']['MessageStartedRecord'] | components['schemas']['MessageEndedRecord'] | components['schemas']['MessageRequeuedRecord'] | components['schemas']['EnvironmentPhaseRecord'] | components['schemas']['EnvironmentOutputRecord'] | components['schemas']['EnvironmentReadyRecord'];
8607
8683
  /**
8608
8684
  * PollCliAuthResponse
8609
8685
  * @description The state of a device-code flow. Poll until `status` leaves `pending`.
@@ -10751,7 +10827,7 @@ interface components {
10751
10827
  * Session
10752
10828
  * @description An agent session: one conversation with an agent. Returned by
10753
10829
  * `GET /v1/sessions/{id}` and carried by the session stream's
10754
- * `session`/`snapshot` frames; REST and stream never disagree about what a
10830
+ * `session` frames; REST and stream never disagree about what a
10755
10831
  * session looks like.
10756
10832
  */
10757
10833
  Session: {
@@ -10783,6 +10859,8 @@ interface components {
10783
10859
  created_at: string;
10784
10860
  /** @description The full environment configuration frozen when the session was created, with the saved environment's id and how it was chosen. */
10785
10861
  environment: components['schemas']['SessionEnvironment'];
10862
+ /** @description Why the last message failed, was stopped, or was cancelled; null otherwise. */
10863
+ error: components['schemas']['SessionError'] | null;
10786
10864
  /**
10787
10865
  * Event
10788
10866
  * @description The typed external event that started the session; null for direct and scheduled starts.
@@ -10807,7 +10885,7 @@ interface components {
10807
10885
  metadata: {
10808
10886
  [key: string]: string;
10809
10887
  };
10810
- /** @description The session's structured output: the `json_schema` the agent must satisfy and, once a turn has submitted it, the `result`. */
10888
+ /** @description The session's structured output: the `json_schema` the agent must satisfy and, once the agent has submitted it, the `result`. */
10811
10889
  output: components['schemas']['SessionOutput'] | null;
10812
10890
  /** @description The predecessor session this session continues; null when there is none. */
10813
10891
  parent: components['schemas']['SessionParent'] | null;
@@ -10820,12 +10898,12 @@ interface components {
10820
10898
  skills: components['schemas']['SkillRef-Output'][];
10821
10899
  /** @description Where the session came from (e.g. react, web, api, cli, mention, cron). */
10822
10900
  source: components['schemas']['SessionSource'];
10901
+ /** @description Where the session is. A message you sent is answered once the status is `idle` or `closed`; its `message_ended` record in GET /v1/sessions/{id}/records says how. */
10902
+ status: components['schemas']['SessionStatus'];
10823
10903
  /** @description The latest live summary of the session's progress while it runs, and when it was generated. */
10824
10904
  summary: components['schemas']['SessionSummary'] | null;
10825
10905
  /** @description The tokens the session has used so far. */
10826
10906
  tokens: components['schemas']['Tokens'];
10827
- /** @description The turn in progress, or the latest one when none is running. Null until the session has a message. Wait on it: the message you sent is answered when the turn with your message's `turn_id` reaches a final status. */
10828
- turn: components['schemas']['SessionTurn'] | null;
10829
10907
  /**
10830
10908
  * Updated At
10831
10909
  * Format: date-time
@@ -10958,7 +11036,7 @@ interface components {
10958
11036
  SessionCapability: 'coding' | 'interactive' | 'agent' | 'structured_input' | 'structured_output' | 'system_files' | 'images' | 'mcp' | 'skills' | 'settings' | 'fallback_model' | 'effort';
10959
11037
  /**
10960
11038
  * SessionClosedPayload
10961
- * @description session_closed: the conversation closed permanently.
11039
+ * @description session_closed: the session closed permanently.
10962
11040
  */
10963
11041
  SessionClosedPayload: {
10964
11042
  [key: string]: unknown;
@@ -10990,6 +11068,11 @@ interface components {
10990
11068
  * @constant
10991
11069
  */
10992
11070
  kind: 'platform';
11071
+ /**
11072
+ * Message Id
11073
+ * @description The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
11074
+ */
11075
+ message_id: string | null;
10993
11076
  /** Model */
10994
11077
  model: string | null;
10995
11078
  payload: components['schemas']['SessionClosedPayload'];
@@ -11009,11 +11092,6 @@ interface components {
11009
11092
  * @description Session containing this record.
11010
11093
  */
11011
11094
  session_id: string;
11012
- /**
11013
- * Session Message Id
11014
- * @description Message this record receives, delivers, requeues, or echoes.
11015
- */
11016
- session_message_id: string | null;
11017
11095
  /**
11018
11096
  * Source
11019
11097
  * @default lifecycle
@@ -11023,11 +11101,6 @@ interface components {
11023
11101
  tokens_info: components['schemas']['TokensInfo'] | null;
11024
11102
  /** Tools */
11025
11103
  tools: string[] | null;
11026
- /**
11027
- * Turn Id
11028
- * @description Turn containing this record, when applicable.
11029
- */
11030
- turn_id: string | null;
11031
11104
  };
11032
11105
  /**
11033
11106
  * SessionConfig
@@ -11172,13 +11245,11 @@ interface components {
11172
11245
  SessionConversation: {
11173
11246
  /**
11174
11247
  * Interactive
11175
- * @description Whether the session stays open after its first turn.
11248
+ * @description Whether the session stays open after its first message is answered.
11176
11249
  */
11177
11250
  interactive: boolean;
11178
11251
  /** @description The session's policy for direct messages. Caller authorization and message validation are checked separately. */
11179
11252
  prompting: components['schemas']['SessionPrompting'];
11180
- /** @description `open` while the session can take messages; `closed` is permanent. */
11181
- state: components['schemas']['SessionState'];
11182
11253
  /**
11183
11254
  * Warm
11184
11255
  * @description Whether an agent is ready to answer the next message right away. When false, the next message first prepares an environment, which takes longer. A hint only; clients need no logic on it.
@@ -11192,7 +11263,7 @@ interface components {
11192
11263
  'SessionConversationConfig-Input': {
11193
11264
  /**
11194
11265
  * Interactive
11195
- * @description Whether the session stays open after its first turn. Defaults to true; false runs once and requires a prompt. Requires the model's interactive capability when true. Direct message acceptance is reported separately in conversation.prompting.
11266
+ * @description Whether the session stays open after its first message is answered. Defaults to true; false runs once and requires a prompt. Requires the model's interactive capability when true. Direct message acceptance is reported separately in conversation.prompting.
11196
11267
  */
11197
11268
  interactive?: boolean;
11198
11269
  };
@@ -11203,7 +11274,7 @@ interface components {
11203
11274
  'SessionConversationConfig-Output': {
11204
11275
  /**
11205
11276
  * Interactive
11206
- * @description Whether the session stays open after its first turn. Defaults to true; false runs once and requires a prompt. Requires the model's interactive capability when true. Direct message acceptance is reported separately in conversation.prompting.
11277
+ * @description Whether the session stays open after its first message is answered. Defaults to true; false runs once and requires a prompt. Requires the model's interactive capability when true. Direct message acceptance is reported separately in conversation.prompting.
11207
11278
  * @default true
11208
11279
  */
11209
11280
  interactive: boolean;
@@ -11269,11 +11340,25 @@ interface components {
11269
11340
  variables: components['schemas']['EnvironmentVariable-Output'][];
11270
11341
  };
11271
11342
  /**
11272
- * SessionEventActor
11273
- * @description The event's initiator, when known; never inferred from resource ownership.
11343
+ * SessionError
11344
+ * @description Why the last message failed, was stopped, or was cancelled. Cleared
11345
+ * when the next message starts.
11274
11346
  */
11275
- SessionEventActor: {
11276
- /** Avatar Url */
11347
+ SessionError: {
11348
+ /**
11349
+ * Detail
11350
+ * @description A human-readable explanation.
11351
+ */
11352
+ detail: string | null;
11353
+ /** @description What went wrong. */
11354
+ reason: components['schemas']['ErrorReason'];
11355
+ };
11356
+ /**
11357
+ * SessionEventActor
11358
+ * @description The event's initiator, when known; never inferred from resource ownership.
11359
+ */
11360
+ SessionEventActor: {
11361
+ /** Avatar Url */
11277
11362
  avatar_url: string | null;
11278
11363
  /** Is Bot */
11279
11364
  is_bot: boolean | null;
@@ -11481,8 +11566,7 @@ interface components {
11481
11566
  };
11482
11567
  /**
11483
11568
  * SessionMessage
11484
- * @description One message in a session's inbox: what a queued message renders and
11485
- * retires on. The webhook provenance internals stay off the wire.
11569
+ * @description One message sent to a session.
11486
11570
  */
11487
11571
  SessionMessage: {
11488
11572
  /**
@@ -11498,19 +11582,9 @@ interface components {
11498
11582
  /**
11499
11583
  * Created At
11500
11584
  * Format: date-time
11501
- * @description When the message was created.
11585
+ * @description When the message was received.
11502
11586
  */
11503
11587
  created_at: string;
11504
- /**
11505
- * Delivered At
11506
- * @description When the message was delivered to the agent, if it has been.
11507
- */
11508
- delivered_at?: string | null;
11509
- /**
11510
- * Feed Seq
11511
- * @description Where the message sits in the session's feed — placement metadata only, NOT a resume cursor (only records_append frames advance the cursor). Null for older rows.
11512
- */
11513
- feed_seq?: number | null;
11514
11588
  /**
11515
11589
  * Id
11516
11590
  * @description Unique identifier of the message.
@@ -11522,24 +11596,15 @@ interface components {
11522
11596
  */
11523
11597
  images?: components['schemas']['SessionMessageImage'][];
11524
11598
  /**
11525
- * Sender Attribution Id
11526
- * @description Identifier of the principal that sent the message, if attributed.
11599
+ * Index
11600
+ * @description Position in the session, starting at 0.
11527
11601
  */
11528
- sender_attribution_id?: string | null;
11529
- /** @description Kind of principal that sent the message, if attributed. */
11530
- sender_attribution_type?: components['schemas']['AttributionType'] | null;
11602
+ index: number;
11531
11603
  /**
11532
11604
  * Session Id
11533
11605
  * @description Identifier of the session the message belongs to.
11534
11606
  */
11535
11607
  session_id: string;
11536
- /** @description Delivery status of the message. */
11537
- status: components['schemas']['SessionMessageStatus'];
11538
- /**
11539
- * Turn Id
11540
- * @description The turn created to answer this message. Wait on it: the message is answered when that turn reaches a final status.
11541
- */
11542
- turn_id?: string | null;
11543
11608
  };
11544
11609
  /**
11545
11610
  * SessionMessageImage
@@ -11565,24 +11630,17 @@ interface components {
11565
11630
  };
11566
11631
  /**
11567
11632
  * SessionMessageResponse
11568
- * @description One inbox message and the turn created to answer it.
11633
+ * @description One message sent to a session.
11569
11634
  */
11570
11635
  SessionMessageResponse: {
11571
- /** @description The message. */
11636
+ /** @description The message. It is answered once the session's status is `idle` or `closed`; its `message_ended` record says how. */
11572
11637
  message: components['schemas']['SessionMessage'];
11573
- /** @description The turn that will answer the message. Wait on it: poll GET /v1/sessions/{session_id}/turns/{id} or watch the stream's session frames until its status is final. */
11574
- turn: components['schemas']['SessionTurn'];
11575
11638
  };
11576
- /**
11577
- * SessionMessageStatus
11578
- * @enum {string}
11579
- */
11580
- SessionMessageStatus: 'pending' | 'delivered';
11581
11639
  /**
11582
11640
  * SessionOutput
11583
- * @description Structured output on the wire: the contract and, when a turn has
11641
+ * @description Structured output on the wire: the contract and, when the agent has
11584
11642
  * submitted one, the payload. `result` is None while the session runs and
11585
- * when no turn submitted anything; it is the agent's own JSON, in the
11643
+ * when the agent submitted nothing; it is the agent's own JSON, in the
11586
11644
  * shape of `json_schema`.
11587
11645
  */
11588
11646
  SessionOutput: {
@@ -11595,7 +11653,7 @@ interface components {
11595
11653
  };
11596
11654
  /**
11597
11655
  * Result
11598
- * @description The payload the agent submitted, or null until a turn submits one.
11656
+ * @description The payload the agent submitted, or null until it submits one.
11599
11657
  */
11600
11658
  result: {
11601
11659
  [key: string]: unknown;
@@ -11744,8 +11802,7 @@ interface components {
11744
11802
  };
11745
11803
  /**
11746
11804
  * SessionRecordsListResponse
11747
- * @description A session's stored transcript records, plus its pending inbox
11748
- * messages.
11805
+ * @description A session's log: everything that happened, oldest first.
11749
11806
  */
11750
11807
  SessionRecordsListResponse: {
11751
11808
  /**
@@ -11759,12 +11816,6 @@ interface components {
11759
11816
  * @default false
11760
11817
  */
11761
11818
  has_more: boolean;
11762
- /**
11763
- * Messages
11764
- * @description The open inbox slice (pending rows only): queued messages not yet consumed by a turn. Delivered history comes from the records themselves.
11765
- * @default []
11766
- */
11767
- messages: components['schemas']['SessionMessage'][];
11768
11819
  /**
11769
11820
  * Next Cursor
11770
11821
  * @description Pass as `cursor` to fetch the next page. Null on the last page. Opaque — echo it back rather than parsing it.
@@ -11772,7 +11823,7 @@ interface components {
11772
11823
  next_cursor?: string | null;
11773
11824
  /**
11774
11825
  * Records
11775
- * @description The session's records (transcript + lifecycle), ordered by feed_seq. Clients render each by (source, record_format, record_type). Pagination is opt-in (`cursor` + `limit`); a bare call returns the full retained transcript.
11826
+ * @description The session's records, ordered by feed_seq: the messages sent to it, the platform's own events, and the agent's output. Clients render each by (source, record_format, record_type). Pagination is opt-in (`cursor` + `limit`); a bare call returns the full retained log.
11776
11827
  */
11777
11828
  records: components['schemas']['SessionRecord'][];
11778
11829
  };
@@ -11839,27 +11890,15 @@ interface components {
11839
11890
  tokens: number;
11840
11891
  };
11841
11892
  /**
11842
- * SessionState
11843
- * @description Whether the conversation can still take messages. `closed` is permanent:
11844
- * a session with interactive false closes when its turn ends, and a conversation closes
11845
- * after its closing message's turn.
11893
+ * SessionStatus
11894
+ * @description Where the session is. `queued` while a message waits for a worker,
11895
+ * `preparing` while its environment is set up, `running` while the agent
11896
+ * works, `idle` when every message has been answered and the session can
11897
+ * take another, and `closed` when it can take no more. `closed` is
11898
+ * permanent.
11846
11899
  * @enum {string}
11847
11900
  */
11848
- SessionState: 'open' | 'closed';
11849
- /**
11850
- * SessionStopped
11851
- * @description When a stop was requested and the GitHub user who requested it.
11852
- */
11853
- SessionStopped: {
11854
- /**
11855
- * At
11856
- * Format: date-time
11857
- * @description When a stop was requested.
11858
- */
11859
- at: string;
11860
- /** @description The GitHub user who stopped the session, resolved at read time. Null if the user is unknown or unavailable. */
11861
- by: components['schemas']['GithubAccountSnippet'] | null;
11862
- };
11901
+ SessionStatus: 'queued' | 'preparing' | 'running' | 'idle' | 'closed';
11863
11902
  /**
11864
11903
  * SessionSummary
11865
11904
  * @description A live one-line summary of what the session is doing, refreshed
@@ -11884,80 +11923,6 @@ interface components {
11884
11923
  /** Name */
11885
11924
  name: string;
11886
11925
  };
11887
- /**
11888
- * SessionTurn
11889
- * @description One message and the agent's answer to it. A turn is `queued` from the
11890
- * moment its message is received, `preparing` while its environment is set
11891
- * up, `running` while the agent works, then `completed`, `failed`,
11892
- * `stopped`, or `cancelled`.
11893
- */
11894
- SessionTurn: {
11895
- /** @description What the turn cost so far, in millicents, broken down by leg. */
11896
- cost: components['schemas']['Cost'];
11897
- /**
11898
- * Created At
11899
- * Format: date-time
11900
- * @description When the turn's message was received.
11901
- */
11902
- created_at: string;
11903
- /**
11904
- * Detail
11905
- * @description A human-readable explanation of a failed, stopped, or cancelled turn, or of why a queued turn waits.
11906
- */
11907
- detail: string | null;
11908
- /**
11909
- * Ended At
11910
- * @description When the turn reached its final status.
11911
- */
11912
- ended_at: string | null;
11913
- /**
11914
- * Id
11915
- * @description Unique identifier of the turn.
11916
- */
11917
- id: string;
11918
- /**
11919
- * Index
11920
- * @description Position in the session, starting at 0.
11921
- */
11922
- index: number;
11923
- /** @description Why the turn failed or was cancelled; null on every other status. */
11924
- reason: components['schemas']['TurnReason'] | null;
11925
- /**
11926
- * Started At
11927
- * @description When the agent started on the message.
11928
- */
11929
- started_at: string | null;
11930
- /** @description Where the turn is. */
11931
- status: components['schemas']['TurnStatus'];
11932
- /** @description When and by whom a stop was requested; null when none was. */
11933
- stopped: components['schemas']['SessionStopped'] | null;
11934
- /** @description The tokens the turn spent and the model they went to. */
11935
- tokens: components['schemas']['Tokens'];
11936
- };
11937
- /**
11938
- * SessionTurnResponse
11939
- * @description One turn.
11940
- */
11941
- SessionTurnResponse: {
11942
- /** @description The turn. */
11943
- turn: components['schemas']['SessionTurn'];
11944
- };
11945
- /**
11946
- * SessionTurnsListResponse
11947
- * @description A session's turns and its whole inbox, oldest first.
11948
- */
11949
- SessionTurnsListResponse: {
11950
- /**
11951
- * Messages
11952
- * @description Every message, delivered and pending, oldest first.
11953
- */
11954
- messages: components['schemas']['SessionMessage'][];
11955
- /**
11956
- * Turns
11957
- * @description Every turn, ordered by index.
11958
- */
11959
- turns: components['schemas']['SessionTurn'][];
11960
- };
11961
11926
  /** SessionUsageBucket */
11962
11927
  SessionUsageBucket: {
11963
11928
  /**
@@ -12007,6 +11972,13 @@ interface components {
12007
11972
  * @default false
12008
11973
  */
12009
11974
  has_more: boolean;
11975
+ /**
11976
+ * Message Counts
11977
+ * @description How many messages each listed session has received, by session id.
11978
+ */
11979
+ message_counts?: {
11980
+ [key: string]: number;
11981
+ };
12010
11982
  /**
12011
11983
  * Next Cursor
12012
11984
  * @description Pass as `cursor` to fetch the next page. Null on the last page. Opaque — echo it back rather than parsing it.
@@ -12021,10 +11993,6 @@ interface components {
12021
11993
  * @description Lean wire rows — the same shape GET /v1/sessions/{id} and the stream's session frames carry. The heavy blobs (config snapshot, input/output) live on the detail endpoints.
12022
11994
  */
12023
11995
  sessions: components['schemas']['Session'][];
12024
- /** Turn Counts */
12025
- turn_counts?: {
12026
- [key: string]: number;
12027
- };
12028
11996
  };
12029
11997
  /**
12030
11998
  * SettingsRef
@@ -12439,7 +12407,7 @@ interface components {
12439
12407
  claude_code?: components['schemas']['ClaudeOverrides'] | null;
12440
12408
  /** @description Codex options for this session. Sent fields replace the agent's; naming Codex on an agent that runs another harness replaces its harness and requires a model. Set at most one of claude_code, codex, or gemini. */
12441
12409
  codex?: components['schemas']['CodexOverrides'] | null;
12442
- /** @description Conversation settings. Omitted, a raw session is interactive and an agent session keeps the agent's setting. State, warmth, prompting, and the turn are server-owned response fields. */
12410
+ /** @description Conversation settings. Omitted, a raw session is interactive and an agent session keeps the agent's setting. Warmth and prompting are server-owned response fields. */
12443
12411
  conversation?: components['schemas']['SessionConversationConfig-Input'];
12444
12412
  /**
12445
12413
  * Environment
@@ -12455,7 +12423,7 @@ interface components {
12455
12423
  gemini?: components['schemas']['GeminiOverrides'] | null;
12456
12424
  /**
12457
12425
  * Images
12458
- * @description Images attached to the first message, base64 inline. Requires the model's `images` capability, listed by `/v1/account/models`. Each becomes an `[Image #N]` placeholder in the prompt and an image block on turn 0. Up to 10, 5 MiB each; PNG, JPEG, GIF, or WebP.
12426
+ * @description Images attached to the first message, base64 inline. Requires the model's `images` capability, listed by `/v1/account/models`. Each becomes an `[Image #N]` placeholder in the prompt and an image block the model sees with it. Up to 10, 5 MiB each; PNG, JPEG, GIF, or WebP.
12459
12427
  */
12460
12428
  images?: components['schemas']['ImageAttachment'][];
12461
12429
  /**
@@ -12539,7 +12507,7 @@ interface components {
12539
12507
  claude_code?: components['schemas']['ClaudeConfig-Input'] | null;
12540
12508
  /** @description Codex input and native options. Set exactly one of claude_code, codex, or gemini. */
12541
12509
  codex?: components['schemas']['CodexConfig-Input'] | null;
12542
- /** @description Conversation settings. Omitted, a raw session is interactive and an agent session keeps the agent's setting. State, warmth, prompting, and the turn are server-owned response fields. */
12510
+ /** @description Conversation settings. Omitted, a raw session is interactive and an agent session keeps the agent's setting. Warmth and prompting are server-owned response fields. */
12543
12511
  conversation?: components['schemas']['SessionConversationConfig-Input'];
12544
12512
  /**
12545
12513
  * Environment
@@ -12555,7 +12523,7 @@ interface components {
12555
12523
  gemini?: components['schemas']['GeminiConfig-Input'] | null;
12556
12524
  /**
12557
12525
  * Images
12558
- * @description Images attached to the first message, base64 inline. Requires the model's `images` capability, listed by `/v1/account/models`. Each becomes an `[Image #N]` placeholder in the prompt and an image block on turn 0. Up to 10, 5 MiB each; PNG, JPEG, GIF, or WebP.
12526
+ * @description Images attached to the first message, base64 inline. Requires the model's `images` capability, listed by `/v1/account/models`. Each becomes an `[Image #N]` placeholder in the prompt and an image block the model sees with it. Up to 10, 5 MiB each; PNG, JPEG, GIF, or WebP.
12559
12527
  */
12560
12528
  images?: components['schemas']['ImageAttachment'][];
12561
12529
  /**
@@ -12725,29 +12693,16 @@ interface components {
12725
12693
  /** Skipped */
12726
12694
  skipped: number;
12727
12695
  };
12696
+ /** UninstallGithubAppRequest */
12697
+ UninstallGithubAppRequest: {
12698
+ /** Confirm Account Login */
12699
+ confirm_account_login: string;
12700
+ };
12728
12701
  /**
12729
- * TurnEndedPayload
12730
- * @description turn_ended: the turn reached its final status. `status`, `reason`, and
12731
- * `detail` match the turn on the session object.
12702
+ * UnknownSessionRecord
12703
+ * @description Unrecognized or unparseable payload; the complete original stays readable.
12732
12704
  */
12733
- TurnEndedPayload: {
12734
- /** Detail */
12735
- detail?: string | null;
12736
- /** Duration Ms */
12737
- duration_ms?: number | null;
12738
- /** Reason */
12739
- reason?: string | null;
12740
- /** Status */
12741
- status: string;
12742
- /** Turn Id */
12743
- turn_id: string;
12744
- /** Turn Index */
12745
- turn_index: number;
12746
- } & {
12747
- [key: string]: unknown;
12748
- };
12749
- /** TurnEndedRecord */
12750
- TurnEndedRecord: {
12705
+ UnknownSessionRecord: {
12751
12706
  /** Cost */
12752
12707
  cost: number | null;
12753
12708
  /**
@@ -12769,398 +12724,143 @@ interface components {
12769
12724
  id: string;
12770
12725
  /**
12771
12726
  * Kind
12772
- * @default platform
12727
+ * @default unknown
12773
12728
  * @constant
12774
12729
  */
12775
- kind: 'platform';
12730
+ kind: 'unknown';
12731
+ /**
12732
+ * Message Id
12733
+ * @description The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
12734
+ */
12735
+ message_id: string | null;
12776
12736
  /** Model */
12777
12737
  model: string | null;
12778
- payload: components['schemas']['TurnEndedPayload'];
12738
+ /** Payload */
12739
+ payload: {
12740
+ [key: string]: unknown;
12741
+ };
12779
12742
  /**
12780
12743
  * Record Format
12781
- * @default ellipsis_lifecycle@1
12782
- * @constant
12744
+ * @description Original versioned payload format.
12783
12745
  */
12784
- record_format: 'ellipsis_lifecycle@1';
12746
+ record_format: string;
12785
12747
  /**
12786
- * @description discriminator enum property added by openapi-typescript
12787
- * @enum {string}
12748
+ * Record Type
12749
+ * @description Original record type within its format.
12788
12750
  */
12789
- record_type: 'turn_ended';
12751
+ record_type: string;
12790
12752
  /**
12791
12753
  * Session Id
12792
12754
  * @description Session containing this record.
12793
12755
  */
12794
12756
  session_id: string;
12795
- /**
12796
- * Session Message Id
12797
- * @description Message this record receives, delivers, requeues, or echoes.
12798
- */
12799
- session_message_id: string | null;
12800
12757
  /**
12801
12758
  * Source
12802
- * @default lifecycle
12803
- * @constant
12759
+ * @description Original producer. Unknown producers remain readable as unknown records.
12804
12760
  */
12805
- source: 'lifecycle';
12761
+ source: string;
12806
12762
  tokens_info: components['schemas']['TokensInfo'] | null;
12807
12763
  /** Tools */
12808
12764
  tools: string[] | null;
12809
- /**
12810
- * Turn Id
12811
- * @description Turn containing this record, when applicable.
12812
- */
12813
- turn_id: string | null;
12814
12765
  };
12815
12766
  /**
12816
- * TurnQueuedPayload
12817
- * @description turn_queued: the turn waits because the account already has
12818
- * `sessions_alive` sessions alive, its limit.
12767
+ * UpdateAgentRequest
12768
+ * @description A replacement definition for an agent managed through the API.
12819
12769
  */
12820
- TurnQueuedPayload: {
12821
- /** Limit */
12822
- limit: number;
12823
- /** Sessions Alive */
12824
- sessions_alive: number;
12825
- /** Turn Id */
12826
- turn_id: string;
12827
- } & {
12828
- [key: string]: unknown;
12770
+ UpdateAgentRequest: {
12771
+ /** @description The agent's new definition. Replaces the previous one wholesale — this is not a partial update. */
12772
+ agent: components['schemas']['AgentConfig-Input'];
12829
12773
  };
12830
- /** TurnQueuedRecord */
12831
- TurnQueuedRecord: {
12832
- /** Cost */
12833
- cost: number | null;
12774
+ /**
12775
+ * UpdateEnvironmentRequest
12776
+ * @description A replacement definition for an environment managed through the API.
12777
+ */
12778
+ UpdateEnvironmentRequest: {
12779
+ /** @description The environment's new definition. Replaces the previous one wholesale — this is not a partial update. */
12780
+ environment: components['schemas']['EnvironmentDocument-Input'];
12781
+ };
12782
+ /** UpdateLinearSettingsRequest */
12783
+ UpdateLinearSettingsRequest: {
12784
+ /** Teams */
12785
+ teams: components['schemas']['LinearTeamUpdate'][];
12786
+ };
12787
+ /**
12788
+ * UpdateSessionRequest
12789
+ * @description Set the session's archive state.
12790
+ */
12791
+ UpdateSessionRequest: {
12834
12792
  /**
12835
- * Created At
12836
- * Format: date-time
12793
+ * Archived
12794
+ * @description True to archive the session; false to unarchive it.
12837
12795
  */
12838
- created_at: string;
12839
- /** Duration */
12840
- duration: number | null;
12796
+ archived: boolean;
12797
+ };
12798
+ /**
12799
+ * UsageDay
12800
+ * @description One UTC day's cost and tokens.
12801
+ */
12802
+ UsageDay: {
12803
+ /** @description What the day's usage cost. */
12804
+ cost: components['schemas']['Cost'];
12841
12805
  /**
12842
- * Feed Seq
12843
- * @description Position in the session feed and the stream's resume cursor.
12806
+ * Date
12807
+ * @description The UTC day, formatted yyyy-MM-dd.
12844
12808
  */
12845
- feed_seq: number;
12809
+ date: string;
12810
+ /** @description The tokens used that day. */
12811
+ tokens: components['schemas']['Tokens'];
12812
+ };
12813
+ /**
12814
+ * UsageTotals
12815
+ * @description Cost and tokens over a set of sessions.
12816
+ */
12817
+ UsageTotals: {
12818
+ /** @description What the sessions cost. */
12819
+ cost: components['schemas']['Cost'];
12820
+ /** @description The tokens the sessions used. */
12821
+ tokens: components['schemas']['Tokens'];
12822
+ };
12823
+ /** UserPlan */
12824
+ UserPlan: {
12825
+ /** Collaborators */
12826
+ collaborators: number;
12827
+ /** Name */
12828
+ name: string;
12829
+ /** Private Repos */
12830
+ private_repos: number;
12831
+ /** Space */
12832
+ space: number;
12833
+ };
12834
+ /**
12835
+ * UserTokenApi
12836
+ * @description A user token as shown in listings -- never includes the secret.
12837
+ */
12838
+ UserTokenApi: {
12839
+ /** Created At */
12840
+ created_at: string;
12841
+ /** Expires At */
12842
+ expires_at: string;
12843
+ /** Id */
12844
+ id: string;
12845
+ /** Last Used At */
12846
+ last_used_at: string | null;
12847
+ /** Name */
12848
+ name: string;
12849
+ /** Revoked At */
12850
+ revoked_at: string | null;
12851
+ };
12852
+ /** VM */
12853
+ VM: {
12846
12854
  /**
12847
12855
  * Id
12848
- * @description Unique identifier of the record.
12856
+ * @description The VM id, shared across session resumes.
12849
12857
  */
12850
12858
  id: string;
12859
+ /** @description Most recent execution using this machine; its timestamps and costs describe that execution. */
12860
+ latest_execution: components['schemas']['VMExecutionResponse'];
12851
12861
  /**
12852
- * Kind
12853
- * @default platform
12854
- * @constant
12855
- */
12856
- kind: 'platform';
12857
- /** Model */
12858
- model: string | null;
12859
- payload: components['schemas']['TurnQueuedPayload'];
12860
- /**
12861
- * Record Format
12862
- * @default ellipsis_lifecycle@1
12863
- * @constant
12864
- */
12865
- record_format: 'ellipsis_lifecycle@1';
12866
- /**
12867
- * @description discriminator enum property added by openapi-typescript
12868
- * @enum {string}
12869
- */
12870
- record_type: 'turn_queued';
12871
- /**
12872
- * Session Id
12873
- * @description Session containing this record.
12874
- */
12875
- session_id: string;
12876
- /**
12877
- * Session Message Id
12878
- * @description Message this record receives, delivers, requeues, or echoes.
12879
- */
12880
- session_message_id: string | null;
12881
- /**
12882
- * Source
12883
- * @default lifecycle
12884
- * @constant
12885
- */
12886
- source: 'lifecycle';
12887
- tokens_info: components['schemas']['TokensInfo'] | null;
12888
- /** Tools */
12889
- tools: string[] | null;
12890
- /**
12891
- * Turn Id
12892
- * @description Turn containing this record, when applicable.
12893
- */
12894
- turn_id: string | null;
12895
- };
12896
- /**
12897
- * TurnReason
12898
- * @description Why a turn failed or was cancelled. Null on every other outcome.
12899
- * @enum {string}
12900
- */
12901
- TurnReason: 'error' | 'tool_call_failed' | 'budget_hit' | 'payment_required' | 'blocked' | 'contact_email_required' | 'lifecycle_hook_failed' | 'missing_repo_access' | 'missing_token_permissions' | 'missing_environment_variables' | 'missing_github_integration' | 'agent_unavailable' | 'upstream_unavailable' | 'unsupported_configuration' | 'execution_disabled' | 'interrupted';
12902
- /**
12903
- * TurnStartedPayload
12904
- * @description turn_started: the agent started on the turn's message.
12905
- */
12906
- TurnStartedPayload: {
12907
- /** Turn Id */
12908
- turn_id: string;
12909
- /** Turn Index */
12910
- turn_index: number;
12911
- } & {
12912
- [key: string]: unknown;
12913
- };
12914
- /** TurnStartedRecord */
12915
- TurnStartedRecord: {
12916
- /** Cost */
12917
- cost: number | null;
12918
- /**
12919
- * Created At
12920
- * Format: date-time
12921
- */
12922
- created_at: string;
12923
- /** Duration */
12924
- duration: number | null;
12925
- /**
12926
- * Feed Seq
12927
- * @description Position in the session feed and the stream's resume cursor.
12928
- */
12929
- feed_seq: number;
12930
- /**
12931
- * Id
12932
- * @description Unique identifier of the record.
12933
- */
12934
- id: string;
12935
- /**
12936
- * Kind
12937
- * @default platform
12938
- * @constant
12939
- */
12940
- kind: 'platform';
12941
- /** Model */
12942
- model: string | null;
12943
- payload: components['schemas']['TurnStartedPayload'];
12944
- /**
12945
- * Record Format
12946
- * @default ellipsis_lifecycle@1
12947
- * @constant
12948
- */
12949
- record_format: 'ellipsis_lifecycle@1';
12950
- /**
12951
- * @description discriminator enum property added by openapi-typescript
12952
- * @enum {string}
12953
- */
12954
- record_type: 'turn_started';
12955
- /**
12956
- * Session Id
12957
- * @description Session containing this record.
12958
- */
12959
- session_id: string;
12960
- /**
12961
- * Session Message Id
12962
- * @description Message this record receives, delivers, requeues, or echoes.
12963
- */
12964
- session_message_id: string | null;
12965
- /**
12966
- * Source
12967
- * @default lifecycle
12968
- * @constant
12969
- */
12970
- source: 'lifecycle';
12971
- tokens_info: components['schemas']['TokensInfo'] | null;
12972
- /** Tools */
12973
- tools: string[] | null;
12974
- /**
12975
- * Turn Id
12976
- * @description Turn containing this record, when applicable.
12977
- */
12978
- turn_id: string | null;
12979
- };
12980
- /**
12981
- * TurnStatus
12982
- * @description Where one turn is: waiting, preparing, being answered, or over.
12983
- *
12984
- * `queued` turns wait to start, behind another turn or for a free session
12985
- * slot on the account. `preparing` turns wait while the environment is set
12986
- * up. `stopped` and `cancelled` are their own outcomes; `reason` explains a
12987
- * `failed` or `cancelled` turn.
12988
- * @enum {string}
12989
- */
12990
- TurnStatus: 'queued' | 'preparing' | 'running' | 'completed' | 'failed' | 'stopped' | 'cancelled';
12991
- /** UninstallGithubAppRequest */
12992
- UninstallGithubAppRequest: {
12993
- /** Confirm Account Login */
12994
- confirm_account_login: string;
12995
- };
12996
- /**
12997
- * UnknownSessionRecord
12998
- * @description Unrecognized or unparseable payload; the complete original stays readable.
12999
- */
13000
- UnknownSessionRecord: {
13001
- /** Cost */
13002
- cost: number | null;
13003
- /**
13004
- * Created At
13005
- * Format: date-time
13006
- */
13007
- created_at: string;
13008
- /** Duration */
13009
- duration: number | null;
13010
- /**
13011
- * Feed Seq
13012
- * @description Position in the session feed and the stream's resume cursor.
13013
- */
13014
- feed_seq: number;
13015
- /**
13016
- * Id
13017
- * @description Unique identifier of the record.
13018
- */
13019
- id: string;
13020
- /**
13021
- * Kind
13022
- * @default unknown
13023
- * @constant
13024
- */
13025
- kind: 'unknown';
13026
- /** Model */
13027
- model: string | null;
13028
- /** Payload */
13029
- payload: {
13030
- [key: string]: unknown;
13031
- };
13032
- /**
13033
- * Record Format
13034
- * @description Original versioned payload format.
13035
- */
13036
- record_format: string;
13037
- /**
13038
- * Record Type
13039
- * @description Original record type within its format.
13040
- */
13041
- record_type: string;
13042
- /**
13043
- * Session Id
13044
- * @description Session containing this record.
13045
- */
13046
- session_id: string;
13047
- /**
13048
- * Session Message Id
13049
- * @description Message this record receives, delivers, requeues, or echoes.
13050
- */
13051
- session_message_id: string | null;
13052
- /**
13053
- * Source
13054
- * @description Original producer. Unknown producers remain readable as unknown records.
13055
- */
13056
- source: string;
13057
- tokens_info: components['schemas']['TokensInfo'] | null;
13058
- /** Tools */
13059
- tools: string[] | null;
13060
- /**
13061
- * Turn Id
13062
- * @description Turn containing this record, when applicable.
13063
- */
13064
- turn_id: string | null;
13065
- };
13066
- /**
13067
- * UpdateAgentRequest
13068
- * @description A replacement definition for an agent managed through the API.
13069
- */
13070
- UpdateAgentRequest: {
13071
- /** @description The agent's new definition. Replaces the previous one wholesale — this is not a partial update. */
13072
- agent: components['schemas']['AgentConfig-Input'];
13073
- };
13074
- /**
13075
- * UpdateEnvironmentRequest
13076
- * @description A replacement definition for an environment managed through the API.
13077
- */
13078
- UpdateEnvironmentRequest: {
13079
- /** @description The environment's new definition. Replaces the previous one wholesale — this is not a partial update. */
13080
- environment: components['schemas']['EnvironmentDocument-Input'];
13081
- };
13082
- /** UpdateLinearSettingsRequest */
13083
- UpdateLinearSettingsRequest: {
13084
- /** Teams */
13085
- teams: components['schemas']['LinearTeamUpdate'][];
13086
- };
13087
- /**
13088
- * UpdateSessionRequest
13089
- * @description Set the session's archive state.
13090
- */
13091
- UpdateSessionRequest: {
13092
- /**
13093
- * Archived
13094
- * @description True to archive the session; false to unarchive it.
13095
- */
13096
- archived: boolean;
13097
- };
13098
- /**
13099
- * UsageDay
13100
- * @description One UTC day's cost and tokens.
13101
- */
13102
- UsageDay: {
13103
- /** @description What the day's usage cost. */
13104
- cost: components['schemas']['Cost'];
13105
- /**
13106
- * Date
13107
- * @description The UTC day, formatted yyyy-MM-dd.
13108
- */
13109
- date: string;
13110
- /** @description The tokens used that day. */
13111
- tokens: components['schemas']['Tokens'];
13112
- };
13113
- /**
13114
- * UsageTotals
13115
- * @description Cost and tokens over a set of sessions.
13116
- */
13117
- UsageTotals: {
13118
- /** @description What the sessions cost. */
13119
- cost: components['schemas']['Cost'];
13120
- /** @description The tokens the sessions used. */
13121
- tokens: components['schemas']['Tokens'];
13122
- };
13123
- /** UserPlan */
13124
- UserPlan: {
13125
- /** Collaborators */
13126
- collaborators: number;
13127
- /** Name */
13128
- name: string;
13129
- /** Private Repos */
13130
- private_repos: number;
13131
- /** Space */
13132
- space: number;
13133
- };
13134
- /**
13135
- * UserTokenApi
13136
- * @description A user token as shown in listings -- never includes the secret.
13137
- */
13138
- UserTokenApi: {
13139
- /** Created At */
13140
- created_at: string;
13141
- /** Expires At */
13142
- expires_at: string;
13143
- /** Id */
13144
- id: string;
13145
- /** Last Used At */
13146
- last_used_at: string | null;
13147
- /** Name */
13148
- name: string;
13149
- /** Revoked At */
13150
- revoked_at: string | null;
13151
- };
13152
- /** VM */
13153
- VM: {
13154
- /**
13155
- * Id
13156
- * @description The VM id, shared across session resumes.
13157
- */
13158
- id: string;
13159
- /** @description Most recent execution using this machine; its timestamps and costs describe that execution. */
13160
- latest_execution: components['schemas']['VMExecutionResponse'];
13161
- /**
13162
- * Status
13163
- * @description Last recorded machine state.
12862
+ * Status
12863
+ * @description Last recorded machine state.
13164
12864
  * @enum {string}
13165
12865
  */
13166
12866
  status: 'starting' | 'running' | 'paused' | 'deleting' | 'deleted' | 'failed' | 'unknown';
@@ -17595,8 +17295,8 @@ interface operations {
17595
17295
  author_id?: number | null;
17596
17296
  /** @description "owner/name" (exact) or a bare repo name. Sessions whose repository is named only inside their agent — dashboard starts, cron — do not match. */
17597
17297
  repo?: string | null;
17598
- /** @description Keep only sessions whose current turn is queued, preparing, or running. */
17599
- unfinished?: boolean;
17298
+ /** @description Keep only sessions in these statuses. */
17299
+ status?: components['schemas']['SessionStatus'][] | null;
17600
17300
  };
17601
17301
  header?: {
17602
17302
  'user-agent'?: string | null;
@@ -17732,8 +17432,8 @@ interface operations {
17732
17432
  session_ids?: string[] | null;
17733
17433
  /** @description "owner/name" (exact) or a bare repo name; ORed. */
17734
17434
  repo?: string[] | null;
17735
- /** @description Current turn statuses to keep. */
17736
- status?: components['schemas']['TurnStatus'][] | null;
17435
+ /** @description Keep only sessions in these statuses. */
17436
+ status?: components['schemas']['SessionStatus'][] | null;
17737
17437
  start?: string | null;
17738
17438
  end?: string | null;
17739
17439
  limit?: number;
@@ -18317,6 +18017,8 @@ interface operations {
18317
18017
  query?: {
18318
18018
  cursor?: string | null;
18319
18019
  limit?: number | null;
18020
+ /** @description Keep only the records of this message. */
18021
+ message_id?: string | null;
18320
18022
  };
18321
18023
  header?: {
18322
18024
  'user-agent'?: string | null;
@@ -18424,7 +18126,7 @@ interface operations {
18424
18126
  'application/json': components['schemas']['ErrorResponse'];
18425
18127
  };
18426
18128
  };
18427
- /** @description No turn is queued, preparing, or running. */
18129
+ /** @description The session is idle or closed. */
18428
18130
  409: {
18429
18131
  headers: {
18430
18132
  [name: string]: unknown;
@@ -18568,15 +18270,13 @@ interface operations {
18568
18270
  };
18569
18271
  };
18570
18272
  };
18571
- get_session_turns: {
18273
+ get_slack_help: {
18572
18274
  parameters: {
18573
18275
  query?: never;
18574
18276
  header?: {
18575
18277
  'user-agent'?: string | null;
18576
18278
  };
18577
- path: {
18578
- id: string;
18579
- };
18279
+ path?: never;
18580
18280
  cookie?: never;
18581
18281
  };
18582
18282
  requestBody?: never;
@@ -18587,7 +18287,7 @@ interface operations {
18587
18287
  [name: string]: unknown;
18588
18288
  };
18589
18289
  content: {
18590
- 'application/json': components['schemas']['SessionTurnsListResponse'];
18290
+ 'application/json': components['schemas']['SlackHelpResponse'] | null;
18591
18291
  };
18592
18292
  };
18593
18293
  /** @description The bearer token is missing, invalid, or revoked. */
@@ -18608,132 +18308,13 @@ interface operations {
18608
18308
  'application/json': components['schemas']['ErrorResponse'];
18609
18309
  };
18610
18310
  };
18611
- /** @description No such session in your account. */
18612
- 404: {
18311
+ /** @description Validation Error */
18312
+ 422: {
18613
18313
  headers: {
18614
18314
  [name: string]: unknown;
18615
18315
  };
18616
18316
  content: {
18617
- 'application/json': components['schemas']['ErrorResponse'];
18618
- };
18619
- };
18620
- /** @description Validation Error */
18621
- 422: {
18622
- headers: {
18623
- [name: string]: unknown;
18624
- };
18625
- content: {
18626
- 'application/json': components['schemas']['HTTPValidationError'];
18627
- };
18628
- };
18629
- };
18630
- };
18631
- get_session_turn: {
18632
- parameters: {
18633
- query?: never;
18634
- header?: {
18635
- 'user-agent'?: string | null;
18636
- };
18637
- path: {
18638
- session_id: string;
18639
- id: string;
18640
- };
18641
- cookie?: never;
18642
- };
18643
- requestBody?: never;
18644
- responses: {
18645
- /** @description Successful Response */
18646
- 200: {
18647
- headers: {
18648
- [name: string]: unknown;
18649
- };
18650
- content: {
18651
- 'application/json': components['schemas']['SessionTurnResponse'];
18652
- };
18653
- };
18654
- /** @description The bearer token is missing, invalid, or revoked. */
18655
- 401: {
18656
- headers: {
18657
- [name: string]: unknown;
18658
- };
18659
- content: {
18660
- 'application/json': components['schemas']['ErrorResponse'];
18661
- };
18662
- };
18663
- /** @description The credential may not perform this action, or the account is blocked. */
18664
- 403: {
18665
- headers: {
18666
- [name: string]: unknown;
18667
- };
18668
- content: {
18669
- 'application/json': components['schemas']['ErrorResponse'];
18670
- };
18671
- };
18672
- /** @description No such session or turn in your account. */
18673
- 404: {
18674
- headers: {
18675
- [name: string]: unknown;
18676
- };
18677
- content: {
18678
- 'application/json': components['schemas']['ErrorResponse'];
18679
- };
18680
- };
18681
- /** @description Validation Error */
18682
- 422: {
18683
- headers: {
18684
- [name: string]: unknown;
18685
- };
18686
- content: {
18687
- 'application/json': components['schemas']['HTTPValidationError'];
18688
- };
18689
- };
18690
- };
18691
- };
18692
- get_slack_help: {
18693
- parameters: {
18694
- query?: never;
18695
- header?: {
18696
- 'user-agent'?: string | null;
18697
- };
18698
- path?: never;
18699
- cookie?: never;
18700
- };
18701
- requestBody?: never;
18702
- responses: {
18703
- /** @description Successful Response */
18704
- 200: {
18705
- headers: {
18706
- [name: string]: unknown;
18707
- };
18708
- content: {
18709
- 'application/json': components['schemas']['SlackHelpResponse'] | null;
18710
- };
18711
- };
18712
- /** @description The bearer token is missing, invalid, or revoked. */
18713
- 401: {
18714
- headers: {
18715
- [name: string]: unknown;
18716
- };
18717
- content: {
18718
- 'application/json': components['schemas']['ErrorResponse'];
18719
- };
18720
- };
18721
- /** @description The credential may not perform this action, or the account is blocked. */
18722
- 403: {
18723
- headers: {
18724
- [name: string]: unknown;
18725
- };
18726
- content: {
18727
- 'application/json': components['schemas']['ErrorResponse'];
18728
- };
18729
- };
18730
- /** @description Validation Error */
18731
- 422: {
18732
- headers: {
18733
- [name: string]: unknown;
18734
- };
18735
- content: {
18736
- 'application/json': components['schemas']['HTTPValidationError'];
18317
+ 'application/json': components['schemas']['HTTPValidationError'];
18737
18318
  };
18738
18319
  };
18739
18320
  };
@@ -19877,12 +19458,7 @@ interface operations {
19877
19458
  /**
19878
19459
  * One server-to-client frame of the Ellipsis session stream (WS /v1/sessions/{id}/stream). Clients ignore frames with unknown `type` values.
19879
19460
  */
19880
- type SessionStreamFrame = SnapshotFrame | RecordsAppendFrame | SessionFrame | DeltaFrame | HeartbeatFrame | DoneFrame | ErrorFrame;
19881
- type AttributionType = 'github_user' | 'linear_user' | 'slack_user' | 'api_key';
19882
- /**
19883
- * Delivery status of the message.
19884
- */
19885
- type SessionMessageStatus = 'pending' | 'delivered';
19461
+ type SessionStreamFrame = SessionFrame | RecordsFrame | DeltaFrame | HeartbeatFrame | ErrorFrame;
19886
19462
  /**
19887
19463
  * The session's current state.
19888
19464
  */
@@ -19915,6 +19491,10 @@ type Session = {
19915
19491
  */
19916
19492
  created_at: string;
19917
19493
  environment: SessionEnvironment;
19494
+ /**
19495
+ * Why the last message failed, was stopped, or was cancelled; null otherwise.
19496
+ */
19497
+ error: SessionError | null;
19918
19498
  /**
19919
19499
  * The typed external event that started the session; null for direct and scheduled starts.
19920
19500
  */
@@ -19942,7 +19522,7 @@ type Session = {
19942
19522
  [k: string]: string;
19943
19523
  };
19944
19524
  /**
19945
- * The session's structured output: the `json_schema` the agent must satisfy and, once a turn has submitted it, the `result`.
19525
+ * The session's structured output: the `json_schema` the agent must satisfy and, once the agent has submitted it, the `result`.
19946
19526
  */
19947
19527
  output: SessionOutput | null;
19948
19528
  /**
@@ -19955,15 +19535,12 @@ type Session = {
19955
19535
  */
19956
19536
  skills: SkillRef[];
19957
19537
  source: SessionSource;
19538
+ status: SessionStatus;
19958
19539
  /**
19959
19540
  * The latest live summary of the session's progress while it runs, and when it was generated.
19960
19541
  */
19961
19542
  summary: SessionSummary | null;
19962
19543
  tokens: Tokens;
19963
- /**
19964
- * The turn in progress, or the latest one when none is running. Null until the session has a message. Wait on it: the message you sent is answered when the turn with your message's `turn_id` reaches a final status.
19965
- */
19966
- turn: SessionTurn | null;
19967
19544
  /**
19968
19545
  * When the session was last updated.
19969
19546
  */
@@ -20087,14 +19664,11 @@ type StatusAction = 'pending' | 'passed' | 'failed' | 'errored';
20087
19664
  */
20088
19665
  type WorkflowRunAction = 'requested' | 'queued' | 'waiting' | 'pending' | 'started' | 'passed' | 'failed' | 'timed_out' | 'cancelled' | 'skipped' | 'neutral' | 'action_required' | 'stale' | 'startup_failure';
20089
19666
  type GithubAccountType = 'User' | 'Organization' | 'Bot' | 'Mannequin';
19667
+ type AttributionType = 'github_user' | 'linear_user' | 'slack_user' | 'api_key';
20090
19668
  /**
20091
19669
  * Why direct prompting is refused. Absent when prompting is allowed.
20092
19670
  */
20093
19671
  type PromptBlockedReason = 'mention_surface' | 'non_interactive' | 'harness_single_turn' | 'budget_exhausted' | 'closed';
20094
- /**
20095
- * `open` while the session can take messages; `closed` is permanent.
20096
- */
20097
- type SessionState = 'open' | 'closed';
20098
19672
  /**
20099
19673
  * How a session's environment was chosen. None (the field is nullable)
20100
19674
  * when the config carried an inline environment block and no resolution ran —
@@ -20104,6 +19678,10 @@ type SessionState = 'open' | 'closed';
20104
19678
  * how it was chosen, and is null for the built-in basic environment.
20105
19679
  */
20106
19680
  type EnvironmentSource = 'request' | 'agent' | 'repo_default' | 'account_default' | 'platform_default';
19681
+ /**
19682
+ * What went wrong.
19683
+ */
19684
+ type ErrorReason = 'error' | 'tool_call_failed' | 'budget_hit' | 'payment_required' | 'blocked' | 'contact_email_required' | 'lifecycle_hook_failed' | 'missing_repo_access' | 'missing_token_permissions' | 'missing_environment_variables' | 'missing_github_integration' | 'agent_unavailable' | 'upstream_unavailable' | 'unsupported_configuration' | 'execution_disabled' | 'interrupted' | 'stopped';
20107
19685
  /**
20108
19686
  * The service the handler responds to.
20109
19687
  */
@@ -20113,320 +19691,136 @@ type HandlerService = 'slack' | 'github' | 'linear' | 'sentry';
20113
19691
  */
20114
19692
  type SessionSource = 'react' | 'code_review' | 'web' | 'api' | 'cli' | 'mention' | 'cron';
20115
19693
  /**
20116
- * Why a turn failed or was cancelled. Null on every other outcome.
20117
- */
20118
- type TurnReason = 'error' | 'tool_call_failed' | 'budget_hit' | 'payment_required' | 'blocked' | 'contact_email_required' | 'lifecycle_hook_failed' | 'missing_repo_access' | 'missing_token_permissions' | 'missing_environment_variables' | 'missing_github_integration' | 'agent_unavailable' | 'upstream_unavailable' | 'unsupported_configuration' | 'execution_disabled' | 'interrupted';
20119
- /**
20120
- * Where the turn is.
19694
+ * Where the session is. A message you sent is answered once the status is `idle` or `closed`; its `message_ended` record in GET /v1/sessions/{id}/records says how.
20121
19695
  */
20122
- type TurnStatus = 'queued' | 'preparing' | 'running' | 'completed' | 'failed' | 'stopped' | 'cancelled';
19696
+ type SessionStatus = 'queued' | 'preparing' | 'running' | 'idle' | 'closed';
20123
19697
  type SessionRecord$1 = ClaudeSessionRecord | ClaudeNativeSessionRecord | CodexSessionRecord | CodexAppServerSessionRecord | GeminiSessionRecord | PlatformSessionRecord | UnknownSessionRecord;
20124
19698
  type CodexAppServerNotification = CodexThreadStarted | CodexTurnStarted | CodexTurnCompleted | CodexItemStarted | CodexItemCompleted | CodexTokenUsageUpdated | CodexAppServerError;
20125
- type CodexAppServerItem = CodexUserMessage | CodexAgentMessage | CodexReasoning | CodexPlan | CodexCommandExecution | CodexFileChange | CodexWebSearch | CodexMcpToolCall | CodexContextCompaction;
19699
+ type CodexAppServerItem = CodexUserMessage | CodexAgentMessage | CodexReasoning | CodexPlan | CodexCommandExecution | CodexFileChange | CodexWebSearch | CodexMcpToolCall | CodexContextCompaction | CodexSubAgentActivity | CodexCollabAgentToolCall;
20126
19700
  type CodexUserInput = CodexTextInput | CodexLocalImageInput;
20127
19701
  type GeminiStreamEvent$1 = GeminiInitEvent | GeminiMessageEvent | GeminiToolUseEvent | GeminiToolResultEvent | GeminiErrorEvent | GeminiResultEvent;
20128
- type PlatformSessionRecord = SessionClosedRecord | MessageReceivedRecord | MessageDeliveredRecord | MessageRequeuedRecord | TurnQueuedRecord | TurnStartedRecord | TurnEndedRecord | EnvironmentPhaseRecord | EnvironmentOutputRecord | EnvironmentReadyRecord;
19702
+ type PlatformSessionRecord = SessionClosedRecord | MessageRecord | MessageQueuedRecord | MessageStartedRecord | MessageEndedRecord | MessageRequeuedRecord | EnvironmentPhaseRecord | EnvironmentOutputRecord | EnvironmentReadyRecord;
20129
19703
  /**
20130
- * The session's current state.
19704
+ * The whole session, last writer wins: the first frame after the stream
19705
+ * connects, and resent whole whenever any field changes (status, error,
19706
+ * cost). A `closed` status is the last one; a normal close (1000) follows.
20131
19707
  */
20132
- type Session1 = {
20133
- /**
20134
- * The agent the session was started from, or null for a raw session started with POST /v1/sessions.
20135
- */
20136
- agent: SessionAgent | null;
20137
- /**
20138
- * When and by whom the session was archived; null when unarchived. Archiving does not stop or close a session.
20139
- */
20140
- archived: SessionArchived | null;
20141
- attribution: SessionAttribution;
19708
+ interface SessionFrame {
19709
+ session: Session;
19710
+ type: 'session';
19711
+ }
19712
+ /**
19713
+ * The agent this session was started from: the definition frozen
19714
+ * when the session was created, and the saved agent it came from as it
19715
+ * exists NOW. They diverge legitimately — a YAML edit after the session
19716
+ * started leaves the pointer describing something the session never ran.
19717
+ */
19718
+ interface SessionAgent {
19719
+ config: AgentConfig;
20142
19720
  /**
20143
- * The spend budget enforced for this session, in millicents, after resolving defaults and ceilings.
19721
+ * Identifier of the saved agent this session's snapshot was taken from. Null for a routing-file agent or the built-in mention agent, which have no saved agent behind them. Points at the agent as it exists now, which may have changed since.
20144
19722
  */
20145
- budget: number;
19723
+ id: string | null;
19724
+ }
19725
+ /**
19726
+ * The agent definition the session was started from, frozen when the session was created.
19727
+ */
19728
+ interface AgentConfig {
19729
+ ellipsis: AgentIdentity;
19730
+ input: InputContract | null;
19731
+ session: SessionConfig;
19732
+ trigger: (CronTrigger | ReactTrigger) | null;
19733
+ }
19734
+ /**
19735
+ * The Ellipsis product namespace for a config file: which schema this is
19736
+ * (`version`), the human-facing identity (`name`/`description`), freeform
19737
+ * organizational `metadata`, and whether the agent is `enabled`. The
19738
+ * presence of a top-level `ellipsis:` mapping is what marks a YAML file as
19739
+ * an Ellipsis agent (vs arbitrary YAML that merely lives under a
19740
+ * config directory) — see `yaml_is_ellipsis_config`.
19741
+ *
19742
+ * `enabled` is agent behavior, not freeform metadata, so it stays inside
19743
+ * the config `sha` (only `metadata` is sha-excluded).
19744
+ */
19745
+ interface AgentIdentity {
19746
+ description: string | null;
19747
+ enabled: boolean;
19748
+ kind: 'agent';
19749
+ metadata: ConfigMetadata;
19750
+ name: string | null;
19751
+ version: string;
19752
+ }
19753
+ interface ConfigMetadata {
19754
+ annotations: {
19755
+ [k: string]: string;
19756
+ };
19757
+ labels: string[];
19758
+ }
19759
+ /**
19760
+ * The typed input contract: what goes INTO a session (the trigger is
19761
+ * when it happens; this is what goes in).
19762
+ *
19763
+ * `json_schema` validates customer data sent as `input` to
19764
+ * `POST /v1/agents/{id}/sessions` (the dashboard and the CLI start
19765
+ * through the same door) and stored as `session.input`. An on-demand
19766
+ * start requires input when a schema is declared. A trigger fires
19767
+ * without it: a cron fire has no payload and a react fire carries the
19768
+ * platform-shaped event, so an agent may declare a schema alongside
19769
+ * either trigger and the schema governs only its on-demand starts.
19770
+ *
19771
+ * `message` is the initial-message template: exact `{{path}}` substitution
19772
+ * over the payload the session has (the caller payload on an on-demand
19773
+ * start, the surface's published fields on a react fire, the empty
19774
+ * object on a cron fire), no conditionals/loops/filters. Refs are
19775
+ * validated at deploy time against every governing field set (see
19776
+ * AgentConfig's `_check_input`): the caller schema's paths, the react
19777
+ * surface's published fields, and both when the agent has a react trigger
19778
+ * and a schema, so one template renders fully on either door (declare the
19779
+ * surface's field names in the schema). Omit `message` to let each door
19780
+ * render its default. An unresolved ref renders as the empty string (a
19781
+ * cron fire, an optional field the payload omitted).
19782
+ */
19783
+ interface InputContract {
19784
+ json_schema: {
19785
+ [k: string]: unknown;
19786
+ } | null;
19787
+ message: string | null;
19788
+ }
19789
+ /**
19790
+ * A saved agent's spend limits: the per-session cap plus its total spend
19791
+ * over the trailing 1, 7, and 28 days.
19792
+ */
19793
+ interface BudgetConfig {
20146
19794
  /**
20147
- * Claude Code input and native options. Set exactly one of claude_code, codex, or gemini.
19795
+ * The most the agent may spend over the last day, in US dollars.
20148
19796
  */
20149
- claude_code: ClaudeConfig | null;
19797
+ day: number | null;
20150
19798
  /**
20151
- * Codex input and native options. Set exactly one of claude_code, codex, or gemini.
19799
+ * The most the agent may spend over the last 28 days, in US dollars.
20152
19800
  */
20153
- codex: CodexConfig | null;
20154
- conversation: SessionConversation;
20155
- cost: Cost;
19801
+ month: number | null;
20156
19802
  /**
20157
- * When the session was created.
19803
+ * The most one session may spend, in US dollars.
20158
19804
  */
20159
- created_at: string;
20160
- environment: SessionEnvironment;
19805
+ session: number | null;
20161
19806
  /**
20162
- * The typed external event that started the session; null for direct and scheduled starts.
19807
+ * The most the agent may spend over the last 7 days, in US dollars.
20163
19808
  */
20164
- event: (GithubPullRequestEvent | GithubIssueEvent | GithubPushEvent | GithubCheckRunEvent | GithubCheckSuiteEvent | GithubWorkflowRunEvent | GithubStatusEvent | GithubReleaseEvent | LinearIssueEvent | SlackMessageEvent | SlackChannelCreatedEvent | SentryAlertEvent) | null;
19809
+ week: number | null;
19810
+ }
19811
+ /**
19812
+ * Native Claude Code options for an explicitly selected harness.
19813
+ */
19814
+ interface ClaudeConfig {
19815
+ effort: EffortLevel | null;
19816
+ fallback_model: string | null;
19817
+ max_turns: number | null;
20165
19818
  /**
20166
- * Gemini CLI input and native options. Set exactly one of claude_code, codex, or gemini.
19819
+ * The model the session runs on: an alias or canonical id from the models table. Required.
20167
19820
  */
20168
- gemini: GeminiConfig | null;
19821
+ model: string;
20169
19822
  /**
20170
- * 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.
20171
- */
20172
- git: SessionGit | null;
20173
- /**
20174
- * The saved handler and its effective display name when this session started, frozen at creation. Null for built-in responders, legacy sessions, and sessions started without a handler.
20175
- */
20176
- handler: SessionHandler | null;
20177
- /**
20178
- * Unique identifier of the session.
20179
- */
20180
- id: string;
20181
- /**
20182
- * Caller-supplied metadata key-value pairs.
20183
- */
20184
- metadata: {
20185
- [k: string]: string;
20186
- };
20187
- /**
20188
- * The session's structured output: the `json_schema` the agent must satisfy and, once a turn has submitted it, the `result`.
20189
- */
20190
- output: SessionOutput | null;
20191
- /**
20192
- * The predecessor session this session continues; null when there is none.
20193
- */
20194
- parent: SessionParent | null;
20195
- permissions: PermissionsConfig1;
20196
- /**
20197
- * Skills installed for this session.
20198
- */
20199
- skills: SkillRef[];
20200
- source: SessionSource;
20201
- /**
20202
- * The latest live summary of the session's progress while it runs, and when it was generated.
20203
- */
20204
- summary: SessionSummary | null;
20205
- tokens: Tokens;
20206
- /**
20207
- * The turn in progress, or the latest one when none is running. Null until the session has a message. Wait on it: the message you sent is answered when the turn with your message's `turn_id` reaches a final status.
20208
- */
20209
- turn: SessionTurn | null;
20210
- /**
20211
- * When the session was last updated.
20212
- */
20213
- updated_at: string;
20214
- } & ({
20215
- claude_code: {
20216
- [k: string]: unknown;
20217
- };
20218
- codex: null;
20219
- gemini: null;
20220
- } | {
20221
- claude_code: null;
20222
- codex: {
20223
- [k: string]: unknown;
20224
- };
20225
- gemini: null;
20226
- } | {
20227
- claude_code: null;
20228
- codex: null;
20229
- gemini: {
20230
- [k: string]: unknown;
20231
- };
20232
- });
20233
- /**
20234
- * The first frame after the stream connects: the session plus its open
20235
- * inbox. Records always arrive separately via records_append frames.
20236
- */
20237
- interface SnapshotFrame {
20238
- /**
20239
- * The retention head: the lowest feed_seq still stored for this session, or null when it has no stored records. A client resuming from after_seq < earliest_feed_seq - 1 knows history is truncated.
20240
- */
20241
- earliest_feed_seq: number | null;
20242
- /**
20243
- * The session's open (pending) inbox messages.
20244
- */
20245
- messages: SessionMessage[];
20246
- session: Session;
20247
- type: 'snapshot';
20248
- }
20249
- /**
20250
- * One message in a session's inbox: what a queued message renders and
20251
- * retires on. The webhook provenance internals stay off the wire.
20252
- */
20253
- interface SessionMessage {
20254
- /**
20255
- * Display attribution of the message's sender.
20256
- */
20257
- author: string | null;
20258
- /**
20259
- * The message text, with one `[Image #N]` placeholder per attached image.
20260
- */
20261
- body: string;
20262
- /**
20263
- * When the message was created.
20264
- */
20265
- created_at: string;
20266
- /**
20267
- * When the message was delivered to the agent, if it has been.
20268
- */
20269
- delivered_at: string | null;
20270
- /**
20271
- * Where the message sits in the session's feed — placement metadata only, NOT a resume cursor (only records_append frames advance the cursor). Null for older rows.
20272
- */
20273
- feed_seq: number | null;
20274
- /**
20275
- * Unique identifier of the message.
20276
- */
20277
- id: string;
20278
- /**
20279
- * Images attached to the message, metadata only: index, media type, size. The bytes go to the model, never over the stream.
20280
- */
20281
- images: SessionMessageImage[];
20282
- /**
20283
- * Identifier of the principal that sent the message, if attributed.
20284
- */
20285
- sender_attribution_id: string | null;
20286
- /**
20287
- * Kind of principal that sent the message, if attributed.
20288
- */
20289
- sender_attribution_type: AttributionType | null;
20290
- /**
20291
- * Identifier of the session the message belongs to.
20292
- */
20293
- session_id: string;
20294
- status: SessionMessageStatus;
20295
- /**
20296
- * The turn created to answer this message. Wait on it: the message is answered when that turn reaches a final status.
20297
- */
20298
- turn_id: string | null;
20299
- }
20300
- /**
20301
- * One image on a message, metadata only. `index` is the N in the
20302
- * `[Image #N]` placeholder in the message body.
20303
- */
20304
- interface SessionMessageImage {
20305
- /**
20306
- * 1-based position: the N in `[Image #N]`.
20307
- */
20308
- index: number;
20309
- /**
20310
- * The image's MIME type.
20311
- */
20312
- media_type: string;
20313
- /**
20314
- * Size of the decoded image, in bytes.
20315
- */
20316
- size_bytes: number;
20317
- }
20318
- /**
20319
- * The agent this session was started from: the definition frozen
20320
- * when the session was created, and the saved agent it came from as it
20321
- * exists NOW. They diverge legitimately — a YAML edit after the session
20322
- * started leaves the pointer describing something the session never ran.
20323
- */
20324
- interface SessionAgent {
20325
- config: AgentConfig;
20326
- /**
20327
- * Identifier of the saved agent this session's snapshot was taken from. Null for a routing-file agent or the built-in mention agent, which have no saved agent behind them. Points at the agent as it exists now, which may have changed since.
20328
- */
20329
- id: string | null;
20330
- }
20331
- /**
20332
- * The agent definition the session was started from, frozen when the session was created.
20333
- */
20334
- interface AgentConfig {
20335
- ellipsis: AgentIdentity;
20336
- input: InputContract | null;
20337
- session: SessionConfig;
20338
- trigger: (CronTrigger | ReactTrigger) | null;
20339
- }
20340
- /**
20341
- * The Ellipsis product namespace for a config file: which schema this is
20342
- * (`version`), the human-facing identity (`name`/`description`), freeform
20343
- * organizational `metadata`, and whether the agent is `enabled`. The
20344
- * presence of a top-level `ellipsis:` mapping is what marks a YAML file as
20345
- * an Ellipsis agent (vs arbitrary YAML that merely lives under a
20346
- * config directory) — see `yaml_is_ellipsis_config`.
20347
- *
20348
- * `enabled` is agent behavior, not freeform metadata, so it stays inside
20349
- * the config `sha` (only `metadata` is sha-excluded).
20350
- */
20351
- interface AgentIdentity {
20352
- description: string | null;
20353
- enabled: boolean;
20354
- kind: 'agent';
20355
- metadata: ConfigMetadata;
20356
- name: string | null;
20357
- version: string;
20358
- }
20359
- interface ConfigMetadata {
20360
- annotations: {
20361
- [k: string]: string;
20362
- };
20363
- labels: string[];
20364
- }
20365
- /**
20366
- * The typed input contract: what goes INTO a session (the trigger is
20367
- * when it happens; this is what goes in).
20368
- *
20369
- * `json_schema` validates customer data sent as `input` to
20370
- * `POST /v1/agents/{id}/sessions` (the dashboard and the CLI start
20371
- * through the same door) and stored as `session.input`. An on-demand
20372
- * start requires input when a schema is declared. A trigger fires
20373
- * without it: a cron fire has no payload and a react fire carries the
20374
- * platform-shaped event, so an agent may declare a schema alongside
20375
- * either trigger and the schema governs only its on-demand starts.
20376
- *
20377
- * `message` is the initial-message template: exact `{{path}}` substitution
20378
- * over the payload the session has (the caller payload on an on-demand
20379
- * start, the surface's published fields on a react fire, the empty
20380
- * object on a cron fire), no conditionals/loops/filters. Refs are
20381
- * validated at deploy time against every governing field set (see
20382
- * AgentConfig's `_check_input`): the caller schema's paths, the react
20383
- * surface's published fields, and both when the agent has a react trigger
20384
- * and a schema, so one template renders fully on either door (declare the
20385
- * surface's field names in the schema). Omit `message` to let each door
20386
- * render its default. An unresolved ref renders as the empty string (a
20387
- * cron fire, an optional field the payload omitted).
20388
- */
20389
- interface InputContract {
20390
- json_schema: {
20391
- [k: string]: unknown;
20392
- } | null;
20393
- message: string | null;
20394
- }
20395
- /**
20396
- * A saved agent's spend limits: the per-session cap plus its total spend
20397
- * over the trailing 1, 7, and 28 days.
20398
- */
20399
- interface BudgetConfig {
20400
- /**
20401
- * The most the agent may spend over the last day, in US dollars.
20402
- */
20403
- day: number | null;
20404
- /**
20405
- * The most the agent may spend over the last 28 days, in US dollars.
20406
- */
20407
- month: number | null;
20408
- /**
20409
- * The most one session may spend, in US dollars.
20410
- */
20411
- session: number | null;
20412
- /**
20413
- * The most the agent may spend over the last 7 days, in US dollars.
20414
- */
20415
- week: number | null;
20416
- }
20417
- /**
20418
- * Native Claude Code options for an explicitly selected harness.
20419
- */
20420
- interface ClaudeConfig {
20421
- effort: EffortLevel | null;
20422
- fallback_model: string | null;
20423
- max_turns: number | null;
20424
- /**
20425
- * The model the session runs on: an alias or canonical id from the models table. Required.
20426
- */
20427
- model: string;
20428
- /**
20429
- * The initial user message, passed verbatim. Omit to start an interactive session with no turn, waiting for a message.
19823
+ * The initial user message, passed verbatim. Omit to start an interactive session with no message, waiting for one.
20430
19824
  */
20431
19825
  prompt: string | null;
20432
19826
  settings: SettingsRef | null;
@@ -20451,7 +19845,7 @@ interface RepositoryRef {
20451
19845
  */
20452
19846
  interface CodexConfig {
20453
19847
  /**
20454
- * Reasoning effort for every turn. Omit to use the model default.
19848
+ * Reasoning effort for every message. Omit to use the model default.
20455
19849
  */
20456
19850
  effort: CodexEffortLevel | null;
20457
19851
  /**
@@ -20459,7 +19853,7 @@ interface CodexConfig {
20459
19853
  */
20460
19854
  model: string;
20461
19855
  /**
20462
- * The initial user message, passed verbatim. Omit to start an interactive session with no turn, waiting for a message.
19856
+ * The initial user message, passed verbatim. Omit to start an interactive session with no message, waiting for one.
20463
19857
  */
20464
19858
  prompt: string | null;
20465
19859
  }
@@ -20468,7 +19862,7 @@ interface CodexConfig {
20468
19862
  */
20469
19863
  interface SessionConversationConfig {
20470
19864
  /**
20471
- * Whether the session stays open after its first turn. Defaults to true; false runs once and requires a prompt. Requires the model's interactive capability when true. Direct message acceptance is reported separately in conversation.prompting.
19865
+ * Whether the session stays open after its first message is answered. Defaults to true; false runs once and requires a prompt. Requires the model's interactive capability when true. Direct message acceptance is reported separately in conversation.prompting.
20472
19866
  */
20473
19867
  interactive: boolean;
20474
19868
  }
@@ -20662,7 +20056,7 @@ interface GeminiConfig {
20662
20056
  */
20663
20057
  model: string;
20664
20058
  /**
20665
- * The initial user message, passed verbatim. Omit to start an interactive session with no turn, waiting for a message.
20059
+ * The initial user message, passed verbatim. Omit to start an interactive session with no message, waiting for one.
20666
20060
  */
20667
20061
  prompt: string | null;
20668
20062
  }
@@ -20939,11 +20333,10 @@ interface SessionAttribution {
20939
20333
  */
20940
20334
  interface SessionConversation {
20941
20335
  /**
20942
- * Whether the session stays open after its first turn.
20336
+ * Whether the session stays open after its first message is answered.
20943
20337
  */
20944
20338
  interactive: boolean;
20945
20339
  prompting: SessionPrompting;
20946
- state: SessionState;
20947
20340
  /**
20948
20341
  * Whether an agent is ready to answer the next message right away. When false, the next message first prepares an environment, which takes longer. A hint only; clients need no logic on it.
20949
20342
  */
@@ -20959,7 +20352,7 @@ interface SessionPrompting {
20959
20352
  surface_name: string | null;
20960
20353
  }
20961
20354
  /**
20962
- * What the session has cost so far.
20355
+ * What something cost, in millicents.
20963
20356
  */
20964
20357
  interface Cost {
20965
20358
  /**
@@ -21121,6 +20514,17 @@ interface EnvironmentHooks1 {
21121
20514
  */
21122
20515
  validate: EnvironmentScript | string | null;
21123
20516
  }
20517
+ /**
20518
+ * Why the last message failed, was stopped, or was cancelled. Cleared
20519
+ * when the next message starts.
20520
+ */
20521
+ interface SessionError {
20522
+ /**
20523
+ * A human-readable explanation.
20524
+ */
20525
+ detail: string | null;
20526
+ reason: ErrorReason;
20527
+ }
21124
20528
  interface GithubPullRequestEvent {
21125
20529
  action: PullRequestAction | 'review_commented';
21126
20530
  actor: SessionEventActor | null;
@@ -21326,9 +20730,9 @@ interface SessionHandler {
21326
20730
  sha: string;
21327
20731
  }
21328
20732
  /**
21329
- * Structured output on the wire: the contract and, when a turn has
20733
+ * Structured output on the wire: the contract and, when the agent has
21330
20734
  * submitted one, the payload. `result` is None while the session runs and
21331
- * when no turn submitted anything; it is the agent's own JSON, in the
20735
+ * when the agent submitted nothing; it is the agent's own JSON, in the
21332
20736
  * shape of `json_schema`.
21333
20737
  */
21334
20738
  interface SessionOutput {
@@ -21339,7 +20743,7 @@ interface SessionOutput {
21339
20743
  [k: string]: unknown;
21340
20744
  };
21341
20745
  /**
21342
- * The payload the agent submitted, or null until a turn submits one.
20746
+ * The payload the agent submitted, or null until it submits one.
21343
20747
  */
21344
20748
  result: {
21345
20749
  [k: string]: unknown;
@@ -21376,7 +20780,7 @@ interface SessionSummary {
21376
20780
  description: string;
21377
20781
  }
21378
20782
  /**
21379
- * The tokens the session has used so far.
20783
+ * Tokens used, in total and by model.
21380
20784
  */
21381
20785
  interface Tokens {
21382
20786
  all: TokenCounts;
@@ -21396,152 +20800,60 @@ interface TokenCounts {
21396
20800
  /**
21397
20801
  * Tokens read from the prompt cache.
21398
20802
  */
21399
- cache_read: number;
21400
- /**
21401
- * Input tokens used.
21402
- */
21403
- input: number;
21404
- /**
21405
- * Output tokens used.
21406
- */
21407
- output: number;
21408
- /**
21409
- * All tokens used, including prompt cache reads and writes. Token cost is priced on this.
21410
- */
21411
- total: number;
21412
- }
21413
- /**
21414
- * Token counts for one model.
21415
- */
21416
- interface ModelTokenCounts {
21417
- /**
21418
- * Tokens written to the prompt cache.
21419
- */
21420
- cache_creation: number;
21421
- /**
21422
- * Tokens read from the prompt cache.
21423
- */
21424
- cache_read: number;
21425
- /**
21426
- * Input tokens used.
21427
- */
21428
- input: number;
21429
- /**
21430
- * The model that used these tokens.
21431
- */
21432
- model: string;
21433
- /**
21434
- * Output tokens used.
21435
- */
21436
- output: number;
21437
- /**
21438
- * All tokens used, including prompt cache reads and writes. Token cost is priced on this.
21439
- */
21440
- total: number;
21441
- }
21442
- /**
21443
- * One message and the agent's answer to it. A turn is `queued` from the
21444
- * moment its message is received, `preparing` while its environment is set
21445
- * up, `running` while the agent works, then `completed`, `failed`,
21446
- * `stopped`, or `cancelled`.
21447
- */
21448
- interface SessionTurn {
21449
- cost: Cost1;
21450
- /**
21451
- * When the turn's message was received.
21452
- */
21453
- created_at: string;
21454
- /**
21455
- * A human-readable explanation of a failed, stopped, or cancelled turn, or of why a queued turn waits.
21456
- */
21457
- detail: string | null;
21458
- /**
21459
- * When the turn reached its final status.
21460
- */
21461
- ended_at: string | null;
21462
- /**
21463
- * Unique identifier of the turn.
21464
- */
21465
- id: string;
21466
- /**
21467
- * Position in the session, starting at 0.
21468
- */
21469
- index: number;
21470
- /**
21471
- * Why the turn failed or was cancelled; null on every other status.
21472
- */
21473
- reason: TurnReason | null;
21474
- /**
21475
- * When the agent started on the message.
21476
- */
21477
- started_at: string | null;
21478
- status: TurnStatus;
21479
- /**
21480
- * When and by whom a stop was requested; null when none was.
21481
- */
21482
- stopped: SessionStopped | null;
21483
- tokens: Tokens1;
21484
- }
21485
- /**
21486
- * What the turn cost so far, in millicents, broken down by leg.
21487
- */
21488
- interface Cost1 {
21489
- /**
21490
- * What Ellipsis charged to credit, in millicents. It is everything except subscription tokens.
21491
- */
21492
- charged: number;
21493
- /**
21494
- * CPU spend in millicents.
21495
- */
21496
- cpu: number;
20803
+ cache_read: number;
21497
20804
  /**
21498
- * Platform fee in millicents.
20805
+ * Input tokens used.
21499
20806
  */
21500
- fee: number;
21501
- llm: LlmCost;
20807
+ input: number;
21502
20808
  /**
21503
- * Memory spend in millicents.
20809
+ * Output tokens used.
21504
20810
  */
21505
- memory: number;
20811
+ output: number;
21506
20812
  /**
21507
- * Everything it cost, whoever paid, in millicents. It is the sum of llm.all.total, cpu, memory, and fee, and it is what the budget caps.
20813
+ * All tokens used, including prompt cache reads and writes. Token cost is priced on this.
21508
20814
  */
21509
20815
  total: number;
21510
20816
  }
21511
20817
  /**
21512
- * When a stop was requested and the GitHub user who requested it.
20818
+ * Token counts for one model.
21513
20819
  */
21514
- interface SessionStopped {
20820
+ interface ModelTokenCounts {
21515
20821
  /**
21516
- * When a stop was requested.
20822
+ * Tokens written to the prompt cache.
21517
20823
  */
21518
- at: string;
20824
+ cache_creation: number;
21519
20825
  /**
21520
- * The GitHub user who stopped the session, resolved at read time. Null if the user is unknown or unavailable.
20826
+ * Tokens read from the prompt cache.
21521
20827
  */
21522
- by: GithubAccountSnippet | null;
21523
- }
21524
- /**
21525
- * The tokens the turn spent and the model they went to.
21526
- */
21527
- interface Tokens1 {
21528
- all: TokenCounts;
20828
+ cache_read: number;
21529
20829
  /**
21530
- * Token counts for each model that used tokens.
20830
+ * Input tokens used.
21531
20831
  */
21532
- by_model: ModelTokenCounts[];
20832
+ input: number;
20833
+ /**
20834
+ * The model that used these tokens.
20835
+ */
20836
+ model: string;
20837
+ /**
20838
+ * Output tokens used.
20839
+ */
20840
+ output: number;
20841
+ /**
20842
+ * All tokens used, including prompt cache reads and writes. Token cost is priced on this.
20843
+ */
20844
+ total: number;
21533
20845
  }
21534
20846
  /**
21535
20847
  * Cursored append-only delivery of session records, ordered by feed_seq,
21536
- * from all sources. Every record in the frame advances the resume cursor —
20848
+ * from all sources. Every record in the frame advances the resume cursor,
21537
20849
  * including ones a client renders as nothing.
21538
20850
  */
21539
- interface RecordsAppendFrame {
20851
+ interface RecordsFrame {
21540
20852
  /**
21541
20853
  * New session records, ordered by feed_seq.
21542
20854
  */
21543
20855
  records: SessionRecord$1[];
21544
- type: 'records_append';
20856
+ type: 'records';
21545
20857
  }
21546
20858
  /**
21547
20859
  * Historical Claude SDK projection, retained for existing session history.
@@ -21559,6 +20871,10 @@ interface ClaudeSessionRecord {
21559
20871
  */
21560
20872
  id: string;
21561
20873
  kind: 'claude_sdk';
20874
+ /**
20875
+ * The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
20876
+ */
20877
+ message_id: string | null;
21562
20878
  model: string | null;
21563
20879
  payload: LegacyAssistantPayload | SdkUserRecord$1 | SdkSystemRecord$1 | LegacyResultPayload | SdkRateLimitRecord$1;
21564
20880
  record_format: 'claude_sdk@1';
@@ -21570,17 +20886,9 @@ interface ClaudeSessionRecord {
21570
20886
  * Session containing this record.
21571
20887
  */
21572
20888
  session_id: string;
21573
- /**
21574
- * Message this record receives, delivers, requeues, or echoes.
21575
- */
21576
- session_message_id: string | null;
21577
20889
  source: 'claude_code';
21578
20890
  tokens_info: TokensInfo | null;
21579
20891
  tools: string[] | null;
21580
- /**
21581
- * Turn containing this record, when applicable.
21582
- */
21583
- turn_id: string | null;
21584
20892
  }
21585
20893
  interface LegacyAssistantPayload {
21586
20894
  cache_creation?: SdkCacheCreation | null;
@@ -21757,6 +21065,10 @@ interface ClaudeNativeSessionRecord {
21757
21065
  */
21758
21066
  id: string;
21759
21067
  kind: 'claude_code';
21068
+ /**
21069
+ * The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
21070
+ */
21071
+ message_id: string | null;
21760
21072
  model: string | null;
21761
21073
  payload: ClaudeAssistantEvent | ClaudeUserEvent | ClaudeSystemEvent | ClaudeResultEvent | ClaudeRateLimitEvent | ClaudeConversationResetEvent;
21762
21074
  record_format: 'claude_jsonl@1';
@@ -21768,17 +21080,9 @@ interface ClaudeNativeSessionRecord {
21768
21080
  * Session containing this record.
21769
21081
  */
21770
21082
  session_id: string;
21771
- /**
21772
- * Message this record receives, delivers, requeues, or echoes.
21773
- */
21774
- session_message_id: string | null;
21775
21083
  source: 'claude_code';
21776
21084
  tokens_info: TokensInfo | null;
21777
21085
  tools: string[] | null;
21778
- /**
21779
- * Turn containing this record, when applicable.
21780
- */
21781
- turn_id: string | null;
21782
21086
  }
21783
21087
  interface ClaudeAssistantEvent {
21784
21088
  error?: string | null;
@@ -21890,6 +21194,10 @@ interface CodexSessionRecord {
21890
21194
  */
21891
21195
  id: string;
21892
21196
  kind: 'codex';
21197
+ /**
21198
+ * The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
21199
+ */
21200
+ message_id: string | null;
21893
21201
  model: string | null;
21894
21202
  payload: CodexThreadStartedEvent | CodexTurnStartedEvent | CodexTurnCompletedEvent | CodexTurnFailedEvent | CodexErrorEvent | CodexItemStartedEvent | CodexItemUpdatedEvent | CodexItemCompletedEvent;
21895
21203
  record_format: 'codex_jsonl@1';
@@ -21901,17 +21209,9 @@ interface CodexSessionRecord {
21901
21209
  * Session containing this record.
21902
21210
  */
21903
21211
  session_id: string;
21904
- /**
21905
- * Message this record receives, delivers, requeues, or echoes.
21906
- */
21907
- session_message_id: string | null;
21908
21212
  source: 'codex';
21909
21213
  tokens_info: TokensInfo | null;
21910
21214
  tools: string[] | null;
21911
- /**
21912
- * Turn containing this record, when applicable.
21913
- */
21914
- turn_id: string | null;
21915
21215
  }
21916
21216
  interface CodexThreadStartedEvent {
21917
21217
  thread_id?: string | null;
@@ -22046,6 +21346,10 @@ interface CodexAppServerSessionRecord {
22046
21346
  */
22047
21347
  id: string;
22048
21348
  kind: 'codex_app_server';
21349
+ /**
21350
+ * The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
21351
+ */
21352
+ message_id: string | null;
22049
21353
  model: string | null;
22050
21354
  payload: CodexAppServerNotification;
22051
21355
  record_format: 'codex_app_server@1';
@@ -22057,17 +21361,9 @@ interface CodexAppServerSessionRecord {
22057
21361
  * Session containing this record.
22058
21362
  */
22059
21363
  session_id: string;
22060
- /**
22061
- * Message this record receives, delivers, requeues, or echoes.
22062
- */
22063
- session_message_id: string | null;
22064
21364
  source: 'codex';
22065
21365
  tokens_info: TokensInfo | null;
22066
21366
  tools: string[] | null;
22067
- /**
22068
- * Turn containing this record, when applicable.
22069
- */
22070
- turn_id: string | null;
22071
21367
  }
22072
21368
  interface CodexThreadStarted {
22073
21369
  method: 'thread/started';
@@ -22223,6 +21519,27 @@ interface CodexContextCompaction {
22223
21519
  type: 'contextCompaction';
22224
21520
  [k: string]: unknown;
22225
21521
  }
21522
+ /**
21523
+ * A subagent's spawn or completion, recorded on the spawning thread.
21524
+ */
21525
+ interface CodexSubAgentActivity {
21526
+ agentPath?: string | null;
21527
+ agentThreadId: string;
21528
+ id: string;
21529
+ kind: string;
21530
+ type: 'subAgentActivity';
21531
+ [k: string]: unknown;
21532
+ }
21533
+ interface CodexCollabAgentToolCall {
21534
+ id: string;
21535
+ prompt?: string | null;
21536
+ receiverThreadIds: string[];
21537
+ senderThreadId: string;
21538
+ status: 'inProgress' | 'completed' | 'failed';
21539
+ tool: string;
21540
+ type: 'collabAgentToolCall';
21541
+ [k: string]: unknown;
21542
+ }
22226
21543
  interface CodexTurnStarted {
22227
21544
  method: 'turn/started';
22228
21545
  params: CodexTurnParams;
@@ -22305,6 +21622,10 @@ interface GeminiSessionRecord {
22305
21622
  */
22306
21623
  id: string;
22307
21624
  kind: 'gemini';
21625
+ /**
21626
+ * The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
21627
+ */
21628
+ message_id: string | null;
22308
21629
  model: string | null;
22309
21630
  payload: GeminiStreamEvent$1;
22310
21631
  record_format: 'gemini_stream_json@1';
@@ -22316,17 +21637,9 @@ interface GeminiSessionRecord {
22316
21637
  * Session containing this record.
22317
21638
  */
22318
21639
  session_id: string;
22319
- /**
22320
- * Message this record receives, delivers, requeues, or echoes.
22321
- */
22322
- session_message_id: string | null;
22323
21640
  source: 'gemini';
22324
21641
  tokens_info: TokensInfo | null;
22325
21642
  tools: string[] | null;
22326
- /**
22327
- * Turn containing this record, when applicable.
22328
- */
22329
- turn_id: string | null;
22330
21643
  }
22331
21644
  interface GeminiInitEvent {
22332
21645
  model: string;
@@ -22416,6 +21729,10 @@ interface SessionClosedRecord {
22416
21729
  */
22417
21730
  id: string;
22418
21731
  kind: 'platform';
21732
+ /**
21733
+ * The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
21734
+ */
21735
+ message_id: string | null;
22419
21736
  model: string | null;
22420
21737
  payload: SessionClosedPayload;
22421
21738
  record_format: 'ellipsis_lifecycle@1';
@@ -22424,25 +21741,17 @@ interface SessionClosedRecord {
22424
21741
  * Session containing this record.
22425
21742
  */
22426
21743
  session_id: string;
22427
- /**
22428
- * Message this record receives, delivers, requeues, or echoes.
22429
- */
22430
- session_message_id: string | null;
22431
21744
  source: 'lifecycle';
22432
21745
  tokens_info: TokensInfo | null;
22433
21746
  tools: string[] | null;
22434
- /**
22435
- * Turn containing this record, when applicable.
22436
- */
22437
- turn_id: string | null;
22438
21747
  }
22439
21748
  /**
22440
- * session_closed: the conversation closed permanently.
21749
+ * session_closed: the session closed permanently.
22441
21750
  */
22442
21751
  interface SessionClosedPayload {
22443
21752
  [k: string]: unknown;
22444
21753
  }
22445
- interface MessageReceivedRecord {
21754
+ interface MessageRecord {
22446
21755
  cost: number | null;
22447
21756
  created_at: string;
22448
21757
  duration: number | null;
@@ -22455,41 +21764,74 @@ interface MessageReceivedRecord {
22455
21764
  */
22456
21765
  id: string;
22457
21766
  kind: 'platform';
21767
+ /**
21768
+ * The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
21769
+ */
21770
+ message_id: string | null;
22458
21771
  model: string | null;
22459
- payload: MessageReceivedPayload;
21772
+ payload: SessionMessage;
22460
21773
  record_format: 'ellipsis_lifecycle@1';
22461
- record_type: 'message_received';
21774
+ record_type: 'message';
22462
21775
  /**
22463
21776
  * Session containing this record.
22464
21777
  */
22465
21778
  session_id: string;
22466
- /**
22467
- * Message this record receives, delivers, requeues, or echoes.
22468
- */
22469
- session_message_id: string | null;
22470
21779
  source: 'lifecycle';
22471
21780
  tokens_info: TokensInfo | null;
22472
21781
  tools: string[] | null;
21782
+ }
21783
+ /**
21784
+ * One message sent to a session.
21785
+ */
21786
+ interface SessionMessage {
21787
+ /**
21788
+ * Display attribution of the message's sender.
21789
+ */
21790
+ author: string | null;
21791
+ /**
21792
+ * The message text, with one `[Image #N]` placeholder per attached image.
21793
+ */
21794
+ body: string;
21795
+ /**
21796
+ * When the message was received.
21797
+ */
21798
+ created_at: string;
21799
+ /**
21800
+ * Unique identifier of the message.
21801
+ */
21802
+ id: string;
22473
21803
  /**
22474
- * Turn containing this record, when applicable.
21804
+ * Images attached to the message, metadata only: index, media type, size. The bytes go to the model, never over the stream.
21805
+ */
21806
+ images: SessionMessageImage[];
21807
+ /**
21808
+ * Position in the session, starting at 0.
21809
+ */
21810
+ index: number;
21811
+ /**
21812
+ * Identifier of the session the message belongs to.
22475
21813
  */
22476
- turn_id: string | null;
21814
+ session_id: string;
22477
21815
  }
22478
21816
  /**
22479
- * message_received: a message landed in the session inbox and its turn was
22480
- * created. `turn_id` is the turn that will answer it.
21817
+ * One image on a message, metadata only. `index` is the N in the
21818
+ * `[Image #N]` placeholder in the message body.
22481
21819
  */
22482
- interface MessageReceivedPayload {
22483
- author?: string | null;
22484
- body: string;
22485
- closes_session?: boolean;
22486
- message_id: string;
22487
- sender_attribution_id?: string | null;
22488
- sender_attribution_type?: string | null;
22489
- turn_id?: string | null;
22490
- [k: string]: unknown;
21820
+ interface SessionMessageImage {
21821
+ /**
21822
+ * 1-based position: the N in `[Image #N]`.
21823
+ */
21824
+ index: number;
21825
+ /**
21826
+ * The image's MIME type.
21827
+ */
21828
+ media_type: string;
21829
+ /**
21830
+ * Size of the decoded image, in bytes.
21831
+ */
21832
+ size_bytes: number;
22491
21833
  }
22492
- interface MessageDeliveredRecord {
21834
+ interface MessageQueuedRecord {
22493
21835
  cost: number | null;
22494
21836
  created_at: string;
22495
21837
  duration: number | null;
@@ -22502,35 +21844,33 @@ interface MessageDeliveredRecord {
22502
21844
  */
22503
21845
  id: string;
22504
21846
  kind: 'platform';
21847
+ /**
21848
+ * The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
21849
+ */
21850
+ message_id: string | null;
22505
21851
  model: string | null;
22506
- payload: MessageDeliveredPayload;
21852
+ payload: MessageQueuedPayload;
22507
21853
  record_format: 'ellipsis_lifecycle@1';
22508
- record_type: 'message_delivered';
21854
+ record_type: 'message_queued';
22509
21855
  /**
22510
21856
  * Session containing this record.
22511
21857
  */
22512
21858
  session_id: string;
22513
- /**
22514
- * Message this record receives, delivers, requeues, or echoes.
22515
- */
22516
- session_message_id: string | null;
22517
21859
  source: 'lifecycle';
22518
21860
  tokens_info: TokensInfo | null;
22519
21861
  tools: string[] | null;
22520
- /**
22521
- * Turn containing this record, when applicable.
22522
- */
22523
- turn_id: string | null;
22524
21862
  }
22525
21863
  /**
22526
- * message_delivered: the agent started on the message.
21864
+ * message_queued: the message waits because the account already has
21865
+ * `sessions_alive` sessions alive, its limit.
22527
21866
  */
22528
- interface MessageDeliveredPayload {
21867
+ interface MessageQueuedPayload {
21868
+ limit: number;
22529
21869
  message_id: string;
22530
- turn_id: string;
21870
+ sessions_alive: number;
22531
21871
  [k: string]: unknown;
22532
21872
  }
22533
- interface MessageRequeuedRecord {
21873
+ interface MessageStartedRecord {
22534
21874
  cost: number | null;
22535
21875
  created_at: string;
22536
21876
  duration: number | null;
@@ -22543,37 +21883,30 @@ interface MessageRequeuedRecord {
22543
21883
  */
22544
21884
  id: string;
22545
21885
  kind: 'platform';
21886
+ /**
21887
+ * The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
21888
+ */
21889
+ message_id: string | null;
22546
21890
  model: string | null;
22547
- payload: MessageRequeuedPayload;
21891
+ payload: MessageStartedPayload;
22548
21892
  record_format: 'ellipsis_lifecycle@1';
22549
- record_type: 'message_requeued';
21893
+ record_type: 'message_started';
22550
21894
  /**
22551
21895
  * Session containing this record.
22552
21896
  */
22553
21897
  session_id: string;
22554
- /**
22555
- * Message this record receives, delivers, requeues, or echoes.
22556
- */
22557
- session_message_id: string | null;
22558
21898
  source: 'lifecycle';
22559
21899
  tokens_info: TokensInfo | null;
22560
21900
  tools: string[] | null;
22561
- /**
22562
- * Turn containing this record, when applicable.
22563
- */
22564
- turn_id: string | null;
22565
21901
  }
22566
21902
  /**
22567
- * message_requeued: a turn was interrupted before answering, so the
22568
- * message goes back to the inbox with a new queued turn.
21903
+ * message_started: the agent started on the message.
22569
21904
  */
22570
- interface MessageRequeuedPayload {
21905
+ interface MessageStartedPayload {
22571
21906
  message_id: string;
22572
- requeued_turn_id?: string | null;
22573
- turn_id: string;
22574
21907
  [k: string]: unknown;
22575
21908
  }
22576
- interface TurnQueuedRecord {
21909
+ interface MessageEndedRecord {
22577
21910
  cost: number | null;
22578
21911
  created_at: string;
22579
21912
  duration: number | null;
@@ -22586,78 +21919,75 @@ interface TurnQueuedRecord {
22586
21919
  */
22587
21920
  id: string;
22588
21921
  kind: 'platform';
21922
+ /**
21923
+ * The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
21924
+ */
21925
+ message_id: string | null;
22589
21926
  model: string | null;
22590
- payload: TurnQueuedPayload;
21927
+ payload: MessageEndedPayload$1;
22591
21928
  record_format: 'ellipsis_lifecycle@1';
22592
- record_type: 'turn_queued';
21929
+ record_type: 'message_ended';
22593
21930
  /**
22594
21931
  * Session containing this record.
22595
21932
  */
22596
21933
  session_id: string;
22597
- /**
22598
- * Message this record receives, delivers, requeues, or echoes.
22599
- */
22600
- session_message_id: string | null;
22601
21934
  source: 'lifecycle';
22602
21935
  tokens_info: TokensInfo | null;
22603
21936
  tools: string[] | null;
22604
- /**
22605
- * Turn containing this record, when applicable.
22606
- */
22607
- turn_id: string | null;
22608
21937
  }
22609
21938
  /**
22610
- * turn_queued: the turn waits because the account already has
22611
- * `sessions_alive` sessions alive, its limit.
21939
+ * message_ended: the message was answered, or its answer failed, was
21940
+ * stopped, or was cancelled. `error` is the same object as the session's
21941
+ * `error`, null when the message was answered. `cost` and `tokens` are what
21942
+ * answering it spent. Messages answered together report the spend once, on
21943
+ * the last of them.
22612
21944
  */
22613
- interface TurnQueuedPayload {
22614
- limit: number;
22615
- sessions_alive: number;
22616
- turn_id: string;
21945
+ interface MessageEndedPayload$1 {
21946
+ cost?: Cost1;
21947
+ duration_ms?: number | null;
21948
+ error?: SessionError | null;
21949
+ message_id: string;
21950
+ status: string;
21951
+ tokens?: Tokens1;
22617
21952
  [k: string]: unknown;
22618
21953
  }
22619
- interface TurnStartedRecord {
22620
- cost: number | null;
22621
- created_at: string;
22622
- duration: number | null;
21954
+ /**
21955
+ * What something cost, in millicents.
21956
+ */
21957
+ interface Cost1 {
22623
21958
  /**
22624
- * Position in the session feed and the stream's resume cursor.
21959
+ * What Ellipsis charged to credit, in millicents. It is everything except subscription tokens.
22625
21960
  */
22626
- feed_seq: number;
21961
+ charged: number;
22627
21962
  /**
22628
- * Unique identifier of the record.
21963
+ * CPU spend in millicents.
22629
21964
  */
22630
- id: string;
22631
- kind: 'platform';
22632
- model: string | null;
22633
- payload: TurnStartedPayload;
22634
- record_format: 'ellipsis_lifecycle@1';
22635
- record_type: 'turn_started';
21965
+ cpu: number;
22636
21966
  /**
22637
- * Session containing this record.
21967
+ * Platform fee in millicents.
22638
21968
  */
22639
- session_id: string;
21969
+ fee: number;
21970
+ llm: LlmCost;
22640
21971
  /**
22641
- * Message this record receives, delivers, requeues, or echoes.
21972
+ * Memory spend in millicents.
22642
21973
  */
22643
- session_message_id: string | null;
22644
- source: 'lifecycle';
22645
- tokens_info: TokensInfo | null;
22646
- tools: string[] | null;
21974
+ memory: number;
22647
21975
  /**
22648
- * Turn containing this record, when applicable.
21976
+ * Everything it cost, whoever paid, in millicents. It is the sum of llm.all.total, cpu, memory, and fee, and it is what the budget caps.
22649
21977
  */
22650
- turn_id: string | null;
21978
+ total: number;
22651
21979
  }
22652
21980
  /**
22653
- * turn_started: the agent started on the turn's message.
21981
+ * Tokens used, in total and by model.
22654
21982
  */
22655
- interface TurnStartedPayload {
22656
- turn_id: string;
22657
- turn_index: number;
22658
- [k: string]: unknown;
21983
+ interface Tokens1 {
21984
+ all: TokenCounts;
21985
+ /**
21986
+ * Token counts for each model that used tokens.
21987
+ */
21988
+ by_model: ModelTokenCounts[];
22659
21989
  }
22660
- interface TurnEndedRecord {
21990
+ interface MessageRequeuedRecord {
22661
21991
  cost: number | null;
22662
21992
  created_at: string;
22663
21993
  duration: number | null;
@@ -22670,37 +22000,28 @@ interface TurnEndedRecord {
22670
22000
  */
22671
22001
  id: string;
22672
22002
  kind: 'platform';
22003
+ /**
22004
+ * The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
22005
+ */
22006
+ message_id: string | null;
22673
22007
  model: string | null;
22674
- payload: TurnEndedPayload;
22008
+ payload: MessageRequeuedPayload;
22675
22009
  record_format: 'ellipsis_lifecycle@1';
22676
- record_type: 'turn_ended';
22010
+ record_type: 'message_requeued';
22677
22011
  /**
22678
22012
  * Session containing this record.
22679
22013
  */
22680
22014
  session_id: string;
22681
- /**
22682
- * Message this record receives, delivers, requeues, or echoes.
22683
- */
22684
- session_message_id: string | null;
22685
22015
  source: 'lifecycle';
22686
22016
  tokens_info: TokensInfo | null;
22687
22017
  tools: string[] | null;
22688
- /**
22689
- * Turn containing this record, when applicable.
22690
- */
22691
- turn_id: string | null;
22692
22018
  }
22693
22019
  /**
22694
- * turn_ended: the turn reached its final status. `status`, `reason`, and
22695
- * `detail` match the turn on the session object.
22020
+ * message_requeued: the agent was interrupted before answering, so the
22021
+ * message goes back to the inbox and starts again on a fresh environment.
22696
22022
  */
22697
- interface TurnEndedPayload {
22698
- detail?: string | null;
22699
- duration_ms?: number | null;
22700
- reason?: string | null;
22701
- status: string;
22702
- turn_id: string;
22703
- turn_index: number;
22023
+ interface MessageRequeuedPayload {
22024
+ message_id: string;
22704
22025
  [k: string]: unknown;
22705
22026
  }
22706
22027
  interface EnvironmentPhaseRecord {
@@ -22716,6 +22037,10 @@ interface EnvironmentPhaseRecord {
22716
22037
  */
22717
22038
  id: string;
22718
22039
  kind: 'platform';
22040
+ /**
22041
+ * The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
22042
+ */
22043
+ message_id: string | null;
22719
22044
  model: string | null;
22720
22045
  payload: EnvironmentPhasePayload;
22721
22046
  record_format: 'ellipsis_lifecycle@1';
@@ -22724,17 +22049,9 @@ interface EnvironmentPhaseRecord {
22724
22049
  * Session containing this record.
22725
22050
  */
22726
22051
  session_id: string;
22727
- /**
22728
- * Message this record receives, delivers, requeues, or echoes.
22729
- */
22730
- session_message_id: string | null;
22731
22052
  source: 'lifecycle';
22732
22053
  tokens_info: TokensInfo | null;
22733
22054
  tools: string[] | null;
22734
- /**
22735
- * Turn containing this record, when applicable.
22736
- */
22737
- turn_id: string | null;
22738
22055
  }
22739
22056
  /**
22740
22057
  * environment_phase: one transition of environment preparation, so clients
@@ -22764,6 +22081,10 @@ interface EnvironmentOutputRecord {
22764
22081
  */
22765
22082
  id: string;
22766
22083
  kind: 'platform';
22084
+ /**
22085
+ * The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
22086
+ */
22087
+ message_id: string | null;
22767
22088
  model: string | null;
22768
22089
  payload: EnvironmentOutputPayload;
22769
22090
  record_format: 'ellipsis_lifecycle@1';
@@ -22772,22 +22093,14 @@ interface EnvironmentOutputRecord {
22772
22093
  * Session containing this record.
22773
22094
  */
22774
22095
  session_id: string;
22775
- /**
22776
- * Message this record receives, delivers, requeues, or echoes.
22777
- */
22778
- session_message_id: string | null;
22779
22096
  source: 'lifecycle';
22780
22097
  tokens_info: TokensInfo | null;
22781
22098
  tools: string[] | null;
22782
- /**
22783
- * Turn containing this record, when applicable.
22784
- */
22785
- turn_id: string | null;
22786
22099
  }
22787
22100
  /**
22788
22101
  * environment_output: one chunk of output from preparing the environment,
22789
- * including the customer's own hooks. Many fire per turn; `chunk` orders them
22790
- * within a step.
22102
+ * including the customer's own hooks. Many fire per message; `chunk` orders
22103
+ * them within a step.
22791
22104
  */
22792
22105
  interface EnvironmentOutputPayload {
22793
22106
  chunk: number;
@@ -22810,6 +22123,10 @@ interface EnvironmentReadyRecord {
22810
22123
  */
22811
22124
  id: string;
22812
22125
  kind: 'platform';
22126
+ /**
22127
+ * The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
22128
+ */
22129
+ message_id: string | null;
22813
22130
  model: string | null;
22814
22131
  payload: EnvironmentReadyPayload;
22815
22132
  record_format: 'ellipsis_lifecycle@1';
@@ -22818,17 +22135,9 @@ interface EnvironmentReadyRecord {
22818
22135
  * Session containing this record.
22819
22136
  */
22820
22137
  session_id: string;
22821
- /**
22822
- * Message this record receives, delivers, requeues, or echoes.
22823
- */
22824
- session_message_id: string | null;
22825
22138
  source: 'lifecycle';
22826
22139
  tokens_info: TokensInfo | null;
22827
22140
  tools: string[] | null;
22828
- /**
22829
- * Turn containing this record, when applicable.
22830
- */
22831
- turn_id: string | null;
22832
22141
  }
22833
22142
  /**
22834
22143
  * environment_ready: the environment is prepared and the agent is about
@@ -22855,6 +22164,10 @@ interface UnknownSessionRecord {
22855
22164
  */
22856
22165
  id: string;
22857
22166
  kind: 'unknown';
22167
+ /**
22168
+ * The message this record belongs to: the message itself, or what happened while answering it. Null for records outside any message, such as the session closing.
22169
+ */
22170
+ message_id: string | null;
22858
22171
  model: string | null;
22859
22172
  payload: {
22860
22173
  [k: string]: unknown;
@@ -22871,28 +22184,12 @@ interface UnknownSessionRecord {
22871
22184
  * Session containing this record.
22872
22185
  */
22873
22186
  session_id: string;
22874
- /**
22875
- * Message this record receives, delivers, requeues, or echoes.
22876
- */
22877
- session_message_id: string | null;
22878
22187
  /**
22879
22188
  * Original producer. Unknown producers remain readable as unknown records.
22880
22189
  */
22881
22190
  source: string;
22882
22191
  tokens_info: TokensInfo | null;
22883
22192
  tools: string[] | null;
22884
- /**
22885
- * Turn containing this record, when applicable.
22886
- */
22887
- turn_id: string | null;
22888
- }
22889
- /**
22890
- * A last-writer-wins snapshot of the session: the only way turn,
22891
- * conversation, and cost updates arrive. Resent whole on any field change.
22892
- */
22893
- interface SessionFrame {
22894
- session: Session1;
22895
- type: 'session';
22896
22193
  }
22897
22194
  /**
22898
22195
  * Fire-and-forget partial assistant output for the current response.
@@ -22904,6 +22201,10 @@ interface DeltaFrame {
22904
22201
  * Known values: text (append assistant output), thinking (replace the readable reasoning-summary preview). Open vocabulary: ignore deltas with unknown kinds.
22905
22202
  */
22906
22203
  kind: string;
22204
+ /**
22205
+ * Identifier of the message being answered, if known.
22206
+ */
22207
+ message_id: string | null;
22907
22208
  /**
22908
22209
  * Output tokens generated so far for the current response.
22909
22210
  */
@@ -22912,10 +22213,6 @@ interface DeltaFrame {
22912
22213
  * For "text", an append-only fragment. For "thinking", the first-line prefix of the latest summary section (at most 512 characters); replace the preview, and clear it on an empty string. Null means no text update.
22913
22214
  */
22914
22215
  text: string | null;
22915
- /**
22916
- * Identifier of the turn the delta belongs to, if known.
22917
- */
22918
- turn_id: string | null;
22919
22216
  type: 'delta';
22920
22217
  }
22921
22218
  /**
@@ -22930,13 +22227,6 @@ interface HeartbeatFrame {
22930
22227
  ts: string;
22931
22228
  type: 'heartbeat';
22932
22229
  }
22933
- /**
22934
- * Terminal marker: the conversation is over, after the final session
22935
- * frame carried the end state. Followed by a normal close (1000).
22936
- */
22937
- interface DoneFrame {
22938
- type: 'done';
22939
- }
22940
22230
  /**
22941
22231
  * Terminal error marker, sent before the server closes with code 1011.
22942
22232
  */
@@ -22948,7 +22238,7 @@ interface ErrorFrame {
22948
22238
  type: 'error';
22949
22239
  }
22950
22240
 
22951
- type SessionRecord = RecordsAppendFrame['records'][number];
22241
+ type SessionRecord = RecordsFrame['records'][number];
22952
22242
  type LifecycleSessionRecord = PlatformSessionRecord;
22953
22243
  type ClaudeNativeEvent = ClaudeNativeSessionRecord['payload'];
22954
22244
  type SdkRecord = ClaudeSessionRecord['payload'];
@@ -22978,8 +22268,7 @@ type StreamFrame = SessionStreamFrame;
22978
22268
  type SendSessionMessageRequest = components['schemas']['SendSessionMessageRequest'];
22979
22269
  type SessionRecordsListResponse = components['schemas']['SessionRecordsListResponse'];
22980
22270
  type SessionResponse = components['schemas']['SessionResponse'];
22981
- type SessionTurnResponse = components['schemas']['SessionTurnResponse'];
22982
- type SessionTurnsListResponse = components['schemas']['SessionTurnsListResponse'];
22271
+ type MessageEndedPayload = components['schemas']['MessageEndedPayload'];
22983
22272
  type UpdateSessionRequest = components['schemas']['UpdateSessionRequest'];
22984
22273
  type SessionMessageResponse = components['schemas']['SessionMessageResponse'];
22985
22274
  type SessionsListResponse = components['schemas']['SessionsListResponse'];
@@ -22993,4 +22282,4 @@ type ReviewsListResponse = components['schemas']['ReviewsListResponse'];
22993
22282
  type ReviewConfig = components['schemas']['ReviewConfig'];
22994
22283
  type ReviewConfigsListResponse = components['schemas']['ReviewConfigsListResponse'];
22995
22284
 
22996
- export type { CodexPlan as $, AgentConfig as A, BudgetConfig as B, CheckRunAction as C, CodexCommandExecutionItem as D, CodexConfig as E, CodexContextCompaction as F, CodexEffortLevel as G, CodexErrorEvent as H, CodexErrorItem as I, CodexErrorParams as J, CodexEvent as K, CodexFileChange as L, CodexFileChangeItem as M, CodexFileUpdate as N, CodexItem as O, CodexItemCompleted as P, CodexItemCompletedEvent as Q, CodexItemParams as R, CodexItemStarted as S, CodexItemStartedEvent as T, CodexItemUpdatedEvent as U, CodexLocalImageInput as V, CodexMcpToolCall as W, CodexMcpToolCallAppContext as X, CodexMcpToolCallError as Y, CodexMcpToolCallItem as Z, CodexMcpToolCallResult as _, AgentIdentity as a, GeminiToolUseEvent as a$, CodexReasoning as a0, CodexReasoningItem as a1, CodexSessionRecord as a2, CodexTextInput as a3, CodexThread as a4, CodexThreadStarted as a5, CodexThreadStartedEvent as a6, CodexThreadStartedParams as a7, CodexThreadTokenUsage as a8, CodexTodoListItem as a9, EllipsisGrant as aA, EllipsisPermissions as aB, EnvironmentBaseBuild as aC, EnvironmentConfig as aD, EnvironmentHooks as aE, EnvironmentHooks1 as aF, EnvironmentOutputPayload as aG, EnvironmentOutputRecord as aH, EnvironmentPhasePayload as aI, EnvironmentPhaseRecord as aJ, EnvironmentReadyPayload as aK, EnvironmentReadyRecord as aL, EnvironmentScript as aM, EnvironmentSource as aN, EnvironmentVariable as aO, ErrorFrame as aP, GeminiConfig as aQ, GeminiErrorEvent as aR, GeminiInitEvent as aS, GeminiMessageEvent as aT, GeminiModelStats as aU, GeminiResultEvent as aV, GeminiSessionRecord as aW, GeminiStreamEvent as aX, GeminiStreamStats as aY, GeminiToolError as aZ, GeminiToolResultEvent as a_, CodexTokenUsageBreakdown as aa, CodexTokenUsageParams as ab, CodexTokenUsageUpdated as ac, CodexTurn as ad, CodexTurnCompleted as ae, CodexTurnCompletedEvent as af, CodexTurnError as ag, CodexTurnFailedEvent as ah, CodexTurnParams as ai, CodexTurnStarted as aj, CodexTurnStartedEvent as ak, CodexUsage as al, CodexUserInput as am, CodexUserMessage as an, CodexWebSearch as ao, CodexWebSearchItem as ap, ComputeConfig as aq, ComputeConfig1 as ar, ConfigMetadata as as, Cost as at, Cost1 as au, CronTrigger as av, DeltaFrame as aw, DoneFrame as ax, Duration as ay, EffortLevel as az, AttributionType as b, ReviewConfigsListResponse as b$, GithubAccountFilter as b0, GithubAccountSelector as b1, GithubAccountSnippet as b2, GithubAccountType as b3, GithubCheckRunEvent as b4, GithubCheckSuiteEvent as b5, GithubIssueEvent as b6, GithubPermissions as b7, GithubPullRequestEvent as b8, GithubPushEvent as b9, ModelLlmCostSplit as bA, ModelTokenCounts as bB, OutputConfig as bC, PermissionsConfig as bD, PermissionsConfig1 as bE, PlatformSessionRecord as bF, PromptBlockedReason as bG, PullRequestAction as bH, ReactCheckRun as bI, ReactCheckSuite as bJ, ReactIssue as bK, ReactLinearIssue as bL, ReactPullRequest as bM, ReactPush as bN, ReactRelease as bO, ReactSentry as bP, ReactSlackChannel as bQ, ReactStatus as bR, ReactTrigger as bS, ReactWorkflowRun as bT, RecordsAppendFrame as bU, ReleaseAction as bV, RepositoryFilter as bW, RepositoryRef as bX, Review as bY, ReviewComment as bZ, ReviewConfig as b_, GithubReleaseEvent as ba, GithubStatusEvent as bb, GithubWorkflowRunEvent as bc, HandlerService as bd, HeartbeatFrame as be, InputContract as bf, IssueAction as bg, LegacyAssistantPayload as bh, LegacyNativeUsage as bi, LegacyResultPayload as bj, Level as bk, LifecycleSessionRecord as bl, LinearIssueAction as bm, LinearIssueEvent as bn, LlmCost as bo, LlmCostSplit as bp, McpRemoteServer as bq, McpServerRef as br, McpStdioServer as bs, MemorySize as bt, MessageDeliveredPayload as bu, MessageDeliveredRecord as bv, MessageReceivedPayload as bw, MessageReceivedRecord as bx, MessageRequeuedPayload as by, MessageRequeuedRecord as bz, components as c, SlackMessageEvent as c$, ReviewPullRequest as c0, ReviewPullRequestAuthor as c1, ReviewReviewer as c2, ReviewSummary as c3, ReviewsListResponse as c4, SdkAssistantRecord as c5, SdkCacheCreation as c6, SdkContentBlock as c7, SdkRateLimitRecord as c8, SdkRecord as c9, SessionGitCommit as cA, SessionGitFile as cB, SessionGitPr as cC, SessionGitRepo as cD, SessionHandler as cE, SessionMessage as cF, SessionMessageImage as cG, SessionMessageResponse as cH, SessionMessageStatus as cI, SessionOutput as cJ, SessionParent as cK, SessionPrompting as cL, SessionRecord as cM, SessionRecordsListResponse as cN, SessionResponse as cO, SessionSource as cP, SessionState as cQ, SessionStopped as cR, SessionStreamFrame as cS, SessionSummary as cT, SessionTurn as cU, SessionTurnResponse as cV, SessionTurnsListResponse as cW, SessionsListResponse as cX, SettingsRef as cY, SkillRef as cZ, SlackChannelCreatedEvent as c_, SdkResultRecord as ca, SdkServerToolResultBlock as cb, SdkServerToolUseBlock as cc, SdkSystemRecord as cd, SdkTextBlock as ce, SdkThinkingBlock as cf, SdkToolResultBlock as cg, SdkToolUseBlock as ch, SdkUserRecord as ci, SendSessionMessageRequest as cj, SentryAction as ck, SentryAlertEvent as cl, Session as cm, Session1 as cn, SessionAgent as co, SessionArchived as cp, SessionAttribution as cq, SessionClosedPayload as cr, SessionClosedRecord as cs, SessionConfig as ct, SessionConversation as cu, SessionConversationConfig as cv, SessionEnvironment as cw, SessionEventActor as cx, SessionFrame as cy, SessionGit as cz, CheckSuiteAction as d, SnapshotFrame as d0, StatusAction as d1, StreamFrame as d2, TokenCounts as d3, Tokens as d4, Tokens1 as d5, TokensInfo as d6, TurnEndedPayload as d7, TurnEndedRecord as d8, TurnQueuedPayload as d9, TurnQueuedRecord as da, TurnReason as db, TurnStartedPayload as dc, TurnStartedRecord as dd, TurnStatus as de, UnknownSessionRecord as df, UpdateSessionRequest as dg, WorkflowRunAction as dh, paths as di, ClaudeAssistantEvent as e, ClaudeAssistantMessage as f, ClaudeConfig as g, ClaudeConversationResetEvent as h, ClaudeNativeEvent as i, ClaudeNativeSessionRecord as j, ClaudeNativeUsage as k, ClaudeRateLimitEvent as l, ClaudeRateLimitInfo as m, ClaudeResultEvent as n, ClaudeSessionRecord as o, ClaudeSystemEvent as p, ClaudeUserEvent as q, ClaudeUserMessage as r, CodexAgentMessage as s, CodexAgentMessageItem as t, CodexAppServerError as u, CodexAppServerEvent as v, CodexAppServerItem as w, CodexAppServerNotification as x, CodexAppServerSessionRecord as y, CodexCommandExecution as z };
22285
+ export type { CodexMcpToolCallResult as $, AgentConfig as A, BudgetConfig as B, CheckRunAction as C, CodexCommandExecution as D, CodexCommandExecutionItem as E, CodexConfig as F, CodexContextCompaction as G, CodexEffortLevel as H, CodexErrorEvent as I, CodexErrorItem as J, CodexErrorParams as K, CodexEvent as L, CodexFileChange as M, CodexFileChangeItem as N, CodexFileUpdate as O, CodexItem as P, CodexItemCompleted as Q, CodexItemCompletedEvent as R, CodexItemParams as S, CodexItemStarted as T, CodexItemStartedEvent as U, CodexItemUpdatedEvent as V, CodexLocalImageInput as W, CodexMcpToolCall as X, CodexMcpToolCallAppContext as Y, CodexMcpToolCallError as Z, CodexMcpToolCallItem as _, AgentIdentity as a, GeminiToolError as a$, CodexPlan as a0, CodexReasoning as a1, CodexReasoningItem as a2, CodexSessionRecord as a3, CodexSubAgentActivity as a4, CodexTextInput as a5, CodexThread as a6, CodexThreadStarted as a7, CodexThreadStartedEvent as a8, CodexThreadStartedParams as a9, EffortLevel as aA, EllipsisGrant as aB, EllipsisPermissions as aC, EnvironmentBaseBuild as aD, EnvironmentConfig as aE, EnvironmentHooks as aF, EnvironmentHooks1 as aG, EnvironmentOutputPayload as aH, EnvironmentOutputRecord as aI, EnvironmentPhasePayload as aJ, EnvironmentPhaseRecord as aK, EnvironmentReadyPayload as aL, EnvironmentReadyRecord as aM, EnvironmentScript as aN, EnvironmentSource as aO, EnvironmentVariable as aP, ErrorFrame as aQ, ErrorReason as aR, GeminiConfig as aS, GeminiErrorEvent as aT, GeminiInitEvent as aU, GeminiMessageEvent as aV, GeminiModelStats as aW, GeminiResultEvent as aX, GeminiSessionRecord as aY, GeminiStreamEvent as aZ, GeminiStreamStats as a_, CodexThreadTokenUsage as aa, CodexTodoListItem as ab, CodexTokenUsageBreakdown as ac, CodexTokenUsageParams as ad, CodexTokenUsageUpdated as ae, CodexTurn as af, CodexTurnCompleted as ag, CodexTurnCompletedEvent as ah, CodexTurnError as ai, CodexTurnFailedEvent as aj, CodexTurnParams as ak, CodexTurnStarted as al, CodexTurnStartedEvent as am, CodexUsage as an, CodexUserInput as ao, CodexUserMessage as ap, CodexWebSearch as aq, CodexWebSearchItem as ar, ComputeConfig as as, ComputeConfig1 as at, ConfigMetadata as au, Cost as av, Cost1 as aw, CronTrigger as ax, DeltaFrame as ay, Duration as az, AttributionType as b, RepositoryFilter as b$, GeminiToolResultEvent as b0, GeminiToolUseEvent as b1, GithubAccountFilter as b2, GithubAccountSelector as b3, GithubAccountSnippet as b4, GithubAccountType as b5, GithubCheckRunEvent as b6, GithubCheckSuiteEvent as b7, GithubIssueEvent as b8, GithubPermissions as b9, MessageRecord as bA, MessageRequeuedPayload as bB, MessageRequeuedRecord as bC, MessageStartedPayload as bD, MessageStartedRecord as bE, ModelLlmCostSplit as bF, ModelTokenCounts as bG, OutputConfig as bH, PermissionsConfig as bI, PermissionsConfig1 as bJ, PlatformSessionRecord as bK, PromptBlockedReason as bL, PullRequestAction as bM, ReactCheckRun as bN, ReactCheckSuite as bO, ReactIssue as bP, ReactLinearIssue as bQ, ReactPullRequest as bR, ReactPush as bS, ReactRelease as bT, ReactSentry as bU, ReactSlackChannel as bV, ReactStatus as bW, ReactTrigger as bX, ReactWorkflowRun as bY, RecordsFrame as bZ, ReleaseAction as b_, GithubPullRequestEvent as ba, GithubPushEvent as bb, GithubReleaseEvent as bc, GithubStatusEvent as bd, GithubWorkflowRunEvent as be, HandlerService as bf, HeartbeatFrame as bg, InputContract as bh, IssueAction as bi, LegacyAssistantPayload as bj, LegacyNativeUsage as bk, LegacyResultPayload as bl, Level as bm, LifecycleSessionRecord as bn, LinearIssueAction as bo, LinearIssueEvent as bp, LlmCost as bq, LlmCostSplit as br, McpRemoteServer as bs, McpServerRef as bt, McpStdioServer as bu, MemorySize as bv, MessageEndedPayload as bw, MessageEndedRecord as bx, MessageQueuedPayload as by, MessageQueuedRecord as bz, components as c, SlackMessageEvent as c$, RepositoryRef as c0, Review as c1, ReviewComment as c2, ReviewConfig as c3, ReviewConfigsListResponse as c4, ReviewPullRequest as c5, ReviewPullRequestAuthor as c6, ReviewReviewer as c7, ReviewSummary as c8, ReviewsListResponse as c9, SessionEnvironment as cA, SessionError as cB, SessionEventActor as cC, SessionFrame as cD, SessionGit as cE, SessionGitCommit as cF, SessionGitFile as cG, SessionGitPr as cH, SessionGitRepo as cI, SessionHandler as cJ, SessionMessage as cK, SessionMessageImage as cL, SessionMessageResponse as cM, SessionOutput as cN, SessionParent as cO, SessionPrompting as cP, SessionRecord as cQ, SessionRecordsListResponse as cR, SessionResponse as cS, SessionSource as cT, SessionStatus as cU, SessionStreamFrame as cV, SessionSummary as cW, SessionsListResponse as cX, SettingsRef as cY, SkillRef as cZ, SlackChannelCreatedEvent as c_, SdkAssistantRecord as ca, SdkCacheCreation as cb, SdkContentBlock as cc, SdkRateLimitRecord as cd, SdkRecord as ce, SdkResultRecord as cf, SdkServerToolResultBlock as cg, SdkServerToolUseBlock as ch, SdkSystemRecord as ci, SdkTextBlock as cj, SdkThinkingBlock as ck, SdkToolResultBlock as cl, SdkToolUseBlock as cm, SdkUserRecord as cn, SendSessionMessageRequest as co, SentryAction as cp, SentryAlertEvent as cq, Session as cr, SessionAgent as cs, SessionArchived as ct, SessionAttribution as cu, SessionClosedPayload as cv, SessionClosedRecord as cw, SessionConfig as cx, SessionConversation as cy, SessionConversationConfig as cz, CheckSuiteAction as d, StatusAction as d0, StreamFrame as d1, TokenCounts as d2, Tokens as d3, Tokens1 as d4, TokensInfo as d5, UnknownSessionRecord as d6, UpdateSessionRequest as d7, WorkflowRunAction as d8, paths as d9, ClaudeAssistantEvent as e, ClaudeAssistantMessage as f, ClaudeConfig as g, ClaudeConversationResetEvent as h, ClaudeNativeEvent as i, ClaudeNativeSessionRecord as j, ClaudeNativeUsage as k, ClaudeRateLimitEvent as l, ClaudeRateLimitInfo as m, ClaudeResultEvent as n, ClaudeSessionRecord as o, ClaudeSystemEvent as p, ClaudeUserEvent as q, ClaudeUserMessage as r, CodexAgentMessage as s, CodexAgentMessageItem as t, CodexAppServerError as u, CodexAppServerEvent as v, CodexAppServerItem as w, CodexAppServerNotification as x, CodexAppServerSessionRecord as y, CodexCollabAgentToolCall as z };