@ellipsis-dev/sdk 0.36.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: {
@@ -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,6 @@ interface components {
3839
3782
  tokens_info: components['schemas']['TokensInfo'] | null;
3840
3783
  /** Tools */
3841
3784
  tools: string[] | null;
3842
- /**
3843
- * Turn Id
3844
- * @description Turn containing this record, when applicable.
3845
- */
3846
- turn_id: string | null;
3847
3785
  };
3848
3786
  /** CodexCollabAgentToolCall */
3849
3787
  CodexCollabAgentToolCall: {
@@ -3931,7 +3869,7 @@ interface components {
3931
3869
  * @description Native options supported by the current Codex adapter.
3932
3870
  */
3933
3871
  'CodexConfig-Input': {
3934
- /** @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. */
3935
3873
  effort?: components['schemas']['CodexEffortLevel'] | null;
3936
3874
  /**
3937
3875
  * Model
@@ -3940,7 +3878,7 @@ interface components {
3940
3878
  model: string;
3941
3879
  /**
3942
3880
  * Prompt
3943
- * @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.
3944
3882
  */
3945
3883
  prompt?: string | null;
3946
3884
  };
@@ -3949,7 +3887,7 @@ interface components {
3949
3887
  * @description Native options supported by the current Codex adapter.
3950
3888
  */
3951
3889
  'CodexConfig-Output': {
3952
- /** @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. */
3953
3891
  effort: components['schemas']['CodexEffortLevel'] | null;
3954
3892
  /**
3955
3893
  * Model
@@ -3958,7 +3896,7 @@ interface components {
3958
3896
  model: string;
3959
3897
  /**
3960
3898
  * Prompt
3961
- * @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.
3962
3900
  */
3963
3901
  prompt: string | null;
3964
3902
  };
@@ -4241,13 +4179,13 @@ interface components {
4241
4179
  * Unknown options are rejected instead of silently ignored.
4242
4180
  */
4243
4181
  CodexOverrides: {
4244
- /** @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. */
4245
4183
  effort?: components['schemas']['CodexEffortLevel'] | null;
4246
4184
  /** Model */
4247
4185
  model?: string | null;
4248
4186
  /**
4249
4187
  * Prompt
4250
- * @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.
4251
4189
  */
4252
4190
  prompt?: string | null;
4253
4191
  };
@@ -4330,6 +4268,11 @@ interface components {
4330
4268
  * @constant
4331
4269
  */
4332
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;
4333
4276
  /** Model */
4334
4277
  model: string | null;
4335
4278
  /** Payload */
@@ -4350,11 +4293,6 @@ interface components {
4350
4293
  * @description Session containing this record.
4351
4294
  */
4352
4295
  session_id: string;
4353
- /**
4354
- * Session Message Id
4355
- * @description Message this record receives, delivers, requeues, or echoes.
4356
- */
4357
- session_message_id: string | null;
4358
4296
  /**
4359
4297
  * Source
4360
4298
  * @default codex
@@ -4364,11 +4302,6 @@ interface components {
4364
4302
  tokens_info: components['schemas']['TokensInfo'] | null;
4365
4303
  /** Tools */
4366
4304
  tools: string[] | null;
4367
- /**
4368
- * Turn Id
4369
- * @description Turn containing this record, when applicable.
4370
- */
4371
- turn_id: string | null;
4372
4305
  };
4373
4306
  /**
4374
4307
  * CodexSubAgentActivity
@@ -5623,8 +5556,8 @@ interface components {
5623
5556
  /**
5624
5557
  * EnvironmentOutputPayload
5625
5558
  * @description environment_output: one chunk of output from preparing the environment,
5626
- * including the customer's own hooks. Many fire per turn; `chunk` orders them
5627
- * within a step.
5559
+ * including the customer's own hooks. Many fire per message; `chunk` orders
5560
+ * them within a step.
5628
5561
  */
5629
5562
  EnvironmentOutputPayload: {
5630
5563
  /** Chunk */
@@ -5670,6 +5603,11 @@ interface components {
5670
5603
  * @constant
5671
5604
  */
5672
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;
5673
5611
  /** Model */
5674
5612
  model: string | null;
5675
5613
  payload: components['schemas']['EnvironmentOutputPayload'];
@@ -5689,11 +5627,6 @@ interface components {
5689
5627
  * @description Session containing this record.
5690
5628
  */
5691
5629
  session_id: string;
5692
- /**
5693
- * Session Message Id
5694
- * @description Message this record receives, delivers, requeues, or echoes.
5695
- */
5696
- session_message_id: string | null;
5697
5630
  /**
5698
5631
  * Source
5699
5632
  * @default lifecycle
@@ -5703,11 +5636,6 @@ interface components {
5703
5636
  tokens_info: components['schemas']['TokensInfo'] | null;
5704
5637
  /** Tools */
5705
5638
  tools: string[] | null;
5706
- /**
5707
- * Turn Id
5708
- * @description Turn containing this record, when applicable.
5709
- */
5710
- turn_id: string | null;
5711
5639
  };
5712
5640
  /**
5713
5641
  * EnvironmentPhasePayload
@@ -5758,6 +5686,11 @@ interface components {
5758
5686
  * @constant
5759
5687
  */
5760
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;
5761
5694
  /** Model */
5762
5695
  model: string | null;
5763
5696
  payload: components['schemas']['EnvironmentPhasePayload'];
@@ -5777,11 +5710,6 @@ interface components {
5777
5710
  * @description Session containing this record.
5778
5711
  */
5779
5712
  session_id: string;
5780
- /**
5781
- * Session Message Id
5782
- * @description Message this record receives, delivers, requeues, or echoes.
5783
- */
5784
- session_message_id: string | null;
5785
5713
  /**
5786
5714
  * Source
5787
5715
  * @default lifecycle
@@ -5791,11 +5719,6 @@ interface components {
5791
5719
  tokens_info: components['schemas']['TokensInfo'] | null;
5792
5720
  /** Tools */
5793
5721
  tools: string[] | null;
5794
- /**
5795
- * Turn Id
5796
- * @description Turn containing this record, when applicable.
5797
- */
5798
- turn_id: string | null;
5799
5722
  };
5800
5723
  /**
5801
5724
  * EnvironmentReadyPayload
@@ -5837,6 +5760,11 @@ interface components {
5837
5760
  * @constant
5838
5761
  */
5839
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;
5840
5768
  /** Model */
5841
5769
  model: string | null;
5842
5770
  payload: components['schemas']['EnvironmentReadyPayload'];
@@ -5856,11 +5784,6 @@ interface components {
5856
5784
  * @description Session containing this record.
5857
5785
  */
5858
5786
  session_id: string;
5859
- /**
5860
- * Session Message Id
5861
- * @description Message this record receives, delivers, requeues, or echoes.
5862
- */
5863
- session_message_id: string | null;
5864
5787
  /**
5865
5788
  * Source
5866
5789
  * @default lifecycle
@@ -5870,11 +5793,6 @@ interface components {
5870
5793
  tokens_info: components['schemas']['TokensInfo'] | null;
5871
5794
  /** Tools */
5872
5795
  tools: string[] | null;
5873
- /**
5874
- * Turn Id
5875
- * @description Turn containing this record, when applicable.
5876
- */
5877
- turn_id: string | null;
5878
5796
  };
5879
5797
  /**
5880
5798
  * EnvironmentResponse
@@ -5970,6 +5888,12 @@ interface components {
5970
5888
  */
5971
5889
  request_id?: string | null;
5972
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';
5973
5897
  /**
5974
5898
  * ErrorResponse
5975
5899
  * @description The error envelope every /v1 error returns.
@@ -5993,7 +5917,7 @@ interface components {
5993
5917
  model: string;
5994
5918
  /**
5995
5919
  * Prompt
5996
- * @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.
5997
5921
  */
5998
5922
  prompt?: string | null;
5999
5923
  };
@@ -6009,7 +5933,7 @@ interface components {
6009
5933
  model: string;
6010
5934
  /**
6011
5935
  * Prompt
6012
- * @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.
6013
5937
  */
6014
5938
  prompt: string | null;
6015
5939
  };
@@ -6106,7 +6030,7 @@ interface components {
6106
6030
  model?: string | null;
6107
6031
  /**
6108
6032
  * Prompt
6109
- * @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.
6110
6034
  */
6111
6035
  prompt?: string | null;
6112
6036
  };
@@ -6156,6 +6080,11 @@ interface components {
6156
6080
  * @constant
6157
6081
  */
6158
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;
6159
6088
  /** Model */
6160
6089
  model: string | null;
6161
6090
  payload: components['schemas']['GeminiStreamEvent'];
@@ -6175,11 +6104,6 @@ interface components {
6175
6104
  * @description Session containing this record.
6176
6105
  */
6177
6106
  session_id: string;
6178
- /**
6179
- * Session Message Id
6180
- * @description Message this record receives, delivers, requeues, or echoes.
6181
- */
6182
- session_message_id: string | null;
6183
6107
  /**
6184
6108
  * Source
6185
6109
  * @default gemini
@@ -6189,11 +6113,6 @@ interface components {
6189
6113
  tokens_info: components['schemas']['TokensInfo'] | null;
6190
6114
  /** Tools */
6191
6115
  tools: string[] | null;
6192
- /**
6193
- * Turn Id
6194
- * @description Turn containing this record, when applicable.
6195
- */
6196
- turn_id: string | null;
6197
6116
  };
6198
6117
  GeminiStreamEvent: components['schemas']['GeminiInitEvent'] | components['schemas']['GeminiMessageEvent'] | components['schemas']['GeminiToolUseEvent'] | components['schemas']['GeminiToolResultEvent'] | components['schemas']['GeminiErrorEvent'] | components['schemas']['GeminiResultEvent'];
6199
6118
  /** GeminiStreamStats */
@@ -8131,19 +8050,28 @@ interface components {
8131
8050
  trigger_on_user_mention_public_repo: boolean;
8132
8051
  };
8133
8052
  /**
8134
- * MessageDeliveredPayload
8135
- * @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.
8136
8059
  */
8137
- MessageDeliveredPayload: {
8060
+ MessageEndedPayload: {
8061
+ cost?: components['schemas']['Cost'];
8062
+ /** Duration Ms */
8063
+ duration_ms?: number | null;
8064
+ error?: components['schemas']['SessionError'] | null;
8138
8065
  /** Message Id */
8139
8066
  message_id: string;
8140
- /** Turn Id */
8141
- turn_id: string;
8067
+ /** Status */
8068
+ status: string;
8069
+ tokens?: components['schemas']['Tokens'];
8142
8070
  } & {
8143
8071
  [key: string]: unknown;
8144
8072
  };
8145
- /** MessageDeliveredRecord */
8146
- MessageDeliveredRecord: {
8073
+ /** MessageEndedRecord */
8074
+ MessageEndedRecord: {
8147
8075
  /** Cost */
8148
8076
  cost: number | null;
8149
8077
  /**
@@ -8169,9 +8097,14 @@ interface components {
8169
8097
  * @constant
8170
8098
  */
8171
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;
8172
8105
  /** Model */
8173
8106
  model: string | null;
8174
- payload: components['schemas']['MessageDeliveredPayload'];
8107
+ payload: components['schemas']['MessageEndedPayload'];
8175
8108
  /**
8176
8109
  * Record Format
8177
8110
  * @default ellipsis_lifecycle@1
@@ -8182,17 +8115,12 @@ interface components {
8182
8115
  * @description discriminator enum property added by openapi-typescript
8183
8116
  * @enum {string}
8184
8117
  */
8185
- record_type: 'message_delivered';
8118
+ record_type: 'message_ended';
8186
8119
  /**
8187
8120
  * Session Id
8188
8121
  * @description Session containing this record.
8189
8122
  */
8190
8123
  session_id: string;
8191
- /**
8192
- * Session Message Id
8193
- * @description Message this record receives, delivers, requeues, or echoes.
8194
- */
8195
- session_message_id: string | null;
8196
8124
  /**
8197
8125
  * Source
8198
8126
  * @default lifecycle
@@ -8202,40 +8130,24 @@ interface components {
8202
8130
  tokens_info: components['schemas']['TokensInfo'] | null;
8203
8131
  /** Tools */
8204
8132
  tools: string[] | null;
8205
- /**
8206
- * Turn Id
8207
- * @description Turn containing this record, when applicable.
8208
- */
8209
- turn_id: string | null;
8210
8133
  };
8211
8134
  /**
8212
- * MessageReceivedPayload
8213
- * @description message_received: a message landed in the session inbox and its turn was
8214
- * 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.
8215
8138
  */
8216
- MessageReceivedPayload: {
8217
- /** Author */
8218
- author?: string | null;
8219
- /** Body */
8220
- body: string;
8221
- /**
8222
- * Closes Session
8223
- * @default false
8224
- */
8225
- closes_session: boolean;
8139
+ MessageQueuedPayload: {
8140
+ /** Limit */
8141
+ limit: number;
8226
8142
  /** Message Id */
8227
8143
  message_id: string;
8228
- /** Sender Attribution Id */
8229
- sender_attribution_id?: string | null;
8230
- /** Sender Attribution Type */
8231
- sender_attribution_type?: string | null;
8232
- /** Turn Id */
8233
- turn_id?: string | null;
8144
+ /** Sessions Alive */
8145
+ sessions_alive: number;
8234
8146
  } & {
8235
8147
  [key: string]: unknown;
8236
8148
  };
8237
- /** MessageReceivedRecord */
8238
- MessageReceivedRecord: {
8149
+ /** MessageQueuedRecord */
8150
+ MessageQueuedRecord: {
8239
8151
  /** Cost */
8240
8152
  cost: number | null;
8241
8153
  /**
@@ -8261,9 +8173,14 @@ interface components {
8261
8173
  * @constant
8262
8174
  */
8263
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;
8264
8181
  /** Model */
8265
8182
  model: string | null;
8266
- payload: components['schemas']['MessageReceivedPayload'];
8183
+ payload: components['schemas']['MessageQueuedPayload'];
8267
8184
  /**
8268
8185
  * Record Format
8269
8186
  * @default ellipsis_lifecycle@1
@@ -8274,17 +8191,12 @@ interface components {
8274
8191
  * @description discriminator enum property added by openapi-typescript
8275
8192
  * @enum {string}
8276
8193
  */
8277
- record_type: 'message_received';
8194
+ record_type: 'message_queued';
8278
8195
  /**
8279
8196
  * Session Id
8280
8197
  * @description Session containing this record.
8281
8198
  */
8282
8199
  session_id: string;
8283
- /**
8284
- * Session Message Id
8285
- * @description Message this record receives, delivers, requeues, or echoes.
8286
- */
8287
- session_message_id: string | null;
8288
8200
  /**
8289
8201
  * Source
8290
8202
  * @default lifecycle
@@ -8294,24 +8206,76 @@ interface components {
8294
8206
  tokens_info: components['schemas']['TokensInfo'] | null;
8295
8207
  /** Tools */
8296
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;
8297
8261
  /**
8298
- * Turn Id
8299
- * @description Turn containing this record, when applicable.
8262
+ * Source
8263
+ * @default lifecycle
8264
+ * @constant
8300
8265
  */
8301
- turn_id: string | null;
8266
+ source: 'lifecycle';
8267
+ tokens_info: components['schemas']['TokensInfo'] | null;
8268
+ /** Tools */
8269
+ tools: string[] | null;
8302
8270
  };
8303
8271
  /**
8304
8272
  * MessageRequeuedPayload
8305
- * @description message_requeued: a turn was interrupted before answering, so the
8306
- * 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.
8307
8275
  */
8308
8276
  MessageRequeuedPayload: {
8309
8277
  /** Message Id */
8310
8278
  message_id: string;
8311
- /** Requeued Turn Id */
8312
- requeued_turn_id?: string | null;
8313
- /** Turn Id */
8314
- turn_id: string;
8315
8279
  } & {
8316
8280
  [key: string]: unknown;
8317
8281
  };
@@ -8342,6 +8306,11 @@ interface components {
8342
8306
  * @constant
8343
8307
  */
8344
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;
8345
8314
  /** Model */
8346
8315
  model: string | null;
8347
8316
  payload: components['schemas']['MessageRequeuedPayload'];
@@ -8361,11 +8330,6 @@ interface components {
8361
8330
  * @description Session containing this record.
8362
8331
  */
8363
8332
  session_id: string;
8364
- /**
8365
- * Session Message Id
8366
- * @description Message this record receives, delivers, requeues, or echoes.
8367
- */
8368
- session_message_id: string | null;
8369
8333
  /**
8370
8334
  * Source
8371
8335
  * @default lifecycle
@@ -8375,11 +8339,77 @@ interface components {
8375
8339
  tokens_info: components['schemas']['TokensInfo'] | null;
8376
8340
  /** Tools */
8377
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'];
8388
+ /**
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;
8378
8404
  /**
8379
- * Turn Id
8380
- * @description Turn containing this record, when applicable.
8405
+ * Source
8406
+ * @default lifecycle
8407
+ * @constant
8381
8408
  */
8382
- turn_id: string | null;
8409
+ source: 'lifecycle';
8410
+ tokens_info: components['schemas']['TokensInfo'] | null;
8411
+ /** Tools */
8412
+ tools: string[] | null;
8383
8413
  };
8384
8414
  /** Model */
8385
8415
  Model: {
@@ -8649,7 +8679,7 @@ interface components {
8649
8679
  /** @default {} */
8650
8680
  github: components['schemas']['GithubPermissions-Output'];
8651
8681
  };
8652
- 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'];
8653
8683
  /**
8654
8684
  * PollCliAuthResponse
8655
8685
  * @description The state of a device-code flow. Poll until `status` leaves `pending`.
@@ -10797,7 +10827,7 @@ interface components {
10797
10827
  * Session
10798
10828
  * @description An agent session: one conversation with an agent. Returned by
10799
10829
  * `GET /v1/sessions/{id}` and carried by the session stream's
10800
- * `session`/`snapshot` frames; REST and stream never disagree about what a
10830
+ * `session` frames; REST and stream never disagree about what a
10801
10831
  * session looks like.
10802
10832
  */
10803
10833
  Session: {
@@ -10829,6 +10859,8 @@ interface components {
10829
10859
  created_at: string;
10830
10860
  /** @description The full environment configuration frozen when the session was created, with the saved environment's id and how it was chosen. */
10831
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;
10832
10864
  /**
10833
10865
  * Event
10834
10866
  * @description The typed external event that started the session; null for direct and scheduled starts.
@@ -10853,7 +10885,7 @@ interface components {
10853
10885
  metadata: {
10854
10886
  [key: string]: string;
10855
10887
  };
10856
- /** @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`. */
10857
10889
  output: components['schemas']['SessionOutput'] | null;
10858
10890
  /** @description The predecessor session this session continues; null when there is none. */
10859
10891
  parent: components['schemas']['SessionParent'] | null;
@@ -10866,12 +10898,12 @@ interface components {
10866
10898
  skills: components['schemas']['SkillRef-Output'][];
10867
10899
  /** @description Where the session came from (e.g. react, web, api, cli, mention, cron). */
10868
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'];
10869
10903
  /** @description The latest live summary of the session's progress while it runs, and when it was generated. */
10870
10904
  summary: components['schemas']['SessionSummary'] | null;
10871
10905
  /** @description The tokens the session has used so far. */
10872
10906
  tokens: components['schemas']['Tokens'];
10873
- /** @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. */
10874
- turn: components['schemas']['SessionTurn'] | null;
10875
10907
  /**
10876
10908
  * Updated At
10877
10909
  * Format: date-time
@@ -11004,7 +11036,7 @@ interface components {
11004
11036
  SessionCapability: 'coding' | 'interactive' | 'agent' | 'structured_input' | 'structured_output' | 'system_files' | 'images' | 'mcp' | 'skills' | 'settings' | 'fallback_model' | 'effort';
11005
11037
  /**
11006
11038
  * SessionClosedPayload
11007
- * @description session_closed: the conversation closed permanently.
11039
+ * @description session_closed: the session closed permanently.
11008
11040
  */
11009
11041
  SessionClosedPayload: {
11010
11042
  [key: string]: unknown;
@@ -11036,6 +11068,11 @@ interface components {
11036
11068
  * @constant
11037
11069
  */
11038
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;
11039
11076
  /** Model */
11040
11077
  model: string | null;
11041
11078
  payload: components['schemas']['SessionClosedPayload'];
@@ -11055,11 +11092,6 @@ interface components {
11055
11092
  * @description Session containing this record.
11056
11093
  */
11057
11094
  session_id: string;
11058
- /**
11059
- * Session Message Id
11060
- * @description Message this record receives, delivers, requeues, or echoes.
11061
- */
11062
- session_message_id: string | null;
11063
11095
  /**
11064
11096
  * Source
11065
11097
  * @default lifecycle
@@ -11069,11 +11101,6 @@ interface components {
11069
11101
  tokens_info: components['schemas']['TokensInfo'] | null;
11070
11102
  /** Tools */
11071
11103
  tools: string[] | null;
11072
- /**
11073
- * Turn Id
11074
- * @description Turn containing this record, when applicable.
11075
- */
11076
- turn_id: string | null;
11077
11104
  };
11078
11105
  /**
11079
11106
  * SessionConfig
@@ -11218,13 +11245,11 @@ interface components {
11218
11245
  SessionConversation: {
11219
11246
  /**
11220
11247
  * Interactive
11221
- * @description Whether the session stays open after its first turn.
11248
+ * @description Whether the session stays open after its first message is answered.
11222
11249
  */
11223
11250
  interactive: boolean;
11224
11251
  /** @description The session's policy for direct messages. Caller authorization and message validation are checked separately. */
11225
11252
  prompting: components['schemas']['SessionPrompting'];
11226
- /** @description `open` while the session can take messages; `closed` is permanent. */
11227
- state: components['schemas']['SessionState'];
11228
11253
  /**
11229
11254
  * Warm
11230
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.
@@ -11238,7 +11263,7 @@ interface components {
11238
11263
  'SessionConversationConfig-Input': {
11239
11264
  /**
11240
11265
  * Interactive
11241
- * @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.
11242
11267
  */
11243
11268
  interactive?: boolean;
11244
11269
  };
@@ -11249,7 +11274,7 @@ interface components {
11249
11274
  'SessionConversationConfig-Output': {
11250
11275
  /**
11251
11276
  * Interactive
11252
- * @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.
11253
11278
  * @default true
11254
11279
  */
11255
11280
  interactive: boolean;
@@ -11314,6 +11339,20 @@ interface components {
11314
11339
  */
11315
11340
  variables: components['schemas']['EnvironmentVariable-Output'][];
11316
11341
  };
11342
+ /**
11343
+ * SessionError
11344
+ * @description Why the last message failed, was stopped, or was cancelled. Cleared
11345
+ * when the next message starts.
11346
+ */
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
+ };
11317
11356
  /**
11318
11357
  * SessionEventActor
11319
11358
  * @description The event's initiator, when known; never inferred from resource ownership.
@@ -11527,8 +11566,7 @@ interface components {
11527
11566
  };
11528
11567
  /**
11529
11568
  * SessionMessage
11530
- * @description One message in a session's inbox: what a queued message renders and
11531
- * retires on. The webhook provenance internals stay off the wire.
11569
+ * @description One message sent to a session.
11532
11570
  */
11533
11571
  SessionMessage: {
11534
11572
  /**
@@ -11544,19 +11582,9 @@ interface components {
11544
11582
  /**
11545
11583
  * Created At
11546
11584
  * Format: date-time
11547
- * @description When the message was created.
11585
+ * @description When the message was received.
11548
11586
  */
11549
11587
  created_at: string;
11550
- /**
11551
- * Delivered At
11552
- * @description When the message was delivered to the agent, if it has been.
11553
- */
11554
- delivered_at?: string | null;
11555
- /**
11556
- * Feed Seq
11557
- * @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.
11558
- */
11559
- feed_seq?: number | null;
11560
11588
  /**
11561
11589
  * Id
11562
11590
  * @description Unique identifier of the message.
@@ -11568,24 +11596,15 @@ interface components {
11568
11596
  */
11569
11597
  images?: components['schemas']['SessionMessageImage'][];
11570
11598
  /**
11571
- * Sender Attribution Id
11572
- * @description Identifier of the principal that sent the message, if attributed.
11599
+ * Index
11600
+ * @description Position in the session, starting at 0.
11573
11601
  */
11574
- sender_attribution_id?: string | null;
11575
- /** @description Kind of principal that sent the message, if attributed. */
11576
- sender_attribution_type?: components['schemas']['AttributionType'] | null;
11602
+ index: number;
11577
11603
  /**
11578
11604
  * Session Id
11579
11605
  * @description Identifier of the session the message belongs to.
11580
11606
  */
11581
11607
  session_id: string;
11582
- /** @description Delivery status of the message. */
11583
- status: components['schemas']['SessionMessageStatus'];
11584
- /**
11585
- * Turn Id
11586
- * @description The turn created to answer this message. Wait on it: the message is answered when that turn reaches a final status.
11587
- */
11588
- turn_id?: string | null;
11589
11608
  };
11590
11609
  /**
11591
11610
  * SessionMessageImage
@@ -11611,24 +11630,17 @@ interface components {
11611
11630
  };
11612
11631
  /**
11613
11632
  * SessionMessageResponse
11614
- * @description One inbox message and the turn created to answer it.
11633
+ * @description One message sent to a session.
11615
11634
  */
11616
11635
  SessionMessageResponse: {
11617
- /** @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. */
11618
11637
  message: components['schemas']['SessionMessage'];
11619
- /** @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. */
11620
- turn: components['schemas']['SessionTurn'];
11621
11638
  };
11622
- /**
11623
- * SessionMessageStatus
11624
- * @enum {string}
11625
- */
11626
- SessionMessageStatus: 'pending' | 'delivered';
11627
11639
  /**
11628
11640
  * SessionOutput
11629
- * @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
11630
11642
  * submitted one, the payload. `result` is None while the session runs and
11631
- * 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
11632
11644
  * shape of `json_schema`.
11633
11645
  */
11634
11646
  SessionOutput: {
@@ -11641,7 +11653,7 @@ interface components {
11641
11653
  };
11642
11654
  /**
11643
11655
  * Result
11644
- * @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.
11645
11657
  */
11646
11658
  result: {
11647
11659
  [key: string]: unknown;
@@ -11790,8 +11802,7 @@ interface components {
11790
11802
  };
11791
11803
  /**
11792
11804
  * SessionRecordsListResponse
11793
- * @description A session's stored transcript records, plus its pending inbox
11794
- * messages.
11805
+ * @description A session's log: everything that happened, oldest first.
11795
11806
  */
11796
11807
  SessionRecordsListResponse: {
11797
11808
  /**
@@ -11805,12 +11816,6 @@ interface components {
11805
11816
  * @default false
11806
11817
  */
11807
11818
  has_more: boolean;
11808
- /**
11809
- * Messages
11810
- * @description The open inbox slice (pending rows only): queued messages not yet consumed by a turn. Delivered history comes from the records themselves.
11811
- * @default []
11812
- */
11813
- messages: components['schemas']['SessionMessage'][];
11814
11819
  /**
11815
11820
  * Next Cursor
11816
11821
  * @description Pass as `cursor` to fetch the next page. Null on the last page. Opaque — echo it back rather than parsing it.
@@ -11818,7 +11823,7 @@ interface components {
11818
11823
  next_cursor?: string | null;
11819
11824
  /**
11820
11825
  * Records
11821
- * @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.
11822
11827
  */
11823
11828
  records: components['schemas']['SessionRecord'][];
11824
11829
  };
@@ -11885,27 +11890,15 @@ interface components {
11885
11890
  tokens: number;
11886
11891
  };
11887
11892
  /**
11888
- * SessionState
11889
- * @description Whether the conversation can still take messages. `closed` is permanent:
11890
- * a session with interactive false closes when its turn ends, and a conversation closes
11891
- * 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.
11892
11899
  * @enum {string}
11893
11900
  */
11894
- SessionState: 'open' | 'closed';
11895
- /**
11896
- * SessionStopped
11897
- * @description When a stop was requested and the GitHub user who requested it.
11898
- */
11899
- SessionStopped: {
11900
- /**
11901
- * At
11902
- * Format: date-time
11903
- * @description When a stop was requested.
11904
- */
11905
- at: string;
11906
- /** @description The GitHub user who stopped the session, resolved at read time. Null if the user is unknown or unavailable. */
11907
- by: components['schemas']['GithubAccountSnippet'] | null;
11908
- };
11901
+ SessionStatus: 'queued' | 'preparing' | 'running' | 'idle' | 'closed';
11909
11902
  /**
11910
11903
  * SessionSummary
11911
11904
  * @description A live one-line summary of what the session is doing, refreshed
@@ -11930,80 +11923,6 @@ interface components {
11930
11923
  /** Name */
11931
11924
  name: string;
11932
11925
  };
11933
- /**
11934
- * SessionTurn
11935
- * @description One message and the agent's answer to it. A turn is `queued` from the
11936
- * moment its message is received, `preparing` while its environment is set
11937
- * up, `running` while the agent works, then `completed`, `failed`,
11938
- * `stopped`, or `cancelled`.
11939
- */
11940
- SessionTurn: {
11941
- /** @description What the turn cost so far, in millicents, broken down by leg. */
11942
- cost: components['schemas']['Cost'];
11943
- /**
11944
- * Created At
11945
- * Format: date-time
11946
- * @description When the turn's message was received.
11947
- */
11948
- created_at: string;
11949
- /**
11950
- * Detail
11951
- * @description A human-readable explanation of a failed, stopped, or cancelled turn, or of why a queued turn waits.
11952
- */
11953
- detail: string | null;
11954
- /**
11955
- * Ended At
11956
- * @description When the turn reached its final status.
11957
- */
11958
- ended_at: string | null;
11959
- /**
11960
- * Id
11961
- * @description Unique identifier of the turn.
11962
- */
11963
- id: string;
11964
- /**
11965
- * Index
11966
- * @description Position in the session, starting at 0.
11967
- */
11968
- index: number;
11969
- /** @description Why the turn failed or was cancelled; null on every other status. */
11970
- reason: components['schemas']['TurnReason'] | null;
11971
- /**
11972
- * Started At
11973
- * @description When the agent started on the message.
11974
- */
11975
- started_at: string | null;
11976
- /** @description Where the turn is. */
11977
- status: components['schemas']['TurnStatus'];
11978
- /** @description When and by whom a stop was requested; null when none was. */
11979
- stopped: components['schemas']['SessionStopped'] | null;
11980
- /** @description The tokens the turn spent and the model they went to. */
11981
- tokens: components['schemas']['Tokens'];
11982
- };
11983
- /**
11984
- * SessionTurnResponse
11985
- * @description One turn.
11986
- */
11987
- SessionTurnResponse: {
11988
- /** @description The turn. */
11989
- turn: components['schemas']['SessionTurn'];
11990
- };
11991
- /**
11992
- * SessionTurnsListResponse
11993
- * @description A session's turns and its whole inbox, oldest first.
11994
- */
11995
- SessionTurnsListResponse: {
11996
- /**
11997
- * Messages
11998
- * @description Every message, delivered and pending, oldest first.
11999
- */
12000
- messages: components['schemas']['SessionMessage'][];
12001
- /**
12002
- * Turns
12003
- * @description Every turn, ordered by index.
12004
- */
12005
- turns: components['schemas']['SessionTurn'][];
12006
- };
12007
11926
  /** SessionUsageBucket */
12008
11927
  SessionUsageBucket: {
12009
11928
  /**
@@ -12053,6 +11972,13 @@ interface components {
12053
11972
  * @default false
12054
11973
  */
12055
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
+ };
12056
11982
  /**
12057
11983
  * Next Cursor
12058
11984
  * @description Pass as `cursor` to fetch the next page. Null on the last page. Opaque — echo it back rather than parsing it.
@@ -12067,10 +11993,6 @@ interface components {
12067
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.
12068
11994
  */
12069
11995
  sessions: components['schemas']['Session'][];
12070
- /** Turn Counts */
12071
- turn_counts?: {
12072
- [key: string]: number;
12073
- };
12074
11996
  };
12075
11997
  /**
12076
11998
  * SettingsRef
@@ -12485,7 +12407,7 @@ interface components {
12485
12407
  claude_code?: components['schemas']['ClaudeOverrides'] | null;
12486
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. */
12487
12409
  codex?: components['schemas']['CodexOverrides'] | null;
12488
- /** @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. */
12489
12411
  conversation?: components['schemas']['SessionConversationConfig-Input'];
12490
12412
  /**
12491
12413
  * Environment
@@ -12501,7 +12423,7 @@ interface components {
12501
12423
  gemini?: components['schemas']['GeminiOverrides'] | null;
12502
12424
  /**
12503
12425
  * Images
12504
- * @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.
12505
12427
  */
12506
12428
  images?: components['schemas']['ImageAttachment'][];
12507
12429
  /**
@@ -12585,7 +12507,7 @@ interface components {
12585
12507
  claude_code?: components['schemas']['ClaudeConfig-Input'] | null;
12586
12508
  /** @description Codex input and native options. Set exactly one of claude_code, codex, or gemini. */
12587
12509
  codex?: components['schemas']['CodexConfig-Input'] | null;
12588
- /** @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. */
12589
12511
  conversation?: components['schemas']['SessionConversationConfig-Input'];
12590
12512
  /**
12591
12513
  * Environment
@@ -12601,7 +12523,7 @@ interface components {
12601
12523
  gemini?: components['schemas']['GeminiConfig-Input'] | null;
12602
12524
  /**
12603
12525
  * Images
12604
- * @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.
12605
12527
  */
12606
12528
  images?: components['schemas']['ImageAttachment'][];
12607
12529
  /**
@@ -12771,269 +12693,6 @@ interface components {
12771
12693
  /** Skipped */
12772
12694
  skipped: number;
12773
12695
  };
12774
- /**
12775
- * TurnEndedPayload
12776
- * @description turn_ended: the turn reached its final status. `status`, `reason`, and
12777
- * `detail` match the turn on the session object.
12778
- */
12779
- TurnEndedPayload: {
12780
- /** Detail */
12781
- detail?: string | null;
12782
- /** Duration Ms */
12783
- duration_ms?: number | null;
12784
- /** Reason */
12785
- reason?: string | null;
12786
- /** Status */
12787
- status: string;
12788
- /** Turn Id */
12789
- turn_id: string;
12790
- /** Turn Index */
12791
- turn_index: number;
12792
- } & {
12793
- [key: string]: unknown;
12794
- };
12795
- /** TurnEndedRecord */
12796
- TurnEndedRecord: {
12797
- /** Cost */
12798
- cost: number | null;
12799
- /**
12800
- * Created At
12801
- * Format: date-time
12802
- */
12803
- created_at: string;
12804
- /** Duration */
12805
- duration: number | null;
12806
- /**
12807
- * Feed Seq
12808
- * @description Position in the session feed and the stream's resume cursor.
12809
- */
12810
- feed_seq: number;
12811
- /**
12812
- * Id
12813
- * @description Unique identifier of the record.
12814
- */
12815
- id: string;
12816
- /**
12817
- * Kind
12818
- * @default platform
12819
- * @constant
12820
- */
12821
- kind: 'platform';
12822
- /** Model */
12823
- model: string | null;
12824
- payload: components['schemas']['TurnEndedPayload'];
12825
- /**
12826
- * Record Format
12827
- * @default ellipsis_lifecycle@1
12828
- * @constant
12829
- */
12830
- record_format: 'ellipsis_lifecycle@1';
12831
- /**
12832
- * @description discriminator enum property added by openapi-typescript
12833
- * @enum {string}
12834
- */
12835
- record_type: 'turn_ended';
12836
- /**
12837
- * Session Id
12838
- * @description Session containing this record.
12839
- */
12840
- session_id: string;
12841
- /**
12842
- * Session Message Id
12843
- * @description Message this record receives, delivers, requeues, or echoes.
12844
- */
12845
- session_message_id: string | null;
12846
- /**
12847
- * Source
12848
- * @default lifecycle
12849
- * @constant
12850
- */
12851
- source: 'lifecycle';
12852
- tokens_info: components['schemas']['TokensInfo'] | null;
12853
- /** Tools */
12854
- tools: string[] | null;
12855
- /**
12856
- * Turn Id
12857
- * @description Turn containing this record, when applicable.
12858
- */
12859
- turn_id: string | null;
12860
- };
12861
- /**
12862
- * TurnQueuedPayload
12863
- * @description turn_queued: the turn waits because the account already has
12864
- * `sessions_alive` sessions alive, its limit.
12865
- */
12866
- TurnQueuedPayload: {
12867
- /** Limit */
12868
- limit: number;
12869
- /** Sessions Alive */
12870
- sessions_alive: number;
12871
- /** Turn Id */
12872
- turn_id: string;
12873
- } & {
12874
- [key: string]: unknown;
12875
- };
12876
- /** TurnQueuedRecord */
12877
- TurnQueuedRecord: {
12878
- /** Cost */
12879
- cost: number | null;
12880
- /**
12881
- * Created At
12882
- * Format: date-time
12883
- */
12884
- created_at: string;
12885
- /** Duration */
12886
- duration: number | null;
12887
- /**
12888
- * Feed Seq
12889
- * @description Position in the session feed and the stream's resume cursor.
12890
- */
12891
- feed_seq: number;
12892
- /**
12893
- * Id
12894
- * @description Unique identifier of the record.
12895
- */
12896
- id: string;
12897
- /**
12898
- * Kind
12899
- * @default platform
12900
- * @constant
12901
- */
12902
- kind: 'platform';
12903
- /** Model */
12904
- model: string | null;
12905
- payload: components['schemas']['TurnQueuedPayload'];
12906
- /**
12907
- * Record Format
12908
- * @default ellipsis_lifecycle@1
12909
- * @constant
12910
- */
12911
- record_format: 'ellipsis_lifecycle@1';
12912
- /**
12913
- * @description discriminator enum property added by openapi-typescript
12914
- * @enum {string}
12915
- */
12916
- record_type: 'turn_queued';
12917
- /**
12918
- * Session Id
12919
- * @description Session containing this record.
12920
- */
12921
- session_id: string;
12922
- /**
12923
- * Session Message Id
12924
- * @description Message this record receives, delivers, requeues, or echoes.
12925
- */
12926
- session_message_id: string | null;
12927
- /**
12928
- * Source
12929
- * @default lifecycle
12930
- * @constant
12931
- */
12932
- source: 'lifecycle';
12933
- tokens_info: components['schemas']['TokensInfo'] | null;
12934
- /** Tools */
12935
- tools: string[] | null;
12936
- /**
12937
- * Turn Id
12938
- * @description Turn containing this record, when applicable.
12939
- */
12940
- turn_id: string | null;
12941
- };
12942
- /**
12943
- * TurnReason
12944
- * @description Why a turn failed or was cancelled. Null on every other outcome.
12945
- * @enum {string}
12946
- */
12947
- 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';
12948
- /**
12949
- * TurnStartedPayload
12950
- * @description turn_started: the agent started on the turn's message.
12951
- */
12952
- TurnStartedPayload: {
12953
- /** Turn Id */
12954
- turn_id: string;
12955
- /** Turn Index */
12956
- turn_index: number;
12957
- } & {
12958
- [key: string]: unknown;
12959
- };
12960
- /** TurnStartedRecord */
12961
- TurnStartedRecord: {
12962
- /** Cost */
12963
- cost: number | null;
12964
- /**
12965
- * Created At
12966
- * Format: date-time
12967
- */
12968
- created_at: string;
12969
- /** Duration */
12970
- duration: number | null;
12971
- /**
12972
- * Feed Seq
12973
- * @description Position in the session feed and the stream's resume cursor.
12974
- */
12975
- feed_seq: number;
12976
- /**
12977
- * Id
12978
- * @description Unique identifier of the record.
12979
- */
12980
- id: string;
12981
- /**
12982
- * Kind
12983
- * @default platform
12984
- * @constant
12985
- */
12986
- kind: 'platform';
12987
- /** Model */
12988
- model: string | null;
12989
- payload: components['schemas']['TurnStartedPayload'];
12990
- /**
12991
- * Record Format
12992
- * @default ellipsis_lifecycle@1
12993
- * @constant
12994
- */
12995
- record_format: 'ellipsis_lifecycle@1';
12996
- /**
12997
- * @description discriminator enum property added by openapi-typescript
12998
- * @enum {string}
12999
- */
13000
- record_type: 'turn_started';
13001
- /**
13002
- * Session Id
13003
- * @description Session containing this record.
13004
- */
13005
- session_id: string;
13006
- /**
13007
- * Session Message Id
13008
- * @description Message this record receives, delivers, requeues, or echoes.
13009
- */
13010
- session_message_id: string | null;
13011
- /**
13012
- * Source
13013
- * @default lifecycle
13014
- * @constant
13015
- */
13016
- source: 'lifecycle';
13017
- tokens_info: components['schemas']['TokensInfo'] | null;
13018
- /** Tools */
13019
- tools: string[] | null;
13020
- /**
13021
- * Turn Id
13022
- * @description Turn containing this record, when applicable.
13023
- */
13024
- turn_id: string | null;
13025
- };
13026
- /**
13027
- * TurnStatus
13028
- * @description Where one turn is: waiting, preparing, being answered, or over.
13029
- *
13030
- * `queued` turns wait to start, behind another turn or for a free session
13031
- * slot on the account. `preparing` turns wait while the environment is set
13032
- * up. `stopped` and `cancelled` are their own outcomes; `reason` explains a
13033
- * `failed` or `cancelled` turn.
13034
- * @enum {string}
13035
- */
13036
- TurnStatus: 'queued' | 'preparing' | 'running' | 'completed' | 'failed' | 'stopped' | 'cancelled';
13037
12696
  /** UninstallGithubAppRequest */
13038
12697
  UninstallGithubAppRequest: {
13039
12698
  /** Confirm Account Login */
@@ -13069,6 +12728,11 @@ interface components {
13069
12728
  * @constant
13070
12729
  */
13071
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;
13072
12736
  /** Model */
13073
12737
  model: string | null;
13074
12738
  /** Payload */
@@ -13090,11 +12754,6 @@ interface components {
13090
12754
  * @description Session containing this record.
13091
12755
  */
13092
12756
  session_id: string;
13093
- /**
13094
- * Session Message Id
13095
- * @description Message this record receives, delivers, requeues, or echoes.
13096
- */
13097
- session_message_id: string | null;
13098
12757
  /**
13099
12758
  * Source
13100
12759
  * @description Original producer. Unknown producers remain readable as unknown records.
@@ -13103,11 +12762,6 @@ interface components {
13103
12762
  tokens_info: components['schemas']['TokensInfo'] | null;
13104
12763
  /** Tools */
13105
12764
  tools: string[] | null;
13106
- /**
13107
- * Turn Id
13108
- * @description Turn containing this record, when applicable.
13109
- */
13110
- turn_id: string | null;
13111
12765
  };
13112
12766
  /**
13113
12767
  * UpdateAgentRequest
@@ -17641,8 +17295,8 @@ interface operations {
17641
17295
  author_id?: number | null;
17642
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. */
17643
17297
  repo?: string | null;
17644
- /** @description Keep only sessions whose current turn is queued, preparing, or running. */
17645
- unfinished?: boolean;
17298
+ /** @description Keep only sessions in these statuses. */
17299
+ status?: components['schemas']['SessionStatus'][] | null;
17646
17300
  };
17647
17301
  header?: {
17648
17302
  'user-agent'?: string | null;
@@ -17778,8 +17432,8 @@ interface operations {
17778
17432
  session_ids?: string[] | null;
17779
17433
  /** @description "owner/name" (exact) or a bare repo name; ORed. */
17780
17434
  repo?: string[] | null;
17781
- /** @description Current turn statuses to keep. */
17782
- status?: components['schemas']['TurnStatus'][] | null;
17435
+ /** @description Keep only sessions in these statuses. */
17436
+ status?: components['schemas']['SessionStatus'][] | null;
17783
17437
  start?: string | null;
17784
17438
  end?: string | null;
17785
17439
  limit?: number;
@@ -18363,6 +18017,8 @@ interface operations {
18363
18017
  query?: {
18364
18018
  cursor?: string | null;
18365
18019
  limit?: number | null;
18020
+ /** @description Keep only the records of this message. */
18021
+ message_id?: string | null;
18366
18022
  };
18367
18023
  header?: {
18368
18024
  'user-agent'?: string | null;
@@ -18470,7 +18126,7 @@ interface operations {
18470
18126
  'application/json': components['schemas']['ErrorResponse'];
18471
18127
  };
18472
18128
  };
18473
- /** @description No turn is queued, preparing, or running. */
18129
+ /** @description The session is idle or closed. */
18474
18130
  409: {
18475
18131
  headers: {
18476
18132
  [name: string]: unknown;
@@ -18614,127 +18270,6 @@ interface operations {
18614
18270
  };
18615
18271
  };
18616
18272
  };
18617
- get_session_turns: {
18618
- parameters: {
18619
- query?: never;
18620
- header?: {
18621
- 'user-agent'?: string | null;
18622
- };
18623
- path: {
18624
- id: string;
18625
- };
18626
- cookie?: never;
18627
- };
18628
- requestBody?: never;
18629
- responses: {
18630
- /** @description Successful Response */
18631
- 200: {
18632
- headers: {
18633
- [name: string]: unknown;
18634
- };
18635
- content: {
18636
- 'application/json': components['schemas']['SessionTurnsListResponse'];
18637
- };
18638
- };
18639
- /** @description The bearer token is missing, invalid, or revoked. */
18640
- 401: {
18641
- headers: {
18642
- [name: string]: unknown;
18643
- };
18644
- content: {
18645
- 'application/json': components['schemas']['ErrorResponse'];
18646
- };
18647
- };
18648
- /** @description The credential may not perform this action, or the account is blocked. */
18649
- 403: {
18650
- headers: {
18651
- [name: string]: unknown;
18652
- };
18653
- content: {
18654
- 'application/json': components['schemas']['ErrorResponse'];
18655
- };
18656
- };
18657
- /** @description No such session in your account. */
18658
- 404: {
18659
- headers: {
18660
- [name: string]: unknown;
18661
- };
18662
- content: {
18663
- 'application/json': components['schemas']['ErrorResponse'];
18664
- };
18665
- };
18666
- /** @description Validation Error */
18667
- 422: {
18668
- headers: {
18669
- [name: string]: unknown;
18670
- };
18671
- content: {
18672
- 'application/json': components['schemas']['HTTPValidationError'];
18673
- };
18674
- };
18675
- };
18676
- };
18677
- get_session_turn: {
18678
- parameters: {
18679
- query?: never;
18680
- header?: {
18681
- 'user-agent'?: string | null;
18682
- };
18683
- path: {
18684
- session_id: string;
18685
- id: string;
18686
- };
18687
- cookie?: never;
18688
- };
18689
- requestBody?: never;
18690
- responses: {
18691
- /** @description Successful Response */
18692
- 200: {
18693
- headers: {
18694
- [name: string]: unknown;
18695
- };
18696
- content: {
18697
- 'application/json': components['schemas']['SessionTurnResponse'];
18698
- };
18699
- };
18700
- /** @description The bearer token is missing, invalid, or revoked. */
18701
- 401: {
18702
- headers: {
18703
- [name: string]: unknown;
18704
- };
18705
- content: {
18706
- 'application/json': components['schemas']['ErrorResponse'];
18707
- };
18708
- };
18709
- /** @description The credential may not perform this action, or the account is blocked. */
18710
- 403: {
18711
- headers: {
18712
- [name: string]: unknown;
18713
- };
18714
- content: {
18715
- 'application/json': components['schemas']['ErrorResponse'];
18716
- };
18717
- };
18718
- /** @description No such session or turn in your account. */
18719
- 404: {
18720
- headers: {
18721
- [name: string]: unknown;
18722
- };
18723
- content: {
18724
- 'application/json': components['schemas']['ErrorResponse'];
18725
- };
18726
- };
18727
- /** @description Validation Error */
18728
- 422: {
18729
- headers: {
18730
- [name: string]: unknown;
18731
- };
18732
- content: {
18733
- 'application/json': components['schemas']['HTTPValidationError'];
18734
- };
18735
- };
18736
- };
18737
- };
18738
18273
  get_slack_help: {
18739
18274
  parameters: {
18740
18275
  query?: never;
@@ -19923,12 +19458,7 @@ interface operations {
19923
19458
  /**
19924
19459
  * One server-to-client frame of the Ellipsis session stream (WS /v1/sessions/{id}/stream). Clients ignore frames with unknown `type` values.
19925
19460
  */
19926
- type SessionStreamFrame = SnapshotFrame | RecordsAppendFrame | SessionFrame | DeltaFrame | HeartbeatFrame | DoneFrame | ErrorFrame;
19927
- type AttributionType = 'github_user' | 'linear_user' | 'slack_user' | 'api_key';
19928
- /**
19929
- * Delivery status of the message.
19930
- */
19931
- type SessionMessageStatus = 'pending' | 'delivered';
19461
+ type SessionStreamFrame = SessionFrame | RecordsFrame | DeltaFrame | HeartbeatFrame | ErrorFrame;
19932
19462
  /**
19933
19463
  * The session's current state.
19934
19464
  */
@@ -19961,6 +19491,10 @@ type Session = {
19961
19491
  */
19962
19492
  created_at: string;
19963
19493
  environment: SessionEnvironment;
19494
+ /**
19495
+ * Why the last message failed, was stopped, or was cancelled; null otherwise.
19496
+ */
19497
+ error: SessionError | null;
19964
19498
  /**
19965
19499
  * The typed external event that started the session; null for direct and scheduled starts.
19966
19500
  */
@@ -19988,7 +19522,7 @@ type Session = {
19988
19522
  [k: string]: string;
19989
19523
  };
19990
19524
  /**
19991
- * 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`.
19992
19526
  */
19993
19527
  output: SessionOutput | null;
19994
19528
  /**
@@ -20001,15 +19535,12 @@ type Session = {
20001
19535
  */
20002
19536
  skills: SkillRef[];
20003
19537
  source: SessionSource;
19538
+ status: SessionStatus;
20004
19539
  /**
20005
19540
  * The latest live summary of the session's progress while it runs, and when it was generated.
20006
19541
  */
20007
19542
  summary: SessionSummary | null;
20008
19543
  tokens: Tokens;
20009
- /**
20010
- * 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.
20011
- */
20012
- turn: SessionTurn | null;
20013
19544
  /**
20014
19545
  * When the session was last updated.
20015
19546
  */
@@ -20133,14 +19664,11 @@ type StatusAction = 'pending' | 'passed' | 'failed' | 'errored';
20133
19664
  */
20134
19665
  type WorkflowRunAction = 'requested' | 'queued' | 'waiting' | 'pending' | 'started' | 'passed' | 'failed' | 'timed_out' | 'cancelled' | 'skipped' | 'neutral' | 'action_required' | 'stale' | 'startup_failure';
20135
19666
  type GithubAccountType = 'User' | 'Organization' | 'Bot' | 'Mannequin';
19667
+ type AttributionType = 'github_user' | 'linear_user' | 'slack_user' | 'api_key';
20136
19668
  /**
20137
19669
  * Why direct prompting is refused. Absent when prompting is allowed.
20138
19670
  */
20139
19671
  type PromptBlockedReason = 'mention_surface' | 'non_interactive' | 'harness_single_turn' | 'budget_exhausted' | 'closed';
20140
- /**
20141
- * `open` while the session can take messages; `closed` is permanent.
20142
- */
20143
- type SessionState = 'open' | 'closed';
20144
19672
  /**
20145
19673
  * How a session's environment was chosen. None (the field is nullable)
20146
19674
  * when the config carried an inline environment block and no resolution ran —
@@ -20150,6 +19678,10 @@ type SessionState = 'open' | 'closed';
20150
19678
  * how it was chosen, and is null for the built-in basic environment.
20151
19679
  */
20152
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';
20153
19685
  /**
20154
19686
  * The service the handler responds to.
20155
19687
  */
@@ -20159,320 +19691,136 @@ type HandlerService = 'slack' | 'github' | 'linear' | 'sentry';
20159
19691
  */
20160
19692
  type SessionSource = 'react' | 'code_review' | 'web' | 'api' | 'cli' | 'mention' | 'cron';
20161
19693
  /**
20162
- * Why a turn failed or was cancelled. Null on every other outcome.
20163
- */
20164
- 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';
20165
- /**
20166
- * 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.
20167
19695
  */
20168
- type TurnStatus = 'queued' | 'preparing' | 'running' | 'completed' | 'failed' | 'stopped' | 'cancelled';
19696
+ type SessionStatus = 'queued' | 'preparing' | 'running' | 'idle' | 'closed';
20169
19697
  type SessionRecord$1 = ClaudeSessionRecord | ClaudeNativeSessionRecord | CodexSessionRecord | CodexAppServerSessionRecord | GeminiSessionRecord | PlatformSessionRecord | UnknownSessionRecord;
20170
19698
  type CodexAppServerNotification = CodexThreadStarted | CodexTurnStarted | CodexTurnCompleted | CodexItemStarted | CodexItemCompleted | CodexTokenUsageUpdated | CodexAppServerError;
20171
19699
  type CodexAppServerItem = CodexUserMessage | CodexAgentMessage | CodexReasoning | CodexPlan | CodexCommandExecution | CodexFileChange | CodexWebSearch | CodexMcpToolCall | CodexContextCompaction | CodexSubAgentActivity | CodexCollabAgentToolCall;
20172
19700
  type CodexUserInput = CodexTextInput | CodexLocalImageInput;
20173
19701
  type GeminiStreamEvent$1 = GeminiInitEvent | GeminiMessageEvent | GeminiToolUseEvent | GeminiToolResultEvent | GeminiErrorEvent | GeminiResultEvent;
20174
- type PlatformSessionRecord = SessionClosedRecord | MessageReceivedRecord | MessageDeliveredRecord | MessageRequeuedRecord | TurnQueuedRecord | TurnStartedRecord | TurnEndedRecord | EnvironmentPhaseRecord | EnvironmentOutputRecord | EnvironmentReadyRecord;
19702
+ type PlatformSessionRecord = SessionClosedRecord | MessageRecord | MessageQueuedRecord | MessageStartedRecord | MessageEndedRecord | MessageRequeuedRecord | EnvironmentPhaseRecord | EnvironmentOutputRecord | EnvironmentReadyRecord;
20175
19703
  /**
20176
- * 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.
20177
19707
  */
20178
- type Session1 = {
20179
- /**
20180
- * The agent the session was started from, or null for a raw session started with POST /v1/sessions.
20181
- */
20182
- agent: SessionAgent | null;
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;
20183
19720
  /**
20184
- * When and by whom the session was archived; null when unarchived. Archiving does not stop or close a session.
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.
20185
19722
  */
20186
- archived: SessionArchived | null;
20187
- attribution: SessionAttribution;
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 {
20188
19794
  /**
20189
- * The spend budget enforced for this session, in millicents, after resolving defaults and ceilings.
19795
+ * The most the agent may spend over the last day, in US dollars.
20190
19796
  */
20191
- budget: number;
19797
+ day: number | null;
20192
19798
  /**
20193
- * Claude Code 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.
20194
19800
  */
20195
- claude_code: ClaudeConfig | null;
19801
+ month: number | null;
20196
19802
  /**
20197
- * Codex input and native options. Set exactly one of claude_code, codex, or gemini.
19803
+ * The most one session may spend, in US dollars.
20198
19804
  */
20199
- codex: CodexConfig | null;
20200
- conversation: SessionConversation;
20201
- cost: Cost;
19805
+ session: number | null;
20202
19806
  /**
20203
- * When the session was created.
19807
+ * The most the agent may spend over the last 7 days, in US dollars.
20204
19808
  */
20205
- created_at: string;
20206
- environment: SessionEnvironment;
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;
20207
19818
  /**
20208
- * The typed external event that started the session; null for direct and scheduled starts.
19819
+ * The model the session runs on: an alias or canonical id from the models table. Required.
20209
19820
  */
20210
- event: (GithubPullRequestEvent | GithubIssueEvent | GithubPushEvent | GithubCheckRunEvent | GithubCheckSuiteEvent | GithubWorkflowRunEvent | GithubStatusEvent | GithubReleaseEvent | LinearIssueEvent | SlackMessageEvent | SlackChannelCreatedEvent | SentryAlertEvent) | null;
19821
+ model: string;
20211
19822
  /**
20212
- * Gemini CLI input and native options. Set exactly one of claude_code, codex, or gemini.
20213
- */
20214
- gemini: GeminiConfig | null;
20215
- /**
20216
- * 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.
20217
- */
20218
- git: SessionGit | null;
20219
- /**
20220
- * 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.
20221
- */
20222
- handler: SessionHandler | null;
20223
- /**
20224
- * Unique identifier of the session.
20225
- */
20226
- id: string;
20227
- /**
20228
- * Caller-supplied metadata key-value pairs.
20229
- */
20230
- metadata: {
20231
- [k: string]: string;
20232
- };
20233
- /**
20234
- * The session's structured output: the `json_schema` the agent must satisfy and, once a turn has submitted it, the `result`.
20235
- */
20236
- output: SessionOutput | null;
20237
- /**
20238
- * The predecessor session this session continues; null when there is none.
20239
- */
20240
- parent: SessionParent | null;
20241
- permissions: PermissionsConfig1;
20242
- /**
20243
- * Skills installed for this session.
20244
- */
20245
- skills: SkillRef[];
20246
- source: SessionSource;
20247
- /**
20248
- * The latest live summary of the session's progress while it runs, and when it was generated.
20249
- */
20250
- summary: SessionSummary | null;
20251
- tokens: Tokens;
20252
- /**
20253
- * 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.
20254
- */
20255
- turn: SessionTurn | null;
20256
- /**
20257
- * When the session was last updated.
20258
- */
20259
- updated_at: string;
20260
- } & ({
20261
- claude_code: {
20262
- [k: string]: unknown;
20263
- };
20264
- codex: null;
20265
- gemini: null;
20266
- } | {
20267
- claude_code: null;
20268
- codex: {
20269
- [k: string]: unknown;
20270
- };
20271
- gemini: null;
20272
- } | {
20273
- claude_code: null;
20274
- codex: null;
20275
- gemini: {
20276
- [k: string]: unknown;
20277
- };
20278
- });
20279
- /**
20280
- * The first frame after the stream connects: the session plus its open
20281
- * inbox. Records always arrive separately via records_append frames.
20282
- */
20283
- interface SnapshotFrame {
20284
- /**
20285
- * 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.
20286
- */
20287
- earliest_feed_seq: number | null;
20288
- /**
20289
- * The session's open (pending) inbox messages.
20290
- */
20291
- messages: SessionMessage[];
20292
- session: Session;
20293
- type: 'snapshot';
20294
- }
20295
- /**
20296
- * One message in a session's inbox: what a queued message renders and
20297
- * retires on. The webhook provenance internals stay off the wire.
20298
- */
20299
- interface SessionMessage {
20300
- /**
20301
- * Display attribution of the message's sender.
20302
- */
20303
- author: string | null;
20304
- /**
20305
- * The message text, with one `[Image #N]` placeholder per attached image.
20306
- */
20307
- body: string;
20308
- /**
20309
- * When the message was created.
20310
- */
20311
- created_at: string;
20312
- /**
20313
- * When the message was delivered to the agent, if it has been.
20314
- */
20315
- delivered_at: string | null;
20316
- /**
20317
- * 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.
20318
- */
20319
- feed_seq: number | null;
20320
- /**
20321
- * Unique identifier of the message.
20322
- */
20323
- id: string;
20324
- /**
20325
- * Images attached to the message, metadata only: index, media type, size. The bytes go to the model, never over the stream.
20326
- */
20327
- images: SessionMessageImage[];
20328
- /**
20329
- * Identifier of the principal that sent the message, if attributed.
20330
- */
20331
- sender_attribution_id: string | null;
20332
- /**
20333
- * Kind of principal that sent the message, if attributed.
20334
- */
20335
- sender_attribution_type: AttributionType | null;
20336
- /**
20337
- * Identifier of the session the message belongs to.
20338
- */
20339
- session_id: string;
20340
- status: SessionMessageStatus;
20341
- /**
20342
- * The turn created to answer this message. Wait on it: the message is answered when that turn reaches a final status.
20343
- */
20344
- turn_id: string | null;
20345
- }
20346
- /**
20347
- * One image on a message, metadata only. `index` is the N in the
20348
- * `[Image #N]` placeholder in the message body.
20349
- */
20350
- interface SessionMessageImage {
20351
- /**
20352
- * 1-based position: the N in `[Image #N]`.
20353
- */
20354
- index: number;
20355
- /**
20356
- * The image's MIME type.
20357
- */
20358
- media_type: string;
20359
- /**
20360
- * Size of the decoded image, in bytes.
20361
- */
20362
- size_bytes: number;
20363
- }
20364
- /**
20365
- * The agent this session was started from: the definition frozen
20366
- * when the session was created, and the saved agent it came from as it
20367
- * exists NOW. They diverge legitimately — a YAML edit after the session
20368
- * started leaves the pointer describing something the session never ran.
20369
- */
20370
- interface SessionAgent {
20371
- config: AgentConfig;
20372
- /**
20373
- * 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.
20374
- */
20375
- id: string | null;
20376
- }
20377
- /**
20378
- * The agent definition the session was started from, frozen when the session was created.
20379
- */
20380
- interface AgentConfig {
20381
- ellipsis: AgentIdentity;
20382
- input: InputContract | null;
20383
- session: SessionConfig;
20384
- trigger: (CronTrigger | ReactTrigger) | null;
20385
- }
20386
- /**
20387
- * The Ellipsis product namespace for a config file: which schema this is
20388
- * (`version`), the human-facing identity (`name`/`description`), freeform
20389
- * organizational `metadata`, and whether the agent is `enabled`. The
20390
- * presence of a top-level `ellipsis:` mapping is what marks a YAML file as
20391
- * an Ellipsis agent (vs arbitrary YAML that merely lives under a
20392
- * config directory) — see `yaml_is_ellipsis_config`.
20393
- *
20394
- * `enabled` is agent behavior, not freeform metadata, so it stays inside
20395
- * the config `sha` (only `metadata` is sha-excluded).
20396
- */
20397
- interface AgentIdentity {
20398
- description: string | null;
20399
- enabled: boolean;
20400
- kind: 'agent';
20401
- metadata: ConfigMetadata;
20402
- name: string | null;
20403
- version: string;
20404
- }
20405
- interface ConfigMetadata {
20406
- annotations: {
20407
- [k: string]: string;
20408
- };
20409
- labels: string[];
20410
- }
20411
- /**
20412
- * The typed input contract: what goes INTO a session (the trigger is
20413
- * when it happens; this is what goes in).
20414
- *
20415
- * `json_schema` validates customer data sent as `input` to
20416
- * `POST /v1/agents/{id}/sessions` (the dashboard and the CLI start
20417
- * through the same door) and stored as `session.input`. An on-demand
20418
- * start requires input when a schema is declared. A trigger fires
20419
- * without it: a cron fire has no payload and a react fire carries the
20420
- * platform-shaped event, so an agent may declare a schema alongside
20421
- * either trigger and the schema governs only its on-demand starts.
20422
- *
20423
- * `message` is the initial-message template: exact `{{path}}` substitution
20424
- * over the payload the session has (the caller payload on an on-demand
20425
- * start, the surface's published fields on a react fire, the empty
20426
- * object on a cron fire), no conditionals/loops/filters. Refs are
20427
- * validated at deploy time against every governing field set (see
20428
- * AgentConfig's `_check_input`): the caller schema's paths, the react
20429
- * surface's published fields, and both when the agent has a react trigger
20430
- * and a schema, so one template renders fully on either door (declare the
20431
- * surface's field names in the schema). Omit `message` to let each door
20432
- * render its default. An unresolved ref renders as the empty string (a
20433
- * cron fire, an optional field the payload omitted).
20434
- */
20435
- interface InputContract {
20436
- json_schema: {
20437
- [k: string]: unknown;
20438
- } | null;
20439
- message: string | null;
20440
- }
20441
- /**
20442
- * A saved agent's spend limits: the per-session cap plus its total spend
20443
- * over the trailing 1, 7, and 28 days.
20444
- */
20445
- interface BudgetConfig {
20446
- /**
20447
- * The most the agent may spend over the last day, in US dollars.
20448
- */
20449
- day: number | null;
20450
- /**
20451
- * The most the agent may spend over the last 28 days, in US dollars.
20452
- */
20453
- month: number | null;
20454
- /**
20455
- * The most one session may spend, in US dollars.
20456
- */
20457
- session: number | null;
20458
- /**
20459
- * The most the agent may spend over the last 7 days, in US dollars.
20460
- */
20461
- week: number | null;
20462
- }
20463
- /**
20464
- * Native Claude Code options for an explicitly selected harness.
20465
- */
20466
- interface ClaudeConfig {
20467
- effort: EffortLevel | null;
20468
- fallback_model: string | null;
20469
- max_turns: number | null;
20470
- /**
20471
- * The model the session runs on: an alias or canonical id from the models table. Required.
20472
- */
20473
- model: string;
20474
- /**
20475
- * 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.
20476
19824
  */
20477
19825
  prompt: string | null;
20478
19826
  settings: SettingsRef | null;
@@ -20497,7 +19845,7 @@ interface RepositoryRef {
20497
19845
  */
20498
19846
  interface CodexConfig {
20499
19847
  /**
20500
- * Reasoning effort for every turn. Omit to use the model default.
19848
+ * Reasoning effort for every message. Omit to use the model default.
20501
19849
  */
20502
19850
  effort: CodexEffortLevel | null;
20503
19851
  /**
@@ -20505,7 +19853,7 @@ interface CodexConfig {
20505
19853
  */
20506
19854
  model: string;
20507
19855
  /**
20508
- * 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.
20509
19857
  */
20510
19858
  prompt: string | null;
20511
19859
  }
@@ -20514,7 +19862,7 @@ interface CodexConfig {
20514
19862
  */
20515
19863
  interface SessionConversationConfig {
20516
19864
  /**
20517
- * 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.
20518
19866
  */
20519
19867
  interactive: boolean;
20520
19868
  }
@@ -20708,7 +20056,7 @@ interface GeminiConfig {
20708
20056
  */
20709
20057
  model: string;
20710
20058
  /**
20711
- * 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.
20712
20060
  */
20713
20061
  prompt: string | null;
20714
20062
  }
@@ -20985,11 +20333,10 @@ interface SessionAttribution {
20985
20333
  */
20986
20334
  interface SessionConversation {
20987
20335
  /**
20988
- * Whether the session stays open after its first turn.
20336
+ * Whether the session stays open after its first message is answered.
20989
20337
  */
20990
20338
  interactive: boolean;
20991
20339
  prompting: SessionPrompting;
20992
- state: SessionState;
20993
20340
  /**
20994
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.
20995
20342
  */
@@ -21005,7 +20352,7 @@ interface SessionPrompting {
21005
20352
  surface_name: string | null;
21006
20353
  }
21007
20354
  /**
21008
- * What the session has cost so far.
20355
+ * What something cost, in millicents.
21009
20356
  */
21010
20357
  interface Cost {
21011
20358
  /**
@@ -21167,6 +20514,17 @@ interface EnvironmentHooks1 {
21167
20514
  */
21168
20515
  validate: EnvironmentScript | string | null;
21169
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
+ }
21170
20528
  interface GithubPullRequestEvent {
21171
20529
  action: PullRequestAction | 'review_commented';
21172
20530
  actor: SessionEventActor | null;
@@ -21372,9 +20730,9 @@ interface SessionHandler {
21372
20730
  sha: string;
21373
20731
  }
21374
20732
  /**
21375
- * 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
21376
20734
  * submitted one, the payload. `result` is None while the session runs and
21377
- * 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
21378
20736
  * shape of `json_schema`.
21379
20737
  */
21380
20738
  interface SessionOutput {
@@ -21385,7 +20743,7 @@ interface SessionOutput {
21385
20743
  [k: string]: unknown;
21386
20744
  };
21387
20745
  /**
21388
- * The payload the agent submitted, or null until a turn submits one.
20746
+ * The payload the agent submitted, or null until it submits one.
21389
20747
  */
21390
20748
  result: {
21391
20749
  [k: string]: unknown;
@@ -21422,7 +20780,7 @@ interface SessionSummary {
21422
20780
  description: string;
21423
20781
  }
21424
20782
  /**
21425
- * The tokens the session has used so far.
20783
+ * Tokens used, in total and by model.
21426
20784
  */
21427
20785
  interface Tokens {
21428
20786
  all: TokenCounts;
@@ -21485,109 +20843,17 @@ interface ModelTokenCounts {
21485
20843
  */
21486
20844
  total: number;
21487
20845
  }
21488
- /**
21489
- * One message and the agent's answer to it. A turn is `queued` from the
21490
- * moment its message is received, `preparing` while its environment is set
21491
- * up, `running` while the agent works, then `completed`, `failed`,
21492
- * `stopped`, or `cancelled`.
21493
- */
21494
- interface SessionTurn {
21495
- cost: Cost1;
21496
- /**
21497
- * When the turn's message was received.
21498
- */
21499
- created_at: string;
21500
- /**
21501
- * A human-readable explanation of a failed, stopped, or cancelled turn, or of why a queued turn waits.
21502
- */
21503
- detail: string | null;
21504
- /**
21505
- * When the turn reached its final status.
21506
- */
21507
- ended_at: string | null;
21508
- /**
21509
- * Unique identifier of the turn.
21510
- */
21511
- id: string;
21512
- /**
21513
- * Position in the session, starting at 0.
21514
- */
21515
- index: number;
21516
- /**
21517
- * Why the turn failed or was cancelled; null on every other status.
21518
- */
21519
- reason: TurnReason | null;
21520
- /**
21521
- * When the agent started on the message.
21522
- */
21523
- started_at: string | null;
21524
- status: TurnStatus;
21525
- /**
21526
- * When and by whom a stop was requested; null when none was.
21527
- */
21528
- stopped: SessionStopped | null;
21529
- tokens: Tokens1;
21530
- }
21531
- /**
21532
- * What the turn cost so far, in millicents, broken down by leg.
21533
- */
21534
- interface Cost1 {
21535
- /**
21536
- * What Ellipsis charged to credit, in millicents. It is everything except subscription tokens.
21537
- */
21538
- charged: number;
21539
- /**
21540
- * CPU spend in millicents.
21541
- */
21542
- cpu: number;
21543
- /**
21544
- * Platform fee in millicents.
21545
- */
21546
- fee: number;
21547
- llm: LlmCost;
21548
- /**
21549
- * Memory spend in millicents.
21550
- */
21551
- memory: number;
21552
- /**
21553
- * 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.
21554
- */
21555
- total: number;
21556
- }
21557
- /**
21558
- * When a stop was requested and the GitHub user who requested it.
21559
- */
21560
- interface SessionStopped {
21561
- /**
21562
- * When a stop was requested.
21563
- */
21564
- at: string;
21565
- /**
21566
- * The GitHub user who stopped the session, resolved at read time. Null if the user is unknown or unavailable.
21567
- */
21568
- by: GithubAccountSnippet | null;
21569
- }
21570
- /**
21571
- * The tokens the turn spent and the model they went to.
21572
- */
21573
- interface Tokens1 {
21574
- all: TokenCounts;
21575
- /**
21576
- * Token counts for each model that used tokens.
21577
- */
21578
- by_model: ModelTokenCounts[];
21579
- }
21580
20846
  /**
21581
20847
  * Cursored append-only delivery of session records, ordered by feed_seq,
21582
- * 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,
21583
20849
  * including ones a client renders as nothing.
21584
20850
  */
21585
- interface RecordsAppendFrame {
20851
+ interface RecordsFrame {
21586
20852
  /**
21587
20853
  * New session records, ordered by feed_seq.
21588
20854
  */
21589
20855
  records: SessionRecord$1[];
21590
- type: 'records_append';
20856
+ type: 'records';
21591
20857
  }
21592
20858
  /**
21593
20859
  * Historical Claude SDK projection, retained for existing session history.
@@ -21605,6 +20871,10 @@ interface ClaudeSessionRecord {
21605
20871
  */
21606
20872
  id: string;
21607
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;
21608
20878
  model: string | null;
21609
20879
  payload: LegacyAssistantPayload | SdkUserRecord$1 | SdkSystemRecord$1 | LegacyResultPayload | SdkRateLimitRecord$1;
21610
20880
  record_format: 'claude_sdk@1';
@@ -21616,17 +20886,9 @@ interface ClaudeSessionRecord {
21616
20886
  * Session containing this record.
21617
20887
  */
21618
20888
  session_id: string;
21619
- /**
21620
- * Message this record receives, delivers, requeues, or echoes.
21621
- */
21622
- session_message_id: string | null;
21623
20889
  source: 'claude_code';
21624
20890
  tokens_info: TokensInfo | null;
21625
20891
  tools: string[] | null;
21626
- /**
21627
- * Turn containing this record, when applicable.
21628
- */
21629
- turn_id: string | null;
21630
20892
  }
21631
20893
  interface LegacyAssistantPayload {
21632
20894
  cache_creation?: SdkCacheCreation | null;
@@ -21803,6 +21065,10 @@ interface ClaudeNativeSessionRecord {
21803
21065
  */
21804
21066
  id: string;
21805
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;
21806
21072
  model: string | null;
21807
21073
  payload: ClaudeAssistantEvent | ClaudeUserEvent | ClaudeSystemEvent | ClaudeResultEvent | ClaudeRateLimitEvent | ClaudeConversationResetEvent;
21808
21074
  record_format: 'claude_jsonl@1';
@@ -21814,17 +21080,9 @@ interface ClaudeNativeSessionRecord {
21814
21080
  * Session containing this record.
21815
21081
  */
21816
21082
  session_id: string;
21817
- /**
21818
- * Message this record receives, delivers, requeues, or echoes.
21819
- */
21820
- session_message_id: string | null;
21821
21083
  source: 'claude_code';
21822
21084
  tokens_info: TokensInfo | null;
21823
21085
  tools: string[] | null;
21824
- /**
21825
- * Turn containing this record, when applicable.
21826
- */
21827
- turn_id: string | null;
21828
21086
  }
21829
21087
  interface ClaudeAssistantEvent {
21830
21088
  error?: string | null;
@@ -21936,6 +21194,10 @@ interface CodexSessionRecord {
21936
21194
  */
21937
21195
  id: string;
21938
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;
21939
21201
  model: string | null;
21940
21202
  payload: CodexThreadStartedEvent | CodexTurnStartedEvent | CodexTurnCompletedEvent | CodexTurnFailedEvent | CodexErrorEvent | CodexItemStartedEvent | CodexItemUpdatedEvent | CodexItemCompletedEvent;
21941
21203
  record_format: 'codex_jsonl@1';
@@ -21947,17 +21209,9 @@ interface CodexSessionRecord {
21947
21209
  * Session containing this record.
21948
21210
  */
21949
21211
  session_id: string;
21950
- /**
21951
- * Message this record receives, delivers, requeues, or echoes.
21952
- */
21953
- session_message_id: string | null;
21954
21212
  source: 'codex';
21955
21213
  tokens_info: TokensInfo | null;
21956
21214
  tools: string[] | null;
21957
- /**
21958
- * Turn containing this record, when applicable.
21959
- */
21960
- turn_id: string | null;
21961
21215
  }
21962
21216
  interface CodexThreadStartedEvent {
21963
21217
  thread_id?: string | null;
@@ -22092,6 +21346,10 @@ interface CodexAppServerSessionRecord {
22092
21346
  */
22093
21347
  id: string;
22094
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;
22095
21353
  model: string | null;
22096
21354
  payload: CodexAppServerNotification;
22097
21355
  record_format: 'codex_app_server@1';
@@ -22103,17 +21361,9 @@ interface CodexAppServerSessionRecord {
22103
21361
  * Session containing this record.
22104
21362
  */
22105
21363
  session_id: string;
22106
- /**
22107
- * Message this record receives, delivers, requeues, or echoes.
22108
- */
22109
- session_message_id: string | null;
22110
21364
  source: 'codex';
22111
21365
  tokens_info: TokensInfo | null;
22112
21366
  tools: string[] | null;
22113
- /**
22114
- * Turn containing this record, when applicable.
22115
- */
22116
- turn_id: string | null;
22117
21367
  }
22118
21368
  interface CodexThreadStarted {
22119
21369
  method: 'thread/started';
@@ -22372,6 +21622,10 @@ interface GeminiSessionRecord {
22372
21622
  */
22373
21623
  id: string;
22374
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;
22375
21629
  model: string | null;
22376
21630
  payload: GeminiStreamEvent$1;
22377
21631
  record_format: 'gemini_stream_json@1';
@@ -22383,17 +21637,9 @@ interface GeminiSessionRecord {
22383
21637
  * Session containing this record.
22384
21638
  */
22385
21639
  session_id: string;
22386
- /**
22387
- * Message this record receives, delivers, requeues, or echoes.
22388
- */
22389
- session_message_id: string | null;
22390
21640
  source: 'gemini';
22391
21641
  tokens_info: TokensInfo | null;
22392
21642
  tools: string[] | null;
22393
- /**
22394
- * Turn containing this record, when applicable.
22395
- */
22396
- turn_id: string | null;
22397
21643
  }
22398
21644
  interface GeminiInitEvent {
22399
21645
  model: string;
@@ -22483,6 +21729,10 @@ interface SessionClosedRecord {
22483
21729
  */
22484
21730
  id: string;
22485
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;
22486
21736
  model: string | null;
22487
21737
  payload: SessionClosedPayload;
22488
21738
  record_format: 'ellipsis_lifecycle@1';
@@ -22491,25 +21741,17 @@ interface SessionClosedRecord {
22491
21741
  * Session containing this record.
22492
21742
  */
22493
21743
  session_id: string;
22494
- /**
22495
- * Message this record receives, delivers, requeues, or echoes.
22496
- */
22497
- session_message_id: string | null;
22498
21744
  source: 'lifecycle';
22499
21745
  tokens_info: TokensInfo | null;
22500
21746
  tools: string[] | null;
22501
- /**
22502
- * Turn containing this record, when applicable.
22503
- */
22504
- turn_id: string | null;
22505
21747
  }
22506
21748
  /**
22507
- * session_closed: the conversation closed permanently.
21749
+ * session_closed: the session closed permanently.
22508
21750
  */
22509
21751
  interface SessionClosedPayload {
22510
21752
  [k: string]: unknown;
22511
21753
  }
22512
- interface MessageReceivedRecord {
21754
+ interface MessageRecord {
22513
21755
  cost: number | null;
22514
21756
  created_at: string;
22515
21757
  duration: number | null;
@@ -22522,41 +21764,74 @@ interface MessageReceivedRecord {
22522
21764
  */
22523
21765
  id: string;
22524
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;
22525
21771
  model: string | null;
22526
- payload: MessageReceivedPayload;
21772
+ payload: SessionMessage;
22527
21773
  record_format: 'ellipsis_lifecycle@1';
22528
- record_type: 'message_received';
21774
+ record_type: 'message';
22529
21775
  /**
22530
21776
  * Session containing this record.
22531
21777
  */
22532
21778
  session_id: string;
22533
- /**
22534
- * Message this record receives, delivers, requeues, or echoes.
22535
- */
22536
- session_message_id: string | null;
22537
21779
  source: 'lifecycle';
22538
21780
  tokens_info: TokensInfo | null;
22539
21781
  tools: string[] | null;
21782
+ }
21783
+ /**
21784
+ * One message sent to a session.
21785
+ */
21786
+ interface SessionMessage {
22540
21787
  /**
22541
- * Turn containing this record, when applicable.
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;
21803
+ /**
21804
+ * Images attached to the message, metadata only: index, media type, size. The bytes go to the model, never over the stream.
22542
21805
  */
22543
- turn_id: string | null;
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.
21813
+ */
21814
+ session_id: string;
22544
21815
  }
22545
21816
  /**
22546
- * message_received: a message landed in the session inbox and its turn was
22547
- * 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.
22548
21819
  */
22549
- interface MessageReceivedPayload {
22550
- author?: string | null;
22551
- body: string;
22552
- closes_session?: boolean;
22553
- message_id: string;
22554
- sender_attribution_id?: string | null;
22555
- sender_attribution_type?: string | null;
22556
- turn_id?: string | null;
22557
- [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;
22558
21833
  }
22559
- interface MessageDeliveredRecord {
21834
+ interface MessageQueuedRecord {
22560
21835
  cost: number | null;
22561
21836
  created_at: string;
22562
21837
  duration: number | null;
@@ -22569,35 +21844,33 @@ interface MessageDeliveredRecord {
22569
21844
  */
22570
21845
  id: string;
22571
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;
22572
21851
  model: string | null;
22573
- payload: MessageDeliveredPayload;
21852
+ payload: MessageQueuedPayload;
22574
21853
  record_format: 'ellipsis_lifecycle@1';
22575
- record_type: 'message_delivered';
21854
+ record_type: 'message_queued';
22576
21855
  /**
22577
21856
  * Session containing this record.
22578
21857
  */
22579
21858
  session_id: string;
22580
- /**
22581
- * Message this record receives, delivers, requeues, or echoes.
22582
- */
22583
- session_message_id: string | null;
22584
21859
  source: 'lifecycle';
22585
21860
  tokens_info: TokensInfo | null;
22586
21861
  tools: string[] | null;
22587
- /**
22588
- * Turn containing this record, when applicable.
22589
- */
22590
- turn_id: string | null;
22591
21862
  }
22592
21863
  /**
22593
- * 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.
22594
21866
  */
22595
- interface MessageDeliveredPayload {
21867
+ interface MessageQueuedPayload {
21868
+ limit: number;
22596
21869
  message_id: string;
22597
- turn_id: string;
21870
+ sessions_alive: number;
22598
21871
  [k: string]: unknown;
22599
21872
  }
22600
- interface MessageRequeuedRecord {
21873
+ interface MessageStartedRecord {
22601
21874
  cost: number | null;
22602
21875
  created_at: string;
22603
21876
  duration: number | null;
@@ -22610,37 +21883,30 @@ interface MessageRequeuedRecord {
22610
21883
  */
22611
21884
  id: string;
22612
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;
22613
21890
  model: string | null;
22614
- payload: MessageRequeuedPayload;
21891
+ payload: MessageStartedPayload;
22615
21892
  record_format: 'ellipsis_lifecycle@1';
22616
- record_type: 'message_requeued';
21893
+ record_type: 'message_started';
22617
21894
  /**
22618
21895
  * Session containing this record.
22619
21896
  */
22620
21897
  session_id: string;
22621
- /**
22622
- * Message this record receives, delivers, requeues, or echoes.
22623
- */
22624
- session_message_id: string | null;
22625
21898
  source: 'lifecycle';
22626
21899
  tokens_info: TokensInfo | null;
22627
21900
  tools: string[] | null;
22628
- /**
22629
- * Turn containing this record, when applicable.
22630
- */
22631
- turn_id: string | null;
22632
21901
  }
22633
21902
  /**
22634
- * message_requeued: a turn was interrupted before answering, so the
22635
- * message goes back to the inbox with a new queued turn.
21903
+ * message_started: the agent started on the message.
22636
21904
  */
22637
- interface MessageRequeuedPayload {
21905
+ interface MessageStartedPayload {
22638
21906
  message_id: string;
22639
- requeued_turn_id?: string | null;
22640
- turn_id: string;
22641
21907
  [k: string]: unknown;
22642
21908
  }
22643
- interface TurnQueuedRecord {
21909
+ interface MessageEndedRecord {
22644
21910
  cost: number | null;
22645
21911
  created_at: string;
22646
21912
  duration: number | null;
@@ -22653,78 +21919,75 @@ interface TurnQueuedRecord {
22653
21919
  */
22654
21920
  id: string;
22655
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;
22656
21926
  model: string | null;
22657
- payload: TurnQueuedPayload;
21927
+ payload: MessageEndedPayload$1;
22658
21928
  record_format: 'ellipsis_lifecycle@1';
22659
- record_type: 'turn_queued';
21929
+ record_type: 'message_ended';
22660
21930
  /**
22661
21931
  * Session containing this record.
22662
21932
  */
22663
21933
  session_id: string;
22664
- /**
22665
- * Message this record receives, delivers, requeues, or echoes.
22666
- */
22667
- session_message_id: string | null;
22668
21934
  source: 'lifecycle';
22669
21935
  tokens_info: TokensInfo | null;
22670
21936
  tools: string[] | null;
22671
- /**
22672
- * Turn containing this record, when applicable.
22673
- */
22674
- turn_id: string | null;
22675
21937
  }
22676
21938
  /**
22677
- * turn_queued: the turn waits because the account already has
22678
- * `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.
22679
21944
  */
22680
- interface TurnQueuedPayload {
22681
- limit: number;
22682
- sessions_alive: number;
22683
- 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;
22684
21952
  [k: string]: unknown;
22685
21953
  }
22686
- interface TurnStartedRecord {
22687
- cost: number | null;
22688
- created_at: string;
22689
- duration: number | null;
21954
+ /**
21955
+ * What something cost, in millicents.
21956
+ */
21957
+ interface Cost1 {
22690
21958
  /**
22691
- * 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.
22692
21960
  */
22693
- feed_seq: number;
21961
+ charged: number;
22694
21962
  /**
22695
- * Unique identifier of the record.
21963
+ * CPU spend in millicents.
22696
21964
  */
22697
- id: string;
22698
- kind: 'platform';
22699
- model: string | null;
22700
- payload: TurnStartedPayload;
22701
- record_format: 'ellipsis_lifecycle@1';
22702
- record_type: 'turn_started';
21965
+ cpu: number;
22703
21966
  /**
22704
- * Session containing this record.
21967
+ * Platform fee in millicents.
22705
21968
  */
22706
- session_id: string;
21969
+ fee: number;
21970
+ llm: LlmCost;
22707
21971
  /**
22708
- * Message this record receives, delivers, requeues, or echoes.
21972
+ * Memory spend in millicents.
22709
21973
  */
22710
- session_message_id: string | null;
22711
- source: 'lifecycle';
22712
- tokens_info: TokensInfo | null;
22713
- tools: string[] | null;
21974
+ memory: number;
22714
21975
  /**
22715
- * 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.
22716
21977
  */
22717
- turn_id: string | null;
21978
+ total: number;
22718
21979
  }
22719
21980
  /**
22720
- * turn_started: the agent started on the turn's message.
21981
+ * Tokens used, in total and by model.
22721
21982
  */
22722
- interface TurnStartedPayload {
22723
- turn_id: string;
22724
- turn_index: number;
22725
- [k: string]: unknown;
21983
+ interface Tokens1 {
21984
+ all: TokenCounts;
21985
+ /**
21986
+ * Token counts for each model that used tokens.
21987
+ */
21988
+ by_model: ModelTokenCounts[];
22726
21989
  }
22727
- interface TurnEndedRecord {
21990
+ interface MessageRequeuedRecord {
22728
21991
  cost: number | null;
22729
21992
  created_at: string;
22730
21993
  duration: number | null;
@@ -22737,37 +22000,28 @@ interface TurnEndedRecord {
22737
22000
  */
22738
22001
  id: string;
22739
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;
22740
22007
  model: string | null;
22741
- payload: TurnEndedPayload;
22008
+ payload: MessageRequeuedPayload;
22742
22009
  record_format: 'ellipsis_lifecycle@1';
22743
- record_type: 'turn_ended';
22010
+ record_type: 'message_requeued';
22744
22011
  /**
22745
22012
  * Session containing this record.
22746
22013
  */
22747
22014
  session_id: string;
22748
- /**
22749
- * Message this record receives, delivers, requeues, or echoes.
22750
- */
22751
- session_message_id: string | null;
22752
22015
  source: 'lifecycle';
22753
22016
  tokens_info: TokensInfo | null;
22754
22017
  tools: string[] | null;
22755
- /**
22756
- * Turn containing this record, when applicable.
22757
- */
22758
- turn_id: string | null;
22759
22018
  }
22760
22019
  /**
22761
- * turn_ended: the turn reached its final status. `status`, `reason`, and
22762
- * `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.
22763
22022
  */
22764
- interface TurnEndedPayload {
22765
- detail?: string | null;
22766
- duration_ms?: number | null;
22767
- reason?: string | null;
22768
- status: string;
22769
- turn_id: string;
22770
- turn_index: number;
22023
+ interface MessageRequeuedPayload {
22024
+ message_id: string;
22771
22025
  [k: string]: unknown;
22772
22026
  }
22773
22027
  interface EnvironmentPhaseRecord {
@@ -22783,6 +22037,10 @@ interface EnvironmentPhaseRecord {
22783
22037
  */
22784
22038
  id: string;
22785
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;
22786
22044
  model: string | null;
22787
22045
  payload: EnvironmentPhasePayload;
22788
22046
  record_format: 'ellipsis_lifecycle@1';
@@ -22791,17 +22049,9 @@ interface EnvironmentPhaseRecord {
22791
22049
  * Session containing this record.
22792
22050
  */
22793
22051
  session_id: string;
22794
- /**
22795
- * Message this record receives, delivers, requeues, or echoes.
22796
- */
22797
- session_message_id: string | null;
22798
22052
  source: 'lifecycle';
22799
22053
  tokens_info: TokensInfo | null;
22800
22054
  tools: string[] | null;
22801
- /**
22802
- * Turn containing this record, when applicable.
22803
- */
22804
- turn_id: string | null;
22805
22055
  }
22806
22056
  /**
22807
22057
  * environment_phase: one transition of environment preparation, so clients
@@ -22831,6 +22081,10 @@ interface EnvironmentOutputRecord {
22831
22081
  */
22832
22082
  id: string;
22833
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;
22834
22088
  model: string | null;
22835
22089
  payload: EnvironmentOutputPayload;
22836
22090
  record_format: 'ellipsis_lifecycle@1';
@@ -22839,22 +22093,14 @@ interface EnvironmentOutputRecord {
22839
22093
  * Session containing this record.
22840
22094
  */
22841
22095
  session_id: string;
22842
- /**
22843
- * Message this record receives, delivers, requeues, or echoes.
22844
- */
22845
- session_message_id: string | null;
22846
22096
  source: 'lifecycle';
22847
22097
  tokens_info: TokensInfo | null;
22848
22098
  tools: string[] | null;
22849
- /**
22850
- * Turn containing this record, when applicable.
22851
- */
22852
- turn_id: string | null;
22853
22099
  }
22854
22100
  /**
22855
22101
  * environment_output: one chunk of output from preparing the environment,
22856
- * including the customer's own hooks. Many fire per turn; `chunk` orders them
22857
- * within a step.
22102
+ * including the customer's own hooks. Many fire per message; `chunk` orders
22103
+ * them within a step.
22858
22104
  */
22859
22105
  interface EnvironmentOutputPayload {
22860
22106
  chunk: number;
@@ -22877,6 +22123,10 @@ interface EnvironmentReadyRecord {
22877
22123
  */
22878
22124
  id: string;
22879
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;
22880
22130
  model: string | null;
22881
22131
  payload: EnvironmentReadyPayload;
22882
22132
  record_format: 'ellipsis_lifecycle@1';
@@ -22885,17 +22135,9 @@ interface EnvironmentReadyRecord {
22885
22135
  * Session containing this record.
22886
22136
  */
22887
22137
  session_id: string;
22888
- /**
22889
- * Message this record receives, delivers, requeues, or echoes.
22890
- */
22891
- session_message_id: string | null;
22892
22138
  source: 'lifecycle';
22893
22139
  tokens_info: TokensInfo | null;
22894
22140
  tools: string[] | null;
22895
- /**
22896
- * Turn containing this record, when applicable.
22897
- */
22898
- turn_id: string | null;
22899
22141
  }
22900
22142
  /**
22901
22143
  * environment_ready: the environment is prepared and the agent is about
@@ -22922,6 +22164,10 @@ interface UnknownSessionRecord {
22922
22164
  */
22923
22165
  id: string;
22924
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;
22925
22171
  model: string | null;
22926
22172
  payload: {
22927
22173
  [k: string]: unknown;
@@ -22938,28 +22184,12 @@ interface UnknownSessionRecord {
22938
22184
  * Session containing this record.
22939
22185
  */
22940
22186
  session_id: string;
22941
- /**
22942
- * Message this record receives, delivers, requeues, or echoes.
22943
- */
22944
- session_message_id: string | null;
22945
22187
  /**
22946
22188
  * Original producer. Unknown producers remain readable as unknown records.
22947
22189
  */
22948
22190
  source: string;
22949
22191
  tokens_info: TokensInfo | null;
22950
22192
  tools: string[] | null;
22951
- /**
22952
- * Turn containing this record, when applicable.
22953
- */
22954
- turn_id: string | null;
22955
- }
22956
- /**
22957
- * A last-writer-wins snapshot of the session: the only way turn,
22958
- * conversation, and cost updates arrive. Resent whole on any field change.
22959
- */
22960
- interface SessionFrame {
22961
- session: Session1;
22962
- type: 'session';
22963
22193
  }
22964
22194
  /**
22965
22195
  * Fire-and-forget partial assistant output for the current response.
@@ -22971,6 +22201,10 @@ interface DeltaFrame {
22971
22201
  * Known values: text (append assistant output), thinking (replace the readable reasoning-summary preview). Open vocabulary: ignore deltas with unknown kinds.
22972
22202
  */
22973
22203
  kind: string;
22204
+ /**
22205
+ * Identifier of the message being answered, if known.
22206
+ */
22207
+ message_id: string | null;
22974
22208
  /**
22975
22209
  * Output tokens generated so far for the current response.
22976
22210
  */
@@ -22979,10 +22213,6 @@ interface DeltaFrame {
22979
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.
22980
22214
  */
22981
22215
  text: string | null;
22982
- /**
22983
- * Identifier of the turn the delta belongs to, if known.
22984
- */
22985
- turn_id: string | null;
22986
22216
  type: 'delta';
22987
22217
  }
22988
22218
  /**
@@ -22997,13 +22227,6 @@ interface HeartbeatFrame {
22997
22227
  ts: string;
22998
22228
  type: 'heartbeat';
22999
22229
  }
23000
- /**
23001
- * Terminal marker: the conversation is over, after the final session
23002
- * frame carried the end state. Followed by a normal close (1000).
23003
- */
23004
- interface DoneFrame {
23005
- type: 'done';
23006
- }
23007
22230
  /**
23008
22231
  * Terminal error marker, sent before the server closes with code 1011.
23009
22232
  */
@@ -23015,7 +22238,7 @@ interface ErrorFrame {
23015
22238
  type: 'error';
23016
22239
  }
23017
22240
 
23018
- type SessionRecord = RecordsAppendFrame['records'][number];
22241
+ type SessionRecord = RecordsFrame['records'][number];
23019
22242
  type LifecycleSessionRecord = PlatformSessionRecord;
23020
22243
  type ClaudeNativeEvent = ClaudeNativeSessionRecord['payload'];
23021
22244
  type SdkRecord = ClaudeSessionRecord['payload'];
@@ -23045,8 +22268,7 @@ type StreamFrame = SessionStreamFrame;
23045
22268
  type SendSessionMessageRequest = components['schemas']['SendSessionMessageRequest'];
23046
22269
  type SessionRecordsListResponse = components['schemas']['SessionRecordsListResponse'];
23047
22270
  type SessionResponse = components['schemas']['SessionResponse'];
23048
- type SessionTurnResponse = components['schemas']['SessionTurnResponse'];
23049
- type SessionTurnsListResponse = components['schemas']['SessionTurnsListResponse'];
22271
+ type MessageEndedPayload = components['schemas']['MessageEndedPayload'];
23050
22272
  type UpdateSessionRequest = components['schemas']['UpdateSessionRequest'];
23051
22273
  type SessionMessageResponse = components['schemas']['SessionMessageResponse'];
23052
22274
  type SessionsListResponse = components['schemas']['SessionsListResponse'];
@@ -23060,4 +22282,4 @@ type ReviewsListResponse = components['schemas']['ReviewsListResponse'];
23060
22282
  type ReviewConfig = components['schemas']['ReviewConfig'];
23061
22283
  type ReviewConfigsListResponse = components['schemas']['ReviewConfigsListResponse'];
23062
22284
 
23063
- 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, Duration as aA, EffortLevel as aB, EllipsisGrant as aC, EllipsisPermissions as aD, EnvironmentBaseBuild as aE, EnvironmentConfig as aF, EnvironmentHooks as aG, EnvironmentHooks1 as aH, EnvironmentOutputPayload as aI, EnvironmentOutputRecord as aJ, EnvironmentPhasePayload as aK, EnvironmentPhaseRecord as aL, EnvironmentReadyPayload as aM, EnvironmentReadyRecord as aN, EnvironmentScript as aO, EnvironmentSource as aP, EnvironmentVariable as aQ, ErrorFrame 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, DoneFrame as az, AttributionType as b, ReviewComment 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, MessageRequeuedPayload as bA, MessageRequeuedRecord as bB, ModelLlmCostSplit as bC, ModelTokenCounts as bD, OutputConfig as bE, PermissionsConfig as bF, PermissionsConfig1 as bG, PlatformSessionRecord as bH, PromptBlockedReason as bI, PullRequestAction as bJ, ReactCheckRun as bK, ReactCheckSuite as bL, ReactIssue as bM, ReactLinearIssue as bN, ReactPullRequest as bO, ReactPush as bP, ReactRelease as bQ, ReactSentry as bR, ReactSlackChannel as bS, ReactStatus as bT, ReactTrigger as bU, ReactWorkflowRun as bV, RecordsAppendFrame as bW, ReleaseAction as bX, RepositoryFilter as bY, RepositoryRef as bZ, Review 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, MessageDeliveredPayload as bw, MessageDeliveredRecord as bx, MessageReceivedPayload as by, MessageReceivedRecord as bz, components as c, SkillRef as c$, ReviewConfig as c0, ReviewConfigsListResponse as c1, ReviewPullRequest as c2, ReviewPullRequestAuthor as c3, ReviewReviewer as c4, ReviewSummary as c5, ReviewsListResponse as c6, SdkAssistantRecord as c7, SdkCacheCreation as c8, SdkContentBlock as c9, SessionFrame as cA, SessionGit as cB, SessionGitCommit as cC, SessionGitFile as cD, SessionGitPr as cE, SessionGitRepo as cF, SessionHandler as cG, SessionMessage as cH, SessionMessageImage as cI, SessionMessageResponse as cJ, SessionMessageStatus as cK, SessionOutput as cL, SessionParent as cM, SessionPrompting as cN, SessionRecord as cO, SessionRecordsListResponse as cP, SessionResponse as cQ, SessionSource as cR, SessionState as cS, SessionStopped as cT, SessionStreamFrame as cU, SessionSummary as cV, SessionTurn as cW, SessionTurnResponse as cX, SessionTurnsListResponse as cY, SessionsListResponse as cZ, SettingsRef as c_, SdkRateLimitRecord as ca, SdkRecord as cb, SdkResultRecord as cc, SdkServerToolResultBlock as cd, SdkServerToolUseBlock as ce, SdkSystemRecord as cf, SdkTextBlock as cg, SdkThinkingBlock as ch, SdkToolResultBlock as ci, SdkToolUseBlock as cj, SdkUserRecord as ck, SendSessionMessageRequest as cl, SentryAction as cm, SentryAlertEvent as cn, Session as co, Session1 as cp, SessionAgent as cq, SessionArchived as cr, SessionAttribution as cs, SessionClosedPayload as ct, SessionClosedRecord as cu, SessionConfig as cv, SessionConversation as cw, SessionConversationConfig as cx, SessionEnvironment as cy, SessionEventActor as cz, CheckSuiteAction as d, SlackChannelCreatedEvent as d0, SlackMessageEvent as d1, SnapshotFrame as d2, StatusAction as d3, StreamFrame as d4, TokenCounts as d5, Tokens as d6, Tokens1 as d7, TokensInfo as d8, TurnEndedPayload as d9, TurnEndedRecord as da, TurnQueuedPayload as db, TurnQueuedRecord as dc, TurnReason as dd, TurnStartedPayload as de, TurnStartedRecord as df, TurnStatus as dg, UnknownSessionRecord as dh, UpdateSessionRequest as di, WorkflowRunAction as dj, paths as dk, 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 };
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 };