@naturali/cli 0.162.0 → 0.162.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.mjs +59 -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.0";
20
+ var version = "0.162.2";
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"],
@@ -12441,7 +12447,7 @@ const routes = {
12441
12447
  },
12442
12448
  {
12443
12449
  "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.",
12450
+ "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
12451
  "required": true,
12446
12452
  "type": "array",
12447
12453
  "in": "body"
@@ -12452,6 +12458,13 @@ const routes = {
12452
12458
  "required": false,
12453
12459
  "type": "number",
12454
12460
  "in": "body"
12461
+ },
12462
+ {
12463
+ "name": "group_by",
12464
+ "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.",
12465
+ "required": false,
12466
+ "type": "string",
12467
+ "in": "body"
12455
12468
  }
12456
12469
  ]
12457
12470
  },
@@ -12527,7 +12540,7 @@ const routes = {
12527
12540
  },
12528
12541
  {
12529
12542
  "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.",
12543
+ "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
12544
  "required": false,
12532
12545
  "type": "array",
12533
12546
  "in": "body"
@@ -12538,6 +12551,13 @@ const routes = {
12538
12551
  "required": false,
12539
12552
  "type": "number",
12540
12553
  "in": "body"
12554
+ },
12555
+ {
12556
+ "name": "group_by",
12557
+ "description": "A key of the items' `metadata` to group run scores by; null clears it, omitting it leaves it unchanged.",
12558
+ "required": false,
12559
+ "type": "string",
12560
+ "in": "body"
12541
12561
  }
12542
12562
  ]
12543
12563
  },
@@ -18219,7 +18239,7 @@ const routes = {
18219
18239
  },
18220
18240
  {
18221
18241
  "name": "agent_id",
18222
- "description": "Agent this session belongs to",
18242
+ "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
18243
  "required": true,
18224
18244
  "type": "string",
18225
18245
  "in": "body"
@@ -19244,7 +19264,7 @@ const routes = {
19244
19264
  "get-tool": {
19245
19265
  serviceClass: "Tools",
19246
19266
  operationId: "getTool",
19247
- description: "Returns a single tool by ID.",
19267
+ 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
19268
  moduleDocsUrl: "https://docs.naturali.ai/docs/modules/tools",
19249
19269
  httpMethod: "get",
19250
19270
  pathParams: ["project_id", "tool_id"],
@@ -19386,31 +19406,41 @@ const routes = {
19386
19406
  "delete-tool": {
19387
19407
  serviceClass: "Tools",
19388
19408
  operationId: "deleteTool",
19389
- description: "Deletes a tool by ID. A tool that is a decider's backend is refused with `409 TOOL_HAS_DEPENDENTS`.",
19409
+ 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
19410
  moduleDocsUrl: "https://docs.naturali.ai/docs/modules/tools",
19391
19411
  httpMethod: "delete",
19392
19412
  pathParams: ["project_id", "tool_id"],
19393
- queryParams: [],
19413
+ queryParams: ["force"],
19394
19414
  headerParams: [],
19395
19415
  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
- }]
19416
+ flags: [
19417
+ {
19418
+ "name": "project_id",
19419
+ "description": "Project public ID (proj_ prefix).",
19420
+ "required": true,
19421
+ "type": "string",
19422
+ "in": "path"
19423
+ },
19424
+ {
19425
+ "name": "tool_id",
19426
+ "description": "",
19427
+ "required": true,
19428
+ "type": "string",
19429
+ "in": "path"
19430
+ },
19431
+ {
19432
+ "name": "force",
19433
+ "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.",
19434
+ "required": false,
19435
+ "type": "boolean",
19436
+ "in": "query"
19437
+ }
19438
+ ]
19409
19439
  },
19410
19440
  "call-tool": {
19411
19441
  serviceClass: "Tools",
19412
19442
  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.",
19443
+ 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
19444
  moduleDocsUrl: "https://docs.naturali.ai/docs/modules/tools",
19415
19445
  httpMethod: "post",
19416
19446
  pathParams: ["project_id", "tool_id"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/cli",
3
- "version": "0.162.0",
3
+ "version": "0.162.2",
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.0",
28
+ "@naturali/sdk": "0.162.2",
29
29
  "@ttoss/openapi-codegen": "^0.5.0",
30
30
  "@types/node": "^26.5.1",
31
31
  "tsdown": "^0.23.0",