@naturali/cli 0.28.0 → 0.28.1

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 (3) hide show
  1. package/README.md +13 -0
  2. package/dist/index.mjs +57 -57
  3. package/package.json +4 -3
package/README.md CHANGED
@@ -88,6 +88,19 @@ pipeline.
88
88
  Hand-written source is limited to dispatch, flag parsing, credentials and help;
89
89
  there is no per-endpoint code.
90
90
 
91
+ ## Testing
92
+
93
+ `pnpm test` runs the unit suite against a mocked `fetch` — flag parsing,
94
+ dispatch, and help output, on every pull request.
95
+
96
+ `pnpm e2e` (`tests/e2e/smoke.ts`) is different: it drives the *built* CLI
97
+ binary (`bin/naturali`) as real subprocesses against the real, deployed API,
98
+ using a `NATURALI_E2E_API_KEY` account-scoped key. It proves the one thing the
99
+ mocked suite can't — that the CLI, the `@naturali/sdk` it bundles, and the live
100
+ API actually agree — and it provisions and archives its own throwaway project.
101
+ It costs real model-provider money, so it only runs as part of the `e2e` job in
102
+ [`main.yml`](../../.github/workflows/main.yml), never on pull requests.
103
+
91
104
  ## Versioning
92
105
 
93
106
  Releases are automatic, and the version is **shared with the API and with
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.28.0";
17
+ var version = "0.28.1";
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) };
@@ -1299,7 +1299,7 @@ var Knowledge = class {
1299
1299
  */
1300
1300
  static queryKnowledgeCollection(options) {
1301
1301
  return (options.client ?? client).post({
1302
- url: "/v1/projects/{project_id}/knowledge/collections/{collection_id}",
1302
+ url: "/v1/projects/{project_id}/knowledge/collections/{collection_id}:query",
1303
1303
  ...options,
1304
1304
  headers: {
1305
1305
  "Content-Type": "application/json",
@@ -1362,7 +1362,7 @@ var Knowledge = class {
1362
1362
  */
1363
1363
  static reingestKnowledgeDocument(options) {
1364
1364
  return (options.client ?? client).post({
1365
- url: "/v1/projects/{project_id}/knowledge/collections/{collection_id}/documents/{document_id}",
1365
+ url: "/v1/projects/{project_id}/knowledge/collections/{collection_id}/documents/{document_id}:reingest",
1366
1366
  ...options
1367
1367
  });
1368
1368
  }
@@ -3779,52 +3779,6 @@ const routes = {
3779
3779
  "in": "path"
3780
3780
  }]
3781
3781
  },
3782
- "query-knowledge-collection": {
3783
- serviceClass: "Knowledge",
3784
- operationId: "queryKnowledgeCollection",
3785
- 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`.",
3786
- moduleDocsUrl: "https://docs.naturali.ai/docs/modules/knowledge",
3787
- httpMethod: "post",
3788
- pathParams: ["project_id", "collection_id"],
3789
- queryParams: [],
3790
- flags: [
3791
- {
3792
- "name": "project_id",
3793
- "description": "Project public ID (proj_ prefix).",
3794
- "required": true,
3795
- "type": "string",
3796
- "in": "path"
3797
- },
3798
- {
3799
- "name": "collection_id",
3800
- "description": "Knowledge collection public ID (kcol_ prefix).",
3801
- "required": true,
3802
- "type": "string",
3803
- "in": "path"
3804
- },
3805
- {
3806
- "name": "query",
3807
- "description": "The question to preview retrieval for.",
3808
- "required": true,
3809
- "type": "string",
3810
- "in": "body"
3811
- },
3812
- {
3813
- "name": "top_k",
3814
- "description": "Maximum chunks to return.",
3815
- "required": false,
3816
- "type": "integer",
3817
- "in": "body"
3818
- },
3819
- {
3820
- "name": "min_score",
3821
- "description": "Drop chunks below this similarity score.",
3822
- "required": false,
3823
- "type": "number",
3824
- "in": "body"
3825
- }
3826
- ]
3827
- },
3828
3782
  "update-knowledge-collection": {
3829
3783
  serviceClass: "Knowledge",
3830
3784
  operationId: "updateKnowledgeCollection",
@@ -3886,6 +3840,52 @@ const routes = {
3886
3840
  "in": "path"
3887
3841
  }]
3888
3842
  },
3843
+ "query-knowledge-collection": {
3844
+ serviceClass: "Knowledge",
3845
+ operationId: "queryKnowledgeCollection",
3846
+ 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`.",
3847
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/knowledge",
3848
+ httpMethod: "post",
3849
+ pathParams: ["project_id", "collection_id"],
3850
+ queryParams: [],
3851
+ flags: [
3852
+ {
3853
+ "name": "project_id",
3854
+ "description": "Project public ID (proj_ prefix).",
3855
+ "required": true,
3856
+ "type": "string",
3857
+ "in": "path"
3858
+ },
3859
+ {
3860
+ "name": "collection_id",
3861
+ "description": "Knowledge collection public ID (kcol_ prefix).",
3862
+ "required": true,
3863
+ "type": "string",
3864
+ "in": "path"
3865
+ },
3866
+ {
3867
+ "name": "query",
3868
+ "description": "The question to preview retrieval for.",
3869
+ "required": true,
3870
+ "type": "string",
3871
+ "in": "body"
3872
+ },
3873
+ {
3874
+ "name": "top_k",
3875
+ "description": "Maximum chunks to return.",
3876
+ "required": false,
3877
+ "type": "integer",
3878
+ "in": "body"
3879
+ },
3880
+ {
3881
+ "name": "min_score",
3882
+ "description": "Drop chunks below this similarity score.",
3883
+ "required": false,
3884
+ "type": "number",
3885
+ "in": "body"
3886
+ }
3887
+ ]
3888
+ },
3889
3889
  "list-knowledge-documents": {
3890
3890
  serviceClass: "Knowledge",
3891
3891
  operationId: "listKnowledgeDocuments",
@@ -4007,12 +4007,12 @@ const routes = {
4007
4007
  }
4008
4008
  ]
4009
4009
  },
4010
- "reingest-knowledge-document": {
4010
+ "delete-knowledge-document": {
4011
4011
  serviceClass: "Knowledge",
4012
- operationId: "reingestKnowledgeDocument",
4013
- 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`.",
4012
+ operationId: "deleteKnowledgeDocument",
4013
+ description: "Delete a document",
4014
4014
  moduleDocsUrl: "https://docs.naturali.ai/docs/modules/knowledge",
4015
- httpMethod: "post",
4015
+ httpMethod: "delete",
4016
4016
  pathParams: [
4017
4017
  "project_id",
4018
4018
  "collection_id",
@@ -4043,12 +4043,12 @@ const routes = {
4043
4043
  }
4044
4044
  ]
4045
4045
  },
4046
- "delete-knowledge-document": {
4046
+ "reingest-knowledge-document": {
4047
4047
  serviceClass: "Knowledge",
4048
- operationId: "deleteKnowledgeDocument",
4049
- description: "Delete a document",
4048
+ operationId: "reingestKnowledgeDocument",
4049
+ 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`.",
4050
4050
  moduleDocsUrl: "https://docs.naturali.ai/docs/modules/knowledge",
4051
- httpMethod: "delete",
4051
+ httpMethod: "post",
4052
4052
  pathParams: [
4053
4053
  "project_id",
4054
4054
  "collection_id",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/cli",
3
- "version": "0.28.0",
3
+ "version": "0.28.1",
4
4
  "description": "Command-line interface for the naturali.ai API, generated from its OpenAPI specs",
5
5
  "type": "module",
6
6
  "bin": {
@@ -30,12 +30,13 @@
30
30
  "tsx": "^4.23.1",
31
31
  "typescript": "~6.0.3",
32
32
  "vitest": "^4.1.10",
33
- "@naturali/sdk": "0.28.0"
33
+ "@naturali/sdk": "0.28.1"
34
34
  },
35
35
  "scripts": {
36
36
  "generate": "tsx scripts/generate.ts",
37
37
  "typecheck": "tsc --noEmit",
38
38
  "test": "vitest run",
39
- "build": "tsdown"
39
+ "build": "tsdown",
40
+ "e2e": "tsx tests/e2e/smoke.ts"
40
41
  }
41
42
  }