@dudko.dev/agent-web 0.0.7 → 0.0.9

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.
@@ -0,0 +1,35 @@
1
+ interface VaultOptions {
2
+ /** Database name, forwarded to the shared IDB owner (default 'agent-web'). */
3
+ dbName?: string;
4
+ }
5
+ /**
6
+ * Encrypted key/value secret store backed by IndexedDB. Values are encrypted at
7
+ * rest with the non-extractable AES-GCM vault key (see crypto.ts).
8
+ *
9
+ * ── THREAT MODEL (read before shipping any app-owned key to a browser) ──
10
+ * This vault PROTECTS secrets **at rest** — an IndexedDB / disk dump yields
11
+ * only ciphertext — and against **casual DevTools inspection** — no plaintext
12
+ * key is stored, and the AES key cannot be exported even by in-page script.
13
+ *
14
+ * It does **NOT** defend against **active XSS on your origin**: any script that
15
+ * already runs on the page can call `getSecret()`, or use the live `CryptoKey`
16
+ * to decrypt. Browser storage is not a secrets manager.
17
+ *
18
+ * Therefore this vault is for the **end user's OWN key on their OWN device**
19
+ * (bring-your-own-key). A shared, app-owned key must NEVER reach the client —
20
+ * put it behind a server proxy (`ProviderModelSpec.baseURL`) or the Vercel AI
21
+ * Gateway instead.
22
+ */
23
+ declare class IndexedDBVault {
24
+ private readonly dbName?;
25
+ constructor(opts?: VaultOptions);
26
+ private key;
27
+ /** Encrypt and store a secret string under `id`. */
28
+ setSecret(id: string, value: string): Promise<void>;
29
+ /** Fetch and decrypt a secret, or undefined if absent. */
30
+ getSecret(id: string): Promise<string | undefined>;
31
+ deleteSecret(id: string): Promise<void>;
32
+ listSecretIds(): Promise<string[]>;
33
+ }
34
+
35
+ export { IndexedDBVault as I, type VaultOptions as V };
@@ -0,0 +1,35 @@
1
+ interface VaultOptions {
2
+ /** Database name, forwarded to the shared IDB owner (default 'agent-web'). */
3
+ dbName?: string;
4
+ }
5
+ /**
6
+ * Encrypted key/value secret store backed by IndexedDB. Values are encrypted at
7
+ * rest with the non-extractable AES-GCM vault key (see crypto.ts).
8
+ *
9
+ * ── THREAT MODEL (read before shipping any app-owned key to a browser) ──
10
+ * This vault PROTECTS secrets **at rest** — an IndexedDB / disk dump yields
11
+ * only ciphertext — and against **casual DevTools inspection** — no plaintext
12
+ * key is stored, and the AES key cannot be exported even by in-page script.
13
+ *
14
+ * It does **NOT** defend against **active XSS on your origin**: any script that
15
+ * already runs on the page can call `getSecret()`, or use the live `CryptoKey`
16
+ * to decrypt. Browser storage is not a secrets manager.
17
+ *
18
+ * Therefore this vault is for the **end user's OWN key on their OWN device**
19
+ * (bring-your-own-key). A shared, app-owned key must NEVER reach the client —
20
+ * put it behind a server proxy (`ProviderModelSpec.baseURL`) or the Vercel AI
21
+ * Gateway instead.
22
+ */
23
+ declare class IndexedDBVault {
24
+ private readonly dbName?;
25
+ constructor(opts?: VaultOptions);
26
+ private key;
27
+ /** Encrypt and store a secret string under `id`. */
28
+ setSecret(id: string, value: string): Promise<void>;
29
+ /** Fetch and decrypt a secret, or undefined if absent. */
30
+ getSecret(id: string): Promise<string | undefined>;
31
+ deleteSecret(id: string): Promise<void>;
32
+ listSecretIds(): Promise<string[]>;
33
+ }
34
+
35
+ export { IndexedDBVault as I, type VaultOptions as V };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dudko.dev/agent-web",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "Headless, configurable in-browser LLM agent on the Vercel AI SDK: multi-provider bring-your-own-key (OpenAI, Anthropic, Google, xAI, DeepSeek, gateway, openai-compatible) AND local WebGPU/WebLLM, native + prompted tool-calling, structured output, an encrypted IndexedDB token vault, and a plan → execute → replan → synthesize loop. UI-agnostic.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -125,7 +125,7 @@
125
125
  "node": ">=18"
126
126
  },
127
127
  "dependencies": {
128
- "ai": "^6.0.218",
128
+ "ai": "^7.0.66",
129
129
  "idb": "^8.0.0",
130
130
  "zod": "^4.4.3"
131
131
  },
@@ -139,7 +139,7 @@
139
139
  "@browser-ai/core": "^2.0.0",
140
140
  "@browser-ai/web-llm": "^2.0.0",
141
141
  "@mlc-ai/web-llm": ">=0.2.70",
142
- "@modelcontextprotocol/sdk": "^1.0.0"
142
+ "@modelcontextprotocol/sdk": "^1.30.0"
143
143
  },
144
144
  "peerDependenciesMeta": {
145
145
  "@ai-sdk/openai": {
@@ -174,19 +174,19 @@
174
174
  }
175
175
  },
176
176
  "devDependencies": {
177
- "@ai-sdk/anthropic": "^3.0.92",
178
- "@ai-sdk/deepseek": "^2.0.44",
179
- "@ai-sdk/google": "^3.0.88",
180
- "@ai-sdk/openai": "^3.0.80",
181
- "@ai-sdk/openai-compatible": "^2.0.56",
182
- "@ai-sdk/xai": "^3.0.102",
183
- "@browser-ai/core": "^2.1.12",
184
- "@browser-ai/web-llm": "^2.1.7",
177
+ "@ai-sdk/anthropic": "^4.0.39",
178
+ "@ai-sdk/deepseek": "^3.0.28",
179
+ "@ai-sdk/google": "^4.0.44",
180
+ "@ai-sdk/openai": "^4.0.42",
181
+ "@ai-sdk/openai-compatible": "^3.0.30",
182
+ "@ai-sdk/xai": "^4.0.39",
183
+ "@browser-ai/core": "^3.0.0",
184
+ "@browser-ai/web-llm": "^3.0.0",
185
185
  "@mlc-ai/web-llm": "^0.2.84",
186
- "@modelcontextprotocol/sdk": "^1.29.0",
186
+ "@modelcontextprotocol/sdk": "^1.30.0",
187
187
  "@types/node": "^22.9.0",
188
188
  "fake-indexeddb": "^6.2.5",
189
- "prettier": "^3.3.3",
189
+ "prettier": "^3.9.6",
190
190
  "tsup": "^8.5.1",
191
191
  "typescript": "^5.6.0"
192
192
  }