Commit Graph

79 Commits

Author SHA1 Message Date
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
Jordan Ritter 5a28b778cd Revert "fix(showcase): unblock D2 cells (depth walk + framework probe fixes) (#4433)"
This reverts commit 44241a89d1, reversing
changes made to 0475a74b17.
2026-04-29 13:46:31 -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 933d37150b chore(showcase): introduce agent_config_pattern + auth_pattern manifest flags
Adds two new manifest pattern flags (matching the existing
`interrupt_pattern` / `a2ui_pattern` convention) so the canonical
`/agent-config` and `/auth` shell-docs pages can gate their per-pattern
sections via `<WhenFrameworkHas>` and only render the implementation that
applies to the framework the user has selected.

- `agent_config_pattern: shared-state | runtime-properties | null`
  - `runtime-properties` (1 fw): built-in-agent
  - `shared-state` (17 fws): everything else that wires agent-config

- `auth_pattern: langgraph | ag2-context-variables | microsoft-agent-framework | runtime-onrequest | null`
  - `langgraph` (3 fws): langgraph-python, langgraph-typescript, langgraph-fastapi
  - `ag2-context-variables` (1 fw): ag2
  - `microsoft-agent-framework` (2 fws): ms-agent-python, ms-agent-dotnet
  - `runtime-onrequest` (12 fws): everything else

Also fills in the previously-missing `a2ui_pattern` flag on 6 frameworks
that have wired demos but were rendering near-empty doc pages because
none of the existing `<WhenFrameworkHas>` gates matched. Audit-driven:
ag2/agno/claude-sdk-{python,typescript}/langroid use schema-loading;
built-in-agent uses schema-inline.
2026-04-29 13:25:02 -07:00
Jordan Ritter 44241a89d1 fix(showcase): unblock D2 cells (depth walk + framework probe fixes) (#4433)
## Summary

Fixes the root causes for **30+ live-dashboard cells stuck at D2**
across 31 integration rows on https://dashboard.showcase.copilotkit.ai/.
Five surgical fixes plus one structural depth-walk fix; deploy-stale
cells (~40) are flagged separately for ops since they are not
code-fixable.

## Why these fixes ship together

A scrape of the live dashboard found 100 D2 chips. Bucketing them by
failure mode revealed the pattern is **structural + per-framework**, not
100 independent failures. Five frameworks ship genuine probe/integration
bugs we can fix in code; three frameworks are deploy-stale (Railway
image is older than the recent commit landings); one cell is a
per-feature slot-API contract bug. The dashboard itself also has a
structural bug that under-reports cells whose D5 is green when D3 has no
row yet.

## What ships

### Slot-agent fixes (Phase A/B/C of the blitz)

| Commit | What |
|---|---|
| `1de1556be` D5-green bypass for missing/red D3 in depth walk |
`deriveDepth` in
`showcase/shell-dashboard/src/components/depth-utils.ts` was
contiguous-walk-only, so 13 cells whose `d5:<slug>/<feature>` row is
green but whose `e2e:<slug>/<feature>` row is missing or red were stuck
at D2. Per the harness model, the e2e-deep driver only emits D5 after D3
+ D4 have passed at some point; D5-green is sufficient evidence. After
the D2 (agent) gate passes, `deriveDepth` now checks D5 first; if green,
achieved jumps to 5 and proceeds to D6. D1+D2 remain hard gates - D5
cannot bypass health/agent. 7 new tests pin every asymmetry. |
| `e0d89e0fe` fail loud on slug missing from registry in e2e-demos
driver | `E2eDemosResolver` previously returned `E2eDemoEntry[]`,
conflating "registry has the slug with zero demos" (legitimate brand-new
package) with "slug absent from registry" (operational fault - manifest
gap, stale mount, slug rename). Both collapsed silently into "aggregate
green / no per-feature rows" - exactly the symptom shape on the live
dashboard for several frameworks (`mastra`, `langroid`, `llamaindex`,
`langgraph-typescript`, `langgraph-fastapi`,
`ms-agent-{python,dotnet}`). Resolver now returns `{ present: boolean,
entries: E2eDemoEntry[] }`; when `present === false`, the driver emits a
synthetic red `e2e:<slug>/__missing-registry` side row + flips the
aggregate red with `errorClass: "registry-missing"`. Read-failure path
still goes through the existing green/silent branch to avoid swamping
the dashboard with N noisy red dots when the registry isn't mounted at
all. |
| `00e801209` claude-sdk-python missing openai dep crashed agent on
import | `src/agents/a2ui_dynamic.py` had a top-level `import openai`
but `openai` was never declared in `requirements.txt`. `agent_server.py`
imports `a2ui_dynamic` at module load, so `ModuleNotFoundError` cascaded
through `entrypoint.sh`'s "Agent failed to start - exiting" gate,
preventing Next.js from booting at all. Result: every `/demos/<id>`
route across the integration was unreachable - explaining all 9 red E2E
cells in the `claude-sdk-python` framework column uniformly. Two-line
fix: add `openai>=1.50.0` to `requirements.txt` and move `import openai`
to a lazy import inside `_generate_a2ui` (mirrors the existing pattern
in `agents/agent.py`). |
| `cb2ef9411` remove __future__ annotations from ag2 agent_config_agent
| Same class of bug as commit `e38fab4d6` (Apr 28) which fixed
`shared_state_read_write.py` and `subagents.py`: `from __future__ import
annotations` turns `ContextVariables` in the `@tool`-decorated
`get_current_config(context_variables: ContextVariables) -> str`
signature into a ForwardRef. Autogen's `TypeAdapter` can't resolve it,
registration raises `PydanticUserError` at module import,
`agent_server.py` fails to load, the whole AG2 integration goes
unreachable. Drop the `__future__` import. |
| `b377b78a6` render input slot in google-adk chat-slots welcome screen
| The custom welcome screen at
`src/app/demos/chat-slots/custom-welcome-screen.tsx` did not accept or
render the `input` ReactElement that `CopilotChatView` passes into the
`welcomeScreen` slot. `CopilotChatView` only mounts the chat composer
inside the welcome screen on the empty-thread path
(`CopilotChatView.tsx:301-348`), so when the empty-state welcome was
active no `<textarea>` ever reached the DOM. The e2e-readiness probe's
structural selectors all timed out, flipping the D2 chat-slots cell red.
Mirrors the canonical pattern used by 16+ other integrations (strands,
langgraph-python, claude-sdk-python). |

### cr-loop fixes (Round 1+2 review findings, applied during
convergence)

