@getorrery/client 0.2.3 → 0.3.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.
- package/README.md +39 -39
- package/dist/channel.d.ts +2 -7
- package/dist/node.js +1 -6
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
# `@getorrery/client`
|
|
2
|
-
|
|
3
|
-
The TypeScript half of the client SDK: `AguiSession` (decode, `seq`, re-attach `since`,
|
|
4
|
-
control RPC) and `SurfaceStore`. **Pure data, no drawing** — exactly the same two things
|
|
5
|
-
[`../../core/crates/orrery-client`](../../core/crates/orrery-client) gives Rust, built on
|
|
6
|
-
stock `@ag-ui/client`'s `HttpAgent` over SSE.
|
|
7
|
-
|
|
8
|
-
Types come from [`@getorrery/protocol`](../../protocol), which is generated by
|
|
9
|
-
`cargo xtask typegen` and must not be hand-edited.
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
pnpm -C harness/clients/sdk-ts test # vitest, over ../conformance
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
It passes the shared fixtures in [`../conformance`](../conformance) — the same files
|
|
16
|
-
`orrery-client` runs in Rust, asserted the same way. If the two ever disagree, one of the
|
|
17
|
-
five clients is drawing something the others are not.
|
|
18
|
-
|
|
19
|
-
## The session is stock `@ag-ui/client`
|
|
20
|
-
|
|
21
|
-
`AguiSession` wraps `HttpAgent` and hands it back unmodified through `httpAgent()`. That
|
|
22
|
-
*is* the "existing AG-UI clients work unmodified" proof: if this package had to patch the
|
|
23
|
-
agent, the claim would be false. What it adds is the half AG-UI has no vocabulary for —
|
|
24
|
-
`session.attach(since)`, `turn.cancel`, `intent`, `consent.answer`, `query` — over a small
|
|
25
|
-
`fetch` client against `POST /control`.
|
|
26
|
-
|
|
27
|
-
`run()` parses the SSE stream itself rather than going through the agent's subscriber API,
|
|
28
|
-
for one reason: our frames carry a `seq` the stock agent drops, and `seq` is the whole of
|
|
29
|
-
the resumption story.
|
|
30
|
-
|
|
31
|
-
## A client never writes state
|
|
32
|
-
|
|
33
|
-
AG-UI's shared state is bidirectional by design; ours is not. `StateSnapshot` and
|
|
34
|
-
`StateDelta` flow outward only, and an edit a person makes arrives back as an `intent` the
|
|
35
|
-
kernel validates. Anyone porting a component that expects to write state directly needs to
|
|
36
|
-
know that.
|
|
37
|
-
|
|
38
|
-
**Status.** Implemented and `private` until there is something to publish.
|
|
39
|
-
Implementation plan: [`harness/docs/plans/08-protocol-transport.md`](../../docs/plans/08-protocol-transport.md).
|
|
1
|
+
# `@getorrery/client`
|
|
2
|
+
|
|
3
|
+
The TypeScript half of the client SDK: `AguiSession` (decode, `seq`, re-attach `since`,
|
|
4
|
+
control RPC) and `SurfaceStore`. **Pure data, no drawing** — exactly the same two things
|
|
5
|
+
[`../../core/crates/orrery-client`](../../core/crates/orrery-client) gives Rust, built on
|
|
6
|
+
stock `@ag-ui/client`'s `HttpAgent` over SSE.
|
|
7
|
+
|
|
8
|
+
Types come from [`@getorrery/protocol`](../../protocol), which is generated by
|
|
9
|
+
`cargo xtask typegen` and must not be hand-edited.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm -C harness/clients/sdk-ts test # vitest, over ../conformance
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
It passes the shared fixtures in [`../conformance`](../conformance) — the same files
|
|
16
|
+
`orrery-client` runs in Rust, asserted the same way. If the two ever disagree, one of the
|
|
17
|
+
five clients is drawing something the others are not.
|
|
18
|
+
|
|
19
|
+
## The session is stock `@ag-ui/client`
|
|
20
|
+
|
|
21
|
+
`AguiSession` wraps `HttpAgent` and hands it back unmodified through `httpAgent()`. That
|
|
22
|
+
*is* the "existing AG-UI clients work unmodified" proof: if this package had to patch the
|
|
23
|
+
agent, the claim would be false. What it adds is the half AG-UI has no vocabulary for —
|
|
24
|
+
`session.attach(since)`, `turn.cancel`, `intent`, `consent.answer`, `query` — over a small
|
|
25
|
+
`fetch` client against `POST /control`.
|
|
26
|
+
|
|
27
|
+
`run()` parses the SSE stream itself rather than going through the agent's subscriber API,
|
|
28
|
+
for one reason: our frames carry a `seq` the stock agent drops, and `seq` is the whole of
|
|
29
|
+
the resumption story.
|
|
30
|
+
|
|
31
|
+
## A client never writes state
|
|
32
|
+
|
|
33
|
+
AG-UI's shared state is bidirectional by design; ours is not. `StateSnapshot` and
|
|
34
|
+
`StateDelta` flow outward only, and an edit a person makes arrives back as an `intent` the
|
|
35
|
+
kernel validates. Anyone porting a component that expects to write state directly needs to
|
|
36
|
+
know that.
|
|
37
|
+
|
|
38
|
+
**Status.** Implemented and `private` until there is something to publish.
|
|
39
|
+
Implementation plan: [`harness/docs/plans/08-protocol-transport.md`](../../docs/plans/08-protocol-transport.md).
|
package/dist/channel.d.ts
CHANGED
|
@@ -8,17 +8,12 @@
|
|
|
8
8
|
* `connect` — one implementation of the wire for every Node client — and this
|
|
9
9
|
* file gives it the AG-UI [`Frame`] type.
|
|
10
10
|
*/
|
|
11
|
-
import { CLIENT_PROTOCOL, type Client, type ConnectOptions } from "@getorrery/ext";
|
|
11
|
+
import { CLIENT_PROTOCOL, pipePath, type Client, type ConnectOptions } from "@getorrery/ext";
|
|
12
12
|
import { type Frame } from "./events.js";
|
|
13
|
-
export { CLIENT_PROTOCOL };
|
|
13
|
+
export { CLIENT_PROTOCOL, pipePath };
|
|
14
14
|
/** The channel to the host, with frames typed as this package's [`Frame`]. */
|
|
15
15
|
export interface ClientChannel extends Omit<Client, "frames"> {
|
|
16
16
|
frames(): AsyncIterable<Frame>;
|
|
17
17
|
}
|
|
18
|
-
/**
|
|
19
|
-
* The socket a `pipe:<name>` endpoint names: `\\.\pipe\<name>` on Windows,
|
|
20
|
-
* the socket's path elsewhere; `undefined` for any other endpoint.
|
|
21
|
-
*/
|
|
22
|
-
export declare function pipePath(endpoint: string, platform?: string): string | undefined;
|
|
23
18
|
/** Attach over `ORRERY_ENDPOINT` + `ORRERY_TOKEN`, or the `input` / `output` given. */
|
|
24
19
|
export declare function connectClient(options?: ConnectOptions): Promise<ClientChannel>;
|
package/dist/node.js
CHANGED
|
@@ -63,12 +63,7 @@ import {
|
|
|
63
63
|
|
|
64
64
|
// src/channel.ts
|
|
65
65
|
import net from "node:net";
|
|
66
|
-
import { CLIENT_PROTOCOL, connect } from "@getorrery/ext";
|
|
67
|
-
function pipePath(endpoint, platform = process.platform) {
|
|
68
|
-
if (!endpoint.startsWith("pipe:")) return void 0;
|
|
69
|
-
const name = endpoint.slice("pipe:".length);
|
|
70
|
-
return platform === "win32" && !name.startsWith("\\\\") ? `\\\\.\\pipe\\${name}` : name;
|
|
71
|
-
}
|
|
66
|
+
import { CLIENT_PROTOCOL, connect, pipePath } from "@getorrery/ext";
|
|
72
67
|
async function connectClient(options = {}) {
|
|
73
68
|
const endpoint = (options.env ?? process.env)["ORRERY_ENDPOINT"] ?? "";
|
|
74
69
|
const path = options.input && options.output ? void 0 : pipePath(endpoint);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getorrery/client",
|
|
3
|
-
"version": "0.2
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "The TypeScript Orrery client SDK: an AG-UI session over a pluggable transport (HTTP+SSE, WebSocket) and a SurfaceStore. Pure data, no drawing. Browser-safe; Node-only parts in @getorrery/client/node.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@ag-ui/client": "^1.0.0",
|
|
35
35
|
"@ag-ui/core": "^1.0.0",
|
|
36
|
-
"@getorrery/ext": "0.2
|
|
37
|
-
"@getorrery/protocol": "0.2
|
|
36
|
+
"@getorrery/ext": "0.3.2",
|
|
37
|
+
"@getorrery/protocol": "0.3.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/node": "^22.10.0",
|