@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.
Files changed (49) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/README.md +12 -12
  3. package/dist/_activation/activation-client.d.ts +2 -2
  4. package/dist/_activation/activation-client.js +4 -4
  5. package/dist/_internal.d.ts +6 -6
  6. package/dist/_internal.js +8 -8
  7. package/dist/audit.d.ts.map +1 -1
  8. package/dist/audit.js +26 -2
  9. package/dist/audit.js.map +1 -1
  10. package/dist/autogen/executor.d.ts +7 -7
  11. package/dist/autogen/executor.js +5 -5
  12. package/dist/autogen/index.d.ts +4 -4
  13. package/dist/autogen/index.js +3 -3
  14. package/dist/browser/provider-setup.d.ts +2 -2
  15. package/dist/browser/sdk-package-version.d.ts +1 -1
  16. package/dist/browser/sdk-package-version.js +1 -1
  17. package/dist/cli/commands/test-utils.js +1 -1
  18. package/dist/cli/config.js +1 -1
  19. package/dist/cli/utils/backend-validator.js +1 -1
  20. package/dist/client.d.ts +4 -4
  21. package/dist/client.js +1 -1
  22. package/dist/errors.d.ts +5 -5
  23. package/dist/errors.js +10 -10
  24. package/dist/index.d.ts +24 -4
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +21 -5
  27. package/dist/index.js.map +1 -1
  28. package/dist/kms.js +4 -4
  29. package/dist/langchain/index.d.ts +9 -9
  30. package/dist/langchain/index.js +6 -6
  31. package/dist/langchain/toolkit.d.ts +7 -7
  32. package/dist/langchain/toolkit.js +13 -13
  33. package/dist/langchain/tools/audit.d.ts +4 -4
  34. package/dist/langchain/tools/audit.js +1 -1
  35. package/dist/langchain/tools/kms.d.ts +6 -6
  36. package/dist/langchain/tools/kms.js +2 -2
  37. package/dist/langchain/tools/vault.d.ts +3 -3
  38. package/dist/langchain/tools/vault.js +3 -3
  39. package/dist/langchain/vault-client.d.ts +1 -1
  40. package/dist/langchain/vault-client.js +3 -3
  41. package/dist/llamaindex/index.d.ts +4 -4
  42. package/dist/llamaindex/index.js +3 -3
  43. package/dist/llamaindex/vector-store.d.ts +7 -7
  44. package/dist/llamaindex/vector-store.js +5 -5
  45. package/dist/storage.d.ts +1 -1
  46. package/dist/storage.js +3 -3
  47. package/dist/webhooks.d.ts +5 -5
  48. package/dist/webhooks.js +15 -15
  49. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -43,7 +43,7 @@ The previous TypeScript SDK family was fragmented across 11 packages (`@heossi/q
43
43
 
44
44
  ### Added
45
45
 
46
- - `QnspClient({ apiKey, baseUrl?, timeoutMs? })` — top-level client. Lazily activates against `/billing/v1/sdk/activate` on first request, reports `sdkId="qnsp"` and `sdkVersion="0.1.0"`.
46
+ - `QnsiClient({ apiKey, baseUrl?, timeoutMs? })` — top-level client. Lazily activates against `/billing/v1/sdk/activate` on first request, reports `sdkId="qnsp"` and `sdkVersion="0.1.0"`.
47
47
  - Eleven service sub-clients sharing one HTTP pool + one activation cache:
48
48
  - `qnsp.vault` (createSecret / getSecret / getSecretVersion / rotateSecret / deleteSecret / listSecretVersions)
49
49
  - `qnsp.kms` (createKey / listKeys / getKey / rotateKey / deleteKey / sign / verify / wrap / unwrap)
package/README.md CHANGED
@@ -5,16 +5,16 @@
5
5
 
6
6
  The official **single-package** Node.js / TypeScript SDK for QNSI. Covers the full customer-facing platform — vault, KMS, audit, auth, tenant, access-control, billing, crypto-inventory, storage, search, and AI orchestrator — plus webhook signature verification. Mirrors the shape of the `qnsp` Python / Go / Rust SDKs byte-for-byte: same wire contracts, same algorithm names, same FIPS 203 / 204 / 205 posture.
7
7
 
8
- > **Free tier available.** Free-forever account at <https://cloud.qnsp.cuilabs.io/auth> — 60-second signup, no credit card. Includes 10 GB PQC storage, 50 000 API calls/month, 20 KMS keys, 25 vault secrets.
8
+ > **Free tier available.** Free-forever account at <https://cloud.qnsi.heossi.com/auth> — 60-second signup, no credit card. Includes 10 GB PQC storage, 50 000 API calls/month, 20 KMS keys, 25 vault secrets.
9
9
 
10
10
  ## Why one package?
11
11
 
12
12
  Previous TypeScript consumers had to install up to 11 separate `@heossi/qnsi-*-sdk` packages and keep their versions in sync. `@heossi/qnsi` collapses that into a single dependency with sub-namespaces:
13
13
 
14
14
  ```ts
15
- import { QnspClient } from "@heossi/qnsi";
15
+ import { QnsiClient } from "@heossi/qnsi";
16
16
 
17
- const qnsp = new QnspClient({ apiKey: process.env.QNSP_API_KEY! });
17
+ const qnsp = new QnsiClient({ apiKey: process.env.QNSP_API_KEY! });
18
18
 
19
19
  await qnsp.vault.createSecret({ ... }); // was @heossi/qnsi-vault-sdk
20
20
  await qnsp.kms.sign(keyId, data); // was @heossi/qnsi-kms-client
@@ -40,9 +40,9 @@ Requires Node.js ≥ 22.0.0. ESM-first; CommonJS consumers can `await import("@h
40
40
  ## Quick start
41
41
 
42
42
  ```ts
43
- import { QnspClient } from "@heossi/qnsi";
43
+ import { QnsiClient } from "@heossi/qnsi";
44
44
 
45
- const qnsp = new QnspClient({ apiKey: process.env.QNSP_API_KEY! });
45
+ const qnsp = new QnsiClient({ apiKey: process.env.QNSP_API_KEY! });
46
46
 
47
47
  // Vault — PQC-encrypted secret storage
48
48
  const secret = await qnsp.vault.createSecret({
@@ -142,7 +142,7 @@ try {
142
142
 
143
143
  ## Activation + tier introspection
144
144
 
145
- `QnspClient` performs a one-shot handshake against `/billing/v1/sdk/activate` on first use. The result is cached in memory; subsequent calls reuse it until ~60 s before expiry. You can inspect the current activation:
145
+ `QnsiClient` performs a one-shot handshake against `/billing/v1/sdk/activate` on first use. The result is cached in memory; subsequent calls reuse it until ~60 s before expiry. You can inspect the current activation:
146
146
 
147
147
  ```ts
148
148
  await qnsp.tenantId(); // resolved tenant
@@ -162,7 +162,7 @@ The per-service `@heossi/qnsi-*-sdk` packages on npm are now **deprecated** in f
162
162
 
163
163
  | Before | After |
164
164
  |---|---|
165
- | `import { VaultClient } from "@heossi/qnsi-vault-sdk"` | `import { QnspClient } from "@heossi/qnsi"` then `qnsp.vault` |
165
+ | `import { VaultClient } from "@heossi/qnsi-vault-sdk"` | `import { QnsiClient } from "@heossi/qnsi"` then `qnsp.vault` |
166
166
  | `import { KmsClient } from "@heossi/qnsi-kms-client"` | `qnsp.kms` |
167
167
  | `import { AuthClient } from "@heossi/qnsi-auth-sdk"` | `qnsp.auth` |
168
168
  | `import { TenantClient } from "@heossi/qnsi-tenant-sdk"` | `qnsp.tenant` |
@@ -182,14 +182,14 @@ import { VaultClient } from "@heossi/qnsi-vault-sdk";
182
182
  import { KmsClient } from "@heossi/qnsi-kms-client";
183
183
  import { AuditClient } from "@heossi/qnsi-audit-sdk";
184
184
 
185
- const vault = new VaultClient({ apiKey, baseUrl: "https://api.qnsp.cuilabs.io/proxy/vault", tier });
186
- const kms = new KmsClient({ apiKey, baseUrl: "https://api.qnsp.cuilabs.io/proxy/kms", tier });
187
- const audit = new AuditClient({ apiKey, baseUrl: "https://api.qnsp.cuilabs.io/proxy/audit", tier });
185
+ const vault = new VaultClient({ apiKey, baseUrl: "https://api.qnsi.heossi.com/proxy/vault", tier });
186
+ const kms = new KmsClient({ apiKey, baseUrl: "https://api.qnsi.heossi.com/proxy/kms", tier });
187
+ const audit = new AuditClient({ apiKey, baseUrl: "https://api.qnsi.heossi.com/proxy/audit", tier });
188
188
 
189
189
  // After — one package, one activation, one client
190
- import { QnspClient } from "@heossi/qnsi";
190
+ import { QnsiClient } from "@heossi/qnsi";
191
191
 
192
- const qnsp = new QnspClient({ apiKey });
192
+ const qnsp = new QnsiClient({ apiKey });
193
193
  // qnsp.vault, qnsp.kms, qnsp.audit, ... all share one connection pool + one activation cache
194
194
  ```
195
195
 
@@ -25,13 +25,13 @@ export declare class SdkActivationError_ extends Error {
25
25
  * Configuration for SDK activation.
26
26
  */
27
27
  export interface SdkActivationConfig {
28
- /** QNSP API key (required — get one at https://cloud.qnsp.cuilabs.io/signup) */
28
+ /** QNSP API key (required — get one at https://cloud.qnsi.heossi.com/signup) */
29
29
  readonly apiKey: string;
30
30
  /** SDK package identifier */
31
31
  readonly sdkId: SdkIdentifier;
32
32
  /** SDK version string */
33
33
  readonly sdkVersion: string;
34
- /** Override platform URL (defaults to https://api.qnsp.cuilabs.io) */
34
+ /** Override platform URL (defaults to https://api.qnsi.heossi.com) */
35
35
  readonly platformUrl?: string | undefined;
36
36
  /** Override activation timeout in ms (defaults to 15000) */
37
37
  readonly timeoutMs?: number | undefined;
@@ -14,7 +14,7 @@
14
14
  */
15
15
  import { SdkActivationErrorSchema, SdkActivationResponseSchema, } from "./types.js";
16
16
  const ACTIVATION_PATH = "/billing/v1/sdk/activate";
17
- const DEFAULT_PLATFORM_URL = "https://api.qnsp.cuilabs.io";
17
+ const DEFAULT_PLATFORM_URL = "https://api.qnsi.heossi.com";
18
18
  const ACTIVATION_TIMEOUT_MS = 15_000;
19
19
  const REFRESH_BUFFER_SECONDS = 300; // Refresh 5 minutes before expiry
20
20
  /**
@@ -61,9 +61,9 @@ function detectRuntime() {
61
61
  export async function activateSdk(config) {
62
62
  if (!config.apiKey || config.apiKey.trim().length === 0) {
63
63
  throw new SdkActivationError_("INVALID_API_KEY", `QNSP ${config.sdkId}: apiKey is required. ` +
64
- "Get your free API key at https://cloud.qnsp.cuilabs.io/signup — " +
64
+ "Get your free API key at https://cloud.qnsi.heossi.com/signup — " +
65
65
  "no credit card required (FREE tier: 10 GB storage, 50,000 API calls/month). " +
66
- `Docs: https://docs.qnsp.cuilabs.io/sdk/${config.sdkId}`, 401);
66
+ `Docs: https://docs.qnsi.heossi.com/sdk/${config.sdkId}`, 401);
67
67
  }
68
68
  const key = cacheKey(config);
69
69
  const cached = activationCache.get(key);
@@ -114,7 +114,7 @@ export async function activateSdk(config) {
114
114
  }
115
115
  if (response.status === 401) {
116
116
  throw new SdkActivationError_("INVALID_API_KEY", `QNSP ${config.sdkId}: Invalid API key. ` +
117
- "Get your API key at https://cloud.qnsp.cuilabs.io/api-keys", 401);
117
+ "Get your API key at https://cloud.qnsi.heossi.com/api-keys", 401);
118
118
  }
119
119
  if (response.status === 429) {
120
120
  throw new SdkActivationError_("RATE_LIMITED", `QNSP ${config.sdkId}: Activation rate limited. Please retry after a short delay.`, 429);
@@ -1,18 +1,18 @@
1
1
  /**
2
2
  * Shared HTTP plumbing + activation cache.
3
3
  *
4
- * Internal — consumers should reach this only via `QnspClient`. Each
4
+ * Internal — consumers should reach this only via `QnsiClient`. Each
5
5
  * service module (vault, kms, audit, …) takes an `Internal` instance
6
6
  * in its constructor and calls `internal.request(method, path, …)`.
7
7
  */
8
8
  import { type SdkActivationResponse } from "./_activation/index.js";
9
9
  export declare const SDK_ID = "qnsp";
10
10
  export declare const SDK_VERSION = "0.3.0";
11
- /** Public configuration accepted by `new QnspClient(opts)`. */
12
- export interface QnspClientOptions {
13
- /** API key issued from <https://cloud.qnsp.cuilabs.io/api-keys>. Required. */
11
+ /** Public configuration accepted by `new QnsiClient(opts)`. */
12
+ export interface QnsiClientOptions {
13
+ /** API key issued from <https://cloud.qnsi.heossi.com/api-keys>. Required. */
14
14
  readonly apiKey: string;
15
- /** Override the QNSP edge-gateway URL. Defaults to https://api.qnsp.cuilabs.io. */
15
+ /** Override the QNSP edge-gateway URL. Defaults to https://api.qnsi.heossi.com. */
16
16
  readonly baseUrl?: string;
17
17
  /** Per-request timeout in milliseconds. Defaults to 15 000. */
18
18
  readonly timeoutMs?: number;
@@ -28,7 +28,7 @@ export declare class Internal {
28
28
  readonly apiKey: string;
29
29
  private cached;
30
30
  private activationPromise;
31
- constructor(opts: QnspClientOptions);
31
+ constructor(opts: QnsiClientOptions);
32
32
  /** Force the activation handshake to run now. */
33
33
  ensureActivated(): Promise<SdkActivationResponse>;
34
34
  /** The activated tenant id (for endpoints that require the tenant in the URL path). */
package/dist/_internal.js CHANGED
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * Shared HTTP plumbing + activation cache.
3
3
  *
4
- * Internal — consumers should reach this only via `QnspClient`. Each
4
+ * Internal — consumers should reach this only via `QnsiClient`. Each
5
5
  * service module (vault, kms, audit, …) takes an `Internal` instance
6
6
  * in its constructor and calls `internal.request(method, path, …)`.
7
7
  */
8
8
  import { activateSdk } from "./_activation/index.js";
9
- import { QnspApiError, QnspAuthError, QnspNetworkError } from "./errors.js";
9
+ import { QnsiApiError, QnsiAuthError, QnsiNetworkError } from "./errors.js";
10
10
  export const SDK_ID = "qnsp";
11
- // Bump in lockstep with packages/qnsp/package.json `version` (activation
11
+ // Bump in lockstep with packages/qnsi/package.json `version` (activation
12
12
  // telemetry label). Same release contract as browser/sdk-package-version.ts.
13
13
  export const SDK_VERSION = "0.3.0";
14
- const DEFAULT_BASE_URL = "https://api.qnsp.cuilabs.io";
14
+ const DEFAULT_BASE_URL = "https://api.qnsi.heossi.com";
15
15
  const DEFAULT_TIMEOUT_MS = 15_000;
16
16
  const EXPIRY_BUFFER_MS = 60_000; // refresh 60 s before expiry
17
17
  export class Internal {
@@ -22,7 +22,7 @@ export class Internal {
22
22
  activationPromise = null;
23
23
  constructor(opts) {
24
24
  if (!opts.apiKey || opts.apiKey.trim().length === 0) {
25
- throw new QnspAuthError("api key required (sign up at https://cloud.qnsp.cuilabs.io/auth)");
25
+ throw new QnsiAuthError("api key required (sign up at https://cloud.qnsi.heossi.com/auth)");
26
26
  }
27
27
  this.apiKey = opts.apiKey;
28
28
  this.baseUrl = (opts.baseUrl ?? DEFAULT_BASE_URL).replace(/\/$/, "");
@@ -107,7 +107,7 @@ export class Internal {
107
107
  return JSON.parse(text);
108
108
  }
109
109
  catch {
110
- throw new QnspApiError("response is not valid JSON", response.status);
110
+ throw new QnsiApiError("response is not valid JSON", response.status);
111
111
  }
112
112
  }
113
113
  async send(method, path, body, options) {
@@ -131,7 +131,7 @@ export class Internal {
131
131
  return await fetch(url, init);
132
132
  }
133
133
  catch (err) {
134
- throw new QnspNetworkError(method, url, err);
134
+ throw new QnsiNetworkError(method, url, err);
135
135
  }
136
136
  finally {
137
137
  clearTimeout(timer);
@@ -218,7 +218,7 @@ function parseApiError(status, raw) {
218
218
  else if (typeof raw === "string" && raw.length > 0) {
219
219
  message = raw;
220
220
  }
221
- return new QnspApiError(message, status, code, body);
221
+ return new QnsiApiError(message, status, code, body);
222
222
  }
223
223
  function parseExpiresAt(response) {
224
224
  const { expiresAt } = response;
@@ -1 +1 @@
1
- {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../src/audit.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAI/D,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AAED,qBAAa,WAAW;IACX,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,QAAQ;IAE/C,QAAQ,CAAC,GAAG,EAAE,eAAe,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,gBAAgB,CAAC;IAI5E,YAAY,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,gBAAgB,CAAC;IAI9F,UAAU,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC;CAG1C"}
1
+ {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../src/audit.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAI/D,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AA+BD,qBAAa,WAAW;IACX,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,QAAQ;IAE/C,QAAQ,CAAC,GAAG,EAAE,eAAe,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,gBAAgB,CAAC;IAI5E,YAAY,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,gBAAgB,CAAC;IAS9F,UAAU,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC;CAG1C"}
package/dist/audit.js CHANGED
@@ -3,16 +3,40 @@
3
3
  * `apps/audit-service` (`/audit/v1`).
4
4
  */
5
5
  const PATH_PREFIX = "/proxy/audit/v1";
6
+ /**
7
+ * Translate the ergonomic SDK event into the wire shape the audit-service
8
+ * actually accepts. This is the contract-translation boundary — callers keep
9
+ * passing `{ eventType, payload, tags }` unchanged.
10
+ *
11
+ * `normalizeBatch` (`apps/audit-service/src/services/audit-service.ts`) matches
12
+ * one of three strict schemas. The `_internal` client injects a top-level
13
+ * `tenantId` into every body, which **fails** the `legacyAttestation` schema
14
+ * (`{ eventType, timestamp?, severity?, payload? }`, `.strict()` → rejects
15
+ * `tenantId` → 0 events → HTTP 400). The only path that tolerates the injected
16
+ * `tenantId` is `legacySecurityAuditClientEventSchema`, which carries
17
+ * `{ eventType?, source?, tenantId?, details?, … }` and maps `details` → the
18
+ * stored event `payload` (and honours `tenantId` for tenant-scoping). So the
19
+ * caller's `payload` goes into `details`, and `tags` rides alongside as
20
+ * `details.tags`. Verified live: `{tenantId,eventType,source,details}` → 202;
21
+ * `{tenantId,eventType,payload}` → 400.
22
+ */
23
+ function toWireEvent(req) {
24
+ const details = { ...req.payload };
25
+ if (req.tags && req.tags.length > 0) {
26
+ details["tags"] = [...req.tags];
27
+ }
28
+ return { eventType: req.eventType, source: "qnsi-sdk", details };
29
+ }
6
30
  export class AuditClient {
7
31
  internal;
8
32
  constructor(internal) {
9
33
  this.internal = internal;
10
34
  }
11
35
  logEvent(req, opts) {
12
- return this.internal.request("POST", `${PATH_PREFIX}/events`, req, opts);
36
+ return this.internal.request("POST", `${PATH_PREFIX}/events`, toWireEvent(req), opts);
13
37
  }
14
38
  ingestEvents(events, opts) {
15
- return this.internal.request("POST", `${PATH_PREFIX}/events/batch`, { events }, opts);
39
+ return this.internal.request("POST", `${PATH_PREFIX}/events/batch`, { events: events.map(toWireEvent) }, opts);
16
40
  }
17
41
  listEvents(query) {
18
42
  return this.internal.request("GET", `${PATH_PREFIX}/events`, undefined, { query });
package/dist/audit.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"audit.js","sourceRoot":"","sources":["../src/audit.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAQtC,MAAM,OAAO,WAAW;IACM;IAA7B,YAA6B,QAAkB;QAAlB,aAAQ,GAAR,QAAQ,CAAU;IAAG,CAAC;IAEnD,QAAQ,CAAC,GAAoB,EAAE,IAA6C;QAC3E,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,WAAW,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IAC1E,CAAC;IAED,YAAY,CAAC,MAAkC,EAAE,IAA6C;QAC7F,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,WAAW,eAAe,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,CAAC;IACvF,CAAC;IAED,UAAU,CAAC,KAA+B;QACzC,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,WAAW,SAAS,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACpF,CAAC;CACD"}
1
+ {"version":3,"file":"audit.js","sourceRoot":"","sources":["../src/audit.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAQtC;;;;;;;;;;;;;;;;GAgBG;AACH,SAAS,WAAW,CAAC,GAAoB;IAKxC,MAAM,OAAO,GAA4B,EAAE,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;IAC5D,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;AAClE,CAAC;AAED,MAAM,OAAO,WAAW;IACM;IAA7B,YAA6B,QAAkB;QAAlB,aAAQ,GAAR,QAAQ,CAAU;IAAG,CAAC;IAEnD,QAAQ,CAAC,GAAoB,EAAE,IAA6C;QAC3E,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,WAAW,SAAS,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;IACvF,CAAC;IAED,YAAY,CAAC,MAAkC,EAAE,IAA6C;QAC7F,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAC3B,MAAM,EACN,GAAG,WAAW,eAAe,EAC7B,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,EACnC,IAAI,CACJ,CAAC;IACH,CAAC;IAED,UAAU,CAAC,KAA+B;QACzC,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,WAAW,SAAS,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACpF,CAAC;CACD"}
@@ -86,9 +86,9 @@ export interface WorkloadDetail extends WorkloadSummary {
86
86
  readonly artifacts: readonly WorkloadArtifactBinding[];
87
87
  readonly schedulerMetadata: Record<string, unknown> | null;
88
88
  }
89
- export interface QnspExecutorConfig {
89
+ export interface QnsiExecutorConfig {
90
90
  /**
91
- * QNSP API key. Get one at https://cloud.qnsp.cuilabs.io/api-keys
91
+ * QNSP API key. Get one at https://cloud.qnsi.heossi.com/api-keys
92
92
  * The API key carries the tenant ID — no separate tenantId needed.
93
93
  */
94
94
  readonly apiKey: string;
@@ -100,7 +100,7 @@ export interface QnspExecutorConfig {
100
100
  readonly tenantId?: string;
101
101
  /**
102
102
  * Base URL for the QNSP API.
103
- * Defaults to https://api.qnsp.cuilabs.io
103
+ * Defaults to https://api.qnsi.heossi.com
104
104
  */
105
105
  readonly baseUrl?: string;
106
106
  /**
@@ -182,16 +182,16 @@ export interface ExecuteCodeResult {
182
182
  *
183
183
  * @example
184
184
  * ```typescript
185
- * import { QnspExecutor } from "@heossi/qnsi/autogen";
185
+ * import { QnsiExecutor } from "@heossi/qnsi/autogen";
186
186
  *
187
- * const executor = new QnspExecutor({ apiKey: process.env.QNSP_API_KEY });
187
+ * const executor = new QnsiExecutor({ apiKey: process.env.QNSP_API_KEY });
188
188
  * const result = await executor.execute({ code: "print('hi')", language: "python" });
189
189
  * console.log(result.status, result.attestationProof);
190
190
  * ```
191
191
  */
192
- export declare class QnspExecutor {
192
+ export declare class QnsiExecutor {
193
193
  #private;
194
- constructor(config: QnspExecutorConfig);
194
+ constructor(config: QnsiExecutorConfig);
195
195
  /**
196
196
  * Execute code inside a QNSP enclave and wait for the result.
197
197
  */
@@ -47,20 +47,20 @@ const LANGUAGE_COMMANDS = {
47
47
  bash: ["bash", "-c"],
48
48
  javascript: ["node", "-e"],
49
49
  };
50
- // ─── QnspExecutor ─────────────────────────────────────────────────────────────
50
+ // ─── QnsiExecutor ─────────────────────────────────────────────────────────────
51
51
  /**
52
52
  * AutoGen-compatible code executor backed by QNSP AI orchestrator enclaves.
53
53
  *
54
54
  * @example
55
55
  * ```typescript
56
- * import { QnspExecutor } from "@heossi/qnsi/autogen";
56
+ * import { QnsiExecutor } from "@heossi/qnsi/autogen";
57
57
  *
58
- * const executor = new QnspExecutor({ apiKey: process.env.QNSP_API_KEY });
58
+ * const executor = new QnsiExecutor({ apiKey: process.env.QNSP_API_KEY });
59
59
  * const result = await executor.execute({ code: "print('hi')", language: "python" });
60
60
  * console.log(result.status, result.attestationProof);
61
61
  * ```
62
62
  */
63
- export class QnspExecutor {
63
+ export class QnsiExecutor {
64
64
  #apiKey;
65
65
  #baseUrl;
66
66
  #containerImage;
@@ -84,7 +84,7 @@ export class QnspExecutor {
84
84
  this.#pollIntervalMs = config.pollIntervalMs ?? 2_000;
85
85
  this.#requestTimeoutMs = config.requestTimeoutMs ?? 30_000;
86
86
  this.#apiKey = config.apiKey;
87
- this.#baseUrl = (config.baseUrl ?? "https://api.qnsp.cuilabs.io").replace(/\/$/, "");
87
+ this.#baseUrl = (config.baseUrl ?? "https://api.qnsi.heossi.com").replace(/\/$/, "");
88
88
  }
89
89
  /**
90
90
  * Resolve the effective tenant ID — either from config or via SDK activation.
@@ -7,12 +7,12 @@
7
7
  *
8
8
  * @example
9
9
  * ```typescript
10
- * import { QnspExecutor } from "@heossi/qnsi/autogen";
10
+ * import { QnsiExecutor } from "@heossi/qnsi/autogen";
11
11
  *
12
- * const executor = new QnspExecutor({ apiKey: process.env.QNSP_API_KEY });
12
+ * const executor = new QnsiExecutor({ apiKey: process.env.QNSP_API_KEY });
13
13
  * const result = await executor.execute({ code: "print('Hello')", language: "python" });
14
14
  * ```
15
15
  */
16
- export type { ExecuteCodeRequest, ExecuteCodeResult, QnspExecutorConfig, SubmitWorkloadRequest, WorkloadDetail, WorkloadStatus, } from "./executor.js";
17
- export { QnspExecutor } from "./executor.js";
16
+ export type { ExecuteCodeRequest, ExecuteCodeResult, QnsiExecutorConfig, SubmitWorkloadRequest, WorkloadDetail, WorkloadStatus, } from "./executor.js";
17
+ export { QnsiExecutor } from "./executor.js";
18
18
  //# sourceMappingURL=index.d.ts.map
@@ -7,11 +7,11 @@
7
7
  *
8
8
  * @example
9
9
  * ```typescript
10
- * import { QnspExecutor } from "@heossi/qnsi/autogen";
10
+ * import { QnsiExecutor } from "@heossi/qnsi/autogen";
11
11
  *
12
- * const executor = new QnspExecutor({ apiKey: process.env.QNSP_API_KEY });
12
+ * const executor = new QnsiExecutor({ apiKey: process.env.QNSP_API_KEY });
13
13
  * const result = await executor.execute({ code: "print('Hello')", language: "python" });
14
14
  * ```
15
15
  */
16
- export { QnspExecutor } from "./executor.js";
16
+ export { QnsiExecutor } from "./executor.js";
17
17
  //# sourceMappingURL=index.js.map
@@ -13,11 +13,11 @@ import type { PqcAlgorithm, PqcProvider } from "./pqc-types.js";
13
13
  export type RuntimeEnvironment = "browser" | "node" | "edge";
14
14
  /** Options for initializing the PQC provider. */
15
15
  export interface InitializePqcProviderOptions {
16
- /** QNSP API key — required. Get one at https://cloud.qnsp.cuilabs.io/signup */
16
+ /** QNSP API key — required. Get one at https://cloud.qnsi.heossi.com/signup */
17
17
  readonly apiKey: string;
18
18
  /** Optional subset of algorithms to enable. Defaults to all noble-supported. */
19
19
  readonly algorithms?: readonly PqcAlgorithm[] | undefined;
20
- /** Override platform URL (defaults to https://api.qnsp.cuilabs.io) */
20
+ /** Override platform URL (defaults to https://api.qnsi.heossi.com) */
21
21
  readonly platformUrl?: string | undefined;
22
22
  }
23
23
  /**
@@ -6,7 +6,7 @@
6
6
  * must stay browser-safe — no `node:fs` runtime read — and a static JSON
7
7
  * import would resolve outside the package `rootDir` (TS6059). This mirrors
8
8
  * the same release-bump contract as `SDK_VERSION` in `../_internal.ts`:
9
- * **bump this in lockstep with `packages/qnsp/package.json` `version`.**
9
+ * **bump this in lockstep with `packages/qnsi/package.json` `version`.**
10
10
  */
11
11
  export declare const SDK_PACKAGE_VERSION = "0.3.0";
12
12
  //# sourceMappingURL=sdk-package-version.d.ts.map
@@ -6,7 +6,7 @@
6
6
  * must stay browser-safe — no `node:fs` runtime read — and a static JSON
7
7
  * import would resolve outside the package `rootDir` (TS6059). This mirrors
8
8
  * the same release-bump contract as `SDK_VERSION` in `../_internal.ts`:
9
- * **bump this in lockstep with `packages/qnsp/package.json` `version`.**
9
+ * **bump this in lockstep with `packages/qnsi/package.json` `version`.**
10
10
  */
11
11
  export const SDK_PACKAGE_VERSION = "0.3.0";
12
12
  //# sourceMappingURL=sdk-package-version.js.map
@@ -18,7 +18,7 @@ export function createMockResponse(data, status = 200, ok = true, headers = {})
18
18
  }
19
19
  export const mockConfig = {
20
20
  edgeGatewayUrl: null,
21
- cloudPortalUrl: "https://cloud.qnsp.cuilabs.io",
21
+ cloudPortalUrl: "https://cloud.qnsi.heossi.com",
22
22
  authServiceUrl: "http://localhost:8081",
23
23
  serviceId: "test-service-id",
24
24
  serviceSecret: "test-secret",
@@ -16,7 +16,7 @@ function deriveViaEdgeGateway(options) {
16
16
  }
17
17
  export function loadConfig(overrides) {
18
18
  const edgeGatewayUrl = process.env["QNSP_EDGE_GATEWAY_URL"] ?? null;
19
- const cloudPortalUrl = process.env["QNSP_CLOUD_PORTAL_URL"] ?? "https://cloud.qnsp.cuilabs.io";
19
+ const cloudPortalUrl = process.env["QNSP_CLOUD_PORTAL_URL"] ?? "https://cloud.qnsi.heossi.com";
20
20
  const defaults = {
21
21
  edgeGatewayUrl,
22
22
  cloudPortalUrl,
@@ -1,6 +1,6 @@
1
1
  import { EXIT_CODES } from "../config.js";
2
2
  import { printError } from "./output.js";
3
- const CLOUD_PORTAL_URL = process.env["QNSP_CLOUD_PORTAL_URL"] ?? "https://cloud.qnsp.cuilabs.io";
3
+ const CLOUD_PORTAL_URL = process.env["QNSP_CLOUD_PORTAL_URL"] ?? "https://cloud.qnsi.heossi.com";
4
4
  export function handleBackendError(response, body) {
5
5
  const error = body;
6
6
  switch (response.status) {
package/dist/client.d.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  * SDK shape byte-for-byte.
9
9
  */
10
10
  import type { SdkActivationResponse } from "./_activation/index.js";
11
- import { type QnspClientOptions } from "./_internal.js";
11
+ import { type QnsiClientOptions } from "./_internal.js";
12
12
  import { AccessClient } from "./access.js";
13
13
  import { AiClient } from "./ai.js";
14
14
  import { AuditClient } from "./audit.js";
@@ -20,7 +20,7 @@ import { SearchClient } from "./search.js";
20
20
  import { StorageClient } from "./storage.js";
21
21
  import { TenantClient } from "./tenant.js";
22
22
  import { VaultClient } from "./vault.js";
23
- export declare class QnspClient {
23
+ export declare class QnsiClient {
24
24
  readonly vault: VaultClient;
25
25
  readonly kms: KmsClient;
26
26
  readonly audit: AuditClient;
@@ -33,7 +33,7 @@ export declare class QnspClient {
33
33
  readonly search: SearchClient;
34
34
  readonly ai: AiClient;
35
35
  private readonly internal;
36
- constructor(options: QnspClientOptions);
36
+ constructor(options: QnsiClientOptions);
37
37
  /**
38
38
  * Force the activation handshake to run now. Surfaces invalid-API-key
39
39
  * errors at startup rather than on the first service call.
@@ -48,5 +48,5 @@ export declare class QnspClient {
48
48
  /** Whether the tenant's plan enables a billing-side boolean feature. */
49
49
  hasFeature(feature: string): Promise<boolean>;
50
50
  }
51
- export type { QnspClientOptions } from "./_internal.js";
51
+ export type { QnsiClientOptions } from "./_internal.js";
52
52
  //# sourceMappingURL=client.d.ts.map
package/dist/client.js CHANGED
@@ -19,7 +19,7 @@ import { SearchClient } from "./search.js";
19
19
  import { StorageClient } from "./storage.js";
20
20
  import { TenantClient } from "./tenant.js";
21
21
  import { VaultClient } from "./vault.js";
22
- export class QnspClient {
22
+ export class QnsiClient {
23
23
  vault;
24
24
  kms;
25
25
  audit;
package/dist/errors.d.ts CHANGED
@@ -6,29 +6,29 @@
6
6
  * the failure mode without parsing error messages.
7
7
  */
8
8
  /** Base class — all QNSP SDK errors inherit. */
9
- export declare class QnspError extends Error {
9
+ export declare class QnsiError extends Error {
10
10
  constructor(message: string, options?: ErrorOptions);
11
11
  }
12
12
  /** DNS, TLS, timeout, or connection failure reaching the QNSP edge gateway. */
13
- export declare class QnspNetworkError extends QnspError {
13
+ export declare class QnsiNetworkError extends QnsiError {
14
14
  readonly op: string;
15
15
  readonly url: string;
16
16
  constructor(op: string, url: string, cause?: unknown);
17
17
  }
18
18
  /** API key rejected at activation. */
19
- export declare class QnspAuthError extends QnspError {
19
+ export declare class QnsiAuthError extends QnsiError {
20
20
  readonly code: string | null;
21
21
  constructor(message: string, code?: string | null);
22
22
  }
23
23
  /** A QNSP service returned a 4xx/5xx with a structured body. */
24
- export declare class QnspApiError extends QnspError {
24
+ export declare class QnsiApiError extends QnsiError {
25
25
  readonly statusCode: number;
26
26
  readonly code: string | null;
27
27
  readonly body: unknown;
28
28
  constructor(message: string, statusCode: number, code?: string | null, body?: unknown);
29
29
  }
30
30
  /** HMAC mismatch, expired/future timestamp, malformed body, or missing fields. */
31
- export declare class QnspWebhookError extends QnspError {
31
+ export declare class QnsiWebhookError extends QnsiError {
32
32
  readonly reason: string;
33
33
  constructor(reason: string);
34
34
  }
package/dist/errors.js CHANGED
@@ -6,51 +6,51 @@
6
6
  * the failure mode without parsing error messages.
7
7
  */
8
8
  /** Base class — all QNSP SDK errors inherit. */
9
- export class QnspError extends Error {
9
+ export class QnsiError extends Error {
10
10
  constructor(message, options) {
11
11
  super(message, options);
12
- this.name = "QnspError";
12
+ this.name = "QnsiError";
13
13
  }
14
14
  }
15
15
  /** DNS, TLS, timeout, or connection failure reaching the QNSP edge gateway. */
16
- export class QnspNetworkError extends QnspError {
16
+ export class QnsiNetworkError extends QnsiError {
17
17
  op;
18
18
  url;
19
19
  constructor(op, url, cause) {
20
20
  super(`qnsp: network error on ${op} ${url}: ${stringifyCause(cause)}`, { cause });
21
- this.name = "QnspNetworkError";
21
+ this.name = "QnsiNetworkError";
22
22
  this.op = op;
23
23
  this.url = url;
24
24
  }
25
25
  }
26
26
  /** API key rejected at activation. */
27
- export class QnspAuthError extends QnspError {
27
+ export class QnsiAuthError extends QnsiError {
28
28
  code;
29
29
  constructor(message, code = null) {
30
30
  super(`qnsp: auth error${code ? ` (${code})` : ""}: ${message}`);
31
- this.name = "QnspAuthError";
31
+ this.name = "QnsiAuthError";
32
32
  this.code = code;
33
33
  }
34
34
  }
35
35
  /** A QNSP service returned a 4xx/5xx with a structured body. */
36
- export class QnspApiError extends QnspError {
36
+ export class QnsiApiError extends QnsiError {
37
37
  statusCode;
38
38
  code;
39
39
  body;
40
40
  constructor(message, statusCode, code = null, body = null) {
41
41
  super(`qnsp: api error ${statusCode}${code ? ` ${code}` : ""}: ${message}`);
42
- this.name = "QnspApiError";
42
+ this.name = "QnsiApiError";
43
43
  this.statusCode = statusCode;
44
44
  this.code = code;
45
45
  this.body = body;
46
46
  }
47
47
  }
48
48
  /** HMAC mismatch, expired/future timestamp, malformed body, or missing fields. */
49
- export class QnspWebhookError extends QnspError {
49
+ export class QnsiWebhookError extends QnsiError {
50
50
  reason;
51
51
  constructor(reason) {
52
52
  super(`qnsp: webhook error: ${reason}`);
53
- this.name = "QnspWebhookError";
53
+ this.name = "QnsiWebhookError";
54
54
  this.reason = reason;
55
55
  }
56
56
  }