| Commit | What |
|---|---|
| `b1768f5db` return red aggregate when e2e-readiness resolver throws |
Round 1 finding (3 of 7 reviewers converged independently). When
`demosResolver(slug)` throws, the catch path was emitting a `__resolver`
red side row but `slugPresentInRegistry` defaulted to `true` and was
never flipped, so the fail-loud branch was skipped and the aggregate
fell through to green with `note: "no demos declared"`. Catch now
returns early with a red aggregate (`errorDesc: "resolver-error"`),
mirroring the missing-registry early-return shape. New C12b test pins
the aggregate state, since the existing C12 test only asserted the side
row. |
| `44037b9ce` align claude-sdk-python requirements.txt comment with
lazy-import implementation | Round 1 trivial - the comment block above
the `openai` dep claimed it was "imported at module top". The
`00e801209` fix moved the import to a lazy import; the comment was now
falsified by the diff. Updated to describe the actual two-layer
protection (lazy import as runtime safety net, requirements.txt as
authoritative dep declaration). |
| `070ecd051` empty in-band input.demos no longer suppresses
missing-registry red | Round 2 finding. The in-band fallback `if
(demos.length === 0 && Array.isArray(input.demos))` triggered even when
`input.demos === []`, forcing `slugPresentInRegistry = true` and
silently bypassing the fail-loud branch. A misconfigured probe YAML with
`demos: []` for a slug not in the registry would have rendered green.
Tightened to also require `input.demos.length > 0`. |

## Live-dashboard impact

After deploy:

