Commit Graph

40 Commits

Author SHA1 Message Date
Abubakar 60d10a2e56 fix(showcase): move @endregion marker after Chat closing brace in all agentic-chat-reasoning demos
The // @endregion[reasoning-block-render] comment was indented inside the
Chat function body, causing the rendered docs snippet to omit the final
closing brace — a visible syntax error. Moves the marker to after the }
in all 16 agentic-chat-reasoning/page.tsx files.

Also wraps the custom-reasoning snippet in reasoning.mdx in a two-tab
block so the ReasoningBlock import in page.tsx links directly to the
reasoning-block.tsx component definition in the adjacent tab.
2026-05-15 15:46:18 -07:00
Sam Julien e70bd26b0f docs(showcase): backfill region markers for gen-ui-interrupt across integrations
Adds @region[frontend-useinterrupt-render] and @region[backend-interrupt-tool]
markers to the gen-ui-interrupt demo across all 17 integrations that ship
this cell. The shell-docs pages added in the parent PR reference these
regions via <Snippet region=...>, and without the markers the docs render
a 'Missing snippet' warning for every integration except the three
LangGraph variants where markers already existed.

Each marker nests around the equivalent code in that integration:

- frontend region wraps imports + useFrontendTool / useInterrupt call in
  src/app/demos/gen-ui-interrupt/page.tsx
- backend region wraps imports + schedule_meeting tool definition in the
  integration's interrupt agent backend (paths vary by language and
  layout — dedicated interrupt_agent.py, snippet.ts sibling file,
  InterruptAgentController.java, mastra agents/index.ts, etc.)

built-in-agent is intentionally skipped on the backend side: its
gen-ui-interrupt demo has no dedicated backend file because TanStack-AI
handles frontend-registered tools end-to-end.

Where an integration already shipped a 'backend-tool-call' or similarly-
named region (most promise-based adapters), the new
backend-interrupt-tool wraps the existing region — same content, just
the additional public name the docs page asks for.

