@ellipsis-dev/sdk 0.13.0 → 0.15.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.
@@ -1245,8 +1245,6 @@ interface components {
1245
1245
  */
1246
1246
  environment: components['schemas']['AgentConfigEnvironment'];
1247
1247
  input?: components['schemas']['AgentConfigInput'] | null;
1248
- /** @default {} */
1249
- llm: components['schemas']['AgentConfigLlm'];
1250
1248
  /**
1251
1249
  * Mcp Servers
1252
1250
  * @default []
@@ -1580,23 +1578,6 @@ interface components {
1580
1578
  /** Message */
1581
1579
  message?: string | null;
1582
1580
  };
1583
- /**
1584
- * AgentConfigLlm
1585
- * @description Where this agent's completions go.
1586
- *
1587
- * Defaults to Ellipsis's own LLM proxy (our Anthropic/Bedrock account, or the
1588
- * account-wide BYO provider if one is enabled). Setting `proxy` to the id of a
1589
- * proxy registered on the models settings page routes THIS agent's
1590
- * completions through that gateway instead.
1591
- *
1592
- * Opt-in per agent by design: registering a proxy does not silently move any
1593
- * existing agent's traffic. The id is account-scoped, so naming another
1594
- * account's id is a terminal config error, not a route.
1595
- */
1596
- AgentConfigLlm: {
1597
- /** Proxy */
1598
- proxy?: string | null;
1599
- };
1600
1581
  /**
1601
1582
  * AgentConfigMcpServer
1602
1583
  * @description One built-in MCP server this agent opts into by name (`linear`/`slack`).
@@ -2280,6 +2261,87 @@ interface components {
2280
2261
  */
2281
2262
  start: string | null;
2282
2263
  };
2264
+ /**
2265
+ * ClaudeSessionRecord
2266
+ * @description A native transcript record of a Claude session (source=claude_code).
2267
+ */
2268
+ ClaudeSessionRecord: {
2269
+ /**
2270
+ * Agent Turn Id
2271
+ * @description Identifier of the turn the record belongs to, if any.
2272
+ */
2273
+ agent_turn_id?: string | null;
2274
+ /**
2275
+ * Cost
2276
+ * @description Cost attributed to this record, if any.
2277
+ */
2278
+ cost?: number | null;
2279
+ /**
2280
+ * Created At
2281
+ * Format: date-time
2282
+ * @description When the record was created.
2283
+ */
2284
+ created_at: string;
2285
+ /**
2286
+ * Duration
2287
+ * @description Duration attributed to this record, if any.
2288
+ */
2289
+ duration?: number | null;
2290
+ /**
2291
+ * Feed Seq
2292
+ * @description The record's position in the session's ordered feed — the resume cursor for the stream and the records endpoints.
2293
+ */
2294
+ feed_seq: number;
2295
+ /**
2296
+ * Id
2297
+ * @description Unique identifier of the record.
2298
+ */
2299
+ id: string;
2300
+ /**
2301
+ * Model
2302
+ * @description The model that produced this record, if any.
2303
+ */
2304
+ model?: string | null;
2305
+ /**
2306
+ * Payload
2307
+ * @description One Claude session record, discriminated by `kind`.
2308
+ */
2309
+ payload: components['schemas']['SdkAssistantRecord'] | components['schemas']['SdkUserRecord'] | components['schemas']['SdkSystemRecord'] | components['schemas']['SdkResultRecord'] | components['schemas']['SdkRateLimitRecord'];
2310
+ /**
2311
+ * @description discriminator enum property added by openapi-typescript
2312
+ * @enum {string}
2313
+ */
2314
+ record_format: 'claude_sdk@1';
2315
+ /**
2316
+ * Record Type
2317
+ * @description The record's type within its format.
2318
+ */
2319
+ record_type: string;
2320
+ /**
2321
+ * Session Id
2322
+ * @description Identifier of the session the record belongs to.
2323
+ */
2324
+ session_id: string;
2325
+ /**
2326
+ * Session Message Id
2327
+ * @description Correlates a user-echo record back to the session message it echoes, so clients can retire queued messages by id.
2328
+ */
2329
+ session_message_id?: string | null;
2330
+ /** @description Which subsystem produced the record. */
2331
+ source: components['schemas']['RecordSource'];
2332
+ /**
2333
+ * Stream Seq
2334
+ * @description The record's position within its execution's stream.
2335
+ */
2336
+ stream_seq: number;
2337
+ /** @description Token usage reported for this record, if any. */
2338
+ tokens_info?: components['schemas']['TokensInfo'] | null;
2339
+ /**
2340
+ * Tools
2341
+ * @description Names of the tools used in this record, if any.
2342
+ */
2343
+ tools?: string[] | null;
2344
+ };
2283
2345
  /**
2284
2346
  * CliAuthPollRequest
2285
2347
  * @description A device-flow poll from the CLI.
@@ -2296,6 +2358,397 @@ interface components {
2296
2358
  * @enum {string}
2297
2359
  */
2298
2360
  CodeReviewRunStatus: 'scheduled' | 'running' | 'posting' | 'completed' | 'skipped' | 'error' | 'cancelled';
