@vorim/sdk 3.22.0 → 3.22.1
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 +7 -0
- package/README.md +12 -6
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog — @vorim/sdk
|
|
2
2
|
|
|
3
|
+
## 3.22.1
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- `emit()` and `emitBatch()` return types now include the `events` array the API already returns (`{ ingested, events?: { event_id, digest? }[], rejected_invalid_signature?, replayed? }`), so `const { events } = await vorim.emit(...)` type-checks.
|
|
8
|
+
- README: quick start states the key scopes it needs (agents:read, agents:write, permissions:read, audit:read, audit:write), how to run it as an ES module, that public `verify()` returns no `active_scopes`, and that `register()` needs at least one scope.
|
|
9
|
+
|
|
3
10
|
## 3.20.0
|
|
4
11
|
|
|
5
12
|
### Added
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ Register agents with cryptographic Ed25519 identities, enforce scoped permission
|
|
|
10
10
|
[](https://nodejs.org/)
|
|
11
11
|
[]()
|
|
12
12
|
|
|
13
|
-
> **
|
|
13
|
+
> **API key**: create one in the Vorim dashboard under Settings, API keys. No account yet? Request access at [vorim.ai](https://vorim.ai).
|
|
14
14
|
> **[Documentation](https://vorim.ai/docs)** — Full API reference, framework integrations, and examples.
|
|
15
15
|
> **[Quick Start](https://vorim.ai/quickstart)** — Set up in under 5 minutes.
|
|
16
16
|
|
|
@@ -48,6 +48,10 @@ pnpm add @vorim/sdk
|
|
|
48
48
|
|
|
49
49
|
## Quick Start
|
|
50
50
|
|
|
51
|
+
The key for this quick start needs the `agents:read`, `agents:write`, `permissions:read`, `audit:read` and `audit:write` scopes. Scopes are independent, so `agents:write` does not include `agents:read`.
|
|
52
|
+
|
|
53
|
+
The example uses top-level `await`, so run it as ES module code. Save it as a `.mjs` file, set `"type": "module"` in your `package.json`, or run the `.ts` file with `npx tsx`.
|
|
54
|
+
|
|
51
55
|
```typescript
|
|
52
56
|
import createVorim from "@vorim/sdk";
|
|
53
57
|
|
|
@@ -83,7 +87,9 @@ if (allowed) {
|
|
|
83
87
|
// 4. Verify any agent's trust (public endpoint, no auth required)
|
|
84
88
|
const trust = await vorim.verify(agent.agent_id);
|
|
85
89
|
console.log(trust.trust_score); // 0–100
|
|
86
|
-
|
|
90
|
+
// The public endpoint does not reveal scopes (active_scopes is always []).
|
|
91
|
+
// As the agent's owner, list them with your API key:
|
|
92
|
+
const permissions = await vorim.listPermissions(agent.agent_id);
|
|
87
93
|
```
|
|
88
94
|
|
|
89
95
|
---
|
|
@@ -334,8 +340,8 @@ trust.verified; // true
|
|
|
334
340
|
trust.trust_score; // 82
|
|
335
341
|
trust.status; // 'active'
|
|
336
342
|
trust.owner.org_name; // 'Acme Corp'
|
|
337
|
-
trust.active_scopes; // [
|
|
338
|
-
trust.key_fingerprint; // '
|
|
343
|
+
trust.active_scopes; // [] (not revealed publicly; owners use vorim.listPermissions(agentId))
|
|
344
|
+
trust.key_fingerprint; // '' (not revealed publicly)
|
|
339
345
|
trust.revocation_status; // false
|
|
340
346
|
```
|
|
341
347
|
|
|
@@ -351,7 +357,7 @@ trust.revocation_status; // false
|
|
|
351
357
|
From v3.1.0, the SDK signs every audit event at source with the agent's Ed25519 private key. No code change required — `register()` caches the key in memory and `emit()` adds the signature transparently.
|
|
352
358
|
|
|
353
359
|
```typescript
|
|
354
|
-
const { agent } = await vorim.register({ name: "agent", capabilities: [], scopes: [] });
|
|
360
|
+
const { agent } = await vorim.register({ name: "agent", capabilities: [], scopes: ["agent:execute"] });
|
|
355
361
|
|
|
356
362
|
// Auto-signed. The signature is attached before the request leaves the process.
|
|
357
363
|
await vorim.emit({
|
|
@@ -481,7 +487,7 @@ const { events } = await vorim.emit({ /* ... */ });
|
|
|
481
487
|
// events: [{ event_id: "evt_...", digest: "sha256:..." }]
|
|
482
488
|
|
|
483
489
|
import { eventDigest } from "@vorim/sdk";
|
|
484
|
-
await eventDigest(sentEvent) === events[0].digest; // true
|
|
490
|
+
await eventDigest(sentEvent) === events?.[0].digest; // true
|
|
485
491
|
```
|
|
486
492
|
|
|
487
493
|
Byte-identical in `@vorim/verify` and the Python SDK. A content digest, not an
|
package/dist/index.cjs
CHANGED
|
@@ -246,7 +246,7 @@ function isDigest(digest) {
|
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
// src/index.ts
|
|
249
|
-
var SDK_VERSION = true ? "3.22.
|
|
249
|
+
var SDK_VERSION = true ? "3.22.1" : "0.0.0";
|
|
250
250
|
var USER_AGENT = `vorim-sdk/${SDK_VERSION}`;
|
|
251
251
|
function sleep(ms) {
|
|
252
252
|
return new Promise((resolve) => setTimeout(resolve, ms));
|