@heossi/qnsi 0.3.3 → 0.4.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.
- package/CHANGELOG.md +1 -1
- package/README.md +12 -12
- package/dist/_activation/activation-client.d.ts +2 -2
- package/dist/_activation/activation-client.js +4 -4
- package/dist/_internal.d.ts +6 -6
- package/dist/_internal.js +8 -8
- package/dist/audit.d.ts.map +1 -1
- package/dist/audit.js +26 -2
- package/dist/audit.js.map +1 -1
- package/dist/autogen/executor.d.ts +7 -7
- package/dist/autogen/executor.js +5 -5
- package/dist/autogen/index.d.ts +4 -4
- package/dist/autogen/index.js +3 -3
- package/dist/browser/provider-setup.d.ts +2 -2
- package/dist/browser/sdk-package-version.d.ts +1 -1
- package/dist/browser/sdk-package-version.js +1 -1
- package/dist/cli/commands/test-utils.js +1 -1
- package/dist/cli/config.js +1 -1
- package/dist/cli/utils/backend-validator.js +1 -1
- package/dist/client.d.ts +4 -4
- package/dist/client.js +1 -1
- package/dist/errors.d.ts +5 -5
- package/dist/errors.js +10 -10
- package/dist/index.d.ts +24 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -5
- package/dist/index.js.map +1 -1
- package/dist/kms.js +4 -4
- package/dist/langchain/index.d.ts +9 -9
- package/dist/langchain/index.js +6 -6
- package/dist/langchain/toolkit.d.ts +7 -7
- package/dist/langchain/toolkit.js +13 -13
- package/dist/langchain/tools/audit.d.ts +4 -4
- package/dist/langchain/tools/audit.js +1 -1
- package/dist/langchain/tools/kms.d.ts +6 -6
- package/dist/langchain/tools/kms.js +2 -2
- package/dist/langchain/tools/vault.d.ts +3 -3
- package/dist/langchain/tools/vault.js +3 -3
- package/dist/langchain/vault-client.d.ts +1 -1
- package/dist/langchain/vault-client.js +3 -3
- package/dist/llamaindex/index.d.ts +4 -4
- package/dist/llamaindex/index.js +3 -3
- package/dist/llamaindex/vector-store.d.ts +7 -7
- package/dist/llamaindex/vector-store.js +5 -5
- package/dist/storage.d.ts +1 -1
- package/dist/storage.js +3 -3
- package/dist/webhooks.d.ts +5 -5
- package/dist/webhooks.js +15 -15
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -31,20 +31,40 @@
|
|
|
31
31
|
* });
|
|
32
32
|
* ```
|
|
33
33
|
*
|
|
34
|
-
* Sign up for a free QNSI account at https://cloud.
|
|
34
|
+
* Sign up for a free QNSI account at https://cloud.qnsi.heossi.com/auth.
|
|
35
35
|
*/
|
|
36
36
|
export { AccessClient, type AssignRoleRequest, type CheckPermissionRequest, type CreateRoleRequest, } from "./access.js";
|
|
37
37
|
export { AiClient, type InferenceRequest, type RegisterArtifactRequest, type RegisterModelRequest, type SubmitWorkloadRequest, } from "./ai.js";
|
|
38
38
|
export { AuditClient, type LogEventRequest } from "./audit.js";
|
|
39
39
|
export { AuthClient, type LoginRequest } from "./auth.js";
|
|
40
40
|
export { BillingClient, type IngestMeterRequest } from "./billing.js";
|
|
41
|
-
export {
|
|
41
|
+
export { QnsiClient,
|
|
42
|
+
/** @deprecated Use `QnsiClient`. Kept for pre-rebrand consumers. */
|
|
43
|
+
QnsiClient as QnspClient, type QnsiClientOptions,
|
|
44
|
+
/** @deprecated Use `QnsiClientOptions`. */
|
|
45
|
+
type QnsiClientOptions as QnspClientOptions, } from "./client.js";
|
|
42
46
|
export { CryptoInventoryClient, type DiscoverAssetsRequest } from "./crypto-inventory.js";
|
|
43
|
-
export {
|
|
47
|
+
export { QnsiApiError,
|
|
48
|
+
/** @deprecated Use `QnsiApiError`. */
|
|
49
|
+
QnsiApiError as QnspApiError, QnsiAuthError,
|
|
50
|
+
/** @deprecated Use `QnsiAuthError`. */
|
|
51
|
+
QnsiAuthError as QnspAuthError, QnsiError,
|
|
52
|
+
/** @deprecated Use `QnsiError`. */
|
|
53
|
+
QnsiError as QnspError, QnsiNetworkError,
|
|
54
|
+
/** @deprecated Use `QnsiNetworkError`. */
|
|
55
|
+
QnsiNetworkError as QnspNetworkError, QnsiWebhookError,
|
|
56
|
+
/** @deprecated Use `QnsiWebhookError`. */
|
|
57
|
+
QnsiWebhookError as QnspWebhookError, } from "./errors.js";
|
|
44
58
|
export { type CreateKeyRequest, KmsClient } from "./kms.js";
|
|
45
59
|
export { type CreateIndexRequest, type QueryRequest, SearchClient, type Vector, } from "./search.js";
|
|
46
60
|
export { type PutObjectInput, StorageClient } from "./storage.js";
|
|
47
61
|
export { type CreateTenantRequest, TenantClient } from "./tenant.js";
|
|
48
62
|
export { type CreateSecretRequest, VaultClient } from "./vault.js";
|
|
49
|
-
export { MAX_WEBHOOK_SKEW_MS,
|
|
63
|
+
export { MAX_WEBHOOK_SKEW_MS, parseQnsiWebhook,
|
|
64
|
+
/** @deprecated Use `parseQnsiWebhook`. */
|
|
65
|
+
parseQnsiWebhook as parseQnspWebhook, type QnsiWebhookEvent,
|
|
66
|
+
/** @deprecated Use `QnsiWebhookEvent`. */
|
|
67
|
+
type QnsiWebhookEvent as QnspWebhookEvent, verifyQnsiWebhookSignature,
|
|
68
|
+
/** @deprecated Use `verifyQnsiWebhookSignature`. */
|
|
69
|
+
verifyQnsiWebhookSignature as verifyQnspWebhookSignature, } from "./webhooks.js";
|
|
50
70
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EACN,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,QAAQ,EACR,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,GAC1B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGtE,OAAO,EACN,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EACN,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,QAAQ,EACR,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,GAC1B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGtE,OAAO,EACN,UAAU;AACV,oEAAoE;AACpE,UAAU,IAAI,UAAU,EACxB,KAAK,iBAAiB;AACtB,2CAA2C;AAC3C,KAAK,iBAAiB,IAAI,iBAAiB,GAC3C,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,qBAAqB,EAAE,KAAK,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EACN,YAAY;AACZ,sCAAsC;AACtC,YAAY,IAAI,YAAY,EAC5B,aAAa;AACb,uCAAuC;AACvC,aAAa,IAAI,aAAa,EAC9B,SAAS;AACT,mCAAmC;AACnC,SAAS,IAAI,SAAS,EACtB,gBAAgB;AAChB,0CAA0C;AAC1C,gBAAgB,IAAI,gBAAgB,EACpC,gBAAgB;AAChB,0CAA0C;AAC1C,gBAAgB,IAAI,gBAAgB,GACpC,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,gBAAgB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,YAAY,EACZ,KAAK,MAAM,GACX,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,KAAK,mBAAmB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAErE,OAAO,EAAE,KAAK,mBAAmB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EACN,mBAAmB,EACnB,gBAAgB;AAChB,0CAA0C;AAC1C,gBAAgB,IAAI,gBAAgB,EACpC,KAAK,gBAAgB;AACrB,0CAA0C;AAC1C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,0BAA0B;AAC1B,oDAAoD;AACpD,0BAA0B,IAAI,0BAA0B,GACxD,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* });
|
|
32
32
|
* ```
|
|
33
33
|
*
|
|
34
|
-
* Sign up for a free QNSI account at https://cloud.
|
|
34
|
+
* Sign up for a free QNSI account at https://cloud.qnsi.heossi.com/auth.
|
|
35
35
|
*/
|
|
36
36
|
export { AccessClient, } from "./access.js";
|
|
37
37
|
export { AiClient, } from "./ai.js";
|
|
@@ -39,15 +39,31 @@ export { AuditClient } from "./audit.js";
|
|
|
39
39
|
export { AuthClient } from "./auth.js";
|
|
40
40
|
export { BillingClient } from "./billing.js";
|
|
41
41
|
// QnsiClient is the canonical name (product is QNSI). QnspClient is kept as a
|
|
42
|
-
// back-compat alias for consumers on the pre-rebrand name.
|
|
43
|
-
export {
|
|
42
|
+
// @deprecated back-compat alias for consumers on the pre-rebrand name.
|
|
43
|
+
export { QnsiClient,
|
|
44
|
+
/** @deprecated Use `QnsiClient`. Kept for pre-rebrand consumers. */
|
|
45
|
+
QnsiClient as QnspClient, } from "./client.js";
|
|
44
46
|
export { CryptoInventoryClient } from "./crypto-inventory.js";
|
|
45
|
-
export {
|
|
47
|
+
export { QnsiApiError,
|
|
48
|
+
/** @deprecated Use `QnsiApiError`. */
|
|
49
|
+
QnsiApiError as QnspApiError, QnsiAuthError,
|
|
50
|
+
/** @deprecated Use `QnsiAuthError`. */
|
|
51
|
+
QnsiAuthError as QnspAuthError, QnsiError,
|
|
52
|
+
/** @deprecated Use `QnsiError`. */
|
|
53
|
+
QnsiError as QnspError, QnsiNetworkError,
|
|
54
|
+
/** @deprecated Use `QnsiNetworkError`. */
|
|
55
|
+
QnsiNetworkError as QnspNetworkError, QnsiWebhookError,
|
|
56
|
+
/** @deprecated Use `QnsiWebhookError`. */
|
|
57
|
+
QnsiWebhookError as QnspWebhookError, } from "./errors.js";
|
|
46
58
|
export { KmsClient } from "./kms.js";
|
|
47
59
|
export { SearchClient, } from "./search.js";
|
|
48
60
|
export { StorageClient } from "./storage.js";
|
|
49
61
|
export { TenantClient } from "./tenant.js";
|
|
50
62
|
// Service classes — exported so callers can construct mocks for testing.
|
|
51
63
|
export { VaultClient } from "./vault.js";
|
|
52
|
-
export { MAX_WEBHOOK_SKEW_MS,
|
|
64
|
+
export { MAX_WEBHOOK_SKEW_MS, parseQnsiWebhook,
|
|
65
|
+
/** @deprecated Use `parseQnsiWebhook`. */
|
|
66
|
+
parseQnsiWebhook as parseQnspWebhook, verifyQnsiWebhookSignature,
|
|
67
|
+
/** @deprecated Use `verifyQnsiWebhookSignature`. */
|
|
68
|
+
verifyQnsiWebhookSignature as verifyQnspWebhookSignature, } from "./webhooks.js";
|
|
53
69
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EACN,YAAY,GAIZ,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,QAAQ,GAKR,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,WAAW,EAAwB,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAqB,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,aAAa,EAA2B,MAAM,cAAc,CAAC;AACtE,8EAA8E;AAC9E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EACN,YAAY,GAIZ,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,QAAQ,GAKR,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,WAAW,EAAwB,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAqB,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,aAAa,EAA2B,MAAM,cAAc,CAAC;AACtE,8EAA8E;AAC9E,uEAAuE;AACvE,OAAO,EACN,UAAU;AACV,oEAAoE;AACpE,UAAU,IAAI,UAAU,GAIxB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,qBAAqB,EAA8B,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EACN,YAAY;AACZ,sCAAsC;AACtC,YAAY,IAAI,YAAY,EAC5B,aAAa;AACb,uCAAuC;AACvC,aAAa,IAAI,aAAa,EAC9B,SAAS;AACT,mCAAmC;AACnC,SAAS,IAAI,SAAS,EACtB,gBAAgB;AAChB,0CAA0C;AAC1C,gBAAgB,IAAI,gBAAgB,EACpC,gBAAgB;AAChB,0CAA0C;AAC1C,gBAAgB,IAAI,gBAAgB,GACpC,MAAM,aAAa,CAAC;AACrB,OAAO,EAAyB,SAAS,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAGN,YAAY,GAEZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAuB,aAAa,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAA4B,YAAY,EAAE,MAAM,aAAa,CAAC;AACrE,yEAAyE;AACzE,OAAO,EAA4B,WAAW,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EACN,mBAAmB,EACnB,gBAAgB;AAChB,0CAA0C;AAC1C,gBAAgB,IAAI,gBAAgB,EAIpC,0BAA0B;AAC1B,oDAAoD;AACpD,0BAA0B,IAAI,0BAA0B,GACxD,MAAM,eAAe,CAAC"}
|
package/dist/kms.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* QNSP KMS — server-side PQC keys with sign, verify, wrap, and unwrap.
|
|
3
3
|
* Wraps `apps/kms-service` (`/kms/v1`).
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { QnsiApiError } from "./errors.js";
|
|
6
6
|
const PATH_PREFIX = "/proxy/kms/v1";
|
|
7
7
|
export class KmsClient {
|
|
8
8
|
internal;
|
|
@@ -45,7 +45,7 @@ export class KmsClient {
|
|
|
45
45
|
const body = { data: encodeB64(data) };
|
|
46
46
|
const resp = await this.internal.request("POST", `${PATH_PREFIX}/keys/${keyId}/sign`, body, opts);
|
|
47
47
|
if (!resp.signature) {
|
|
48
|
-
throw new
|
|
48
|
+
throw new QnsiApiError("kms.sign: response missing signature", 200);
|
|
49
49
|
}
|
|
50
50
|
return decodeB64(resp.signature);
|
|
51
51
|
}
|
|
@@ -65,7 +65,7 @@ export class KmsClient {
|
|
|
65
65
|
const resp = await this.internal.request("POST", `${PATH_PREFIX}/keys/${keyId}/wrap`, body, opts);
|
|
66
66
|
const wrapped = resp.wrappedKey ?? resp.ciphertextB64;
|
|
67
67
|
if (!wrapped) {
|
|
68
|
-
throw new
|
|
68
|
+
throw new QnsiApiError("kms.wrap: response missing wrappedKey/ciphertextB64", 200);
|
|
69
69
|
}
|
|
70
70
|
return decodeB64(wrapped);
|
|
71
71
|
}
|
|
@@ -78,7 +78,7 @@ export class KmsClient {
|
|
|
78
78
|
const resp = await this.internal.request("POST", `${PATH_PREFIX}/keys/${keyId}/unwrap`, body, opts);
|
|
79
79
|
const unwrapped = resp.dataKey ?? resp.plaintextB64;
|
|
80
80
|
if (!unwrapped) {
|
|
81
|
-
throw new
|
|
81
|
+
throw new QnsiApiError("kms.unwrap: response missing dataKey/plaintextB64", 200);
|
|
82
82
|
}
|
|
83
83
|
return decodeB64(unwrapped);
|
|
84
84
|
}
|
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```typescript
|
|
9
|
-
* import {
|
|
9
|
+
* import { QnsiToolkit } from "@heossi/qnsi-langchain-qnsp";
|
|
10
10
|
*
|
|
11
|
-
* const toolkit = new
|
|
11
|
+
* const toolkit = new QnsiToolkit({ apiKey: process.env.QNSP_API_KEY });
|
|
12
12
|
* const tools = toolkit.getTools();
|
|
13
13
|
* ```
|
|
14
14
|
*/
|
|
15
|
-
export type {
|
|
16
|
-
export {
|
|
17
|
-
export type {
|
|
18
|
-
export {
|
|
19
|
-
export type {
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
15
|
+
export type { QnsiToolkitConfig } from "./toolkit.js";
|
|
16
|
+
export { QnsiToolkit } from "./toolkit.js";
|
|
17
|
+
export type { QnsiAuditToolConfig } from "./tools/audit.js";
|
|
18
|
+
export { QnsiLogAgentActionTool } from "./tools/audit.js";
|
|
19
|
+
export type { QnsiKmsToolConfig } from "./tools/kms.js";
|
|
20
|
+
export { QnsiSignDataTool, QnsiVerifySignatureTool } from "./tools/kms.js";
|
|
21
|
+
export { QnsiReadSecretTool, QnsiRotateSecretTool, QnsiWriteSecretTool } from "./tools/vault.js";
|
|
22
22
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/langchain/index.js
CHANGED
|
@@ -6,18 +6,18 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```typescript
|
|
9
|
-
* import {
|
|
9
|
+
* import { QnsiToolkit } from "@heossi/qnsi-langchain-qnsp";
|
|
10
10
|
*
|
|
11
|
-
* const toolkit = new
|
|
11
|
+
* const toolkit = new QnsiToolkit({ apiKey: process.env.QNSP_API_KEY });
|
|
12
12
|
* const tools = toolkit.getTools();
|
|
13
13
|
* ```
|
|
14
14
|
*/
|
|
15
15
|
// Toolkit (recommended entry point)
|
|
16
|
-
export {
|
|
16
|
+
export { QnsiToolkit } from "./toolkit.js";
|
|
17
17
|
// Individual audit tools
|
|
18
|
-
export {
|
|
18
|
+
export { QnsiLogAgentActionTool } from "./tools/audit.js";
|
|
19
19
|
// Individual KMS tools
|
|
20
|
-
export {
|
|
20
|
+
export { QnsiSignDataTool, QnsiVerifySignatureTool } from "./tools/kms.js";
|
|
21
21
|
// Individual vault tools
|
|
22
|
-
export {
|
|
22
|
+
export { QnsiReadSecretTool, QnsiRotateSecretTool, QnsiWriteSecretTool } from "./tools/vault.js";
|
|
23
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
9
|
* ```typescript
|
|
10
|
-
* import {
|
|
10
|
+
* import { QnsiToolkit } from "@heossi/qnsi-langchain-qnsp";
|
|
11
11
|
* import { ChatOpenAI } from "@langchain/openai";
|
|
12
12
|
* import { AgentExecutor, createToolCallingAgent } from "langchain/agents";
|
|
13
13
|
*
|
|
14
|
-
* const toolkit = new
|
|
14
|
+
* const toolkit = new QnsiToolkit({
|
|
15
15
|
* apiKey: process.env.QNSP_API_KEY,
|
|
16
16
|
* });
|
|
17
17
|
*
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
25
|
import type { StructuredTool } from "@langchain/core/tools";
|
|
26
|
-
export interface
|
|
26
|
+
export interface QnsiToolkitConfig {
|
|
27
27
|
/**
|
|
28
|
-
* QNSP API key. Get one at https://cloud.
|
|
28
|
+
* QNSP API key. Get one at https://cloud.qnsi.heossi.com/api-keys
|
|
29
29
|
* The API key carries the tenant ID — no separate tenantId needed.
|
|
30
30
|
*/
|
|
31
31
|
readonly apiKey: string;
|
|
@@ -36,7 +36,7 @@ export interface QnspToolkitConfig {
|
|
|
36
36
|
readonly tenantId?: string;
|
|
37
37
|
/**
|
|
38
38
|
* Base URL for the QNSP API.
|
|
39
|
-
* Defaults to https://api.
|
|
39
|
+
* Defaults to https://api.qnsi.heossi.com
|
|
40
40
|
*/
|
|
41
41
|
readonly baseUrl?: string;
|
|
42
42
|
/**
|
|
@@ -58,9 +58,9 @@ export interface QnspToolkitConfig {
|
|
|
58
58
|
* - KMS tools: sign and verify data with quantum-safe algorithms
|
|
59
59
|
* - Audit tools: write immutable, PQC-signed audit events
|
|
60
60
|
*/
|
|
61
|
-
export declare class
|
|
61
|
+
export declare class QnsiToolkit {
|
|
62
62
|
#private;
|
|
63
|
-
constructor(config:
|
|
63
|
+
constructor(config: QnsiToolkitConfig);
|
|
64
64
|
/**
|
|
65
65
|
* One-shot activation handshake against billing-service. Validates the API
|
|
66
66
|
* key, captures tenantId + tier, caches the activation token. Required:
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
9
|
* ```typescript
|
|
10
|
-
* import {
|
|
10
|
+
* import { QnsiToolkit } from "@heossi/qnsi-langchain-qnsp";
|
|
11
11
|
* import { ChatOpenAI } from "@langchain/openai";
|
|
12
12
|
* import { AgentExecutor, createToolCallingAgent } from "langchain/agents";
|
|
13
13
|
*
|
|
14
|
-
* const toolkit = new
|
|
14
|
+
* const toolkit = new QnsiToolkit({
|
|
15
15
|
* apiKey: process.env.QNSP_API_KEY,
|
|
16
16
|
* });
|
|
17
17
|
*
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
25
|
import { activateSdk } from "../_activation/index.js";
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
26
|
+
import { QnsiLogAgentActionTool } from "./tools/audit.js";
|
|
27
|
+
import { QnsiSignDataTool, QnsiVerifySignatureTool } from "./tools/kms.js";
|
|
28
|
+
import { QnsiReadSecretTool, QnsiRotateSecretTool, QnsiWriteSecretTool } from "./tools/vault.js";
|
|
29
29
|
import { VaultClient } from "./vault-client.js";
|
|
30
30
|
const SDK_VERSION = "0.3.0";
|
|
31
31
|
/**
|
|
@@ -36,7 +36,7 @@ const SDK_VERSION = "0.3.0";
|
|
|
36
36
|
* - KMS tools: sign and verify data with quantum-safe algorithms
|
|
37
37
|
* - Audit tools: write immutable, PQC-signed audit events
|
|
38
38
|
*/
|
|
39
|
-
export class
|
|
39
|
+
export class QnsiToolkit {
|
|
40
40
|
#apiKey;
|
|
41
41
|
#tenantId;
|
|
42
42
|
#baseUrl;
|
|
@@ -47,7 +47,7 @@ export class QnspToolkit {
|
|
|
47
47
|
constructor(config) {
|
|
48
48
|
this.#apiKey = config.apiKey;
|
|
49
49
|
this.#tenantId = config.tenantId ?? "";
|
|
50
|
-
this.#baseUrl = config.baseUrl ?? "https://api.
|
|
50
|
+
this.#baseUrl = config.baseUrl ?? "https://api.qnsi.heossi.com";
|
|
51
51
|
this.#timeoutMs = config.timeoutMs ?? 15_000;
|
|
52
52
|
this.#include = config.include ?? ["vault", "kms", "audit"];
|
|
53
53
|
this.#vaultClient = new VaultClient({
|
|
@@ -89,7 +89,7 @@ export class QnspToolkit {
|
|
|
89
89
|
if (!this.#activated) {
|
|
90
90
|
throw new Error("@heossi/qnsi-langchain-qnsp: call `await toolkit.activate()` once before `getTools()`. " +
|
|
91
91
|
"This validates your QNSP API key and resolves the tenant ID. " +
|
|
92
|
-
"Free signup (no credit card): https://cloud.
|
|
92
|
+
"Free signup (no credit card): https://cloud.qnsi.heossi.com/auth");
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
/** Returns all configured QNSP tools for use with a LangChain agent. */
|
|
@@ -111,9 +111,9 @@ export class QnspToolkit {
|
|
|
111
111
|
getVaultTools() {
|
|
112
112
|
this.#assertActivated();
|
|
113
113
|
return [
|
|
114
|
-
new
|
|
115
|
-
new
|
|
116
|
-
new
|
|
114
|
+
new QnsiReadSecretTool(this.#vaultClient),
|
|
115
|
+
new QnsiWriteSecretTool(this.#vaultClient),
|
|
116
|
+
new QnsiRotateSecretTool(this.#vaultClient),
|
|
117
117
|
];
|
|
118
118
|
}
|
|
119
119
|
/** Returns only the KMS tools (sign, verify). */
|
|
@@ -125,7 +125,7 @@ export class QnspToolkit {
|
|
|
125
125
|
tenantId: this.#tenantId,
|
|
126
126
|
timeoutMs: this.#timeoutMs,
|
|
127
127
|
};
|
|
128
|
-
return [new
|
|
128
|
+
return [new QnsiSignDataTool(kmsConfig), new QnsiVerifySignatureTool(kmsConfig)];
|
|
129
129
|
}
|
|
130
130
|
/** Returns only the audit tool (log agent actions). */
|
|
131
131
|
getAuditTools() {
|
|
@@ -136,7 +136,7 @@ export class QnspToolkit {
|
|
|
136
136
|
tenantId: this.#tenantId,
|
|
137
137
|
timeoutMs: this.#timeoutMs,
|
|
138
138
|
};
|
|
139
|
-
return [new
|
|
139
|
+
return [new QnsiLogAgentActionTool(auditConfig)];
|
|
140
140
|
}
|
|
141
141
|
/** True once `activate()` has resolved successfully. */
|
|
142
142
|
get isActivated() {
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { StructuredTool, type ToolParams } from "@langchain/core/tools";
|
|
8
8
|
import { z } from "zod";
|
|
9
|
-
export interface
|
|
10
|
-
/** Base URL for the QNSP API (e.g. https://api.
|
|
9
|
+
export interface QnsiAuditToolConfig {
|
|
10
|
+
/** Base URL for the QNSP API (e.g. https://api.qnsi.heossi.com) */
|
|
11
11
|
readonly baseUrl: string;
|
|
12
12
|
/** API key or Bearer token for authentication */
|
|
13
13
|
readonly apiKey: string;
|
|
@@ -26,7 +26,7 @@ declare const logAgentActionSchema: z.ZodObject<{
|
|
|
26
26
|
* LangChain tool that writes an immutable, PQC-signed audit event to QNSP.
|
|
27
27
|
* Use this to create a tamper-evident record of every significant agent action.
|
|
28
28
|
*/
|
|
29
|
-
export declare class
|
|
29
|
+
export declare class QnsiLogAgentActionTool extends StructuredTool {
|
|
30
30
|
#private;
|
|
31
31
|
readonly name = "qnsp_log_agent_action";
|
|
32
32
|
readonly description = "Write an immutable, PQC-signed audit event to QNSP. Creates a tamper-evident record of agent actions, decisions, tool calls, and outputs. Use this for compliance, governance, and traceability of agent behavior.";
|
|
@@ -36,7 +36,7 @@ export declare class QnspLogAgentActionTool extends StructuredTool {
|
|
|
36
36
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
37
37
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
38
38
|
}, z.core.$strip>;
|
|
39
|
-
constructor(config:
|
|
39
|
+
constructor(config: QnsiAuditToolConfig, fields?: ToolParams);
|
|
40
40
|
protected _call(input: z.infer<typeof logAgentActionSchema>): Promise<string>;
|
|
41
41
|
}
|
|
42
42
|
export {};
|
|
@@ -30,7 +30,7 @@ const logAgentActionSchema = z.object({
|
|
|
30
30
|
* LangChain tool that writes an immutable, PQC-signed audit event to QNSP.
|
|
31
31
|
* Use this to create a tamper-evident record of every significant agent action.
|
|
32
32
|
*/
|
|
33
|
-
export class
|
|
33
|
+
export class QnsiLogAgentActionTool extends StructuredTool {
|
|
34
34
|
name = "qnsp_log_agent_action";
|
|
35
35
|
description = "Write an immutable, PQC-signed audit event to QNSP. Creates a tamper-evident record of agent actions, decisions, tool calls, and outputs. Use this for compliance, governance, and traceability of agent behavior.";
|
|
36
36
|
schema = logAgentActionSchema;
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { StructuredTool, type ToolParams } from "@langchain/core/tools";
|
|
8
8
|
import { z } from "zod";
|
|
9
|
-
export interface
|
|
10
|
-
/** Base URL for the QNSP API (e.g. https://api.
|
|
9
|
+
export interface QnsiKmsToolConfig {
|
|
10
|
+
/** Base URL for the QNSP API (e.g. https://api.qnsi.heossi.com) */
|
|
11
11
|
readonly baseUrl: string;
|
|
12
12
|
/** API key or Bearer token for authentication */
|
|
13
13
|
readonly apiKey: string;
|
|
@@ -24,7 +24,7 @@ declare const signDataSchema: z.ZodObject<{
|
|
|
24
24
|
/**
|
|
25
25
|
* LangChain tool that signs data with a PQC key (ML-DSA / SLH-DSA / FN-DSA).
|
|
26
26
|
*/
|
|
27
|
-
export declare class
|
|
27
|
+
export declare class QnsiSignDataTool extends StructuredTool {
|
|
28
28
|
#private;
|
|
29
29
|
readonly name = "qnsp_sign_data";
|
|
30
30
|
readonly description = "Sign data with a quantum-safe PQC key (ML-DSA, SLH-DSA, or FN-DSA). Returns a base64-encoded signature. Use this when an agent needs to cryptographically attest to data it produced or decisions it made.";
|
|
@@ -33,7 +33,7 @@ export declare class QnspSignDataTool extends StructuredTool {
|
|
|
33
33
|
data: z.ZodString;
|
|
34
34
|
context: z.ZodOptional<z.ZodString>;
|
|
35
35
|
}, z.core.$strip>;
|
|
36
|
-
constructor(config:
|
|
36
|
+
constructor(config: QnsiKmsToolConfig, fields?: ToolParams);
|
|
37
37
|
protected _call(input: z.infer<typeof signDataSchema>): Promise<string>;
|
|
38
38
|
}
|
|
39
39
|
declare const verifySignatureSchema: z.ZodObject<{
|
|
@@ -45,7 +45,7 @@ declare const verifySignatureSchema: z.ZodObject<{
|
|
|
45
45
|
/**
|
|
46
46
|
* LangChain tool that verifies a PQC signature against data and a key.
|
|
47
47
|
*/
|
|
48
|
-
export declare class
|
|
48
|
+
export declare class QnsiVerifySignatureTool extends StructuredTool {
|
|
49
49
|
#private;
|
|
50
50
|
readonly name = "qnsp_verify_signature";
|
|
51
51
|
readonly description = "Verify a quantum-safe PQC signature. Returns true/false and the algorithm used. Use this when an agent needs to verify the authenticity of data or attestations from other agents or services.";
|
|
@@ -55,7 +55,7 @@ export declare class QnspVerifySignatureTool extends StructuredTool {
|
|
|
55
55
|
signature: z.ZodString;
|
|
56
56
|
context: z.ZodOptional<z.ZodString>;
|
|
57
57
|
}, z.core.$strip>;
|
|
58
|
-
constructor(config:
|
|
58
|
+
constructor(config: QnsiKmsToolConfig, fields?: ToolParams);
|
|
59
59
|
protected _call(input: z.infer<typeof verifySignatureSchema>): Promise<string>;
|
|
60
60
|
}
|
|
61
61
|
export {};
|
|
@@ -21,7 +21,7 @@ const signDataSchema = z.object({
|
|
|
21
21
|
/**
|
|
22
22
|
* LangChain tool that signs data with a PQC key (ML-DSA / SLH-DSA / FN-DSA).
|
|
23
23
|
*/
|
|
24
|
-
export class
|
|
24
|
+
export class QnsiSignDataTool extends StructuredTool {
|
|
25
25
|
name = "qnsp_sign_data";
|
|
26
26
|
description = "Sign data with a quantum-safe PQC key (ML-DSA, SLH-DSA, or FN-DSA). Returns a base64-encoded signature. Use this when an agent needs to cryptographically attest to data it produced or decisions it made.";
|
|
27
27
|
schema = signDataSchema;
|
|
@@ -75,7 +75,7 @@ const verifySignatureSchema = z.object({
|
|
|
75
75
|
/**
|
|
76
76
|
* LangChain tool that verifies a PQC signature against data and a key.
|
|
77
77
|
*/
|
|
78
|
-
export class
|
|
78
|
+
export class QnsiVerifySignatureTool extends StructuredTool {
|
|
79
79
|
name = "qnsp_verify_signature";
|
|
80
80
|
description = "Verify a quantum-safe PQC signature. Returns true/false and the algorithm used. Use this when an agent needs to verify the authenticity of data or attestations from other agents or services.";
|
|
81
81
|
schema = verifySignatureSchema;
|
|
@@ -13,7 +13,7 @@ declare const readSecretSchema: z.ZodObject<{
|
|
|
13
13
|
/**
|
|
14
14
|
* LangChain tool that reads a PQC-encrypted secret from QNSP Vault.
|
|
15
15
|
*/
|
|
16
|
-
export declare class
|
|
16
|
+
export declare class QnsiReadSecretTool extends StructuredTool {
|
|
17
17
|
#private;
|
|
18
18
|
readonly name = "qnsp_read_secret";
|
|
19
19
|
readonly description = "Read a PQC-encrypted secret from QNSP Vault. Returns the secret name and encrypted envelope. Use this when an agent needs to retrieve a stored credential, API key, or sensitive value.";
|
|
@@ -32,7 +32,7 @@ declare const writeSecretSchema: z.ZodObject<{
|
|
|
32
32
|
/**
|
|
33
33
|
* LangChain tool that stores a PQC-encrypted secret in QNSP Vault.
|
|
34
34
|
*/
|
|
35
|
-
export declare class
|
|
35
|
+
export declare class QnsiWriteSecretTool extends StructuredTool {
|
|
36
36
|
#private;
|
|
37
37
|
readonly name = "qnsp_write_secret";
|
|
38
38
|
readonly description = "Store a PQC-encrypted secret in QNSP Vault. The payload must be base64-encoded. Returns the created secret ID. Use this when an agent needs to persist a credential, token, or sensitive value securely.";
|
|
@@ -53,7 +53,7 @@ declare const rotateSecretSchema: z.ZodObject<{
|
|
|
53
53
|
/**
|
|
54
54
|
* LangChain tool that rotates a secret in QNSP Vault with a new value.
|
|
55
55
|
*/
|
|
56
|
-
export declare class
|
|
56
|
+
export declare class QnsiRotateSecretTool extends StructuredTool {
|
|
57
57
|
#private;
|
|
58
58
|
readonly name = "qnsp_rotate_secret";
|
|
59
59
|
readonly description = "Rotate a secret in QNSP Vault with a new PQC-encrypted value. The previous version is retained for rollback. Use this when an agent needs to update a credential after rotation.";
|
|
@@ -13,7 +13,7 @@ const readSecretSchema = z.object({
|
|
|
13
13
|
/**
|
|
14
14
|
* LangChain tool that reads a PQC-encrypted secret from QNSP Vault.
|
|
15
15
|
*/
|
|
16
|
-
export class
|
|
16
|
+
export class QnsiReadSecretTool extends StructuredTool {
|
|
17
17
|
name = "qnsp_read_secret";
|
|
18
18
|
description = "Read a PQC-encrypted secret from QNSP Vault. Returns the secret name and encrypted envelope. Use this when an agent needs to retrieve a stored credential, API key, or sensitive value.";
|
|
19
19
|
schema = readSecretSchema;
|
|
@@ -47,7 +47,7 @@ const writeSecretSchema = z.object({
|
|
|
47
47
|
/**
|
|
48
48
|
* LangChain tool that stores a PQC-encrypted secret in QNSP Vault.
|
|
49
49
|
*/
|
|
50
|
-
export class
|
|
50
|
+
export class QnsiWriteSecretTool extends StructuredTool {
|
|
51
51
|
name = "qnsp_write_secret";
|
|
52
52
|
description = "Store a PQC-encrypted secret in QNSP Vault. The payload must be base64-encoded. Returns the created secret ID. Use this when an agent needs to persist a credential, token, or sensitive value securely.";
|
|
53
53
|
schema = writeSecretSchema;
|
|
@@ -81,7 +81,7 @@ const rotateSecretSchema = z.object({
|
|
|
81
81
|
/**
|
|
82
82
|
* LangChain tool that rotates a secret in QNSP Vault with a new value.
|
|
83
83
|
*/
|
|
84
|
-
export class
|
|
84
|
+
export class QnsiRotateSecretTool extends StructuredTool {
|
|
85
85
|
name = "qnsp_rotate_secret";
|
|
86
86
|
description = "Rotate a secret in QNSP Vault with a new PQC-encrypted value. The previous version is retained for rollback. Use this when an agent needs to update a credential after rotation.";
|
|
87
87
|
schema = rotateSecretSchema;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* consolidation): Bearer auth, `x-qnsp-tenant-id` header, 429 retry with
|
|
7
7
|
* exponential backoff + `Retry-After`, per-request timeout, `Vault API
|
|
8
8
|
* error: <status> <statusText>` on failure. Endpoints and request/response
|
|
9
|
-
* shapes are byte-for-byte preserved. Activation is owned by `
|
|
9
|
+
* shapes are byte-for-byte preserved. Activation is owned by `QnsiToolkit`
|
|
10
10
|
* (single `langchain-qnsp` handshake); the resolved tenant id is injected via
|
|
11
11
|
* {@link VaultClient.setTenantId} — so this subpath has no `@heossi/qnsi-*`
|
|
12
12
|
* workspace dependency (same pattern as `../_activation`).
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* consolidation): Bearer auth, `x-qnsp-tenant-id` header, 429 retry with
|
|
7
7
|
* exponential backoff + `Retry-After`, per-request timeout, `Vault API
|
|
8
8
|
* error: <status> <statusText>` on failure. Endpoints and request/response
|
|
9
|
-
* shapes are byte-for-byte preserved. Activation is owned by `
|
|
9
|
+
* shapes are byte-for-byte preserved. Activation is owned by `QnsiToolkit`
|
|
10
10
|
* (single `langchain-qnsp` handshake); the resolved tenant id is injected via
|
|
11
11
|
* {@link VaultClient.setTenantId} — so this subpath has no `@heossi/qnsi-*`
|
|
12
12
|
* workspace dependency (same pattern as `../_activation`).
|
|
@@ -17,7 +17,7 @@ function validateUUID(value, field) {
|
|
|
17
17
|
throw new Error(`QNSP Vault: ${field} must be a valid UUID, received "${value}"`);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
const DEFAULT_BASE_URL = "https://api.
|
|
20
|
+
const DEFAULT_BASE_URL = "https://api.qnsi.heossi.com";
|
|
21
21
|
export class VaultClient {
|
|
22
22
|
#baseUrl;
|
|
23
23
|
#apiKey;
|
|
@@ -27,7 +27,7 @@ export class VaultClient {
|
|
|
27
27
|
#tenantId = null;
|
|
28
28
|
constructor(config) {
|
|
29
29
|
if (!config.apiKey || config.apiKey.trim().length === 0) {
|
|
30
|
-
throw new Error("QNSP Vault: apiKey is required. Get a free key at https://cloud.
|
|
30
|
+
throw new Error("QNSP Vault: apiKey is required. Get a free key at https://cloud.qnsi.heossi.com/auth");
|
|
31
31
|
}
|
|
32
32
|
this.#baseUrl = (config.baseUrl ?? DEFAULT_BASE_URL).replace(/\/$/, "");
|
|
33
33
|
this.#apiKey = config.apiKey;
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```typescript
|
|
9
|
-
* import {
|
|
9
|
+
* import { QnsiVectorStore } from "@heossi/qnsi/llamaindex";
|
|
10
10
|
*
|
|
11
|
-
* const store = new
|
|
11
|
+
* const store = new QnsiVectorStore({ apiKey: process.env.QNSP_API_KEY });
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
|
-
export type {
|
|
15
|
-
export {
|
|
14
|
+
export type { QnsiVectorStoreConfig, SearchSecurityEnvelope, TextNode, VectorStoreQuery, VectorStoreQueryResult, } from "./vector-store.js";
|
|
15
|
+
export { QnsiVectorStore } from "./vector-store.js";
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/llamaindex/index.js
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```typescript
|
|
9
|
-
* import {
|
|
9
|
+
* import { QnsiVectorStore } from "@heossi/qnsi/llamaindex";
|
|
10
10
|
*
|
|
11
|
-
* const store = new
|
|
11
|
+
* const store = new QnsiVectorStore({ apiKey: process.env.QNSP_API_KEY });
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
|
-
export {
|
|
14
|
+
export { QnsiVectorStore } from "./vector-store.js";
|
|
15
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -42,9 +42,9 @@ export interface VectorStoreQueryResult {
|
|
|
42
42
|
readonly similarities: number[];
|
|
43
43
|
readonly ids: string[];
|
|
44
44
|
}
|
|
45
|
-
export interface
|
|
45
|
+
export interface QnsiVectorStoreConfig {
|
|
46
46
|
/**
|
|
47
|
-
* QNSP API key. Get one at https://cloud.
|
|
47
|
+
* QNSP API key. Get one at https://cloud.qnsi.heossi.com/api-keys
|
|
48
48
|
* The API key carries the tenant ID internally — no separate tenantId needed.
|
|
49
49
|
*/
|
|
50
50
|
readonly apiKey: string;
|
|
@@ -55,7 +55,7 @@ export interface QnspVectorStoreConfig {
|
|
|
55
55
|
readonly tenantId?: string;
|
|
56
56
|
/** Source service label used when indexing documents. Defaults to "llamaindex-qnsp". */
|
|
57
57
|
readonly sourceService?: string;
|
|
58
|
-
/** Base URL for the QNSP API. Defaults to https://api.
|
|
58
|
+
/** Base URL for the QNSP API. Defaults to https://api.qnsi.heossi.com */
|
|
59
59
|
readonly baseUrl?: string;
|
|
60
60
|
/** Request timeout in milliseconds. Defaults to 15000. */
|
|
61
61
|
readonly timeoutMs?: number;
|
|
@@ -70,16 +70,16 @@ export interface QnspVectorStoreConfig {
|
|
|
70
70
|
*
|
|
71
71
|
* @example
|
|
72
72
|
* ```typescript
|
|
73
|
-
* import {
|
|
73
|
+
* import { QnsiVectorStore } from "@heossi/qnsi/llamaindex";
|
|
74
74
|
*
|
|
75
|
-
* const store = new
|
|
75
|
+
* const store = new QnsiVectorStore({ apiKey: process.env.QNSP_API_KEY });
|
|
76
76
|
* await store.add([{ id_: "doc-1", text: "Quantum-safe overview", metadata: {} }]);
|
|
77
77
|
* const result = await store.query({ queryStr: "post-quantum cryptography" });
|
|
78
78
|
* ```
|
|
79
79
|
*/
|
|
80
|
-
export declare class
|
|
80
|
+
export declare class QnsiVectorStore {
|
|
81
81
|
#private;
|
|
82
|
-
constructor(config:
|
|
82
|
+
constructor(config: QnsiVectorStoreConfig);
|
|
83
83
|
/**
|
|
84
84
|
* Add nodes to the QNSP encrypted search index. Returns indexed node IDs.
|
|
85
85
|
*/
|
|
@@ -19,7 +19,7 @@ import { activateSdk } from "../_activation/index.js";
|
|
|
19
19
|
import { deriveDocumentSseTokens, deriveQuerySseTokens } from "./sse.js";
|
|
20
20
|
const SDK_VERSION = "0.3.0";
|
|
21
21
|
const SDK_ID = "llamaindex-qnsp";
|
|
22
|
-
const DEFAULT_BASE_URL = "https://api.
|
|
22
|
+
const DEFAULT_BASE_URL = "https://api.qnsi.heossi.com";
|
|
23
23
|
async function resolveActivationTenantId(apiKey, baseUrl) {
|
|
24
24
|
const activation = await activateSdk({
|
|
25
25
|
apiKey,
|
|
@@ -212,20 +212,20 @@ class SearchTransport {
|
|
|
212
212
|
});
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
// ───
|
|
215
|
+
// ─── QnsiVectorStore ──────────────────────────────────────────────────────────
|
|
216
216
|
/**
|
|
217
217
|
* LlamaIndex-compatible vector store backed by QNSP encrypted search (SSE-X).
|
|
218
218
|
*
|
|
219
219
|
* @example
|
|
220
220
|
* ```typescript
|
|
221
|
-
* import {
|
|
221
|
+
* import { QnsiVectorStore } from "@heossi/qnsi/llamaindex";
|
|
222
222
|
*
|
|
223
|
-
* const store = new
|
|
223
|
+
* const store = new QnsiVectorStore({ apiKey: process.env.QNSP_API_KEY });
|
|
224
224
|
* await store.add([{ id_: "doc-1", text: "Quantum-safe overview", metadata: {} }]);
|
|
225
225
|
* const result = await store.query({ queryStr: "post-quantum cryptography" });
|
|
226
226
|
* ```
|
|
227
227
|
*/
|
|
228
|
-
export class
|
|
228
|
+
export class QnsiVectorStore {
|
|
229
229
|
#transport;
|
|
230
230
|
#sourceService;
|
|
231
231
|
#apiKey;
|