anyclaude-react 0.2.1 → 0.2.2

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 +27 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # anyclaude-react
2
2
 
3
- Restylable React UI kit for [`anyclaude-sdk`](https://www.npmjs.com/package/anyclaude-sdk) — hooks + components to build chatbots, AI agents, research assistants, and more. Includes built-in **serverless "survivor" stream-stitching** so long agent runs span function time-limits transparently.
3
+ Restylable React UI kit for [`anyclaude-sdk`](https://www.npmjs.com/package/anyclaude-sdk) — hooks + components to build chatbots, AI agents, research assistants, and **browser IDEs**. Includes built-in **serverless "survivor" stream-stitching** (long runs span function time-limits transparently) and **client-side tool execution** (the server-side agent runs `bash`/file tools in the user's browser). Markdown via [`streamdown`](https://www.npmjs.com/package/streamdown).
4
+
5
+ > **[Live demo](https://anyclaude-docs.puter.site/demo/)** — a full IDE built with this kit, running in your browser.
4
6
 
5
7
  ```bash
6
8
  npm install anyclaude-react anyclaude-sdk react
@@ -51,17 +53,40 @@ const { messages, streamingText, status, tokens, cost, send, interrupt, clear }
51
53
  - `status`: `'idle' | 'running' | 'paused'`
52
54
  - `send(text)` starts/continues; `interrupt()` aborts; `clear()` resets (new session).
53
55
 
56
+ ## Client-side tools (server brain, browser hands)
57
+
58
+ Run the agent on your server but execute chosen tools in the browser — e.g. `bash` on a WebContainer. Pair `query({ clientTools: ['bash'] })` server-side with a `clientTools` executor map here; `client_tool_request`s are auto-executed and the results streamed back:
59
+
60
+ ```tsx
61
+ useAgent({
62
+ endpoint: '/api/agent',
63
+ clientTools: { bash: async ({ command }) => ({ content: await runOnWebContainer(command) }) },
64
+ })
65
+ ```
66
+
54
67
  ## Components
55
68
 
69
+ **Chat**
70
+
56
71
  | Component | Purpose |
57
72
  |---|---|
58
73
  | `<AgentChat>` | All-in-one: Transcript + Working + Composer wired to `useAgent`. |
74
+ | `<ChatPanel>` | Like AgentChat with a header (status / tokens / cost). |
59
75
  | `<Transcript messages streamingText>` | Renders messages; pairs tool calls with results. |
60
- | `<Message>` / `<MarkdownMessage>` | Chat bubbles; safe built-in markdown (override via `render`). |
76
+ | `<Message>` / `<MarkdownMessage>` | Chat bubbles; markdown via `streamdown` (override via `render`). |
61
77
  | `<ToolCall>` | Collapsible tool call + result. |
62
78
  | `<Composer onSend>` | Textarea + send (Enter sends, Shift+Enter newline). |
63
79
  | `<Working active paused>` | Shimmering "Working…" indicator. |
64
80
 
81
+ **IDE** (optional peers: `@xterm/xterm`, `codemirror`)
82
+
83
+ | Component | Purpose |
84
+ |---|---|
85
+ | `<Terminal spawn>` | xterm.js bound to a streaming shell (e.g. a WebContainer process). |
86
+ | `<FileExplorer list onOpen>` | Collapsible file tree over any filesystem adapter. |
87
+ | `<CodeEditor value onChange>` | Controlled CodeMirror 6 editor. |
88
+ | `<AskUser question onAnswer>` | Renders an `ask_user_question` prompt; pair with the SDK's `onAskUser`. |
89
+
65
90
  ## Styling
66
91
 
67
92
  Everything is class-based (`.ac-*`) with `data-role` attributes. Import the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anyclaude-react",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "React UI kit for anyclaude-sdk — restylable hooks + components (useAgent, Transcript, Composer, AgentChat, Terminal, FileExplorer, CodeEditor, ChatPanel, AskUser) with built-in serverless 'survivor' stream-stitching. Build chatbots, agents, research assistants, browser IDEs.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",