2361
+ /**
2362
+ * CodexAgentMessageItem
2363
+ * @description The agent said something to the user — Codex's assistant-text item.
2364
+ */
2365
+ CodexAgentMessageItem: {
2366
+ /** Id */
2367
+ id?: string | null;
2368
+ /**
2369
+ * Text
2370
+ * @default
2371
+ */
2372
+ text: string;
2373
+ /**
2374
+ * Type
2375
+ * @default agent_message
2376
+ * @constant
2377
+ */
2378
+ type: 'agent_message';
2379
+ } & {
2380
+ [key: string]: unknown;
2381
+ };
2382
+ /** CodexCommandExecutionItem */
2383
+ CodexCommandExecutionItem: {
2384
+ /** Aggregated Output */
2385
+ aggregated_output?: string | null;
2386
+ /**
2387
+ * Command
2388
+ * @default
2389
+ */
2390
+ command: string;
2391
+ /** Exit Code */
2392
+ exit_code?: number | null;
2393
+ /** Id */
2394
+ id?: string | null;
2395
+ /** Status */
2396
+ status?: string | null;
2397
+ /**
2398
+ * Type
2399
+ * @default command_execution
2400
+ * @constant
2401
+ */
2402
+ type: 'command_execution';
2403
+ } & {
2404
+ [key: string]: unknown;
2405
+ };
2406
+ /** CodexErrorEvent */
2407
+ CodexErrorEvent: {
2408
+ /** Message */
2409
+ message?: string | null;
2410
+ /**
2411
+ * Type
2412
+ * @default error
2413
+ * @constant
2414
+ */
2415
+ type: 'error';
2416
+ } & {
2417
+ [key: string]: unknown;
2418
+ };
2419
+ /** CodexErrorItem */
2420
+ CodexErrorItem: {
2421
+ /** Id */
2422
+ id?: string | null;
2423
+ /** Message */
2424
+ message?: string | null;
2425
+ /**
2426
+ * Type
2427
+ * @default error
2428
+ * @constant
2429
+ */
2430
+ type: 'error';
2431
+ } & {
2432
+ [key: string]: unknown;
2433
+ };
2434
+ /** CodexFileChangeItem */
2435
+ CodexFileChangeItem: {
2436
+ /** Changes */
2437
+ changes?: {
2438
+ [key: string]: unknown;
2439
+ }[] | null;
2440
+ /** Id */
2441
+ id?: string | null;
2442
+ /** Status */
2443
+ status?: string | null;
2444
+ /**
2445
+ * Type
2446
+ * @default file_change
2447
+ * @constant
2448
+ */
2449
+ type: 'file_change';
2450
+ } & {
2451
+ [key: string]: unknown;
2452
+ };
2453
+ /** CodexItemCompletedEvent */
2454
+ CodexItemCompletedEvent: {
2455
+ /** Item */
2456
+ item: components['schemas']['CodexAgentMessageItem'] | components['schemas']['CodexReasoningItem'] | components['schemas']['CodexCommandExecutionItem'] | components['schemas']['CodexFileChangeItem'] | components['schemas']['CodexMcpToolCallItem'] | components['schemas']['CodexWebSearchItem'] | components['schemas']['CodexTodoListItem'] | components['schemas']['CodexErrorItem'] | components['schemas']['CodexUnknownItem'];
2457
+ /**
2458
+ * Type
2459
+ * @default item.completed
2460
+ * @constant
2461
+ */
2462
+ type: 'item.completed';
2463
+ } & {
2464
+ [key: string]: unknown;
2465
+ };
2466
+ /** CodexItemStartedEvent */
2467
+ CodexItemStartedEvent: {
2468
+ /** Item */
2469
+ item: components['schemas']['CodexAgentMessageItem'] | components['schemas']['CodexReasoningItem'] | components['schemas']['CodexCommandExecutionItem'] | components['schemas']['CodexFileChangeItem'] | components['schemas']['CodexMcpToolCallItem'] | components['schemas']['CodexWebSearchItem'] | components['schemas']['CodexTodoListItem'] | components['schemas']['CodexErrorItem'] | components['schemas']['CodexUnknownItem'];
2470
+ /**
2471
+ * Type
2472
+ * @default item.started
2473
+ * @constant
2474
+ */
2475
+ type: 'item.started';
2476
+ } & {
2477
+ [key: string]: unknown;
2478
+ };
2479
+ /** CodexItemUpdatedEvent */
2480
+ CodexItemUpdatedEvent: {
2481
+ /** Item */
2482
+ item: components['schemas']['CodexAgentMessageItem'] | components['schemas']['CodexReasoningItem'] | components['schemas']['CodexCommandExecutionItem'] | components['schemas']['CodexFileChangeItem'] | components['schemas']['CodexMcpToolCallItem'] | components['schemas']['CodexWebSearchItem'] | components['schemas']['CodexTodoListItem'] | components['schemas']['CodexErrorItem'] | components['schemas']['CodexUnknownItem'];
2483
+ /**
2484
+ * Type
2485
+ * @default item.updated
2486
+ * @constant
2487
+ */
2488
+ type: 'item.updated';
2489
+ } & {
2490
+ [key: string]: unknown;
2491
+ };
2492
+ /** CodexMcpToolCallItem */
2493
+ CodexMcpToolCallItem: {
2494
+ /** Id */
2495
+ id?: string | null;
2496
+ /** Server */
2497
+ server?: string | null;
2498
+ /** Status */
2499
+ status?: string | null;
2500
+ /** Tool */
2501
+ tool?: string | null;
2502
+ /**
2503
+ * Type
2504
+ * @default mcp_tool_call
2505
+ * @constant
2506
+ */
2507
+ type: 'mcp_tool_call';
2508
+ } & {
2509
+ [key: string]: unknown;
2510
+ };
2511
+ /** CodexReasoningItem */
2512
+ CodexReasoningItem: {
2513
+ /** Id */
2514
+ id?: string | null;
2515
+ /** Summary */
2516
+ summary?: string | null;
2517
+ /** Text */
2518
+ text?: string | null;
2519
+ /**
2520
+ * Type
2521
+ * @default reasoning
2522
+ * @constant
2523
+ */
2524
+ type: 'reasoning';
2525
+ } & {
2526
+ [key: string]: unknown;
2527
+ };
2528
+ /**
2529
+ * CodexSessionRecord
2530
+ * @description A native transcript record of a Codex session (source=codex).
2531
+ */
2532
+ CodexSessionRecord: {
2533
+ /**
2534
+ * Agent Turn Id
2535
+ * @description Identifier of the turn the record belongs to, if any.
2536
+ */
2537
+ agent_turn_id?: string | null;
2538
+ /**
2539
+ * Cost
2540
+ * @description Cost attributed to this record, if any.
2541
+ */
2542
+ cost?: number | null;
2543
+ /**
2544
+ * Created At
2545
+ * Format: date-time
2546
+ * @description When the record was created.
2547
+ */
2548
+ created_at: string;
2549
+ /**
2550
+ * Duration
2551
+ * @description Duration attributed to this record, if any.
2552
+ */
2553
+ duration?: number | null;
2554
+ /**
2555
+ * Feed Seq
2556
+ * @description The record's position in the session's ordered feed — the resume cursor for the stream and the records endpoints.
2557
+ */
2558
+ feed_seq: number;
2559
+ /**
2560
+ * Id
2561
+ * @description Unique identifier of the record.
2562
+ */
2563
+ id: string;
2564
+ /**
2565
+ * Model
2566
+ * @description The model that produced this record, if any.
2567
+ */
2568
+ model?: string | null;
2569
+ /**
2570
+ * Payload
2571
+ * @description One Codex `exec --json` ThreadEvent, verbatim, discriminated by `type`.
2572
+ */
2573
+ payload: components['schemas']['CodexThreadStartedEvent'] | components['schemas']['CodexTurnStartedEvent'] | components['schemas']['CodexTurnCompletedEvent'] | components['schemas']['CodexTurnFailedEvent'] | components['schemas']['CodexErrorEvent'] | components['schemas']['CodexItemStartedEvent'] | components['schemas']['CodexItemUpdatedEvent'] | components['schemas']['CodexItemCompletedEvent'] | components['schemas']['CodexUnknownEvent'];
2574
+ /**
2575
+ * @description discriminator enum property added by openapi-typescript
2576
+ * @enum {string}
2577
+ */
2578
+ record_format: 'codex_jsonl@1';
2579
+ /**
2580
+ * Record Type
2581
+ * @description The record's type within its format.
2582
+ */
2583
+ record_type: string;
2584
+ /**
2585
+ * Session Id
2586
+ * @description Identifier of the session the record belongs to.
2587
+ */
2588
+ session_id: string;
2589
+ /**
2590
+ * Session Message Id
2591
+ * @description Correlates a user-echo record back to the session message it echoes, so clients can retire queued messages by id.
2592
+ */
2593
+ session_message_id?: string | null;
2594
+ /** @description Which subsystem produced the record. */
2595
+ source: components['schemas']['RecordSource'];
2596
+ /**
2597
+ * Stream Seq
2598
+ * @description The record's position within its execution's stream.
2599
+ */
2600
+ stream_seq: number;
2601
+ /** @description Token usage reported for this record, if any. */
2602
+ tokens_info?: components['schemas']['TokensInfo'] | null;
2603
+ /**
2604
+ * Tools
2605
+ * @description Names of the tools used in this record, if any.
2606
+ */
2607
+ tools?: string[] | null;
2608
+ };
2609
+ /** CodexThreadStartedEvent */
2610
+ CodexThreadStartedEvent: {
2611
+ /** Thread Id */
2612
+ thread_id?: string | null;
2613
+ /**
2614
+ * Type
2615
+ * @default thread.started
2616
+ * @constant
2617
+ */
2618
+ type: 'thread.started';
2619
+ } & {
2620
+ [key: string]: unknown;
2621
+ };
2622
+ /** CodexTodoListItem */
2623
+ CodexTodoListItem: {
2624
+ /** Id */
2625
+ id?: string | null;
2626
+ /** Items */
2627
+ items?: {
2628
+ [key: string]: unknown;
2629
+ }[] | null;
2630
+ /**
2631
+ * Type
2632
+ * @default todo_list
2633
+ * @constant
2634
+ */
2635
+ type: 'todo_list';
2636
+ } & {
2637
+ [key: string]: unknown;
2638
+ };
2639
+ /** CodexTurnCompletedEvent */
2640
+ CodexTurnCompletedEvent: {
2641
+ /**
2642
+ * Type
2643
+ * @default turn.completed
2644
+ * @constant
2645
+ */
2646
+ type: 'turn.completed';
2647
+ usage?: components['schemas']['CodexUsage'] | null;
2648
+ } & {
2649
+ [key: string]: unknown;
2650
+ };
2651
+ /** CodexTurnFailedEvent */
2652
+ CodexTurnFailedEvent: {
2653
+ /** Error */
2654
+ error?: {
2655
+ [key: string]: unknown;
2656
+ } | null;
2657
+ /**
2658
+ * Type
2659
+ * @default turn.failed
2660
+ * @constant
2661
+ */
2662
+ type: 'turn.failed';
2663
+ } & {
2664
+ [key: string]: unknown;
2665
+ };
2666
+ /** CodexTurnStartedEvent */
2667
+ CodexTurnStartedEvent: {
2668
+ /**
2669
+ * Type
2670
+ * @default turn.started
2671
+ * @constant
2672
+ */
2673
+ type: 'turn.started';
2674
+ } & {
2675
+ [key: string]: unknown;
2676
+ };
2677
+ /**
2678
+ * CodexUnknownEvent
2679
+ * @description Catch-all for event types this schema does not know yet — including the
2680
+ * malformed-line records the stream parser keeps verbatim.
2681
+ */
2682
+ CodexUnknownEvent: {
2683
+ /** Type */
2684
+ type?: string | null;
2685
+ } & {
2686
+ [key: string]: unknown;
2687
+ };
2688
+ /**
2689
+ * CodexUnknownItem
2690
+ * @description Catch-all for item types this schema does not know yet.
2691
+ */
2692
+ CodexUnknownItem: {
2693
+ /** Id */
2694
+ id?: string | null;
2695
+ /** Type */
2696
+ type: string;
2697
+ } & {
2698
+ [key: string]: unknown;
2699
+ };
2700
+ /**
2701
+ * CodexUsage
2702
+ * @description The `usage` object on a `turn.completed` event — one turn's token counts.
2703
+ *
2704
+ * Note the field names differ from BOTH the Responses API and chat completions:
2705
+ * Codex reports `cached_input_tokens` / `cache_write_input_tokens` where the
2706
+ * Responses API says `input_tokens_details.cached_tokens`. These counts are for
2707
+ * display/records only — billing cost comes from the proxy's own ledger, which
2708
+ * prices the provider's usage, so a drift here can never mis-bill.
2709
+ */
2710
+ CodexUsage: {
2711
+ /**
2712
+ * Cache Write Input Tokens
2713
+ * @default 0
2714
+ */
2715
+ cache_write_input_tokens: number;
2716
+ /**
2717
+ * Cached Input Tokens
2718
+ * @default 0
2719
+ */
2720
+ cached_input_tokens: number;
2721
+ /**
2722
+ * Input Tokens
2723
+ * @default 0
2724
+ */
2725
+ input_tokens: number;
2726
+ /**
2727
+ * Output Tokens
2728
+ * @default 0
2729
+ */
2730
+ output_tokens: number;
2731
+ /**
2732
+ * Reasoning Output Tokens
2733
+ * @default 0
2734
+ */
2735
+ reasoning_output_tokens: number;
2736
+ };
2737
+ /** CodexWebSearchItem */
2738
+ CodexWebSearchItem: {
2739
+ /** Id */
2740
+ id?: string | null;
2741
+ /** Query */
2742
+ query?: string | null;
2743
+ /**
2744
+ * Type
2745
+ * @default web_search
2746
+ * @constant
2747
+ */
2748
+ type: 'web_search';
2749
+ } & {
2750
+ [key: string]: unknown;
2751
+ };
2299
2752
  /**
2300
2753
  * Config
2301
2754
  * @description A saved agent config: the stored row for one agent, plus where it syncs
@@ -2630,7 +3083,7 @@ interface components {
2630
3083
  ErrorInfo: {
2631
3084
  /**
2632
3085
  * Code
2633
- * @description Stable machine-readable error code. Open vocabulary — handle unknown codes by HTTP status. Known values: account_blocked, conflict, contact_email_required, failed_dependency, file_quota_exceeded, forbidden, internal_error, invalid_request, not_found, rate_limited, review_in_flight, session_closed, session_ephemeral_trigger, session_finished, session_harness_single_turn, session_mention_surface, session_non_interactive, unauthorized, unavailable.
3086
+ * @description Stable machine-readable error code. Open vocabulary — handle unknown codes by HTTP status. Known values: account_blocked, conflict, contact_email_required, failed_dependency, file_quota_exceeded, forbidden, internal_error, invalid_request, not_found, rate_limit_exceeded, rate_limited, review_in_flight, session_closed, session_ephemeral_trigger, session_finished, session_harness_single_turn, session_mention_surface, session_non_interactive, unauthorized, unavailable.
2634
3087
  */
