@ellipsis-dev/sdk 0.14.0 → 0.15.1

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
  /**
@@ -3237,36 +3690,120 @@ interface components {
3237
3690
  */
3238
3691
  lines: string[];
3239
3692
  /**
3240
- * Offset
3241
- * @description The line offset the batch starts at.
3242
- * @default 0
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'];
3794
+ /**
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.
@@ -3548,11 +4085,10 @@ interface components {
3548
4085
  * @description Who BUILT a model. Never who serves it.
3549
4086
  *
3550
4087
  * Serving path is irrelevant here. Anthropic built every Claude model, so all of
3551
- * them are ANTHROPIC whether we reach them through the first-party Anthropic API
3552
- * or through Bedrock -- a choice made per request by the llm_providers chain, so
3553
- * it is not even a fixed property of the model. Likewise the `gpt-5.6-*` rows
3554
- * are OPENAI (OpenAI's models, served by AWS via bedrock-mantle), and GLM is ZAI
3555
- * (Z.ai's model, served by DeepInfra via OpenRouter).
4088
+ * them are ANTHROPIC even though OpenRouter is what actually serves them.
4089
+ * Likewise the `gpt-5.6-*` rows are OPENAI (OpenAI's models, resold to us by
4090
+ * OpenRouter), and GLM is ZAI (Z.ai's model, served by DeepInfra via
4091
+ * OpenRouter).
3556
4092
  *
3557
4093
  * So this is deliberately NOT derived from `EgressRoute.provider`: routing is an
3558
4094
  * infrastructure fact that changes when we move a model between providers, while
@@ -3566,16 +4102,16 @@ interface components {
3566
4102
  ModelManufacturer: 'anthropic' | 'openai' | 'zai' | 'minimax' | 'moonshot';
3567
4103
  /** ModelRateCardApi */
3568
4104
  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;
4105
+ /** Cache Read Millicents Per 1M Tokens */
4106
+ cache_read_millicents_per_1m_tokens: number;
4107
+ /** Cache Write 1H Millicents Per 1M Tokens */
4108
+ cache_write_1h_millicents_per_1m_tokens: number;
4109
+ /** Cache Write 5M Millicents Per 1M Tokens */
4110
+ cache_write_5m_millicents_per_1m_tokens: number;
4111
+ /** Input Millicents Per 1M Tokens */
4112
+ input_millicents_per_1m_tokens: number;
4113
+ /** Output Millicents Per 1M Tokens */
4114
+ output_millicents_per_1m_tokens: number;
3579
4115
  };
3580
4116
  /**
3581
4117
  * ModelUsageBreakdown
@@ -5064,6 +5600,252 @@ interface components {
5064
5600
  * @enum {string}
5065
5601
  */
5066
5602
  RunStatus: 'scheduled' | 'starting' | 'working' | 'waiting' | 'done' | 'failed' | 'stopped' | 'cancelled' | 'retrying';
