anyclaude-sdk 0.4.4 → 0.4.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.
Files changed (2) hide show
  1. package/README.md +10 -1
  2. package/package.json +60 -17
package/README.md CHANGED
@@ -317,10 +317,19 @@ Pluggable `SessionStore` adapters (all implement `SessionStoreLike`): `SessionSt
317
317
  Declare tools the **host** executes — e.g. run `bash` in the user's browser WebContainer while the agent loop runs on your server. The run pauses with a `client_tool_request`; the client executes it and you resume with the result:
318
318
 
319
319
  ```ts
320
- query({ prompt, llm, workspace, sessionId, clientTools: ['bash'] }) // → emits client_tool_request + pauses
320
+ import { WORKSPACE_TOOL_NAMES } from 'anyclaude-sdk'
321
+ query({ prompt, llm, workspace, sessionId, clientTools: WORKSPACE_TOOL_NAMES }) // → emits client_tool_request + pauses
321
322
  query({ llm, workspace, sessionId, resume: true, continueRun: true, clientToolResults }) // → continues
322
323
  ```
323
324
 
325
+ On the browser side, `anyclaude-react` turns those into a ready executor map backed by **any** workspace — a WebContainer (real shell + files), the user's **IndexedDB** (`DexieFileSystem`), OPFS, or memory:
326
+
327
+ ```tsx
328
+ import { createWebContainerClientTools, createWorkspaceClientTools } from 'anyclaude-react'
329
+ useAgent({ endpoint: '/api/agent', clientTools: createWebContainerClientTools(wc) }) // files + bash
330
+ useAgent({ endpoint: '/api/agent', clientTools: createWorkspaceClientTools(new DexieFileSystem('my-db')) }) // IndexedDB
331
+ ```
332
+
324
333
  ## Interactive — `ask_user_question`
325
334
 
326
335
  Provide `onAskUser` and the agent gains an `ask_user_question` tool to put a multiple-choice decision to the user:
package/package.json CHANGED
@@ -1,22 +1,53 @@
1
1
  {
2
2
  "name": "anyclaude-sdk",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "Standalone, browser-compatible SDK providing Claude Code agent capabilities (tools, tool loop, multi-turn, MCP, sub-agents, sessions) against any OpenAI/Anthropic-compatible LLM endpoint. Runs in the browser (WebContainer), Node, and Bun — no backend required.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
8
8
  "types": "./dist/index.d.ts",
9
9
  "exports": {
10
- ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" },
11
- "./query": { "types": "./dist/query.d.ts", "import": "./dist/query.js" },
12
- "./workspace": { "types": "./dist/workspace/index.d.ts", "import": "./dist/workspace/index.js" },
13
- "./sandbox": { "types": "./dist/sandbox/index.d.ts", "import": "./dist/sandbox/index.js" },
14
- "./fs": { "types": "./dist/fs/index.d.ts", "import": "./dist/fs/index.js" },
15
- "./llm": { "types": "./dist/llm/index.d.ts", "import": "./dist/llm/index.js" },
16
- "./tools": { "types": "./dist/tools/index.d.ts", "import": "./dist/tools/index.js" },
17
- "./session": { "types": "./dist/session/index.d.ts", "import": "./dist/session/index.js" },
18
- "./memory": { "types": "./dist/memory/index.d.ts", "import": "./dist/memory/index.js" },
19
- "./package.json": "./package.json"
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ },
14
+ "./query": {
15
+ "types": "./dist/query.d.ts",
16
+ "import": "./dist/query.js"
17
+ },
18
+ "./workspace": {
19
+ "types": "./dist/workspace/index.d.ts",
20
+ "import": "./dist/workspace/index.js"
21
+ },
22
+ "./sandbox": {
23
+ "types": "./dist/sandbox/index.d.ts",
24
+ "import": "./dist/sandbox/index.js"
25
+ },
26
+ "./fs": {
27
+ "types": "./dist/fs/index.d.ts",
28
+ "import": "./dist/fs/index.js"
29
+ },
30
+ "./llm": {
31
+ "types": "./dist/llm/index.d.ts",
32
+ "import": "./dist/llm/index.js"
33
+ },
34
+ "./tools": {
35
+ "types": "./dist/tools/index.d.ts",
36
+ "import": "./dist/tools/index.js"
37
+ },
38
+ "./session": {
39
+ "types": "./dist/session/index.d.ts",
40
+ "import": "./dist/session/index.js"
41
+ },
42
+ "./memory": {
43
+ "types": "./dist/memory/index.d.ts",
44
+ "import": "./dist/memory/index.js"
45
+ },
46
+ "./package.json": "./package.json",
47
+ "./compact": {
48
+ "types": "./dist/compact.d.ts",
49
+ "import": "./dist/compact.js"
50
+ }
20
51
  },
21
52
  "sideEffects": false,
22
53
  "files": [
@@ -64,12 +95,24 @@
64
95
  "e2b": "*"
65
96
  },
66
97
  "peerDependenciesMeta": {
67
- "@webcontainer/api": { "optional": true },
68
- "dexie": { "optional": true },
69
- "e2b": { "optional": true },
70
- "@vercel/sandbox": { "optional": true },
71
- "@daytonaio/sdk": { "optional": true },
72
- "@cloudflare/sandbox": { "optional": true }
98
+ "@webcontainer/api": {
99
+ "optional": true
100
+ },
101
+ "dexie": {
102
+ "optional": true
103
+ },
104
+ "e2b": {
105
+ "optional": true
106
+ },
107
+ "@vercel/sandbox": {
108
+ "optional": true
109
+ },
110
+ "@daytonaio/sdk": {
111
+ "optional": true
112
+ },
113
+ "@cloudflare/sandbox": {
114
+ "optional": true
115
+ }
73
116
  },
74
117
  "devDependencies": {
75
118
  "@types/node": "^26.0.0",