2635
3088
  code: string;
2636
3089
  /**
@@ -3235,38 +3688,122 @@ interface components {
3235
3688
  * Lines
3236
3689
  * @description Raw on-disk transcript lines starting at `offset`.
3237
3690
  */
3238
- lines: string[];
3691
+ lines: string[];
3692
+ /**
3693
+ * Offset
3694
+ * @description The line offset the batch starts at.
3695
+ * @default 0
3696
+ */
3697
+ offset: number;
3698
+ };
3699
+ /**
3700
+ * IssueAction
3701
+ * @enum {string}
3702
+ */
3703
+ IssueAction: 'opened' | 'closed' | 'commented';
3704
+ /**
3705
+ * JiraIntegrationSummary
3706
+ * @description The account's connected Jira site.
3707
+ */
3708
+ JiraIntegrationSummary: {
3709
+ /**
3710
+ * Cloud Id
3711
+ * @description The Jira cloud site id.
3712
+ */
3713
+ cloud_id: string;
3714
+ };
3715
+ /**
3716
+ * Level
3717
+ * @description What may be done to a resource. Strictly ordered: a grant at one level
3718
+ * includes every level below it (write-only would be a phantom capability —
3719
+ * no real client can create what it cannot read back).
3720
+ * @enum {string}
3721
+ */
3722
+ Level: 'read' | 'write' | 'delete';
3723
+ /**
3724
+ * LifecycleSessionRecord
3725
+ * @description A controller-emitted platform notification (source=lifecycle). The
3726
+ * payload shape is keyed by `record_type` — see lifecycle.schema.json.
3727
+ */
3728
+ LifecycleSessionRecord: {
3729
+ /**
3730
+ * Agent Turn Id
3731
+ * @description Identifier of the turn the record belongs to, if any.
3732
+ */
3733
+ agent_turn_id?: string | null;
3734
+ /**
3735
+ * Cost
3736
+ * @description Cost attributed to this record, if any.
3737
+ */
3738
+ cost?: number | null;
3739
+ /**
3740
+ * Created At
3741
+ * Format: date-time
3742
+ * @description When the record was created.
3743
+ */
3744
+ created_at: string;
3745
+ /**
3746
+ * Duration
3747
+ * @description Duration attributed to this record, if any.
3748
+ */
3749
+ duration?: number | null;
3750
+ /**
3751
+ * Feed Seq
3752
+ * @description The record's position in the session's ordered feed — the resume cursor for the stream and the records endpoints.
3753
+ */
3754
+ feed_seq: number;
3755
+ /**
3756
+ * Id
3757
+ * @description Unique identifier of the record.
3758
+ */
3759
+ id: string;
3760
+ /**
3761
+ * Model
3762
+ * @description The model that produced this record, if any.
3763
+ */
3764
+ model?: string | null;
3765
+ /**
3766
+ * Payload
3767
+ * @description The lifecycle payload; its shape is keyed by record_type.
3768
+ */
3769
+ payload: {
3770
+ [key: string]: unknown;
3771
+ };
3772
+ /**
3773
+ * @description discriminator enum property added by openapi-typescript
3774
+ * @enum {string}
3775
+ */
3776
+ record_format: 'ellipsis_lifecycle@1';
3777
+ /**
3778
+ * Record Type
3779
+ * @description The record's type within its format.
3780
+ */
3781
+ record_type: string;
3782
+ /**
3783
+ * Session Id
3784
+ * @description Identifier of the session the record belongs to.
3785
+ */
3786
+ session_id: string;
3787
+ /**
3788
+ * Session Message Id
3789
+ * @description Correlates a user-echo record back to the session message it echoes, so clients can retire queued messages by id.
3790
+ */
3791
+ session_message_id?: string | null;
3792
+ /** @description Which subsystem produced the record. */
3793
+ source: components['schemas']['RecordSource'];
3239
3794
  /**
3240
- * Offset
3241
- * @description The line offset the batch starts at.
3242
- * @default 0
3795
+ * Stream Seq
3796
+ * @description The record's position within its execution's stream.
3243
3797
  */
3244
- offset: number;
3245
- };
3246
- /**
3247
- * IssueAction
3248
- * @enum {string}
3249
- */
3250
- IssueAction: 'opened' | 'closed' | 'commented';
3251
- /**
3252
- * JiraIntegrationSummary
3253
- * @description The account's connected Jira site.
3254
- */
3255
- JiraIntegrationSummary: {
3798
+ stream_seq: number;
3799
+ /** @description Token usage reported for this record, if any. */
3800
+ tokens_info?: components['schemas']['TokensInfo'] | null;
3256
3801
  /**
3257
- * Cloud Id
3258
- * @description The Jira cloud site id.
3802
+ * Tools
3803
+ * @description Names of the tools used in this record, if any.
3259
3804
  */
3260
- cloud_id: string;
3805
+ tools?: string[] | null;
3261
3806
  };