- **13 cells** whose `d5:<slug>/<feature>` is already green flip to D5
immediately (purely from the depth-walk fix; no probe/agent change
required).
- **30+ cells** across `mastra` / `langroid` / `llamaindex` /
`langgraph-typescript` / `langgraph-fastapi` / `ms-agent-python` /
`ms-agent-dotnet` will surface as red `__missing-registry` rows on the
next probe tick (the previously-silent missing-registry fault becomes
loud and actionable).
- **9 cells** in `claude-sdk-python` flip green once the integration
container rebuilds with the openai dep.
- **15 cells** in `ag2` framework column should flip green once the
agent server boots cleanly (the `agent_config_agent` import crash was
preventing `agent_server.py` from loading at all).
- **1 cell** `google-adk` × `chat-slots` flips green on next deploy
(welcome screen now renders the chat composer).

## Deploy-stale cohort (NOT code-fixable, flagged for ops)

| Framework | D2 cells | Status |
|---|---|---|
| `built-in-agent` | 28 | **Needs Railway redeploy** - local `next
build` succeeds for all 53 routes; live
`https://showcase-built-in-agent-production.up.railway.app` returns HTTP
404 for every demo added in commits `e18ee1d25 e4afffd4f 7abb1d076
74e574838 69cb5f51c 7c44b71f6 53455bfeb`. Source healthy; deploy is
older than the demo-landing commits. |
| `claude-sdk-typescript` | 10 | **Needs Railway redeploy** - same
pattern: local build green, live URL returns 404 for newly-added demos
(`b9dbacd99 / 70522b1a6 / 417e3b397`). |
| `ms-agent-python` | 2 | Probable snapshot-stale - live HTML now
renders the canonical `data-testid="copilot-chat-textarea"` selector;
the readiness scan was probably running before the redeploy completed.
Should self-heal on next probe tick. |

Slack thread to Jordan with the `built-in-agent` deploy-stale evidence
already sent earlier in the run.

## Test plan

- [x] `pnpm --filter @copilotkit/showcase-harness exec vitest run
e2e-readiness` - 34/34 pass (32 pre-existing + 1 new C12b resolver-throw
aggregate-red + 1 new empty-in-band missing-registry)
- [x] `npx vitest run depth-utils` (in `showcase/shell-dashboard/`) -
30/30 pass (23 pre-existing + 7 new D5-bypass cohort)
- [x] `pnpm typecheck` on `showcase/harness` - clean
- [x] `npx tsc --noEmit` on `showcase/shell-dashboard` - touched files
(`depth-utils.ts`, `depth-utils.test.ts`) clean. Pre-existing TS errors
in `compute-tally-detail.test.tsx` are on `main`, not introduced by this
PR.
- [x] cr-loop converged on Round 3 (7 unbiased reviewers, 0 bucket (a)
findings, byte-identical verbatim prompts)
- [ ] CI green on PR HEAD
- [ ] After merge: ops triggers Railway redeploy of
`showcase-built-in-agent-production` and
`showcase-claude-sdk-typescript-production` - those 38 cells flip green
without any code change.

## Out of scope (deferred to follow-up PRs)