5603
+ /** SdkAssistantRecord */
5604
+ SdkAssistantRecord: {
5605
+ cache_creation?: components['schemas']['SdkCacheCreation'] | null;
5606
+ /**
5607
+ * Content
5608
+ * @default []
5609
+ */
5610
+ content: (components['schemas']['SdkTextBlock'] | components['schemas']['SdkThinkingBlock'] | components['schemas']['SdkToolUseBlock'] | components['schemas']['SdkToolResultBlock'] | components['schemas']['SdkServerToolUseBlock'] | components['schemas']['SdkServerToolResultBlock'])[];
5611
+ /** Error */
5612
+ error?: string | null;
5613
+ /**
5614
+ * @description discriminator enum property added by openapi-typescript
5615
+ * @enum {string}
5616
+ */
5617
+ kind: 'assistant';
5618
+ /** Message Id */
5619
+ message_id?: string | null;
5620
+ /** Model */
5621
+ model: string;
5622
+ /** Parent Tool Use Id */
5623
+ parent_tool_use_id?: string | null;
5624
+ /** Session Id */
5625
+ session_id?: string | null;
5626
+ /** Stop Reason */
5627
+ stop_reason?: string | null;
5628
+ usage?: components['schemas']['TokensInfo'] | null;
5629
+ /** Uuid */
5630
+ uuid?: string | null;
5631
+ };
5632
+ /**
5633
+ * SdkCacheCreation
5634
+ * @description The cache-write breakdown by TTL. Load-bearing for billing, not
5635
+ * informational: the 5m and 1h lanes have different rate-card prices
5636
+ * (`normalized_usage_from_anthropic`), so collapsing them into one
5637
+ * `cache_creation_input_tokens` total silently misprices every session with 1h
5638
+ * caching on.
5639
+ */
5640
+ SdkCacheCreation: {
5641
+ /**
5642
+ * Ephemeral 1H Input Tokens
5643
+ * @default 0
5644
+ */
5645
+ ephemeral_1h_input_tokens: number;
5646
+ /**
5647
+ * Ephemeral 5M Input Tokens
5648
+ * @default 0
5649
+ */
5650
+ ephemeral_5m_input_tokens: number;
5651
+ };
5652
+ /** SdkRateLimitRecord */
5653
+ SdkRateLimitRecord: {
5654
+ /**
5655
+ * @description discriminator enum property added by openapi-typescript
5656
+ * @enum {string}
5657
+ */
5658
+ kind: 'rate_limit';
5659
+ /** Rate Limit Type */
5660
+ rate_limit_type?: string | null;
5661
+ /** Resets At */
5662
+ resets_at?: number | null;
5663
+ /** Session Id */
5664
+ session_id?: string | null;
5665
+ /** Status */
5666
+ status: string;
5667
+ /** Utilization */
5668
+ utilization?: number | null;
5669
+ /** Uuid */
5670
+ uuid?: string | null;
5671
+ };
5672
+ /**
5673
+ * SdkResultRecord
5674
+ * @description One turn's terminal record: the SDK's `ResultMessage`. `usage` and
5675
+ * `cost_usd` here are the turn totals the worker prices from.
5676
+ */
5677
+ SdkResultRecord: {
5678
+ /** Api Error Status */
5679
+ api_error_status?: number | null;
5680
+ /** Cost Usd */
5681
+ cost_usd?: number | null;
5682
+ /** Duration Api Ms */
5683
+ duration_api_ms: number;
5684
+ /** Duration Ms */
5685
+ duration_ms: number;
5686
+ /** Errors */
5687
+ errors?: string[] | null;
5688
+ /** Is Error */
5689
+ is_error: boolean;
5690
+ /**
5691
+ * @description discriminator enum property added by openapi-typescript
5692
+ * @enum {string}
5693
+ */
5694
+ kind: 'result';
5695
+ /** Model Usage */
5696
+ model_usage?: {
5697
+ [key: string]: unknown;
5698
+ } | null;
5699
+ /** Num Turns */
5700
+ num_turns: number;
5701
+ /** Result */
5702
+ result?: string | null;
5703
+ /** Session Id */
5704
+ session_id?: string | null;
5705
+ /** Stop Reason */
5706
+ stop_reason?: string | null;
5707
+ /** Structured Output */
5708
+ structured_output?: unknown;
5709
+ /** Subtype */
5710
+ subtype: string;
5711
+ usage?: components['schemas']['TokensInfo'] | null;
5712
+ /** Uuid */
5713
+ uuid?: string | null;
5714
+ };
5715
+ /** SdkServerToolResultBlock */
5716
+ SdkServerToolResultBlock: {
5717
+ /**
5718
+ * Content
5719
+ * @default {}
5720
+ */
5721
+ content: {
5722
+ [key: string]: unknown;
5723
+ };
5724
+ /** Tool Use Id */
5725
+ tool_use_id: string;
5726
+ /**
5727
+ * @description discriminator enum property added by openapi-typescript
5728
+ * @enum {string}
5729
+ */
5730
+ type: 'server_tool_result';
5731
+ };
5732
+ /** SdkServerToolUseBlock */
5733
+ SdkServerToolUseBlock: {
5734
+ /** Id */
5735
+ id: string;
5736
+ /**
5737
+ * Input
5738
+ * @default {}
5739
+ */
5740
+ input: {
5741
+ [key: string]: unknown;
5742
+ };
5743
+ /** Name */
5744
+ name: string;
5745
+ /**
5746
+ * @description discriminator enum property added by openapi-typescript
5747
+ * @enum {string}
5748
+ */
5749
+ type: 'server_tool_use';
5750
+ };
5751
+ /**
5752
+ * SdkSystemRecord
5753
+ * @description Everything the CLI reports out-of-band: init, compact_boundary, task
5754
+ * lifecycle, hook events, api_error. `data` is the raw payload — this is the
5755
+ * one open shape in the schema, because the CLI's system subtypes are an
5756
+ * open set we do not want to fail a session over.
5757
+ */
5758
+ SdkSystemRecord: {
5759
+ /**
5760
+ * Data
5761
+ * @default {}
5762
+ */
5763
+ data: {
5764
+ [key: string]: unknown;
5765
+ };
5766
+ /**
5767
+ * @description discriminator enum property added by openapi-typescript
5768
+ * @enum {string}
5769
+ */
5770
+ kind: 'system';
5771
+ /** Session Id */
5772
+ session_id?: string | null;
5773
+ /** Subtype */
5774
+ subtype: string;
5775
+ /** Uuid */
5776
+ uuid?: string | null;
5777
+ };
5778
+ /** SdkTextBlock */
5779
+ SdkTextBlock: {
5780
+ /** Text */
5781
+ text: string;
5782
+ /**
5783
+ * @description discriminator enum property added by openapi-typescript
5784
+ * @enum {string}
5785
+ */
5786
+ type: 'text';
5787
+ };
5788
+ /** SdkThinkingBlock */
5789
+ SdkThinkingBlock: {
5790
+ /** Signature */
5791
+ signature: string;
5792
+ /** Thinking */
5793
+ thinking: string;
5794
+ /**
5795
+ * @description discriminator enum property added by openapi-typescript
5796
+ * @enum {string}
5797
+ */
5798
+ type: 'thinking';
5799
+ };
5800
+ /** SdkToolResultBlock */
5801
+ SdkToolResultBlock: {
5802
+ /** Content */
5803
+ content?: string | {
5804
+ [key: string]: unknown;
5805
+ }[] | null;
5806
+ /** Is Error */
5807
+ is_error?: boolean | null;
5808
+ /** Tool Use Id */
5809
+ tool_use_id: string;
5810
+ /**
5811
+ * @description discriminator enum property added by openapi-typescript
5812
+ * @enum {string}
5813
+ */
5814
+ type: 'tool_result';
5815
+ };
5816
+ /** SdkToolUseBlock */
5817
+ SdkToolUseBlock: {
5818
+ /** Id */
5819
+ id: string;
5820
+ /**
5821
+ * Input
5822
+ * @default {}
5823
+ */
5824
+ input: {
5825
+ [key: string]: unknown;
5826
+ };
5827
+ /** Name */
5828
+ name: string;
5829
+ /**
5830
+ * @description discriminator enum property added by openapi-typescript
5831
+ * @enum {string}
5832
+ */
5833
+ type: 'tool_use';
5834
+ };
5835
+ /** SdkUserRecord */
5836
+ SdkUserRecord: {
5837
+ /** Content */
5838
+ content: string | (components['schemas']['SdkTextBlock'] | components['schemas']['SdkThinkingBlock'] | components['schemas']['SdkToolUseBlock'] | components['schemas']['SdkToolResultBlock'] | components['schemas']['SdkServerToolUseBlock'] | components['schemas']['SdkServerToolResultBlock'])[];
5839
+ /**
5840
+ * @description discriminator enum property added by openapi-typescript
5841
+ * @enum {string}
5842
+ */
5843
+ kind: 'user';
5844
+ /** Parent Tool Use Id */
5845
+ parent_tool_use_id?: string | null;
5846
+ /** Uuid */
5847
+ uuid?: string | null;
5848
+ };
5067
5849
  /**
5068
5850
  * Secret
5069
5851
  * @description A stored variable WITHOUT its value. Values are write-only: once
@@ -5220,6 +6002,8 @@ interface components {
5220
6002
  metadata: {
5221
6003
  [key: string]: string;
5222
6004
  };
6005
+ /** @description Per-file line counts for the uncommitted changes in the session's workspace. Work the session committed is not included here — see output_prs. Null if no diff was ever captured. */
6006
+ output_diff?: components['schemas']['SessionDiff'] | null;
5223
6007
  /**
5224
6008
  * Output Prs
5225
6009
  * @description Pull requests the session created or updated.
@@ -5363,6 +6147,37 @@ interface components {
5363
6147
  */