3262
- /**
3263
- * Level
3264
- * @description What may be done to a resource. Strictly ordered: a grant at one level
3265
- * includes every level below it (write-only would be a phantom capability —
3266
- * no real client can create what it cannot read back).
3267
- * @enum {string}
3268
- */
3269
- Level: 'read' | 'write' | 'delete';
3270
3807
  /**
3271
3808
  * LinearIntegrationSummary
3272
3809
  * @description The account's connected Linear organization and its teams.
@@ -3566,16 +4103,16 @@ interface components {
3566
4103
  ModelManufacturer: 'anthropic' | 'openai' | 'zai' | 'minimax' | 'moonshot';
3567
4104
  /** ModelRateCardApi */
3568
4105
  ModelRateCardApi: {
3569
- /** Cache Read Cents Per 1M Tokens */
3570
- cache_read_cents_per_1m_tokens: number;
3571
- /** Cache Write 1H Cents Per 1M Tokens */
3572
- cache_write_1h_cents_per_1m_tokens: number;
3573
- /** Cache Write 5M Cents Per 1M Tokens */
3574
- cache_write_5m_cents_per_1m_tokens: number;
3575
- /** Input Cents Per 1M Tokens */
3576
- input_cents_per_1m_tokens: number;
3577
- /** Output Cents Per 1M Tokens */
3578
- output_cents_per_1m_tokens: number;
4106
+ /** Cache Read Millicents Per 1M Tokens */
4107
+ cache_read_millicents_per_1m_tokens: number;
4108
+ /** Cache Write 1H Millicents Per 1M Tokens */
4109
+ cache_write_1h_millicents_per_1m_tokens: number;
4110
+ /** Cache Write 5M Millicents Per 1M Tokens */
4111
+ cache_write_5m_millicents_per_1m_tokens: number;
4112
+ /** Input Millicents Per 1M Tokens */
4113
+ input_millicents_per_1m_tokens: number;
4114
+ /** Output Millicents Per 1M Tokens */
4115
+ output_millicents_per_1m_tokens: number;
3579
4116
  };
3580
4117
  /**
3581
4118
  * ModelUsageBreakdown
@@ -5064,6 +5601,252 @@ interface components {
5064
5601
  * @enum {string}
5065
5602
  */
5066
5603
  RunStatus: 'scheduled' | 'starting' | 'working' | 'waiting' | 'done' | 'failed' | 'stopped' | 'cancelled' | 'retrying';
