@naturali/cli 0.162.1 → 0.162.3

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 +66 -29
  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.162.1";
20
+ var version = "0.162.3";
21
21
  //#endregion
22
22
  //#region ../sdk/src/generated/core/bodySerializer.gen.ts
23
23
  const serializeFormDataPair = (data, key, value) => {
@@ -1218,7 +1218,7 @@ var Agents = class {
1218
1218
  /**
1219
1219
  * Delete an agent
1220
1220
  *
1221
- * Deletes an agent by ID. Fails with `409` if the agent has dependent generations or traces, unless `force=true` is passed, in which case those generations and traces are deleted along with the agent.
1221
+ * Deletes an agent by ID. Fails with `409` if the agent has dependent generations or traces, or another project has accepted a share of it, unless `force=true` is passed, in which case those generations and traces are deleted along with the agent and the shares are revoked. Every share of the agent is revoked when it is deleted.
1222
1222
  *
1223
1223
  */
1224
1224
  static deleteAgent(options) {
@@ -1230,7 +1230,8 @@ var Agents = class {
1230
1230
  /**
1231
1231
  * Get an agent
1232
1232
  *
1233
- * Returns a single agent by ID.
1233
+ * Returns a single agent by ID. A credential scoped to a project the agent is shared with, through an accepted share, reads its `id` and `name` only.
1234
+ *
1234
1235
  */
1235
1236
  static getAgent(options) {
1236
1237
  return (options.client ?? client).get({
@@ -1273,6 +1274,8 @@ var Agents = class {
1273
1274
  *
1274
1275
  * Sends messages to the agent, resolves its tools, and runs the AI model loop. Background by default: returns `202 Accepted` with a `generation_id` to poll via `GET /v1/projects/{project_id}/generations/{generation_id}`. Pass `?wait=true` to block and receive the result inline, where client tools pause the generation and return `requires_action`. Streaming (`stream: true`) implies waiting. Pass `idempotency_key` to make a retry safe: a request whose key is already claimed runs nothing and answers `202` with the generation the key names.
1275
1276
  *
1277
+ * A credential scoped to a project the agent is shared with, through an accepted share, runs it in that project: on the publisher's configuration, recorded, metered and governed in the grantee project.
1278
+ *
1276
1279
  */
1277
1280
  static createAgentGeneration(options) {
1278
1281
  return (options.client ?? client).post({
@@ -4847,7 +4850,7 @@ var Tools = class {
4847
4850
  /**
4848
4851
  * Delete a tool
4849
4852
  *
4850
- * Deletes a tool by ID. A tool that is a decider's backend is refused with `409 TOOL_HAS_DEPENDENTS`.
4853
+ * Deletes a tool by ID. A tool that is a decider's backend is refused with `409 TOOL_HAS_DEPENDENTS`, and so is one another project has accepted a share of, or one of its own project's ingestion rules converts with, until `force=true`. Every share of the tool is revoked when it is deleted; an ingestion rule keeps its `tool_id` and fails the documents it matches with `CONVERTER_FAILED` until repointed.
4851
4854
  */
4852
4855
  static deleteTool(options) {
4853
4856
  return (options.client ?? client).delete({
@@ -4858,7 +4861,8 @@ var Tools = class {
4858
4861
  /**
4859
4862
  * Get a tool
4860
4863
  *
4861
- * Returns a single tool by ID.
4864
+ * Returns a single tool by ID. A credential scoped to a project the tool is shared with, through an accepted share, reads its `id`, `name`, `description` and `parameters` only.
4865
+ *
4862
4866
  */
4863
4867
  static getTool(options) {
4864
4868
  return (options.client ?? client).get({
@@ -4889,6 +4893,8 @@ var Tools = class {
4889
4893
  * `preset_parameters` stored on the tool are pinned over the caller-supplied `input` before execution: a key the tool presets keeps its preset value even when `input` sets it. Keys the presets do not name are taken from `input` as sent.
4890
4894
  * Guardrails attached to the tool or to its project adjudicate the call before dispatch, composing project + tool scope. A call this route cannot await a decision on — class C (human sign-off), class D, or a class-B tripwire — is refused with `422 TOOL_DISPATCH_FAILED`, whose `meta` carries the `tool_id` and the `outcome`. A `pipeline` tool is adjudicated before its first step runs, and every step is adjudicated as the call of that tool it is.
4891
4895
  *
4896
+ * A credential scoped to a project the tool is shared with, through an accepted share, calls it in that project: the calling project's guardrails adjudicate it, it is metered there with `publisher_project_id`, and the tool receives the calling project as the `calling_project_id` tool context key.
4897
+ *
4892
4898
  */
4893
4899
  static callTool(options) {
4894
4900
  return (options.client ?? client).post({
@@ -7413,7 +7419,7 @@ const routes = {
7413
7419
  "get-agent": {
7414
7420
  serviceClass: "Agents",
7415
7421
  operationId: "getAgent",
7416
- description: "Returns a single agent by ID.",
7422
+ description: "Returns a single agent by ID. A credential scoped to a project the agent is shared with, through an accepted share, reads its `id` and `name` only.",
7417
7423
  moduleDocsUrl: "https://docs.naturali.ai/docs/modules/agents",
7418
7424
  httpMethod: "get",
7419
7425
  pathParams: ["project_id", "agent_id"],
@@ -7827,7 +7833,7 @@ const routes = {
7827
7833
  "delete-agent": {
7828
7834
  serviceClass: "Agents",
7829
7835
  operationId: "deleteAgent",
7830
- description: "Deletes an agent by ID. Fails with `409` if the agent has dependent generations or traces, unless `force=true` is passed, in which case those generations and traces are deleted along with the agent.",
7836
+ description: "Deletes an agent by ID. Fails with `409` if the agent has dependent generations or traces, or another project has accepted a share of it, unless `force=true` is passed, in which case those generations and traces are deleted along with the agent and the shares are revoked. Every share of the agent is revoked when it is deleted.",
7831
7837
  moduleDocsUrl: "https://docs.naturali.ai/docs/modules/agents",
7832
7838
  httpMethod: "delete",
7833
7839
  pathParams: ["project_id", "agent_id"],
@@ -7851,7 +7857,7 @@ const routes = {
7851
7857
  },
7852
7858
  {
7853
7859
  "name": "force",
7854
- "description": "When `true`, deletes the agent's dependent generations and traces instead of returning `409 AGENT_HAS_DEPENDENTS`.\n",
7860
+ "description": "When `true`, deletes the agent's dependent generations and traces, revokes its accepted shares and leaves its ingestion rules naming it instead of returning `409 AGENT_HAS_DEPENDENTS`.\n",
7855
7861
  "required": false,
7856
7862
  "type": "boolean",
7857
7863
  "in": "query"
@@ -7861,7 +7867,7 @@ const routes = {
7861
7867
  "create-agent-generation": {
7862
7868
  serviceClass: "Agents",
7863
7869
  operationId: "createAgentGeneration",
7864
- description: "Sends messages to the agent, resolves its tools, and runs the AI model loop. Background by default: returns `202 Accepted` with a `generation_id` to poll via `GET /v1/projects/{project_id}/generations/{generation_id}`. Pass `?wait=true` to block and receive the result inline, where client tools pause the generation and return `requires_action`. Streaming (`stream: true`) implies waiting. Pass `idempotency_key` to make a retry safe: a request whose key is already claimed runs nothing and answers `202` with the generation the key names.",
7870
+ description: "Sends messages to the agent, resolves its tools, and runs the AI model loop. Background by default: returns `202 Accepted` with a `generation_id` to poll via `GET /v1/projects/{project_id}/generations/{generation_id}`. Pass `?wait=true` to block and receive the result inline, where client tools pause the generation and return `requires_action`. Streaming (`stream: true`) implies waiting. Pass `idempotency_key` to make a retry safe: a request whose key is already claimed runs nothing and answers `202` with the generation the key names. A credential scoped to a project the agent is shared with, through an accepted share, runs it in that project: on the publisher's configuration, recorded, metered and governed in the grantee project.",
7865
7871
  moduleDocsUrl: "https://docs.naturali.ai/docs/modules/agents",
7866
7872
  httpMethod: "post",
7867
7873
  pathParams: ["project_id", "agent_id"],
@@ -8868,6 +8874,13 @@ const routes = {
8868
8874
  "required": false,
8869
8875
  "type": "object",
8870
8876
  "in": "body"
8877
+ },
8878
+ {
8879
+ "name": "tool_context",
8880
+ "description": "Key-value pairs forwarded as context headers on the approved action and on every tool call of the continuation turn, as on a generation's `tool_context`. Never stored on the item: supply it on the approve call itself, for a tool that authorizes with a credential minted at decision time. The server-pinned identity keys (`session_id`, `actor_id`, `actor_external_id`) are dropped. An invalid or colliding key is rejected with `400 INVALID_TOOL_CONTEXT_KEY` and nothing is resolved.",
8881
+ "required": false,
8882
+ "type": "object",
8883
+ "in": "body"
8871
8884
  }
8872
8885
  ]
8873
8886
  },
@@ -12441,7 +12454,7 @@ const routes = {
12441
12454
  },
12442
12455
  {
12443
12456
  "name": "scorers",
12444
- "description": "Scorer configs, a discriminated union on `type`. Each type may appear at most once. Every scorer produces `{ score: 0–1, passed: boolean }`; binary scorers emit 0 or 1.\n\n`exact_match` compares the trimmed output text to `expected_output`. `contains` looks for `value` in the output text. `json_logic` evaluates `expression` over `{ input, output, object, expected, item.metadata }`, where `object` is the structured output (absent when the agent has no `output_schema`). `output_schema` validates the structured output against the scorer's own `schema`, falling back to the agent's; it requires the agent to carry an `output_schema`, because without one the platform emits no structured output and every item would score 0.\n\n`llm_judge` grades the output with a model completion, returning a continuous score plus its `reasoning`. Its `pass_threshold` is required: a continuous score says nothing about where \"good enough\" is, and a defaulted cutoff would silently decide the gate.\n\n`embedding_similarity` embeds the output text and `expected_output` with the platform's configured embedding model (`EMBEDDING_PROVIDER` / `EMBEDDING_MODEL` — the same stack document ingestion uses) and scores their cosine similarity, clamped to 0-1. Its `pass_threshold` is required for the same reason as the judge's. An item without an `expected_output` scores 0; an embedding backend failure marks the **item** errored, never a score of 0.\n\n`tool` runs a custom scoring algorithm: a server-callable project tool the engine invokes once per item with the item's context. Unlike the built-in types it may appear several times, each under a distinct `name` — outcomes and aggregates key on the name.",
12457
+ "description": "Scorer configs, a discriminated union on `type`. Each type may appear at most once. Every scorer produces `{ score: 0–1, passed: boolean }`; binary scorers emit 0 or 1.\n\n`exact_match` compares the trimmed output text to `expected_output`. `contains` looks for `value` in the output text. `json_logic` evaluates `expression` over `{ input, output, object, expected, item.metadata }`, where `object` is the structured output (absent when the agent has no `output_schema`). `output_schema` validates the structured output against the scorer's own `schema`, falling back to the agent's; it requires the agent to carry an `output_schema`, because without one the platform emits no structured output and every item would score 0.\n\n`llm_judge` grades the output with a model completion, returning a continuous score plus its `reasoning`. Its `pass_threshold` is required: a continuous score says nothing about where \"good enough\" is, and a defaulted cutoff would silently decide the gate.\n\n`embedding_similarity` embeds the output text and `expected_output` with the platform's configured embedding model (`EMBEDDING_PROVIDER` / `EMBEDDING_MODEL` — the same stack document ingestion uses) and scores their cosine similarity, clamped to 0-1. Its `pass_threshold` is required for the same reason as the judge's. An item without an `expected_output` scores 0; an embedding backend failure marks the **item** errored, never a score of 0.\n\n`tool` runs a custom scoring algorithm: a server-callable project tool the engine invokes once per item with the item's context. Unlike the built-in types it may appear several times, each under a distinct `name` — outcomes and aggregates key on the name.\n\n`decider` grades each item with a decision of a project decider: its `score` expression reads the decision's `answers`. Like `tool`, it keys on its `name` and may appear several times.",
12445
12458
  "required": true,
12446
12459
  "type": "array",
12447
12460
  "in": "body"
@@ -12452,6 +12465,13 @@ const routes = {
12452
12465
  "required": false,
12453
12466
  "type": "number",
12454
12467
  "in": "body"
12468
+ },
12469
+ {
12470
+ "name": "group_by",
12471
+ "description": "A key of the items' `metadata`. A run rolls its scores up per string value of that key in `aggregate_scores.grouping`. Null reports no grouping.",
12472
+ "required": false,
12473
+ "type": "string",
12474
+ "in": "body"
12455
12475
  }
12456
12476
  ]
12457
12477
  },
@@ -12527,7 +12547,7 @@ const routes = {
12527
12547
  },
12528
12548
  {
12529
12549
  "name": "scorers",
12530
- "description": "Scorer configs, a discriminated union on `type`. Each type may appear at most once. Every scorer produces `{ score: 0–1, passed: boolean }`; binary scorers emit 0 or 1.\n\n`exact_match` compares the trimmed output text to `expected_output`. `contains` looks for `value` in the output text. `json_logic` evaluates `expression` over `{ input, output, object, expected, item.metadata }`, where `object` is the structured output (absent when the agent has no `output_schema`). `output_schema` validates the structured output against the scorer's own `schema`, falling back to the agent's; it requires the agent to carry an `output_schema`, because without one the platform emits no structured output and every item would score 0.\n\n`llm_judge` grades the output with a model completion, returning a continuous score plus its `reasoning`. Its `pass_threshold` is required: a continuous score says nothing about where \"good enough\" is, and a defaulted cutoff would silently decide the gate.\n\n`embedding_similarity` embeds the output text and `expected_output` with the platform's configured embedding model (`EMBEDDING_PROVIDER` / `EMBEDDING_MODEL` — the same stack document ingestion uses) and scores their cosine similarity, clamped to 0-1. Its `pass_threshold` is required for the same reason as the judge's. An item without an `expected_output` scores 0; an embedding backend failure marks the **item** errored, never a score of 0.\n\n`tool` runs a custom scoring algorithm: a server-callable project tool the engine invokes once per item with the item's context. Unlike the built-in types it may appear several times, each under a distinct `name` — outcomes and aggregates key on the name.",
12550
+ "description": "Scorer configs, a discriminated union on `type`. Each type may appear at most once. Every scorer produces `{ score: 0–1, passed: boolean }`; binary scorers emit 0 or 1.\n\n`exact_match` compares the trimmed output text to `expected_output`. `contains` looks for `value` in the output text. `json_logic` evaluates `expression` over `{ input, output, object, expected, item.metadata }`, where `object` is the structured output (absent when the agent has no `output_schema`). `output_schema` validates the structured output against the scorer's own `schema`, falling back to the agent's; it requires the agent to carry an `output_schema`, because without one the platform emits no structured output and every item would score 0.\n\n`llm_judge` grades the output with a model completion, returning a continuous score plus its `reasoning`. Its `pass_threshold` is required: a continuous score says nothing about where \"good enough\" is, and a defaulted cutoff would silently decide the gate.\n\n`embedding_similarity` embeds the output text and `expected_output` with the platform's configured embedding model (`EMBEDDING_PROVIDER` / `EMBEDDING_MODEL` — the same stack document ingestion uses) and scores their cosine similarity, clamped to 0-1. Its `pass_threshold` is required for the same reason as the judge's. An item without an `expected_output` scores 0; an embedding backend failure marks the **item** errored, never a score of 0.\n\n`tool` runs a custom scoring algorithm: a server-callable project tool the engine invokes once per item with the item's context. Unlike the built-in types it may appear several times, each under a distinct `name` — outcomes and aggregates key on the name.\n\n`decider` grades each item with a decision of a project decider: its `score` expression reads the decision's `answers`. Like `tool`, it keys on its `name` and may appear several times.",
12531
12551
  "required": false,
12532
12552
  "type": "array",
12533
12553
  "in": "body"
@@ -12538,6 +12558,13 @@ const routes = {
12538
12558
  "required": false,
12539
12559
  "type": "number",
12540
12560
  "in": "body"
12561
+ },
12562
+ {
12563
+ "name": "group_by",
12564
+ "description": "A key of the items' `metadata` to group run scores by; null clears it, omitting it leaves it unchanged.",
12565
+ "required": false,
12566
+ "type": "string",
12567
+ "in": "body"
12541
12568
  }
12542
12569
  ]
12543
12570
  },
@@ -18219,7 +18246,7 @@ const routes = {
18219
18246
  },
18220
18247
  {
18221
18248
  "name": "agent_id",
18222
- "description": "Agent this session belongs to",
18249
+ "description": "Agent this session belongs to. With a credential scoped to a project, it may also be an agent another project shares with that project; the session is then that project's.\n",
18223
18250
  "required": true,
18224
18251
  "type": "string",
18225
18252
  "in": "body"
@@ -19244,7 +19271,7 @@ const routes = {
19244
19271
  "get-tool": {
19245
19272
  serviceClass: "Tools",
19246
19273
  operationId: "getTool",
19247
- description: "Returns a single tool by ID.",
19274
+ description: "Returns a single tool by ID. A credential scoped to a project the tool is shared with, through an accepted share, reads its `id`, `name`, `description` and `parameters` only.",
19248
19275
  moduleDocsUrl: "https://docs.naturali.ai/docs/modules/tools",
19249
19276
  httpMethod: "get",
19250
19277
  pathParams: ["project_id", "tool_id"],
@@ -19386,31 +19413,41 @@ const routes = {
19386
19413
  "delete-tool": {
19387
19414
  serviceClass: "Tools",
19388
19415
  operationId: "deleteTool",
19389
- description: "Deletes a tool by ID. A tool that is a decider's backend is refused with `409 TOOL_HAS_DEPENDENTS`.",
19416
+ description: "Deletes a tool by ID. A tool that is a decider's backend is refused with `409 TOOL_HAS_DEPENDENTS`, and so is one another project has accepted a share of, or one of its own project's ingestion rules converts with, until `force=true`. Every share of the tool is revoked when it is deleted; an ingestion rule keeps its `tool_id` and fails the documents it matches with `CONVERTER_FAILED` until repointed.",
19390
19417
  moduleDocsUrl: "https://docs.naturali.ai/docs/modules/tools",
19391
19418
  httpMethod: "delete",
19392
19419
  pathParams: ["project_id", "tool_id"],
19393
- queryParams: [],
19420
+ queryParams: ["force"],
19394
19421
  headerParams: [],
19395
19422
  cookieParams: [],
19396
- flags: [{
19397
- "name": "project_id",
19398
- "description": "Project public ID (proj_ prefix).",
19399
- "required": true,
19400
- "type": "string",
19401
- "in": "path"
19402
- }, {
19403
- "name": "tool_id",
19404
- "description": "",
19405
- "required": true,
19406
- "type": "string",
19407
- "in": "path"
19408
- }]
19423
+ flags: [
19424
+ {
19425
+ "name": "project_id",
19426
+ "description": "Project public ID (proj_ prefix).",
19427
+ "required": true,
19428
+ "type": "string",
19429
+ "in": "path"
19430
+ },
19431
+ {
19432
+ "name": "tool_id",
19433
+ "description": "",
19434
+ "required": true,
19435
+ "type": "string",
19436
+ "in": "path"
19437
+ },
19438
+ {
19439
+ "name": "force",
19440
+ "description": "Delete the tool even when another project has accepted a share of it, revoking those shares, or an ingestion rule converts with it. A decider backend still refuses.",
19441
+ "required": false,
19442
+ "type": "boolean",
19443
+ "in": "query"
19444
+ }
19445
+ ]
19409
19446
  },
19410
19447
  "call-tool": {
19411
19448
  serviceClass: "Tools",
19412
19449
  operationId: "callTool",
19413
- description: "Directly invokes a tool and returns its output. Supported for `http`, `mcp`, and `pipeline` tools. `client` tools cannot be invoked server-side and will return 422. A `pipeline` tool runs its declared steps in order and returns the mapped `output` (or the last step's output); `action` is ignored and `input` is the pipeline input. For `mcp` tools the `action` field is required and identifies which tool name to invoke. For `http` tools `action` is ignored. When an `mcp` tool declares an `actions` allowlist, an action outside it is rejected with `400 VALIDATION_FAILED` (\"not available on this tool\") before any outbound request is made. `preset_parameters` stored on the tool are pinned over the caller-supplied `input` before execution: a key the tool presets keeps its preset value even when `input` sets it. Keys the presets do not name are taken from `input` as sent. Guardrails attached to the tool or to its project adjudicate the call before dispatch, composing project + tool scope. A call this route cannot await a decision on — class C (human sign-off), class D, or a class-B tripwire — is refused with `422 TOOL_DISPATCH_FAILED`, whose `meta` carries the `tool_id` and the `outcome`. A `pipeline` tool is adjudicated before its first step runs, and every step is adjudicated as the call of that tool it is.",
19450
+ description: "Directly invokes a tool and returns its output. Supported for `http`, `mcp`, and `pipeline` tools. `client` tools cannot be invoked server-side and will return 422. A `pipeline` tool runs its declared steps in order and returns the mapped `output` (or the last step's output); `action` is ignored and `input` is the pipeline input. For `mcp` tools the `action` field is required and identifies which tool name to invoke. For `http` tools `action` is ignored. When an `mcp` tool declares an `actions` allowlist, an action outside it is rejected with `400 VALIDATION_FAILED` (\"not available on this tool\") before any outbound request is made. `preset_parameters` stored on the tool are pinned over the caller-supplied `input` before execution: a key the tool presets keeps its preset value even when `input` sets it. Keys the presets do not name are taken from `input` as sent. Guardrails attached to the tool or to its project adjudicate the call before dispatch, composing project + tool scope. A call this route cannot await a decision on — class C (human sign-off), class D, or a class-B tripwire — is refused with `422 TOOL_DISPATCH_FAILED`, whose `meta` carries the `tool_id` and the `outcome`. A `pipeline` tool is adjudicated before its first step runs, and every step is adjudicated as the call of that tool it is. A credential scoped to a project the tool is shared with, through an accepted share, calls it in that project: the calling project's guardrails adjudicate it, it is metered there with `publisher_project_id`, and the tool receives the calling project as the `calling_project_id` tool context key.",
19414
19451
  moduleDocsUrl: "https://docs.naturali.ai/docs/modules/tools",
19415
19452
  httpMethod: "post",
19416
19453
  pathParams: ["project_id", "tool_id"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/cli",
3
- "version": "0.162.1",
3
+ "version": "0.162.3",
4
4
  "description": "Command-line interface for the naturali.ai API, generated from its OpenAPI specs",
5
5
  "type": "module",
6
6
  "bin": {
@@ -25,7 +25,7 @@
25
25
  "yaml": "^2.9.1"
26
26
  },
27
27
  "devDependencies": {
28
- "@naturali/sdk": "0.162.1",
28
+ "@naturali/sdk": "0.162.3",
29
29
  "@ttoss/openapi-codegen": "^0.5.0",
30
30
  "@types/node": "^26.5.1",
31
31
  "tsdown": "^0.23.0",