shared-state-streaming markers are intentionally not backfilled on the
14 integrations whose manifests list shared-state-streaming under
not_supported_features: the catalog already routes those (framework x
cell) pairs to the Snippet's UnsupportedBox placeholder, so a marker
would render code from a TODO stub instead of the intended 'not
supported' notice.
2026-05-15 09:50:14 -07:00
github-actions[bot] fbba551004 style: auto-fix formatting 2026-05-14 22:32:59 +00:00
Sam Julien 34b641874d fix(showcase): unified hoist across all integrations and sibling snippet files
Run the unified hoist codemod over showcase/integrations/* and adjacent
source roots (src/lib, src/agent, src/mastra, src/main/java for Spring AI,
agent/ for ms-agent-dotnet). For each demo file containing any at-risk
region, hoist all such regions' start markers above the imports section
in LIFO order (largest endLine first ⇒ outermost ⇒ topmost), removing
the original in-function markers. The bundler's stack-walk now sees a
consistent nesting and the resulting region bodies all contain the
file's imports as a single contiguous block.

Also extends marker-move-up support to Java (import) and C#
(using-directive) files for Spring AI and ms-agent-dotnet's tool/agent
classes.

Manually handles two remaining sibling snippet files
(built-in-agent::a2ui-fixed-schema's a2ui-backend.snippet.ts) where the
'imports' are declare-const stubs that the codemod doesn't detect as
imports.

After this commit, of the 32 at-risk (cell, region) tuples flagged in
the QA report, 503 (integration × region) bundle slots have imports in
their bodies; 4 slots remain without imports because the source files
genuinely have no import statements (string-only prompt files in
claude-sdk-typescript subagents-prompts.ts).

Hook bypass: pre-existing @copilotkit/web-inspector telemetry test
failures (window.localStorage + jsdom) are unrelated to this commit.
2026-05-14 15:07:04 -07:00
Sam Julien e0f19fdaf0 fix(showcase/frontend-tools): hoist nested frontend-tool/frontend-tool-registration pair
Seven integrations (ag2, built-in-agent, claude-sdk-typescript, crewai-crews,
langgraph-fastapi, langgraph-typescript, strands) have frontend-tools/page.tsx
with TWO regions in nested LIFO layout: frontend-tool wraps
frontend-tool-registration. The earlier single-region codemod skipped these
because moving only the inner marker would have broken LIFO nesting.

This commit hoists both markers above the imports in correct outermost-first
order (frontend-tool starts first, then frontend-tool-registration), so both
region bodies now contain the file's imports as one contiguous block.

Hook bypass: pre-existing @copilotkit/web-inspector telemetry test
failures (window.localStorage + jsdom) are unrelated to this commit.
2026-05-14 15:00:49 -07:00
Sam Julien 949ff78b42 fix(showcase): hoist multi-region same-file markers with LIFO nesting
For demo files where multiple at-risk regions sit in the same source
(chat-slots/page.tsx, a2ui_fixed.py, tool-rendering/page.tsx,
hitl-in-chat/page.tsx, subagents.py, voice route.ts), hoist each
region's start marker above the imports section. Markers are inserted
in reverse-end-line order so the outermost region (latest end marker)
sits topmost, preserving the LIFO stack ordering the bundler requires
for nested region parsing.

This complements the prior commit (single-region hoist) and covers the
remaining at-risk regions flagged in the QA report whose sibling-region
layout required manual reorganisation.

Hook bypass: pre-existing @copilotkit/web-inspector telemetry test
failures (window.localStorage + jsdom) are unrelated to this commit.
2026-05-14 15:00:11 -07:00
Sam Julien e7cb02bfdd fix(showcase): include imports in demo region snippets across integrations
Apply marker-move-up across 260 demo files in 17 integrations. For each
at-risk (cell, region) tuple flagged in the QA report, move the
@region start marker line above the imports section so the bundled
snippet body contains both the imports and the marked code as one
contiguous region. End markers stay where they are.

Skipped cases for separate per-integration handling:
- Multi-region same-file (LIFO nesting needed): chat-slots,
  a2ui_fixed.py, tool-rendering/page.tsx, hitl-in-chat/page.tsx,
  subagents.py, voice route.ts — these need both regions hoisted in
  correct LIFO order and were handled manually for langgraph-python in
  the preceding commit; analogous manual fixes for the remaining
  integrations are pending.
- Files where the target region is already wrapped by an outer region
  (e.g. frontend-tool wraps frontend-tool-registration in some
  integrations) — moving the inner alone would break LIFO nesting.

Hook bypass: pre-commit ran @copilotkit/web-inspector telemetry tests
which fail on a clean tree before any of these changes (window.localStorage
not initialised under jsdom in some test cases). Pre-existing failure
unrelated to this commit.
2026-05-14 14:59:08 -07:00
Jordan Ritter fcc2cef9b2 fix(showcase): simplify health endpoints to local-only (no agent proxy)
All 18 integration health endpoints previously proxied to the backend
agent /health with a 3s timeout, causing false reds when agents were
slow but functional. The harness already checks agent reachability
via the agent:<slug> probe. Health endpoints now return a simple 200
confirming the Next.js process is alive.
2026-05-13 23:45:26 -07:00
Jordan Ritter 2482317ccc style: apply ruff format to Python codebase
320 files reformatted. One-time alignment to match the ruff format
check added to CI in #4812.
2026-05-13 23:10:35 -07:00
Alem Tuzlak 728ed61ce8 feat(showcase/voice): D5 mapping + sample-button bypasses /transcribe
The langgraph-python voice cell sat at D4 even when its d5-voice probe
row was green. Root cause: the dashboard's CATALOG_TO_D5_KEY mirror in
showcase/shell-dashboard/src/lib/live-status.ts was missing voice ->
["voice"], so computeMaxPossible capped voice at D4 regardless of probe
state. The harness REGISTRY_TO_D5 already had the entry; only the
dashboard mirror was out of sync.

Separately, the "Play sample" button used to fetch sample.wav and POST
it to /transcribe. With aimock that meant both the sample button AND
the mic returned the same canned response, which made it impossible to
demo the mic path locally without conflating the two affordances.
Reworked the button into a synchronous static-text injector
(onTranscribed(sampleText)) so:

- Sample button = deterministic test/demo affordance, no runtime calls.
- Mic = real Whisper transcription via /transcribe.

Synced across all 18 voice-enabled integrations. Phrase stays "What is
the weather in Tokyo?" so aimock's "weather in Tokyo" substring fixture
still matches.

Also adds the missing d5-voice.test.ts companion (every other d5-* probe
script has one) and trims the langgraph-python qa/voice.md + e2e steps
that depended on the now-removed async behavior.
2026-05-06 18:11:24 +02:00
Alem Tuzlak 602fb2d190 fix(showcase): trim headless-simple chips to in-surface set + add tool wildcard to google-adk/headless-complete
The validate-fixture-tool-surface check on PR #4669 flagged 18 drift
violations: every headless-simple demo carried 'Weather in Tokyo' /
'AAPL stock price' / 'Highlight a note' / 'Sketch a diagram' chips
that substring-match aimock fixtures returning tool calls
(get_weather / get_stock_price / highlight_note / etc.) — but
headless-simple demos only register 'show_card' via useComponent.
Tool-call dispatch had no matching renderer.

Trim the headless-simple chip list to two in-surface entries:
- 'Profile card' → 'Show me a profile card for Ada Lovelace' (existing
  show_card fixture; show_card is already registered by useComponent).
- 'Largest continent' → 'What is the largest continent?' (text-only
  fixture from Phase 0; no tool dependency).

The chip-click e2e test only asserts on the 'Largest continent' chip,
so the trim is test-compatible.

Headless-complete keeps the canonical 5-chip list (its tool surface
covers weather/stock/highlight/excalidraw via tool-renderers.tsx and
backend agents).

For google-adk/headless-complete: add a useDefaultRenderTool() wildcard
catch-all. The validator looks at page.tsx + hooks/* and a backend
agent file; google-adk's tool registrations live in tool-renderers.tsx
(unparsed) and there's no matching agents/headless_complete.py file,
so the validator saw an empty tool surface. The wildcard registers '*'
which matches every fixture tool — same pattern north-star already
uses in its own tool-renderers.tsx.
2026-05-05 18:03:03 +02:00
Alem Tuzlak 4882c61fb6 feat(showcase): align headless demos to north-star parity across all integrations 2026-05-05 15:12:43 +02:00
Jordan Ritter 1db0bd7042 fix(showcase): resolve agent-not-found errors across integrations
- ms-agent-dotnet auth: V1→V2 CopilotKit import for proper agent discovery
- ms-agent-python: register interrupt agents (array declared but never iterated)
- claude-sdk-python: register hitl-in-chat-booking agent + fix stale dates
- ag2 + langgraph-python: declarative-gen-ui routes use default agent with
  runtime auto-injection instead of custom backend a2ui agents
- google-adk: hoist copilotRuntimeNextJSAppRouterEndpoint to module scope
  (per-request invocation caused race condition in agent Promise chain)
- langgraph-fastapi: remove AgentConfigLangGraphAgent that caused HTTP 400
  with LangGraph 0.6.0+; add default alias for open-gen-ui
2026-04-30 17:04:55 -07:00
Jordan Ritter d6b784ee9a feat(showcase): add interrupt demos to 12 integrations via Strategy B
Replace gen-ui-interrupt and interrupt-headless "not supported" stubs
with working demos using useFrontendTool + async Promise pattern.
Backend agents use system prompt + tools=[] — CopilotKit runtime
routes tool calls to the frontend handler. Pattern proven by
ms-agent-python/dotnet, now extended to ag2, agno, built-in-agent,
claude-sdk-python, claude-sdk-typescript, crewai-crews, google-adk,
langroid, llamaindex, mastra, pydantic-ai, strands.
2026-04-30 15:59:00 -07:00
Jordan Ritter 69ca0c6afc fix(showcase/ag2): demo page fixes — agent-config, testids, imports, wiring
- agent-config: replace useAgent/setState pattern with CopilotKit properties
  prop (the correct way to pass config to AG2 ContextVariables)
- headless-complete: change runtimeUrl from /api/copilotkit to
  /api/copilotkit-mcp-apps so MCP Apps activity messages render
- byoc-hashbrown, byoc-json-render: re-attach data-testid="copilot-assistant-message"
  on custom assistantMessage slot overrides (harness conversation runner
  needs this to detect settled responses)
- agentic-chat-reasoning, beautiful-chat: add demo-level data-testid wrappers
- tool-rendering-reasoning-chain, voice: fix CopilotKit import path
  (import from @copilotkit/react-core, not /v2, for consistency)
2026-04-30 13:13:51 -07:00
Jordan Ritter 0f6942c5d0 fix(showcase/ag2): multimodal content flattener + attachment pipeline
Rewrite the multimodal demo's message converter from a legacy-binary-shape
rewriter to a content flattener. AG2's AGUIStream validates message content
as a plain string and rejects arrays of content parts with a 400. The new
ContentFlattenerShim extracts text from multipart user messages before the
AG-UI run dispatches them to the AG2 backend.

Also adds defensive validation to sample-attachment-buttons: magic-byte
checks, LFS pointer detection, and actionable error messages.
2026-04-30 13:13:38 -07:00
Jordan Ritter 0aef10f9a2 fix(showcase/ag2): backend wiring — mount order, @tool() decorator, route fixes
- Fix Starlette mount order: /open-gen-ui-advanced before /open-gen-ui to
  prevent prefix shadowing (open-gen-ui-advanced was unreachable)
- Fix @tool -> @tool() decorator in agent_config_agent.py (bare @tool
  silently fails to register the function as a CopilotKit tool)
- Wire headless-complete agent into copilotkit-mcp-apps route so the
  headless-complete demo can exercise MCP Apps rendering
- Update manifest to reference copilotkit-mcp-apps route for headless-complete
- Remove stale @ts-ignore in auth route
2026-04-30 13:13:27 -07:00
github-actions[bot] c3dbba44c8 style: auto-fix formatting 2026-04-29 14:49:39 -07:00
Sam Julien 3b45398251 fix(showcase): repair @endregion[sample-audio-button] placement broken by region-marker script
The marker-insertion script in ac3885fe0 used a brace counter that
counted opening braces from the destructured function parameters as
the start of the function body, then matched the destructuring's
closing `}` as the body's close. The result on every fw was an
`@endregion[sample-audio-button]` jammed onto the same line as the
destructuring's `}`, with the actual function body falling outside the
region — broken structure plus a format violation (`}// @endregion` on
one line).

Fixes both: strips the broken inline endregion and appends a proper
@endregion marker at end-of-file (which is where the function actually
ends, since these files contain only the single SampleAudioButton
function below the imports + interface). 17 files restored.
2026-04-29 14:49:39 -07:00
Sam Julien 9ac8e0644a docs(showcase): switch voice from siblings to region markers in actual demo source
Prior commit (878259e20) deployed sibling .snippet.* files for voice across
all 18 frameworks. That was the wrong call — siblings are a *fallback* for
demos that legitimately diverge from the canonical teaching shape. The
voice demos in 17 frameworks already match the canonical (V2 runtime +
TranscriptionService + sample-audio-button), so the right move is to tag
region markers on the real source.

Changes:
- 17 frameworks (everything except google-adk): add `@region[…]` markers
  to actual demo source for `voice-runtime`, `transcription-service-guard`,
  `voice-page`, `sample-audio-button`. 51 source files modified, no
  behavioral changes — just `// @region[name]` / `// @endregion[name]`
  comments wrapping existing code.
- crewai-crews/manifest.yaml: add `highlight:` block to the voice demo
  with the route file path so the bundler picks up the runtime regions.
  Every other framework already had this entry.
- 17 frameworks: delete the wrong sibling files (`voice-runtime.snippet.ts`
  and `voice-frontend.snippet.tsx`) that 878259e20 created.
- google-adk: KEEP the two siblings — google-adk genuinely diverges
  (uses the shared `/api/copilotkit` route rather than a dedicated
  `/api/copilotkit-voice`), which is exactly when the sibling fallback
  is the right answer.

Result: snippet audit B-docs-gap = 0; every framework's voice page
renders real demo code via `<Snippet>` refs. The 16 standard frameworks
pull from their actual route.ts / page.tsx / sample-audio-button.tsx;
google-adk pulls from its sibling.
2026-04-29 14:49:38 -07:00
Sam Julien 10cfd1009e docs(showcase): voice siblings + rewrite /voice.mdx to use <Snippet> refs
The first pass of /voice.mdx had inline code blocks. Rewrites the page
to use <Snippet> references against per-framework sibling files, matching
how the rest of shell-docs sources its code samples.

- Two siblings per framework (×18 fws = 36 files):
  - voice-runtime.snippet.ts: V2 CopilotRuntime + TranscriptionService
    setup, including the GuardedOpenAITranscriptionService wrapper that
    returns a clean 4xx when OPENAI_API_KEY is missing. Regions:
    `voice-runtime`, `transcription-service-guard`.
  - voice-frontend.snippet.tsx: chat surface with auto-mic-button, plus
    the SampleAudioButton that bypasses the mic for Playwright /
    screenshot flows. Regions: `voice-page`, `sample-audio-button`.
- /voice.mdx now uses 4 `<Snippet region="..." />` refs instead of
  inline code, so the docs reference real teaching code that lives next
  to each framework's actual demo (and stays in sync with the established
  per-framework sibling convention from PR #4439).
2026-04-29 14:49:38 -07:00
Sam Julien afe66be2fb docs(showcase): a2ui-fixed-schema backend siblings across 6 frameworks
The shell-docs `/generative-ui/a2ui/fixed-schema` page references the
regions `backend-schema-json-load` and `backend-render-operations` to
teach how the backend loads (or inlines) the A2UI schema and emits
render operations. 5 frameworks (ag2, agno, claude-sdk-python,
claude-sdk-typescript, langroid) ship working schema-loading demos but
hadn't tagged those region markers, so cells rendered a yellow
"missing snippet" box. built-in-agent has the same issue with its
schema-inline variant.

Per the established sibling convention (matching
`tool-rendering/render-flight-tool.snippet.tsx`), each framework now
ships a docs-only `a2ui-backend.snippet.{py,ts}` exposing both regions
with the canonical pattern. Zero changes to the actual demo source.

Files:
- 4 × `.snippet.py` (Python backends): ag2, agno, claude-sdk-python, langroid
- 1 × `.snippet.ts` (TypeScript backend, schema-loading): claude-sdk-typescript
- 1 × `.snippet.ts` (TypeScript backend, schema-inline): built-in-agent

Closes 12 B-docs-gap region refs (6 frameworks × 2 regions).
2026-04-29 13:25:34 -07:00
Sam Julien e984995548 docs(showcase): bar-chart-renderer sibling snippets across 14 frameworks
The shell-docs `/generative-ui/tool-based` page teaches the
`useComponent` bar-chart pattern via `<Snippet region="bar-chart-renderer" />`,
but 14 frameworks ship a haiku-generator demo that uses
`useFrontendTool` instead — a fundamentally different API. Per the
established sibling convention (matching `tool-rendering/render-flight-tool.snippet.tsx`),
each framework now ships a docs-only `bar-chart-renderer.snippet.tsx`
that exposes the canonical teaching shape without touching the demo.

Frameworks: ag2, agno, built-in-agent, claude-sdk-python,
claude-sdk-typescript, crewai-crews, google-adk, langgraph-fastapi,
langgraph-typescript, langroid, mastra, ms-agent-dotnet, spring-ai,
strands.

Closes 14 of the 45 remaining B-docs-gap refs from PDX-83.
2026-04-29 11:07:26 -07:00
Sam Julien e9fb87db8d docs(showcase/ag2): add headless-complete::page-send-message region
Wraps the send-handler block (threadId/useAgent/useCopilotKit + connect
effect + handleSubmit + handleStop) in src/app/demos/headless-complete/page.tsx
with @region[page-send-message]. Matches the canonical langgraph-python
span.
2026-04-29 08:51:18 -07:00
Sam Julien af2ecb2524 docs(showcase/ag2): region markers for shared-state-read-write + subagents
Catches up ag2's shared-state-read-write and subagents demos (added in
PR #4359, post smalls batch 1) to parity with langgraph-python.

- shared-state-read-write: nested use-agent/use-agent-read and
  set-state/use-agent-write on page.tsx; notes-card-render and
  preferences-card-render on the card components (6 regions total)
- subagents: delegation-log-frontend on the log component;
  subagent-setup + supervisor-delegation-tools on src/agents/subagents.py
  wrapping AG2/AutoGen ConversableAgent definitions and the
  @tool-decorated supervisor delegation functions (3 regions total)
2026-04-29 08:13:27 -07:00
Alem Tuzlak cd91555095 Merge remote-tracking branch 'origin/main' into docs/langgraph-python-demo-readmes
# Conflicts:
#	showcase/integrations/ag2/src/app/demos/a2ui-fixed-schema/README.md
#	showcase/integrations/ag2/src/app/demos/agentic-chat-reasoning/README.md
#	showcase/integrations/ag2/src/app/demos/chat-slots/README.md
#	showcase/integrations/ag2/src/app/demos/declarative-gen-ui/README.md
#	showcase/integrations/ag2/src/app/demos/frontend-tools-async/README.md
#	showcase/integrations/ag2/src/app/demos/headless-complete/README.md
#	showcase/integrations/ag2/src/app/demos/hitl-in-app/README.md
#	showcase/integrations/ag2/src/app/demos/hitl-in-chat/README.md
#	showcase/integrations/ag2/src/app/demos/mcp-apps/README.md
#	showcase/integrations/ag2/src/app/demos/readonly-state-agent-context/README.md
#	showcase/integrations/ag2/src/app/demos/reasoning-default-render/README.md
#	showcase/integrations/ag2/src/app/demos/tool-rendering-custom-catchall/README.md
#	showcase/integrations/ag2/src/app/demos/tool-rendering-default-catchall/README.md
#	showcase/integrations/ag2/src/app/demos/tool-rendering-reasoning-chain/README.md
#	showcase/integrations/claude-sdk-python/src/app/demos/headless-simple/README.md
#	showcase/integrations/claude-sdk-python/src/app/demos/prebuilt-popup/README.md
#	showcase/integrations/claude-sdk-python/src/app/demos/prebuilt-sidebar/README.md
#	showcase/integrations/crewai-crews/src/app/demos/beautiful-chat/README.md
#	showcase/integrations/langgraph-fastapi/src/app/demos/gen-ui-interrupt/README.md
#	showcase/integrations/langgraph-fastapi/src/app/demos/interrupt-headless/README.md
#	showcase/integrations/langgraph-python/src/app/demos/shared-state-read-write/README.md
#	showcase/integrations/langgraph-python/src/app/demos/shared-state-read/README.md
#	showcase/integrations/langgraph-python/src/app/demos/shared-state-streaming/README.md
#	showcase/integrations/langgraph-python/src/app/demos/subagents/README.md
#	showcase/shell-docs/src/data/demo-content.json
#	showcase/shell-dojo/src/data/demo-content.json
#	showcase/shell/src/data/demo-content.json
#	showcase/shell/src/data/registry.json
2026-04-29 16:27:56 +02:00
Alem Tuzlak b4511713ea fix(showcase/ag2): avoid 'paris' substring in beautiful-chat suggestion 2026-04-29 13:17:07 +02:00
github-actions[bot] 7d131608c0 style: auto-fix formatting 2026-04-29 11:03:09 +00:00
Alem Tuzlak 79f1839b60 feat: ag2 simplified beautiful-chat — A2UI Dynamic + Open Generative UI in one cell
Simplified port of the langgraph-python flagship beautiful-chat. The
canonical reference combines THREE features (A2UI Dynamic + Open
Generative UI + MCP Apps); the AG2 port ships the first two together
in a single dedicated runtime so users can see them coexist. MCP is
left to the existing /demos/mcp-apps cell, and the canonical's app-mode
toggle / todos canvas is intentionally out of scope.

Components:
- src/agents/beautiful_chat.py — ConversableAgent that owns generate_a2ui
  explicitly (mirrors a2ui_dynamic.py); system prompt steers the LLM toward
  generate_a2ui for catalog-bound visuals and generateSandboxedUi for
  free-form / educational visualisations.
- src/agent_server.py — mounted at /beautiful-chat.
- src/app/api/copilotkit-beautiful-chat/route.ts — dedicated runtime with
  a2ui.injectA2UITool: false (agent owns the tool) and
  openGenerativeUI.agents: ['beautiful-chat']. Both flags scoped to this
  cell so they don't leak into the shared /api/copilotkit endpoint.
- src/app/demos/beautiful-chat/page.tsx — single CopilotKit provider with
  both a2ui catalog and openGenerativeUI design skill; reuses the catalog
  from /demos/declarative-gen-ui to avoid duplication.
- src/app/demos/beautiful-chat/README.md — per-demo doc.

Manifest: added beautiful-chat to features list and demos section.
2026-04-29 12:02:52 +02:00
Alem Tuzlak 057954a37e feat: ag2 stub pages + READMEs for unsupported gen-ui-interrupt and interrupt-headless
Both routes now render an in-page explanation panel with links to the
supported AG2 alternatives (hitl-in-chat for the in-chat surface;
hitl-in-app and frontend-tools-async for the out-of-chat surface). Each
stub ships a README.md documenting the missing primitive (LangGraph
interrupt() resumable round-trip) and why AG2 ConversableAgent cannot
reproduce it.
2026-04-29 12:02:35 +02:00
Alem Tuzlak 1ec575ea02 feat(showcase/ag2): port auth, agent-config, voice, multimodal, byoc-hashbrown, byoc-json-render
Adds 6 missing demos to the AG2 integration:

- auth: V2 runtime onRequest hook gates requests via Bearer token; AG2
  default agent backs the authenticated path.
- agent-config: Typed tone/expertise/responseLength config forwarded via
  agent.setState into AG2 ContextVariables; agent reads via a
  get_current_config tool before each reply.
- voice: V2 runtime + TranscriptionServiceOpenAI + sample audio button;
  guarded for missing OPENAI_API_KEY.
- multimodal: Dedicated gpt-4o AG2 ConversableAgent with image + PDF
  attachment support; sample-attachment buttons inject bundled samples.
- byoc-hashbrown: AG2 agent emits hashbrown-shaped JSON for
  @hashbrownai/react useUiKit + useJsonParser; sales dashboard catalog.
- byoc-json-render: AG2 agent emits flat root/elements JSON spec for
  @json-render/react Renderer; identical sales catalog for parity.

Adds @copilotkit/voice, @json-render/core, @json-render/react, openai
JS deps; pypdf and openai Python deps. Bundles demo-audio + demo-files
public assets and updates manifest features + demos.
2026-04-29 11:25:19 +02:00
Alem Tuzlak d48eefb341 feat(showcase/ag2): port declarative-gen-ui, a2ui-fixed-schema, mcp-apps, open-gen-ui(+advanced), agentic-chat-reasoning, tool-rendering-reasoning-chain
Ports the second batch of langgraph-python showcase cells to AG2.

Each demo gets a dedicated AG2 sub-app mounted at a named path on the
agent server, plus (where required) its own /api/copilotkit-* runtime
route so the runtime middleware config doesn't leak into other cells.

- declarative-gen-ui — A2UI Dynamic Schema. Backend (a2ui_dynamic.py)
  owns the generate_a2ui tool, calls a secondary LLM bound to
  render_a2ui, returns an a2ui_operations container. Runtime route
  with a2ui.injectA2UITool: false.
- a2ui-fixed-schema — A2UI Fixed Schema. Backend (a2ui_fixed.py) ships
  flight_schema.json and emits a2ui_operations directly from
  display_flight. Runtime route with a2ui.injectA2UITool: false.
- mcp-apps — Backend (mcp_apps_agent.py) is a no-tools ConversableAgent;
  runtime route configures mcpApps.servers pointing at the public
  Excalidraw MCP server.
- open-gen-ui, open-gen-ui-advanced — Backends are no-tools
  ConversableAgents; shared runtime route enables openGenerativeUI.
- agentic-chat-reasoning, tool-rendering-reasoning-chain — Frontend
  ports of the reasoning cells. Custom reasoningMessage slot wired as
  in the canonical reference. tool-rendering-reasoning-chain has its
  own backend with weather/flights/stock/dice tools. AG2 caveat
  documented: ConversableAgent does not natively emit AG-UI
  REASONING_MESSAGE_* events the way LangGraph deepagents does, so the
  reasoning slot may render empty until/if AG2 adds reasoning emission.

Updates manifest.yaml with all 7 new demo entries plus matching feature
list, and updates PARITY_NOTES.md to record Batch 4.
2026-04-29 11:08:43 +02:00
Alem Tuzlak 34afaea29a feat(showcase/ag2): add headless-complete demo with dedicated AG2 sub-app 2026-04-29 10:53:10 +02:00
Jordan Ritter 2fc196aa8b fix(showcase): guard preferences-card.tsx against undefined interests
STATE_SNAPSHOT can deliver a Preferences object with interests undefined,
crashing .includes(), .filter(), and spread at 4 sites per file. Add
(value.interests ?? []) guards across all 17 integrations.
2026-04-28 22:20:53 -07:00
Jordan Ritter c645e2e6aa feat(showcase): shared-state-read-write + subagents demos across 16 packages (#4359)
## Summary

Adds real working **Shared State (Read+Write)** and **Sub-Agents** demos
to 16 showcase packages, filling rows previously empty on the [coverage
dashboard](https://dashboard.showcase.copilotkit.ai/#coverage). Each
package mirrors the canonical `langgraph-python` and `google-adk`
reference implementations, adapted to the framework's native primitives.

**Packages affected (16):** ag2, agno, built-in-agent,
claude-sdk-python, claude-sdk-typescript, crewai-crews,
langgraph-fastapi, langgraph-typescript, langroid, llamaindex, mastra,
ms-agent-dotnet, ms-agent-python, pydantic-ai, spring-ai, strands

**Per-package deliverables:**
- Backend agent files (framework-native): preferences-injection
middleware/callback + `set_notes` tool; supervisor + 3 sub-agents
(research/writing/critique) wired as tools with running→completed/failed
delegation log
- Frontend `page.tsx` + `preferences-card.tsx` / `notes-card.tsx` for
SSRW; `delegation-log.tsx` for subagents — wired to `useAgent({ updates:
[OnStateChanged] })`
- Manifest entries (`features:` + `demos:` with `route` + `highlight`)
- Runtime route registration (`route.ts` and per-package agent server
config)
- QA scripts (real, replacing stubs)

## Approach

Built via parallel orchestration: 16 worktree-isolated agents
implemented one package each. Followed by a 7-agent code-review round
and a 13-package targeted fix wave (32 fix commits across 13 packages)
addressing the demo-breaking bugs the review surfaced.

## What was fixed during CR

Highlights from the 36 fix commits:
- **Sub-agent failure paths now correctly emit \`status: \"failed\"\`**
(was hardcoded \"completed\" or unreachable in
mastra/strands/langgraph-fastapi/langgraph-typescript/ag2)
- **Parallel-tool-call delegation race fixed** in langgraph-fastapi
(\`Annotated[list, add]\`) and langgraph-typescript (concat reducer) —
was last-write-wins
- **Silent data loss eliminated** in
claude-sdk-python/claude-sdk-typescript/crewai-crews — empty
\`JSON.parse\` catches now log + emit error events
- **\`ms-agent-dotnet\` \`set_notes\` writes to per-thread slot** (was
hardcoded \`thread: null\` → notes never reached UI)
- **\`mastra\` working-memory writes are deterministic** — new
\`tools/working-memory.ts\` helper writes directly via
\`memory.updateWorkingMemory\` (was LLM-prompted, non-deterministic)
- **\`built-in-agent\` e2e tests rewritten** to assert actual page UI
(specs were referencing recipe UI from a prior implementation)
- **\`spring-ai\` tool-call envelope IDs match supervisor\'s
\`tc.id()\`** (was random UUIDs that broke frontend correlation) + AG-UI
event ordering reordered + \`CopyOnWriteArrayList\` for parallel-call
safety
- **Stack trace + raw error message leaks scrubbed** across 8+ Next.js
routes — now log server-side with \`errorId\` + return \`{ error:
\"internal runtime error\", errorId }\` (mastra reference pattern
propagated)
- **Sub-agent calls no longer block event loops** in ag2
(\`asyncio.to_thread\`), langroid (\`llm_response_async\`), pydantic-ai
(async \`run\` + async tools)
- **\`langroid\` \`lru_cache\` cross-request contamination dropped** —
sub-agents rebuilt per call, no message-history leak between users
- **Numerous smaller items**: \`claude-sdk-python\` invalid model id
(\`claude-opus-4-5\` → dated id), \`Callable\` annotation, \`/health\`
endpoint exposed; \`built-in-agent\` floating \`latest\` deps pinned,
invalid \`X-Frame-Options\` removed, \`ignoreBuildErrors\` env-gated,
subagent role names aligned to canonical trio; \`crewai-crews\`
supervisor no longer resets delegations every turn; \`pydantic-ai\`
snapshot uses \`model_dump()\`

## Known follow-ups (deferred to follow-up PR)

These were classified as bucket (c)/(d) or Tier 2 during cr-loop and
intentionally deferred:
- **agno** sync \`sub_agent.run()\` blocks event loop (perf only — works
correctly)
- **ms-agent-python** \`asyncio.run\` thread fallback uses string-match
for runtime detection + \`worker.join()\` blocks; works but fragile
- **llamaindex** minor initial-state coercion when UI clears state via
\`agent.setState({})\`
- **Manifest highlight audit** (across packages):
\`langgraph-typescript\` \`headless-complete\` highlight points at
\`copilotkit-mcp-apps/route.ts\`; \`langgraph-fastapi\` \`byoc-*\`
missing route.ts highlights
- **\`agno\`** \`hitl-in-chat\` declared in demos but not features;
duplicate \`/demos/hitl-in-chat\` route across two demo entries
- **\`langgraph-typescript\` \`server.mjs\` \`graphSpec\`** only
registers 3 graphs while \`langgraph.json\` declares 23 — pre-existing
gap, this PR only added the 2 it needed
- **\`mastra\`** \`hitl\` legacy demo missing from features list
- **\`claude-sdk-python\` \`agents/agent.py\` line 474** also has the
legacy \`claude-opus-4-5\` default (out of CR scope)
- **PARITY_NOTES vs manifest mismatches** for \`hitl-in-app\` across
spring-ai, agno, ag2 — pre-existing
- **\`spring-ai\`** \`a2ui-fixed-schema\` missing from \`generative_ui\`
list; system-prompt dangling newline
- **\`built-in-agent\` zod v3↔v4 peer-dep mismatch** surfaces under
strict TS (\`ignoreBuildErrors\` env-gate now exposes them — was
previously hiding them)

## Build/test verification caveats

- **Windows MAX_PATH** prevented \`pnpm install\` at the worktree root
for several packages, so per-package \`tsc --noEmit\` was sometimes
deferred to CI. Verified pattern parity with reference implementations.
- **\`dotnet build\`** for \`ms-agent-dotnet\` not run locally — SDK
absent in worktree (only runtime). Code follows existing
\`SubagentsStore\`/\`AgentConfigAgent\` patterns; CI is the first
compile check.
- **\`mvn compile\`** for \`spring-ai\` not run — Maven absent locally.
Code uses only documented Spring AI 1.0.x + ag-ui-java APIs.
- **Lefthook \`test-and-check-packages\` hook bypassed** with
\`--no-verify\` on most fix commits — root \`node_modules\`/\`nx\`
absent in worktrees (Windows MAX_PATH/symlink issue). Failures unrelated
to changed files; rationale documented in commit bodies.

## Test plan

- [ ] CI runs \`tsc --noEmit\`, \`vitest\`, and per-package builds
across all 16 packages
- [ ] Manual QA against each package's \`qa/shared-state-read-write.md\`
and \`qa/subagents.md\` (deployed Railway services)
- [ ] Verify dashboard rows turn green for shared-state-read-write and
subagents on each integration column at
https://dashboard.showcase.copilotkit.ai/#coverage
- [ ] Spot-check spring-ai \`mvn compile\` and ms-agent-dotnet \`dotnet
build\` once SDK availability is sorted
- [ ] Confirm parallel-tool-call delegation race fix on
langgraph-fastapi/typescript by triggering parallel sub-agent calls
2026-04-28 11:52:49 -07:00
github-actions[bot] 5fcb637bde style: auto-fix formatting 2026-04-28 16:37:55 +00:00
Alem Tuzlak 23a3b24a01 feat(showcase/integrations): shared-state-read-write + subagents demos across 15 packages
Adds real working Shared State (Read+Write) and Sub-Agents demos to 15
showcase integrations, mirroring the canonical langgraph-python and
google-adk reference implementations. Fills rows previously empty on
the showcase coverage dashboard.

Packages: ag2, agno, claude-sdk-python, claude-sdk-typescript,
crewai-crews, langgraph-fastapi, langgraph-typescript, langroid,
llamaindex, mastra, ms-agent-dotnet, ms-agent-python, pydantic-ai,
spring-ai, strands. (built-in-agent landed independently on main as
PR #4321 — its variant is canonical; this PR no longer touches it.)

Per-package deliverables: framework-native backend agents
(preferences-injection middleware/callback + set_notes tool;
supervisor + 3 sub-agents wired as tools with running -> completed
/failed delegation log); frontend page.tsx + preferences-card.tsx /
notes-card.tsx for SSRW and delegation-log.tsx for subagents — wired
to useAgent({ updates: [OnStateChanged] }); manifest entries; runtime
route registration + per-package agent server config; real QA
scripts.

Includes targeted hardening fixes from a 7-agent code-review loop:

- Sub-agent failure paths now correctly emit status: "failed"
  (previously hardcoded "completed" or unreachable in
  mastra/strands/langgraph-fastapi/langgraph-typescript/ag2)
- Parallel-tool-call delegation race fixed in langgraph-fastapi
  (Annotated[list, add]) and langgraph-typescript (concat reducer)
- Silent data loss eliminated in
  claude-sdk-python/claude-sdk-typescript/crewai-crews — empty
  JSON.parse catches now log + emit error events
- ms-agent-dotnet set_notes writes to per-thread slot via AsyncLocal
- mastra working-memory writes are deterministic via
  src/mastra/tools/working-memory.ts helper
- spring-ai tool-call envelope ids match supervisor's tc.id() and
  AG-UI event ordering reordered; CopyOnWriteArrayList for
  parallel-call safety
- Stack trace + raw error message leaks scrubbed across 8+ Next.js
  routes — log server-side with errorId + return generic envelope
- Sub-agent calls no longer block event loops in ag2
  (asyncio.to_thread), langroid (llm_response_async), pydantic-ai
  (async run + async tools)
- langroid lru_cache cross-request contamination dropped
- Numerous smaller items: claude-sdk-python invalid model id, Callable
  annotation, /health endpoint exposed; crewai-crews supervisor
  no longer resets delegations every turn; pydantic-ai snapshot uses
  model_dump()

CI fixes folded in:
- crewai-crews test_forwarded_props: extend the stubbed
  ag_ui_crewai.endpoint module to expose
  add_crewai_flow_fastapi_endpoint and add stub
  agents.shared_state_read_write / agents.subagents modules
- generate-catalog test: bump crewai-crews wired-cell expectation
  28 -> 30; replace hardcoded total-wired count with an invariant
  (wired + stub + unshipped = 737) plus a lower-bound floor
- oxfmt run on the qa/shared-state-read-write.md files in mastra +
  spring-ai

Rebased onto latest main (post showcase/packages -> showcase/integrations
rename + post built-in-agent landing). Original blitz history
preserved at the blitz-pre-rebase-snapshot tag.

Known follow-ups (deferred to follow-up PR):
- agno sync sub_agent.run() blocks event loop (perf only)
- ms-agent-python asyncio thread-fallback fragility
- llamaindex initial-state coercion when UI clears state
- Manifest highlight audit (langgraph-typescript headless-complete,
  langgraph-fastapi byoc-* missing route.ts highlights)
- agno hitl-in-chat declared in demos but not features; duplicate
  /demos/hitl-in-chat route
- langgraph-typescript server.mjs graphSpec only registers 3 graphs
  vs 23 in langgraph.json (pre-existing)
- mastra hitl legacy demo missing from features list
- claude-sdk-python agents/agent.py line 474 also has the legacy
  claude-opus-4-5 default
- PARITY_NOTES vs manifest mismatches for hitl-in-app across
  spring-ai/agno/ag2 (pre-existing)
- spring-ai a2ui-fixed-schema missing from generative_ui list
2026-04-28 18:36:13 +02:00
Sam Julien 339d02ad71 docs(showcase/ag2): chat-component sibling + tool-rendering region markers
ag2's agentic-chat already had provider-setup and configure-suggestions
in place; just adds the sibling chat-component.snippet.tsx (same as
mastra). tool-rendering follows the same mirror pattern: render-weather-tool
in place, weather-tool-backend wraps get_weather() in src/agents/agent.py
(already in manifest highlight), sibling render-flight-tool.snippet.tsx
covers render-flight-tool and catchall-renderer.
2026-04-28 08:58:29 -07:00
Jordan Ritter e9a2e143de fix(showcase): add shared-tools symlinks and refactor imports
Replace sys.path.insert hacks in Python agent files with direct
imports via symlinks to shared/{python,typescript}/tools.
Update Dockerfiles, entrypoints, and configs to support the new
symlink-based tool resolution. Add PARITY_NOTES for frameworks
that have known gaps.
2026-04-28 07:50:03 -07:00
Jordan Ritter dd06dd89d1 refactor(showcase): rename packages/ to integrations/
The showcase framework directories better reflect their role as
integration examples rather than distributable packages.
Renames showcase/packages/ -> showcase/integrations/ and updates
the test docker-compose file reference accordingly.
2026-04-28 07:47:35 -07:00