@soat/sdk 0.77.0 → 0.78.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.
package/dist/index.cjs CHANGED
@@ -994,7 +994,7 @@ var AiProviders = class {
994
994
  *
995
995
  * Deletes an AI provider configuration.
996
996
  *
997
- * Live references — chats, agents, and model routes whose targets name this provider — always block deletion with `409 AI_PROVIDER_HAS_DEPENDENTS`; `force` does not override them, so delete or repoint those resources first. Soft dependents — price overrides and usage/generation records — also block with `409` unless `force=true`, which deletes the provider's price overrides and unlinks (nulls) its usage history, preserving those rows. The `409` body's `error.meta` reports the counts, a sample of offending IDs, and a `forcible` flag that is `true` when a `force=true` retry would succeed.
997
+ * Live references — chats, agents, and model routes whose targets name this provider — always block deletion with `409 AI_PROVIDER_HAS_DEPENDENTS`; `force` does not override them, so delete or repoint those resources first. Soft dependents — price overrides and usage/generation records — also block with `409` unless `force=true`, which deletes the provider's price overrides and unlinks its usage history, preserving those rows: each usage event keeps the provider's id as its `ai_provider_id`. The `409` body's `error.meta` reports the counts, a sample of offending IDs, and a `forcible` flag that is `true` when a `force=true` retry would succeed.
998
998
  *
999
999
  */
1000
1000
  static deleteAiProvider(options) {
@@ -4753,7 +4753,7 @@ var Usage = class {
4753
4753
  *
4754
4754
  * Returns the raw usage events the caller can access, most recent first, narrowed by any combination of the same filters the aggregate takes — agent, generation, trace, actor, session, AI provider, orchestration run, orchestration, tool, trigger, action, outcome, meter type, model or `source` — so a rollup and the events behind it are addressed the same way. Each event is the per-generation token usage as reported by the provider, for audit and reconciliation.
4755
4755
  *
4756
- * An id naming nothing in scope yields an empty page rather than dropping the filter, so a mistyped narrowing can never widen the list past what was asked for.
4756
+ * An id filter matches the id the event recorded, so it still selects the spend of an agent, provider, session or tool since deleted. An id no event in scope recorded yields an empty page rather than dropping the filter, so a mistyped narrowing can never widen the list past what was asked for.
4757
4757
  *
4758
4758
  */
4759
4759
  static listUsageEvents(options) {
@@ -4767,7 +4767,7 @@ var Usage = class {
4767
4767
  *
4768
4768
  * Returns a project's usage rolled up over an optional `[from, to]` time window, optionally bucketed by a single dimension and narrowed by any combination of sixteen filters — session, actor, agent, AI provider, orchestration run, orchestration, generation, trace, tool, publisher project, meter type, model, source, trigger, action and outcome. That is how "what did this conversation cost", "what has this end user cost" and "what did this agent cost" are answered. Each group and the grand total carry an `event_count`, summed token counts, a measured `quantity` per component (so infra meters report their real amount, not zeros), and `cost_usd` (null when no event in the bucket was priced). This is the per-project cost-by-range/by-category query — a monthly figure without scanning raw usage events client-side.
4769
4769
  *
4770
- * Narrowings intersect and apply to the whole rollup — every bucket, `totals` and `totals.distinct` alike — so each composes with any `group_by`, and all sixteen are echoed back under `filters`. The ten naming a resource are resolved against the project (a tool also through an accepted share), and one naming nothing there empties the rollup rather than being dropped: a mistyped id must never read back as the project's whole spend. The other six are matched against the value the event recorded.
4770
+ * Narrowings intersect and apply to the whole rollup — every bucket, `totals` and `totals.distinct` alike — so each composes with any `group_by`, and all sixteen are echoed back under `filters`. The ten naming a resource match the id the event recorded, so a deleted resource's spend stays selectable; an id no event recorded empties the rollup rather than being dropped: a mistyped id must never read back as the project's whole spend. `orchestration_id` is the exception — the event records no orchestration, so a deleted one empties the rollup. The other six are matched against the value the event recorded.
4771
4771
  *
4772
4772
  * `groups` is paginated. Its `total` is the number of distinct buckets in the window — bucket cardinality, including a null bucket for the events the dimension does not apply to, and never a count of entities. To count entities, send `include=distinct` and read `totals.distinct`. `totals` always describes the whole window — never the page above it, and never the bucketing: omit `group_by` and `totals` is unchanged while `groups` is empty.
4773
4773
  *
package/dist/index.d.cts CHANGED
@@ -526,6 +526,16 @@ type Agent = {
526
526
  * Maximum number of recent messages to include in the context window sent to the model. When null, all messages are included.
527
527
  */
528
528
  max_context_messages?: number | null;
529
+ /**
530
+ * Maximum number of tokens the model may generate per step of a turn. A response that reaches it stops with `stop_reason` `length`. Null leaves the model's default.
531
+ */
532
+ max_output_tokens?: number | null;
533
+ /**
534
+ * How much the model reasons before answering. Translated per provider (Anthropic thinking, Gemini thinking config, OpenAI reasoning effort) against what the model supports; a model that cannot reason ignores it. `none` turns reasoning off where the model allows it. Reasoning tokens are metered as output. Null leaves the model's default.
535
+ */
536
+ reasoning?: {
537
+ effort: 'none' | 'low' | 'medium' | 'high';
538
+ } | null;
529
539
  /**
530
540
  * When true, only one open session per actor_id is allowed for this agent. Creating a second open session for the same actor returns 409.
531
541
  */
@@ -587,7 +597,7 @@ type AgentVersion = {
587
597
  */
588
598
  version?: number;
589
599
  /**
590
- * The agent's configuration as it stood at this version: every mutable field of the `Agent` schema (`instructions`, `model`, `tool_bindings`, `max_steps`, `tool_choice`, `stop_conditions`, `active_tool_ids`, `step_rules`, `boundary_policy`, `temperature`, `knowledge_config`, `output_schema`, `max_context_messages`, `single_session_per_actor`, `on_approval_expiry`, `guardrail_ids`, `ai_provider_id`, `model_route_id`, `name`), and none of its identity or bookkeeping fields (`id`, `project_id`, `version`, `active_release`, timestamps).
600
+ * The agent's configuration as it stood at this version: every mutable field of the `Agent` schema (`instructions`, `model`, `tool_bindings`, `max_steps`, `tool_choice`, `stop_conditions`, `active_tool_ids`, `step_rules`, `boundary_policy`, `temperature`, `knowledge_config`, `output_schema`, `max_context_messages`, `max_output_tokens`, `reasoning`, `single_session_per_actor`, `on_approval_expiry`, `guardrail_ids`, `ai_provider_id`, `model_route_id`, `name`), and none of its identity or bookkeeping fields (`id`, `project_id`, `version`, `active_release`, timestamps).
591
601
  *
592
602
  * Deliberately open rather than a fixed schema: an archive written by an earlier release of SOAT reflects the agent surface **of its own time**, so it may carry fields the current schema no longer defines, or lack ones it has since gained. Knowledge retrieval is not part of the snapshot — a version records which `knowledge_config` applied, while the documents and memory stores it resolves keep their own histories and are pinned at generation time.
593
603
  */
@@ -764,6 +774,16 @@ type CreateAgentRequest = {
764
774
  * Maximum number of recent messages included in the context window. Null means no limit.
765
775
  */
766
776
  max_context_messages?: number;
777
+ /**
778
+ * Maximum number of tokens the model may generate per step of a turn. A response that reaches it stops with `stop_reason` `length`. Null leaves the model's default.
779
+ */
780
+ max_output_tokens?: number | null;
781
+ /**
782
+ * How much the model reasons before answering. Translated per provider (Anthropic thinking, Gemini thinking config, OpenAI reasoning effort) against what the model supports; a model that cannot reason ignores it. `none` turns reasoning off where the model allows it. Reasoning tokens are metered as output. Null leaves the model's default.
783
+ */
784
+ reasoning?: {
785
+ effort: 'none' | 'low' | 'medium' | 'high';
786
+ } | null;
767
787
  /**
768
788
  * When true, only one open session per actor_id is allowed for this agent.
769
789
  */
@@ -899,6 +919,16 @@ type UpdateAgentRequest = {
899
919
  * Maximum number of recent messages included in the context window. Null means no limit.
900
920
  */
901
921
  max_context_messages?: number | null;
922
+ /**
923
+ * Maximum number of tokens the model may generate per step of a turn. A response that reaches it stops with `stop_reason` `length`. Null leaves the model's default.
924
+ */
925
+ max_output_tokens?: number | null;
926
+ /**
927
+ * How much the model reasons before answering. Translated per provider (Anthropic thinking, Gemini thinking config, OpenAI reasoning effort) against what the model supports; a model that cannot reason ignores it. `none` turns reasoning off where the model allows it. Reasoning tokens are metered as output. Null leaves the model's default.
928
+ */
929
+ reasoning?: {
930
+ effort: 'none' | 'low' | 'medium' | 'high';
931
+ } | null;
902
932
  /**
903
933
  * When true, only one open session per actor_id is allowed for this agent.
904
934
  */
@@ -2942,6 +2972,16 @@ type AgentResourceProperties = {
2942
2972
  * Maximum number of recent messages to include in the context window sent to the model. When null, all messages are included.
2943
2973
  */
2944
2974
  max_context_messages?: number | null;
2975
+ /**
2976
+ * Maximum number of tokens the model may generate per step of a turn. A response that reaches it stops with `stop_reason` `length`. Null leaves the model's default.
2977
+ */
2978
+ max_output_tokens?: number | null;
2979
+ /**
2980
+ * How much the model reasons before answering. Translated per provider (Anthropic thinking, Gemini thinking config, OpenAI reasoning effort) against what the model supports; a model that cannot reason ignores it. `none` turns reasoning off where the model allows it. Reasoning tokens are metered as output. Null leaves the model's default.
2981
+ */
2982
+ reasoning?: {
2983
+ effort: 'none' | 'low' | 'medium' | 'high';
2984
+ } | null;
2945
2985
  /**
2946
2986
  * When true, only one open session per actor_id is allowed for this agent.
2947
2987
  */
@@ -3671,6 +3711,10 @@ type SessionResourceProperties = {
3671
3711
  * Number of seconds of inactivity after which the session expires. 0 means never expires.
3672
3712
  */
3673
3713
  inactivity_ttl_seconds?: number;
3714
+ /**
3715
+ * Maximum number of recent conversation messages sent to the model on each generation, taking precedence over the agent's. null defers to the agent.
3716
+ */
3717
+ max_context_messages?: number | null;
3674
3718
  /**
3675
3719
  * Optional context object passed to tool calls. Write-only: no read of a session returns it.
3676
3720
  */
@@ -6251,6 +6295,11 @@ type SessionRecord = {
6251
6295
  *
6252
6296
  */
6253
6297
  message_delay_seconds?: number | null;
6298
+ /**
6299
+ * Maximum number of recent conversation messages sent to the model on each generation. Takes precedence over the agent's `max_context_messages`; null defers to it. A fork keeps its parent's value.
6300
+ *
6301
+ */
6302
+ max_context_messages?: number | null;
6254
6303
  /**
6255
6304
  * Timestamp of the last activity on the session (message added or response generated).
6256
6305
  */
@@ -6331,6 +6380,11 @@ type CreateSessionRequest = {
6331
6380
  *
6332
6381
  */
6333
6382
  message_delay_seconds?: number | null;
6383
+ /**
6384
+ * Maximum number of recent conversation messages sent to the model on each generation, taking precedence over the agent's `max_context_messages`. null or absent defers to the agent.
6385
+ *
6386
+ */
6387
+ max_context_messages?: number | null;
6334
6388
  };
6335
6389
  type UpdateSessionRequest = {
6336
6390
  /**
@@ -6361,6 +6415,11 @@ type UpdateSessionRequest = {
6361
6415
  *
6362
6416
  */
6363
6417
  message_delay_seconds?: number | null;
6418
+ /**
6419
+ * Maximum number of recent conversation messages sent to the model on each generation, taking precedence over the agent's `max_context_messages`. Set to null to defer to the agent.
6420
+ *
6421
+ */
6422
+ max_context_messages?: number | null;
6364
6423
  };
6365
6424
  type AddSessionMessageRequest = {
6366
6425
  /**
@@ -7415,7 +7474,7 @@ type UsageEvent = {
7415
7474
  */
7416
7475
  session_id?: string | null;
7417
7476
  /**
7418
- * Public ID of the AI provider instance billed — the target a model route picked for the turn, or the agent's pinned provider. Null if the provider was later deleted; the `provider`/`model` snapshot still records what was billed.
7477
+ * Public ID of the AI provider instance billed — the target a model route picked for the turn, or the agent's pinned provider. Kept after the provider is deleted, like every attribution id on the event.
7419
7478
  *
7420
7479
  */
7421
7480
  ai_provider_id?: string | null;
@@ -7430,7 +7489,7 @@ type UsageEvent = {
7430
7489
  */
7431
7490
  action_id?: string | null;
7432
7491
  /**
7433
- * Public ID of the tool a `tool_execution` event metered. Null on every other meter, for an inline tool definition, and once the tool is deleted.
7492
+ * Public ID of the tool a `tool_execution` event metered. Null on every other meter and for an inline tool definition.
7434
7493
  *
7435
7494
  */
7436
7495
  tool_id?: string | null;
@@ -7440,12 +7499,12 @@ type UsageEvent = {
7440
7499
  */
7441
7500
  publisher_project_id?: string | null;
7442
7501
  /**
7443
- * Public ID of the document an `embedding` event embedded a chunk of — ingestion, a re-chunk, a conversation's turns. Null on a query embedding, on every other meter, and once the document is deleted.
7502
+ * Public ID of the document an `embedding` event embedded a chunk of — ingestion, a re-chunk, a conversation's turns. Null on a query embedding and on every other meter.
7444
7503
  *
7445
7504
  */
7446
7505
  document_id?: string | null;
7447
7506
  /**
7448
- * Public ID of the memory store an `embedding` event embedded written content for. The store rather than the memory: stored content is shared by every memory in the store that states it. Null on a query embedding, on every other meter, and once the store is deleted.
7507
+ * Public ID of the memory store an `embedding` event embedded written content for. The store rather than the memory: stored content is shared by every memory in the store that states it. Null on a query embedding and on every other meter.
7449
7508
  *
7450
7509
  */
7451
7510
  memory_store_id?: string | null;
@@ -20752,22 +20811,22 @@ type ListUsageEventsData = {
20752
20811
  */
20753
20812
  trace_id?: string;
20754
20813
  /**
20755
- * Filter by the actor (end user) the usage is attributed to. An actor that does not exist in scope yields an empty page.
20814
+ * Filter by the actor (end user) the usage is attributed to.
20756
20815
  *
20757
20816
  */
20758
20817
  actor_id?: string;
20759
20818
  /**
20760
- * Filter by the session the usage was produced in. A session that does not exist in scope yields an empty page.
20819
+ * Filter by the session the usage was produced in.
20761
20820
  *
20762
20821
  */
20763
20822
  session_id?: string;
20764
20823
  /**
20765
- * Filter by the provider record the spend was billed against. A provider that does not exist in scope yields an empty page.
20824
+ * Filter by the provider record the spend was billed against.
20766
20825
  *
20767
20826
  */
20768
20827
  ai_provider_id?: string;
20769
20828
  /**
20770
- * Filter by the orchestration run that metered the event. A run that does not exist in scope yields an empty page.
20829
+ * Filter by the orchestration run that metered the event.
20771
20830
  *
20772
20831
  */
20773
20832
  orchestration_run_id?: string;
@@ -20790,12 +20849,12 @@ type ListUsageEventsData = {
20790
20849
  */
20791
20850
  action_id?: string;
20792
20851
  /**
20793
- * Filter by the tool a `tool_execution` event metered, including a tool another project shares with one in scope. A tool that does not exist in scope yields an empty page.
20852
+ * Filter by the tool a `tool_execution` event metered, including a tool another project shares with one in scope.
20794
20853
  *
20795
20854
  */
20796
20855
  tool_id?: string;
20797
20856
  /**
20798
- * Filter to the calls made through a share of a resource the named project owns. A project that does not exist yields an empty page.
20857
+ * Filter to the calls made through a share of a resource the named project owns.
20799
20858
  *
20800
20859
  */
20801
20860
  publisher_project_id?: string;
@@ -20886,7 +20945,7 @@ type GetUsageAggregateData = {
20886
20945
  */
20887
20946
  meter_type?: string;
20888
20947
  /**
20889
- * Narrow the whole rollup — every bucket, `totals` and `totals.distinct` alike — to one session's traffic. Combines with `group_by`: `group_by=day&session_id=…` is a conversation's spend per day, `group_by=model` is the same spend split by model. An id naming no session in this project yields an empty rollup, never the project total.
20948
+ * Narrow the whole rollup — every bucket, `totals` and `totals.distinct` alike — to one session's traffic. Combines with `group_by`: `group_by=day&session_id=…` is a conversation's spend per day, `group_by=model` is the same spend split by model. Like every id narrowing it matches the id the event recorded, so a deleted session's spend stays selectable; an id no event in this project recorded yields an empty rollup, never the project total.
20890
20949
  *
20891
20950
  */
20892
20951
  session_id?: string;
@@ -20944,12 +21003,12 @@ type GetUsageAggregateData = {
20944
21003
  */
20945
21004
  action_id?: string;
20946
21005
  /**
20947
- * Narrow to the executions of one tool, including one another project shares with this one. An id naming no tool in reach yields an empty rollup.
21006
+ * Narrow to the executions of one tool, including one another project shares with this one.
20948
21007
  *
20949
21008
  */
20950
21009
  tool_id?: string;
20951
21010
  /**
20952
- * Narrow to the calls made through a share of a resource the named project owns. A project that does not exist yields an empty rollup.
21011
+ * Narrow to the calls made through a share of a resource the named project owns.
20953
21012
  *
20954
21013
  */
20955
21014
  publisher_project_id?: string;
@@ -22237,7 +22296,7 @@ export declare class AiProviders {
22237
22296
  *
22238
22297
  * Deletes an AI provider configuration.
22239
22298
  *
22240
- * Live references — chats, agents, and model routes whose targets name this provider — always block deletion with `409 AI_PROVIDER_HAS_DEPENDENTS`; `force` does not override them, so delete or repoint those resources first. Soft dependents — price overrides and usage/generation records — also block with `409` unless `force=true`, which deletes the provider's price overrides and unlinks (nulls) its usage history, preserving those rows. The `409` body's `error.meta` reports the counts, a sample of offending IDs, and a `forcible` flag that is `true` when a `force=true` retry would succeed.
22299
+ * Live references — chats, agents, and model routes whose targets name this provider — always block deletion with `409 AI_PROVIDER_HAS_DEPENDENTS`; `force` does not override them, so delete or repoint those resources first. Soft dependents — price overrides and usage/generation records — also block with `409` unless `force=true`, which deletes the provider's price overrides and unlinks its usage history, preserving those rows: each usage event keeps the provider's id as its `ai_provider_id`. The `409` body's `error.meta` reports the counts, a sample of offending IDs, and a `forcible` flag that is `true` when a `force=true` retry would succeed.
22241
22300
  *
22242
22301
  */
22243
22302
  static deleteAiProvider<ThrowOnError extends boolean = false>(options: Options<DeleteAiProviderData, ThrowOnError>): RequestResult<DeleteAiProviderResponses, DeleteAiProviderErrors, ThrowOnError>;
@@ -24163,7 +24222,7 @@ export declare class Usage {
24163
24222
  *
24164
24223
  * Returns the raw usage events the caller can access, most recent first, narrowed by any combination of the same filters the aggregate takes — agent, generation, trace, actor, session, AI provider, orchestration run, orchestration, tool, trigger, action, outcome, meter type, model or `source` — so a rollup and the events behind it are addressed the same way. Each event is the per-generation token usage as reported by the provider, for audit and reconciliation.
24165
24224
  *
24166
- * An id naming nothing in scope yields an empty page rather than dropping the filter, so a mistyped narrowing can never widen the list past what was asked for.
24225
+ * An id filter matches the id the event recorded, so it still selects the spend of an agent, provider, session or tool since deleted. An id no event in scope recorded yields an empty page rather than dropping the filter, so a mistyped narrowing can never widen the list past what was asked for.
24167
24226
  *
24168
24227
  */
24169
24228
  static listUsageEvents<ThrowOnError extends boolean = false>(options?: Options<ListUsageEventsData, ThrowOnError>): RequestResult<ListUsageEventsResponses, ListUsageEventsErrors, ThrowOnError>;
@@ -24172,7 +24231,7 @@ export declare class Usage {
24172
24231
  *
24173
24232
  * Returns a project's usage rolled up over an optional `[from, to]` time window, optionally bucketed by a single dimension and narrowed by any combination of sixteen filters — session, actor, agent, AI provider, orchestration run, orchestration, generation, trace, tool, publisher project, meter type, model, source, trigger, action and outcome. That is how "what did this conversation cost", "what has this end user cost" and "what did this agent cost" are answered. Each group and the grand total carry an `event_count`, summed token counts, a measured `quantity` per component (so infra meters report their real amount, not zeros), and `cost_usd` (null when no event in the bucket was priced). This is the per-project cost-by-range/by-category query — a monthly figure without scanning raw usage events client-side.
24174
24233
  *
24175
- * Narrowings intersect and apply to the whole rollup — every bucket, `totals` and `totals.distinct` alike — so each composes with any `group_by`, and all sixteen are echoed back under `filters`. The ten naming a resource are resolved against the project (a tool also through an accepted share), and one naming nothing there empties the rollup rather than being dropped: a mistyped id must never read back as the project's whole spend. The other six are matched against the value the event recorded.
24234
+ * Narrowings intersect and apply to the whole rollup — every bucket, `totals` and `totals.distinct` alike — so each composes with any `group_by`, and all sixteen are echoed back under `filters`. The ten naming a resource match the id the event recorded, so a deleted resource's spend stays selectable; an id no event recorded empties the rollup rather than being dropped: a mistyped id must never read back as the project's whole spend. `orchestration_id` is the exception — the event records no orchestration, so a deleted one empties the rollup. The other six are matched against the value the event recorded.
24176
24235
  *
24177
24236
  * `groups` is paginated. Its `total` is the number of distinct buckets in the window — bucket cardinality, including a null bucket for the events the dimension does not apply to, and never a count of entities. To count entities, send `include=distinct` and read `totals.distinct`. `totals` always describes the whole window — never the page above it, and never the bucketing: omit `group_by` and `totals` is unchanged while `groups` is empty.
24178
24237
  *
package/dist/index.d.mts CHANGED
@@ -526,6 +526,16 @@ type Agent = {
526
526
  * Maximum number of recent messages to include in the context window sent to the model. When null, all messages are included.
527
527
  */
528
528
  max_context_messages?: number | null;
529
+ /**
530
+ * Maximum number of tokens the model may generate per step of a turn. A response that reaches it stops with `stop_reason` `length`. Null leaves the model's default.
531
+ */
532
+ max_output_tokens?: number | null;
533
+ /**
534
+ * How much the model reasons before answering. Translated per provider (Anthropic thinking, Gemini thinking config, OpenAI reasoning effort) against what the model supports; a model that cannot reason ignores it. `none` turns reasoning off where the model allows it. Reasoning tokens are metered as output. Null leaves the model's default.
535
+ */
536
+ reasoning?: {
537
+ effort: 'none' | 'low' | 'medium' | 'high';
538
+ } | null;
529
539
  /**
530
540
  * When true, only one open session per actor_id is allowed for this agent. Creating a second open session for the same actor returns 409.
531
541
  */
@@ -587,7 +597,7 @@ type AgentVersion = {
587
597
  */
588
598
  version?: number;
589
599
  /**
590
- * The agent's configuration as it stood at this version: every mutable field of the `Agent` schema (`instructions`, `model`, `tool_bindings`, `max_steps`, `tool_choice`, `stop_conditions`, `active_tool_ids`, `step_rules`, `boundary_policy`, `temperature`, `knowledge_config`, `output_schema`, `max_context_messages`, `single_session_per_actor`, `on_approval_expiry`, `guardrail_ids`, `ai_provider_id`, `model_route_id`, `name`), and none of its identity or bookkeeping fields (`id`, `project_id`, `version`, `active_release`, timestamps).
600
+ * The agent's configuration as it stood at this version: every mutable field of the `Agent` schema (`instructions`, `model`, `tool_bindings`, `max_steps`, `tool_choice`, `stop_conditions`, `active_tool_ids`, `step_rules`, `boundary_policy`, `temperature`, `knowledge_config`, `output_schema`, `max_context_messages`, `max_output_tokens`, `reasoning`, `single_session_per_actor`, `on_approval_expiry`, `guardrail_ids`, `ai_provider_id`, `model_route_id`, `name`), and none of its identity or bookkeeping fields (`id`, `project_id`, `version`, `active_release`, timestamps).
591
601
  *
592
602
  * Deliberately open rather than a fixed schema: an archive written by an earlier release of SOAT reflects the agent surface **of its own time**, so it may carry fields the current schema no longer defines, or lack ones it has since gained. Knowledge retrieval is not part of the snapshot — a version records which `knowledge_config` applied, while the documents and memory stores it resolves keep their own histories and are pinned at generation time.
593
603
  */
@@ -764,6 +774,16 @@ type CreateAgentRequest = {
764
774
  * Maximum number of recent messages included in the context window. Null means no limit.
765
775
  */
766
776
  max_context_messages?: number;
777
+ /**
778
+ * Maximum number of tokens the model may generate per step of a turn. A response that reaches it stops with `stop_reason` `length`. Null leaves the model's default.
779
+ */
780
+ max_output_tokens?: number | null;
781
+ /**
782
+ * How much the model reasons before answering. Translated per provider (Anthropic thinking, Gemini thinking config, OpenAI reasoning effort) against what the model supports; a model that cannot reason ignores it. `none` turns reasoning off where the model allows it. Reasoning tokens are metered as output. Null leaves the model's default.
783
+ */
784
+ reasoning?: {
785
+ effort: 'none' | 'low' | 'medium' | 'high';
786
+ } | null;
767
787
  /**
768
788
  * When true, only one open session per actor_id is allowed for this agent.
769
789
  */
@@ -899,6 +919,16 @@ type UpdateAgentRequest = {
899
919
  * Maximum number of recent messages included in the context window. Null means no limit.
900
920
  */
901
921
  max_context_messages?: number | null;
922
+ /**
923
+ * Maximum number of tokens the model may generate per step of a turn. A response that reaches it stops with `stop_reason` `length`. Null leaves the model's default.
924
+ */
925
+ max_output_tokens?: number | null;
926
+ /**
927
+ * How much the model reasons before answering. Translated per provider (Anthropic thinking, Gemini thinking config, OpenAI reasoning effort) against what the model supports; a model that cannot reason ignores it. `none` turns reasoning off where the model allows it. Reasoning tokens are metered as output. Null leaves the model's default.
928
+ */
929
+ reasoning?: {
930
+ effort: 'none' | 'low' | 'medium' | 'high';
931
+ } | null;
902
932
  /**
903
933
  * When true, only one open session per actor_id is allowed for this agent.
904
934
  */
@@ -2942,6 +2972,16 @@ type AgentResourceProperties = {
2942
2972
  * Maximum number of recent messages to include in the context window sent to the model. When null, all messages are included.
2943
2973
  */
2944
2974
  max_context_messages?: number | null;
2975
+ /**
2976
+ * Maximum number of tokens the model may generate per step of a turn. A response that reaches it stops with `stop_reason` `length`. Null leaves the model's default.
2977
+ */
2978
+ max_output_tokens?: number | null;
2979
+ /**
2980
+ * How much the model reasons before answering. Translated per provider (Anthropic thinking, Gemini thinking config, OpenAI reasoning effort) against what the model supports; a model that cannot reason ignores it. `none` turns reasoning off where the model allows it. Reasoning tokens are metered as output. Null leaves the model's default.
2981
+ */
2982
+ reasoning?: {
2983
+ effort: 'none' | 'low' | 'medium' | 'high';
2984
+ } | null;
2945
2985
  /**
2946
2986
  * When true, only one open session per actor_id is allowed for this agent.
2947
2987
  */
@@ -3671,6 +3711,10 @@ type SessionResourceProperties = {
3671
3711
  * Number of seconds of inactivity after which the session expires. 0 means never expires.
3672
3712
  */
3673
3713
  inactivity_ttl_seconds?: number;
3714
+ /**
3715
+ * Maximum number of recent conversation messages sent to the model on each generation, taking precedence over the agent's. null defers to the agent.
3716
+ */
3717
+ max_context_messages?: number | null;
3674
3718
  /**
3675
3719
  * Optional context object passed to tool calls. Write-only: no read of a session returns it.
3676
3720
  */
@@ -6251,6 +6295,11 @@ type SessionRecord = {
6251
6295
  *
6252
6296
  */
6253
6297
  message_delay_seconds?: number | null;
6298
+ /**
6299
+ * Maximum number of recent conversation messages sent to the model on each generation. Takes precedence over the agent's `max_context_messages`; null defers to it. A fork keeps its parent's value.
6300
+ *
6301
+ */
6302
+ max_context_messages?: number | null;
6254
6303
  /**
6255
6304
  * Timestamp of the last activity on the session (message added or response generated).
6256
6305
  */
@@ -6331,6 +6380,11 @@ type CreateSessionRequest = {
6331
6380
  *
6332
6381
  */
6333
6382
  message_delay_seconds?: number | null;
6383
+ /**
6384
+ * Maximum number of recent conversation messages sent to the model on each generation, taking precedence over the agent's `max_context_messages`. null or absent defers to the agent.
6385
+ *
6386
+ */
6387
+ max_context_messages?: number | null;
6334
6388
  };
6335
6389
  type UpdateSessionRequest = {
6336
6390
  /**
@@ -6361,6 +6415,11 @@ type UpdateSessionRequest = {
6361
6415
  *
6362
6416
  */
6363
6417
  message_delay_seconds?: number | null;
6418
+ /**
6419
+ * Maximum number of recent conversation messages sent to the model on each generation, taking precedence over the agent's `max_context_messages`. Set to null to defer to the agent.
6420
+ *
6421
+ */
6422
+ max_context_messages?: number | null;
6364
6423
  };
6365
6424
  type AddSessionMessageRequest = {
6366
6425
  /**
@@ -7415,7 +7474,7 @@ type UsageEvent = {
7415
7474
  */
7416
7475
  session_id?: string | null;
7417
7476
  /**
7418
- * Public ID of the AI provider instance billed — the target a model route picked for the turn, or the agent's pinned provider. Null if the provider was later deleted; the `provider`/`model` snapshot still records what was billed.
7477
+ * Public ID of the AI provider instance billed — the target a model route picked for the turn, or the agent's pinned provider. Kept after the provider is deleted, like every attribution id on the event.
7419
7478
  *
7420
7479
  */
7421
7480
  ai_provider_id?: string | null;
@@ -7430,7 +7489,7 @@ type UsageEvent = {
7430
7489
  */
7431
7490
  action_id?: string | null;
7432
7491
  /**
7433
- * Public ID of the tool a `tool_execution` event metered. Null on every other meter, for an inline tool definition, and once the tool is deleted.
7492
+ * Public ID of the tool a `tool_execution` event metered. Null on every other meter and for an inline tool definition.
7434
7493
  *
7435
7494
  */
7436
7495
  tool_id?: string | null;
@@ -7440,12 +7499,12 @@ type UsageEvent = {
7440
7499
  */
7441
7500
  publisher_project_id?: string | null;
7442
7501
  /**
7443
- * Public ID of the document an `embedding` event embedded a chunk of — ingestion, a re-chunk, a conversation's turns. Null on a query embedding, on every other meter, and once the document is deleted.
7502
+ * Public ID of the document an `embedding` event embedded a chunk of — ingestion, a re-chunk, a conversation's turns. Null on a query embedding and on every other meter.
7444
7503
  *
7445
7504
  */
7446
7505
  document_id?: string | null;
7447
7506
  /**
7448
- * Public ID of the memory store an `embedding` event embedded written content for. The store rather than the memory: stored content is shared by every memory in the store that states it. Null on a query embedding, on every other meter, and once the store is deleted.
7507
+ * Public ID of the memory store an `embedding` event embedded written content for. The store rather than the memory: stored content is shared by every memory in the store that states it. Null on a query embedding and on every other meter.
7449
7508
  *
7450
7509
  */
7451
7510
  memory_store_id?: string | null;
@@ -20752,22 +20811,22 @@ type ListUsageEventsData = {
20752
20811
  */
20753
20812
  trace_id?: string;
20754
20813
  /**
20755
- * Filter by the actor (end user) the usage is attributed to. An actor that does not exist in scope yields an empty page.
20814
+ * Filter by the actor (end user) the usage is attributed to.
20756
20815
  *
20757
20816
  */
20758
20817
  actor_id?: string;
20759
20818
  /**
20760
- * Filter by the session the usage was produced in. A session that does not exist in scope yields an empty page.
20819
+ * Filter by the session the usage was produced in.
20761
20820
  *
20762
20821
  */
20763
20822
  session_id?: string;
20764
20823
  /**
20765
- * Filter by the provider record the spend was billed against. A provider that does not exist in scope yields an empty page.
20824
+ * Filter by the provider record the spend was billed against.
20766
20825
  *
20767
20826
  */
20768
20827
  ai_provider_id?: string;
20769
20828
  /**
20770
- * Filter by the orchestration run that metered the event. A run that does not exist in scope yields an empty page.
20829
+ * Filter by the orchestration run that metered the event.
20771
20830
  *
20772
20831
  */
20773
20832
  orchestration_run_id?: string;
@@ -20790,12 +20849,12 @@ type ListUsageEventsData = {
20790
20849
  */
20791
20850
  action_id?: string;
20792
20851
  /**
20793
- * Filter by the tool a `tool_execution` event metered, including a tool another project shares with one in scope. A tool that does not exist in scope yields an empty page.
20852
+ * Filter by the tool a `tool_execution` event metered, including a tool another project shares with one in scope.
20794
20853
  *
20795
20854
  */
20796
20855
  tool_id?: string;
20797
20856
  /**
20798
- * Filter to the calls made through a share of a resource the named project owns. A project that does not exist yields an empty page.
20857
+ * Filter to the calls made through a share of a resource the named project owns.
20799
20858
  *
20800
20859
  */
20801
20860
  publisher_project_id?: string;
@@ -20886,7 +20945,7 @@ type GetUsageAggregateData = {
20886
20945
  */
20887
20946
  meter_type?: string;
20888
20947
  /**
20889
- * Narrow the whole rollup — every bucket, `totals` and `totals.distinct` alike — to one session's traffic. Combines with `group_by`: `group_by=day&session_id=…` is a conversation's spend per day, `group_by=model` is the same spend split by model. An id naming no session in this project yields an empty rollup, never the project total.
20948
+ * Narrow the whole rollup — every bucket, `totals` and `totals.distinct` alike — to one session's traffic. Combines with `group_by`: `group_by=day&session_id=…` is a conversation's spend per day, `group_by=model` is the same spend split by model. Like every id narrowing it matches the id the event recorded, so a deleted session's spend stays selectable; an id no event in this project recorded yields an empty rollup, never the project total.
20890
20949
  *
20891
20950
  */
20892
20951
  session_id?: string;
@@ -20944,12 +21003,12 @@ type GetUsageAggregateData = {
20944
21003
  */
20945
21004
  action_id?: string;
20946
21005
  /**
20947
- * Narrow to the executions of one tool, including one another project shares with this one. An id naming no tool in reach yields an empty rollup.
21006
+ * Narrow to the executions of one tool, including one another project shares with this one.
20948
21007
  *
20949
21008
  */
20950
21009
  tool_id?: string;
20951
21010
  /**
20952
- * Narrow to the calls made through a share of a resource the named project owns. A project that does not exist yields an empty rollup.
21011
+ * Narrow to the calls made through a share of a resource the named project owns.
20953
21012
  *
20954
21013
  */
20955
21014
  publisher_project_id?: string;
@@ -22237,7 +22296,7 @@ export declare class AiProviders {
22237
22296
  *
22238
22297
  * Deletes an AI provider configuration.
22239
22298
  *
22240
- * Live references — chats, agents, and model routes whose targets name this provider — always block deletion with `409 AI_PROVIDER_HAS_DEPENDENTS`; `force` does not override them, so delete or repoint those resources first. Soft dependents — price overrides and usage/generation records — also block with `409` unless `force=true`, which deletes the provider's price overrides and unlinks (nulls) its usage history, preserving those rows. The `409` body's `error.meta` reports the counts, a sample of offending IDs, and a `forcible` flag that is `true` when a `force=true` retry would succeed.
22299
+ * Live references — chats, agents, and model routes whose targets name this provider — always block deletion with `409 AI_PROVIDER_HAS_DEPENDENTS`; `force` does not override them, so delete or repoint those resources first. Soft dependents — price overrides and usage/generation records — also block with `409` unless `force=true`, which deletes the provider's price overrides and unlinks its usage history, preserving those rows: each usage event keeps the provider's id as its `ai_provider_id`. The `409` body's `error.meta` reports the counts, a sample of offending IDs, and a `forcible` flag that is `true` when a `force=true` retry would succeed.
22241
22300
  *
22242
22301
  */
22243
22302
  static deleteAiProvider<ThrowOnError extends boolean = false>(options: Options<DeleteAiProviderData, ThrowOnError>): RequestResult<DeleteAiProviderResponses, DeleteAiProviderErrors, ThrowOnError>;
@@ -24163,7 +24222,7 @@ export declare class Usage {
24163
24222
  *
24164
24223
  * Returns the raw usage events the caller can access, most recent first, narrowed by any combination of the same filters the aggregate takes — agent, generation, trace, actor, session, AI provider, orchestration run, orchestration, tool, trigger, action, outcome, meter type, model or `source` — so a rollup and the events behind it are addressed the same way. Each event is the per-generation token usage as reported by the provider, for audit and reconciliation.
24165
24224
  *
24166
- * An id naming nothing in scope yields an empty page rather than dropping the filter, so a mistyped narrowing can never widen the list past what was asked for.
24225
+ * An id filter matches the id the event recorded, so it still selects the spend of an agent, provider, session or tool since deleted. An id no event in scope recorded yields an empty page rather than dropping the filter, so a mistyped narrowing can never widen the list past what was asked for.
24167
24226
  *
24168
24227
  */
24169
24228
  static listUsageEvents<ThrowOnError extends boolean = false>(options?: Options<ListUsageEventsData, ThrowOnError>): RequestResult<ListUsageEventsResponses, ListUsageEventsErrors, ThrowOnError>;
@@ -24172,7 +24231,7 @@ export declare class Usage {
24172
24231
  *
24173
24232
  * Returns a project's usage rolled up over an optional `[from, to]` time window, optionally bucketed by a single dimension and narrowed by any combination of sixteen filters — session, actor, agent, AI provider, orchestration run, orchestration, generation, trace, tool, publisher project, meter type, model, source, trigger, action and outcome. That is how "what did this conversation cost", "what has this end user cost" and "what did this agent cost" are answered. Each group and the grand total carry an `event_count`, summed token counts, a measured `quantity` per component (so infra meters report their real amount, not zeros), and `cost_usd` (null when no event in the bucket was priced). This is the per-project cost-by-range/by-category query — a monthly figure without scanning raw usage events client-side.
24174
24233
  *
24175
- * Narrowings intersect and apply to the whole rollup — every bucket, `totals` and `totals.distinct` alike — so each composes with any `group_by`, and all sixteen are echoed back under `filters`. The ten naming a resource are resolved against the project (a tool also through an accepted share), and one naming nothing there empties the rollup rather than being dropped: a mistyped id must never read back as the project's whole spend. The other six are matched against the value the event recorded.
24234
+ * Narrowings intersect and apply to the whole rollup — every bucket, `totals` and `totals.distinct` alike — so each composes with any `group_by`, and all sixteen are echoed back under `filters`. The ten naming a resource match the id the event recorded, so a deleted resource's spend stays selectable; an id no event recorded empties the rollup rather than being dropped: a mistyped id must never read back as the project's whole spend. `orchestration_id` is the exception — the event records no orchestration, so a deleted one empties the rollup. The other six are matched against the value the event recorded.
24176
24235
  *
24177
24236
  * `groups` is paginated. Its `total` is the number of distinct buckets in the window — bucket cardinality, including a null bucket for the events the dimension does not apply to, and never a count of entities. To count entities, send `include=distinct` and read `totals.distinct`. `totals` always describes the whole window — never the page above it, and never the bucketing: omit `group_by` and `totals` is unchanged while `groups` is empty.
24178
24237
  *
package/dist/index.mjs CHANGED
@@ -993,7 +993,7 @@ var AiProviders = class {
993
993
  *
994
994
  * Deletes an AI provider configuration.
995
995
  *
996
- * Live references — chats, agents, and model routes whose targets name this provider — always block deletion with `409 AI_PROVIDER_HAS_DEPENDENTS`; `force` does not override them, so delete or repoint those resources first. Soft dependents — price overrides and usage/generation records — also block with `409` unless `force=true`, which deletes the provider's price overrides and unlinks (nulls) its usage history, preserving those rows. The `409` body's `error.meta` reports the counts, a sample of offending IDs, and a `forcible` flag that is `true` when a `force=true` retry would succeed.
996
+ * Live references — chats, agents, and model routes whose targets name this provider — always block deletion with `409 AI_PROVIDER_HAS_DEPENDENTS`; `force` does not override them, so delete or repoint those resources first. Soft dependents — price overrides and usage/generation records — also block with `409` unless `force=true`, which deletes the provider's price overrides and unlinks its usage history, preserving those rows: each usage event keeps the provider's id as its `ai_provider_id`. The `409` body's `error.meta` reports the counts, a sample of offending IDs, and a `forcible` flag that is `true` when a `force=true` retry would succeed.
997
997
  *
998
998
  */
999
999
  static deleteAiProvider(options) {
@@ -4752,7 +4752,7 @@ var Usage = class {
4752
4752
  *
4753
4753
  * Returns the raw usage events the caller can access, most recent first, narrowed by any combination of the same filters the aggregate takes — agent, generation, trace, actor, session, AI provider, orchestration run, orchestration, tool, trigger, action, outcome, meter type, model or `source` — so a rollup and the events behind it are addressed the same way. Each event is the per-generation token usage as reported by the provider, for audit and reconciliation.
4754
4754
  *
4755
- * An id naming nothing in scope yields an empty page rather than dropping the filter, so a mistyped narrowing can never widen the list past what was asked for.
4755
+ * An id filter matches the id the event recorded, so it still selects the spend of an agent, provider, session or tool since deleted. An id no event in scope recorded yields an empty page rather than dropping the filter, so a mistyped narrowing can never widen the list past what was asked for.
4756
4756
  *
4757
4757
  */
4758
4758
  static listUsageEvents(options) {
@@ -4766,7 +4766,7 @@ var Usage = class {
4766
4766
  *
4767
4767
  * Returns a project's usage rolled up over an optional `[from, to]` time window, optionally bucketed by a single dimension and narrowed by any combination of sixteen filters — session, actor, agent, AI provider, orchestration run, orchestration, generation, trace, tool, publisher project, meter type, model, source, trigger, action and outcome. That is how "what did this conversation cost", "what has this end user cost" and "what did this agent cost" are answered. Each group and the grand total carry an `event_count`, summed token counts, a measured `quantity` per component (so infra meters report their real amount, not zeros), and `cost_usd` (null when no event in the bucket was priced). This is the per-project cost-by-range/by-category query — a monthly figure without scanning raw usage events client-side.
4768
4768
  *
4769
- * Narrowings intersect and apply to the whole rollup — every bucket, `totals` and `totals.distinct` alike — so each composes with any `group_by`, and all sixteen are echoed back under `filters`. The ten naming a resource are resolved against the project (a tool also through an accepted share), and one naming nothing there empties the rollup rather than being dropped: a mistyped id must never read back as the project's whole spend. The other six are matched against the value the event recorded.
4769
+ * Narrowings intersect and apply to the whole rollup — every bucket, `totals` and `totals.distinct` alike — so each composes with any `group_by`, and all sixteen are echoed back under `filters`. The ten naming a resource match the id the event recorded, so a deleted resource's spend stays selectable; an id no event recorded empties the rollup rather than being dropped: a mistyped id must never read back as the project's whole spend. `orchestration_id` is the exception — the event records no orchestration, so a deleted one empties the rollup. The other six are matched against the value the event recorded.
4770
4770
  *
4771
4771
  * `groups` is paginated. Its `total` is the number of distinct buckets in the window — bucket cardinality, including a null bucket for the events the dimension does not apply to, and never a count of entities. To count entities, send `include=distinct` and read `totals.distinct`. `totals` always describes the whole window — never the page above it, and never the bucketing: omit `group_by` and `totals` is unchanged while `groups` is empty.
4772
4772
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soat/sdk",
3
- "version": "0.77.0",
3
+ "version": "0.78.0",
4
4
  "description": "TypeScript SDK for SOAT — open-source infrastructure for production-ready AI agents.",
5
5
  "keywords": [
6
6
  "ai-agents",