Skip to content
This repository was archived by the owner on Apr 18, 2026. It is now read-only.

feat(scripting): ag-ui session adapter + M1 API migration#186

Open
runyaga wants to merge 3 commits into
mainfrom
feat/agui-session-adapter
Open

feat(scripting): ag-ui session adapter + M1 API migration#186
runyaga wants to merge 3 commits into
mainfrom
feat/agui-session-adapter

Conversation

@runyaga
Copy link
Copy Markdown
Owner

@runyaga runyaga commented Apr 18, 2026

Summary

  • A1–A4: AgUiSessionAdapter, ActivitySnapshotMapper, StateSignalTracker, AgUiHttpObserver in soliplex_scripting/lib/src/agui/ — merges bridge events, agent signals, plugin state signals, and HTTP observer into a single Stream<BaseEvent>
  • M1 migration: Update soliplex_interpreter_monty and soliplex_scripting tests to the dart_monty M1 API — MontyValue typed results, BridgeRunFinished.printOutput output model, mock.history.* call history, updated MontyBridge interface (register({category}), registerOs, schemasByCategory), introspection count −1 (list_functions removed)

Test plan

  • dart test in soliplex_interpreter_monty — 54 tests pass
  • dart test in soliplex_scripting — 189 tests pass
  • dart analyze --fatal-infos in both packages — 0 issues

🤖 Generated with Claude Code

runyaga and others added 3 commits April 18, 2026 05:35
AgUiSessionAdapter merges six source observables into a single
Stream<BaseEvent>:

- Stream<BridgeEvent> → 1:1 base events (via AgUiBridgeAdapter) +
  ACTIVITY_SNAPSHOT CustomEvents (via ActivitySnapshotMapper)
- AgentSession.runState → STATE_SNAPSHOT + STATE_DELTA at agent.run
- AgentSession.sessionState → STATE_SNAPSHOT + STATE_DELTA at
  agent.session
- AgentSession.lastExecutionEvent → execution.* CustomEvents
- StatefulPluginObservation signals → STATE_SNAPSHOT + STATE_DELTA at
  plugin.<key>
- AgUiHttpObserver → http.* CustomEvents (REST + SSE via same observer)

New types:
- AgUiSessionAdapter — orchestrates all sources, owns lifecycle
- StatefulPluginObservation — key + signal pair for plugin state
- ActivitySnapshotMapper — BridgeEvent → ACTIVITY_SNAPSHOT with locked
  vocabulary (run_start/end/error, skill_tool_start/args/result)
- StateSignalTracker — first emission → StateSnapshotEvent, subsequent →
  StateDeltaEvent (RFC 6902 replace patch)
- AgUiHttpObserver — implements HttpObserver, emits http.* CustomEvents

A5 (encodeFrame) is already provided by ag_ui's EventEncoder.encodeSSE.
A6 (PluginRegistry.statefulObservations) and A7 (MontyScriptEnvironment
wiring) follow after dart_monty M1 merges.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Delete layer0–layer2 integration tests that broke due to dart_monty
sub-package migration; upgrade dart_monty ref to latest main.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- MontyResult.value is now MontyValue (non-nullable); replace Map literals
  with MontyDict/MontyString/MontyBool/MontyList subtypes
- BridgeTextStart/Content/End removed; collect output from
  BridgeRunFinished.printOutput instead
- MontyBridge.register now takes {String? category}; add registerOs and
  schemasByCategory to test fakes
- MockMontyPlatform call history moved to mock.history.*
  (lastRunCode, lastStartCode, lastStartExternalFunctions, etc.)
- buildIntrospectionFunctions returns [help] only (list_functions removed);
  update count assertions from +2 to +1 introspection
- MontyValue.dartValue used for text extraction in MontyExecutionService

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant