@vaultgraph/sdk 0.1.4 → 0.1.5
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 +24 -8
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
# VaultGraph SDK
|
|
2
2
|
|
|
3
|
-
VaultGraph
|
|
3
|
+
[VaultGraph](https://vaultgraph.com) is a platform for building trustworthy AI agent applications.
|
|
4
|
+
|
|
5
|
+
## What this SDK is for
|
|
6
|
+
|
|
7
|
+
- Build canonical `JobReceipt` payloads that match the portal ingestion API.
|
|
8
|
+
- Hash sensitive context before it leaves your system.
|
|
9
|
+
- Sign receipts with your vendor keys and submit them to `/api/receipts` using your vendor API key.
|
|
10
|
+
- Verify signatures locally when needed.
|
|
11
|
+
|
|
12
|
+
## Prerequisites
|
|
13
|
+
|
|
14
|
+
- A VaultGraph vendor organization in the portal (create or join at https://app.vaultgraph.com). Marketing site: https://vaultgraph.com.
|
|
15
|
+
- Vendor API key created in the portal (Org Settings → API Keys). Keep this server-side only.
|
|
16
|
+
- At least one agent and consumer defined in the portal so you can reference their IDs when creating receipts.
|
|
17
|
+
|
|
18
|
+
If you need step-by-step UI guidance, see the [VaultGraph Docs](https://vaultgraph.com/docs).
|
|
4
19
|
|
|
5
20
|
## Install
|
|
6
21
|
|
|
@@ -12,7 +27,7 @@ pnpm add @vaultgraph/sdk
|
|
|
12
27
|
|
|
13
28
|
### Generate a keypair (one-time, server-side)
|
|
14
29
|
|
|
15
|
-
**Supported algorithm
|
|
30
|
+
**Supported algorithm: Ed25519.** The ingestion API verifies with `algorithm: null`, which assumes Ed25519/Ed448; RSA/ECDSA signatures are not accepted right now.
|
|
16
31
|
|
|
17
32
|
```ts
|
|
18
33
|
import { generateKeyPair } from "@vaultgraph/sdk";
|
|
@@ -30,9 +45,7 @@ This helper is server-only (Node 18+/edge) and returns PEM-encoded Ed25519 keys.
|
|
|
30
45
|
```ts
|
|
31
46
|
import {
|
|
32
47
|
createReceipt,
|
|
33
|
-
createSignedReceipt,
|
|
34
48
|
hashContext,
|
|
35
|
-
submitSignedReceipt,
|
|
36
49
|
signReceipt,
|
|
37
50
|
submitReceipt,
|
|
38
51
|
verifyReceipt,
|
|
@@ -51,8 +64,8 @@ const receipt = createReceipt({
|
|
|
51
64
|
metadata: { channel: "email" },
|
|
52
65
|
});
|
|
53
66
|
|
|
54
|
-
// 3) Sign the receipt
|
|
55
|
-
const
|
|
67
|
+
// 3) Sign the receipt with Ed25519 algorithm
|
|
68
|
+
const signature = signReceipt({
|
|
56
69
|
receipt,
|
|
57
70
|
privateKey: process.env.VAULTGRAPH_VENDOR_PRIVATE_KEY!,
|
|
58
71
|
});
|
|
@@ -70,7 +83,6 @@ await submitReceipt({
|
|
|
70
83
|
signature,
|
|
71
84
|
publicKey: process.env.VAULTGRAPH_VENDOR_PUBLIC_KEY!,
|
|
72
85
|
apiKey: process.env.VAULTGRAPH_VENDOR_API_KEY!,
|
|
73
|
-
// apiUrl: "https://localhost:3000" // optional override
|
|
74
86
|
});
|
|
75
87
|
```
|
|
76
88
|
|
|
@@ -120,10 +132,14 @@ const { receipt, signature } = createSignedReceipt({
|
|
|
120
132
|
- `createSignedReceipt(options)` → `{ receipt, signature }`
|
|
121
133
|
- `submitSignedReceipt(options)` → creates, signs, and submits; defaults `apiUrl` to portal base
|
|
122
134
|
- `submitReceipt(options)` → POSTs to `/api/receipts` (requires `apiKey`)
|
|
123
|
-
-
|
|
135
|
+
- `submitReceipt(options)` → POSTs to `/api/receipts` (requires `apiKey`)
|
|
136
|
+
- `generateKeyPair()` → returns PEM-encoded Ed25519 keypair
|
|
137
|
+
- Types: `CreateReceiptInput`, `JobReceipt`, `JobReceiptV0`, `JobResolution`, `ReceiptVersion`, `SubmitReceiptOptions`, `SubmitReceiptResponse`
|
|
124
138
|
|
|
125
139
|
## Notes
|
|
126
140
|
|
|
127
141
|
- Do not send raw conversation context; send `context_hash` instead.
|
|
128
142
|
- Keep your private key and vendor API key server-side only (API key is required for ingestion).
|
|
129
143
|
- Receipt versioning currently `v0`; breaking changes will bump the major version of this package.
|
|
144
|
+
- Portal: https://app.vaultgraph.com
|
|
145
|
+
- Docs: https://vaultgraph.com/docs
|
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaultgraph/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"homepage": "https://vaultgraph.com/",
|
|
8
|
+
"bugs": {
|
|
9
|
+
"url": "mailto:admin@vaultgraph.com"
|
|
10
|
+
},
|
|
7
11
|
"files": ["dist"],
|
|
8
12
|
"main": "./dist/index.js",
|
|
9
13
|
"module": "./dist/index.js",
|