@vorim/sdk 3.19.0 → 3.20.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 +49 -0
- package/README.md +73 -1
- package/dist/index.cjs +145 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +109 -1
- package/dist/index.d.ts +109 -1
- package/dist/index.js +138 -7
- package/dist/index.js.map +1 -1
- package/dist/integrations/commerce-agents.cjs +467 -0
- package/dist/integrations/commerce-agents.cjs.map +1 -0
- package/dist/integrations/commerce-agents.d.cts +199 -0
- package/dist/integrations/commerce-agents.d.ts +199 -0
- package/dist/integrations/commerce-agents.js +429 -0
- package/dist/integrations/commerce-agents.js.map +1 -0
- package/package.json +11 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
# Changelog — @vorim/sdk
|
|
2
2
|
|
|
3
|
+
## 3.20.0
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **Anthropic commerce-agents integration**
|
|
8
|
+
(`import { createVorimCommerceGuard, guardStorefrontBackend, guardMerchantBackend }
|
|
9
|
+
from '@vorim/sdk/integrations/commerce-agents'`) — guards an agent built on
|
|
10
|
+
Anthropic's [commerce-agents](https://github.com/anthropics/commerce-agents)
|
|
11
|
+
blueprint. That blueprint plugs in through two contracts, `StorefrontBackend`
|
|
12
|
+
and `MerchantBackend`, and every tool the model calls lands in one of their
|
|
13
|
+
methods, so the guard wraps the backend rather than any of its three runtimes.
|
|
14
|
+
Catalogue, order, policy and analytics reads require `agent:read`; cart writes
|
|
15
|
+
and staged merchant changes `agent:write`; `checkout_handoff`, which produces a
|
|
16
|
+
payable cart, `agent:transact`; and `apply_change`, the irreversible live-store
|
|
17
|
+
write, `agent:elevate` plus a named human. `approveChange()` bridges a resolved
|
|
18
|
+
Vorim escalation into the blueprint's `approved_change_ids`, so the mark it
|
|
19
|
+
applies on is backed by a signed human decision rather than host code that
|
|
20
|
+
trusted the conversation. Nothing imports commerce-agents: the wrappers proxy
|
|
21
|
+
the backend structurally, a denial throws before the store is called, and
|
|
22
|
+
`onDenied` maps it onto the blueprint's own `NotOffered` / `Unavailable`
|
|
23
|
+
wording. Method names match in either spelling (`searchProducts` or
|
|
24
|
+
`search_products`). Parity with `vorim.integrations.commerce_agents` in the
|
|
25
|
+
Python SDK.
|
|
26
|
+
|
|
27
|
+
- **`eventDigest(event)`** — the stable content digest of an audit event,
|
|
28
|
+
`sha256:<hex>` over the same canonical bytes the signature covers, dispatched
|
|
29
|
+
on `canonical_form`. Not a new primitive: this is the value `prev_event_hash`
|
|
30
|
+
has always referenced, promoted to a named export so a downstream evidence
|
|
31
|
+
layer can bind to a reference without reimplementing the dispatch. Byte-identical
|
|
32
|
+
to `eventDigest` in `@vorim/verify`, `event_digest` in the Python SDK, and the
|
|
33
|
+
digest the server now returns from `POST /v1/audit/events`. Locked by
|
|
34
|
+
`scripts/check-replay-parity.sh`.
|
|
35
|
+
|
|
36
|
+
- **Payload commitments** (`commitPayload`, `hashPayload`, `isKeyedCommitment`,
|
|
37
|
+
`isDigest`). `input_hash` and `output_hash` always let you send a digest
|
|
38
|
+
instead of a prompt, but the format was a bare `sha256:`, and a bare SHA-256
|
|
39
|
+
of a prompt is a lookup key rather than a commitment — prompts are low-entropy
|
|
40
|
+
and templated, so a holder of the digest recovers the content by trying
|
|
41
|
+
candidates. `commitPayload(content, key)` produces `hmac-sha256:<hex>` under a
|
|
42
|
+
key you hold and never send us. `hashPayload` is unchanged and still correct
|
|
43
|
+
for content that is already high-entropy.
|
|
44
|
+
|
|
45
|
+
- **`noPayload` mode** (`createVorim({ noPayload: true })`). Throws before
|
|
46
|
+
anything is transmitted when an event would carry content: non-scalar metadata,
|
|
47
|
+
metadata strings over `maxMetadataChars` (256 by default), or a hash field that
|
|
48
|
+
is not a well-formed digest. Distinct from the server-side Zero Data Retention
|
|
49
|
+
setting, which drops `metadata` at persistence after it has already crossed the
|
|
50
|
+
network. `noPayload` means it never left your process. Off by default.
|
|
51
|
+
|
|
3
52
|
## 3.11.0
|
|
4
53
|
|
|
5
54
|
### Added
|
package/README.md
CHANGED
|
@@ -411,10 +411,82 @@ const vorim = createVorim({
|
|
|
411
411
|
|
|
412
412
|
| Option | Type | Default | Description |
|
|
413
413
|
|--------|------|---------|-------------|
|
|
414
|
-
| `apiKey` | `string` | — | Your Vorim API key (`agid_sk_live_...`
|
|
414
|
+
| `apiKey` | `string` | — | Your Vorim API key (`agid_sk_live_...`) |
|
|
415
415
|
| `baseUrl` | `string` | `https://api.vorim.ai` | API base URL (override for self-hosted) |
|
|
416
416
|
| `timeout` | `number` | `10000` | Request timeout in milliseconds |
|
|
417
417
|
| `autoSign` | `boolean` | `true` | Sign every audit event at source with the agent's Ed25519 key |
|
|
418
|
+
| `noPayload` | `boolean \| { maxMetadataChars?: number }` | `false` | Refuse to transmit agent content. Throws before sending on non-scalar metadata, over-long metadata strings, or a hash field that is not a well-formed digest |
|
|
419
|
+
|
|
420
|
+
---
|
|
421
|
+
|
|
422
|
+
## Payload Privacy
|
|
423
|
+
|
|
424
|
+
Your prompts and model outputs never have to reach Vorim. The audit event
|
|
425
|
+
carries a digest of them, computed in your process.
|
|
426
|
+
|
|
427
|
+
### Commit, don't just hash
|
|
428
|
+
|
|
429
|
+
A bare SHA-256 of a prompt is not a commitment, it is a lookup key. Prompts are
|
|
430
|
+
low-entropy and usually templated, so anyone holding the digest and the template
|
|
431
|
+
recovers the content by trying candidates until a hash matches. That includes us,
|
|
432
|
+
and anyone who obtains an export.
|
|
433
|
+
|
|
434
|
+
```typescript
|
|
435
|
+
import { commitPayload, hashPayload } from "@vorim/sdk";
|
|
436
|
+
|
|
437
|
+
const key = process.env.VORIM_COMMITMENT_KEY!; // never sent to Vorim
|
|
438
|
+
|
|
439
|
+
await vorim.emit({
|
|
440
|
+
agent_id: agent.agent_id,
|
|
441
|
+
event_type: "tool_call",
|
|
442
|
+
action: "invoice.refund",
|
|
443
|
+
result: "success",
|
|
444
|
+
input_hash: await commitPayload(prompt, key), // hmac-sha256:...
|
|
445
|
+
output_hash: await commitPayload(completion, key),
|
|
446
|
+
});
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
Keep `hashPayload` for content that is already high-entropy, such as a file
|
|
450
|
+
digest or a random identifier.
|
|
451
|
+
|
|
452
|
+
To disclose later, hand the verifier the content and the key; they recompute and
|
|
453
|
+
compare. Rotating the key does not invalidate past events, so retain the key you
|
|
454
|
+
used for as long as you might need to prove the events it covers.
|
|
455
|
+
|
|
456
|
+
### Refuse to send content at all
|
|
457
|
+
|
|
458
|
+
```typescript
|
|
459
|
+
const vorim = createVorim({ apiKey: process.env.VORIM_API_KEY!, noPayload: true });
|
|
460
|
+
|
|
461
|
+
await vorim.emit({ ...event, metadata: { tool: "stripe.refunds.create" } }); // ok
|
|
462
|
+
await vorim.emit({ ...event, metadata: { prompt: fullPrompt } }); // throws
|
|
463
|
+
// VorimError PAYLOAD_BLOCKED — nothing was sent
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
Not the same as the server-side Zero Data Retention setting, which drops metadata
|
|
467
|
+
when we persist it, by which point the content has crossed the network. This mode
|
|
468
|
+
means it never left your process.
|
|
469
|
+
|
|
470
|
+
`action` and `resource` are left alone: both are short structural identifiers
|
|
471
|
+
covered by the signature.
|
|
472
|
+
|
|
473
|
+
### Referencing an event
|
|
474
|
+
|
|
475
|
+
Every emit returns a stable content digest beside the event id, computed over
|
|
476
|
+
exactly the bytes the signature covers. You can recompute it yourself, and it is
|
|
477
|
+
the same value `prev_event_hash` references on the next event.
|
|
478
|
+
|
|
479
|
+
```typescript
|
|
480
|
+
const { events } = await vorim.emit({ /* ... */ });
|
|
481
|
+
// events: [{ event_id: "evt_...", digest: "sha256:..." }]
|
|
482
|
+
|
|
483
|
+
import { eventDigest } from "@vorim/sdk";
|
|
484
|
+
await eventDigest(sentEvent) === events[0].digest; // true
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
Byte-identical in `@vorim/verify` and the Python SDK. A content digest, not an
|
|
488
|
+
identity: two byte-identical events share one, which is why the event id sits
|
|
489
|
+
beside it.
|
|
418
490
|
|
|
419
491
|
---
|
|
420
492
|
|
package/dist/index.cjs
CHANGED
|
@@ -31,17 +31,24 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
33
|
CANONICAL_TOOL_CATALOGUE_VERSION: () => CANONICAL_TOOL_CATALOGUE_VERSION,
|
|
34
|
+
HMAC_SHA256_PREFIX: () => HMAC_SHA256_PREFIX,
|
|
35
|
+
SHA256_PREFIX: () => SHA256_PREFIX,
|
|
34
36
|
VorimDeniedError: () => VorimDeniedError,
|
|
35
37
|
VorimError: () => VorimError,
|
|
36
38
|
VorimSDK: () => VorimSDK,
|
|
37
39
|
canonicalPayloadV0: () => canonicalPayloadV0,
|
|
38
40
|
canonicalPayloadV1: () => canonicalPayloadV1,
|
|
41
|
+
commitPayload: () => commitPayload,
|
|
39
42
|
default: () => createVorim,
|
|
40
43
|
deviceLogin: () => deviceLogin,
|
|
44
|
+
eventDigest: () => eventDigest,
|
|
45
|
+
hashPayload: () => hashPayload,
|
|
41
46
|
hashPreviousEvent: () => hashPreviousEvent,
|
|
42
47
|
hashSystemPrompt: () => hashSystemPrompt,
|
|
43
48
|
hashTool: () => hashTool,
|
|
44
49
|
hashToolCatalogue: () => hashToolCatalogue,
|
|
50
|
+
isDigest: () => isDigest,
|
|
51
|
+
isKeyedCommitment: () => isKeyedCommitment,
|
|
45
52
|
jcsCanonicalise: () => jcsCanonicalise,
|
|
46
53
|
prepareReplayContext: () => prepareReplayContext
|
|
47
54
|
});
|
|
@@ -123,8 +130,57 @@ async function prepareReplayContext(inputs) {
|
|
|
123
130
|
return ctx;
|
|
124
131
|
}
|
|
125
132
|
|
|
133
|
+
// src/commit.ts
|
|
134
|
+
var HMAC_SHA256_PREFIX = "hmac-sha256:";
|
|
135
|
+
var SHA256_PREFIX = "sha256:";
|
|
136
|
+
function toBytes(v) {
|
|
137
|
+
return typeof v === "string" ? new TextEncoder().encode(v) : v;
|
|
138
|
+
}
|
|
139
|
+
function toHex(buf) {
|
|
140
|
+
return Array.from(buf instanceof Uint8Array ? buf : new Uint8Array(buf)).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
141
|
+
}
|
|
142
|
+
async function hashPayload(content) {
|
|
143
|
+
const bytes = toBytes(content);
|
|
144
|
+
const subtle = globalThis.crypto?.subtle;
|
|
145
|
+
if (subtle) {
|
|
146
|
+
return SHA256_PREFIX + toHex(await subtle.digest("SHA-256", bytes));
|
|
147
|
+
}
|
|
148
|
+
const nodeCrypto = await import("crypto");
|
|
149
|
+
return SHA256_PREFIX + nodeCrypto.createHash("sha256").update(bytes).digest("hex");
|
|
150
|
+
}
|
|
151
|
+
async function commitPayload(content, key) {
|
|
152
|
+
const keyBytes = toBytes(key);
|
|
153
|
+
if (keyBytes.length === 0) {
|
|
154
|
+
throw new Error(
|
|
155
|
+
"commitPayload: key must not be empty. An empty key makes the commitment no stronger than hashPayload while labelling it as keyed."
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
const bytes = toBytes(content);
|
|
159
|
+
const subtle = globalThis.crypto?.subtle;
|
|
160
|
+
if (subtle) {
|
|
161
|
+
const cryptoKey = await subtle.importKey(
|
|
162
|
+
"raw",
|
|
163
|
+
keyBytes,
|
|
164
|
+
{ name: "HMAC", hash: "SHA-256" },
|
|
165
|
+
false,
|
|
166
|
+
["sign"]
|
|
167
|
+
);
|
|
168
|
+
const sig = await subtle.sign("HMAC", cryptoKey, bytes);
|
|
169
|
+
return HMAC_SHA256_PREFIX + toHex(sig);
|
|
170
|
+
}
|
|
171
|
+
const nodeCrypto = await import("crypto");
|
|
172
|
+
return HMAC_SHA256_PREFIX + nodeCrypto.createHmac("sha256", keyBytes).update(bytes).digest("hex");
|
|
173
|
+
}
|
|
174
|
+
function isKeyedCommitment(digest) {
|
|
175
|
+
return typeof digest === "string" && digest.startsWith(HMAC_SHA256_PREFIX);
|
|
176
|
+
}
|
|
177
|
+
var DIGEST_RE = /^(?:sha256|hmac-sha256):[0-9a-f]{64}$/;
|
|
178
|
+
function isDigest(digest) {
|
|
179
|
+
return typeof digest === "string" && DIGEST_RE.test(digest);
|
|
180
|
+
}
|
|
181
|
+
|
|
126
182
|
// src/index.ts
|
|
127
|
-
var SDK_VERSION = true ? "3.
|
|
183
|
+
var SDK_VERSION = true ? "3.20.0" : "0.0.0";
|
|
128
184
|
var USER_AGENT = `vorim-sdk/${SDK_VERSION}`;
|
|
129
185
|
function sleep(ms) {
|
|
130
186
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -143,6 +199,14 @@ function canonicalPayloadV1(event) {
|
|
|
143
199
|
const { signature: _sig, canonical_form: _cf, ...rest } = event;
|
|
144
200
|
return jcsCanonicalise(rest);
|
|
145
201
|
}
|
|
202
|
+
async function eventDigest(event) {
|
|
203
|
+
const form = event.canonical_form ?? "v0";
|
|
204
|
+
const bytes = form === "v1" ? canonicalPayloadV1(event) : canonicalPayloadV0(event);
|
|
205
|
+
return hashPreviousEvent(bytes);
|
|
206
|
+
}
|
|
207
|
+
function idempotencyHeader(key) {
|
|
208
|
+
return key ? { "Idempotency-Key": key } : void 0;
|
|
209
|
+
}
|
|
146
210
|
var VorimSDK = class _VorimSDK {
|
|
147
211
|
apiKey;
|
|
148
212
|
baseUrl;
|
|
@@ -151,6 +215,8 @@ var VorimSDK = class _VorimSDK {
|
|
|
151
215
|
canonicalForm;
|
|
152
216
|
chainEvents;
|
|
153
217
|
runtimeFailOpen;
|
|
218
|
+
noPayload;
|
|
219
|
+
maxMetadataChars;
|
|
154
220
|
/**
|
|
155
221
|
* In-memory keyring mapping agent_id -> PEM-encoded Ed25519 private key.
|
|
156
222
|
* Populated automatically by register() and registerEphemeral(), or
|
|
@@ -197,6 +263,8 @@ var VorimSDK = class _VorimSDK {
|
|
|
197
263
|
}
|
|
198
264
|
this.chainEvents = config.chainEvents ?? false;
|
|
199
265
|
this.runtimeFailOpen = config.runtimeFailOpen ?? true;
|
|
266
|
+
this.noPayload = config.noPayload !== void 0 && config.noPayload !== false;
|
|
267
|
+
this.maxMetadataChars = typeof config.noPayload === "object" && typeof config.noPayload.maxMetadataChars === "number" ? config.noPayload.maxMetadataChars : 256;
|
|
200
268
|
}
|
|
201
269
|
/**
|
|
202
270
|
* Register a previously-issued agent keypair so this SDK instance can
|
|
@@ -836,7 +904,11 @@ var VorimSDK = class _VorimSDK {
|
|
|
836
904
|
*/
|
|
837
905
|
async emit(event, options) {
|
|
838
906
|
const prepared = await this.prepareEvent(event, options?.sign);
|
|
839
|
-
const result = await this.post(
|
|
907
|
+
const result = await this.post(
|
|
908
|
+
"/audit/events",
|
|
909
|
+
{ events: [prepared] },
|
|
910
|
+
idempotencyHeader(options?.idempotencyKey)
|
|
911
|
+
);
|
|
840
912
|
this.warnOnPartialIngest(1, result?.ingested ?? 0);
|
|
841
913
|
return result;
|
|
842
914
|
}
|
|
@@ -852,7 +924,11 @@ var VorimSDK = class _VorimSDK {
|
|
|
852
924
|
*/
|
|
853
925
|
async emitBatch(events, options) {
|
|
854
926
|
const prepared = await Promise.all(events.map((e) => this.prepareEvent(e, options?.sign)));
|
|
855
|
-
const result = await this.post(
|
|
927
|
+
const result = await this.post(
|
|
928
|
+
"/audit/events",
|
|
929
|
+
{ events: prepared },
|
|
930
|
+
idempotencyHeader(options?.idempotencyKey)
|
|
931
|
+
);
|
|
856
932
|
this.warnOnPartialIngest(events.length, result?.ingested ?? 0);
|
|
857
933
|
return result;
|
|
858
934
|
}
|
|
@@ -889,7 +965,61 @@ var VorimSDK = class _VorimSDK {
|
|
|
889
965
|
* - Chain ops are serialised per-agent via `chainLocks` so
|
|
890
966
|
* concurrent emits to the same agent build a deterministic chain.
|
|
891
967
|
*/
|
|
968
|
+
/**
|
|
969
|
+
* Fail closed when `noPayload` is on and an event would carry content.
|
|
970
|
+
*
|
|
971
|
+
* Runs before signing and before any network call, so a rejected event is
|
|
972
|
+
* one Vorim never saw. Throwing rather than stripping is deliberate: a
|
|
973
|
+
* silent strip would leave the caller believing they had logged something
|
|
974
|
+
* they had not, and would change the bytes after they were signed.
|
|
975
|
+
*/
|
|
976
|
+
assertNoPayload(event) {
|
|
977
|
+
if (!this.noPayload) return;
|
|
978
|
+
for (const field of ["input_hash", "output_hash", "system_prompt_hash", "tool_catalogue_hash"]) {
|
|
979
|
+
const value = event[field];
|
|
980
|
+
if (value === void 0 || value === null) continue;
|
|
981
|
+
if (!isDigest(value)) {
|
|
982
|
+
throw new VorimError(
|
|
983
|
+
0,
|
|
984
|
+
"PAYLOAD_BLOCKED",
|
|
985
|
+
`noPayload: ${field} must be a sha256: or hmac-sha256: digest, got ${typeof value === "string" ? `${value.length} chars` : typeof value}. Hash it locally first \u2014 commitPayload() for anything a human or a model wrote, hashPayload() only for content that is already high-entropy.`,
|
|
986
|
+
{ field }
|
|
987
|
+
);
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
const metadata = event.metadata;
|
|
991
|
+
if (metadata === void 0 || metadata === null) return;
|
|
992
|
+
for (const [key, value] of Object.entries(metadata)) {
|
|
993
|
+
if (value === null) continue;
|
|
994
|
+
const t = typeof value;
|
|
995
|
+
if (t === "object") {
|
|
996
|
+
throw new VorimError(
|
|
997
|
+
0,
|
|
998
|
+
"PAYLOAD_BLOCKED",
|
|
999
|
+
`noPayload: metadata.${key} is ${Array.isArray(value) ? "an array" : "an object"}. Nested values can carry arbitrary content, so only string, number, boolean and null are allowed. Summarise it, or commit to it with commitPayload() and send the digest.`,
|
|
1000
|
+
{ field: `metadata.${key}` }
|
|
1001
|
+
);
|
|
1002
|
+
}
|
|
1003
|
+
if (t !== "string" && t !== "number" && t !== "boolean") {
|
|
1004
|
+
throw new VorimError(
|
|
1005
|
+
0,
|
|
1006
|
+
"PAYLOAD_BLOCKED",
|
|
1007
|
+
`noPayload: metadata.${key} is ${t}, which is not a permitted metadata type.`,
|
|
1008
|
+
{ field: `metadata.${key}` }
|
|
1009
|
+
);
|
|
1010
|
+
}
|
|
1011
|
+
if (t === "string" && value.length > this.maxMetadataChars) {
|
|
1012
|
+
throw new VorimError(
|
|
1013
|
+
0,
|
|
1014
|
+
"PAYLOAD_BLOCKED",
|
|
1015
|
+
`noPayload: metadata.${key} is ${value.length} chars, over the ${this.maxMetadataChars} limit. A value this long is content, not a label. Raise the limit with noPayload: { maxMetadataChars } if this really is a label.`,
|
|
1016
|
+
{ field: `metadata.${key}`, length: value.length }
|
|
1017
|
+
);
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
892
1021
|
async prepareEvent(event, signOverride) {
|
|
1022
|
+
this.assertNoPayload(event);
|
|
893
1023
|
const shouldSign = signOverride ?? this.autoSign;
|
|
894
1024
|
if (!shouldSign && !this.chainEvents) return event;
|
|
895
1025
|
if (this.chainEvents) {
|
|
@@ -1094,8 +1224,8 @@ var VorimSDK = class _VorimSDK {
|
|
|
1094
1224
|
async get(path) {
|
|
1095
1225
|
return this.request("GET", path);
|
|
1096
1226
|
}
|
|
1097
|
-
async post(path, body) {
|
|
1098
|
-
return this.request("POST", path, body);
|
|
1227
|
+
async post(path, body, headers) {
|
|
1228
|
+
return this.request("POST", path, body, true, headers);
|
|
1099
1229
|
}
|
|
1100
1230
|
async patch(path, body) {
|
|
1101
1231
|
return this.request("PATCH", path, body);
|
|
@@ -1111,7 +1241,7 @@ var VorimSDK = class _VorimSDK {
|
|
|
1111
1241
|
async requestEnvelope(method, path, body) {
|
|
1112
1242
|
return this.request(method, path, body, false);
|
|
1113
1243
|
}
|
|
1114
|
-
async request(method, path, body, unwrap = true) {
|
|
1244
|
+
async request(method, path, body, unwrap = true, extraHeaders) {
|
|
1115
1245
|
const controller = new AbortController();
|
|
1116
1246
|
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
1117
1247
|
try {
|
|
@@ -1120,7 +1250,8 @@ var VorimSDK = class _VorimSDK {
|
|
|
1120
1250
|
headers: {
|
|
1121
1251
|
"Authorization": `Bearer ${this.apiKey}`,
|
|
1122
1252
|
"Content-Type": "application/json",
|
|
1123
|
-
"User-Agent": USER_AGENT
|
|
1253
|
+
"User-Agent": USER_AGENT,
|
|
1254
|
+
...extraHeaders
|
|
1124
1255
|
},
|
|
1125
1256
|
body: body ? JSON.stringify(body) : void 0,
|
|
1126
1257
|
signal: controller.signal
|
|
@@ -1249,16 +1380,23 @@ async function deviceLogin(opts) {
|
|
|
1249
1380
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1250
1381
|
0 && (module.exports = {
|
|
1251
1382
|
CANONICAL_TOOL_CATALOGUE_VERSION,
|
|
1383
|
+
HMAC_SHA256_PREFIX,
|
|
1384
|
+
SHA256_PREFIX,
|
|
1252
1385
|
VorimDeniedError,
|
|
1253
1386
|
VorimError,
|
|
1254
1387
|
VorimSDK,
|
|
1255
1388
|
canonicalPayloadV0,
|
|
1256
1389
|
canonicalPayloadV1,
|
|
1390
|
+
commitPayload,
|
|
1257
1391
|
deviceLogin,
|
|
1392
|
+
eventDigest,
|
|
1393
|
+
hashPayload,
|
|
1258
1394
|
hashPreviousEvent,
|
|
1259
1395
|
hashSystemPrompt,
|
|
1260
1396
|
hashTool,
|
|
1261
1397
|
hashToolCatalogue,
|
|
1398
|
+
isDigest,
|
|
1399
|
+
isKeyedCommitment,
|
|
1262
1400
|
jcsCanonicalise,
|
|
1263
1401
|
prepareReplayContext
|
|
1264
1402
|
});
|