@naturali/cli 0.267.3 → 0.269.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 +101 -10
  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.267.3";
20
+ var version = "0.269.0";
21
21
  //#endregion
22
22
  //#region ../sdk/src/generated/core/bodySerializer.gen.ts
23
23
  const serializeFormDataPair = (data, key, value) => {
@@ -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
  /**
@@ -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) {
@@ -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",
@@ -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`.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/cli",
3
- "version": "0.267.3",
3
+ "version": "0.269.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.267.3",
34
+ "@naturali/sdk": "0.269.0",
35
35
  "@ttoss/openapi-codegen": "^0.10.1",
36
36
  "@types/node": "^26.5.1",
37
37
  "tsdown": "^0.23.0",