5604
+ /** SdkAssistantRecord */
5605
+ SdkAssistantRecord: {
5606
+ cache_creation?: components['schemas']['SdkCacheCreation'] | null;
5607
+ /**
5608
+ * Content
5609
+ * @default []
5610
+ */
5611
+ content: (components['schemas']['SdkTextBlock'] | components['schemas']['SdkThinkingBlock'] | components['schemas']['SdkToolUseBlock'] | components['schemas']['SdkToolResultBlock'] | components['schemas']['SdkServerToolUseBlock'] | components['schemas']['SdkServerToolResultBlock'])[];
5612
+ /** Error */
5613
+ error?: string | null;
5614
+ /**
5615
+ * @description discriminator enum property added by openapi-typescript
5616
+ * @enum {string}
5617
+ */
5618
+ kind: 'assistant';
5619
+ /** Message Id */
5620
+ message_id?: string | null;
5621
+ /** Model */
5622
+ model: string;
5623
+ /** Parent Tool Use Id */
5624
+ parent_tool_use_id?: string | null;
5625
+ /** Session Id */
5626
+ session_id?: string | null;
5627
+ /** Stop Reason */
5628
+ stop_reason?: string | null;
5629
+ usage?: components['schemas']['TokensInfo'] | null;
5630
+ /** Uuid */
5631
+ uuid?: string | null;
5632
+ };
5633
+ /**
5634
+ * SdkCacheCreation
5635
+ * @description The cache-write breakdown by TTL. Load-bearing for billing, not
5636
+ * informational: the 5m and 1h lanes have different rate-card prices
5637
+ * (`normalized_usage_from_anthropic`), so collapsing them into one
5638
+ * `cache_creation_input_tokens` total silently misprices every session with 1h
5639
+ * caching on.
5640
+ */
5641
+ SdkCacheCreation: {
5642
+ /**
5643
+ * Ephemeral 1H Input Tokens
5644
+ * @default 0
5645
+ */
5646
+ ephemeral_1h_input_tokens: number;
5647
+ /**
5648
+ * Ephemeral 5M Input Tokens
5649
+ * @default 0
5650
+ */
5651
+ ephemeral_5m_input_tokens: number;
5652
+ };
5653
+ /** SdkRateLimitRecord */
5654
+ SdkRateLimitRecord: {
5655
+ /**
5656
+ * @description discriminator enum property added by openapi-typescript
5657
+ * @enum {string}
5658
+ */
5659
+ kind: 'rate_limit';
5660
+ /** Rate Limit Type */
5661
+ rate_limit_type?: string | null;
5662
+ /** Resets At */
5663
+ resets_at?: number | null;
5664
+ /** Session Id */
5665
+ session_id?: string | null;
5666
+ /** Status */
5667
+ status: string;
5668
+ /** Utilization */
5669
+ utilization?: number | null;
5670
+ /** Uuid */
5671
+ uuid?: string | null;
5672
+ };
5673
+ /**
5674
+ * SdkResultRecord
5675
+ * @description One turn's terminal record: the SDK's `ResultMessage`. `usage` and
5676
+ * `cost_usd` here are the turn totals the worker prices from.
5677
+ */
5678
+ SdkResultRecord: {
5679
+ /** Api Error Status */
5680
+ api_error_status?: number | null;
5681
+ /** Cost Usd */
5682
+ cost_usd?: number | null;
5683
+ /** Duration Api Ms */
5684
+ duration_api_ms: number;
5685
+ /** Duration Ms */
5686
+ duration_ms: number;
5687
+ /** Errors */
5688
+ errors?: string[] | null;
5689
+ /** Is Error */
5690
+ is_error: boolean;
5691
+ /**
5692
+ * @description discriminator enum property added by openapi-typescript
5693
+ * @enum {string}
5694
+ */
5695
+ kind: 'result';
5696
+ /** Model Usage */
5697
+ model_usage?: {
5698
+ [key: string]: unknown;
5699
+ } | null;
5700
+ /** Num Turns */
5701
+ num_turns: number;
5702
+ /** Result */
5703
+ result?: string | null;
5704
+ /** Session Id */
5705
+ session_id?: string | null;
5706
+ /** Stop Reason */
5707
+ stop_reason?: string | null;
5708
+ /** Structured Output */
5709
+ structured_output?: unknown;
5710
+ /** Subtype */
5711
+ subtype: string;
5712
+ usage?: components['schemas']['TokensInfo'] | null;
5713
+ /** Uuid */
5714
+ uuid?: string | null;
5715
+ };
5716
+ /** SdkServerToolResultBlock */
5717
+ SdkServerToolResultBlock: {
5718
+ /**
5719
+ * Content
5720
+ * @default {}
5721
+ */
5722
+ content: {
5723
+ [key: string]: unknown;
5724
+ };
5725
+ /** Tool Use Id */
5726
+ tool_use_id: string;
5727
+ /**
5728
+ * @description discriminator enum property added by openapi-typescript
5729
+ * @enum {string}
5730
+ */
5731
+ type: 'server_tool_result';
5732
+ };
5733
+ /** SdkServerToolUseBlock */
5734
+ SdkServerToolUseBlock: {
5735
+ /** Id */
5736
+ id: string;
5737
+ /**
5738
+ * Input
5739
+ * @default {}
5740
+ */
5741
+ input: {
5742
+ [key: string]: unknown;
5743
+ };
5744
+ /** Name */
5745
+ name: string;
5746
+ /**
5747
+ * @description discriminator enum property added by openapi-typescript
5748
+ * @enum {string}
5749
+ */
5750
+ type: 'server_tool_use';
5751
+ };
5752
+ /**
5753
+ * SdkSystemRecord
5754
+ * @description Everything the CLI reports out-of-band: init, compact_boundary, task
5755
+ * lifecycle, hook events, api_error. `data` is the raw payload — this is the
5756
+ * one open shape in the schema, because the CLI's system subtypes are an
5757
+ * open set we do not want to fail a session over.
5758
+ */
5759
+ SdkSystemRecord: {
5760
+ /**
5761
+ * Data
5762
+ * @default {}
5763
+ */
5764
+ data: {
5765
+ [key: string]: unknown;
5766
+ };
5767
+ /**
5768
+ * @description discriminator enum property added by openapi-typescript
5769
+ * @enum {string}
5770
+ */
5771
+ kind: 'system';
5772
+ /** Session Id */
5773
+ session_id?: string | null;
5774
+ /** Subtype */
5775
+ subtype: string;
5776
+ /** Uuid */
5777
+ uuid?: string | null;
5778
+ };
5779
+ /** SdkTextBlock */
5780
+ SdkTextBlock: {
5781
+ /** Text */
5782
+ text: string;
5783
+ /**
5784
+ * @description discriminator enum property added by openapi-typescript
5785
+ * @enum {string}
5786
+ */
5787
+ type: 'text';
5788
+ };
5789
+ /** SdkThinkingBlock */
5790
+ SdkThinkingBlock: {
5791
+ /** Signature */
5792
+ signature: string;
5793
+ /** Thinking */
5794
+ thinking: string;
5795
+ /**
5796
+ * @description discriminator enum property added by openapi-typescript
5797
+ * @enum {string}
5798
+ */
5799
+ type: 'thinking';
5800
+ };
5801
+ /** SdkToolResultBlock */
5802
+ SdkToolResultBlock: {
5803
+ /** Content */
5804
+ content?: string | {
5805
+ [key: string]: unknown;
5806
+ }[] | null;
5807
+ /** Is Error */
5808
+ is_error?: boolean | null;
5809
+ /** Tool Use Id */
5810
+ tool_use_id: string;
5811
+ /**
5812
+ * @description discriminator enum property added by openapi-typescript
5813
+ * @enum {string}
5814
+ */
5815
+ type: 'tool_result';
5816
+ };
5817
+ /** SdkToolUseBlock */
5818
+ SdkToolUseBlock: {
5819
+ /** Id */
5820
+ id: string;
5821
+ /**
5822
+ * Input
5823
+ * @default {}
5824
+ */
5825
+ input: {
5826
+ [key: string]: unknown;
5827
+ };
5828
+ /** Name */
5829
+ name: string;
5830
+ /**
5831
+ * @description discriminator enum property added by openapi-typescript
5832
+ * @enum {string}
5833
+ */
5834
+ type: 'tool_use';
5835
+ };
5836
+ /** SdkUserRecord */
5837
+ SdkUserRecord: {
5838
+ /** Content */
5839
+ content: string | (components['schemas']['SdkTextBlock'] | components['schemas']['SdkThinkingBlock'] | components['schemas']['SdkToolUseBlock'] | components['schemas']['SdkToolResultBlock'] | components['schemas']['SdkServerToolUseBlock'] | components['schemas']['SdkServerToolResultBlock'])[];
5840
+ /**
5841
+ * @description discriminator enum property added by openapi-typescript
5842
+ * @enum {string}
5843
+ */
5844
+ kind: 'user';
5845
+ /** Parent Tool Use Id */
5846
+ parent_tool_use_id?: string | null;
5847
+ /** Uuid */
5848
+ uuid?: string | null;
5849
+ };
5067
5850
  /**
5068
5851
  * Secret
5069
5852
  * @description A stored variable WITHOUT its value. Values are write-only: once
@@ -5589,121 +6372,36 @@ interface components {
5589
6372
  * SessionPr
5590
6373
  * @description A pull request this session created, denormalized at capture time so
5591
6374
  * session surfaces render a labeled link without joining gh_prs. Live PR
5592
- * state (open/merged/closed) is not stored here — read it from gh_prs where
5593
- * a view needs it.
5594
- */
5595
- SessionPr: {
5596
- /** Gh Pr Id */
5597
- gh_pr_id?: number | null;
5598
- /** Number */
5599
- number: number;
5600
- /** Repo Full Name */
5601
- repo_full_name: string;
5602
- /** Title */
5603
- title?: string | null;
5604
- /** Url */
5605
- url: string;
5606
- };
5607
- /**
5608
- * SessionPrompting
5609
- * @description The prompt-affordance projection. `enabled` answers "would a send work",
5610
- * and when it wouldn't, `blocked_reason` + `detail` say why.
5611
- *
5612
- * `surface_name` is set only for MENTION_SURFACE, naming where to reply.
5613
- */
5614
- SessionPrompting: {
5615
- blocked_reason?: components['schemas']['PromptBlockedReason'] | null;
5616
- /** Detail */
5617
- detail?: string | null;
5618
- /** Enabled */
5619
- enabled: boolean;
5620
- /** Surface Name */
5621
- surface_name?: string | null;
5622
- };
5623
- /**
5624
- * SessionRecord
5625
- * @description One entry of a session's log: a stable envelope around the harness's
5626
- * native payload. Internal-only columns are deliberately absent so internal
5627
- * model evolution stays free.
5628
- */
5629
- SessionRecord: {
5630
- /**
5631
- * Agent Turn Id
5632
- * @description Identifier of the turn the record belongs to, if any.
5633
- */
5634
- agent_turn_id?: string | null;
5635
- /**
5636
- * Cost
5637
- * @description Cost attributed to this record, if any.
5638
- */
5639
- cost?: number | null;
5640
- /**
5641
- * Created At
5642
- * Format: date-time
5643
- * @description When the record was created.
5644
- */
5645
- created_at: string;
5646
- /**
5647
- * Duration
5648
- * @description Duration attributed to this record, if any.
5649
- */
5650
- duration?: number | null;
5651
- /**
5652
- * Feed Seq
5653
- * @description The record's position in the session's ordered feed — the resume cursor for the stream and the records endpoints.
5654
- */
5655
- feed_seq: number;
5656
- /**
5657
- * Id
5658
- * @description Unique identifier of the record.
5659
- */
5660
- id: string;
5661
- /**
5662
- * Model
5663
- * @description The model that produced this record, if any.
5664
- */
5665
- model?: string | null;
5666
- /**
5667
- * Payload
5668
- * @description The harness's native line, verbatim. Consumers parse it at their own risk, versioned via record_format.
5669
- */
5670
- payload: {
5671
- [key: string]: unknown;
5672
- };
5673
- /**
5674
- * Record Format
5675
- * @description Versions the payload shape, e.g. claude_stream_json@2.0 or ellipsis_lifecycle@1.
5676
- */
5677
- record_format: string;
5678
- /**
5679
- * Record Type
5680
- * @description The record's type within its format.
5681
- */
5682
- record_type: string;
5683
- /**
5684
- * Session Id
5685
- * @description Identifier of the session the record belongs to.
5686
- */
5687
- session_id: string;
5688
- /**
5689
- * Session Message Id
5690
- * @description Correlates a user-echo record back to the session message it echoes, so clients can retire queued messages by id.
5691
- */
5692
- session_message_id?: string | null;
5693
- /** @description Which subsystem produced the record. */
5694
- source: components['schemas']['RecordSource'];
5695
- /**
5696
- * Stream Seq
5697
- * @description The record's position within its execution's stream.
5698
- */
5699
- stream_seq: number;
5700
- /** @description Token usage reported for this record, if any. */
5701
- tokens_info?: components['schemas']['TokensInfo'] | null;
5702
- /**
5703
- * Tools
5704
- * @description Names of the tools used in this record, if any.
5705
- */
5706
- tools?: string[] | null;
6375
+ * state (open/merged/closed) is not stored here — read it from gh_prs where
6376
+ * a view needs it.
6377
+ */
6378
+ SessionPr: {
6379
+ /** Gh Pr Id */
6380
+ gh_pr_id?: number | null;
6381
+ /** Number */
6382
+ number: number;
6383
+ /** Repo Full Name */
6384
+ repo_full_name: string;
6385
+ /** Title */
6386
+ title?: string | null;
6387
+ /** Url */
6388
+ url: string;
6389
+ };
6390
+ /**
6391
+ * SessionPrompting
6392
+ * @description The prompt-affordance projection. `enabled` answers "would a send work",
6393
+ * and when it wouldn't, `blocked_reason` + `detail` say why.
6394
+ *
6395
+ * `surface_name` is set only for MENTION_SURFACE, naming where to reply.
6396
+ */
6397
+ SessionPrompting: {
6398
+ blocked_reason?: components['schemas']['PromptBlockedReason'] | null;
6399
+ /** Detail */
6400
+ detail?: string | null;
6401
+ /** Enabled */
6402
+ enabled: boolean;
6403
+ /** Surface Name */
6404
+ surface_name?: string | null;
5707
6405
  };
5708
6406
  /**
5709
6407
  * SessionRecordsListResponse
@@ -5737,7 +6435,7 @@ interface components {
5737
6435
  * Records
5738
6436
  * @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.
5739
6437
  */
5740
- records: components['schemas']['SessionRecord'][];
6438
+ records: (components['schemas']['ClaudeSessionRecord'] | components['schemas']['CodexSessionRecord'] | components['schemas']['LifecycleSessionRecord'])[];
5741
6439
  };
