@agentvault/agentvault 0.14.13 → 0.14.14

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
@@ -1,249 +1,117 @@
1
1
  # @agentvault/agentvault
2
2
 
3
- End-to-end encrypted communication channel for AI agents on the [AgentVault](https://agentvault.chat) platform. Connect your agent to its owner with XChaCha20-Poly1305 encryption and Double Ratchet forward secrecy.
3
+ The security infrastructure layer for AI agents cryptographic identity, earned trust, and Signal-grade encrypted communications natively integrated with OpenClaw.
4
4
 
5
- ## What's New in v0.5.0
5
+ Connect your agent to its owner with XChaCha20-Poly1305 encryption, Double Ratchet forward secrecy, and W3C Decentralized Identifiers (DIDs).
6
6
 
7
- **Desktop Notifications** Incoming messages now trigger native OS notifications (macOS Notification Center, Windows Toast, Linux notify-send) when using the CLI. Enabled by default — disable with `--no-notifications`.
7
+ ## What's New in v0.14.7 (Gen2)
8
8
 
9
- **Webhook URL CLI Flag** (v0.4.4) `--webhook-url` flag and `AGENTVAULT_WEBHOOK_URL` env var for programmatic webhook registration.
9
+ * **OpenClaw Native Plugin:** AgentVault now integrates directly into OpenClaw as a first-class channel (`agentvault`).
10
+ * **W3C Decentralized Identifiers (DIDs):** Agents are now addressed using cryptographic identities (`did:hub:<address>`).
11
+ * **Trust Scoring & Telemetry:** Native OpenTelemetry (OTel) auto-instrumentation to compute real-time trust scores.
12
+ * **Skill Permission Tokens (SPTs):** Support for explicit-deny authorization and cryptographic capability access grants.
10
13
 
11
- **Webhook Notifications** (v0.4.0) — HTTP webhook callbacks when a new message arrives, even when not connected via WebSocket.
14
+ ---
12
15
 
13
- ### Upgrading
16
+ ## Installation & Quick Start
14
17
 
15
- ```bash
16
- npm install @agentvault/agentvault@latest
17
- ```
18
+ ### 1. OpenClaw Channel Integration (Recommended)
18
19
 
19
- No code changes required fully backward-compatible.
20
+ To install AgentVault globally as an OpenClaw channel plugin:
20
21
 
21
- ---
22
+ ```bash
23
+ # Using pnpm (adjust path to your global installation)
24
+ PNPM_HOME=~/Library/pnpm /opt/homebrew/bin/pnpm add -g @agentvault/agentvault@latest
25
+ ```
22
26
 
23
- ## Installation
27
+ After installation, configure the channel with your invite token from the AgentVault dashboard:
24
28
 
25
29
  ```bash
26
- npm install @agentvault/agentvault
30
+ npx @agentvault/agentvault setup --token=YOUR_INVITE_TOKEN
27
31
  ```
28
32
 
29
- ## Quick Start
33
+ ⚠️ **CRITICAL WARNING FOR UPGRADES:**
34
+ > There is currently a known bug in `setup.js` where running `setup` on an already enrolled agent will wipe the existing account configuration. **Always back up your `agentvault.json` and `agentvault-data` directories before updating the plugin or re-running setup.**
30
35
 
31
- ### Option 1: CLI (Interactive)
36
+ ### 2. Standalone CLI Usage
32
37
 
33
- Run directly with npx using the invite token from your AgentVault dashboard:
38
+ If you are not using OpenClaw, you can run AgentVault as a standalone interactive CLI:
34
39
 
35
40
  ```bash
36
- npx @agentvault/agentvault --token=YOUR_INVITE_TOKEN
41
+ npx @agentvault/agentvault setup --token=YOUR_INVITE_TOKEN
42
+ npx @agentvault/agentvault
37
43
  ```
38
44
 
39
45
  The CLI will:
40
- 1. Enroll your agent with the server
41
- 2. Display a fingerprint for the owner to verify
46
+ 1. Generate an Ed25519 identity keypair
47
+ 2. Enroll your agent with the server (anchoring a `did:hub` identity)
42
48
  3. Wait for owner approval
43
- 4. Establish an encrypted channel
44
- 5. Enter interactive mode where you can send/receive messages
49
+ 4. Establish an end-to-end encrypted channel
45
50
 
46
- **CLI Flags:**
47
-
48
- | Flag | Default | Description |
49
- |------|---------|-------------|
50
- | `--token` | (required on first run) | Invite token from dashboard |
51
- | `--name` | `"CLI Agent"` | Agent display name |
52
- | `--data-dir` | `./agentvault-data` | Directory for persistent state |
53
- | `--api-url` | `https://api.agentvault.chat` | API endpoint |
54
- | `--webhook-url` | (none) | URL for HTTP webhook notifications |
55
- | `--no-notifications` | (notifications on) | Disable OS desktop notifications |
51
+ ---
56
52
 
57
- Environment variables (`AGENTVAULT_INVITE_TOKEN`, `AGENTVAULT_AGENT_NAME`, `AGENTVAULT_DATA_DIR`, `AGENTVAULT_API_URL`, `AGENTVAULT_WEBHOOK_URL`, `AGENTVAULT_NO_NOTIFICATIONS`) work as alternatives to flags.
53
+ ## Programmatic SDK Integration
58
54
 
59
- ### Option 2: SDK (Programmatic)
55
+ You can easily integrate AgentVault directly into custom Node.js/TypeScript agent architectures.
60
56
 
61
- ```js
57
+ ```ts
62
58
  import { SecureChannel } from "@agentvault/agentvault";
63
59
 
64
60
  const channel = new SecureChannel({
65
- inviteToken: "YOUR_INVITE_TOKEN",
61
+ inviteToken: process.env.AGENTVAULT_INVITE_TOKEN,
66
62
  dataDir: "./agentvault-data",
67
63
  apiUrl: "https://api.agentvault.chat",
68
- agentName: "My Agent",
64
+ agentName: "My Custom Agent",
69
65
  });
70
66
 
71
67
  channel.on("message", (text, metadata) => {
72
- console.log(`Received: ${text}`);
73
- // Echo back
74
- channel.send(`You said: ${text}`);
68
+ console.log(`[AgentVault] Received: ${text}`);
69
+ // Execute agent logic, then send response:
70
+ channel.send(`Task complete. Result: ${text}`);
75
71
  });
76
72
 
77
73
  channel.on("ready", () => {
78
- console.log("Secure channel established!");
74
+ console.log(`Secure channel established! Routing address: did:hub:${channel.deviceId}`);
79
75
  });
80
76
 
81
77
  await channel.start();
82
78
  ```
83
79
 
84
- ---
85
-
86
- ## Webhook Notifications (v0.4.0+)
87
-
88
- Enable webhook notifications so your agent gets an HTTP POST when a new message arrives — useful for agents that aren't always connected via WebSocket.
80
+ ### Advanced: Telemetry & OTel
81
+ To enable behavioral trust scoring, configure the telemetry exporter:
89
82
 
90
- ### Setup
91
-
92
- Add `webhookUrl` to your config:
93
-
94
- ```js
95
- const channel = new SecureChannel({
96
- inviteToken: "YOUR_INVITE_TOKEN",
97
- dataDir: "./agentvault-data",
98
- apiUrl: "https://api.agentvault.chat",
99
- webhookUrl: "https://your-server.com/webhook/agentvault",
100
- });
101
- ```
102
-
103
- The webhook URL is registered automatically during device activation. The channel emits a `webhook_registered` event on success:
104
-
105
- ```js
106
- channel.on("webhook_registered", ({ url, secret }) => {
107
- console.log(`Webhook registered at ${url}`);
108
- // Save the secret to verify incoming webhooks
83
+ ```ts
84
+ // Telemetry is automatically routed through the established E2E channel
85
+ channel.enableTelemetry({
86
+ serviceName: "my-custom-agent",
87
+ exportIntervalMs: 5000
109
88
  });
110
89
  ```
111
90
 
112
- ### Webhook Payload
113
-
114
- When the owner sends a message, your webhook endpoint receives:
115
-
116
- ```http
117
- POST /webhook/agentvault HTTP/1.1
118
- Content-Type: application/json
119
- X-AgentVault-Event: new_message
120
- X-AgentVault-Signature: sha256=<hmac-hex>
121
-
122
- {
123
- "event": "new_message",
124
- "conversation_id": "uuid",
125
- "sender_device_id": "uuid",
126
- "message_id": "uuid",
127
- "timestamp": "2026-02-17T12:00:00Z"
128
- }
129
- ```
130
-
131
- ### Verifying Webhook Signatures
132
-
133
- Each webhook includes an HMAC-SHA256 signature in the `X-AgentVault-Signature` header. Verify it using the secret from the `webhook_registered` event:
134
-
135
- ```js
136
- import crypto from "crypto";
137
-
138
- function verifyWebhook(body, signature, secret) {
139
- const expected = "sha256=" +
140
- crypto.createHmac("sha256", secret).update(body).digest("hex");
141
- return crypto.timingSafeEqual(
142
- Buffer.from(signature),
143
- Buffer.from(expected),
144
- );
145
- }
146
- ```
147
-
148
91
  ---
149
92
 
150
- ## Configuration Reference
151
-
152
- ```ts
153
- interface SecureChannelConfig {
154
- // Required
155
- inviteToken: string; // Invite token from the AgentVault dashboard
156
- dataDir: string; // Directory for persistent state files
157
- apiUrl: string; // API endpoint (e.g., "https://api.agentvault.chat")
158
-
159
- // Optional
160
- agentName?: string; // Display name (default: "CLI Agent")
161
- platform?: string; // Platform identifier (e.g., "node")
162
- maxHistorySize?: number; // Max stored messages for cross-device replay (default: 500)
163
- webhookUrl?: string; // Webhook URL for new message notifications (v0.4.0+)
164
-
165
- // Callbacks (alternative to event listeners)
166
- onMessage?: (text: string, metadata: MessageMetadata) => void;
167
- onStateChange?: (state: ChannelState) => void;
168
- }
169
- ```
170
-
171
- ## Events
172
-
173
- | Event | Payload | Description |
174
- |-------|---------|-------------|
175
- | `message` | `(text: string, metadata: MessageMetadata)` | Owner sent a message |
176
- | `ready` | none | WebSocket connected, channel operational |
177
- | `state` | `(state: ChannelState)` | State transition occurred |
178
- | `error` | `(error: Error)` | Fatal error |
179
- | `webhook_registered` | `({ url: string, secret: string })` | Webhook registered (v0.4.0+) |
180
-
181
- ## Channel States
182
-
183
- `idle` → `enrolling` → `polling` → `activating` → `connecting` → `ready`
184
-
185
- If disconnected: `ready` → `disconnected` → `connecting` → `ready` (auto-reconnect)
186
-
187
- ## API
188
-
189
- | Method | Description |
190
- |--------|-------------|
191
- | `start()` | Initialize, enroll, and connect |
192
- | `send(text)` | Encrypt and send message to all owner devices |
193
- | `stop()` | Gracefully disconnect |
194
-
195
- | Property | Description |
196
- |----------|-------------|
197
- | `state` | Current channel state |
198
- | `deviceId` | Agent's device ID (after enrollment) |
199
- | `fingerprint` | Device fingerprint for verification |
200
- | `conversationId` | Primary conversation ID |
201
- | `conversationIds` | All active conversation IDs (multi-device) |
202
- | `sessionCount` | Number of active encrypted sessions |
93
+ ## Security Architecture
203
94
 
204
- ## Multi-Device Support
95
+ AgentVault is a **zero-knowledge** platform. The server only routes ciphertext and NEVER sees your data in plaintext.
205
96
 
206
- AgentVault supports multiple owner devices (e.g., desktop + mobile). The channel automatically:
207
- - Maintains independent encrypted sessions per owner device
208
- - Fans out `send()` to all active sessions
209
- - Stores message history for cross-device replay (up to `maxHistorySize`)
210
- - Replays history when a new device connects
97
+ * **Identity:** Ed25519 dual-key model (Owner Key + Operational Key) linked to a `did:hub` identifier.
98
+ * **Encryption:** XChaCha20-Poly1305 symmetric encryption with 192-bit nonces (eliminating nonce reuse risk).
99
+ * **Forward Secrecy:** Double Ratchet protocol and X3DH key agreement. Old keys are mathematically destroyed.
100
+ * **Audit Trails:** All operations are chained using BLAKE2b hashes and W3C TraceContext traceparents.
211
101
 
212
- No additional configuration needed — multi-device is handled transparently.
102
+ ## Webhook Notifications
213
103
 
214
- ## Running as a Service
104
+ Enable HTTP POST webhooks when a new message arrives for offline-capable agents:
215
105
 
216
- The agent process must stay running to receive messages and desktop notifications. Use [pm2](https://pm2.keymetrics.io/) to keep it alive:
217
-
218
- ```bash
219
- # Install pm2 globally
220
- npm install -g pm2
221
-
222
- # Start your agent as a background service
223
- pm2 start npx --name "my-agent" -- @agentvault/agentvault \
224
- --token=YOUR_TOKEN --name="My Agent"
225
-
226
- # View logs
227
- pm2 logs my-agent
228
-
229
- # Auto-restart on crash
230
- pm2 save
231
-
232
- # Stop the agent
233
- pm2 stop my-agent
106
+ ```ts
107
+ const channel = new SecureChannel({
108
+ // ...
109
+ webhookUrl: "https://your-server.com/webhook/agentvault",
110
+ });
234
111
  ```
112
+ *Verify incoming webhooks using the HMAC-SHA256 signature provided in the `X-AgentVault-Signature` header.*
235
113
 
236
- pm2 keeps the process running if the terminal closes and auto-restarts on crashes. Desktop notifications continue to work as long as pm2 was started from your desktop session.
237
-
238
- For headless servers (no desktop), use `--no-notifications` and configure `--webhook-url` instead.
239
-
240
- ## Security
241
-
242
- - **XChaCha20-Poly1305** symmetric encryption (192-bit nonces)
243
- - **X3DH** key agreement (Ed25519 + X25519)
244
- - **Double Ratchet** for forward secrecy — old keys deleted after use
245
- - **Zero-knowledge server** — the server never sees plaintext
246
- - **HMAC-SHA256** webhook signatures for authenticity verification
114
+ ---
247
115
 
248
116
  ## License
249
117
 
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=install-plugin.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-plugin.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/install-plugin.test.ts"],"names":[],"mappings":""}