@vess-id/ai-identity 0.11.0 → 0.12.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 (32) hide show
  1. package/README.md +0 -16
  2. package/dist/client.d.ts +0 -14
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/index.d.mts +342 -153
  5. package/dist/index.d.ts +2 -1
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +164 -204
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.mjs +150 -203
  10. package/dist/index.mjs.map +1 -1
  11. package/dist/internal-signature/__tests__/canonical.spec.d.ts +2 -0
  12. package/dist/internal-signature/__tests__/canonical.spec.d.ts.map +1 -0
  13. package/dist/internal-signature/__tests__/signer-roundtrip.spec.d.ts +2 -0
  14. package/dist/internal-signature/__tests__/signer-roundtrip.spec.d.ts.map +1 -0
  15. package/dist/internal-signature/__tests__/signer.spec.d.ts +2 -0
  16. package/dist/internal-signature/__tests__/signer.spec.d.ts.map +1 -0
  17. package/dist/internal-signature/canonical.d.ts +80 -0
  18. package/dist/internal-signature/canonical.d.ts.map +1 -0
  19. package/dist/internal-signature/index.d.ts +17 -0
  20. package/dist/internal-signature/index.d.ts.map +1 -0
  21. package/dist/internal-signature/signer.d.ts +76 -0
  22. package/dist/internal-signature/signer.d.ts.map +1 -0
  23. package/dist/registry/index.d.ts +2 -0
  24. package/dist/registry/index.d.ts.map +1 -1
  25. package/dist/registry/reauth-constants.d.ts +33 -0
  26. package/dist/registry/reauth-constants.d.ts.map +1 -0
  27. package/dist/vp/kb-jwt-builder.d.ts +89 -0
  28. package/dist/vp/kb-jwt-builder.d.ts.map +1 -0
  29. package/dist/vp/vp-manager.d.ts.map +1 -1
  30. package/package.json +20 -26
  31. package/dist/memory/memory-manager.d.ts +0 -77
  32. package/dist/memory/memory-manager.d.ts.map +0 -1