5364
6148
  total: number;
5365
6149
  };
6150
+ /**
6151
+ * SessionDiff
6152
+ * @description The counts half of a session's working-tree diff, small enough to ride on
6153
+ * agent_sessions and be returned by every session read. The patch text lives
6154
+ * in `agent_session_diffs` and is fetched on demand.
6155
+ *
6156
+ * Scope is UNCOMMITTED work only (`git diff HEAD`), so this answers "is there
6157
+ * unlanded work in this sandbox?" — a session that committed and pushed shows
6158
+ * no files here and its created PR instead.
6159
+ */
6160
+ SessionDiff: {
6161
+ /** Files */
6162
+ files: components['schemas']['SessionDiffFile'][];
6163
+ };
6164
+ /**
6165
+ * SessionDiffFile
6166
+ * @description One file's uncommitted change in a session's sandbox, as `git diff HEAD`
6167
+ * --numstat reports it (with intent-to-add so new files count).
6168
+ */
6169
+ SessionDiffFile: {
6170
+ /** Additions */
6171
+ additions: number;
6172
+ /** Deletions */
6173
+ deletions: number;
6174
+ /** Path */
6175
+ path: string;
6176
+ /** Repo */
6177
+ repo: string;
6178
+ /** Status */
6179
+ status: string;
6180
+ };
5366
6181
  /**
5367
6182
  * SessionExecution
5368
6183
  * @description One runtime attempt of a session — the initial start, a cold wake of a
@@ -5601,109 +6416,24 @@ interface components {
5601
6416
  repo_full_name: string;
5602
6417
  /** Title */
