@irisrun/client-sdk 0.1.0 → 0.2.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 +32 -0
- package/package.json +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# @irisrun/client-sdk
|
|
2
|
+
|
|
3
|
+
**A portable client for durable, resumable sessions.** A thin, isomorphic
|
|
4
|
+
(browser + Node ≥ 24) client over the `iris serve` protocol that holds only a
|
|
5
|
+
`{ sessionId, continuationToken }` handle — *not* a live connection — so a reload
|
|
6
|
+
or a brand-new process can rebuild the client from the saved handle and resume the
|
|
7
|
+
**same** session.
|
|
8
|
+
|
|
9
|
+
## What it is
|
|
10
|
+
|
|
11
|
+
`IrisClient` mirrors the channel's two-identifier discipline exactly: it adopts
|
|
12
|
+
the rotated `continuationToken` the server returns and presents it on the next
|
|
13
|
+
turn. Sends are buffered or streamed over **SSE** via callbacks. Zero runtime
|
|
14
|
+
dependencies — only global `fetch` / `TextDecoder` / `ReadableStream` — and it
|
|
15
|
+
defines its own local `StreamEvent` wire union (it does *not* import
|
|
16
|
+
`@irisrun/channel-rest`, which would pull in `node:http`). The WebSocket transport
|
|
17
|
+
is **reserved** (held-connection model) and throws loudly until implemented — SSE
|
|
18
|
+
and buffered today.
|
|
19
|
+
|
|
20
|
+
## Use it
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { IrisClient } from "@irisrun/client-sdk";
|
|
24
|
+
|
|
25
|
+
const client = new IrisClient({ baseUrl }); // start a fresh session
|
|
26
|
+
const resumed = new IrisClient({ baseUrl, handle }); // resume from a SessionHandle
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
See **[docs/Channels](../../docs/channels.md)**.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
Part of [Iris](../../README.md) — own, portable, verifiable state.
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@irisrun/client-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "Portable client for durable, resumable sessions — a thin, isomorphic (browser + Node 24) client over the `iris serve` two-identifier protocol; holds only a {sessionId, continuationToken} handle, so a reload or a fresh process resumes the same session. Buffered + streaming over SSE. Zero runtime deps (global fetch / TextDecoder / ReadableStream); defines its OWN local StreamEvent wire union (no @irisrun/channel-rest import — that pulls node:http). The WS transport is reserved (held-connection model; throws loudly until implemented).",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
8
|
"iris-src": "./src/index.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@irisrun/core": "^0.
|
|
14
|
+
"@irisrun/core": "^0.2.0"
|
|
15
15
|
},
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"engines": {
|