Commit 0d3bfd1
refactor(langgraph): unify agent() return type as LangGraphAgent (#152)
* docs: LangGraph agent() unification design
Eliminate two-step agent()+toAgent() pattern. agent() returns unified
LangGraphAgent (extends AgentWithHistory) preserving all AgentRef
public surface. Type-level tension resolved via langGraph*-prefixed
raw signals (langGraphMessages, langGraphHistory, etc.) alongside
runtime-neutral fields. Breaking change; no compat aliases.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* docs: LangGraph agent() unification implementation plan
4 tasks: lib refactor (define LangGraphAgent, fold to-agent translation
into agent.fn, delete to-agent.ts, refactor mocks, conformance test),
cockpit migration (~23 demos), website docs migration (~20 files), final
verify + PR. Three commits sequenced to keep each step build-clean.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* refactor(langgraph): unify agent() return type as LangGraphAgent
Eliminate two-step agent()+toAgent() pattern. agent() now returns
LangGraphAgent extending AgentWithHistory with the full LangGraph-
specific surface preserved (langGraph*-prefixed raw signals where
type collisions exist with the runtime-neutral chat contract).
- Define LangGraphAgent in agent.types.ts
- Fold to-agent translation logic into agent.fn.ts
- Delete to-agent.ts and its specs
- Add agent.conformance.spec.ts (runAgentConformance suite)
- Rename mockAgentRef → mockLangGraphAgent (mock-langgraph-agent.ts)
- public-api.ts: drop toAgent, AgentRef, createMockAgentRef;
add LangGraphAgent, mockLangGraphAgent
BREAKING: AgentRef is no longer exported. agent() return type changed
from AgentRef to LangGraphAgent. toAgent() removed entirely.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor(cockpit): migrate from agent()+toAgent() to unified LangGraphAgent
25 cockpit angular demos updated. The two field initializers
(stream = agent({...}); chatAgent = toAgent(this.stream)) collapse
to a single field 'agent'. Code reading raw BaseMessage[] switches to
.langGraphMessages(); chat-template bindings now reference the
unified agent.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* docs(website): align with unified LangGraphAgent API
Update MDX prose, code samples in chat/agent/render docs to reference
LangGraphAgent + the single agent({...}) flow. Regenerate api-docs.json.
Rename createMockAgentRef doc page to mockLangGraphAgent. Update llms.txt
example to single-step.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* docs(cockpit): update ag-ui streaming prompt to reference Agent contract
* fix(demo): align chat-demo with unified Message type and AgentSubmitInput
- msg.getType() === 'ai' → msg.role === 'assistant' (Message has 'role',
not BaseMessage's getType()).
- chat.submit({ messages: [{ role: 'human', content }] } as any) →
chat.submit({ message: content }) (the runtime-neutral
AgentSubmitInput shape).
- Drop unused BaseMessage import + generic.
This resolves the TS2339 error that blocked website lint/build CI.
The demo's old code path predates the unification refactor and was
reading raw LangChain types directly off the agent.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent ca02bc9 commit 0d3bfd1
58 files changed
Lines changed: 1463 additions & 1567 deletions
File tree
- apps
- demo/src/app/chat-demo
- website
- content/docs
- ag-ui/getting-started
- agent
- api
- concepts
- chat
- api
- components
- getting-started
- render/a2ui
- src
- app/llms.txt
- components/landing/chat-landing
- lib
- cockpit
- ag-ui/streaming/angular/prompts
- chat
- a2ui/angular/src/app
- debug/angular/src/app
- generative-ui/angular/src/app
- input/angular/src/app
- interrupts/angular/src/app
- messages/angular/src/app
- subagents/angular/src/app
- theming/angular/src/app
- threads/angular/src/app
- timeline/angular/src/app
- tool-calls/angular/src/app
- deep-agents
- filesystem/angular/src/app
- memory/angular/src/app
- planning/angular/src/app
- sandboxes/angular/src/app
- skills/angular/src/app
- subagents/angular/src/app
- langgraph
- deployment-runtime/angular/src/app
- durable-execution/angular/src/app
- interrupts/angular/src/app
- memory/angular/src/app
- persistence/angular/src/app
- streaming/angular/src/app
- subgraphs/angular/src/app
- time-travel/angular/src/app
- docs/superpowers
- plans
- specs
- libs/langgraph/src
- lib
- testing
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
11 | | - | |
| 10 | + | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
37 | | - | |
| 36 | + | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
44 | | - | |
| 43 | + | |
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
| |||
55 | 54 | | |
56 | 55 | | |
57 | 56 | | |
58 | | - | |
59 | | - | |
| 57 | + | |
60 | 58 | | |
61 | 59 | | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
0 commit comments