@naturali/cli 0.268.0 → 0.270.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.
Files changed (2) hide show
  1. package/dist/index.mjs +139 -48
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -17,7 +17,7 @@ var __exportAll = (all, no_symbols) => {
17
17
  };
18
18
  //#endregion
19
19
  //#region package.json
20
- var version = "0.268.0";
20
+ var version = "0.270.0";
21
21
  //#endregion
22
22
  //#region ../sdk/src/generated/core/bodySerializer.gen.ts
23
23
  const serializeFormDataPair = (data, key, value) => {
@@ -859,7 +859,7 @@ var Channels = class {
859
859
  /**
860
860
  * Create a route
861
861
  *
862
- * `action` is required; `agent_id` is required when it is `agent`, `text` when it is `message`; `repeat` is only valid alongside `action: message`. `surface`, when present, must be one this channel's kind serves (`GET /v1/channel-kinds`) — otherwise `400 unknown_surface`. `match` keys must be predicates that kind's registry declares — otherwise `400 unknown_predicate`. Writing a route for a surface whose transport mode is off (e.g. a Discord `guild_thread` route before `mention_threads` is enabled) still succeeds, with `unreachable_surface` in the response `warnings`.
862
+ * `action` is required; `agent_id` is required when it is `agent`, `text` when it is `message`; `repeat` is only valid alongside `action: message`. `surface`, when present, must be one this channel's kind serves (`GET /v1/channel-kinds`) — otherwise `400 UNKNOWN_SURFACE`. `match` keys must be predicates that kind's registry declares — otherwise `400 UNKNOWN_PREDICATE`. Writing a route for a surface whose transport mode is off (e.g. a Discord `guild_thread` route before `mention_threads` is enabled) still succeeds, with `unreachable_surface` in the response `warnings`.
863
863
  *
864
864
  */
865
865
  static createChannelRoute(options) {
@@ -899,7 +899,7 @@ var Channels = class {
899
899
  /**
900
900
  * Replace a route
901
901
  *
902
- * Full replace, the same validation as create: an omitted field takes its create default. Where that default would widen a value the route sets, omission is `400 replace_omits_fields`, naming the fields in `details.fields`, and nothing is written: a set `surface` (the default is any surface), a non-empty `match` (every message), a non-empty `config` (it carries the Discord allowlist), and `status` on a `disabled` route (the default re-activates it). Send the value to keep it, or `"surface": null`, `"match": {}`, `"config": null`, `"status": "active"` to clear it.
902
+ * Full replace, the same validation as create: an omitted field takes its create default. Where that default would widen a value the route sets, omission is `400 REPLACE_OMITS_FIELDS`, naming the fields in `meta.fields`, and nothing is written: a set `surface` (the default is any surface), a non-empty `match` (every message), a non-empty `config` (it carries the Discord allowlist), and `status` on a `disabled` route (the default re-activates it). Send the value to keep it, or `"surface": null`, `"match": {}`, `"config": null`, `"status": "active"` to clear it.
903
903
  *
904
904
  */
905
905
  static replaceChannelRoute(options) {
@@ -939,17 +939,17 @@ var Channels = class {
939
939
  * Connect a channel
940
940
  *
941
941
  * Connect a channel. The required fields depend on `channel`; no credential is ever returned.
942
- * **Discord** (`channel: discord`) — supply `application_id` and `bot_token`, plus the `modes` selecting which Gateway flows to serve (direct messages, and/or @mention-opens-a-thread). The token is checked with Discord first: `400 invalid_bot_token` when Discord rejects it, `400 application_mismatch` when it belongs to another application, `502 discord_unavailable` when Discord cannot be read. Returns `501` when this deployment does not enable Discord channels.
943
- * **X** (`channel: x`) — supply the bot's `bot_token` (X developer portal, Chat bots) and the `consumer_key` and `consumer_secret` of the app that issued it. naturali then registers its own webhook on that app, subscribes it to the bot's incoming direct messages and registers the bot's chat encryption key, keeping the private key sealed: replies are end-to-end encrypted, and the project never handles keys, webhooks or ciphertext. Pass `chat_private_keys` and `chat_key_version` instead to keep a key the bot already registered. `400 invalid_bot_token` or `400 invalid_consumer_credentials` when X rejects a credential, `409 bot_in_use` when another channel holds the bot, `502 x_provisioning_failed` when X refuses the webhook or the subscription (an app holds a limited number of webhooks), `429 x_key_registration_limited` when the bot used its few daily key registrations, `502 x_unavailable` when X cannot be reached. Returns `501` when this deployment does not enable X channels.
942
+ * **Discord** (`channel: discord`) — supply `application_id` and `bot_token`, plus the `modes` selecting which Gateway flows to serve (direct messages, and/or @mention-opens-a-thread). The token is checked with Discord first: `400 INVALID_BOT_TOKEN` when Discord rejects it, `400 APPLICATION_MISMATCH` when it belongs to another application, `502 DISCORD_UNAVAILABLE` when Discord cannot be read. Returns `501` when this deployment does not enable Discord channels.
943
+ * **X** (`channel: x`) — supply the bot's `bot_token` (X developer portal, Chat bots) and the `consumer_key` and `consumer_secret` of the app that issued it. naturali then registers its own webhook on that app, subscribes it to the bot's incoming direct messages and registers the bot's chat encryption key, keeping the private key sealed: replies are end-to-end encrypted, and the project never handles keys, webhooks or ciphertext. Pass `chat_private_keys` and `chat_key_version` instead to keep a key the bot already registered. `400 INVALID_BOT_TOKEN` or `400 INVALID_CONSUMER_CREDENTIALS` when X rejects a credential, `409 BOT_IN_USE` when another channel holds the bot, `502 X_PROVISIONING_FAILED` when X refuses the webhook or the subscription (an app holds a limited number of webhooks), `429 X_KEY_REGISTRATION_LIMITED` when the bot used its few daily key registrations, `502 X_UNAVAILABLE` when X cannot be reached. Returns `501` when this deployment does not enable X channels.
944
944
  * **WhatsApp** (default) — one of two credential paths, both filling the same write-only secret:
945
945
  * * **BYOT** (`credential_source: byot`, default) — supply
946
946
  * `phone_number_id` and `access_token` from your own Meta app. The
947
- * number is read with the token first: `400 invalid_access_token` when
948
- * Meta rejects the token, `400 phone_number_not_accessible` when it
949
- * cannot reach that number, `502 meta_unavailable` when Meta fails.
947
+ * number is read with the token first: `400 INVALID_ACCESS_TOKEN` when
948
+ * Meta rejects the token, `400 PHONE_NUMBER_NOT_ACCESSIBLE` when it
949
+ * cannot reach that number, `502 META_UNAVAILABLE` when Meta fails.
950
950
  * The token's app is then subscribed to the WABA Meta reports as the
951
951
  * number's owner, which is the `waba_id` stored:
952
- * `400 waba_not_manageable` when the token cannot subscribe to it.
952
+ * `400 WABA_NOT_MANAGEABLE` when the token cannot subscribe to it.
953
953
  *
954
954
  * * **Embedded signup** (`credential_source: embedded_signup`) — supply
955
955
  * `code` and `waba_id` from the Meta popup; naturali exchanges the
@@ -959,7 +959,7 @@ var Channels = class {
959
959
  * are not configured.
960
960
  *
961
961
  *
962
- * The project's plan limits how many channels it may hold. At the limit this responds `403` with `plan_limit_reached`, whose `details` carry the `plan` and the `limit`, before any credential is acquired. Only `active` channels count, so disabling one frees allowance without deleting it.
962
+ * The project's plan limits how many channels it may hold. At the limit this responds `403` with `PLAN_LIMIT_REACHED`, whose `meta` carries the `plan` and the `limit`, before any credential is acquired. Only `active` channels count, so disabling one frees allowance without deleting it.
963
963
  *
964
964
  */
965
965
  static createChannel(options) {
@@ -991,7 +991,7 @@ var Channels = class {
991
991
  /**
992
992
  * Complete a WhatsApp signup
993
993
  *
994
- * Finish a signup link: the app's result page receives `pending` and the numbers Meta granted, and sends back the one to connect. The caller must be a member of the project the link was created for (`404` otherwise), so a link opened by anyone else connects nothing. `pending` expires 10 minutes after the dialog returns (`400 link_expired`).
994
+ * Finish a signup link: the app's result page receives `pending` and the numbers Meta granted, and sends back the one to connect. The caller must be a member of the project the link was created for (`404` otherwise), so a link opened by anyone else connects nothing. `pending` expires 10 minutes after the dialog returns (`400 LINK_EXPIRED`).
995
995
  *
996
996
  */
997
997
  static completeWhatsappSignup(options) {
@@ -1031,7 +1031,7 @@ var Channels = class {
1031
1031
  /**
1032
1032
  * Update a channel
1033
1033
  *
1034
- * Rotate the credential, update the kind's config (`waba_id` / `credential_source` for WhatsApp, `modes` for Discord), or flip the naturali-side status. At least one field is required. Rotating a WhatsApp token first reads the number with it, as connect does (`400 invalid_access_token`, `400 phone_number_not_accessible`, `502 meta_unavailable`, keeping the old token), then stores a new write-only secret, repoints the send tool and deletes the old secret; rotating a Discord bot token reseals it and the gateway worker reconnects with it.
1034
+ * Rotate the credential, update the kind's config (`waba_id` / `credential_source` for WhatsApp, `modes` for Discord), or flip the naturali-side status. At least one field is required. Rotating a WhatsApp token first reads the number with it, as connect does (`400 INVALID_ACCESS_TOKEN`, `400 PHONE_NUMBER_NOT_ACCESSIBLE`, `502 META_UNAVAILABLE`, keeping the old token), then stores a new write-only secret, repoints the send tool and deletes the old secret; rotating a Discord bot token reseals it and the gateway worker reconnects with it.
1035
1035
  *
1036
1036
  */
1037
1037
  static updateChannel(options) {
@@ -3520,7 +3520,7 @@ var Generations = class {
3520
3520
  *
3521
3521
  * The transcript is assembled at read time from the generation record and the trace's steps object; nothing is stored, so it cannot outlive the content it projects. Requires `traces:GetTrace` in addition to `generations:GetGeneration`, because the response merges content from both resources.
3522
3522
  *
3523
- * A generation whose content is unavailable — never written under zero-retention, or cleared by a purge — returns `200` with the skeleton rather than an error: `input` and `output` are null, `steps` is empty, and the `content_redacted_*` fields say which happened. `content_redacted_by_principal_id` is `zero_retention` when the content was never stored, and the purging principal's ID when it was erased later. A generation that is still running returns the same shape with an empty `steps`; `status` disambiguates the two.
3523
+ * A generation whose content is unavailable — never written under zero-retention, or cleared by a purge — returns `200` with the skeleton rather than an error: `input` and `output` are null, `steps` is empty, and the `content_redacted_*` fields say which happened. `content_redacted_by_principal_id` is `zero_retention` when the content was never stored, and the purging principal's ID when it was erased later. A generation that is still running returns the steps it has ended so far and its `in_flight_tool_calls`; `status` says it runs. To follow it as it runs, read `GET /v1/projects/{project_id}/generations/{generation_id}/events`.
3524
3524
  *
3525
3525
  */
3526
3526
  static getGenerationTranscript(options) {
@@ -3529,6 +3529,22 @@ var Generations = class {
3529
3529
  ...options
3530
3530
  });
3531
3531
  }
3532
+ /**
3533
+ * List a generation's events
3534
+ *
3535
+ * The generation's transcript, incrementally: its progress rows in `seq` order, after `after_seq`. Each `generations.step_ended` row carries the step it ended as a `TranscriptStep`; the other rows say when a step or a tool call started and ended, and which generation a tool call started.
3536
+ *
3537
+ * Step content and tool names are the trace's content: reading them needs `traces:GetTrace` on the generation's trace beside `generations:GetGeneration`, and is refused with `403` without it. `progress_only=true` asks for the rows alone (`step` is null), which `generations:GetGeneration` alone allows. Content is re-read on every page: once a purge erases it, or under zero-retention, `step` is null.
3538
+ *
3539
+ * `stream=true` answers `text/event-stream` instead and follows the generation until it settles (`completed`, `failed` or `requires_action`), or stops running without a settle row. Each row is one `event: progress` frame whose `id` is its `seq`; the stream ends with `data: [DONE]`. A `: heartbeat` comment is sent every 15 seconds. After 5 minutes the stream ends with `event: end` and `data: {"reason": "max_lifetime", "generation_id": "...", "after_seq": N}`: reconnect with that `after_seq`, or let an `EventSource` reconnect with its `Last-Event-ID` header, which this route reads as `after_seq`. Every reconnect is authorized afresh.
3540
+ *
3541
+ */
3542
+ static listGenerationEvents(options) {
3543
+ return (options.client ?? client).get({
3544
+ url: "/v1/projects/{project_id}/generations/{generation_id}/events",
3545
+ ...options
3546
+ });
3547
+ }
3532
3548
  };
3533
3549
  var Guardrails = class {
3534
3550
  /**
@@ -5194,7 +5210,7 @@ var Projects = class {
5194
5210
  *
5195
5211
  * Creates a project (one per client or per environment).
5196
5212
  *
5197
- * Your plan limits how many projects you may own. At the limit this responds `403` with `plan_limit_reached`, whose `details` carry the `plan` and the `limit`. An archived project still counts — archiving keeps every resource, so it frees nothing; deleting a project does.
5213
+ * Your plan limits how many projects you may own. At the limit this responds `403` with `PLAN_LIMIT_REACHED`, whose `meta` carries the `plan` and the `limit`. An archived project still counts — archiving keeps every resource, so it frees nothing; deleting a project does.
5198
5214
  *
5199
5215
  * A new project starts at the content-retention window your plan sets (`trace_content_retention_days`); `PATCH` it to anything shorter.
5200
5216
  *
@@ -5242,11 +5258,11 @@ var Projects = class {
5242
5258
  * Rename or archive a project, and/or change its content-retention settings (`trace_content_retention_days`, `trace_content_mode`), its execution ceilings (`max_concurrent_runs`, `max_chain_generations`, `max_orchestration_run_depth`), its priced-model gate (`require_priced_model`), its project-scope guardrails (`guardrail_ids`), the policies capping every agent turn in it (`agent_policy_ids`), the tag keys a change of agent-readable text removes (`content_bound_tag_keys`) and managed conversion (`managed_conversion`). Archiving is reversible; resources are retained.
5243
5259
  * Requires the `admin` role in the project (an `owner` has it too). These are the terms every member works under, which is why setting them sits above the role that works under them.
5244
5260
  * The ceilings and the priced-model gate are uncapped by plan: each one only ever narrows what the project may spend, so setting one takes on a restriction rather than claiming an entitlement. On the three ceilings `null` clears the project's own bound and omission leaves it alone — they are different instructions.
5245
- * `guardrail_ids` is the floor under every tool call by every agent in the project, including tools added later. The list is replaced wholesale, so send the ids you want to keep; `[]` detaches every one. An id naming no guardrail in the project responds `400` with `guardrail_not_found`, whose `details.missing` lists the ids. It is uncapped by plan, like the ceilings: a guardrail can only tighten what runs.
5261
+ * `guardrail_ids` is the floor under every tool call by every agent in the project, including tools added later. The list is replaced wholesale, so send the ids you want to keep; `[]` detaches every one. An id naming no guardrail in the project responds `400` with `GUARDRAIL_NOT_FOUND`, whose `meta.missing` lists the ids. It is uncapped by plan, like the ceilings: a guardrail can only tighten what runs.
5246
5262
  * `agent_policy_ids` caps every turn of every agent the project owns: an action they deny is refused even where the agent's own `policy_ids` allow it, and the refusal's `meta.denied_by` is `{ type: project, id: <project_id> }`. `null` or `[]` removes the cap. The credential must hold every grant the policies carry, else `403` with `POLICY_GRANT_NOT_HELD`; an id naming no policy responds `400` with `POLICY_NOT_FOUND`, and a policy of another project `400` with `POLICY_OUTSIDE_PROJECT`.
5247
5263
  * The two retention controls answer different questions. The window bounds how long content *stays* — a daily sweep purges anything past it, leaving auditable skeletons behind. `trace_content_mode: none` means content is never *written*, which is the stronger guarantee: it cannot be missed by a sweep or survive in a backup.
5248
5264
  *
5249
- * Your plan sets the longest window you may keep content for. A wider one — `null` included, which keeps content indefinitely — responds `403` with `plan_limit_reached`, whose `details` carry the `plan` and the `limit` in days. Anything shorter is always allowed. Moving to a plan with a shorter window takes effect at the end of the billing cycle, and content already stored is then purged by age like everything else.
5265
+ * Your plan sets the longest window you may keep content for. A wider one — `null` included, which keeps content indefinitely — responds `403` with `PLAN_LIMIT_REACHED`, whose `meta` carries the `plan` and the `limit` in days. Anything shorter is always allowed. Moving to a plan with a shorter window takes effect at the end of the billing cycle, and content already stored is then purged by age like everything else.
5250
5266
  *
5251
5267
  */
5252
5268
  static updateProject(options) {
@@ -5412,7 +5428,7 @@ var Projects = class {
5412
5428
  *
5413
5429
  * Makes the caller — the member the transfer names — the project's owner.
5414
5430
  *
5415
- * Usage up to this moment is settled on the previous owner's credit; from here on the project's usage is billed to the caller, and its runs count against the caller's allowance. The project counts toward the caller's plan limits at once: its active channels and triggers, and on Free the project itself. A transfer the caller's plan cannot hold is refused with `403 plan_limit_reached`, and the project's retention window is brought within the caller's plan.
5431
+ * Usage up to this moment is settled on the previous owner's credit; from here on the project's usage is billed to the caller, and its runs count against the caller's allowance. The project counts toward the caller's plan limits at once: its active channels and triggers, and on Free the project itself. A transfer the caller's plan cannot hold is refused with `403 PLAN_LIMIT_REACHED`, and the project's retention window is brought within the caller's plan.
5416
5432
  *
5417
5433
  * The previous owner stays in the project as an `admin`. Stops recorded against the project's spend move to the caller. Refused to a connected app.
5418
5434
  *
@@ -5731,7 +5747,7 @@ var Sessions = class {
5731
5747
  /**
5732
5748
  * Trigger agent generation
5733
5749
  *
5734
- * Triggers the agent to generate a response based on the current conversation. Background by default: returns `202 Accepted` with the generation's id once its record exists. Pass ?wait=true to block and receive the assistant reply (or a requires_action status if the agent needs client tool outputs) in the response.
5750
+ * Triggers the agent to generate a response based on the current conversation. Background by default: returns `202 Accepted` with the generation's id once its record exists. Pass ?wait=true to block and receive the assistant reply (or a requires_action status if the agent needs client tool outputs) in the response. Pass `stream: true` in the body to receive the turn's events as SSE, one frame per step and tool call, until it settles; `stream: true` with `?wait=false` is `400`.
5735
5751
  *
5736
5752
  */
5737
5753
  static generateSessionResponse(options) {
@@ -6369,7 +6385,7 @@ var Users = class {
6369
6385
  *
6370
6386
  * The plan the account is on, how long its projects may keep content, how much indexed storage it is holding, and the credit it has left — the figures the platform already enforces against, readable by the account they are enforced against.
6371
6387
  *
6372
- * A managed-model generation is refused with `402 insufficient_credit` while `credit_balance_usd` is negative, and a feature or a resource count outside the plan is refused with `403`, as is a retention window wider than `retention_days` or an ingest past `storage.limit`. Every refusal names what is missing; this is where the numbers behind them are read.
6388
+ * A managed-model generation is refused with `402 INSUFFICIENT_CREDIT` while `credit_balance_usd` is negative, and a feature or a resource count outside the plan is refused with `403`, as is a retention window wider than `retention_days` or an ingest past `storage.limit`. Every refusal names what is missing; this is where the numbers behind them are read.
6373
6389
  *
6374
6390
  * Every figure here is a local read, which is what keeps this route cheap enough to poll — unlike `GET /v1/users/me/usage`, which asks the meter once per project.
6375
6391
  *
@@ -6391,7 +6407,7 @@ var Users = class {
6391
6407
  *
6392
6408
  * Counted across the projects this account is the billing owner of, over the current UTC calendar month, from the meter itself. Archived projects are included: the runs they already made were made.
6393
6409
  *
6394
- * **On the `free` plan the allowance is enforced.** An account that has used it is refused `403 plan_limit_reached` with `resource: "runs"` on everything that starts a generation and on a direct tool call — on its own provider credential as much as on a managed model, because a run is a run — until the billing month turns or it upgrades. On `pro` and `business` nothing is refused: runs past the allowance are billed at the overage rate those plans are sold with. A contract plan is not counted.
6410
+ * **On the `free` plan the allowance is enforced.** An account that has used it is refused `403 PLAN_LIMIT_REACHED` with `resource: "runs"` on everything that starts a generation and on a direct tool call — on its own provider credential as much as on a managed model, because a run is a run — until the billing month turns or it upgrades. On `pro` and `business` nothing is refused: runs past the allowance are billed at the overage rate those plans are sold with. A contract plan is not counted.
6395
6411
  *
6396
6412
  * The other thing that stops a managed-model generation is a negative credit balance, which is `GET /v1/users/me/billing`, and it never applies to your own credential.
6397
6413
  *
@@ -6439,7 +6455,7 @@ var Users = class {
6439
6455
  *
6440
6456
  * Turns one stopped item back on — re-enables the schedule trigger, or resumes the orchestration run or workflow task — and stops listing it. An item that is no longer stopped (resumed already, finished or deleted) is marked restored too.
6441
6457
  *
6442
- * Refused with `409 stop_ceiling_closed` while a ceiling is still closed, naming it in `details.blocked_by`, and with `409 stop_not_restorable` for a cancelled eval run, which can only be dismissed.
6458
+ * Refused with `409 STOP_CEILING_CLOSED` while a ceiling is still closed, naming it in `meta.blocked_by`, and with `409 STOP_NOT_RESTORABLE` for a cancelled eval run, which can only be dismissed.
6443
6459
  *
6444
6460
  */
6445
6461
  static restoreCurrentUserStop(options) {
@@ -6632,7 +6648,7 @@ var Webhooks = class {
6632
6648
  *
6633
6649
  * Register an endpoint and subscribe it to one or more event types.
6634
6650
  * The response carries `secret` — the signing key, in plaintext. **This is the only time it is returned.** Store it where your receiver can read it; if you lose it, rotate rather than re-create, so the endpoint keeps its delivery history. Send `secret` yourself to sign with a key your receiver already holds; the response then returns that one.
6635
- * A project holds at most 20 webhooks, inactive ones included; the 21st is refused with `409 webhook_limit_reached`.
6651
+ * A project holds at most 20 webhooks, inactive ones included; the 21st is refused with `409 WEBHOOK_LIMIT_REACHED`.
6636
6652
  * Returns `501` on a deployment with no credential-sealing key configured, since the secret could not then be stored safely.
6637
6653
  *
6638
6654
  */
@@ -6731,7 +6747,7 @@ var Webhooks = class {
6731
6747
  *
6732
6748
  * Queue the same event at the same endpoint again — the recovery path for a delivery that failed, or one your receiver dropped. This is the `…:redeliver` action; the path segment is `{delivery_id}:redeliver`.
6733
6749
  * A **new** delivery is created and returned; the original record is left untouched, because its attempt history is the evidence you redelivered on. The event's `id` is carried over unchanged, so a receiver deduping on the event sees the same event twice while one deduping on `X-Naturali-Delivery` sees a distinct delivery.
6734
- * An inactive webhook is refused with `409 webhook_inactive`.
6750
+ * An inactive webhook is refused with `409 WEBHOOK_INACTIVE`.
6735
6751
  *
6736
6752
  */
6737
6753
  static redeliverWebhookDelivery(options) {
@@ -11217,7 +11233,7 @@ const routes = {
11217
11233
  "create-channel-route": {
11218
11234
  serviceClass: "Channels",
11219
11235
  operationId: "createChannelRoute",
11220
- description: "`action` is required; `agent_id` is required when it is `agent`, `text` when it is `message`; `repeat` is only valid alongside `action: message`. `surface`, when present, must be one this channel's kind serves (`GET /v1/channel-kinds`) — otherwise `400 unknown_surface`. `match` keys must be predicates that kind's registry declares — otherwise `400 unknown_predicate`. Writing a route for a surface whose transport mode is off (e.g. a Discord `guild_thread` route before `mention_threads` is enabled) still succeeds, with `unreachable_surface` in the response `warnings`.",
11236
+ description: "`action` is required; `agent_id` is required when it is `agent`, `text` when it is `message`; `repeat` is only valid alongside `action: message`. `surface`, when present, must be one this channel's kind serves (`GET /v1/channel-kinds`) — otherwise `400 UNKNOWN_SURFACE`. `match` keys must be predicates that kind's registry declares — otherwise `400 UNKNOWN_PREDICATE`. Writing a route for a surface whose transport mode is off (e.g. a Discord `guild_thread` route before `mention_threads` is enabled) still succeeds, with `unreachable_surface` in the response `warnings`.",
11221
11237
  moduleDocsUrl: "https://naturali.ai/docs/modules/channel-routes",
11222
11238
  httpMethod: "post",
11223
11239
  pathParams: ["project_id", "channel_id"],
@@ -11352,7 +11368,7 @@ const routes = {
11352
11368
  "replace-channel-route": {
11353
11369
  serviceClass: "Channels",
11354
11370
  operationId: "replaceChannelRoute",
11355
- description: "Full replace, the same validation as create: an omitted field takes its create default. Where that default would widen a value the route sets, omission is `400 replace_omits_fields`, naming the fields in `details.fields`, and nothing is written: a set `surface` (the default is any surface), a non-empty `match` (every message), a non-empty `config` (it carries the Discord allowlist), and `status` on a `disabled` route (the default re-activates it). Send the value to keep it, or `\"surface\": null`, `\"match\": {}`, `\"config\": null`, `\"status\": \"active\"` to clear it.",
11371
+ description: "Full replace, the same validation as create: an omitted field takes its create default. Where that default would widen a value the route sets, omission is `400 REPLACE_OMITS_FIELDS`, naming the fields in `meta.fields`, and nothing is written: a set `surface` (the default is any surface), a non-empty `match` (every message), a non-empty `config` (it carries the Discord allowlist), and `status` on a `disabled` route (the default re-activates it). Send the value to keep it, or `\"surface\": null`, `\"match\": {}`, `\"config\": null`, `\"status\": \"active\"` to clear it.",
11356
11372
  moduleDocsUrl: "https://naturali.ai/docs/modules/channel-routes",
11357
11373
  httpMethod: "patch",
11358
11374
  pathParams: [
@@ -11550,7 +11566,7 @@ const routes = {
11550
11566
  "create-channel": {
11551
11567
  serviceClass: "Channels",
11552
11568
  operationId: "createChannel",
11553
- description: "Connect a channel. The required fields depend on `channel`; no credential is ever returned. **Discord** (`channel: discord`) — supply `application_id` and `bot_token`, plus the `modes` selecting which Gateway flows to serve (direct messages, and/or @mention-opens-a-thread). The token is checked with Discord first: `400 invalid_bot_token` when Discord rejects it, `400 application_mismatch` when it belongs to another application, `502 discord_unavailable` when Discord cannot be read. Returns `501` when this deployment does not enable Discord channels. **X** (`channel: x`) — supply the bot's `bot_token` (X developer portal, Chat bots) and the `consumer_key` and `consumer_secret` of the app that issued it. naturali then registers its own webhook on that app, subscribes it to the bot's incoming direct messages and registers the bot's chat encryption key, keeping the private key sealed: replies are end-to-end encrypted, and the project never handles keys, webhooks or ciphertext. Pass `chat_private_keys` and `chat_key_version` instead to keep a key the bot already registered. `400 invalid_bot_token` or `400 invalid_consumer_credentials` when X rejects a credential, `409 bot_in_use` when another channel holds the bot, `502 x_provisioning_failed` when X refuses the webhook or the subscription (an app holds a limited number of webhooks), `429 x_key_registration_limited` when the bot used its few daily key registrations, `502 x_unavailable` when X cannot be reached. Returns `501` when this deployment does not enable X channels. **WhatsApp** (default) — one of two credential paths, both filling the same write-only secret: * **BYOT** (`credential_source: byot`, default) — supply `phone_number_id` and `access_token` from your own Meta app. The number is read with the token first: `400 invalid_access_token` when Meta rejects the token, `400 phone_number_not_accessible` when it cannot reach that number, `502 meta_unavailable` when Meta fails. The token's app is then subscribed to the WABA Meta reports as the number's owner, which is the `waba_id` stored: `400 waba_not_manageable` when the token cannot subscribe to it. * **Embedded signup** (`credential_source: embedded_signup`) — supply `code` and `waba_id` from the Meta popup; naturali exchanges the `code` for the token, subscribes its app to the WABA and registers the number for sending when it is not yet, so the customer never hands over a token. Returns `501` on deployments where Meta App credentials are not configured. The project's plan limits how many channels it may hold. At the limit this responds `403` with `plan_limit_reached`, whose `details` carry the `plan` and the `limit`, before any credential is acquired. Only `active` channels count, so disabling one frees allowance without deleting it.",
11569
+ description: "Connect a channel. The required fields depend on `channel`; no credential is ever returned. **Discord** (`channel: discord`) — supply `application_id` and `bot_token`, plus the `modes` selecting which Gateway flows to serve (direct messages, and/or @mention-opens-a-thread). The token is checked with Discord first: `400 INVALID_BOT_TOKEN` when Discord rejects it, `400 APPLICATION_MISMATCH` when it belongs to another application, `502 DISCORD_UNAVAILABLE` when Discord cannot be read. Returns `501` when this deployment does not enable Discord channels. **X** (`channel: x`) — supply the bot's `bot_token` (X developer portal, Chat bots) and the `consumer_key` and `consumer_secret` of the app that issued it. naturali then registers its own webhook on that app, subscribes it to the bot's incoming direct messages and registers the bot's chat encryption key, keeping the private key sealed: replies are end-to-end encrypted, and the project never handles keys, webhooks or ciphertext. Pass `chat_private_keys` and `chat_key_version` instead to keep a key the bot already registered. `400 INVALID_BOT_TOKEN` or `400 INVALID_CONSUMER_CREDENTIALS` when X rejects a credential, `409 BOT_IN_USE` when another channel holds the bot, `502 X_PROVISIONING_FAILED` when X refuses the webhook or the subscription (an app holds a limited number of webhooks), `429 X_KEY_REGISTRATION_LIMITED` when the bot used its few daily key registrations, `502 X_UNAVAILABLE` when X cannot be reached. Returns `501` when this deployment does not enable X channels. **WhatsApp** (default) — one of two credential paths, both filling the same write-only secret: * **BYOT** (`credential_source: byot`, default) — supply `phone_number_id` and `access_token` from your own Meta app. The number is read with the token first: `400 INVALID_ACCESS_TOKEN` when Meta rejects the token, `400 PHONE_NUMBER_NOT_ACCESSIBLE` when it cannot reach that number, `502 META_UNAVAILABLE` when Meta fails. The token's app is then subscribed to the WABA Meta reports as the number's owner, which is the `waba_id` stored: `400 WABA_NOT_MANAGEABLE` when the token cannot subscribe to it. * **Embedded signup** (`credential_source: embedded_signup`) — supply `code` and `waba_id` from the Meta popup; naturali exchanges the `code` for the token, subscribes its app to the WABA and registers the number for sending when it is not yet, so the customer never hands over a token. Returns `501` on deployments where Meta App credentials are not configured. The project's plan limits how many channels it may hold. At the limit this responds `403` with `PLAN_LIMIT_REACHED`, whose `meta` carries the `plan` and the `limit`, before any credential is acquired. Only `active` channels count, so disabling one frees allowance without deleting it.",
11554
11570
  moduleDocsUrl: "https://naturali.ai/docs/modules/channels",
11555
11571
  httpMethod: "post",
11556
11572
  pathParams: ["project_id"],
@@ -11567,7 +11583,7 @@ const routes = {
11567
11583
  },
11568
11584
  {
11569
11585
  "name": "idempotency_key",
11570
- "description": "Deduplication key, unique within your account, that makes a retry of an ambiguous failure safe. The first request under a key performs the write and answers `201`; any later request carrying the same key answers `200` with that same result, so a timeout you cannot interpret can simply be retried.\n\nThe key is claimed for as long as the record exists and never silently expires. Reusing one with a different request body is `409 idempotency_key_reused` — a key names one request, so changing the body and keeping the key is a bug rather than a retry. A retry that arrives while the original is still in flight is `409 idempotency_request_in_progress`.",
11586
+ "description": "Deduplication key, unique within your account, that makes a retry of an ambiguous failure safe. The first request under a key performs the write and answers `201`; any later request carrying the same key answers `200` with that same result, so a timeout you cannot interpret can simply be retried.\n\nThe key is claimed for as long as the record exists and never silently expires. Reusing one with a different request body is `409 IDEMPOTENCY_KEY_REUSED` — a key names one request, so changing the body and keeping the key is a bug rather than a retry. A retry that arrives while the original is still in flight is `409 IDEMPOTENCY_REQUEST_IN_PROGRESS`.",
11571
11587
  "required": false,
11572
11588
  "type": "string",
11573
11589
  "in": "body"
@@ -11616,7 +11632,7 @@ const routes = {
11616
11632
  },
11617
11633
  {
11618
11634
  "name": "code",
11619
- "description": "Required for `embedded_signup`. The short-lived authorization code from the Meta popup; naturali exchanges it for the access token server-side. Never stored or returned. A code Meta rejects (malformed, expired or already used) is `400 invalid_signup_code`.\n",
11635
+ "description": "Required for `embedded_signup`. The short-lived authorization code from the Meta popup; naturali exchanges it for the access token server-side. Never stored or returned. A code Meta rejects (malformed, expired or already used) is `400 INVALID_SIGNUP_CODE`.\n",
11620
11636
  "required": false,
11621
11637
  "type": "string",
11622
11638
  "in": "body"
@@ -11707,7 +11723,7 @@ const routes = {
11707
11723
  "complete-whatsapp-signup": {
11708
11724
  serviceClass: "Channels",
11709
11725
  operationId: "completeWhatsappSignup",
11710
- description: "Finish a signup link: the app's result page receives `pending` and the numbers Meta granted, and sends back the one to connect. The caller must be a member of the project the link was created for (`404` otherwise), so a link opened by anyone else connects nothing. `pending` expires 10 minutes after the dialog returns (`400 link_expired`).",
11726
+ description: "Finish a signup link: the app's result page receives `pending` and the numbers Meta granted, and sends back the one to connect. The caller must be a member of the project the link was created for (`404` otherwise), so a link opened by anyone else connects nothing. `pending` expires 10 minutes after the dialog returns (`400 LINK_EXPIRED`).",
11711
11727
  moduleDocsUrl: "https://naturali.ai/docs/modules/channels",
11712
11728
  httpMethod: "post",
11713
11729
  pathParams: [],
@@ -11755,7 +11771,7 @@ const routes = {
11755
11771
  "update-channel": {
11756
11772
  serviceClass: "Channels",
11757
11773
  operationId: "updateChannel",
11758
- description: "Rotate the credential, update the kind's config (`waba_id` / `credential_source` for WhatsApp, `modes` for Discord), or flip the naturali-side status. At least one field is required. Rotating a WhatsApp token first reads the number with it, as connect does (`400 invalid_access_token`, `400 phone_number_not_accessible`, `502 meta_unavailable`, keeping the old token), then stores a new write-only secret, repoints the send tool and deletes the old secret; rotating a Discord bot token reseals it and the gateway worker reconnects with it.",
11774
+ description: "Rotate the credential, update the kind's config (`waba_id` / `credential_source` for WhatsApp, `modes` for Discord), or flip the naturali-side status. At least one field is required. Rotating a WhatsApp token first reads the number with it, as connect does (`400 INVALID_ACCESS_TOKEN`, `400 PHONE_NUMBER_NOT_ACCESSIBLE`, `502 META_UNAVAILABLE`, keeping the old token), then stores a new write-only secret, repoints the send tool and deletes the old secret; rotating a Discord bot token reseals it and the gateway worker reconnects with it.",
11759
11775
  moduleDocsUrl: "https://naturali.ai/docs/modules/channels",
11760
11776
  httpMethod: "patch",
11761
11777
  pathParams: ["project_id", "channel_id"],
@@ -12985,7 +13001,7 @@ const routes = {
12985
13001
  },
12986
13002
  {
12987
13003
  "name": "stream",
12988
- "description": "If true, stream tokens via SSE. NOT IMPLEMENTED in v1 — returns 501.",
13004
+ "description": "When true, the response is the turn's event stream (SSE) at step granularity. Implies waiting; `?wait=false` with it is `400`.",
12989
13005
  "required": false,
12990
13006
  "type": "boolean",
12991
13007
  "in": "body"
@@ -16171,7 +16187,7 @@ const routes = {
16171
16187
  },
16172
16188
  {
16173
16189
  "name": "parameters",
16174
- "description": "Runtime parameter values that override or supply template parameter defaults. Keys must match parameter names declared in `template.parameters`. When provided, the validation result also reports required parameters that are still missing after applying these values.\n",
16190
+ "description": "Runtime parameter values that override or supply template parameter defaults. Each value is a string that takes its declaration's `type` (a numeric string for `number`, a JSON array for `list`). Keys must match parameter names declared in `template.parameters`. When provided, the validation result also reports required parameters that are still missing after applying these values.\n",
16175
16191
  "required": false,
16176
16192
  "type": "object",
16177
16193
  "in": "body"
@@ -16212,7 +16228,7 @@ const routes = {
16212
16228
  },
16213
16229
  {
16214
16230
  "name": "parameters",
16215
- "description": "Runtime parameter values that override or supply template parameter defaults. Keys must match parameter names declared in `template.parameters`. A parameter declared with `use_previous_value: true` may be omitted to reuse its stored value.\n",
16231
+ "description": "Runtime parameter values that override or supply template parameter defaults. Each value is a string that takes its declaration's `type` (a numeric string for `number`, a JSON array for `list`). Keys must match parameter names declared in `template.parameters`. A parameter declared with `use_previous_value: true` may be omitted to reuse its stored value.\n",
16216
16232
  "required": false,
16217
16233
  "type": "object",
16218
16234
  "in": "body"
@@ -16287,7 +16303,7 @@ const routes = {
16287
16303
  },
16288
16304
  {
16289
16305
  "name": "parameters",
16290
- "description": "Runtime parameter values that override or supply template parameter defaults. Keys must match parameter names declared in `template.parameters`. Required parameters (those without a default) must be provided here.\n",
16306
+ "description": "Runtime parameter values that override or supply template parameter defaults. Each value is a string that takes its declaration's `type` (a numeric string for `number`, a JSON array for `list`). Keys must match parameter names declared in `template.parameters`. Required parameters (those without a default) must be provided here.\n",
16291
16307
  "required": false,
16292
16308
  "type": "object",
16293
16309
  "in": "body"
@@ -16359,7 +16375,7 @@ const routes = {
16359
16375
  },
16360
16376
  {
16361
16377
  "name": "parameters",
16362
- "description": "Runtime parameter values that override or supply template parameter defaults. Keys must match parameter names declared in `template.parameters`. Required parameters (those without a default) must be provided here, unless the parameter is declared with `use_previous_value: true`, in which case omitting it reuses the previously stored value.\n",
16378
+ "description": "Runtime parameter values that override or supply template parameter defaults. Each value is a string that takes its declaration's `type` (a numeric string for `number`, a JSON array for `list`). Keys must match parameter names declared in `template.parameters`. Required parameters (those without a default) must be provided here, unless the parameter is declared with `use_previous_value: true`, in which case omitting it reuses the previously stored value.\n",
16363
16379
  "required": false,
16364
16380
  "type": "object",
16365
16381
  "in": "body"
@@ -16673,7 +16689,7 @@ const routes = {
16673
16689
  "get-generation-transcript": {
16674
16690
  serviceClass: "Generations",
16675
16691
  operationId: "getGenerationTranscript",
16676
- description: "Returns one generation's turn read back as an ordered sequence of steps: what it was asked, each model step with its tool calls and results, and how it ended. The transcript is assembled at read time from the generation record and the trace's steps object; nothing is stored, so it cannot outlive the content it projects. Requires `traces:GetTrace` in addition to `generations:GetGeneration`, because the response merges content from both resources. A generation whose content is unavailable — never written under zero-retention, or cleared by a purge — returns `200` with the skeleton rather than an error: `input` and `output` are null, `steps` is empty, and the `content_redacted_*` fields say which happened. `content_redacted_by_principal_id` is `zero_retention` when the content was never stored, and the purging principal's ID when it was erased later. A generation that is still running returns the same shape with an empty `steps`; `status` disambiguates the two.",
16692
+ description: "Returns one generation's turn read back as an ordered sequence of steps: what it was asked, each model step with its tool calls and results, and how it ended. The transcript is assembled at read time from the generation record and the trace's steps object; nothing is stored, so it cannot outlive the content it projects. Requires `traces:GetTrace` in addition to `generations:GetGeneration`, because the response merges content from both resources. A generation whose content is unavailable — never written under zero-retention, or cleared by a purge — returns `200` with the skeleton rather than an error: `input` and `output` are null, `steps` is empty, and the `content_redacted_*` fields say which happened. `content_redacted_by_principal_id` is `zero_retention` when the content was never stored, and the purging principal's ID when it was erased later. A generation that is still running returns the steps it has ended so far and its `in_flight_tool_calls`; `status` says it runs. To follow it as it runs, read `GET /v1/projects/{project_id}/generations/{generation_id}/events`.",
16677
16693
  moduleDocsUrl: "https://naturali.ai/docs/modules/generations",
16678
16694
  httpMethod: "get",
16679
16695
  pathParams: ["project_id", "generation_id"],
@@ -16694,6 +16710,74 @@ const routes = {
16694
16710
  "in": "path"
16695
16711
  }]
16696
16712
  },
16713
+ "list-generation-events": {
16714
+ serviceClass: "Generations",
16715
+ operationId: "listGenerationEvents",
16716
+ description: "The generation's transcript, incrementally: its progress rows in `seq` order, after `after_seq`. Each `generations.step_ended` row carries the step it ended as a `TranscriptStep`; the other rows say when a step or a tool call started and ended, and which generation a tool call started. Step content and tool names are the trace's content: reading them needs `traces:GetTrace` on the generation's trace beside `generations:GetGeneration`, and is refused with `403` without it. `progress_only=true` asks for the rows alone (`step` is null), which `generations:GetGeneration` alone allows. Content is re-read on every page: once a purge erases it, or under zero-retention, `step` is null. `stream=true` answers `text/event-stream` instead and follows the generation until it settles (`completed`, `failed` or `requires_action`), or stops running without a settle row. Each row is one `event: progress` frame whose `id` is its `seq`; the stream ends with `data: [DONE]`. A `: heartbeat` comment is sent every 15 seconds. After 5 minutes the stream ends with `event: end` and `data: {\"reason\": \"max_lifetime\", \"generation_id\": \"...\", \"after_seq\": N}`: reconnect with that `after_seq`, or let an `EventSource` reconnect with its `Last-Event-ID` header, which this route reads as `after_seq`. Every reconnect is authorized afresh.",
16717
+ moduleDocsUrl: "https://naturali.ai/docs/modules/generations",
16718
+ httpMethod: "get",
16719
+ pathParams: ["project_id", "generation_id"],
16720
+ queryParams: [
16721
+ "after_seq",
16722
+ "limit",
16723
+ "cursor",
16724
+ "progress_only",
16725
+ "stream"
16726
+ ],
16727
+ headerParams: [],
16728
+ cookieParams: [],
16729
+ flags: [
16730
+ {
16731
+ "name": "project_id",
16732
+ "description": "Project public ID (proj_ prefix).",
16733
+ "required": true,
16734
+ "type": "string",
16735
+ "in": "path"
16736
+ },
16737
+ {
16738
+ "name": "generation_id",
16739
+ "description": "Public ID of the generation",
16740
+ "required": true,
16741
+ "type": "string",
16742
+ "in": "path"
16743
+ },
16744
+ {
16745
+ "name": "after_seq",
16746
+ "description": "Return the rows after this `seq`. Defaults to the `Last-Event-ID` header when sent, else `0` (from the first row).\n",
16747
+ "required": false,
16748
+ "type": "integer",
16749
+ "in": "query"
16750
+ },
16751
+ {
16752
+ "name": "limit",
16753
+ "description": "Results per page, 1 to 100 (default 50). Above 100 it is clamped; below 1 or not an integer it is `400`.",
16754
+ "required": false,
16755
+ "type": "integer",
16756
+ "in": "query"
16757
+ },
16758
+ {
16759
+ "name": "cursor",
16760
+ "description": "The previous page's `next_cursor`; omit it for the first page. A cursor this list did not issue is `400`.",
16761
+ "required": false,
16762
+ "type": "string",
16763
+ "in": "query"
16764
+ },
16765
+ {
16766
+ "name": "progress_only",
16767
+ "description": "When `true`, the rows without step content, which needs no `traces:GetTrace`.\n",
16768
+ "required": false,
16769
+ "type": "boolean",
16770
+ "in": "query"
16771
+ },
16772
+ {
16773
+ "name": "stream",
16774
+ "description": "When `true`, answer `text/event-stream` and follow the generation until it settles.\n",
16775
+ "required": false,
16776
+ "type": "boolean",
16777
+ "in": "query"
16778
+ }
16779
+ ]
16780
+ },
16697
16781
  "list-guardrails": {
16698
16782
  serviceClass: "Guardrails",
16699
16783
  operationId: "listGuardrails",
@@ -17632,7 +17716,7 @@ const routes = {
17632
17716
  },
17633
17717
  {
17634
17718
  "name": "daily_call_limit",
17635
- "description": "Tool calls per UTC day, over every caller; past it a call is `429 mcp_daily_limit_reached`. Required for `none`.",
17719
+ "description": "Tool calls per UTC day, over every caller; past it a call is `429 QUOTA_EXCEEDED`. Required for `none`.",
17636
17720
  "required": false,
17637
17721
  "type": "integer",
17638
17722
  "in": "body"
@@ -22462,7 +22546,7 @@ const routes = {
22462
22546
  "create-project": {
22463
22547
  serviceClass: "Projects",
22464
22548
  operationId: "createProject",
22465
- description: "Creates a project (one per client or per environment). Your plan limits how many projects you may own. At the limit this responds `403` with `plan_limit_reached`, whose `details` carry the `plan` and the `limit`. An archived project still counts — archiving keeps every resource, so it frees nothing; deleting a project does. A new project starts at the content-retention window your plan sets (`trace_content_retention_days`); `PATCH` it to anything shorter.",
22549
+ description: "Creates a project (one per client or per environment). Your plan limits how many projects you may own. At the limit this responds `403` with `PLAN_LIMIT_REACHED`, whose `meta` carries the `plan` and the `limit`. An archived project still counts — archiving keeps every resource, so it frees nothing; deleting a project does. A new project starts at the content-retention window your plan sets (`trace_content_retention_days`); `PATCH` it to anything shorter.",
22466
22550
  moduleDocsUrl: "https://naturali.ai/docs/modules/projects",
22467
22551
  httpMethod: "post",
22468
22552
  pathParams: [],
@@ -22477,7 +22561,7 @@ const routes = {
22477
22561
  "in": "body"
22478
22562
  }, {
22479
22563
  "name": "idempotency_key",
22480
- "description": "Deduplication key, unique within your account, that makes a retry of an ambiguous failure safe. The first request under a key performs the write and answers `201`; any later request carrying the same key answers `200` with that same result, so a timeout you cannot interpret can simply be retried.\n\nThe key is claimed for as long as the record exists and never silently expires. Reusing one with a different request body is `409 idempotency_key_reused` — a key names one request, so changing the body and keeping the key is a bug rather than a retry. A retry that arrives while the original is still in flight is `409 idempotency_request_in_progress`.",
22564
+ "description": "Deduplication key, unique within your account, that makes a retry of an ambiguous failure safe. The first request under a key performs the write and answers `201`; any later request carrying the same key answers `200` with that same result, so a timeout you cannot interpret can simply be retried.\n\nThe key is claimed for as long as the record exists and never silently expires. Reusing one with a different request body is `409 IDEMPOTENCY_KEY_REUSED` — a key names one request, so changing the body and keeping the key is a bug rather than a retry. A retry that arrives while the original is still in flight is `409 IDEMPOTENCY_REQUEST_IN_PROGRESS`.",
22481
22565
  "required": false,
22482
22566
  "type": "string",
22483
22567
  "in": "body"
@@ -22504,7 +22588,7 @@ const routes = {
22504
22588
  "update-project": {
22505
22589
  serviceClass: "Projects",
22506
22590
  operationId: "updateProject",
22507
- description: "Rename or archive a project, and/or change its content-retention settings (`trace_content_retention_days`, `trace_content_mode`), its execution ceilings (`max_concurrent_runs`, `max_chain_generations`, `max_orchestration_run_depth`), its priced-model gate (`require_priced_model`), its project-scope guardrails (`guardrail_ids`), the policies capping every agent turn in it (`agent_policy_ids`), the tag keys a change of agent-readable text removes (`content_bound_tag_keys`) and managed conversion (`managed_conversion`). Archiving is reversible; resources are retained. Requires the `admin` role in the project (an `owner` has it too). These are the terms every member works under, which is why setting them sits above the role that works under them. The ceilings and the priced-model gate are uncapped by plan: each one only ever narrows what the project may spend, so setting one takes on a restriction rather than claiming an entitlement. On the three ceilings `null` clears the project's own bound and omission leaves it alone — they are different instructions. `guardrail_ids` is the floor under every tool call by every agent in the project, including tools added later. The list is replaced wholesale, so send the ids you want to keep; `[]` detaches every one. An id naming no guardrail in the project responds `400` with `guardrail_not_found`, whose `details.missing` lists the ids. It is uncapped by plan, like the ceilings: a guardrail can only tighten what runs. `agent_policy_ids` caps every turn of every agent the project owns: an action they deny is refused even where the agent's own `policy_ids` allow it, and the refusal's `meta.denied_by` is `{ type: project, id: <project_id> }`. `null` or `[]` removes the cap. The credential must hold every grant the policies carry, else `403` with `POLICY_GRANT_NOT_HELD`; an id naming no policy responds `400` with `POLICY_NOT_FOUND`, and a policy of another project `400` with `POLICY_OUTSIDE_PROJECT`. The two retention controls answer different questions. The window bounds how long content *stays* — a daily sweep purges anything past it, leaving auditable skeletons behind. `trace_content_mode: none` means content is never *written*, which is the stronger guarantee: it cannot be missed by a sweep or survive in a backup. Your plan sets the longest window you may keep content for. A wider one — `null` included, which keeps content indefinitely — responds `403` with `plan_limit_reached`, whose `details` carry the `plan` and the `limit` in days. Anything shorter is always allowed. Moving to a plan with a shorter window takes effect at the end of the billing cycle, and content already stored is then purged by age like everything else.",
22591
+ description: "Rename or archive a project, and/or change its content-retention settings (`trace_content_retention_days`, `trace_content_mode`), its execution ceilings (`max_concurrent_runs`, `max_chain_generations`, `max_orchestration_run_depth`), its priced-model gate (`require_priced_model`), its project-scope guardrails (`guardrail_ids`), the policies capping every agent turn in it (`agent_policy_ids`), the tag keys a change of agent-readable text removes (`content_bound_tag_keys`) and managed conversion (`managed_conversion`). Archiving is reversible; resources are retained. Requires the `admin` role in the project (an `owner` has it too). These are the terms every member works under, which is why setting them sits above the role that works under them. The ceilings and the priced-model gate are uncapped by plan: each one only ever narrows what the project may spend, so setting one takes on a restriction rather than claiming an entitlement. On the three ceilings `null` clears the project's own bound and omission leaves it alone — they are different instructions. `guardrail_ids` is the floor under every tool call by every agent in the project, including tools added later. The list is replaced wholesale, so send the ids you want to keep; `[]` detaches every one. An id naming no guardrail in the project responds `400` with `GUARDRAIL_NOT_FOUND`, whose `meta.missing` lists the ids. It is uncapped by plan, like the ceilings: a guardrail can only tighten what runs. `agent_policy_ids` caps every turn of every agent the project owns: an action they deny is refused even where the agent's own `policy_ids` allow it, and the refusal's `meta.denied_by` is `{ type: project, id: <project_id> }`. `null` or `[]` removes the cap. The credential must hold every grant the policies carry, else `403` with `POLICY_GRANT_NOT_HELD`; an id naming no policy responds `400` with `POLICY_NOT_FOUND`, and a policy of another project `400` with `POLICY_OUTSIDE_PROJECT`. The two retention controls answer different questions. The window bounds how long content *stays* — a daily sweep purges anything past it, leaving auditable skeletons behind. `trace_content_mode: none` means content is never *written*, which is the stronger guarantee: it cannot be missed by a sweep or survive in a backup. Your plan sets the longest window you may keep content for. A wider one — `null` included, which keeps content indefinitely — responds `403` with `PLAN_LIMIT_REACHED`, whose `meta` carries the `plan` and the `limit` in days. Anything shorter is always allowed. Moving to a plan with a shorter window takes effect at the end of the billing cycle, and content already stored is then purged by age like everything else.",
22508
22592
  moduleDocsUrl: "https://naturali.ai/docs/modules/projects",
22509
22593
  httpMethod: "patch",
22510
22594
  pathParams: ["project_id"],
@@ -22535,7 +22619,7 @@ const routes = {
22535
22619
  },
22536
22620
  {
22537
22621
  "name": "trace_content_retention_days",
22538
- "description": "Days of trace and generation content retention before the daily sweep purges it. Send `null` to disable retention (content is then kept until purged on demand). Omitting the field leaves the current window unchanged — `null` and absent are different instructions.\n\nBounded by your plan: a window longer than the plan allows, and `null` on any plan that sets a window, respond `403` `plan_limit_reached`.\n",
22622
+ "description": "Days of trace and generation content retention before the daily sweep purges it. Send `null` to disable retention (content is then kept until purged on demand). Omitting the field leaves the current window unchanged — `null` and absent are different instructions.\n\nBounded by your plan: a window longer than the plan allows, and `null` on any plan that sets a window, respond `403` `PLAN_LIMIT_REACHED`.\n",
22539
22623
  "required": false,
22540
22624
  "type": "integer",
22541
22625
  "in": "body"
@@ -22844,7 +22928,7 @@ const routes = {
22844
22928
  "accept-project-transfer": {
22845
22929
  serviceClass: "Projects",
22846
22930
  operationId: "acceptProjectTransfer",
22847
- description: "Makes the caller — the member the transfer names — the project's owner. Usage up to this moment is settled on the previous owner's credit; from here on the project's usage is billed to the caller, and its runs count against the caller's allowance. The project counts toward the caller's plan limits at once: its active channels and triggers, and on Free the project itself. A transfer the caller's plan cannot hold is refused with `403 plan_limit_reached`, and the project's retention window is brought within the caller's plan. The previous owner stays in the project as an `admin`. Stops recorded against the project's spend move to the caller. Refused to a connected app.",
22931
+ description: "Makes the caller — the member the transfer names — the project's owner. Usage up to this moment is settled on the previous owner's credit; from here on the project's usage is billed to the caller, and its runs count against the caller's allowance. The project counts toward the caller's plan limits at once: its active channels and triggers, and on Free the project itself. A transfer the caller's plan cannot hold is refused with `403 PLAN_LIMIT_REACHED`, and the project's retention window is brought within the caller's plan. The previous owner stays in the project as an `admin`. Stops recorded against the project's spend move to the caller. Refused to a connected app.",
22848
22932
  moduleDocsUrl: "https://naturali.ai/docs/modules/projects",
22849
22933
  httpMethod: "post",
22850
22934
  pathParams: ["project_id"],
@@ -24020,7 +24104,7 @@ const routes = {
24020
24104
  "generate-session-response": {
24021
24105
  serviceClass: "Sessions",
24022
24106
  operationId: "generateSessionResponse",
24023
- description: "Triggers the agent to generate a response based on the current conversation. Background by default: returns `202 Accepted` with the generation's id once its record exists. Pass ?wait=true to block and receive the assistant reply (or a requires_action status if the agent needs client tool outputs) in the response.",
24107
+ description: "Triggers the agent to generate a response based on the current conversation. Background by default: returns `202 Accepted` with the generation's id once its record exists. Pass ?wait=true to block and receive the assistant reply (or a requires_action status if the agent needs client tool outputs) in the response. Pass `stream: true` in the body to receive the turn's events as SSE, one frame per step and tool call, until it settles; `stream: true` with `?wait=false` is `400`.",
24024
24108
  moduleDocsUrl: "https://naturali.ai/docs/modules/sessions",
24025
24109
  httpMethod: "post",
24026
24110
  pathParams: ["project_id", "session_id"],
@@ -24056,6 +24140,13 @@ const routes = {
24056
24140
  "type": "string",
24057
24141
  "in": "body"
24058
24142
  },
24143
+ {
24144
+ "name": "stream",
24145
+ "description": "When true, the response is the turn's event stream (SSE) at step granularity. Implies waiting; `?wait=false` with it is `400`.",
24146
+ "required": false,
24147
+ "type": "boolean",
24148
+ "in": "body"
24149
+ },
24059
24150
  {
24060
24151
  "name": "tool_context",
24061
24152
  "description": "Key-value pairs forwarded as `X-Naturali-Context-<key>` headers on every `http`, `mcp` and `builtin` tool call in this generation. The header name is the deployment's configured context prefix (`X-Naturali-Context-` by default) plus the key verbatim — no character is re-cased. Keys are never case-converted — they round-trip exactly as sent. An invalid or colliding key is rejected with `400 INVALID_TOOL_CONTEXT_KEY`.",
@@ -26171,7 +26262,7 @@ const routes = {
26171
26262
  "get-current-user-billing": {
26172
26263
  serviceClass: "Users",
26173
26264
  operationId: "getCurrentUserBilling",
26174
- description: "The plan the account is on, how long its projects may keep content, how much indexed storage it is holding, and the credit it has left — the figures the platform already enforces against, readable by the account they are enforced against. A managed-model generation is refused with `402 insufficient_credit` while `credit_balance_usd` is negative, and a feature or a resource count outside the plan is refused with `403`, as is a retention window wider than `retention_days` or an ingest past `storage.limit`. Every refusal names what is missing; this is where the numbers behind them are read. Every figure here is a local read, which is what keeps this route cheap enough to poll — unlike `GET /v1/users/me/usage`, which asks the meter once per project. Answers for the caller's own account only, and always the account the credential resolves to — an API key answers for the user that minted it. The plan gating a *project* is that project's billing owner's, so a member of someone else's project reads their own rung here, not that project's.",
26265
+ description: "The plan the account is on, how long its projects may keep content, how much indexed storage it is holding, and the credit it has left — the figures the platform already enforces against, readable by the account they are enforced against. A managed-model generation is refused with `402 INSUFFICIENT_CREDIT` while `credit_balance_usd` is negative, and a feature or a resource count outside the plan is refused with `403`, as is a retention window wider than `retention_days` or an ingest past `storage.limit`. Every refusal names what is missing; this is where the numbers behind them are read. Every figure here is a local read, which is what keeps this route cheap enough to poll — unlike `GET /v1/users/me/usage`, which asks the meter once per project. Answers for the caller's own account only, and always the account the credential resolves to — an API key answers for the user that minted it. The plan gating a *project* is that project's billing owner's, so a member of someone else's project reads their own rung here, not that project's.",
26175
26266
  moduleDocsUrl: "https://naturali.ai/docs/modules/users",
26176
26267
  httpMethod: "get",
26177
26268
  pathParams: [],
@@ -26183,7 +26274,7 @@ const routes = {
26183
26274
  "get-current-user-usage": {
26184
26275
  serviceClass: "Users",
26185
26276
  operationId: "getCurrentUserUsage",
26186
- description: "What the account uses this billing cycle, per project and against its plan: runs, indexed storage, and the counts the plan caps — projects, active channels and triggers. How many runs the account has made this billing cycle, and how many its plan includes. A **run is one agent generation or one tool call** — the unit every rung is priced in. Every tool call counts, including those an agent makes inside a generation; a `client` tool counts nothing. Counted across the projects this account is the billing owner of, over the current UTC calendar month, from the meter itself. Archived projects are included: the runs they already made were made. **On the `free` plan the allowance is enforced.** An account that has used it is refused `403 plan_limit_reached` with `resource: \"runs\"` on everything that starts a generation and on a direct tool call — on its own provider credential as much as on a managed model, because a run is a run — until the billing month turns or it upgrades. On `pro` and `business` nothing is refused: runs past the allowance are billed at the overage rate those plans are sold with. A contract plan is not counted. The other thing that stops a managed-model generation is a negative credit balance, which is `GET /v1/users/me/billing`, and it never applies to your own credential. **This route counts live; the refusal reads a figure counted every few minutes.** So the two can differ by a burst: this is the more current number, and a refusal quotes the one it actually enforced. It is also more expensive than the balance read: it reads the runtime several times per project. Poll it on the order of minutes, not seconds. A figure that could not be read is `null` rather than failing the request.",
26277
+ description: "What the account uses this billing cycle, per project and against its plan: runs, indexed storage, and the counts the plan caps — projects, active channels and triggers. How many runs the account has made this billing cycle, and how many its plan includes. A **run is one agent generation or one tool call** — the unit every rung is priced in. Every tool call counts, including those an agent makes inside a generation; a `client` tool counts nothing. Counted across the projects this account is the billing owner of, over the current UTC calendar month, from the meter itself. Archived projects are included: the runs they already made were made. **On the `free` plan the allowance is enforced.** An account that has used it is refused `403 PLAN_LIMIT_REACHED` with `resource: \"runs\"` on everything that starts a generation and on a direct tool call — on its own provider credential as much as on a managed model, because a run is a run — until the billing month turns or it upgrades. On `pro` and `business` nothing is refused: runs past the allowance are billed at the overage rate those plans are sold with. A contract plan is not counted. The other thing that stops a managed-model generation is a negative credit balance, which is `GET /v1/users/me/billing`, and it never applies to your own credential. **This route counts live; the refusal reads a figure counted every few minutes.** So the two can differ by a burst: this is the more current number, and a refusal quotes the one it actually enforced. It is also more expensive than the balance read: it reads the runtime several times per project. Poll it on the order of minutes, not seconds. A figure that could not be read is `null` rather than failing the request.",
26187
26278
  moduleDocsUrl: "https://naturali.ai/docs/modules/users",
26188
26279
  httpMethod: "get",
26189
26280
  pathParams: [],
@@ -26257,7 +26348,7 @@ const routes = {
26257
26348
  "restore-current-user-stop": {
26258
26349
  serviceClass: "Users",
26259
26350
  operationId: "restoreCurrentUserStop",
26260
- description: "Turns one stopped item back on — re-enables the schedule trigger, or resumes the orchestration run or workflow task — and stops listing it. An item that is no longer stopped (resumed already, finished or deleted) is marked restored too. Refused with `409 stop_ceiling_closed` while a ceiling is still closed, naming it in `details.blocked_by`, and with `409 stop_not_restorable` for a cancelled eval run, which can only be dismissed.",
26351
+ description: "Turns one stopped item back on — re-enables the schedule trigger, or resumes the orchestration run or workflow task — and stops listing it. An item that is no longer stopped (resumed already, finished or deleted) is marked restored too. Refused with `409 STOP_CEILING_CLOSED` while a ceiling is still closed, naming it in `meta.blocked_by`, and with `409 STOP_NOT_RESTORABLE` for a cancelled eval run, which can only be dismissed.",
26261
26352
  moduleDocsUrl: "https://naturali.ai/docs/modules/users",
26262
26353
  httpMethod: "post",
26263
26354
  pathParams: ["stop_id"],
@@ -26513,7 +26604,7 @@ const routes = {
26513
26604
  "create-webhook": {
26514
26605
  serviceClass: "Webhooks",
26515
26606
  operationId: "createWebhook",
26516
- description: "Register an endpoint and subscribe it to one or more event types. The response carries `secret` — the signing key, in plaintext. **This is the only time it is returned.** Store it where your receiver can read it; if you lose it, rotate rather than re-create, so the endpoint keeps its delivery history. Send `secret` yourself to sign with a key your receiver already holds; the response then returns that one. A project holds at most 20 webhooks, inactive ones included; the 21st is refused with `409 webhook_limit_reached`. Returns `501` on a deployment with no credential-sealing key configured, since the secret could not then be stored safely.",
26607
+ description: "Register an endpoint and subscribe it to one or more event types. The response carries `secret` — the signing key, in plaintext. **This is the only time it is returned.** Store it where your receiver can read it; if you lose it, rotate rather than re-create, so the endpoint keeps its delivery history. Send `secret` yourself to sign with a key your receiver already holds; the response then returns that one. A project holds at most 20 webhooks, inactive ones included; the 21st is refused with `409 WEBHOOK_LIMIT_REACHED`. Returns `501` on a deployment with no credential-sealing key configured, since the secret could not then be stored safely.",
26517
26608
  moduleDocsUrl: "https://naturali.ai/docs/modules/webhooks",
26518
26609
  httpMethod: "post",
26519
26610
  pathParams: ["project_id"],
@@ -26787,7 +26878,7 @@ const routes = {
26787
26878
  "redeliver-webhook-delivery": {
26788
26879
  serviceClass: "Webhooks",
26789
26880
  operationId: "redeliverWebhookDelivery",
26790
- description: "Queue the same event at the same endpoint again — the recovery path for a delivery that failed, or one your receiver dropped. This is the `…:redeliver` action; the path segment is `{delivery_id}:redeliver`. A **new** delivery is created and returned; the original record is left untouched, because its attempt history is the evidence you redelivered on. The event's `id` is carried over unchanged, so a receiver deduping on the event sees the same event twice while one deduping on `X-Naturali-Delivery` sees a distinct delivery. An inactive webhook is refused with `409 webhook_inactive`.",
26881
+ description: "Queue the same event at the same endpoint again — the recovery path for a delivery that failed, or one your receiver dropped. This is the `…:redeliver` action; the path segment is `{delivery_id}:redeliver`. A **new** delivery is created and returned; the original record is left untouched, because its attempt history is the evidence you redelivered on. The event's `id` is carried over unchanged, so a receiver deduping on the event sees the same event twice while one deduping on `X-Naturali-Delivery` sees a distinct delivery. An inactive webhook is refused with `409 WEBHOOK_INACTIVE`.",
26791
26882
  moduleDocsUrl: "https://naturali.ai/docs/modules/webhooks",
26792
26883
  httpMethod: "post",
26793
26884
  pathParams: ["project_id", "delivery_id"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/cli",
3
- "version": "0.268.0",
3
+ "version": "0.270.0",
4
4
  "description": "Command-line interface for the naturali.ai API, generated from its OpenAPI specs",
5
5
  "keywords": [
6
6
  "naturali",
@@ -31,7 +31,7 @@
31
31
  "yaml": "^2.9.1"
32
32
  },
33
33
  "devDependencies": {
34
- "@naturali/sdk": "0.268.0",
34
+ "@naturali/sdk": "0.270.0",
35
35
  "@ttoss/openapi-codegen": "^0.10.1",
36
36
  "@types/node": "^26.5.1",
37
37
  "tsdown": "^0.23.0",