@sandagent/sdk 0.2.6 → 0.2.7

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 +42 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # @sandagent/sdk
2
+
3
+ Run Claude in a sandbox. Stream from your API, chat from React.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @sandagent/sdk ai
9
+ npm install react react-dom
10
+ ```
11
+
12
+ ## Quick start
13
+
14
+ ```typescript
15
+ import { createSandAgent, LocalSandbox } from "@sandagent/sdk";
16
+ import { createUIMessageStream, createUIMessageStreamResponse, streamText } from "ai";
17
+
18
+ const sandbox = new LocalSandbox({ workdir: process.cwd() });
19
+ const sandagent = createSandAgent({ sandbox, cwd: sandbox.getWorkdir() });
20
+
21
+ const stream = createUIMessageStream({
22
+ execute: async ({ writer }) => {
23
+ const result = streamText({
24
+ model: sandagent("sonnet"),
25
+ messages,
26
+ abortSignal: request.signal,
27
+ });
28
+ writer.merge(result.toUIMessageStream());
29
+ },
30
+ });
31
+ return createUIMessageStreamResponse({ stream });
32
+ ```
33
+
34
+ ```tsx
35
+ import { useSandAgentChat } from "@sandagent/sdk/react";
36
+
37
+ const { messages, sendMessage } = useSandAgentChat({ apiEndpoint: "/api/ai" });
38
+ ```
39
+
40
+ ## License
41
+
42
+ Apache-2.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sandagent/sdk",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "SandAgent SDK - AI Provider and React hooks for building AI agents",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -49,7 +49,7 @@
49
49
  "dependencies": {
50
50
  "@ai-sdk/provider": "^3.0.5",
51
51
  "@ai-sdk/react": "^3.0.52",
52
- "@sandagent/manager": "0.2.6"
52
+ "@sandagent/manager": "0.2.7"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@types/node": "^20.10.0",