5603
6418
  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;
6419
+ /** Url */
6420
+ url: string;
6421
+ };
6422
+ /**
6423
+ * SessionPrompting
6424
+ * @description The prompt-affordance projection. `enabled` answers "would a send work",
6425
+ * and when it wouldn't, `blocked_reason` + `detail` say why.
6426
+ *
6427
+ * `surface_name` is set only for MENTION_SURFACE, naming where to reply.
6428
+ */
6429
+ SessionPrompting: {
6430
+ blocked_reason?: components['schemas']['PromptBlockedReason'] | null;
6431
+ /** Detail */
6432
+ detail?: string | null;
6433
+ /** Enabled */
6434
+ enabled: boolean;
6435
+ /** Surface Name */
6436
+ surface_name?: string | null;
5707
6437
  };
5708
6438
  /**
5709
6439
  * SessionRecordsListResponse
@@ -5737,7 +6467,7 @@ interface components {
5737
6467
  * Records
5738
6468
  * @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
6469
  */
5740
- records: components['schemas']['SessionRecord'][];
6470
+ records: (components['schemas']['ClaudeSessionRecord'] | components['schemas']['CodexSessionRecord'] | components['schemas']['LifecycleSessionRecord'])[];
5741
6471
  };
5742
6472
  /**
5743
6473
  * SessionResponse
@@ -10133,6 +10863,10 @@ interface Session {
10133
10863
  metadata: {
10134
10864
  [k: string]: string;
10135
10865
  };
10866
+ /**
10867
+ * Per-file line counts for the uncommitted changes in the session's workspace. Work the session committed is not included here — see output_prs. Null if no diff was ever captured.
10868
+ */
10869
+ output_diff: SessionDiff | null;
10136
10870
  /**
10137
10871
  * Pull requests the session created or updated.
10138
10872
  */
@@ -10195,7 +10929,6 @@ interface AgentConfig {
10195
10929
  ellipsis: AgentConfigEllipsis;
10196
10930
  environment: AgentConfigEnvironment;
10197
10931
  input: AgentConfigInput | null;
10198
- llm: AgentConfigLlm;
10199
10932
  mcp_servers: (string | AgentConfigMcpServer)[];
10200
10933
  output: AgentConfigOutput | null;
10201
10934
  permissions: AgentConfigPermissions;
@@ -10425,21 +11158,6 @@ interface AgentConfigInput {
10425
11158
  } | null;
10426
11159
  message: string | null;
10427
11160
  }
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
11161
  /**
10444
11162
  * One built-in MCP server this agent opts into by name (`linear`/`slack`).
10445
11163
  * This is a name reference over the connected built-in set, NOT a custom-server
@@ -10661,6 +11379,29 @@ interface SessionCost {
10661
11379
  */
10662
11380
  total: number;
10663
11381
  }
11382
+ /**
11383
+ * The counts half of a session's working-tree diff, small enough to ride on
11384
+ * agent_sessions and be returned by every session read. The patch text lives
11385
+ * in `agent_session_diffs` and is fetched on demand.
11386
+ *
11387
+ * Scope is UNCOMMITTED work only (`git diff HEAD`), so this answers "is there
11388
+ * unlanded work in this sandbox?" — a session that committed and pushed shows
11389
+ * no files here and its created PR instead.
11390
+ */
11391
+ interface SessionDiff {
11392
+ files: SessionDiffFile[];
11393
+ }
11394
+ /**
11395
+ * One file's uncommitted change in a session's sandbox, as `git diff HEAD`
11396
+ * --numstat reports it (with intent-to-add so new files count).
11397
+ */
11398
+ interface SessionDiffFile {
11399
+ additions: number;
11400
+ deletions: number;
11401
+ path: string;
11402
+ repo: string;
11403
+ status: string;
11404
+ }
10664
11405
  /**
10665
11406
  * A pull request this session created, denormalized at capture time so
10666
11407
  * session surfaces render a labeled link without joining gh_prs. Live PR
@@ -10780,15 +11521,13 @@ interface RecordsAppendFrame {
10780
11521
  /**
10781
11522
  * New session records, ordered by feed_seq.
10782
11523
  */
10783
- records: SessionRecord[];
11524
+ records: (ClaudeSessionRecord | CodexSessionRecord | LifecycleSessionRecord)[];
10784
11525
  type: 'records_append';
10785
11526
  }
10786
11527
  /**
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.
11528
+ * A native transcript record of a Claude session (source=claude_code).
10790
11529
  */