A 7-agent unbiased CR surfaced ~50 pre-existing concerns in files this
PR happens to touch but whose subject is distinct (bucket (d) per
cr-loop's classification rules). They have coherent, named subjects and
belong in their own PRs:

- **a2ui_dynamic.py agent observability audit** (claude-sdk-python):
broad `except Exception` leaks tracebacks to chat content; sync `openai`
call in async generator blocks the event loop; Anthropic-format messages
forwarded to OpenAI's `chat.completions.create` will 400 on the second
tool round; no max-iteration cap on the outer `while True` loop;
empty-string `ANTHROPIC_API_KEY` fallback masks misconfig;
`tool_call_id` falls back to empty string.
- **e2e-readiness probe robustness audit**: `Math.max(0, deadline -
Date.now())` returns `0` after deadline expiry, which Playwright treats
as "no timeout" instead of "fail immediately"; whitespace-only `route`
strings bypass the `config-invalid` guard; URL concatenation does not
normalize trailing/leading slashes; no abort check between `newPage()`
and `page.goto()`; `setTimeout` overflow on huge `E2E_DEMOS_TIMEOUT_MS`
env values; `__resolver` / `__missing-registry` sentinel namespacing
speculation.
- **e2e-readiness test hygiene**: the C7 "aborts mid-selector-loop
without walking all 6 selectors" test asserts behavior the
implementation no longer has (single compound selector replaced the
sequential loop); the assertion
`expect(selectorsTried.length).toBeLessThan(5)` is now trivially true.
- **depth-walk semantics audit**: D6 unreachable when `isD5Green` is
false (D6 was always gated on D5-green even before this PR; design
discussion on whether D6-green should imply D5-green - the same way
D5-green now implies D3/D4-pass).
- **agent_config_agent observability**: invalid frontend values
(`tone="snarky"`) silently coerce to defaults with no log; `logger`
instance imported but never used.

## Worktrees / cleanup

- Integration worktree at
`<repo>/.claude/worktrees/blitz-d2-to-d4-integration` retained alive
across cr-loop rounds per blitz protocol; will be removed after this PR
merges.
- 8 per-slot blitz worktrees and 2 ephemeral cr-fix worktrees were
created; 7 cleaned up successfully, 3 had Windows file-lock issues
(built-in-agent, claude-sdk-typescript, ms-agent-python) - git metadata
is gone, just stale dirs that need a manual `rm -rf`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-04-29 13:05:40 -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
Alem Tuzlak 44037b9ceb fix(showcase): align claude-sdk-python requirements.txt comment with lazy-import implementation
The comment block above the openai dep claimed it was "imported at module
top" — that was true on origin/main but our fix in 00e801209 moved the
import to a lazy-import inside _generate_a2ui to localize a missing-dep
failure to the demo path that needs it. The comment was therefore
falsified by the diff: a future cleanup reading the comment would assume
removing the lazy-import is safe, which would re-introduce the import-time
crash this fix was shipped to prevent.

Update the comment to describe the actual two-layer protection: lazy
import in the source as the runtime safety net, requirements.txt as the
authoritative dep declaration so containers ship with it installed.

Surfaced by cr-loop Round 1 (slots 4 + 5 independently flagged the
contradiction). Bucket (b) trivial — orchestrator-applied per cr-loop
discretion.
2026-04-29 18:42:36 +02:00
Alem Tuzlak 00e801209b fix(showcase): claude-sdk-python missing openai dep crashed agent on import
Root cause: src/agents/a2ui_dynamic.py imported `openai` at module top
level, but openai was not in requirements.txt. The agent_server.py imports
a2ui_dynamic at top level too, so on container startup the entire FastAPI
module failed to load with ModuleNotFoundError. entrypoint.sh's startup
gate ("Agent failed to start - exiting") then bailed before Next.js
launched, taking the whole container down. Railway's restart loop made
every /demos/<id> route unreachable, which is exactly the symptom the
D2 e2e-readiness probe reports as red across all 9 features in this
framework column.

Two-part fix:
- Add openai>=1.50.0 to requirements.txt so the dep is actually
  installed in the agent-builder stage.
- Move the `import openai` to a lazy import inside _generate_a2ui
  (mirroring the same pattern in agents/agent.py:339), so a future
  requirements regression localizes the failure to the one
  declarative-gen-ui demo instead of nuking the whole backend on
  module load.
2026-04-29 17:30:36 +02: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
github-actions[bot] 7d131608c0 style: auto-fix formatting 2026-04-29 11:03:09 +00:00
Alem Tuzlak b375349e6a fix(showcase): cr-loop fixes — manifest validation, types, env-var fallbacks
- generate-registry: cross-validate not_supported_features against features list
- catalog-types: widen manifestation union to include 'starter'
- claude-sdk-python: drop invalid 'declarative-schema' from generative_ui enum
- crewai-crews: remove duplicate animated_preview_url key in mcp-apps demo
- built-in-agent + pydantic-ai: REASONING_MODEL env-var fallback so deployers can swap if gpt-5.2/gpt-5 isn't available
2026-04-29 12:58:31 +02:00
Alem Tuzlak 96725d0478 feat: claude-sdk-python adds hitl-in-chat, declarative-gen-ui, a2ui-fixed-schema, gen-ui-tool-based manifest
- hitl-in-chat (+ booking alias): frontend useHumanInTheLoop book_call tool;
  basic Claude SDK chat agent forwards AG-UI tool defs and lets standard
  tool-call lifecycle resolve the user's choice.
- declarative-gen-ui: backend a2ui_dynamic agent owns generate_a2ui tool
  (calls secondary OpenAI client bound to render_a2ui), dedicated runtime
  route with injectA2UITool: false.
- a2ui-fixed-schema: backend a2ui_fixed ships flight_schema.json and the
  display_flight tool emitting a2ui_operations directly; dedicated runtime
  route with injectA2UITool: false.
- gen-ui-tool-based: manifest entry for the existing haiku demo
  (useFrontendTool + useRenderTool).
- Per-demo READMEs documenting the architectural choice for each cell.
2026-04-29 12:33:41 +02:00
Alem Tuzlak d7db181261 feat(claude-sdk-python): add not-supported stubs for interrupt demos
Adds page.tsx + README stubs for gen-ui-interrupt and interrupt-headless.
Both rely on LangGraph's graph-level interrupt() / Command(resume=...)
primitive, which the Claude Agent SDK's Anthropic Messages stream does
not expose. Stubs explain the gap and link users to the hitl /
hitl-in-app cells, which model approval gating with regular tool calls.
2026-04-29 12:05:33 +02:00
Alem Tuzlak 36ffb40ed2 feat(claude-sdk-python): add simplified beautiful-chat demo
A polished brand-themed chat surface over the shared Claude agent.
Mirrors the simplified spring-ai port: gradient background, brand
fonts, seeded suggestion pills, plus a small decorative side panel
(static SVG sparkline + intent breakdown). No A2UI / declarative
generative UI infrastructure required — pure frontend dressing on top
of the existing /api/copilotkit endpoint.

The full canonical version (langgraph-python ExampleCanvas + A2UI
catalog) is documented as out-of-scope in the per-demo README.
2026-04-29 12:05:22 +02:00
Alem Tuzlak 27497206a3 feat(claude-sdk-python): add mcp-apps demo + not_supported_features schema
Adds the MCP Apps demo to the claude-sdk-python integration. The
dedicated /mcp-apps FastAPI endpoint forwards AG-UI input_data.tools
(injected by the runtime's MCP Apps middleware) straight to the
Anthropic Messages API and streams tool_use blocks back as AG-UI
TOOL_CALL_* events. The runtime middleware then fetches each MCP UI
resource and emits the activity event the built-in
MCPAppsActivityRenderer paints in the chat.

Also extends the manifest schema with not_supported_features (a
pre-approved field for surfacing stub pages on features that cannot
be ported to a given backend).
2026-04-29 12:05:09 +02:00
Alem Tuzlak 960dbb9428 feat(claude-sdk-python): add reasoning + tool-rendering-reasoning-chain demos 2026-04-29 11:02:13 +02:00
Jordan Ritter 17e7e0a406 fix(showcase): add missing D5 demo entries and feature IDs to manifests
Add demo entries for hitl, hitl-in-app, hitl-in-chat, tool-rendering,
shared-state-read-write, and gen-ui-tool-based across 14 integrations.
Ensure every demo ID also appears in the features list so the showcase
matrix and D5 probes discover them correctly.
2026-04-28 22:20:58 -07: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 f1f3f07514 fix: resolve security vulnerabilities via dependency overrides (#3857)
## Summary

Comprehensive security vulnerability sweep via pnpm overrides and devDep
bumps. Reduces audit from **155+ to 3** unfixable vulnerabilities.

### Changes

**49 pnpm overrides** covering all resolvable transitive dependency
vulnerabilities:
- 12 initial overrides (phase 1)
- 7 upgraded to higher patched versions (phase 2)
- 30 new overrides added (phase 3)

**Direct dependency bumps:**
- storybook devDeps: ^10.1.10 → ^10.2.10 (root + react storybook
example)
- vitest in demo-agents: ^2.1.8 → ^4.1.3 (resolves vite 5.x vuln)
- next in chat-with-your-data: 15.6.0-canary.58 → 15.6.0-canary.61
- vite in react-router: ^6.0.0 → ~7.3.2

### Remaining 3 (truly unfixable)

| Package | Severity | Why |
|---------|----------|-----|
| parse-git-config | HIGH | No patch exists (patched: <0.0.0), dep of
danger |
| elliptic | LOW | No patch exists, deep in storybook crypto chain |
| next | MODERATE | Example on 15.x canary, advisory needs 16.x |

### Companion PR
ag-ui-protocol/ag-ui#1504

Part of CPK-7320
2026-04-28 13:42:41 -07:00
Sam Julien 1ae1c301d1 docs(showcase/claude-sdk-python): region markers across 10 cells
Brings claude-sdk-python to feature parity with langgraph-python on the
shell-docs snippet audit. 10 (framework x cell) targets advanced from B
(missing regions) to A (ready), following the patterns established in
#4326 (mastra), #4361 (smalls batch 1), #4363 (ms-agent), and #4369
(google-adk).

Frontend regions (in-place markers):
- agentic-chat: configure-suggestions, provider-setup
- frontend-tools: frontend-tool-handler, frontend-tool-registration
- headless-complete: page-send-message
- open-gen-ui: minimal-provider-setup
- open-gen-ui-advanced: sandbox-function-registration (multi-file:
  page.tsx + sandbox-functions.ts)
- readonly-state-agent-context: context-provider-sketch,
  use-agent-context-call
- tool-rendering: render-weather-tool
- tool-rendering-custom-catchall: use-default-render-tool-wildcard
- tool-rendering-default-catchall: default-catchall-zero-config

Runtime regions (route.ts, in-place):
- open-gen-ui: minimal-runtime-flag
- open-gen-ui-advanced: advanced-runtime-config
  (both names share one block — server config is identical)

Backend regions (Python, in-place):
- subagents: subagent-setup wraps SUB_AGENT_PROMPTS plus _invoke_sub_agent;
  supervisor-delegation-tools wraps _delegation_tool_schema plus
  SUPERVISOR_TOOLS — captures the Claude Agent SDK idiom (Anthropic tool
  schemas plus a manual run loop) rather than langgraph-python's
  @tool/create_agent shape.

Sibling teaching files (production demo carries QA hooks irrelevant to
the docs page):
- agentic-chat/chat-component.snippet.tsx — minimal Chat for the
  prebuilt-chat docs page
- tool-rendering/render-flight-tool.snippet.tsx — flight + catchall
  renderer patterns; production demo only registers a weather renderer
- tool-rendering/weather_tool.snippet.py — single-tool teaching example
  for the Anthropic tool-schema idiom; production agent.py declares
  get_weather inside a shared TOOLS list with dispatch via _execute_tool

Markers are comment-only and stripped from rendered output, so the
runtime demos are byte-for-byte unchanged. No manifest edits.
2026-04-28 13:21:02 -07:00
Jordan Ritter c272a795dc fix: remove stale starter: blocks from all 17 integration manifests
The packages/starters merge (PR #4351) eliminated starters as separate
deployable units. Remove the starter: block (path, name, description,
github_url, demo_url, clone_command) from all 17 integration manifests
to stop propagating stale showcase-starter-* Railway URLs through the
data pipeline.
2026-04-28 12:06:08 -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
Jordan Ritter 9729cffbce fix(showcase): fix D5 probe failures for claude-sdk-python and langroid
claude-sdk-python tool-rendering: ToolCallResultEvent was missing the
required `message_id` field, causing a pydantic ValidationError that
crashed the SSE stream whenever a tool was invoked. Add message_id
derived from the parent message id and tool call id.

claude-sdk-python agentic-chat: wrap the Anthropic streaming loop in
try/except so errors from the LLM client surface as visible text in
the assistant message instead of silently breaking the SSE stream.

langroid agentic-chat: bump ag-ui-protocol from ==0.1.9 to >=0.1.14.
Version 0.1.9 typed UserMessage.content as `str` only, but CopilotKit
sends structured content as `list[TextInputContent]`. This caused a
pydantic ValidationError on every request, breaking all langroid
backend endpoints.
2026-04-28 10:36:38 -07:00
Jordan Ritter 6bc0db6a25 fix: harden showcase packages — dep pins + Docker image pins
Dependency version floors:
- next: ^15.0.0 → ^15.5.15 across all 19 showcase packages (CVE-2025-29927)
- express: ^4.21.0 → ^4.21.2 in claude-sdk-typescript (open redirect fix)
- hono: ^4.0.0 → ^4.6.0 in shell (path traversal fix)

Docker base image pins:
- node:20-slim → node:20.19-slim (18 Dockerfiles)
- python:3.12-slim → python:3.12.11-slim (12 Dockerfiles)
- aimock:latest → aimock:1.13.0 (1 Dockerfile)

Part of CPK-7320
2026-04-28 10:33:06 -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
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