shadowkey-agent-sdk 1.0.0 → 1.1.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/README.md CHANGED
@@ -14,13 +14,13 @@ Official SDK for integrating AI agents with ShadowKey's privacy-preserving data
14
14
  ## Installation
15
15
 
16
16
  ```bash
17
- npm install @shadowkey/agent-sdk
17
+ npm install shadowkey-agent-sdk
18
18
  ```
19
19
 
20
20
  ## Quick Start
21
21
 
22
22
  ```typescript
23
- import { ShadowKeyClient } from '@shadowkey/agent-sdk';
23
+ import { ShadowKeyClient } from 'shadowkey-agent-sdk';
24
24
 
25
25
  const client = new ShadowKeyClient({
26
26
  apiUrl: 'https://your-project.supabase.co/functions/v1',
package/dist/index.js CHANGED
@@ -59,12 +59,12 @@ var ShadowKeyClient = class {
59
59
  async generateSignature(payload) {
60
60
  const timestamp = Date.now();
61
61
  const nonceBytes = new Uint8Array(12);
62
- crypto.getRandomValues(nonceBytes);
62
+ globalThis.crypto.getRandomValues(nonceBytes);
63
63
  const nonce = Array.from(nonceBytes).map((b) => b.toString(16).padStart(2, "0")).join("");
64
64
  const message = JSON.stringify({ ...payload, timestamp, nonce });
65
65
  const encoder = new TextEncoder();
66
66
  const data = encoder.encode(message + this.config.apiKey);
67
- const hashBuffer = await crypto.subtle.digest("SHA-256", data);
67
+ const hashBuffer = await globalThis.crypto.subtle.digest("SHA-256", data);
68
68
  const hashArray = Array.from(new Uint8Array(hashBuffer));
69
69
  const signature = hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
70
70
  return { timestamp, nonce, signature };
@@ -118,10 +118,10 @@ var ShadowKeyClient = class {
118
118
  }
119
119
  }
120
120
  async requestAccess(request) {
121
- return this.makeRequest("/access-request", "POST", request);
121
+ return this.makeRequest("/sdk-access-request", "POST", request);
122
122
  }
123
123
  async checkStatus(requestId) {
124
- return this.makeRequest(`/access-status/${requestId}`, "GET");
124
+ return this.makeRequest(`/sdk-access-status/${requestId}`, "GET");
125
125
  }
126
126
  async submitReverseDisclosure(request) {
127
127
  return this.makeRequest("/reverse-disclosure", "POST", request);
package/dist/index.mjs CHANGED
@@ -33,12 +33,12 @@ var ShadowKeyClient = class {
33
33
  async generateSignature(payload) {
34
34
  const timestamp = Date.now();
35
35
  const nonceBytes = new Uint8Array(12);
36
- crypto.getRandomValues(nonceBytes);
36
+ globalThis.crypto.getRandomValues(nonceBytes);
37
37
  const nonce = Array.from(nonceBytes).map((b) => b.toString(16).padStart(2, "0")).join("");
38
38
  const message = JSON.stringify({ ...payload, timestamp, nonce });
39
39
  const encoder = new TextEncoder();
40
40
  const data = encoder.encode(message + this.config.apiKey);
41
- const hashBuffer = await crypto.subtle.digest("SHA-256", data);
41
+ const hashBuffer = await globalThis.crypto.subtle.digest("SHA-256", data);
42
42
  const hashArray = Array.from(new Uint8Array(hashBuffer));
43
43
  const signature = hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
44
44
  return { timestamp, nonce, signature };
@@ -92,10 +92,10 @@ var ShadowKeyClient = class {
92
92
  }
93
93
  }
94
94
  async requestAccess(request) {
95
- return this.makeRequest("/access-request", "POST", request);
95
+ return this.makeRequest("/sdk-access-request", "POST", request);
96
96
  }
97
97
  async checkStatus(requestId) {
98
- return this.makeRequest(`/access-status/${requestId}`, "GET");
98
+ return this.makeRequest(`/sdk-access-status/${requestId}`, "GET");
99
99
  }
100
100
  async submitReverseDisclosure(request) {
101
101
  return this.makeRequest("/reverse-disclosure", "POST", request);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shadowkey-agent-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Official SDK for integrating AI agents with ShadowKey privacy vault",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -32,11 +32,13 @@
32
32
  ],
33
33
  "author": "ShadowKey Team",
34
34
  "license": "MIT",
35
+ "engines": {
36
+ "node": ">=18"
37
+ },
35
38
  "repository": {
36
39
  "type": "git",
37
40
  "url": "https://github.com/kimboltpro3-create/shadowkey"
38
41
  },
39
- "dependencies": {},
40
42
  "devDependencies": {
41
43
  "tsup": "^8.0.0",
42
44
  "typescript": "^5.5.3",