5742
6440
  /**
5743
6441
  * SessionResponse
@@ -10195,7 +10893,6 @@ interface AgentConfig {
10195
10893
  ellipsis: AgentConfigEllipsis;
10196
10894
  environment: AgentConfigEnvironment;
10197
10895
  input: AgentConfigInput | null;
10198
- llm: AgentConfigLlm;
10199
10896
  mcp_servers: (string | AgentConfigMcpServer)[];
10200
10897
  output: AgentConfigOutput | null;
10201
10898
  permissions: AgentConfigPermissions;
@@ -10425,21 +11122,6 @@ interface AgentConfigInput {
10425
11122
  } | null;
10426
11123
  message: string | null;
10427
11124
  }
10428
- /**
10429
- * Where this agent's completions go.
10430
- *
10431
- * Defaults to Ellipsis's own LLM proxy (our Anthropic/Bedrock account, or the
10432
- * account-wide BYO provider if one is enabled). Setting `proxy` to the id of a
10433
- * proxy registered on the models settings page routes THIS agent's
10434
- * completions through that gateway instead.
10435
- *
10436
- * Opt-in per agent by design: registering a proxy does not silently move any
10437
- * existing agent's traffic. The id is account-scoped, so naming another
10438
- * account's id is a terminal config error, not a route.
10439
- */
10440
- interface AgentConfigLlm {
10441
- proxy: string | null;
10442
- }
10443
11125
  /**
10444
11126
  * One built-in MCP server this agent opts into by name (`linear`/`slack`).
10445
11127
  * This is a name reference over the connected built-in set, NOT a custom-server
@@ -10780,15 +11462,13 @@ interface RecordsAppendFrame {
10780
11462
  /**
10781
11463
  * New session records, ordered by feed_seq.
10782
11464
  */
10783
- records: SessionRecord[];
11465
+ records: (ClaudeSessionRecord | CodexSessionRecord | LifecycleSessionRecord)[];
10784
11466
  type: 'records_append';
10785
11467
  }
10786
11468
  /**
10787
- * One entry of a session's log: a stable envelope around the harness's
10788
- * native payload. Internal-only columns are deliberately absent so internal
10789
- * model evolution stays free.
11469
+ * A native transcript record of a Claude session (source=claude_code).
10790
11470
  */