10791
- interface SessionRecord {
11530
+ interface ClaudeSessionRecord {
10792
11531
  /**
10793
11532
  * Identifier of the turn the record belongs to, if any.
10794
11533
  */
@@ -10818,15 +11557,10 @@ interface SessionRecord {
10818
11557
  */
10819
11558
  model: string | null;
10820
11559
  /**
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.
11560
+ * One Claude session record, discriminated by `kind`.
10828
11561
  */
10829
- record_format: string;
11562
+ payload: SdkAssistantRecord$1 | SdkUserRecord$1 | SdkSystemRecord$1 | SdkResultRecord$1 | SdkRateLimitRecord$1;
11563
+ record_format: 'claude_sdk@1';
10830
11564
  /**
10831
11565
  * The record's type within its format.
10832
11566
  */
@@ -10840,7 +11574,7 @@ interface SessionRecord {
10840
11574
  */
10841
11575
  session_message_id: string | null;
10842
11576
  /**
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.
11577
+ * Who wrote the record. Open vocabulary: ignore records with unknown sources.
10844
11578
  */
10845
11579
  source: string;
10846
11580
  /**
@@ -10856,6 +11590,70 @@ interface SessionRecord {
10856
11590
  */
10857
11591
  tools: string[] | null;
10858
11592
  }
11593
+ interface SdkAssistantRecord$1 {
11594
+ cache_creation: SdkCacheCreation | null;
11595
+ content: (SdkTextBlock | SdkThinkingBlock | SdkToolUseBlock | SdkToolResultBlock | SdkServerToolUseBlock | SdkServerToolResultBlock)[];
11596
+ error: string | null;
11597
+ kind: 'assistant';
11598
+ message_id: string | null;
11599
+ model: string;
11600
+ parent_tool_use_id: string | null;
11601
+ session_id: string | null;
11602
+ stop_reason: string | null;
11603
+ usage: TokensInfo | null;
11604
+ uuid: string | null;
11605
+ }
11606
+ /**
11607
+ * The cache-write breakdown by TTL. Load-bearing for billing, not
11608
+ * informational: the 5m and 1h lanes have different rate-card prices
11609
+ * (`normalized_usage_from_anthropic`), so collapsing them into one
11610
+ * `cache_creation_input_tokens` total silently misprices every session with 1h
11611
+ * caching on.
11612
+ */
11613
+ interface SdkCacheCreation {
11614
+ ephemeral_1h_input_tokens: number;
11615
+ ephemeral_5m_input_tokens: number;
11616
+ }
11617
+ interface SdkTextBlock {
11618
+ text: string;
11619
+ type: 'text';
11620
+ }
11621
+ interface SdkThinkingBlock {
11622
+ signature: string;
11623
+ thinking: string;
11624
+ type: 'thinking';
11625
+ }
11626
+ interface SdkToolUseBlock {
11627
+ id: string;
11628
+ input: {
11629
+ [k: string]: unknown;
11630
+ };
11631
+ name: string;
11632
+ type: 'tool_use';
11633
+ }
11634
+ interface SdkToolResultBlock {
11635
+ content: string | {
11636
+ [k: string]: unknown;
11637
+ }[] | null;
11638
+ is_error: boolean | null;
11639
+ tool_use_id: string;
11640
+ type: 'tool_result';
11641
+ }
11642
+ interface SdkServerToolUseBlock {
11643
+ id: string;
11644
+ input: {
11645
+ [k: string]: unknown;
11646
+ };
11647
+ name: string;
11648
+ type: 'server_tool_use';
11649
+ }
11650
+ interface SdkServerToolResultBlock {
11651
+ content: {
11652
+ [k: string]: unknown;
11653
+ };
11654
+ tool_use_id: string;
11655
+ type: 'server_tool_result';
11656
+ }
10859
11657
  /**
10860
11658
  * Token/cost usage, per record (one API call's counts, aggregate fields at
10861
11659
  * their zero defaults) or aggregated per execution/session
@@ -10876,6 +11674,332 @@ interface TokensInfo {
10876
11674
  num_turns: number;
10877
11675
  output_tokens: number;
10878
11676
  }
11677
+ interface SdkUserRecord$1 {
11678
+ content: string | (SdkTextBlock | SdkThinkingBlock | SdkToolUseBlock | SdkToolResultBlock | SdkServerToolUseBlock | SdkServerToolResultBlock)[];
11679
+ kind: 'user';
11680
+ parent_tool_use_id: string | null;
11681
+ uuid: string | null;
11682
+ }
11683
+ /**
11684
+ * Everything the CLI reports out-of-band: init, compact_boundary, task
11685
+ * lifecycle, hook events, api_error. `data` is the raw payload — this is the
11686
+ * one open shape in the schema, because the CLI's system subtypes are an
11687
+ * open set we do not want to fail a session over.
11688
+ */
11689
+ interface SdkSystemRecord$1 {
11690
+ data: {
11691
+ [k: string]: unknown;
11692
+ };
11693
+ kind: 'system';
11694
+ session_id: string | null;
11695
+ subtype: string;
11696
+ uuid: string | null;
11697
+ }
11698
+ /**
11699
+ * One turn's terminal record: the SDK's `ResultMessage`. `usage` and
11700
+ * `cost_usd` here are the turn totals the worker prices from.
11701
+ */
11702
+ interface SdkResultRecord$1 {
11703
+ api_error_status: number | null;
11704
+ cost_usd: number | null;
11705
+ duration_api_ms: number;
11706
+ duration_ms: number;
11707
+ errors: string[] | null;
11708
+ is_error: boolean;
11709
+ kind: 'result';
11710
+ model_usage: {
11711
+ [k: string]: unknown;
11712
+ } | null;
11713
+ num_turns: number;
11714
+ result: string | null;
11715
+ session_id: string | null;
11716
+ stop_reason: string | null;
11717
+ structured_output: {
11718
+ [k: string]: unknown;
11719
+ };
11720
+ subtype: string;
11721
+ usage: TokensInfo | null;
11722
+ uuid: string | null;
11723
+ }
11724
+ interface SdkRateLimitRecord$1 {
11725
+ kind: 'rate_limit';
11726
+ rate_limit_type: string | null;
11727
+ resets_at: number | null;
11728
+ session_id: string | null;
11729
+ status: string;
11730
+ utilization: number | null;
11731
+ uuid: string | null;
11732
+ }
11733
+ /**
11734
+ * A native transcript record of a Codex session (source=codex).
11735
+ */
11736
+ interface CodexSessionRecord {
11737
+ /**
11738
+ * Identifier of the turn the record belongs to, if any.
11739
+ */
11740
+ agent_turn_id: string | null;
11741
+ /**
11742
+ * Cost attributed to this record, if any.
11743
+ */
11744
+ cost: number | null;
11745
+ /**
11746
+ * When the record was created.
11747
+ */
11748
+ created_at: string;
11749
+ /**
11750
+ * Duration attributed to this record, if any.
11751
+ */
11752
+ duration: number | null;
11753
+ /**
11754
+ * The record's position in the session's ordered feed — the resume cursor for the stream and the records endpoints.
11755
+ */
11756
+ feed_seq: number;
11757
+ /**
11758
+ * Unique identifier of the record.
11759
+ */
11760
+ id: string;
11761
+ /**
11762
+ * The model that produced this record, if any.
11763
+ */
11764
+ model: string | null;
11765
+ /**
11766
+ * One Codex `exec --json` ThreadEvent, verbatim, discriminated by `type`.
11767
+ */
11768
+ payload: CodexThreadStartedEvent | CodexTurnStartedEvent | CodexTurnCompletedEvent | CodexTurnFailedEvent | CodexErrorEvent | CodexItemStartedEvent | CodexItemUpdatedEvent | CodexItemCompletedEvent | CodexUnknownEvent;
11769
+ record_format: 'codex_jsonl@1';
11770
+ /**
11771
+ * The record's type within its format.
11772
+ */
11773
+ record_type: string;
11774
+ /**
11775
+ * Identifier of the session the record belongs to.
11776
+ */
11777
+ session_id: string;
11778
+ /**
11779
+ * Correlates a user-echo record back to the session message it echoes, so clients can retire queued messages by id.
11780
+ */
11781
+ session_message_id: string | null;
11782
+ /**
11783
+ * Who wrote the record. Open vocabulary: ignore records with unknown sources.
11784
+ */
11785
+ source: string;
11786
+ /**
11787
+ * The record's position within its execution's stream.
11788
+ */
11789
+ stream_seq: number;
11790
+ /**
11791
+ * Token usage reported for this record, if any.
11792
+ */
11793
+ tokens_info: TokensInfo | null;
11794
+ /**
11795
+ * Names of the tools used in this record, if any.
11796
+ */
11797
+ tools: string[] | null;
11798
+ }
11799
+ interface CodexThreadStartedEvent {
11800
+ thread_id: string | null;
11801
+ type: 'thread.started';
11802
+ [k: string]: unknown;
11803
+ }
11804
+ interface CodexTurnStartedEvent {
11805
+ type: 'turn.started';
11806
+ [k: string]: unknown;
11807
+ }
11808
+ interface CodexTurnCompletedEvent {
11809
+ type: 'turn.completed';
11810
+ usage: CodexUsage | null;
11811
+ [k: string]: unknown;
11812
+ }
11813
+ /**
11814
+ * The `usage` object on a `turn.completed` event — one turn's token counts.
11815
+ *
11816
+ * Note the field names differ from BOTH the Responses API and chat completions:
11817
+ * Codex reports `cached_input_tokens` / `cache_write_input_tokens` where the
11818
+ * Responses API says `input_tokens_details.cached_tokens`. These counts are for
11819
+ * display/records only — billing cost comes from the proxy's own ledger, which
11820
+ * prices the provider's usage, so a drift here can never mis-bill.
11821
+ */
11822
+ interface CodexUsage {
11823
+ cache_write_input_tokens: number;
11824
+ cached_input_tokens: number;
11825
+ input_tokens: number;
11826
+ output_tokens: number;
11827
+ reasoning_output_tokens: number;
11828
+ }
11829
+ interface CodexTurnFailedEvent {
11830
+ error: {
11831
+ [k: string]: unknown;
11832
+ } | null;
11833
+ type: 'turn.failed';
11834
+ [k: string]: unknown;
11835
+ }
11836
+ interface CodexErrorEvent {
11837
+ message: string | null;
11838
+ type: 'error';
11839
+ [k: string]: unknown;
11840
+ }
11841
+ interface CodexItemStartedEvent {
11842
+ item: CodexAgentMessageItem | CodexReasoningItem | CodexCommandExecutionItem | CodexFileChangeItem | CodexMcpToolCallItem | CodexWebSearchItem | CodexTodoListItem | CodexErrorItem | CodexUnknownItem;
11843
+ type: 'item.started';
11844
+ [k: string]: unknown;
11845
+ }
11846
+ /**
11847
+ * The agent said something to the user — Codex's assistant-text item.
11848
+ */
11849
+ interface CodexAgentMessageItem {
11850
+ id: string | null;
11851
+ text: string;
11852
+ type: 'agent_message';
11853
+ [k: string]: unknown;
11854
+ }
11855
+ interface CodexReasoningItem {
11856
+ id: string | null;
11857
+ summary: string | null;
11858
+ text: string | null;
11859
+ type: 'reasoning';
11860
+ [k: string]: unknown;
11861
+ }
11862
+ interface CodexCommandExecutionItem {
11863
+ aggregated_output: string | null;
11864
+ command: string;
11865
+ exit_code: number | null;
11866
+ id: string | null;
11867
+ status: string | null;
11868
+ type: 'command_execution';
11869
+ [k: string]: unknown;
11870
+ }
11871
+ interface CodexFileChangeItem {
11872
+ changes: {
11873
+ [k: string]: unknown;
11874
+ }[] | null;
11875
+ id: string | null;
11876
+ status: string | null;
11877
+ type: 'file_change';
11878
+ [k: string]: unknown;
11879
+ }
11880
+ interface CodexMcpToolCallItem {
11881
+ id: string | null;
11882
+ server: string | null;
11883
+ status: string | null;
11884
+ tool: string | null;
11885
+ type: 'mcp_tool_call';
11886
+ [k: string]: unknown;
11887
+ }
11888
+ interface CodexWebSearchItem {
11889
+ id: string | null;
11890
+ query: string | null;
11891
+ type: 'web_search';
11892
+ [k: string]: unknown;
11893
+ }
11894
+ interface CodexTodoListItem {
11895
+ id: string | null;
11896
+ items: {
11897
+ [k: string]: unknown;
11898
+ }[] | null;
11899
+ type: 'todo_list';
11900
+ [k: string]: unknown;
11901
+ }
11902
+ interface CodexErrorItem {
11903
+ id: string | null;
11904
+ message: string | null;
11905
+ type: 'error';
11906
+ [k: string]: unknown;
11907
+ }
11908
+ /**
11909
+ * Catch-all for item types this schema does not know yet.
11910
+ */
11911
+ interface CodexUnknownItem {
11912
+ id: string | null;
11913
+ type: string;
11914
+ [k: string]: unknown;
11915
+ }
11916
+ interface CodexItemUpdatedEvent {
11917
+ item: CodexAgentMessageItem | CodexReasoningItem | CodexCommandExecutionItem | CodexFileChangeItem | CodexMcpToolCallItem | CodexWebSearchItem | CodexTodoListItem | CodexErrorItem | CodexUnknownItem;
11918
+ type: 'item.updated';
11919
+ [k: string]: unknown;
11920
+ }
11921
+ interface CodexItemCompletedEvent {
11922
+ item: CodexAgentMessageItem | CodexReasoningItem | CodexCommandExecutionItem | CodexFileChangeItem | CodexMcpToolCallItem | CodexWebSearchItem | CodexTodoListItem | CodexErrorItem | CodexUnknownItem;
11923
+ type: 'item.completed';
11924
+ [k: string]: unknown;
11925
+ }
11926
+ /**
11927
+ * Catch-all for event types this schema does not know yet — including the
11928
+ * malformed-line records the stream parser keeps verbatim.
11929
+ */
11930
+ interface CodexUnknownEvent {
11931
+ type: string | null;
11932
+ [k: string]: unknown;
11933
+ }
11934
+ /**
11935
+ * A controller-emitted platform notification (source=lifecycle). The
11936
+ * payload shape is keyed by `record_type` — see lifecycle.schema.json.
11937
+ */
11938
+ interface LifecycleSessionRecord {
11939
+ /**
11940
+ * Identifier of the turn the record belongs to, if any.
11941
+ */
11942
+ agent_turn_id: string | null;
11943
+ /**
11944
+ * Cost attributed to this record, if any.
11945
+ */
11946
+ cost: number | null;
11947
+ /**
11948
+ * When the record was created.
11949
+ */
11950
+ created_at: string;
11951
+ /**
11952
+ * Duration attributed to this record, if any.
11953
+ */
11954
+ duration: number | null;
11955
+ /**
11956
+ * The record's position in the session's ordered feed — the resume cursor for the stream and the records endpoints.
11957
+ */
11958
+ feed_seq: number;
11959
+ /**
11960
+ * Unique identifier of the record.
11961
+ */
11962
+ id: string;
11963
+ /**
11964
+ * The model that produced this record, if any.
11965
+ */
11966
+ model: string | null;
11967
+ /**
11968
+ * The lifecycle payload; its shape is keyed by record_type.
11969
+ */
11970
+ payload: {
11971
+ [k: string]: unknown;
11972
+ };
11973
+ record_format: 'ellipsis_lifecycle@1';
11974
+ /**
11975
+ * The record's type within its format.
11976
+ */
11977
+ record_type: string;
11978
+ /**
11979
+ * Identifier of the session the record belongs to.
11980
+ */
11981
+ session_id: string;
11982
+ /**
11983
+ * Correlates a user-echo record back to the session message it echoes, so clients can retire queued messages by id.
11984
+ */
11985
+ session_message_id: string | null;
11986
+ /**
11987
+ * Who wrote the record. Open vocabulary: ignore records with unknown sources.
11988
+ */
11989
+ source: string;
11990
+ /**
11991
+ * The record's position within its execution's stream.
11992
+ */
11993
+ stream_seq: number;
11994
+ /**
11995
+ * Token usage reported for this record, if any.
11996
+ */
11997
+ tokens_info: TokensInfo | null;
11998
+ /**
11999
+ * Names of the tools used in this record, if any.
12000
+ */
12001
+ tools: string[] | null;
12002
+ }
10879
12003
  /**
10880
12004
  * A last-writer-wins snapshot of the session — the only way status,
10881
12005
  * state, and cost updates arrive. Resent whole on any field change.
@@ -10923,6 +12047,10 @@ interface Session1 {
10923
12047
  metadata: {
10924
12048
  [k: string]: string;
10925
12049
  };
12050
+ /**
12051
+ * Per-file line counts for the uncommitted changes in the session's workspace. Work the session committed is not included here — see output_prs. Null if no diff was ever captured.
12052
+ */
12053
+ output_diff: SessionDiff | null;
10926
12054
  /**
10927
12055
  * Pull requests the session created or updated.
10928
12056
  */
@@ -11012,6 +12140,28 @@ interface ErrorFrame {
11012
12140
  type: 'error';
11013
12141
  }
11014
12142
 
12143
+ type SessionRecord = ClaudeSessionRecord | CodexSessionRecord | LifecycleSessionRecord;
12144
+ type SdkRecord = ClaudeSessionRecord['payload'];
12145
+ type SdkAssistantRecord = Extract<SdkRecord, {
12146
+ kind: 'assistant';
12147
+ }>;
12148
+ type SdkUserRecord = Extract<SdkRecord, {
12149
+ kind: 'user';
12150
+ }>;
12151
+ type SdkSystemRecord = Extract<SdkRecord, {
12152
+ kind: 'system';
12153
+ }>;
12154
+ type SdkResultRecord = Extract<SdkRecord, {
12155
+ kind: 'result';
12156
+ }>;
12157
+ type SdkRateLimitRecord = Extract<SdkRecord, {
12158
+ kind: 'rate_limit';
12159
+ }>;
12160
+ type SdkContentBlock = SdkAssistantRecord['content'][number];
12161
+ type CodexEvent = CodexSessionRecord['payload'];
12162
+ type CodexItem = Extract<CodexEvent, {
12163
+ type: 'item.completed';
12164
+ }>['item'];
11015
12165
  type StreamFrame = SessionStreamFrame | {
11016
12166
  type: string;
11017
12167
  [key: string]: unknown;
@@ -11037,4 +12187,4 @@ type ReviewRequester = components['schemas']['ReviewRequester'];
11037
12187
  type ReviewFinding = components['schemas']['ReviewFinding'];
11038
12188
  type Finding = ReviewFinding;
11039
12189
 
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 };
12190
+ 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 };