@naturali/sdk 0.85.1 → 0.85.2

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.d.cts CHANGED
@@ -502,15 +502,15 @@ type Agent = {
502
502
  */
503
503
  tool_bindings?: Array<ToolBinding> | null;
504
504
  /**
505
- * Maximum agent loop steps before stopping
505
+ * Maximum agent loop steps before stopping. The budget bounds a **turn**: a generation that pauses at `requires_action` and resumes after `submit-tool-outputs` continues the same turn and spends what is left of it, so a turn that arrives with nothing left completes with `stop_reason: "max_steps"` instead of calling the model again.
506
506
  */
507
507
  max_steps?: number | null;
508
508
  /**
509
- * Tool choice strategy. Accepts a string (`"auto"`, `"required"`) or an object (`{ "type": "tool", "tool_name": "my_tool" }`).
509
+ * Tool choice strategy. Accepts a string (`"auto"`, `"required"`) or an object (`{ "type": "tool", "tool_name": "my_tool" }`). A forcing value (`"required"` or the object form) forbids a final assistant message on every step of every turn, including a resumed or continued one, so it requires a `hasToolCall` entry in `stop_conditions` — otherwise the write is refused with `FORCED_TOOL_CHOICE_CANNOT_STOP`.
510
510
  */
511
511
  tool_choice?: unknown;
512
512
  /**
513
- * Stop conditions
513
+ * Conditions that end the agent's work early, on top of `max_steps` — turn-scoped (`hasToolCall`) or chain-scoped (`maxChainGenerations`). See the create request body for the accepted shapes.
514
514
  */
515
515
  stop_conditions?: Array<{
516
516
  [key: string]: unknown;
@@ -524,7 +524,7 @@ type Agent = {
524
524
  */
525
525
  guardrail_ids?: Array<string> | null;
526
526
  /**
527
- * Per-step overrides
527
+ * Per-step overrides of `tool_choice` and `active_tool_ids`. Steps are numbered from the first step of the **turn**, and that numbering spans a `requires_action` pause — a rule fires once per turn, not once per resumption.
528
528
  */
529
529
  step_rules?: Array<{
530
530
  [key: string]: unknown;
@@ -593,6 +593,10 @@ type Agent = {
593
593
  * Agent-scope zero-retention setting. `null` (the default) inherits the project's `trace_content_mode`; `none` means this agent's trace and generation content is never persisted. An agent may tighten a storing project to `none` but cannot loosen a `none` project back to `full`.
594
594
  */
595
595
  trace_content_mode?: 'full' | 'none' | null;
596
+ /**
597
+ * What happens when one of this agent's held tool calls expires un-approved. `null` (the default) and `terminate` end the chain there — the expired approval, its `approvals.expired` event and the auto-filed `approval_expired` exception are the whole record. `react` spawns a continuation that reports the staleness to the agent, for an agent that acts on it.
598
+ */
599
+ on_approval_expiry?: 'terminate' | 'react' | null;
596
600
  /**
597
601
  * Current config version. Starts at 1 and increments on every write that changes the config; each increment archives the new config as an `AgentVersion`. A write that changes nothing leaves it untouched.
598
602
  */
@@ -642,7 +646,7 @@ type AgentVersion = {
642
646
  */
643
647
  version?: number;
644
648
  /**
645
- * 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`, `guardrail_ids`, `ai_provider_id`, `model_route_id`, `name`), and none of its identity or bookkeeping fields (`id`, `project_id`, `version`, `active_release`, timestamps).
649
+ * 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).
646
650
  *
647
651
  * Deliberately open rather than a fixed schema: an archive written by an earlier release of the runtime 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 memories it resolves keep their own histories and are pinned at generation time.
648
652
  */
@@ -718,9 +722,18 @@ type CreateAgentRequest = {
718
722
  tool_bindings?: Array<ToolBinding>;
719
723
  max_steps?: number;
720
724
  /**
721
- * Tool choice strategy. Accepts a string (`"auto"`, `"required"`) or an object (`{ "type": "tool", "tool_name": "my_tool" }`).
725
+ * Tool choice strategy. Accepts a string (`"auto"`, `"required"`) or an object (`{ "type": "tool", "tool_name": "my_tool" }`). A forcing value (`"required"` or the object form) forbids a final assistant message on every step of every turn, including a resumed or continued one, so it requires a `hasToolCall` entry in `stop_conditions` — otherwise the write is refused with `FORCED_TOOL_CHOICE_CANNOT_STOP`.
722
726
  */
723
727
  tool_choice?: unknown;
728
+ /**
729
+ * Conditions that end the agent's work early, on top of `max_steps`. Two scopes:
730
+ *
731
+ * `{"type": "hasToolCall", "tool_name": "<resolved tool name>"}` ends the **turn** after the step that calls the named tool. It narrows when the loop ends — it never lets it run past `max_steps`.
732
+ *
733
+ * `{"type": "maxChainGenerations", "max_generations": <n>}` bounds the **continuation chain** instead: once the chain has spawned that many generations, further resumptions stop with `chain_limit` rather than extending it. It never shortens a turn. The effective ceiling is the smaller of this and the deployment's `MAX_CONTINUATION_CHAIN_GENERATIONS`, so an agent can be stricter than the platform but never looser.
734
+ *
735
+ * An unknown `type`, a `hasToolCall` without a `tool_name`, a `maxChainGenerations` whose `max_generations` is not a positive integer, or a non-object entry is rejected with 400.
736
+ */
724
737
  stop_conditions?: Array<{
725
738
  [key: string]: unknown;
726
739
  }>;
@@ -787,6 +800,10 @@ type CreateAgentRequest = {
787
800
  * Zero-retention opt-in for this agent. `null` inherits the project's setting; `none` means trace and generation content is never written. Setting `full` under a project whose own mode is `none` is refused with 400 — the project is a floor an agent may only tighten.
788
801
  */
789
802
  trace_content_mode?: 'full' | 'none' | null;
803
+ /**
804
+ * What happens when one of this agent's held tool calls expires un-approved. `null` (the default) and `terminate` end the chain there — the expired approval, its `approvals.expired` event and the auto-filed `approval_expired` exception are the whole record. `react` spawns a continuation that reports the staleness to the agent, for an agent that acts on it.
805
+ */
806
+ on_approval_expiry?: 'terminate' | 'react' | null;
790
807
  /**
791
808
  * Optional tag for the config version this write archives (e.g. `initial`). Annotates the version only — it is not stored on the agent and is not part of the config, so labelling a change is never itself a change.
792
809
  */
@@ -810,9 +827,18 @@ type UpdateAgentRequest = {
810
827
  tool_bindings?: Array<ToolBinding> | null;
811
828
  max_steps?: number | null;
812
829
  /**
813
- * Tool choice strategy. Accepts a string (`"auto"`, `"required"`) or an object (`{ "type": "tool", "tool_name": "my_tool" }`).
830
+ * Tool choice strategy. Accepts a string (`"auto"`, `"required"`) or an object (`{ "type": "tool", "tool_name": "my_tool" }`). A forcing value (`"required"` or the object form) forbids a final assistant message on every step of every turn, including a resumed or continued one, so it requires a `hasToolCall` entry in `stop_conditions` — otherwise the write is refused with `FORCED_TOOL_CHOICE_CANNOT_STOP`.
814
831
  */
815
832
  tool_choice?: unknown;
833
+ /**
834
+ * Conditions that end the agent's work early, on top of `max_steps`. Two scopes:
835
+ *
836
+ * `{"type": "hasToolCall", "tool_name": "<resolved tool name>"}` ends the **turn** after the step that calls the named tool. It narrows when the loop ends — it never lets it run past `max_steps`.
837
+ *
838
+ * `{"type": "maxChainGenerations", "max_generations": <n>}` bounds the **continuation chain** instead: once the chain has spawned that many generations, further resumptions stop with `chain_limit` rather than extending it. It never shortens a turn. The effective ceiling is the smaller of this and the deployment's `MAX_CONTINUATION_CHAIN_GENERATIONS`, so an agent can be stricter than the platform but never looser.
839
+ *
840
+ * An unknown `type`, a `hasToolCall` without a `tool_name`, a `maxChainGenerations` whose `max_generations` is not a positive integer, or a non-object entry is rejected with 400.
841
+ */
816
842
  stop_conditions?: Array<{
817
843
  [key: string]: unknown;
818
844
  }> | null;
@@ -879,6 +905,10 @@ type UpdateAgentRequest = {
879
905
  * Zero-retention opt-in for this agent. `null` inherits the project's setting; `none` means trace and generation content is never written. Setting `full` under a project whose own mode is `none` is refused with 400.
880
906
  */
881
907
  trace_content_mode?: 'full' | 'none' | null;
908
+ /**
909
+ * What happens when one of this agent's held tool calls expires un-approved. `null` (the default) and `terminate` end the chain there — the expired approval, its `approvals.expired` event and the auto-filed `approval_expired` exception are the whole record. `react` spawns a continuation that reports the staleness to the agent, for an agent that acts on it.
910
+ */
911
+ on_approval_expiry?: 'terminate' | 'react' | null;
882
912
  /**
883
913
  * Optional tag for the config version this write archives (e.g. `pre-tone-change`). Annotates the version only — it is not stored on the agent and is not part of the config, so labelling a change is never itself a change. Ignored when the write changes nothing, since no version is created.
884
914
  */
@@ -2443,7 +2473,7 @@ type ExceptionItem = {
2443
2473
  /**
2444
2474
  * How the exception was filed
2445
2475
  */
2446
- kind?: 'run_failed' | 'guardrail_tripwire' | 'approval_expired' | 'quota_unpriced' | 'event_trigger_loop' | 'manual';
2476
+ kind?: 'run_failed' | 'guardrail_tripwire' | 'approval_expired' | 'quota_unpriced' | 'event_trigger_loop' | 'chain_limit' | 'manual';
2447
2477
  /**
2448
2478
  * Human-readable one-line summary
2449
2479
  */
@@ -2659,17 +2689,21 @@ type AgentResourceProperties = {
2659
2689
  */
2660
2690
  tool_choice?: unknown;
2661
2691
  /**
2662
- * Conditions that stop multi-step generation early. The loop stops when any condition is met.
2692
+ * Conditions that stop the agent's work early — turn-scoped (`hasToolCall`) or chain-scoped (`maxChainGenerations`).
2663
2693
  */
2664
2694
  stop_conditions?: Array<{
2665
2695
  /**
2666
- * Condition type — currently `hasToolCall`
2696
+ * Condition type — `hasToolCall` or `maxChainGenerations`
2667
2697
  */
2668
2698
  type?: string;
2669
2699
  /**
2670
2700
  * Tool name to match when type is `hasToolCall`
2671
2701
  */
2672
2702
  tool_name?: string | null;
2703
+ /**
2704
+ * Generations the continuation chain may reach when type is `maxChainGenerations`
2705
+ */
2706
+ max_generations?: number | null;
2673
2707
  }> | null;
2674
2708
  /**
2675
2709
  * Subset of the bound tools that are active
@@ -2736,6 +2770,10 @@ type AgentResourceProperties = {
2736
2770
  * Agent-scope zero-retention setting (`full` or `none`). `null` inherits the project's setting. `full` is refused when the project's own mode is `none`.
2737
2771
  */
2738
2772
  trace_content_mode?: string | null;
2773
+ /**
2774
+ * What happens when a held tool call expires un-approved: `terminate` (the default when null) ends the chain, `react` spawns a continuation that reports the staleness to the agent.
2775
+ */
2776
+ on_approval_expiry?: string | null;
2739
2777
  /**
2740
2778
  * Knowledge retrieval configuration. When set, relevant documents and memory entries are injected into every generation.
2741
2779
  */
@@ -2831,9 +2869,9 @@ type AiProviderResourceProperties = {
2831
2869
  */
2832
2870
  name: string;
2833
2871
  /**
2834
- * Provider type (e.g. openai, anthropic)
2872
+ * Provider type
2835
2873
  */
2836
- provider: string;
2874
+ provider: 'openai' | 'anthropic' | 'google' | 'xai' | 'groq' | 'ollama' | 'azure' | 'bedrock' | 'vertex' | 'gateway' | 'custom';
2837
2875
  /**
2838
2876
  * Default model identifier (e.g. gpt-4o, claude-3-7-sonnet)
2839
2877
  */
@@ -3394,7 +3432,7 @@ type WorkflowResourceProperties = {
3394
3432
  } | null;
3395
3433
  };
3396
3434
  /**
3397
- * Creates a quota — a project-scoped cap that blocks (`enforce`) or reports (`monitor`) when a windowed aggregate is exceeded. `requests` quotas are enforced by the request middleware; `tokens`/`cost_usd` quotas at the pre-generation check. Mirrors the quotas REST contract; `scope`, `metric`, and `window` are immutable after creation (only `limit` and `mode` update).
3435
+ * Creates a quota — a project-scoped cap that blocks (`enforce`) or reports (`monitor`) when a windowed aggregate is exceeded. `requests` quotas are enforced by the request middleware; `tokens`/`cost_usd` quotas at the pre-generation check. Mirrors the quotas REST contract; `scope`, `metric`, and `window` are immutable after creation (only `limit`, `mode`, and `on_unpriced` update).
3398
3436
  */
3399
3437
  type QuotaResourceProperties = {
3400
3438
  /**
@@ -3421,6 +3459,10 @@ type QuotaResourceProperties = {
3421
3459
  * enforce blocks with 429; monitor fires the webhook only
3422
3460
  */
3423
3461
  mode?: 'enforce' | 'monitor';
3462
+ /**
3463
+ * Only for metric cost_usd. What an enforce quota does over a pricing blackout — block (the default) refuses generations with 409 QUOTA_UNENFORCEABLE, allow accepts the unmeasurable spend. See the quotas REST contract.
3464
+ */
3465
+ on_unpriced?: 'block' | 'allow';
3424
3466
  };
3425
3467
  /**
3426
3468
  * Creates a guardrail — an action-class document (`class`/`guard`) that gates tool-call autonomy. Attach it to a tool or agent via that resource's `guardrail_ids` (a `{ "ref": … }` to this resource in the same template resolves to its physical id at deploy time). Mirrors the guardrails REST contract; `class`/`default_class`/`guard`/`escalate` are flattened here from the REST API's single `document` object.
@@ -3677,6 +3719,11 @@ type Generation = {
3677
3719
  *
3678
3720
  */
3679
3721
  initiator_generation_id?: string | null;
3722
+ /**
3723
+ * Public ID of the continuation chain this generation belongs to. Set on every member of a chain — the continuations and the root they descend from — and null on a generation that is not part of one.
3724
+ *
3725
+ */
3726
+ chain_id?: string | null;
3680
3727
  /**
3681
3728
  * Type of the principal that started the generation
3682
3729
  */
@@ -3696,7 +3743,8 @@ type Generation = {
3696
3743
  completed_at?: Date | null;
3697
3744
  last_activity_at?: Date | null;
3698
3745
  /**
3699
- * Why the generation stopped (e.g. 'stop', 'error')
3746
+ * Why the generation stopped. Either the model provider's own finish reason relayed unchanged ('stop', 'tool-calls', 'length', …) or one the platform names itself: 'max_steps' when the turn spent its whole step budget on tool calls, 'depth_guard' when a nested call exceeded the call depth, 'chain_limit' when a continuation chain reached its generation budget, or 'error' when the turn failed.
3747
+ *
3700
3748
  */
3701
3749
  stop_reason?: string | null;
3702
3750
  /**
@@ -3917,6 +3965,10 @@ type GenerationTranscript = {
3917
3965
  *
3918
3966
  */
3919
3967
  status?: 'in_progress' | 'requires_action' | 'completed' | 'failed';
3968
+ /**
3969
+ * Why the generation stopped — the provider's finish reason, or one of the platform's own ('max_steps', 'depth_guard', 'chain_limit', 'error').
3970
+ *
3971
+ */
3920
3972
  stop_reason?: string | null;
3921
3973
  started_at?: Date;
3922
3974
  completed_at?: Date | null;
@@ -3926,7 +3978,7 @@ type GenerationTranscript = {
3926
3978
  */
3927
3979
  step_count?: number;
3928
3980
  /**
3929
- * The messages the turn was asked, as recorded. Message content is caller-owned and passed through verbatim. Null when the content was never stored, has been purged, or predates input recording.
3981
+ * The messages the turn was asked, as recorded. Message content is caller-owned and passed through verbatim. Null when the content was never stored or has been purged.
3930
3982
  *
3931
3983
  */
3932
3984
  input?: Array<{
@@ -4568,6 +4620,10 @@ type OrchestrationNode = {
4568
4620
  * For loop nodes — number of items to process in parallel.
4569
4621
  */
4570
4622
  parallelism?: number;
4623
+ /**
4624
+ * For loop and sub_orchestration nodes — allowlist of the run's `tool_context` keys the child run inherits. When `null` (the default), the child inherits the parent's whole bag — the behavior of every graph authored before this field existed. When set, only the listed keys are handed down, so a run holding a broad credential can delegate one step to a shared sub-graph without passing on what that sub-graph does not need; `[]` hands down nothing. Matching is case-insensitive, since an entry names a key that becomes an HTTP header name; an entry outside that grammar is rejected at write time with `INVALID_TOOL_CONTEXT_KEY`. The server-derived identity keys (`sessionId`, `actorId`, `actorExternalId`) are unaffected — they are re-derived per generation in the child regardless of this list. Ignored for other node types.
4625
+ */
4626
+ context_keys?: Array<string> | null;
4571
4627
  /**
4572
4628
  * For poll nodes — wait between attempts. Accepts a friendly suffix form (`5s`, `30s`, `5m`, `2h`, `500ms`) or ISO 8601 (e.g. PT5S).
4573
4629
  *
@@ -5205,6 +5261,10 @@ type Quota = {
5205
5261
  window?: 'rolling_1m' | 'rolling_1h' | 'rolling_24h' | 'calendar_month';
5206
5262
  limit?: number;
5207
5263
  mode?: 'enforce' | 'monitor';
5264
+ /**
5265
+ * Pricing posture of a cost_usd quota over an unpriced blackout — block refuses generations, allow lets them through (the quota_unpriced exception is filed either way). Null for metrics with no pricing dependency.
5266
+ */
5267
+ on_unpriced?: 'block' | 'allow' | null;
5208
5268
  /**
5209
5269
  * Current fixed-window usage for the requests metric. Null for token/cost quotas (which aggregate the usage meter at check time rather than keeping a counter) and in list responses.
5210
5270
  */
@@ -5786,6 +5846,14 @@ type CallToolRequest = {
5786
5846
  input?: {
5787
5847
  [key: string]: unknown;
5788
5848
  };
5849
+ /**
5850
+ * Key/value context for this call, forwarded to the tool as `X-Naturali-Context-<key>` request headers and resolving any `{{context:<key>}}` token in the tool's `execute.headers`, `mcp.headers` or `preset_parameters`. Narrowed by the tool's `context_keys` allowlist when it sets one.
5851
+ * This route has no session, so it stamps no server-derived identity: the reserved keys `sessionId`, `actorId` and `actorExternalId` are dropped from this bag (in any casing) rather than forwarded, so a downstream tool can still trust that a context header naming one is server-derived. Every other key becomes an HTTP header name and must match that grammar, or the call fails with `INVALID_TOOL_CONTEXT_KEY`.
5852
+ *
5853
+ */
5854
+ tool_context?: {
5855
+ [key: string]: string;
5856
+ };
5789
5857
  };
5790
5858
  type Trace = {
5791
5859
  /**
@@ -8648,7 +8716,7 @@ type ListAuditEntriesData = {
8648
8716
  */
8649
8717
  resource_public_id?: string;
8650
8718
  /**
8651
- * SRN prefix match, e.g. `srn:{project}:secret:`. An entry written before an earlier prefix rename keeps its original SRN (the log is append-only), and an `srn:` prefix matches those too, so history stays reachable.
8719
+ * SRN prefix match, e.g. `srn:{project}:secret:`. The log is append-only, so a stored SRN is never rewritten; the filter matches it as stored.
8652
8720
  */
8653
8721
  resource_srn?: string;
8654
8722
  /**
@@ -8722,7 +8790,7 @@ type ExportAuditEntriesData = {
8722
8790
  */
8723
8791
  resource_public_id?: string;
8724
8792
  /**
8725
- * SRN prefix match, e.g. `srn:{project}:secret:`. An entry written before an earlier prefix rename keeps its original SRN (the log is append-only), and an `srn:` prefix matches those too, so history stays reachable.
8793
+ * SRN prefix match, e.g. `srn:{project}:secret:`. The log is append-only, so a stored SRN is never rewritten; the filter matches it as stored.
8726
8794
  */
8727
8795
  resource_srn?: string;
8728
8796
  /**
@@ -11530,6 +11598,16 @@ type StartEvalRunData = {
11530
11598
  metadata?: {
11531
11599
  [key: string]: unknown;
11532
11600
  };
11601
+ /**
11602
+ * Key/value context forwarded to every item's generation, so an agent whose tools authorize through `tool_context` is scored against the configuration it runs in production rather than with an empty bag. Each key is forwarded as one `X-Naturali-Context-<key>` header and resolves any `{{context:<key>}}` token in a bound tool's headers or `preset_parameters`.
11603
+ *
11604
+ * Stored on the run and re-read per item, since a queued run (the default) is driven by a worker with no request behind it. **Write-only**: no read of the run returns it, unlike `metadata` — a run is a report other people read, and a credential in it is not theirs to see. Cleared once the run reaches a terminal state.
11605
+ *
11606
+ * An eval generation has no session, so the reserved keys `sessionId`, `actorId` and `actorExternalId` are dropped (in any casing) rather than forwarded. Every other key becomes an HTTP header name and must match that grammar, or the request is rejected with `400 INVALID_TOOL_CONTEXT_KEY` and no run is created.
11607
+ */
11608
+ tool_context?: {
11609
+ [key: string]: string;
11610
+ };
11533
11611
  };
11534
11612
  path: {
11535
11613
  /**
@@ -11546,7 +11624,7 @@ type StartEvalRunData = {
11546
11624
  };
11547
11625
  type StartEvalRunErrors = {
11548
11626
  /**
11549
- * Bad request (non-boolean wait, dataset empty or over the synchronous cap, unknown agent_version, invalid baseline, scorers no longer valid against the agent)
11627
+ * Bad request (non-boolean wait, dataset empty or over the synchronous cap, unknown agent_version, invalid baseline, scorers no longer valid against the agent, a `tool_context` key that cannot become a header)
11550
11628
  */
11551
11629
  400: unknown;
11552
11630
  /**
@@ -11735,7 +11813,7 @@ type ListExceptionsData = {
11735
11813
  /**
11736
11814
  * Filter by how the exception was filed
11737
11815
  */
11738
- kind?: 'run_failed' | 'guardrail_tripwire' | 'approval_expired' | 'quota_unpriced' | 'event_trigger_loop' | 'manual';
11816
+ kind?: 'run_failed' | 'guardrail_tripwire' | 'approval_expired' | 'quota_unpriced' | 'event_trigger_loop' | 'chain_limit' | 'manual';
11739
11817
  /**
11740
11818
  * Maximum number of results to return
11741
11819
  */
@@ -12777,6 +12855,11 @@ type ListGenerationsData = {
12777
12855
  *
12778
12856
  */
12779
12857
  initiator_generation_id?: string;
12858
+ /**
12859
+ * Filter by the continuation chain the generation belongs to. This is how a chain is expanded into its members — the chain record carries only their count.
12860
+ *
12861
+ */
12862
+ chain_id?: string;
12780
12863
  /**
12781
12864
  * Filter by the orchestration run that dispatched the generation. This is how a run is traced back to what its agent nodes did — a node execution record stores no generation id.
12782
12865
  *
@@ -15414,6 +15497,10 @@ type CreateQuotaData = {
15414
15497
  * enforce blocks with 429 (requests at the middleware, tokens/cost_usd at the pre-generation check); monitor observes without blocking — a breach fires the quota.exceeded webhook and writes a quotas:MonitorBreach audit entry, but the request is let through.
15415
15498
  */
15416
15499
  mode?: 'enforce' | 'monitor';
15500
+ /**
15501
+ * Only for metric cost_usd (400 on any other metric). What an enforce quota does when the current window is a pricing blackout — several metered events, none of them priced, so the aggregate is 0 however much was actually spent. block (the default) refuses new generations with 409 QUOTA_UNENFORCEABLE until pricing is configured; allow accepts the unmeasurable spend explicitly. Either way a quota_unpriced exception is filed. monitor-mode quotas never block regardless.
15502
+ */
15503
+ on_unpriced?: 'block' | 'allow';
15417
15504
  };
15418
15505
  path: {
15419
15506
  /**
@@ -15535,6 +15622,10 @@ type UpdateQuotaData = {
15535
15622
  * New mode
15536
15623
  */
15537
15624
  mode?: 'enforce' | 'monitor';
15625
+ /**
15626
+ * New pricing posture. Only for metric cost_usd (400 on any other metric); see the create operation for what block and allow mean.
15627
+ */
15628
+ on_unpriced?: 'block' | 'allow';
15538
15629
  };
15539
15630
  path: {
15540
15631
  /**
package/dist/index.d.mts CHANGED
@@ -502,15 +502,15 @@ type Agent = {
502
502
  */
503
503
  tool_bindings?: Array<ToolBinding> | null;
504
504
  /**
505
- * Maximum agent loop steps before stopping
505
+ * Maximum agent loop steps before stopping. The budget bounds a **turn**: a generation that pauses at `requires_action` and resumes after `submit-tool-outputs` continues the same turn and spends what is left of it, so a turn that arrives with nothing left completes with `stop_reason: "max_steps"` instead of calling the model again.
506
506
  */
507
507
  max_steps?: number | null;
508
508
  /**
509
- * Tool choice strategy. Accepts a string (`"auto"`, `"required"`) or an object (`{ "type": "tool", "tool_name": "my_tool" }`).
509
+ * Tool choice strategy. Accepts a string (`"auto"`, `"required"`) or an object (`{ "type": "tool", "tool_name": "my_tool" }`). A forcing value (`"required"` or the object form) forbids a final assistant message on every step of every turn, including a resumed or continued one, so it requires a `hasToolCall` entry in `stop_conditions` — otherwise the write is refused with `FORCED_TOOL_CHOICE_CANNOT_STOP`.
510
510
  */
511
511
  tool_choice?: unknown;
512
512
  /**
513
- * Stop conditions
513
+ * Conditions that end the agent's work early, on top of `max_steps` — turn-scoped (`hasToolCall`) or chain-scoped (`maxChainGenerations`). See the create request body for the accepted shapes.
514
514
  */
515
515
  stop_conditions?: Array<{
516
516
  [key: string]: unknown;
@@ -524,7 +524,7 @@ type Agent = {
524
524
  */
525
525
  guardrail_ids?: Array<string> | null;
526
526
  /**
527
- * Per-step overrides
527
+ * Per-step overrides of `tool_choice` and `active_tool_ids`. Steps are numbered from the first step of the **turn**, and that numbering spans a `requires_action` pause — a rule fires once per turn, not once per resumption.
528
528
  */
529
529
  step_rules?: Array<{
530
530
  [key: string]: unknown;
@@ -593,6 +593,10 @@ type Agent = {
593
593
  * Agent-scope zero-retention setting. `null` (the default) inherits the project's `trace_content_mode`; `none` means this agent's trace and generation content is never persisted. An agent may tighten a storing project to `none` but cannot loosen a `none` project back to `full`.
594
594
  */
595
595
  trace_content_mode?: 'full' | 'none' | null;
596
+ /**
597
+ * What happens when one of this agent's held tool calls expires un-approved. `null` (the default) and `terminate` end the chain there — the expired approval, its `approvals.expired` event and the auto-filed `approval_expired` exception are the whole record. `react` spawns a continuation that reports the staleness to the agent, for an agent that acts on it.
598
+ */
599
+ on_approval_expiry?: 'terminate' | 'react' | null;
596
600
  /**
597
601
  * Current config version. Starts at 1 and increments on every write that changes the config; each increment archives the new config as an `AgentVersion`. A write that changes nothing leaves it untouched.
598
602
  */
@@ -642,7 +646,7 @@ type AgentVersion = {
642
646
  */
643
647
  version?: number;
644
648
  /**
645
- * 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`, `guardrail_ids`, `ai_provider_id`, `model_route_id`, `name`), and none of its identity or bookkeeping fields (`id`, `project_id`, `version`, `active_release`, timestamps).
649
+ * 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).
646
650
  *
647
651
  * Deliberately open rather than a fixed schema: an archive written by an earlier release of the runtime 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 memories it resolves keep their own histories and are pinned at generation time.
648
652
  */
@@ -718,9 +722,18 @@ type CreateAgentRequest = {
718
722
  tool_bindings?: Array<ToolBinding>;
719
723
  max_steps?: number;
720
724
  /**
721
- * Tool choice strategy. Accepts a string (`"auto"`, `"required"`) or an object (`{ "type": "tool", "tool_name": "my_tool" }`).
725
+ * Tool choice strategy. Accepts a string (`"auto"`, `"required"`) or an object (`{ "type": "tool", "tool_name": "my_tool" }`). A forcing value (`"required"` or the object form) forbids a final assistant message on every step of every turn, including a resumed or continued one, so it requires a `hasToolCall` entry in `stop_conditions` — otherwise the write is refused with `FORCED_TOOL_CHOICE_CANNOT_STOP`.
722
726
  */
723
727
  tool_choice?: unknown;
728
+ /**
729
+ * Conditions that end the agent's work early, on top of `max_steps`. Two scopes:
730
+ *
731
+ * `{"type": "hasToolCall", "tool_name": "<resolved tool name>"}` ends the **turn** after the step that calls the named tool. It narrows when the loop ends — it never lets it run past `max_steps`.
732
+ *
733
+ * `{"type": "maxChainGenerations", "max_generations": <n>}` bounds the **continuation chain** instead: once the chain has spawned that many generations, further resumptions stop with `chain_limit` rather than extending it. It never shortens a turn. The effective ceiling is the smaller of this and the deployment's `MAX_CONTINUATION_CHAIN_GENERATIONS`, so an agent can be stricter than the platform but never looser.
734
+ *
735
+ * An unknown `type`, a `hasToolCall` without a `tool_name`, a `maxChainGenerations` whose `max_generations` is not a positive integer, or a non-object entry is rejected with 400.
736
+ */
724
737
  stop_conditions?: Array<{
725
738
  [key: string]: unknown;
726
739
  }>;
@@ -787,6 +800,10 @@ type CreateAgentRequest = {
787
800
  * Zero-retention opt-in for this agent. `null` inherits the project's setting; `none` means trace and generation content is never written. Setting `full` under a project whose own mode is `none` is refused with 400 — the project is a floor an agent may only tighten.
788
801
  */
789
802
  trace_content_mode?: 'full' | 'none' | null;
803
+ /**
804
+ * What happens when one of this agent's held tool calls expires un-approved. `null` (the default) and `terminate` end the chain there — the expired approval, its `approvals.expired` event and the auto-filed `approval_expired` exception are the whole record. `react` spawns a continuation that reports the staleness to the agent, for an agent that acts on it.
805
+ */
806
+ on_approval_expiry?: 'terminate' | 'react' | null;
790
807
  /**
791
808
  * Optional tag for the config version this write archives (e.g. `initial`). Annotates the version only — it is not stored on the agent and is not part of the config, so labelling a change is never itself a change.
792
809
  */
@@ -810,9 +827,18 @@ type UpdateAgentRequest = {
810
827
  tool_bindings?: Array<ToolBinding> | null;
811
828
  max_steps?: number | null;
812
829
  /**
813
- * Tool choice strategy. Accepts a string (`"auto"`, `"required"`) or an object (`{ "type": "tool", "tool_name": "my_tool" }`).
830
+ * Tool choice strategy. Accepts a string (`"auto"`, `"required"`) or an object (`{ "type": "tool", "tool_name": "my_tool" }`). A forcing value (`"required"` or the object form) forbids a final assistant message on every step of every turn, including a resumed or continued one, so it requires a `hasToolCall` entry in `stop_conditions` — otherwise the write is refused with `FORCED_TOOL_CHOICE_CANNOT_STOP`.
814
831
  */
815
832
  tool_choice?: unknown;
833
+ /**
834
+ * Conditions that end the agent's work early, on top of `max_steps`. Two scopes:
835
+ *
836
+ * `{"type": "hasToolCall", "tool_name": "<resolved tool name>"}` ends the **turn** after the step that calls the named tool. It narrows when the loop ends — it never lets it run past `max_steps`.
837
+ *
838
+ * `{"type": "maxChainGenerations", "max_generations": <n>}` bounds the **continuation chain** instead: once the chain has spawned that many generations, further resumptions stop with `chain_limit` rather than extending it. It never shortens a turn. The effective ceiling is the smaller of this and the deployment's `MAX_CONTINUATION_CHAIN_GENERATIONS`, so an agent can be stricter than the platform but never looser.
839
+ *
840
+ * An unknown `type`, a `hasToolCall` without a `tool_name`, a `maxChainGenerations` whose `max_generations` is not a positive integer, or a non-object entry is rejected with 400.
841
+ */
816
842
  stop_conditions?: Array<{
817
843
  [key: string]: unknown;
818
844
  }> | null;
@@ -879,6 +905,10 @@ type UpdateAgentRequest = {
879
905
  * Zero-retention opt-in for this agent. `null` inherits the project's setting; `none` means trace and generation content is never written. Setting `full` under a project whose own mode is `none` is refused with 400.
880
906
  */
881
907
  trace_content_mode?: 'full' | 'none' | null;
908
+ /**
909
+ * What happens when one of this agent's held tool calls expires un-approved. `null` (the default) and `terminate` end the chain there — the expired approval, its `approvals.expired` event and the auto-filed `approval_expired` exception are the whole record. `react` spawns a continuation that reports the staleness to the agent, for an agent that acts on it.
910
+ */
911
+ on_approval_expiry?: 'terminate' | 'react' | null;
882
912
  /**
883
913
  * Optional tag for the config version this write archives (e.g. `pre-tone-change`). Annotates the version only — it is not stored on the agent and is not part of the config, so labelling a change is never itself a change. Ignored when the write changes nothing, since no version is created.
884
914
  */
@@ -2443,7 +2473,7 @@ type ExceptionItem = {
2443
2473
  /**
2444
2474
  * How the exception was filed
2445
2475
  */
2446
- kind?: 'run_failed' | 'guardrail_tripwire' | 'approval_expired' | 'quota_unpriced' | 'event_trigger_loop' | 'manual';
2476
+ kind?: 'run_failed' | 'guardrail_tripwire' | 'approval_expired' | 'quota_unpriced' | 'event_trigger_loop' | 'chain_limit' | 'manual';
2447
2477
  /**
2448
2478
  * Human-readable one-line summary
2449
2479
  */
@@ -2659,17 +2689,21 @@ type AgentResourceProperties = {
2659
2689
  */
2660
2690
  tool_choice?: unknown;
2661
2691
  /**
2662
- * Conditions that stop multi-step generation early. The loop stops when any condition is met.
2692
+ * Conditions that stop the agent's work early — turn-scoped (`hasToolCall`) or chain-scoped (`maxChainGenerations`).
2663
2693
  */
2664
2694
  stop_conditions?: Array<{
2665
2695
  /**
2666
- * Condition type — currently `hasToolCall`
2696
+ * Condition type — `hasToolCall` or `maxChainGenerations`
2667
2697
  */
2668
2698
  type?: string;
2669
2699
  /**
2670
2700
  * Tool name to match when type is `hasToolCall`
2671
2701
  */
2672
2702
  tool_name?: string | null;
2703
+ /**
2704
+ * Generations the continuation chain may reach when type is `maxChainGenerations`
2705
+ */
2706
+ max_generations?: number | null;
2673
2707
  }> | null;
2674
2708
  /**
2675
2709
  * Subset of the bound tools that are active
@@ -2736,6 +2770,10 @@ type AgentResourceProperties = {
2736
2770
  * Agent-scope zero-retention setting (`full` or `none`). `null` inherits the project's setting. `full` is refused when the project's own mode is `none`.
2737
2771
  */
2738
2772
  trace_content_mode?: string | null;
2773
+ /**
2774
+ * What happens when a held tool call expires un-approved: `terminate` (the default when null) ends the chain, `react` spawns a continuation that reports the staleness to the agent.
2775
+ */
2776
+ on_approval_expiry?: string | null;
2739
2777
  /**
2740
2778
  * Knowledge retrieval configuration. When set, relevant documents and memory entries are injected into every generation.
2741
2779
  */
@@ -2831,9 +2869,9 @@ type AiProviderResourceProperties = {
2831
2869
  */
2832
2870
  name: string;
2833
2871
  /**
2834
- * Provider type (e.g. openai, anthropic)
2872
+ * Provider type
2835
2873
  */
2836
- provider: string;
2874
+ provider: 'openai' | 'anthropic' | 'google' | 'xai' | 'groq' | 'ollama' | 'azure' | 'bedrock' | 'vertex' | 'gateway' | 'custom';
2837
2875
  /**
2838
2876
  * Default model identifier (e.g. gpt-4o, claude-3-7-sonnet)
2839
2877
  */
@@ -3394,7 +3432,7 @@ type WorkflowResourceProperties = {
3394
3432
  } | null;
3395
3433
  };
3396
3434
  /**
3397
- * Creates a quota — a project-scoped cap that blocks (`enforce`) or reports (`monitor`) when a windowed aggregate is exceeded. `requests` quotas are enforced by the request middleware; `tokens`/`cost_usd` quotas at the pre-generation check. Mirrors the quotas REST contract; `scope`, `metric`, and `window` are immutable after creation (only `limit` and `mode` update).
3435
+ * Creates a quota — a project-scoped cap that blocks (`enforce`) or reports (`monitor`) when a windowed aggregate is exceeded. `requests` quotas are enforced by the request middleware; `tokens`/`cost_usd` quotas at the pre-generation check. Mirrors the quotas REST contract; `scope`, `metric`, and `window` are immutable after creation (only `limit`, `mode`, and `on_unpriced` update).
3398
3436
  */
3399
3437
  type QuotaResourceProperties = {
3400
3438
  /**
@@ -3421,6 +3459,10 @@ type QuotaResourceProperties = {
3421
3459
  * enforce blocks with 429; monitor fires the webhook only
3422
3460
  */
3423
3461
  mode?: 'enforce' | 'monitor';
3462
+ /**
3463
+ * Only for metric cost_usd. What an enforce quota does over a pricing blackout — block (the default) refuses generations with 409 QUOTA_UNENFORCEABLE, allow accepts the unmeasurable spend. See the quotas REST contract.
3464
+ */
3465
+ on_unpriced?: 'block' | 'allow';
3424
3466
  };
3425
3467
  /**
3426
3468
  * Creates a guardrail — an action-class document (`class`/`guard`) that gates tool-call autonomy. Attach it to a tool or agent via that resource's `guardrail_ids` (a `{ "ref": … }` to this resource in the same template resolves to its physical id at deploy time). Mirrors the guardrails REST contract; `class`/`default_class`/`guard`/`escalate` are flattened here from the REST API's single `document` object.
@@ -3677,6 +3719,11 @@ type Generation = {
3677
3719
  *
3678
3720
  */
3679
3721
  initiator_generation_id?: string | null;
3722
+ /**
3723
+ * Public ID of the continuation chain this generation belongs to. Set on every member of a chain — the continuations and the root they descend from — and null on a generation that is not part of one.
3724
+ *
3725
+ */
3726
+ chain_id?: string | null;
3680
3727
  /**
3681
3728
  * Type of the principal that started the generation
3682
3729
  */
@@ -3696,7 +3743,8 @@ type Generation = {
3696
3743
  completed_at?: Date | null;
3697
3744
  last_activity_at?: Date | null;
3698
3745
  /**
3699
- * Why the generation stopped (e.g. 'stop', 'error')
3746
+ * Why the generation stopped. Either the model provider's own finish reason relayed unchanged ('stop', 'tool-calls', 'length', …) or one the platform names itself: 'max_steps' when the turn spent its whole step budget on tool calls, 'depth_guard' when a nested call exceeded the call depth, 'chain_limit' when a continuation chain reached its generation budget, or 'error' when the turn failed.
3747
+ *
3700
3748
  */
3701
3749
  stop_reason?: string | null;
3702
3750
  /**
@@ -3917,6 +3965,10 @@ type GenerationTranscript = {
3917
3965
  *
3918
3966
  */
3919
3967
  status?: 'in_progress' | 'requires_action' | 'completed' | 'failed';
3968
+ /**
3969
+ * Why the generation stopped — the provider's finish reason, or one of the platform's own ('max_steps', 'depth_guard', 'chain_limit', 'error').
3970
+ *
3971
+ */
3920
3972
  stop_reason?: string | null;
3921
3973
  started_at?: Date;
3922
3974
  completed_at?: Date | null;
@@ -3926,7 +3978,7 @@ type GenerationTranscript = {
3926
3978
  */
3927
3979
  step_count?: number;
3928
3980
  /**
3929
- * The messages the turn was asked, as recorded. Message content is caller-owned and passed through verbatim. Null when the content was never stored, has been purged, or predates input recording.
3981
+ * The messages the turn was asked, as recorded. Message content is caller-owned and passed through verbatim. Null when the content was never stored or has been purged.
3930
3982
  *
3931
3983
  */
3932
3984
  input?: Array<{
@@ -4568,6 +4620,10 @@ type OrchestrationNode = {
4568
4620
  * For loop nodes — number of items to process in parallel.
4569
4621
  */
4570
4622
  parallelism?: number;
4623
+ /**
4624
+ * For loop and sub_orchestration nodes — allowlist of the run's `tool_context` keys the child run inherits. When `null` (the default), the child inherits the parent's whole bag — the behavior of every graph authored before this field existed. When set, only the listed keys are handed down, so a run holding a broad credential can delegate one step to a shared sub-graph without passing on what that sub-graph does not need; `[]` hands down nothing. Matching is case-insensitive, since an entry names a key that becomes an HTTP header name; an entry outside that grammar is rejected at write time with `INVALID_TOOL_CONTEXT_KEY`. The server-derived identity keys (`sessionId`, `actorId`, `actorExternalId`) are unaffected — they are re-derived per generation in the child regardless of this list. Ignored for other node types.
4625
+ */
4626
+ context_keys?: Array<string> | null;
4571
4627
  /**
4572
4628
  * For poll nodes — wait between attempts. Accepts a friendly suffix form (`5s`, `30s`, `5m`, `2h`, `500ms`) or ISO 8601 (e.g. PT5S).
4573
4629
  *
@@ -5205,6 +5261,10 @@ type Quota = {
5205
5261
  window?: 'rolling_1m' | 'rolling_1h' | 'rolling_24h' | 'calendar_month';
5206
5262
  limit?: number;
5207
5263
  mode?: 'enforce' | 'monitor';
5264
+ /**
5265
+ * Pricing posture of a cost_usd quota over an unpriced blackout — block refuses generations, allow lets them through (the quota_unpriced exception is filed either way). Null for metrics with no pricing dependency.
5266
+ */
5267
+ on_unpriced?: 'block' | 'allow' | null;
5208
5268
  /**
5209
5269
  * Current fixed-window usage for the requests metric. Null for token/cost quotas (which aggregate the usage meter at check time rather than keeping a counter) and in list responses.
5210
5270
  */
@@ -5786,6 +5846,14 @@ type CallToolRequest = {
5786
5846
  input?: {
5787
5847
  [key: string]: unknown;
5788
5848
  };
5849
+ /**
5850
+ * Key/value context for this call, forwarded to the tool as `X-Naturali-Context-<key>` request headers and resolving any `{{context:<key>}}` token in the tool's `execute.headers`, `mcp.headers` or `preset_parameters`. Narrowed by the tool's `context_keys` allowlist when it sets one.
5851
+ * This route has no session, so it stamps no server-derived identity: the reserved keys `sessionId`, `actorId` and `actorExternalId` are dropped from this bag (in any casing) rather than forwarded, so a downstream tool can still trust that a context header naming one is server-derived. Every other key becomes an HTTP header name and must match that grammar, or the call fails with `INVALID_TOOL_CONTEXT_KEY`.
5852
+ *
5853
+ */
5854
+ tool_context?: {
5855
+ [key: string]: string;
5856
+ };
5789
5857
  };
5790
5858
  type Trace = {
5791
5859
  /**
@@ -8648,7 +8716,7 @@ type ListAuditEntriesData = {
8648
8716
  */
8649
8717
  resource_public_id?: string;
8650
8718
  /**
8651
- * SRN prefix match, e.g. `srn:{project}:secret:`. An entry written before an earlier prefix rename keeps its original SRN (the log is append-only), and an `srn:` prefix matches those too, so history stays reachable.
8719
+ * SRN prefix match, e.g. `srn:{project}:secret:`. The log is append-only, so a stored SRN is never rewritten; the filter matches it as stored.
8652
8720
  */
8653
8721
  resource_srn?: string;
8654
8722
  /**
@@ -8722,7 +8790,7 @@ type ExportAuditEntriesData = {
8722
8790
  */
8723
8791
  resource_public_id?: string;
8724
8792
  /**
8725
- * SRN prefix match, e.g. `srn:{project}:secret:`. An entry written before an earlier prefix rename keeps its original SRN (the log is append-only), and an `srn:` prefix matches those too, so history stays reachable.
8793
+ * SRN prefix match, e.g. `srn:{project}:secret:`. The log is append-only, so a stored SRN is never rewritten; the filter matches it as stored.
8726
8794
  */
8727
8795
  resource_srn?: string;
8728
8796
  /**
@@ -11530,6 +11598,16 @@ type StartEvalRunData = {
11530
11598
  metadata?: {
11531
11599
  [key: string]: unknown;
11532
11600
  };
11601
+ /**
11602
+ * Key/value context forwarded to every item's generation, so an agent whose tools authorize through `tool_context` is scored against the configuration it runs in production rather than with an empty bag. Each key is forwarded as one `X-Naturali-Context-<key>` header and resolves any `{{context:<key>}}` token in a bound tool's headers or `preset_parameters`.
11603
+ *
11604
+ * Stored on the run and re-read per item, since a queued run (the default) is driven by a worker with no request behind it. **Write-only**: no read of the run returns it, unlike `metadata` — a run is a report other people read, and a credential in it is not theirs to see. Cleared once the run reaches a terminal state.
11605
+ *
11606
+ * An eval generation has no session, so the reserved keys `sessionId`, `actorId` and `actorExternalId` are dropped (in any casing) rather than forwarded. Every other key becomes an HTTP header name and must match that grammar, or the request is rejected with `400 INVALID_TOOL_CONTEXT_KEY` and no run is created.
11607
+ */
11608
+ tool_context?: {
11609
+ [key: string]: string;
11610
+ };
11533
11611
  };
11534
11612
  path: {
11535
11613
  /**
@@ -11546,7 +11624,7 @@ type StartEvalRunData = {
11546
11624
  };
11547
11625
  type StartEvalRunErrors = {
11548
11626
  /**
11549
- * Bad request (non-boolean wait, dataset empty or over the synchronous cap, unknown agent_version, invalid baseline, scorers no longer valid against the agent)
11627
+ * Bad request (non-boolean wait, dataset empty or over the synchronous cap, unknown agent_version, invalid baseline, scorers no longer valid against the agent, a `tool_context` key that cannot become a header)
11550
11628
  */
11551
11629
  400: unknown;
11552
11630
  /**
@@ -11735,7 +11813,7 @@ type ListExceptionsData = {
11735
11813
  /**
11736
11814
  * Filter by how the exception was filed
11737
11815
  */
11738
- kind?: 'run_failed' | 'guardrail_tripwire' | 'approval_expired' | 'quota_unpriced' | 'event_trigger_loop' | 'manual';
11816
+ kind?: 'run_failed' | 'guardrail_tripwire' | 'approval_expired' | 'quota_unpriced' | 'event_trigger_loop' | 'chain_limit' | 'manual';
11739
11817
  /**
11740
11818
  * Maximum number of results to return
11741
11819
  */
@@ -12777,6 +12855,11 @@ type ListGenerationsData = {
12777
12855
  *
12778
12856
  */
12779
12857
  initiator_generation_id?: string;
12858
+ /**
12859
+ * Filter by the continuation chain the generation belongs to. This is how a chain is expanded into its members — the chain record carries only their count.
12860
+ *
12861
+ */
12862
+ chain_id?: string;
12780
12863
  /**
12781
12864
  * Filter by the orchestration run that dispatched the generation. This is how a run is traced back to what its agent nodes did — a node execution record stores no generation id.
12782
12865
  *
@@ -15414,6 +15497,10 @@ type CreateQuotaData = {
15414
15497
  * enforce blocks with 429 (requests at the middleware, tokens/cost_usd at the pre-generation check); monitor observes without blocking — a breach fires the quota.exceeded webhook and writes a quotas:MonitorBreach audit entry, but the request is let through.
15415
15498
  */
15416
15499
  mode?: 'enforce' | 'monitor';
15500
+ /**
15501
+ * Only for metric cost_usd (400 on any other metric). What an enforce quota does when the current window is a pricing blackout — several metered events, none of them priced, so the aggregate is 0 however much was actually spent. block (the default) refuses new generations with 409 QUOTA_UNENFORCEABLE until pricing is configured; allow accepts the unmeasurable spend explicitly. Either way a quota_unpriced exception is filed. monitor-mode quotas never block regardless.
15502
+ */
15503
+ on_unpriced?: 'block' | 'allow';
15417
15504
  };
15418
15505
  path: {
15419
15506
  /**
@@ -15535,6 +15622,10 @@ type UpdateQuotaData = {
15535
15622
  * New mode
15536
15623
  */
15537
15624
  mode?: 'enforce' | 'monitor';
15625
+ /**
15626
+ * New pricing posture. Only for metric cost_usd (400 on any other metric); see the create operation for what block and allow mean.
15627
+ */
15628
+ on_unpriced?: 'block' | 'allow';
15538
15629
  };
15539
15630
  path: {
15540
15631
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/sdk",
3
- "version": "0.85.1",
3
+ "version": "0.85.2",
4
4
  "description": "TypeScript SDK for the naturali.ai API, generated from its OpenAPI specs",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -37,7 +37,7 @@
37
37
  "tsx": "^4.23.1",
38
38
  "typescript": "~6.0.3",
39
39
  "vitest": "^4.1.10",
40
- "@naturali/api": "0.85.1"
40
+ "@naturali/api": "0.85.2"
41
41
  },
42
42
  "scripts": {
43
43
  "generate": "tsx scripts/generate.ts",