@naturali/cli 0.64.0 → 0.66.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 +262 -12
  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.64.0";
17
+ var version = "0.66.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) };
@@ -1453,7 +1453,7 @@ var Knowledge = class {
1453
1453
  /**
1454
1454
  * Query a collection (retrieval preview)
1455
1455
  *
1456
- * Retrieval preview (API.md §4, K5): returns the chunks the collection would surface for a question — debuggable standalone, before any agent is bound to it. This is the `…:query` action; the path segment is `{collection_id}:query`.
1456
+ * Retrieval preview: returns the chunks the collection would surface for a question — debuggable standalone, before any agent is bound to it. This is the `…:query` action; the path segment is `{collection_id}:query`.
1457
1457
  *
1458
1458
  */
1459
1459
  static queryKnowledgeCollection(options) {
@@ -1520,7 +1520,7 @@ var Knowledge = class {
1520
1520
  /**
1521
1521
  * Re-ingest a document
1522
1522
  *
1523
- * Re-run ingestion for a document against its stored source, resetting it to `pending` before re-processing — the recovery path for a `failed` ingest (API.md §4, K1). This is the `…:reingest` action; the path segment is `{document_id}:reingest`.
1523
+ * Re-run ingestion for a document against its stored source, resetting it to `pending` before re-processing — the recovery path for a `failed` ingest. This is the `…:reingest` action; the path segment is `{document_id}:reingest`.
1524
1524
  *
1525
1525
  */
1526
1526
  static reingestKnowledgeDocument(options) {
@@ -1610,6 +1610,71 @@ var Knowledge = class {
1610
1610
  });
1611
1611
  }
1612
1612
  };
1613
+ var ModelRoutes = class {
1614
+ /**
1615
+ * List model routes
1616
+ *
1617
+ * Returns the model routes defined in a project
1618
+ */
1619
+ static listModelRoutes(options) {
1620
+ return (options.client ?? client).get({
1621
+ url: "/v1/projects/{project_id}/model-routes",
1622
+ ...options
1623
+ });
1624
+ }
1625
+ /**
1626
+ * Create a model route
1627
+ *
1628
+ * Creates a project-scoped model route: a named, ordered list of provider+model targets tried in array order. Every target must reference an AI provider in the same project (400 otherwise), and the total attempt budget — the sum of `1 + max_retries` over all targets — may not exceed 10 (400 naming the computed total). A duplicate `name` in the project is rejected with 409.
1629
+ */
1630
+ static createModelRoute(options) {
1631
+ return (options.client ?? client).post({
1632
+ url: "/v1/projects/{project_id}/model-routes",
1633
+ ...options,
1634
+ headers: {
1635
+ "Content-Type": "application/json",
1636
+ ...options.headers
1637
+ }
1638
+ });
1639
+ }
1640
+ /**
1641
+ * Delete a model route
1642
+ *
1643
+ * Deletes a model route. Returns 409 when an agent still references it — a routed agent has no pinned provider to fall back on, so the reference must be repointed or the agent deleted first.
1644
+ */
1645
+ static deleteModelRoute(options) {
1646
+ return (options.client ?? client).delete({
1647
+ url: "/v1/projects/{project_id}/model-routes/{route_id}",
1648
+ ...options
1649
+ });
1650
+ }
1651
+ /**
1652
+ * Get a model route
1653
+ *
1654
+ * Returns a specific model route
1655
+ */
1656
+ static getModelRoute(options) {
1657
+ return (options.client ?? client).get({
1658
+ url: "/v1/projects/{project_id}/model-routes/{route_id}",
1659
+ ...options
1660
+ });
1661
+ }
1662
+ /**
1663
+ * Update a model route
1664
+ *
1665
+ * Updates a model route's name, targets, retry classes, or breaker configuration. Omitted fields are left unchanged.
1666
+ */
1667
+ static updateModelRoute(options) {
1668
+ return (options.client ?? client).put({
1669
+ url: "/v1/projects/{project_id}/model-routes/{route_id}",
1670
+ ...options,
1671
+ headers: {
1672
+ "Content-Type": "application/json",
1673
+ ...options.headers
1674
+ }
1675
+ });
1676
+ }
1677
+ };
1613
1678
  var Models = class {
1614
1679
  /**
1615
1680
  * List models
@@ -2543,6 +2608,7 @@ var NaturaliClient = class {
2543
2608
  channels;
2544
2609
  generations;
2545
2610
  knowledge;
2611
+ modelRoutes;
2546
2612
  models;
2547
2613
  orchestrations;
2548
2614
  projects;
@@ -2572,6 +2638,7 @@ var NaturaliClient = class {
2572
2638
  this.channels = bindResource(Channels, this.http);
2573
2639
  this.generations = bindResource(Generations, this.http);
2574
2640
  this.knowledge = bindResource(Knowledge, this.http);
2641
+ this.modelRoutes = bindResource(ModelRoutes, this.http);
2575
2642
  this.models = bindResource(Models, this.http);
2576
2643
  this.orchestrations = bindResource(Orchestrations, this.http);
2577
2644
  this.projects = bindResource(Projects, this.http);
@@ -2596,6 +2663,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
2596
2663
  Channels: () => Channels,
2597
2664
  Generations: () => Generations,
2598
2665
  Knowledge: () => Knowledge,
2666
+ ModelRoutes: () => ModelRoutes,
2599
2667
  Models: () => Models,
2600
2668
  NaturaliClient: () => NaturaliClient,
2601
2669
  Orchestrations: () => Orchestrations,
@@ -3054,13 +3122,6 @@ const routes = {
3054
3122
  "required": false,
3055
3123
  "type": "string",
3056
3124
  "in": "body"
3057
- },
3058
- {
3059
- "name": "memory",
3060
- "description": "Give the actor its own memory container, so an agent remembers it across sessions. Applied on creation only — a call that returns an existing actor leaves its memory as it was.\n",
3061
- "required": false,
3062
- "type": "boolean",
3063
- "in": "body"
3064
3125
  }
3065
3126
  ]
3066
3127
  },
@@ -5196,7 +5257,7 @@ const routes = {
5196
5257
  "query-knowledge-collection": {
5197
5258
  serviceClass: "Knowledge",
5198
5259
  operationId: "queryKnowledgeCollection",
5199
- description: "Retrieval preview (API.md §4, K5): returns the chunks the collection would surface for a question — debuggable standalone, before any agent is bound to it. This is the `…:query` action; the path segment is `{collection_id}:query`.",
5260
+ description: "Retrieval preview: returns the chunks the collection would surface for a question — debuggable standalone, before any agent is bound to it. This is the `…:query` action; the path segment is `{collection_id}:query`.",
5200
5261
  moduleDocsUrl: "https://docs.naturali.ai/docs/modules/knowledge",
5201
5262
  httpMethod: "post",
5202
5263
  pathParams: ["project_id", "collection_id"],
@@ -5434,7 +5495,7 @@ const routes = {
5434
5495
  "reingest-knowledge-document": {
5435
5496
  serviceClass: "Knowledge",
5436
5497
  operationId: "reingestKnowledgeDocument",
5437
- description: "Re-run ingestion for a document against its stored source, resetting it to `pending` before re-processing — the recovery path for a `failed` ingest (API.md §4, K1). This is the `…:reingest` action; the path segment is `{document_id}:reingest`.",
5498
+ description: "Re-run ingestion for a document against its stored source, resetting it to `pending` before re-processing — the recovery path for a `failed` ingest. This is the `…:reingest` action; the path segment is `{document_id}:reingest`.",
5438
5499
  moduleDocsUrl: "https://docs.naturali.ai/docs/modules/knowledge",
5439
5500
  httpMethod: "post",
5440
5501
  pathParams: [
@@ -5698,6 +5759,195 @@ const routes = {
5698
5759
  "in": "path"
5699
5760
  }]
5700
5761
  },
5762
+ "list-model-routes": {
5763
+ serviceClass: "ModelRoutes",
5764
+ operationId: "listModelRoutes",
5765
+ description: "Returns the model routes defined in a project",
5766
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/model-routes",
5767
+ httpMethod: "get",
5768
+ pathParams: ["project_id"],
5769
+ queryParams: ["limit", "offset"],
5770
+ flags: [
5771
+ {
5772
+ "name": "project_id",
5773
+ "description": "Project public ID (proj_ prefix).",
5774
+ "required": true,
5775
+ "type": "string",
5776
+ "in": "path"
5777
+ },
5778
+ {
5779
+ "name": "limit",
5780
+ "description": "Maximum number of results to return",
5781
+ "required": false,
5782
+ "type": "integer",
5783
+ "in": "query"
5784
+ },
5785
+ {
5786
+ "name": "offset",
5787
+ "description": "Number of results to skip",
5788
+ "required": false,
5789
+ "type": "integer",
5790
+ "in": "query"
5791
+ }
5792
+ ]
5793
+ },
5794
+ "create-model-route": {
5795
+ serviceClass: "ModelRoutes",
5796
+ operationId: "createModelRoute",
5797
+ description: "Creates a project-scoped model route: a named, ordered list of provider+model targets tried in array order. Every target must reference an AI provider in the same project (400 otherwise), and the total attempt budget — the sum of `1 + max_retries` over all targets — may not exceed 10 (400 naming the computed total). A duplicate `name` in the project is rejected with 409.",
5798
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/model-routes",
5799
+ httpMethod: "post",
5800
+ pathParams: ["project_id"],
5801
+ queryParams: [],
5802
+ flags: [
5803
+ {
5804
+ "name": "project_id",
5805
+ "description": "Project public ID (proj_ prefix).",
5806
+ "required": true,
5807
+ "type": "string",
5808
+ "in": "path"
5809
+ },
5810
+ {
5811
+ "name": "name",
5812
+ "description": "Human-readable name, unique per project",
5813
+ "required": true,
5814
+ "type": "string",
5815
+ "in": "body"
5816
+ },
5817
+ {
5818
+ "name": "targets",
5819
+ "description": "Ordered failover targets. Position is priority: target 0 is tried first, and a retryable failure falls through to the next target.",
5820
+ "required": true,
5821
+ "type": "array",
5822
+ "in": "body"
5823
+ },
5824
+ {
5825
+ "name": "retry_on",
5826
+ "description": "Which failure classes are failover-eligible. A failure whose class is not listed (and every deterministic failure — 400-class, auth, content policy) fails the generation immediately instead of spending another target's budget.",
5827
+ "required": false,
5828
+ "type": "array",
5829
+ "in": "body"
5830
+ },
5831
+ {
5832
+ "name": "failure_threshold",
5833
+ "description": "Consecutive retryable failures after which a target is skipped for `cooldown_seconds`. Breaker state is in-process per node and keyed by (provider, model), so it is shared by every route pointing at the same backend.",
5834
+ "required": false,
5835
+ "type": "integer",
5836
+ "in": "body"
5837
+ },
5838
+ {
5839
+ "name": "cooldown_seconds",
5840
+ "description": "How long a tripped target is skipped before being probed again",
5841
+ "required": false,
5842
+ "type": "integer",
5843
+ "in": "body"
5844
+ }
5845
+ ]
5846
+ },
5847
+ "get-model-route": {
5848
+ serviceClass: "ModelRoutes",
5849
+ operationId: "getModelRoute",
5850
+ description: "Returns a specific model route",
5851
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/model-routes",
5852
+ httpMethod: "get",
5853
+ pathParams: ["project_id", "route_id"],
5854
+ queryParams: [],
5855
+ flags: [{
5856
+ "name": "project_id",
5857
+ "description": "Project public ID (proj_ prefix).",
5858
+ "required": true,
5859
+ "type": "string",
5860
+ "in": "path"
5861
+ }, {
5862
+ "name": "route_id",
5863
+ "description": "Model route ID",
5864
+ "required": true,
5865
+ "type": "string",
5866
+ "in": "path"
5867
+ }]
5868
+ },
5869
+ "update-model-route": {
5870
+ serviceClass: "ModelRoutes",
5871
+ operationId: "updateModelRoute",
5872
+ description: "Updates a model route's name, targets, retry classes, or breaker configuration. Omitted fields are left unchanged.",
5873
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/model-routes",
5874
+ httpMethod: "put",
5875
+ pathParams: ["project_id", "route_id"],
5876
+ queryParams: [],
5877
+ flags: [
5878
+ {
5879
+ "name": "project_id",
5880
+ "description": "Project public ID (proj_ prefix).",
5881
+ "required": true,
5882
+ "type": "string",
5883
+ "in": "path"
5884
+ },
5885
+ {
5886
+ "name": "route_id",
5887
+ "description": "Model route ID",
5888
+ "required": true,
5889
+ "type": "string",
5890
+ "in": "path"
5891
+ },
5892
+ {
5893
+ "name": "name",
5894
+ "description": "New name (unique per project)",
5895
+ "required": false,
5896
+ "type": "string",
5897
+ "in": "body"
5898
+ },
5899
+ {
5900
+ "name": "targets",
5901
+ "description": "Replacement target list (ordered)",
5902
+ "required": false,
5903
+ "type": "array",
5904
+ "in": "body"
5905
+ },
5906
+ {
5907
+ "name": "retry_on",
5908
+ "description": "",
5909
+ "required": false,
5910
+ "type": "array",
5911
+ "in": "body"
5912
+ },
5913
+ {
5914
+ "name": "failure_threshold",
5915
+ "description": "",
5916
+ "required": false,
5917
+ "type": "integer",
5918
+ "in": "body"
5919
+ },
5920
+ {
5921
+ "name": "cooldown_seconds",
5922
+ "description": "",
5923
+ "required": false,
5924
+ "type": "integer",
5925
+ "in": "body"
5926
+ }
5927
+ ]
5928
+ },
5929
+ "delete-model-route": {
5930
+ serviceClass: "ModelRoutes",
5931
+ operationId: "deleteModelRoute",
5932
+ description: "Deletes a model route. Returns 409 when an agent still references it — a routed agent has no pinned provider to fall back on, so the reference must be repointed or the agent deleted first.",
5933
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/model-routes",
5934
+ httpMethod: "delete",
5935
+ pathParams: ["project_id", "route_id"],
5936
+ queryParams: [],
5937
+ flags: [{
5938
+ "name": "project_id",
5939
+ "description": "Project public ID (proj_ prefix).",
5940
+ "required": true,
5941
+ "type": "string",
5942
+ "in": "path"
5943
+ }, {
5944
+ "name": "route_id",
5945
+ "description": "Model route ID",
5946
+ "required": true,
5947
+ "type": "string",
5948
+ "in": "path"
5949
+ }]
5950
+ },
5701
5951
  "list-models": {
5702
5952
  serviceClass: "Models",
5703
5953
  operationId: "listModels",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/cli",
3
- "version": "0.64.0",
3
+ "version": "0.66.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.64.0"
33
+ "@naturali/sdk": "0.66.0"
34
34
  },
35
35
  "scripts": {
36
36
  "generate": "tsx scripts/generate.ts",