10791
- interface SessionRecord {
11471
+ interface ClaudeSessionRecord {
10792
11472
  /**
10793
11473
  * Identifier of the turn the record belongs to, if any.
10794
11474
  */
@@ -10818,15 +11498,10 @@ interface SessionRecord {
10818
11498
  */
10819
11499
  model: string | null;
10820
11500
  /**
10821
- * The harness's native line, verbatim. Consumers parse it at their own risk, versioned via record_format.
10822
- */
10823
- payload: {
10824
- [k: string]: unknown;
10825
- };
10826
- /**
10827
- * Versions the payload shape, e.g. claude_stream_json@2.0 or ellipsis_lifecycle@1.
11501
+ * One Claude session record, discriminated by `kind`.
10828
11502
  */
10829
- record_format: string;
11503
+ payload: SdkAssistantRecord$1 | SdkUserRecord$1 | SdkSystemRecord$1 | SdkResultRecord$1 | SdkRateLimitRecord$1;
11504
+ record_format: 'claude_sdk@1';
10830
11505
  /**
10831
11506
  * The record's type within its format.
10832
11507
  */
@@ -10840,7 +11515,7 @@ interface SessionRecord {
10840
11515
  */
10841
11516
  session_message_id: string | null;
10842
11517
  /**
10843
- * Who wrote the record. Known values: claude_code (a native harness transcript record) | lifecycle (a platform notification). Open vocabulary: ignore records with unknown sources.
11518
+ * Who wrote the record. Open vocabulary: ignore records with unknown sources.
10844
11519
  */
10845
11520
  source: string;
10846
11521
  /**
@@ -10856,6 +11531,70 @@ interface SessionRecord {
10856
11531
  */
10857
11532
  tools: string[] | null;
10858
11533
  }
11534
+ interface SdkAssistantRecord$1 {
11535
+ cache_creation: SdkCacheCreation | null;
11536
+ content: (SdkTextBlock | SdkThinkingBlock | SdkToolUseBlock | SdkToolResultBlock | SdkServerToolUseBlock | SdkServerToolResultBlock)[];
11537
+ error: string | null;
11538
+ kind: 'assistant';
11539
+ message_id: string | null;
11540
+ model: string;
11541
+ parent_tool_use_id: string | null;
11542
+ session_id: string | null;
11543
+ stop_reason: string | null;
11544
+ usage: TokensInfo | null;
11545
+ uuid: string | null;
11546
+ }
11547
+ /**
11548
+ * The cache-write breakdown by TTL. Load-bearing for billing, not
11549
+ * informational: the 5m and 1h lanes have different rate-card prices
11550
+ * (`normalized_usage_from_anthropic`), so collapsing them into one
11551
+ * `cache_creation_input_tokens` total silently misprices every session with 1h
11552
+ * caching on.
11553
+ */
11554
+ interface SdkCacheCreation {
11555
+ ephemeral_1h_input_tokens: number;
11556
+ ephemeral_5m_input_tokens: number;
11557
+ }
11558
+ interface SdkTextBlock {
11559
+ text: string;
11560
+ type: 'text';
11561
+ }
11562
+ interface SdkThinkingBlock {
11563
+ signature: string;
11564
+ thinking: string;
11565
+ type: 'thinking';
11566
+ }
11567
+ interface SdkToolUseBlock {
11568
+ id: string;
11569
+ input: {
11570
+ [k: string]: unknown;
11571
+ };
11572
+ name: string;
11573
+ type: 'tool_use';
11574
+ }
11575
+ interface SdkToolResultBlock {
11576
+ content: string | {
11577
+ [k: string]: unknown;
11578
+ }[] | null;
11579
+ is_error: boolean | null;
11580
+ tool_use_id: string;
11581
+ type: 'tool_result';
11582
+ }
11583
+ interface SdkServerToolUseBlock {
11584
+ id: string;
11585
+ input: {
11586
+ [k: string]: unknown;
11587
+ };
11588
+ name: string;
11589
+ type: 'server_tool_use';
11590
+ }
11591
+ interface SdkServerToolResultBlock {
11592
+ content: {
11593
+ [k: string]: unknown;
11594
+ };
11595
+ tool_use_id: string;
11596
+ type: 'server_tool_result';
11597
+ }
10859
11598
  /**
10860
11599
  * Token/cost usage, per record (one API call's counts, aggregate fields at
10861
11600
  * their zero defaults) or aggregated per execution/session
@@ -10876,6 +11615,332 @@ interface TokensInfo {
10876
11615
  num_turns: number;
10877
11616
  output_tokens: number;
10878
11617
  }
11618
+ interface SdkUserRecord$1 {
11619
+ content: string | (SdkTextBlock | SdkThinkingBlock | SdkToolUseBlock | SdkToolResultBlock | SdkServerToolUseBlock | SdkServerToolResultBlock)[];
11620
+ kind: 'user';
11621
+ parent_tool_use_id: string | null;
11622
+ uuid: string | null;
11623
+ }
11624
+ /**
11625
+ * Everything the CLI reports out-of-band: init, compact_boundary, task
11626
+ * lifecycle, hook events, api_error. `data` is the raw payload — this is the
11627
+ * one open shape in the schema, because the CLI's system subtypes are an
11628
+ * open set we do not want to fail a session over.
11629
+ */
11630
+ interface SdkSystemRecord$1 {
11631
+ data: {
11632
+ [k: string]: unknown;
11633
+ };
11634
+ kind: 'system';
11635
+ session_id: string | null;
11636
+ subtype: string;
11637
+ uuid: string | null;
11638
+ }
11639
+ /**
11640
+ * One turn's terminal record: the SDK's `ResultMessage`. `usage` and
11641
+ * `cost_usd` here are the turn totals the worker prices from.
11642
+ */
11643
+ interface SdkResultRecord$1 {
11644
+ api_error_status: number | null;
11645
+ cost_usd: number | null;
11646
+ duration_api_ms: number;
11647
+ duration_ms: number;
11648
+ errors: string[] | null;
11649
+ is_error: boolean;
11650
+ kind: 'result';
11651
+ model_usage: {
11652
+ [k: string]: unknown;
11653
+ } | null;
11654
+ num_turns: number;
11655
+ result: string | null;
11656
+ session_id: string | null;
11657
+ stop_reason: string | null;
11658
+ structured_output: {
11659
+ [k: string]: unknown;
11660
+ };
11661
+ subtype: string;
11662
+ usage: TokensInfo | null;
11663
+ uuid: string | null;
11664
+ }
11665
+ interface SdkRateLimitRecord$1 {
11666
+ kind: 'rate_limit';
11667
+ rate_limit_type: string | null;
11668
+ resets_at: number | null;
11669
+ session_id: string | null;
11670
+ status: string;
11671
+ utilization: number | null;
11672
+ uuid: string | null;
11673
+ }
11674
+ /**
11675
+ * A native transcript record of a Codex session (source=codex).
11676
+ */
11677
+ interface CodexSessionRecord {
11678
+ /**
11679
+ * Identifier of the turn the record belongs to, if any.
11680
+ */
11681
+ agent_turn_id: string | null;
11682
+ /**
11683
+ * Cost attributed to this record, if any.
11684
+ */
11685
+ cost: number | null;
11686
+ /**
11687
+ * When the record was created.
11688
+ */
11689
+ created_at: string;
11690
+ /**
11691
+ * Duration attributed to this record, if any.
11692
+ */
11693
+ duration: number | null;
11694
+ /**
11695
+ * The record's position in the session's ordered feed — the resume cursor for the stream and the records endpoints.
11696
+ */
11697
+ feed_seq: number;
11698
+ /**
11699
+ * Unique identifier of the record.
11700
+ */
11701
+ id: string;
11702
+ /**
11703
+ * The model that produced this record, if any.
11704
+ */
11705
+ model: string | null;
11706
+ /**
11707
+ * One Codex `exec --json` ThreadEvent, verbatim, discriminated by `type`.
11708
+ */
11709
+ payload: CodexThreadStartedEvent | CodexTurnStartedEvent | CodexTurnCompletedEvent | CodexTurnFailedEvent | CodexErrorEvent | CodexItemStartedEvent | CodexItemUpdatedEvent | CodexItemCompletedEvent | CodexUnknownEvent;
11710
+ record_format: 'codex_jsonl@1';
11711
+ /**
11712
+ * The record's type within its format.
11713
+ */
11714
+ record_type: string;
11715
+ /**
11716
+ * Identifier of the session the record belongs to.
11717
+ */
11718
+ session_id: string;
11719
+ /**
11720
+ * Correlates a user-echo record back to the session message it echoes, so clients can retire queued messages by id.
11721
+ */
11722
+ session_message_id: string | null;
11723
+ /**
11724
+ * Who wrote the record. Open vocabulary: ignore records with unknown sources.
11725
+ */
11726
+ source: string;
11727
+ /**
11728
+ * The record's position within its execution's stream.
11729
+ */
11730
+ stream_seq: number;
11731
+ /**
11732
+ * Token usage reported for this record, if any.
11733
+ */
11734
+ tokens_info: TokensInfo | null;
11735
+ /**
11736
+ * Names of the tools used in this record, if any.
11737
+ */
11738
+ tools: string[] | null;
11739
+ }
11740
+ interface CodexThreadStartedEvent {
11741
+ thread_id: string | null;
11742
+ type: 'thread.started';
11743
+ [k: string]: unknown;
11744
+ }
11745
+ interface CodexTurnStartedEvent {
11746
+ type: 'turn.started';
11747
+ [k: string]: unknown;
11748
+ }
11749
+ interface CodexTurnCompletedEvent {
11750
+ type: 'turn.completed';
11751
+ usage: CodexUsage | null;
11752
+ [k: string]: unknown;
11753
+ }
11754
+ /**
11755
+ * The `usage` object on a `turn.completed` event — one turn's token counts.
11756
+ *
11757
+ * Note the field names differ from BOTH the Responses API and chat completions:
11758
+ * Codex reports `cached_input_tokens` / `cache_write_input_tokens` where the
11759
+ * Responses API says `input_tokens_details.cached_tokens`. These counts are for
11760
+ * display/records only — billing cost comes from the proxy's own ledger, which
11761
+ * prices the provider's usage, so a drift here can never mis-bill.
11762
+ */
11763
+ interface CodexUsage {
11764
+ cache_write_input_tokens: number;
11765
+ cached_input_tokens: number;
11766
+ input_tokens: number;
11767
+ output_tokens: number;
11768
+ reasoning_output_tokens: number;
11769
+ }
11770
+ interface CodexTurnFailedEvent {
11771
+ error: {
11772
+ [k: string]: unknown;
11773
+ } | null;
11774
+ type: 'turn.failed';
11775
+ [k: string]: unknown;
11776
+ }
11777
+ interface CodexErrorEvent {
11778
+ message: string | null;
11779
+ type: 'error';
11780
+ [k: string]: unknown;
11781
+ }
11782
+ interface CodexItemStartedEvent {
11783
+ item: CodexAgentMessageItem | CodexReasoningItem | CodexCommandExecutionItem | CodexFileChangeItem | CodexMcpToolCallItem | CodexWebSearchItem | CodexTodoListItem | CodexErrorItem | CodexUnknownItem;
11784
+ type: 'item.started';
11785
+ [k: string]: unknown;
11786
+ }
11787
+ /**
11788
+ * The agent said something to the user — Codex's assistant-text item.
11789
+ */
11790
+ interface CodexAgentMessageItem {
11791
+ id: string | null;
11792
+ text: string;
11793
+ type: 'agent_message';
11794
+ [k: string]: unknown;
11795
+ }
11796
+ interface CodexReasoningItem {
11797
+ id: string | null;
11798
+ summary: string | null;
11799
+ text: string | null;
11800
+ type: 'reasoning';
11801
+ [k: string]: unknown;
11802
+ }
11803
+ interface CodexCommandExecutionItem {
11804
+ aggregated_output: string | null;
11805
+ command: string;
11806
+ exit_code: number | null;
11807
+ id: string | null;
11808
+ status: string | null;
11809
+ type: 'command_execution';
11810
+ [k: string]: unknown;
11811
+ }
11812
+ interface CodexFileChangeItem {
11813
+ changes: {
11814
+ [k: string]: unknown;
11815
+ }[] | null;
11816
+ id: string | null;
11817
+ status: string | null;
11818
+ type: 'file_change';
11819
+ [k: string]: unknown;
11820
+ }
11821
+ interface CodexMcpToolCallItem {
11822
+ id: string | null;
11823
+ server: string | null;
11824
+ status: string | null;
11825
+ tool: string | null;
11826
+ type: 'mcp_tool_call';
11827
+ [k: string]: unknown;
11828
+ }
11829
+ interface CodexWebSearchItem {
11830
+ id: string | null;
11831
+ query: string | null;
11832
+ type: 'web_search';
11833
+ [k: string]: unknown;
11834
+ }
11835
+ interface CodexTodoListItem {
11836
+ id: string | null;
11837
+ items: {
11838
+ [k: string]: unknown;
11839
+ }[] | null;
11840
+ type: 'todo_list';
11841
+ [k: string]: unknown;
11842
+ }
11843
+ interface CodexErrorItem {
11844
+ id: string | null;
11845
+ message: string | null;
11846
+ type: 'error';
11847
+ [k: string]: unknown;
11848
+ }
11849
+ /**
11850
+ * Catch-all for item types this schema does not know yet.
11851
+ */
11852
+ interface CodexUnknownItem {
11853
+ id: string | null;
11854
+ type: string;
11855
+ [k: string]: unknown;
11856
+ }
11857
+ interface CodexItemUpdatedEvent {
11858
+ item: CodexAgentMessageItem | CodexReasoningItem | CodexCommandExecutionItem | CodexFileChangeItem | CodexMcpToolCallItem | CodexWebSearchItem | CodexTodoListItem | CodexErrorItem | CodexUnknownItem;
11859
+ type: 'item.updated';
11860
+ [k: string]: unknown;
11861
+ }
11862
+ interface CodexItemCompletedEvent {
11863
+ item: CodexAgentMessageItem | CodexReasoningItem | CodexCommandExecutionItem | CodexFileChangeItem | CodexMcpToolCallItem | CodexWebSearchItem | CodexTodoListItem | CodexErrorItem | CodexUnknownItem;
11864
+ type: 'item.completed';
11865
+ [k: string]: unknown;
11866
+ }
11867
+ /**
11868
+ * Catch-all for event types this schema does not know yet — including the
11869
+ * malformed-line records the stream parser keeps verbatim.
11870
+ */
11871
+ interface CodexUnknownEvent {
11872
+ type: string | null;
11873
+ [k: string]: unknown;
11874
+ }
11875
+ /**
11876
+ * A controller-emitted platform notification (source=lifecycle). The
11877
+ * payload shape is keyed by `record_type` — see lifecycle.schema.json.
11878
+ */
11879
+ interface LifecycleSessionRecord {
11880
+ /**
11881
+ * Identifier of the turn the record belongs to, if any.
11882
+ */
11883
+ agent_turn_id: string | null;
11884
+ /**
11885
+ * Cost attributed to this record, if any.
11886
+ */
11887
+ cost: number | null;
11888
+ /**
11889
+ * When the record was created.
11890
+ */
11891
+ created_at: string;
11892
+ /**
11893
+ * Duration attributed to this record, if any.
11894
+ */
11895
+ duration: number | null;
11896
+ /**
11897
+ * The record's position in the session's ordered feed — the resume cursor for the stream and the records endpoints.
11898
+ */
11899
+ feed_seq: number;
11900
+ /**
11901
+ * Unique identifier of the record.
11902
+ */
11903
+ id: string;
11904
+ /**
11905
+ * The model that produced this record, if any.
11906
+ */
11907
+ model: string | null;
11908
+ /**
11909
+ * The lifecycle payload; its shape is keyed by record_type.
11910
+ */
11911
+ payload: {
11912
+ [k: string]: unknown;
11913
+ };
11914
+ record_format: 'ellipsis_lifecycle@1';
11915
+ /**
11916
+ * The record's type within its format.
11917
+ */
11918
+ record_type: string;
11919
+ /**
11920
+ * Identifier of the session the record belongs to.
11921
+ */
11922
+ session_id: string;
11923
+ /**
11924
+ * Correlates a user-echo record back to the session message it echoes, so clients can retire queued messages by id.
11925
+ */
11926
+ session_message_id: string | null;
11927
+ /**
11928
+ * Who wrote the record. Open vocabulary: ignore records with unknown sources.
11929
+ */
11930
+ source: string;
11931
+ /**
11932
+ * The record's position within its execution's stream.
11933
+ */
11934
+ stream_seq: number;
11935
+ /**
11936
+ * Token usage reported for this record, if any.
11937
+ */
11938
+ tokens_info: TokensInfo | null;
11939
+ /**
11940
+ * Names of the tools used in this record, if any.
11941
+ */
11942
+ tools: string[] | null;
11943
+ }
10879
11944
  /**
10880
11945
  * A last-writer-wins snapshot of the session — the only way status,
10881
11946
  * state, and cost updates arrive. Resent whole on any field change.
@@ -11012,6 +12077,28 @@ interface ErrorFrame {
11012
12077
  type: 'error';
11013
12078
  }
11014
12079
 
12080
+ type SessionRecord = ClaudeSessionRecord | CodexSessionRecord | LifecycleSessionRecord;
12081
+ type SdkRecord = ClaudeSessionRecord['payload'];
12082
+ type SdkAssistantRecord = Extract<SdkRecord, {
12083
+ kind: 'assistant';
12084
+ }>;
12085
+ type SdkUserRecord = Extract<SdkRecord, {
12086
+ kind: 'user';
12087
+ }>;
12088
+ type SdkSystemRecord = Extract<SdkRecord, {
12089
+ kind: 'system';
12090
+ }>;
12091
+ type SdkResultRecord = Extract<SdkRecord, {
12092
+ kind: 'result';
12093
+ }>;
12094
+ type SdkRateLimitRecord = Extract<SdkRecord, {
12095
+ kind: 'rate_limit';
12096
+ }>;
12097
+ type SdkContentBlock = SdkAssistantRecord['content'][number];
12098
+ type CodexEvent = CodexSessionRecord['payload'];
12099
+ type CodexItem = Extract<CodexEvent, {
12100
+ type: 'item.completed';
12101
+ }>['item'];
11015
12102
  type StreamFrame = SessionStreamFrame | {
11016
12103
  type: string;
11017
12104
  [key: string]: unknown;
@@ -11037,4 +12124,4 @@ type ReviewRequester = components['schemas']['ReviewRequester'];
11037
12124
  type ReviewFinding = components['schemas']['ReviewFinding'];
11038
12125
  type Finding = ReviewFinding;
11039
12126
 
11040
- export type { AgentConfigSource as A, BudgetSource as B, CreateReviewRequest as C, DeltaFrame as D, ErrorFrame as E, Finding as F, GithubAccountSnippet as G, Harness as H, SessionPr as I, SessionPrompting as J, SessionRecord as K, SessionRecordsListResponse as L, SessionResponse as M, SessionSource as N, SessionState as O, ParentKind as P, SessionStatus as Q, RecordsAppendFrame as R, SendSessionMessageRequest as S, SessionStreamFrame as T, SessionSurface as U, SessionsListResponse as V, SnapshotFrame as W, StreamFrame as X, TokensInfo as Y, paths as Z, AttributionType as a, DoneFrame as b, components as c, GithubAccountType as d, HeartbeatFrame as e, PromptBlockedReason as f, ResolvedReviewScope as g, Review as h, ReviewConfiguration as i, ReviewCounters as j, ReviewFinding as k, ReviewRequester as l, ReviewScope as m, ReviewScopeKind as n, ReviewStage as o, ReviewedCommit as p, ReviewsListResponse as q, Session as r, SessionExecution as s, SessionExecutionsListResponse as t, SessionExitStatus as u, SessionFrame as v, SessionLiveness as w, SessionMessage as x, SessionMessageResponse as y, SessionMessageStatus as z };
12127
+ export type { SessionResponse as $, AgentConfigSource as A, BudgetSource as B, ClaudeSessionRecord as C, DeltaFrame as D, ErrorFrame as E, Finding as F, GithubAccountSnippet as G, Harness as H, SdkUserRecord as I, SendSessionMessageRequest as J, Session as K, LifecycleSessionRecord as L, SessionExecution as M, SessionExecutionsListResponse as N, SessionExitStatus as O, ParentKind as P, SessionFrame as Q, RecordsAppendFrame as R, SdkAssistantRecord as S, SessionLiveness as T, SessionMessage as U, SessionMessageResponse as V, SessionMessageStatus as W, SessionPr as X, SessionPrompting as Y, SessionRecord as Z, SessionRecordsListResponse as _, AttributionType as a, SessionSource as a0, SessionState as a1, SessionStatus as a2, SessionStreamFrame as a3, SessionSurface as a4, SessionsListResponse as a5, SnapshotFrame as a6, StreamFrame as a7, TokensInfo as a8, paths as a9, CodexFileChangeItem as aa, CodexMcpToolCallItem as ab, CodexEvent as b, components as c, CodexItem as d, CodexSessionRecord as e, CreateReviewRequest as f, DoneFrame as g, GithubAccountType as h, HeartbeatFrame as i, PromptBlockedReason as j, ResolvedReviewScope as k, Review as l, ReviewConfiguration as m, ReviewCounters as n, ReviewFinding as o, ReviewRequester as p, ReviewScope as q, ReviewScopeKind as r, ReviewStage as s, ReviewedCommit as t, ReviewsListResponse as u, SdkContentBlock as v, SdkRateLimitRecord as w, SdkRecord as x, SdkResultRecord as y, SdkSystemRecord as z };