@aparte/runner-ag-ui 0.21.0 → 0.23.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 CHANGED
@@ -25,7 +25,13 @@ client.start();
25
25
  - **Approvals.** When the agent pauses on a call that needs a person (an AG-UI interrupt, such
26
26
  as TanStack AI's `needsApproval`), the page asks through its usual approval panel, and the
27
27
  answer resumes the run on the agent's server.
28
- - **Its own state** (`STATE_*`, `CUSTOM`, sub-agents) is read and left alone in this version.
28
+ - **Its state** (`STATE_SNAPSHOT`, `STATE_DELTA`) is kept for the thread and sent back as the
29
+ next run's `state`. `CUSTOM`, activities and sub-agents are checked, not drawn, in this version.
30
+ - **AG-UI 1.0, held to its own corpus.** The runner declares `protocolVersion: "1.0"`, rejects
31
+ the streams 1.0 tells a client to reject, drops what 1.0 does not describe (reported to
32
+ `onWarning`), and passes the protocol's 68 conformance streams on every build.
33
+ - **TanStack AI** frames its runs its own way — a `RUN_FINISHED` per model step — so its routes
34
+ take `createAgUiRunner({ endpoint: '/api/chat', relaxedRunFraming: true })`.
29
35
 
30
36
  No AG-UI SDK is pulled in: the wire is plain JSON over Server-Sent Events, parsed here, with
31
37
  `@aparte/core` as the only peer dependency.
@@ -0,0 +1,19 @@
1
+ type AgUiEvent = {
2
+ type: string;
3
+ } & Record<string, unknown>;
4
+ /**
5
+ * The properties AG-UI 1.0 describes on each event, beyond `BASE`. Written out rather than
6
+ * read from `@ag-ui/core`'s schemas, which would ship zod to every page; a test holds this
7
+ * table to those schemas, so a protocol update that adds a field fails it.
8
+ */
9
+ export declare const EVENT_KEYS: Record<string, readonly string[]>;
10
+ /**
11
+ * AG-UI's rule for what a consumer does not recognise: survive it. An unknown event is
12
+ * dropped, an undescribed property or an unknown member of a closed set is stripped, an
13
+ * unknown element of a list is removed from it — each told to `warn` by its path, the
14
+ * event otherwise left intact. A value of the wrong SHAPE is not unknown, it is
15
+ * malformed, and is left for the verifier to reject.
16
+ */
17
+ export declare function enforce(event: AgUiEvent, warn: (message: string) => void): AgUiEvent | undefined;
18
+ export {};
19
+ //# sourceMappingURL=enforce.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enforce.d.ts","sourceRoot":"","sources":["../src/enforce.ts"],"names":[],"mappings":"AAAA,KAAK,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAK5D;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAgCxD,CAAC;AAOF;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GAAG,SAAS,GAAG,SAAS,CAmChG"}