@naturali/cli 0.58.1 → 0.59.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 +33 -7
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -14,7 +14,7 @@ var __exportAll = (all, no_symbols) => {
14
14
  };
15
15
  //#endregion
16
16
  //#region package.json
17
- var version = "0.58.1";
17
+ var version = "0.59.0";
18
18
  //#endregion
19
19
  //#region ../sdk/src/generated/core/bodySerializer.gen.ts
20
20
  const jsonBodySerializer = { bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value) };
@@ -1322,7 +1322,13 @@ var Generations = class {
1322
1322
  /**
1323
1323
  * Run an agent generation
1324
1324
  *
1325
- * Sends messages to the agent, resolves its tools, and runs the model loop. Returns the final text when `status` is `completed` (plus `object` when the agent has an output schema), or the pending `tool_calls` when `status` is `requires_action`. With `stream: true` the response is a Server-Sent Events stream (Content-Type text/event-stream) proxied from the runtime instead of a single JSON body.
1325
+ * Sends messages to the agent, resolves its tools, and runs the model loop.
1326
+ *
1327
+ * Background by default: this returns `202` immediately with a `generation_id`, and the turn runs on. Poll [`GET /v1/projects/{project_id}/generations/{generation_id}`](/docs/api/generations/get-generation) until its `status` leaves `in_progress`.
1328
+ *
1329
+ * Pass `?wait=true` to block instead and receive the turn itself — the final text when `status` is `completed` (plus `object` when the agent has an output schema), or the pending `tool_calls` when `status` is `requires_action`.
1330
+ *
1331
+ * With `stream: true` the response is a Server-Sent Events stream (Content-Type text/event-stream) proxied from the runtime. A stream holds the request open by definition, so it always waits; combining it with an explicit `wait=false` is a `400`.
1326
1332
  *
1327
1333
  */
1328
1334
  static createGeneration(options) {
@@ -1994,7 +2000,13 @@ var Sessions = class {
1994
2000
  /**
1995
2001
  * Generate a response
1996
2002
  *
1997
- * Runs the agent over the session's accumulated messages and returns its reply. `status` is `completed` with the assistant `message`, or `requires_action` with the pending `required_action` tool calls. `model` overrides the agent's default model for this turn only.
2003
+ * Runs the agent over the session's accumulated messages.
2004
+ *
2005
+ * Background by default: this returns `202` immediately and the turn runs on. The reply lands in the transcript, so poll [`GET /v1/projects/{project_id}/agents/{agent_id}/sessions/{session_id}/messages`](/docs/api/sessions/list-session-messages) for the assistant message, or read the session for its `status`.
2006
+ *
2007
+ * Pass `?wait=true` to block instead and receive the turn itself: `status` is `completed` with the assistant `message`, or `requires_action` with the pending `required_action` tool calls.
2008
+ *
2009
+ * `model` overrides the agent's default model for this turn only.
1998
2010
  *
1999
2011
  */
2000
2012
  static generateSessionResponse(options) {
@@ -4908,11 +4920,11 @@ const routes = {
4908
4920
  "create-generation": {
4909
4921
  serviceClass: "Generations",
4910
4922
  operationId: "createGeneration",
4911
- description: "Sends messages to the agent, resolves its tools, and runs the model loop. Returns the final text when `status` is `completed` (plus `object` when the agent has an output schema), or the pending `tool_calls` when `status` is `requires_action`. With `stream: true` the response is a Server-Sent Events stream (Content-Type text/event-stream) proxied from the runtime instead of a single JSON body.",
4923
+ description: "Sends messages to the agent, resolves its tools, and runs the model loop. Background by default: this returns `202` immediately with a `generation_id`, and the turn runs on. Poll [`GET /v1/projects/{project_id}/generations/{generation_id}`](/docs/api/generations/get-generation) until its `status` leaves `in_progress`. Pass `?wait=true` to block instead and receive the turn itself — the final text when `status` is `completed` (plus `object` when the agent has an output schema), or the pending `tool_calls` when `status` is `requires_action`. With `stream: true` the response is a Server-Sent Events stream (Content-Type text/event-stream) proxied from the runtime. A stream holds the request open by definition, so it always waits; combining it with an explicit `wait=false` is a `400`.",
4912
4924
  moduleDocsUrl: "https://docs.naturali.ai/docs/modules/generations",
4913
4925
  httpMethod: "post",
4914
4926
  pathParams: ["project_id", "agent_id"],
4915
- queryParams: [],
4927
+ queryParams: ["wait"],
4916
4928
  flags: [
4917
4929
  {
4918
4930
  "name": "project_id",
@@ -4928,6 +4940,13 @@ const routes = {
4928
4940
  "type": "string",
4929
4941
  "in": "path"
4930
4942
  },
4943
+ {
4944
+ "name": "wait",
4945
+ "description": "When omitted or `false` (the default), the generation runs in the background and this returns `202` with a `generation_id` to poll. Pass `true` to block until the turn settles and receive it inline.",
4946
+ "required": false,
4947
+ "type": "boolean",
4948
+ "in": "query"
4949
+ },
4931
4950
  {
4932
4951
  "name": "messages",
4933
4952
  "description": "The conversation to run the model turn over.",
@@ -6809,7 +6828,7 @@ const routes = {
6809
6828
  "generate-session-response": {
6810
6829
  serviceClass: "Sessions",
6811
6830
  operationId: "generateSessionResponse",
6812
- description: "Runs the agent over the session's accumulated messages and returns its reply. `status` is `completed` with the assistant `message`, or `requires_action` with the pending `required_action` tool calls. `model` overrides the agent's default model for this turn only.",
6831
+ description: "Runs the agent over the session's accumulated messages. Background by default: this returns `202` immediately and the turn runs on. The reply lands in the transcript, so poll [`GET /v1/projects/{project_id}/agents/{agent_id}/sessions/{session_id}/messages`](/docs/api/sessions/list-session-messages) for the assistant message, or read the session for its `status`. Pass `?wait=true` to block instead and receive the turn itself: `status` is `completed` with the assistant `message`, or `requires_action` with the pending `required_action` tool calls. `model` overrides the agent's default model for this turn only.",
6813
6832
  moduleDocsUrl: "https://docs.naturali.ai/docs/modules/sessions",
6814
6833
  httpMethod: "post",
6815
6834
  pathParams: [
@@ -6817,7 +6836,7 @@ const routes = {
6817
6836
  "agent_id",
6818
6837
  "session_id"
6819
6838
  ],
6820
- queryParams: [],
6839
+ queryParams: ["wait"],
6821
6840
  flags: [
6822
6841
  {
6823
6842
  "name": "project_id",
@@ -6840,6 +6859,13 @@ const routes = {
6840
6859
  "type": "string",
6841
6860
  "in": "path"
6842
6861
  },
6862
+ {
6863
+ "name": "wait",
6864
+ "description": "When omitted or `false` (the default), the turn runs in the background and this returns `202`; its reply lands in the session transcript. Pass `true` to block until the turn settles and receive it inline.",
6865
+ "required": false,
6866
+ "type": "boolean",
6867
+ "in": "query"
6868
+ },
6843
6869
  {
6844
6870
  "name": "model",
6845
6871
  "description": "Overrides the agent's default model for this turn only.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/cli",
3
- "version": "0.58.1",
3
+ "version": "0.59.0",
4
4
  "description": "Command-line interface for the naturali.ai API, generated from its OpenAPI specs",
5
5
  "type": "module",
6
6
  "bin": {
@@ -30,7 +30,7 @@
30
30
  "tsx": "^4.23.1",
31
31
  "typescript": "~6.0.3",
32
32
  "vitest": "^4.1.10",
33
- "@naturali/sdk": "0.58.1"
33
+ "@naturali/sdk": "0.59.0"
34
34
  },
35
35
  "scripts": {
36
36
  "generate": "tsx scripts/generate.ts",