package/dist/index.js CHANGED
@@ -52,6 +52,7 @@ __export(index_exports, {
52
52
  DummyCreds: () => DummyCreds,
53
53
  DummyVpVerifier: () => DummyVpVerifier,
54
54
  FilesystemKeyStorage: () => FilesystemKeyStorage,
55
+ GATEWAY_ERROR_CODE: () => GATEWAY_ERROR_CODE,
55
56
  GatewayClient: () => GatewayClient,
56
57
  GatewayError: () => GatewayError,
57
58
  GrantResourceType: () => GrantResourceType,
@@ -60,16 +61,20 @@ __export(index_exports, {
60
61
  InvalidVPError: () => InvalidVPError,
61
62
  InvitationStatus: () => InvitationStatus,
62
63
  JsonStateStore: () => JsonStateStore,
64
+ KB_JWT_DEFAULT_LIFETIME_SECONDS: () => KB_JWT_DEFAULT_LIFETIME_SECONDS,
63
65
  KeyManager: () => KeyManager,
64
66
  LEGACY_RESOURCE_TYPE_MAP: () => LEGACY_RESOURCE_TYPE_MAP,
67
+ MIN_SIGNER_KEY_BYTES: () => MIN_SIGNER_KEY_BYTES,
65
68
  MemoryKeyStorage: () => MemoryKeyStorage,
66
- MemoryManager: () => MemoryManager,
67
69
  NetworkError: () => NetworkError,
68
70
  OAuthProvider: () => OAuthProvider,
69
71
  PROVIDER_ALIASES: () => PROVIDER_ALIASES,
72
+ REAUTH_REQUIRED_ACTION: () => REAUTH_REQUIRED_ACTION,
70
73
  RESOURCE_TYPES: () => RESOURCE_TYPES,
71
74
  ReceiptStatus: () => ReceiptStatus,
72
75
  SDJwtClient: () => SDJwtClient,
76
+ SIGNATURE_HEADER: () => SIGNATURE_HEADER,
77
+ SIGNATURE_VERSION_PREFIX: () => SIGNATURE_VERSION_PREFIX,
73
78
  ScopeUnmatchedError: () => ScopeUnmatchedError,
74
79
  SimpleRebac: () => SimpleRebac,
75
80
  StandardActionCategory: () => StandardActionCategory,
@@ -87,7 +92,9 @@ __export(index_exports, {
87
92
  VCType: () => VCType,
88
93
  VPManager: () => VPManager,
89
94
  WRITE_ACTION_NAMES: () => WRITE_ACTION_NAMES,
95
+ buildCanonicalString: () => buildCanonicalString,
90
96
  buildGrantIdFields: () => buildGrantIdFields,
97
+ buildKbJwtPayload: () => buildKbJwtPayload,
91
98
  canonicalizeAction: () => canonicalizeAction,
92
99
  checkPermissionWithVP: () => checkPermissionWithVP,
93
100
  configure: () => configure,
@@ -99,6 +106,7 @@ __export(index_exports, {
99
106
  extractProjectKey: () => extractProjectKey,
100
107
  extractPublicKey: () => extractPublicKey,
101
108
  extractPublicKeyFromDid: () => extractPublicKeyFromDid,
109
+ formatSignatureHeader: () => formatSignatureHeader,
102
110
  generateActionParamsDisplay: () => generateActionParamsDisplay,
103
111
  generateActionSummary: () => generateActionSummary,
104
112
  generateKeyPair: () => generateKeyPair,
@@ -125,16 +133,21 @@ __export(index_exports, {
125
133
  isWriteAction: () => isWriteAction,
126
134
  loadActionRegistryFromFile: () => loadActionRegistryFromFile,
127
135
  loadActionRegistryFromObject: () => loadActionRegistryFromObject,
136
+ normalizeDomain: () => normalizeDomain,
128
137
  normalizeMcpActionName: () => normalizeMcpActionName,
129
138
  parseGrantAction: () => parseGrantAction,
130
139
  parseGrantResourceType: () => parseGrantResourceType,
140
+ parseSignatureHeader: () => parseSignatureHeader,
131
141
  planDelegationForVC: () => planDelegationForVC,
132
142
  publicKeysMatch: () => publicKeysMatch,
143
+ readVcExpSeconds: () => readVcExpSeconds,
133
144
  resolveActionsFromSelection: () => resolveActionsFromSelection,
134
145
  resolveProvider: () => resolveProvider,
135
146
  resolveResourceType: () => resolveResourceType,
136
147
  resolveUserTier: () => resolveUserTier,
148
+ sha256Hex: () => sha256Hex,
137
149
  signJWT: () => signJWT,
150
+ signRequest: () => signRequest,
138
151
  validateRegistryObject: () => validateRegistryObject,
139
152
  vcStatusToCredentialStatus: () => vcStatusToCredentialStatus,
140
153
  verifyJWT: () => verifyJWT,
@@ -1652,6 +1665,56 @@ var VCManager = class {
1652
1665
 
1653
1666
  // src/vp/vp-manager.ts
1654
1667
  var import_crypto_nodejs2 = require("@sd-jwt/crypto-nodejs");
1668
+
1669
+ // src/vp/kb-jwt-builder.ts
1670
+ var KB_JWT_DEFAULT_LIFETIME_SECONDS = 300;
1671
+ function buildKbJwtPayload(args, deps = {}) {
1672
+ const now = deps.now ?? Date.now;
1673
+ const iatSeconds = Math.floor(now() / 1e3);
1674
+ const kbExpCap = iatSeconds + KB_JWT_DEFAULT_LIFETIME_SECONDS;
1675
+ const vcExp = readVcExpSeconds(args.vcCredential);
1676
+ const expSeconds = vcExp !== void 0 ? Math.min(kbExpCap, vcExp) : kbExpCap;
1677
+ if (expSeconds <= iatSeconds) {
1678
+ throw new Error(
1679
+ `VC has expired: cannot issue KB-JWT (vc.exp=${vcExp}, now=${iatSeconds})`
1680
+ );
1681
+ }
1682
+ return {
1683
+ iss: args.holderDid,
1684
+ aud: normalizeDomain(args.audience),
1685
+ nonce: args.nonce,
1686
+ iat: iatSeconds,
1687
+ exp: expSeconds
1688
+ };
1689
+ }
1690
+ function readVcExpSeconds(sdJwtVc) {
1691
+ try {
1692
+ const jwtPart = sdJwtVc.split("~")[0];
1693
+ const payloadB64 = jwtPart.split(".")[1];
1694
+ if (!payloadB64) return void 0;
1695
+ const payload = JSON.parse(Buffer.from(payloadB64, "base64url").toString());
1696
+ return typeof payload.exp === "number" ? payload.exp : void 0;
1697
+ } catch {
1698
+ return void 0;
1699
+ }
1700
+ }
1701
+ function normalizeDomain(domain) {
1702
+ if (!domain) return domain;
1703
+ let urlStr;
1704
+ if (/^https?:\/\//i.test(domain)) {
1705
+ urlStr = domain;
1706
+ } else {
1707
+ const scheme = /^localhost(:\d+)?$/i.test(domain) ? "http" : "https";
1708
+ urlStr = `${scheme}://${domain}`;
1709
+ }
1710
+ try {
1711
+ return new URL(urlStr).origin;
1712
+ } catch {
1713
+ return domain;
1714
+ }
1715
+ }
1716
+
1717
+ // src/vp/vp-manager.ts
1655
1718
  var VPManager = class {
1656
1719
  keyManager;
1657
1720
  constructor(keyManager) {
@@ -1675,12 +1738,12 @@ var VPManager = class {
1675
1738
  presentableKeys.forEach((key) => {
1676
1739
  presentationFrame[key] = true;
1677
1740
  });
1678
- const kbJwtPayload = {
1679
- iss: options.holderDid,
1680
- aud: options.domain,
1741
+ const kbJwtPayload = buildKbJwtPayload({
1742
+ holderDid: options.holderDid,
1743
+ audience: options.domain,
1681
1744
  nonce: options.challenge,
1682
- iat: Math.floor(Date.now() / 1e3)
1683
- };
1745
+ vcCredential: sdJwtVC
1746
+ });
1684
1747
  const presentation = await sdJwtInstance.present(sdJwtVC, presentationFrame, {
1685
1748
  kb: { payload: kbJwtPayload }
1686
1749
  });
@@ -2130,172 +2193,6 @@ var ToolManager = class {
2130
2193
  }
2131
2194
  };
2132
2195
 
2133
- // src/memory/memory-manager.ts
2134
- var MemoryManager = class {
2135
- vpManager;
2136
- proxyApiUrl;
2137
- constructor(vpManager) {
2138
- this.vpManager = vpManager || new VPManager();
2139
- const config = getConfig();
2140
- this.proxyApiUrl = config.proxyApi?.baseUrl || "http://localhost:3000";
2141
- }
2142
- /**
2143
- * Write a document to memory
2144
- */
2145
- async write(content, options) {
2146
- const domain = new URL(this.proxyApiUrl).hostname;
2147
- const challenge = this.generateChallenge();
2148
- const vpJwt = await this.vpManager.create(options.vcs, {
2149
- holderDid: options.holderDid,
2150
- challenge,
2151
- domain,
2152
- purpose: "write"
2153
- });
2154
- const response = await fetch(`${this.proxyApiUrl}/api/v1/memory/${options.namespace}/doc`, {
2155
- method: "POST",
2156
- headers: {
2157
- "Content-Type": "application/json",
2158
- Authorization: `Bearer ${vpJwt}`
2159
- },
2160
- body: JSON.stringify({
2161
- content,
2162
- metadata: options.metadata,
2163
- challenge
2164
- })
2165
- });
2166
- if (!response.ok) {
2167
- const error = await response.text();
2168
- throw new Error(`Failed to write to memory: ${error}`);
2169
- }
2170
- return response.json();
2171
- }
2172
- /**
2173
- * Query memory with vector search
2174
- */
2175
- async query(query, options) {
2176
- const domain = new URL(this.proxyApiUrl).hostname;
2177
- const challenge = this.generateChallenge();
2178
- const vpJwt = await this.vpManager.create(options.vcs, {
2179
- holderDid: options.holderDid,
2180
- challenge,
2181
- domain,
2182
- purpose: "read"
2183
- });
2184
- const queryParams = {
2185
- query,
2186
- namespace: options.namespace,
2187
- limit: options.limit || 10,
2188
- filter: options.filter
2189
- };
2190
- const namespace = options.namespace || "default";
2191
- const response = await fetch(`${this.proxyApiUrl}/api/v1/memory/${namespace}/query`, {
2192
- method: "POST",
2193
- headers: {
2194
- "Content-Type": "application/json",
2195
- Authorization: `Bearer ${vpJwt}`
2196
- },
2197
- body: JSON.stringify({
2198
- ...queryParams,
2199
- challenge
2200
- })
2201
- });
2202
- if (!response.ok) {
2203
- const error = await response.text();
2204
- throw new Error(`Failed to query memory: ${error}`);
2205
- }
2206
- return response.json();
2207
- }
2208
- /**
2209
- * Delete a document from memory
2210
- */
2211
- async delete(documentId, options) {
2212
- const domain = new URL(this.proxyApiUrl).hostname;
2213
- const challenge = this.generateChallenge();
2214
- const vpJwt = await this.vpManager.create(options.vcs, {
2215
- holderDid: options.holderDid,
2216
- challenge,
2217
- domain,
2218
- purpose: "delete"
2219
- });
2220
- const response = await fetch(
2221
- `${this.proxyApiUrl}/api/v1/memory/${options.namespace}/${documentId}`,
2222
- {
2223
- method: "DELETE",
2224
- headers: {
2225
- Authorization: `Bearer ${vpJwt}`,
2226
- "X-Challenge": challenge
2227
- }
2228
- }
2229
- );
2230
- if (!response.ok) {
2231
- const error = await response.text();
2232
- throw new Error(`Failed to delete from memory: ${error}`);
2233
- }
2234
- }
2235
- /**
2236
- * List documents in a namespace
2237
- */
2238
- async list(options) {
2239
- const domain = new URL(this.proxyApiUrl).hostname;
2240
- const challenge = this.generateChallenge();
2241
- const vpJwt = await this.vpManager.create(options.vcs, {
2242
- holderDid: options.holderDid,
2243
- challenge,
2244
- domain,
2245
- purpose: "read"
2246
- });
2247
- const params = new URLSearchParams({
2248
- limit: (options.limit || 100).toString(),
2249
- offset: (options.offset || 0).toString()
2250
- });
2251
- const response = await fetch(
2252
- `${this.proxyApiUrl}/api/v1/memory/${options.namespace}/list?${params}`,
2253
- {
2254
- headers: {
2255
- Authorization: `Bearer ${vpJwt}`,
2256
- "X-Challenge": challenge
2257
- }
2258
- }
2259
- );
2260
- if (!response.ok) {
2261
- const error = await response.text();
2262
- throw new Error(`Failed to list memory documents: ${error}`);
2263
- }
2264
- return response.json();
2265
- }
2266
- /**
2267
- * Check if VCs authorize memory access
2268
- */
2269
- async checkAuthorization(vcs, action, resource) {
2270
- for (const vcJwt of vcs) {
2271
- try {
2272
- const parts = vcJwt.split(".");
2273
- const payload = JSON.parse(Buffer.from(parts[1], "base64url").toString());
2274
- const vcResource = payload.credentialSubject?.resource;
2275
- const vcActions = payload.credentialSubject?.actions || [];
2276
- if (this.matchResource(vcResource, resource)) {
2277
- if (vcActions.includes(action)) {
2278
- return true;
2279
- }
2280
- }
2281
- } catch {
2282
- continue;
2283
- }
2284
- }
2285
- return false;
2286
- }
2287
- matchResource(vcResource, requiredResource) {
2288
- if (vcResource.endsWith("/*")) {
2289
- const prefix = vcResource.slice(0, -2);
2290
- return requiredResource.startsWith(prefix);
2291
- }
2292
- return vcResource === requiredResource;
2293
- }
2294
- generateChallenge() {
2295
- return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
2296
- }
2297
- };
2298
-
2299
2196
  // src/grant/grant-manager.ts
2300
2197
  var GrantManager = class {
2301
2198
  constructor(_vpManager) {
@@ -2537,7 +2434,6 @@ var AIdentityClient = class {
2537
2434
  vc;
2538
2435
  vp;
2539
2436
  tool;
2540
- memory;
2541
2437
  grant;
2542
2438
  keyManager;
2543
2439
  currentAgent;
@@ -2551,7 +2447,6 @@ var AIdentityClient = class {
2551
2447
  this.vc = new VCManager(this.keyManager, this.agent, this.user);
2552
2448
  this.vp = new VPManager(this.keyManager);
2553
2449
  this.tool = new ToolManager(this.vp);
2554
- this.memory = new MemoryManager(this.vp);
2555
2450
  this.grant = new GrantManager(this.vp);
2556
2451
  }
2557
2452
  /**
@@ -2635,35 +2530,6 @@ var AIdentityClient = class {
2635
2530
  holderDid
2636
2531
  });
2637
2532
  }
2638
- /**
2639
- * Write to memory with automatic VP creation
2640
- */
2641
- async writeMemory(content, namespace, vcs, metadata) {
2642
- const holderDid = this.currentAgent?.did;
2643
- if (!holderDid) {
2644
- throw new Error("No current agent available");
2645
- }
2646
- return this.memory.write(content, {
2647
- namespace,
2648
- metadata,
2649
- vcs,
2650
- holderDid
2651
- });
2652
- }
2653
- /**
2654
- * Query memory with automatic VP creation
2655
- */
2656
- async queryMemory(query, vcs, options) {
2657
- const holderDid = this.currentAgent?.did;
2658
- if (!holderDid) {
2659
- throw new Error("No current agent available");
2660
- }
2661
- return this.memory.query(query, {
2662
- ...options,
2663
- vcs,
2664
- holderDid
2665
- });
2666
- }
2667
2533
  };
2668
2534
  var defaultClient;
2669
2535
  function getClient(config, password) {
@@ -2930,6 +2796,8 @@ var AIdentityError = class extends Error {
2930
2796
  this.name = this.constructor.name;
2931
2797
  Object.setPrototypeOf(this, new.target.prototype);
2932
2798
  }
2799
+ code;
2800
+ details;
2933
2801
  };
2934
2802
  var VCExpiredError = class extends AIdentityError {
2935
2803
  constructor(message = "Verifiable Credential has expired", details) {
@@ -4090,6 +3958,8 @@ var GatewayError = class extends Error {
4090
3958
  this.responseBody = responseBody;
4091
3959
  this.name = "GatewayError";
4092
3960
  }
3961
+ statusCode;
3962
+ responseBody;
4093
3963
  };
4094
3964
 
4095
3965
  // src/auth/auth-provider.ts
@@ -4569,6 +4439,7 @@ var SimpleRebac = class {
4569
4439
  constructor(allowRelations = ["viewer", "editor", "admin", "owner", "act_as"]) {
4570
4440
  this.allowRelations = allowRelations;
4571
4441
  }
4442
+ allowRelations;
4572
4443
  async check(_sub, relations) {
4573
4444
  return relations.some((r) => this.allowRelations.includes(r));
4574
4445
  }
@@ -4583,6 +4454,7 @@ var DummyVpVerifier = class {
4583
4454
  constructor(vc) {
4584
4455
  this.vc = vc;
4585
4456
  }
4457
+ vc;
4586
4458
  async verifyAndExtractClaims() {
4587
4459
  return this.vc;
4588
4460
  }
@@ -5911,6 +5783,17 @@ function normalizeMcpActionName(toolName, actionName) {
5911
5783
  return actionName;
5912
5784
  }
5913
5785
 
5786
+ // src/registry/reauth-constants.ts
5787
+ var REAUTH_REQUIRED_ACTION = "reauth_required";
5788
+ var GATEWAY_ERROR_CODE = {
5789
+ /** Upstream OAuth token is revoked — the user must re-auth at the SaaS provider. */
5790
+ REAUTH_REQUIRED: "REAUTH_REQUIRED",
5791
+ /** Local VC/VP is invalid (expired, malformed, signature mismatch). Try VC reissuance. */
5792
+ CREDENTIAL_INVALID: "CREDENTIAL_INVALID",
5793
+ /** VC allowed a different resource than the request targeted. Try a new approval. */
5794
+ RESOURCE_MISMATCH: "RESOURCE_MISMATCH"
5795
+ };
5796
+
5914
5797
  // src/registry/action-summary.ts
5915
5798
  var ACTION_DISPLAY_CONFIGS = {
5916
5799
  "slack.message.post": {
@@ -6165,6 +6048,70 @@ function getTierLimits(tier) {
6165
6048
  return TIER_LIMITS[resolveUserTier(tier)];
6166
6049
  }
6167
6050
 
6051
+ // src/internal-signature/canonical.ts
6052
+ var import_crypto3 = require("crypto");
6053
+ var SIGNATURE_HEADER = "x-internal-signature";
6054
+ var SIGNATURE_VERSION_PREFIX = "v1=";
6055
+ function sha256Hex(input) {
6056
+ return (0, import_crypto3.createHash)("sha256").update(input).digest("hex");
6057
+ }
6058
+ function buildCanonicalString(args) {
6059
+ const { method, path: path4, unixSeconds, rawBody } = args;
6060
+ return [method.toUpperCase(), path4, String(unixSeconds), sha256Hex(rawBody)].join("\n");
6061
+ }
6062
+ function parseSignatureHeader(headerValue) {
6063
+ if (typeof headerValue !== "string" || !headerValue.startsWith(SIGNATURE_VERSION_PREFIX)) {
6064
+ return null;
6065
+ }
6066
+ const payload = headerValue.slice(SIGNATURE_VERSION_PREFIX.length);
6067
+ const parts = payload.split(":");
6068
+ if (parts.length !== 3) return null;
6069
+ const [keyId, tsStr, signature] = parts;
6070
+ if (!keyId || !tsStr || !signature) return null;
6071
+ if (!/^[A-Za-z0-9_-]+$/.test(keyId)) return null;
6072
+ if (!/^\d+$/.test(tsStr)) return null;
6073
+ const unixSeconds = Number(tsStr);
6074
+ if (!Number.isFinite(unixSeconds) || unixSeconds < 0) return null;
6075
+ if (!/^[A-Za-z0-9+/]+=*$/.test(signature)) return null;
6076
+ return { keyId, unixSeconds, signature };
6077
+ }
6078
+ function formatSignatureHeader(parsed) {
6079
+ return `${SIGNATURE_VERSION_PREFIX}${parsed.keyId}:${parsed.unixSeconds}:${parsed.signature}`;
6080
+ }
6081
+
6082
+ // src/internal-signature/signer.ts
6083
+ var import_crypto4 = require("crypto");
6084
+ var MIN_SIGNER_KEY_BYTES = 32;
6085
+ function signRequest(key, args) {
6086
+ assertKeyMaterial(key);
6087
+ const unixSeconds = args.unixSeconds ?? Math.floor(Date.now() / 1e3);
6088
+ const canonical = buildCanonicalString({
6089
+ method: args.method,
6090
+ path: args.path,
6091
+ unixSeconds,
6092
+ rawBody: args.rawBody
6093
+ });
6094
+ const signature = (0, import_crypto4.createHmac)("sha256", key.secret).update(canonical).digest("base64");
6095
+ const parsed = {
6096
+ keyId: key.keyId,
6097
+ unixSeconds,
6098
+ signature
6099
+ };
6100
+ return formatSignatureHeader(parsed);
6101
+ }
6102
+ function assertKeyMaterial(k) {
6103
+ if (!k.keyId || !/^[A-Za-z0-9_-]+$/.test(k.keyId)) {
6104
+ throw new Error(
6105
+ `internal-signature signer: invalid keyId ${JSON.stringify(k.keyId)} (must match /^[A-Za-z0-9_-]+$/)`
6106
+ );
6107
+ }
6108
+ if (!Buffer.isBuffer(k.secret) || k.secret.length < MIN_SIGNER_KEY_BYTES) {
6109
+ throw new Error(
6110
+ `internal-signature signer: secret too short for keyId=${k.keyId} (${Buffer.isBuffer(k.secret) ? k.secret.length : "not a Buffer"} bytes; minimum ${MIN_SIGNER_KEY_BYTES} required)`
6111
+ );
6112
+ }
6113
+ }
6114
+
6168
6115
  // src/index.ts
6169
6116
  var version = "0.0.1";
6170
6117
  // Annotate the CommonJS export names for ESM import in node:
@@ -6191,6 +6138,7 @@ var version = "0.0.1";
6191
6138
  DummyCreds,
6192
6139
  DummyVpVerifier,
6193
6140
  FilesystemKeyStorage,
6141
+ GATEWAY_ERROR_CODE,
6194
6142
  GatewayClient,
6195
6143
  GatewayError,
6196
6144
  GrantResourceType,
@@ -6199,16 +6147,20 @@ var version = "0.0.1";
6199
6147
  InvalidVPError,
6200
6148
  InvitationStatus,
6201
6149
  JsonStateStore,
6150
+ KB_JWT_DEFAULT_LIFETIME_SECONDS,
6202
6151
  KeyManager,
6203
6152
  LEGACY_RESOURCE_TYPE_MAP,
6153
+ MIN_SIGNER_KEY_BYTES,
6204
6154
  MemoryKeyStorage,
6205
- MemoryManager,
6206
6155
  NetworkError,
6207
6156
  OAuthProvider,
6208
6157
  PROVIDER_ALIASES,
6158
+ REAUTH_REQUIRED_ACTION,
6209
6159
  RESOURCE_TYPES,
6210
6160
  ReceiptStatus,
6211
6161
  SDJwtClient,
6162
+ SIGNATURE_HEADER,
6163
+ SIGNATURE_VERSION_PREFIX,
6212
6164
  ScopeUnmatchedError,
6213
6165
  SimpleRebac,
6214
6166
  StandardActionCategory,
@@ -6226,7 +6178,9 @@ var version = "0.0.1";
6226
6178
  VCType,
6227
6179
  VPManager,
6228
6180
  WRITE_ACTION_NAMES,
6181
+ buildCanonicalString,
6229
6182
  buildGrantIdFields,
6183
+ buildKbJwtPayload,
6230
6184
  canonicalizeAction,
6231
6185
  checkPermissionWithVP,
6232
6186
  configure,
@@ -6238,6 +6192,7 @@ var version = "0.0.1";
6238
6192
  extractProjectKey,
6239
6193
  extractPublicKey,
6240
6194
  extractPublicKeyFromDid,
6195
+ formatSignatureHeader,
6241
6196
  generateActionParamsDisplay,
6242
6197
  generateActionSummary,
6243
6198
  generateKeyPair,
@@ -6264,16 +6219,21 @@ var version = "0.0.1";
6264
6219
  isWriteAction,
6265
6220
  loadActionRegistryFromFile,
6266
6221
  loadActionRegistryFromObject,
6222
+ normalizeDomain,
6267
6223
  normalizeMcpActionName,
6268
6224
  parseGrantAction,
6269
6225
  parseGrantResourceType,
6226
+ parseSignatureHeader,
6270
6227
  planDelegationForVC,
6271
6228
  publicKeysMatch,
6229
+ readVcExpSeconds,
6272
6230
  resolveActionsFromSelection,
6273
6231
  resolveProvider,
6274
6232
  resolveResourceType,
6275
6233
  resolveUserTier,
6234
+ sha256Hex,
6276
6235
  signJWT,
6236
+ signRequest,
6277
6237
  validateRegistryObject,
6278
6238
  vcStatusToCredentialStatus,
6279
6239
  verifyJWT,