diff --git a/.changeset/agui-activity-feed.md b/.changeset/agui-activity-feed.md deleted file mode 100644 index 467d685..0000000 --- a/.changeset/agui-activity-feed.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'@mobile-reality/mdma-agui': minor ---- - -Surface agentic activity — tool calls, run steps, and reasoning streams — as an ordered feed via the -`onActivity` option and `bridge.activity` (also returned from `useMdmaAgentStream`). Activity is -deliberately kept **out** of the MDMA document store, so agent chatter and rendered components stay -decoupled: render it as a timeline beside the documents, or ignore it entirely. Each `MdmaActivity` -carries a stable `id` (tool-call id / step handle / reasoning message id), a `kind` -(`'tool' | 'step' | 'reasoning'`), a `label`, a `status` (`'running' | 'done'`), and streamed -`detail` — accumulating tool args, the tool result, or the reasoning text. diff --git a/.changeset/agui-custom-event-channel.md b/.changeset/agui-custom-event-channel.md deleted file mode 100644 index e4f128d..0000000 --- a/.changeset/agui-custom-event-channel.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -'@mobile-reality/mdma-agui': minor ---- - -Accept MDMA on a dedicated `CUSTOM` event channel alongside inline assistant text. A backend that -would rather not interleave documents into visible prose can emit -`{ type: 'CUSTOM', name: 'mdma', value }` (the name is exported as `MDMA_CUSTOM_EVENT_NAME`), where -`value` is either the markdown string or `{ messageId?, markdown }`. Both channels feed the same -parse/store/render pipeline — out-of-band text is parsed immediately rather than throttled, since it -arrives complete — and each message reports where it came from via `message.source` -(`'text' | 'custom'`). Keeping documents off the prose channel means no markup leaks into the chat, -which is what a tool-calling agent wants when the document lives in a tool argument. diff --git a/.changeset/agui-interrupt-resume.md b/.changeset/agui-interrupt-resume.md deleted file mode 100644 index b446ff0..0000000 --- a/.changeset/agui-interrupt-resume.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -'@mobile-reality/mdma-agui': minor ---- - -Resume parked runs through AG-UI's native `interrupt` primitive. When a run finishes with an -`interrupt` outcome the bridge exposes the pending set as `bridge.interrupts` and fires -`onInterrupt`; answering the component an interrupt refers to now resolves **that** interrupt with -`runAgent({ resume })`, so the parked run continues with its state intact instead of starting a -fresh turn. - -The new `resumeMode` option selects the strategy: - -- `'auto'` (default) — resolve a matching interrupt if the run is parked on one, otherwise fall back - to a fresh user turn. -- `'interrupt'` — only ever resolve a matching interrupt; if none matches, do nothing. -- `'user-turn'` — always open a fresh user turn (`addMessage` + `runAgent`). - -**Behavior change:** a user decision previously always opened a fresh user turn. Under the new -`'auto'` default it will resolve a matching interrupt when the run is parked on one. Pass -`resumeMode: 'user-turn'` to keep the previous behavior. Returning `false` from `onAction`, or -supplying `resume`, still overrides resumption entirely. diff --git a/.changeset/agui-shared-state.md b/.changeset/agui-shared-state.md deleted file mode 100644 index 92eb6e1..0000000 --- a/.changeset/agui-shared-state.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -'@mobile-reality/mdma-agui': minor ---- - -Track the agent's shared state (`STATE_SNAPSHOT` / `STATE_DELTA`, including JSON-patch deltas) as a -`componentId → values` map, exposed via the `onState` option and `bridge.state`, and use it to -hydrate MDMA stores. MDMA components are headless — a document describes intent and takes its values -from state — so this is what lets a form the agent renders come up **pre-filled** from what it -already knows. - -Hydration is **reactive**: state arriving *after* a component is already on screen is dispatched into -that live store too, so the agent can set a field the user is currently looking at without -re-rendering the component. diff --git a/demo-native/CHANGELOG.md b/demo-native/CHANGELOG.md index 2725a03..be2a393 100644 --- a/demo-native/CHANGELOG.md +++ b/demo-native/CHANGELOG.md @@ -1,5 +1,15 @@ # @mobile-reality/mdma-demo-native +## 0.0.4 + +### Patch Changes + +- Updated dependencies [16fe1f2] +- Updated dependencies [16fe1f2] +- Updated dependencies [16fe1f2] +- Updated dependencies [16fe1f2] + - @mobile-reality/mdma-agui@0.3.0 + ## 0.0.3 ### Patch Changes diff --git a/demo-native/package.json b/demo-native/package.json index 8d66434..fd50387 100644 --- a/demo-native/package.json +++ b/demo-native/package.json @@ -1,7 +1,7 @@ { "name": "@mobile-reality/mdma-demo-native", "private": true, - "version": "0.0.3", + "version": "0.0.4", "main": "index.ts", "scripts": { "start": "expo start", diff --git a/examples/integrations/ag-ui/CHANGELOG.md b/examples/integrations/ag-ui/CHANGELOG.md new file mode 100644 index 0000000..782a329 --- /dev/null +++ b/examples/integrations/ag-ui/CHANGELOG.md @@ -0,0 +1,11 @@ +# mdma-example-agui + +## 0.0.1 + +### Patch Changes + +- Updated dependencies [16fe1f2] +- Updated dependencies [16fe1f2] +- Updated dependencies [16fe1f2] +- Updated dependencies [16fe1f2] + - @mobile-reality/mdma-agui@0.3.0 diff --git a/examples/integrations/ag-ui/package.json b/examples/integrations/ag-ui/package.json index 523974c..02e8288 100644 --- a/examples/integrations/ag-ui/package.json +++ b/examples/integrations/ag-ui/package.json @@ -1,7 +1,7 @@ { "name": "mdma-example-agui", "private": true, - "version": "0.0.0", + "version": "0.0.1", "type": "module", "description": "End-to-end AG-UI integration example: OpenRouter backend + AG-UI protocol + MDMA + React frontend.", "scripts": { diff --git a/packages/agui/CHANGELOG.md b/packages/agui/CHANGELOG.md index c2ed9c5..6d73b4d 100644 --- a/packages/agui/CHANGELOG.md +++ b/packages/agui/CHANGELOG.md @@ -1,5 +1,52 @@ # @mobile-reality/mdma-agui +## 0.3.0 + +### Minor Changes + +- 16fe1f2: Surface agentic activity — tool calls, run steps, and reasoning streams — as an ordered feed via the + `onActivity` option and `bridge.activity` (also returned from `useMdmaAgentStream`). Activity is + deliberately kept **out** of the MDMA document store, so agent chatter and rendered components stay + decoupled: render it as a timeline beside the documents, or ignore it entirely. Each `MdmaActivity` + carries a stable `id` (tool-call id / step handle / reasoning message id), a `kind` + (`'tool' | 'step' | 'reasoning'`), a `label`, a `status` (`'running' | 'done'`), and streamed + `detail` — accumulating tool args, the tool result, or the reasoning text. +- 16fe1f2: Accept MDMA on a dedicated `CUSTOM` event channel alongside inline assistant text. A backend that + would rather not interleave documents into visible prose can emit + `{ type: 'CUSTOM', name: 'mdma', value }` (the name is exported as `MDMA_CUSTOM_EVENT_NAME`), where + `value` is either the markdown string or `{ messageId?, markdown }`. Both channels feed the same + parse/store/render pipeline — out-of-band text is parsed immediately rather than throttled, since it + arrives complete — and each message reports where it came from via `message.source` + (`'text' | 'custom'`). Keeping documents off the prose channel means no markup leaks into the chat, + which is what a tool-calling agent wants when the document lives in a tool argument. +- 16fe1f2: Resume parked runs through AG-UI's native `interrupt` primitive. When a run finishes with an + `interrupt` outcome the bridge exposes the pending set as `bridge.interrupts` and fires + `onInterrupt`; answering the component an interrupt refers to now resolves **that** interrupt with + `runAgent({ resume })`, so the parked run continues with its state intact instead of starting a + fresh turn. + + The new `resumeMode` option selects the strategy: + + - `'auto'` (default) — resolve a matching interrupt if the run is parked on one, otherwise fall back + to a fresh user turn. + - `'interrupt'` — only ever resolve a matching interrupt; if none matches, do nothing. + - `'user-turn'` — always open a fresh user turn (`addMessage` + `runAgent`). + + **Behavior change:** a user decision previously always opened a fresh user turn. Under the new + `'auto'` default it will resolve a matching interrupt when the run is parked on one. Pass + `resumeMode: 'user-turn'` to keep the previous behavior. Returning `false` from `onAction`, or + supplying `resume`, still overrides resumption entirely. + +- 16fe1f2: Track the agent's shared state (`STATE_SNAPSHOT` / `STATE_DELTA`, including JSON-patch deltas) as a + `componentId → values` map, exposed via the `onState` option and `bridge.state`, and use it to + hydrate MDMA stores. MDMA components are headless — a document describes intent and takes its values + from state — so this is what lets a form the agent renders come up **pre-filled** from what it + already knows. + + Hydration is **reactive**: state arriving _after_ a component is already on screen is dispatched into + that live store too, so the agent can set a field the user is currently looking at without + re-rendering the component. + ## 0.2.0 ### Minor Changes diff --git a/packages/agui/package.json b/packages/agui/package.json index 0f45a1a..ff2a17a 100644 --- a/packages/agui/package.json +++ b/packages/agui/package.json @@ -1,6 +1,6 @@ { "name": "@mobile-reality/mdma-agui", - "version": "0.2.0", + "version": "0.3.0", "description": "Bridge that renders MDMA interactive documents streamed over the AG-UI protocol and routes user actions back into the agent run.", "keywords": [ "mdma",