@seed-app-studio/sdk 0.1.1-canary.0
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 +68 -0
- package/dist/index.d.mts +2672 -0
- package/dist/index.mjs +4018 -0
- package/package.json +46 -0
package/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# @seed-app-studio/sdk
|
|
2
|
+
|
|
3
|
+
SEED App Client SDK — unified API for interacting with SEED Agent Runtime across all platforms.
|
|
4
|
+
|
|
5
|
+
## Transport Migration (JSON-RPC 2.0)
|
|
6
|
+
|
|
7
|
+
All transports have been migrated to **JSON-RPC 2.0** as the wire protocol.
|
|
8
|
+
|
|
9
|
+
### Available Transports
|
|
10
|
+
|
|
11
|
+
| Transport | Function | Platform | Wire Format |
|
|
12
|
+
| -------------------- | ------------------------------------- | ----------------------------------------- | --------------------------------------- |
|
|
13
|
+
| App Host window | `createWindowSeedAppTransport()` | App Studio iframe / browser host | SDK envelope over `postMessage` |
|
|
14
|
+
| Electron IPC | `createSeedAppElectronTransport()` | Desktop Electron | JSON-RPC 2.0 over IPC |
|
|
15
|
+
| Endpoint WebSocket | `createSeedAppEndpointTransport()` | Web SaaS endpoint / mobile remote runtime | JSON-RPC 2.0 over WebSocket |
|
|
16
|
+
| Raw WebSocket | `createSeedAppWebSocketTransport()` | Web SaaS low-level socket clients | JSON-RPC 2.0 over WebSocket |
|
|
17
|
+
| React Native WebView | `createSeedAppReactNativeTransport()` | Mobile embedded App Studio surface | JSON-RPC 2.0 over WebView `postMessage` |
|
|
18
|
+
|
|
19
|
+
### Usage
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import {
|
|
23
|
+
createSeedAppClient,
|
|
24
|
+
createSeedAppElectronTransport,
|
|
25
|
+
createSeedAppEndpointTransport,
|
|
26
|
+
createSeedAppReactNativeTransport,
|
|
27
|
+
} from "@seed-app-studio/sdk";
|
|
28
|
+
|
|
29
|
+
// Electron
|
|
30
|
+
const client = createSeedAppClient({
|
|
31
|
+
transport: createSeedAppElectronTransport(),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// Web endpoint (SaaS / Mobile remote runtime)
|
|
35
|
+
const client = createSeedAppClient({
|
|
36
|
+
transport: createSeedAppEndpointTransport({
|
|
37
|
+
endpoint: "wss://seed.example.com/v1/ws?token=session-token",
|
|
38
|
+
}),
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// React Native WebView
|
|
42
|
+
const client = createSeedAppClient({
|
|
43
|
+
transport: createSeedAppReactNativeTransport(),
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// All transports expose the same API
|
|
47
|
+
const agents = await client.agent.list();
|
|
48
|
+
const result = await client.agent.run({ input: "hello" });
|
|
49
|
+
const unsub = client.agent.subscribe((event) => console.log(event));
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Migration from SeedBridge\* Types
|
|
53
|
+
|
|
54
|
+
If your code references `SeedBridgeElectronIpcFrame` or `SeedBridgeRequest/Result/Event`:
|
|
55
|
+
|
|
56
|
+
1. Replace `createSeedBridgeElectronIpcRequestFrame()` → `createJsonRpcRequest()`
|
|
57
|
+
2. Replace `parseSeedBridgeElectronIpcFrame()` → `deserializeJsonRpcFrame()`
|
|
58
|
+
3. Replace `serializeSeedBridgeElectronIpcFrame()` → `serializeJsonRpcFrame()`
|
|
59
|
+
4. Replace `SeedBridgeEvent` handling → `seed.event` notification parsing
|
|
60
|
+
|
|
61
|
+
The `SeedAppClient` interface is unchanged — only the underlying transport serialization changed.
|
|
62
|
+
|
|
63
|
+
### Dual-Format Compatibility
|
|
64
|
+
|
|
65
|
+
During the migration period, all adapters accept both JSON-RPC and legacy SeedBridge frames on ingress.
|
|
66
|
+
New code MUST send JSON-RPC frames. Legacy frame support will be removed in a future release.
|
|
67
|
+
|
|
68
|
+
See: `openspec/changes/unify-jsonrpc-bridge/` for the full migration plan.
|