Commit 68dce15
feat(ag-ui): @cacheplane/ag-ui adapter wrapping @ag-ui/client (#139)
* docs: AG-UI adapter design
New @cacheplane/ag-ui package wraps @ag-ui/client AbstractAgent into
the runtime-neutral Agent contract. Scope B: messages + lifecycle +
tool calls + state. toAgent(source) primitive + provideAgUiAgent({url})
DI convenience. Pure-function reducer; conformance test against shared
suite. Cockpit demo proves end-to-end decoupling.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* docs: AG-UI adapter implementation plan
6 tasks: scaffold @cacheplane/ag-ui lib, pure-function reducer with
table-driven spec, toAgent + conformance test, provideAgUiAgent DI
convenience, cockpit streaming demo, final verify + PR. Pinned to
@ag-ui/client and fast-json-patch (RFC 6902 for StateDelta).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* feat(ag-ui): scaffold @cacheplane/ag-ui library
Mirror libs/langgraph/ structure. Stubbed toAgent and provideAgUiAgent
will be implemented in subsequent commits.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* feat(ag-ui): pure-function reducer mapping AG-UI events to Agent signals
Implements reduceEvent(event, store) covering RUN_STARTED/FINISHED/ERROR,
TEXT_MESSAGE_START/CONTENT/END, TOOL_CALL_START/ARGS/END/RESULT,
STATE_SNAPSHOT/DELTA, MESSAGES_SNAPSHOT, and CUSTOM. Discriminates
state_update CustomEvents into AgentStateUpdateEvent. Table-driven tests
cover every variant.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* feat(ag-ui): toAgent wraps AbstractAgent into Agent contract
Subscribes to source via AgentSubscriber.onEvent and reduces every event
into the produced Agent's signals. submit() optimistically appends user
message to both our signals and source.addMessage(), then calls
source.runAgent(). stop() calls source.abortRun(). Conformance suite
validates the AG-UI adapter passes the same contract assertions as the
LangGraph adapter.
Also fixes reducer.ts type casts (as unknown as) required by @ag-ui/client
0.0.52 which uses Zod-inferred BaseEvent types that do not overlap with
narrower cast targets without the intermediate unknown step.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* feat(ag-ui): provideAgUiAgent DI convenience for HttpAgent
Constructs HttpAgent from config and wires it through toAgent into the
AG_UI_AGENT injection token. Convenience entry point for the common case;
custom transports go through toAgent(customAgent) directly.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* feat(cockpit): AG-UI streaming demo using @cacheplane/ag-ui
Mirrors cockpit/langgraph/streaming/angular/ structure. Demonstrates
the chat-runtime decoupling: same <chat> composition, AG-UI runtime
instead of LangGraph.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent 7ccd3ad commit 68dce15
38 files changed
Lines changed: 2549 additions & 11 deletions
File tree
- cockpit/ag-ui/streaming/angular
- prompts
- src
- app
- environments
- docs/superpowers
- plans
- specs
- libs/ag-ui
- src
- lib
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
0 commit comments