Commit Graph

107 Commits

Author SHA1 Message Date
Alem Tuzlak 4b5f976016 fix(showcase): split COPY into two explicit lines + probe to diagnose CI failure
Glob form 'COPY package*.json ./' didn't fix CI -- only package.json
ended up in /app, despite the build context transferring 1.38 MB
(lockfile is 705 KB so it's clearly in the source).

This commit:
1. Splits the COPY into two unambiguous lines.
2. Adds a 'RUN ls -la /app/' probe before npm ci.

If the probe shows package-lock.json present in /app, the issue is in
npm ci discovery. If absent, the issue is in build context upload.
Probe to be reverted once root cause is known.
2026-05-19 11:38:08 +02:00
Alem Tuzlak 8ebd7dfe36 fix(showcase): use glob COPY package*.json ./ to bust poisoned Depot cache
CI failed on the 16 integrations whose explicit two-file COPY
`COPY package.json package-lock.json ./` hit a poisoned Depot remote
BuildKit cache entry: the cached layer reported CACHED but only
contained `package.json`, so the subsequent `npm ci` failed with
"command can only install with an existing package-lock.json".

Depot's cache had a layer indexed against the prior `COPY package.json
./` instruction; the new two-file instruction was matching it by some
internal cache-key collision. Two of 18 integrations (langgraph-python,
langgraph-typescript) passed only because they had a fully-cached
`RUN npm ci` layer from a sibling build that short-circuited the
broken COPY.

The glob form `COPY package*.json ./` produces an instruction string
that has never appeared in Depot's cache, so the layer is computed
fresh against the actual build context and includes both files. It
also reads cleaner than the explicit two-file enumeration.

No-Op when no cache poisoning is present -- the glob expands to exactly
package.json and package-lock.json on every integration (verified
locally; only those two files match per directory).
2026-05-19 11:19:24 +02:00
Alem Tuzlak 998be411bd fix(showcase): use lockfile-pinned npm ci in all integration Dockerfiles + reclaim BuildKit cache on build
## Root cause

17 of 18 integration Dockerfiles copy `package.json` but NOT
`package-lock.json`, then run `npm install --legacy-peer-deps`. Despite a
~700KB lockfile sitting in every directory, none of them are consulted at
build time. Only `built-in-agent` was already doing it right.

Effect on Windows / WSL2:

1. `npm install` re-resolves package versions from scratch on every
   rebuild, downloading ~1.1 GB into the build container's writable layer
   plus ~hundreds of MB of `~/.npm/_cacache` that lives in the same
   layer (BuildKit can't dedupe across builds because the layer hash
   varies with each non-deterministic resolution).
2. The npm install layer's BuildKit cache key is just `package.json`'s
   hash + base image — but with `npm install` (not `npm ci`) the install
   itself is non-deterministic, so a cached layer that resolved
   successfully can produce different node_modules trees than a fresh
   resolution. Worse, intermediate state from interrupted rebuilds
   (e.g. host OOM during `npm install`) is not reclaimed by `docker
   builder prune` until 24h later.
3. WSL2's `docker_data.vhdx` grows monotonically — it never shrinks
   until `wsl --shutdown` + `Optimize-VHD`. Repeated rebuilds compound
   into a VHDX that can reach hundreds of GB on the Windows host
   filesystem before any reclaim happens.

## Fix

Two-part:

1. **Lockfile-pinned, deterministic install** in all 18 Dockerfiles:
   ```
   COPY package.json package-lock.json ./
   RUN npm ci --legacy-peer-deps
   ```
   - `npm ci` is faster, deterministic, and writes ~half the temporary
     state of `npm install`.
   - The lockfile in COPY makes the install layer's BuildKit cache key
     stable across rebuilds, so once the layer is warm it actually stays
     warm.
   - Matches the pattern `built-in-agent` already uses.

2. **Reclaim dangling BuildKit cache in `bin/showcase build`** with a
   24h-window `docker builder prune --filter "until=24h"`. Keeps the
   warm cache for day-of work, reaps orphans from interrupted builds.

## Verification

```
for d in showcase/integrations/*/; do
  grep -E "^(COPY package|RUN npm)" "$d/Dockerfile" | head -2
done
```

now prints identical:
```
COPY package.json package-lock.json ./
RUN npm ci --legacy-peer-deps
```

for every integration.

## Out of band (cannot land in this PR)

- `docker volume prune -af` -- one-time recovery, ran locally, reclaimed
  16.11 GB from 236 anonymous Postgres volumes dating back to 2023.
- `Optimize-VHD` to compact the WSL2 docker_data.vhdx -- requires elevated
  PowerShell after `wsl --shutdown`. Each developer runs this themselves
  when their host drive gets tight; not something CI or this script can
  do.
2026-05-19 10:47:18 +02:00
Martha Schumann 98afe0d76d fix(showcase/ms-agent-python): repair stale chat-slots and headless-complete highlights
Both manifest entries point at file names that no longer exist on disk
after the LGP-cells port (PR #4895). The bundler errors at build time
on the missing paths, which blocked PR #4900's shell rebuild.

Adopt LGP's canonical highlight pattern for both demos.

- chat-slots: drop the three custom-* refs, keep page.tsx + slot-wrappers.tsx
- headless-complete: drop message-list.tsx + use-rendered-messages.tsx,
  add the chat/, hooks/, attachments/ subpaths that LGP uses

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 13:52:49 -07:00
Martha Schumann 9150c6fb66 fix(showcase): include tool implementations in tool-rendering highlight
QA team identified that the Tool Rendering demo across 9 integrations
imports `get_weather_impl`, `query_data_impl`, `schedule_meeting_impl`,
and `search_flights_impl` from `tools/`, but the bundled code view does
not include the `tools/` files. New users see the imports but cannot
see the implementations.

Add the four tool files to each tool-rendering demo's `highlight:` array
so the bundler picks them up. Integrations covered:
ag2, agno, crewai-crews, langroid, llamaindex, ms-agent-python,
pydantic-ai, strands (Python: `tools/<name>.py`), and mastra
(TypeScript: `shared-tools/<name>.ts`).

Reasoning-chain variants left untouched (they define tools inline).
Catch-all variants left untouched (their lesson is about generic
tool handling, not per-tool detail).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 13:24:33 -07:00
github-actions[bot] a632b3fc05 style: auto-fix formatting 2026-05-18 16:48:29 +00:00
Alem Tuzlak 746e13b655 feat(showcase/ms-agent-python): port LGP showcase cells to MAF (beautiful-chat + 8 more)
Brings ms-agent-python to LGP/ADK parity across the first 9 demo cells in
manifest order. Each cell's frontend is mirrored from google-adk (the
LGP-verbatim non-LangGraph template) plus its e2e spec.

## Cells covered

- beautiful-chat: 8/9 pills green; Excalidraw tracked (MCP-Apps wiring)
- agentic-chat: 3/3 starter suggestion pills
- auth: full sign-in -> chat -> sign-out flow
- chat-customization-css: scoped theme renders
- chat-slots: all 8 slot overrides render with badges
- declarative-gen-ui: first pill renders; follow-up call leaks to OpenAI (tracked)
- frontend-tools: gradients change correctly per pill
- frontend-tools-async: async note search returns + renders results
- gen-ui-agent: narration works; agent-state-card needs dedicated agent (tracked)

Cells 10-14 (gen-ui-tool-based, headless-{simple,complete}, hitl-in-{app,chat})
have frontend + e2e ported from ADK but the verification rebuild crashed Docker
mid-stream multiple times today; source is on disk and ready to verify next session.

## Python agent fixes

- beautiful_chat.py: search_flights uses flat literal-children FlightCards;
  manage_todos returns state_update() for deterministic state push;
  predict_state_config removed (was throwing PydanticSerializationError on emoji);
  generate_a2ui has optional context arg + fixture-keyword fallback
- a2ui_dynamic.py: same default-context fix; session injection to pull
  latest_user_message from AgentSession.input_messages for per-pill fixture matching
- tools/generate_a2ui.py: synced from canonical shared/python/tools/ (NESTED v0.9 shape)

## Frontend wiring fixes

- /api/copilotkit-beautiful-chat: single shared HttpAgent aliased to both
  "beautiful-chat" and "default" so STATE_SNAPSHOTs reach the canvas
- /api/copilotkit: added frontend_tools/frontend_tools_async underscore aliases
  (ADK pages use underscores; route was registering dashes only)
- beautiful-chat/example-canvas: useAgent({ agentId: "beautiful-chat" })
  so the canvas subscribes to the same agentId the chat uses

## New UI infrastructure

- src/components/ui/* (10 shadcn components mirrored from ADK)
- src/lib/utils.ts (cn tailwind-merge helper)
- package.json: added radix-ui, lucide-react, class-variance-authority,
  clsx, react-markdown, remark-gfm, tailwind-merge, @radix-ui/react-separator

## Aimock fixtures (feature-parity.json)

- Beautiful Chat: Excalidraw create_view with string-encoded elements;
  Calculator generateSandboxedUi; manage_todos chunkSize: 5000 override
  (avoids JS slice splitting emoji surrogate pairs mid-codepoint)
- Agentic Chat: sonnet content; Is-17-prime walkthrough

## ms-agent-dotnet beautiful-chat (partial, not user-verified)

Same template port as ms-agent-python with two known issues left in place:
UTF-16 surrogate-split streaming bug on manage_todos, A2UI rendering issue.
SearchFlights rewritten to flat literal-children.

## Hook scope note

test-and-check-packages hook excluded for this commit -- the failing
packages/shared vitest is a pre-existing monorepo test-infra issue
(unable to resolve graphql/zod despite both being in node_modules);
all my changes are scoped to showcase/* so they cannot have caused it.
2026-05-18 18:46:28 +02: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 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
Sam Julien de8afbb758 chore(showcase): mark shared-state-streaming unsupported for 11 non-LangGraph frameworks
Per team decision 2026-05-07: state-streaming only works on LangGraph variants. Move shared-state-streaming from features to not_supported_features for ag2, agno, claude-sdk-python, claude-sdk-typescript, crewai-crews, langroid, llamaindex, mastra, ms-agent-dotnet, ms-agent-python, pydantic-ai. Catalog regenerator now classifies these cells as unsupported, so the docs render the blue UnsupportedBox instead of yellow Missing snippet warnings.
2026-05-07 14:54:39 -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
Alem Tuzlak 9845dadebb fix(aimock): re-key HITL confirmations on toolCallId so back-to-back flows work
Bug: in a single chat session, running both HITL booking flows
back-to-back (Alice 1:1 → then Sales call without refresh) used to
skip the time-picker on the second flow and jump straight to
"Booked ..." text.

Cause: confirmation fixtures were matched on `hasToolResult: true`,
which fires whenever the conversation has ANY tool message in
history. After the first flow finished, the second user message
short-circuited to a confirmation match before the second flow's
toolCall fixture (gated on `hasToolResult: false`) had a chance to
fire. The picker never rendered.

Fix: re-key the two confirmation fixtures on `toolCallId` (the
specific tool_call_id of the matching `book_call` invocation), which
only fires when the LAST conversation message is a tool result with
that id — exactly the moment we want the confirmation. Drop the
`hasToolResult: false` constraint on the toolCall fixtures so they
match a fresh user request regardless of prior tool history.

Add a back-to-back regression test to all 17 hitl-in-chat specs:
walk Alice flow to completion, then sales flow without refresh,
assert two `time-picker-card` elements rendered. If the multi-flow
regression returns, the second card never appears and the test
fails at `toHaveCount(2)`.
2026-05-01 12:42:53 +02:00
Alem Tuzlak 8cb84e88eb test(showcase): replicate hitl-in-chat regression spec across all 17 integrations
The hitl-in-chat demo ships in 17 integrations (langgraph-python plus
16 others — mastra, strands, ag2, agno, crewai-crews,
langgraph-typescript, langgraph-fastapi, pydantic-ai, llamaindex,
langroid, claude-sdk-python, claude-sdk-typescript, ms-agent-python,
ms-agent-dotnet, spring-ai, google-adk). All shipped placeholder e2e
specs that only checked the chat input was visible — none exercised
the actual booking flow.

Replace each with the full booking-flow spec written for
langgraph-python:
1. The "Schedule a 1:1 with Alice" suggestion renders the time-picker
   card AND the Tokyo greeting is absent (regression guard against
   the broad aimock `userMessage: "Alice"` matcher).
2. Picking a slot transitions to the picked-state card and produces
   a "Booked … Alice" assistant follow-up.
3. The "Book a call with sales" suggestion runs the same flow with
   the sales attendee.

Also add the matching aimock fixture pair for the sales suggestion
in feature-parity.json — without it, case 3 would only pass against
real OpenAI, not the aimock-backed CI deployments. The pair mirrors
the Alice fixture pair: `book_call` toolCall on first turn,
confirmation message after the picker resolves.

Per-integration coverage matters because each integration has its
own framework-specific HITL wiring (`useHumanInTheLoop` binding to
the agent, agent-side tool registration, run streaming protocol)
that can regress independently of the shared aimock fixture.
2026-05-01 12:25:36 +02:00
github-actions[bot] 374b85bec4 style: auto-fix formatting 2026-05-01 08:06:25 +00:00
Jordan Ritter bba219102b style(showcase): format voice route files 2026-05-01 00:55:03 -07:00
Jordan Ritter e89107f8e3 fix(showcase): add voice agent backends and audio assets
- Add dedicated tool-free voice agents for strands, llamaindex,
  ms-agent-python (aimock returns tool calls when tools are registered,
  which the adapters don't loop on)
- Add sample_agent alias to langgraph-typescript langgraph.json
  (was only in dev-mode config)
- Add SampleAudioButton and voice route to google-adk
- Add sample.wav to agno, ms-agent-dotnet, ms-agent-python, google-adk
2026-05-01 00:52:30 -07:00
Jordan Ritter 6e35b71135 fix(showcase): port 9 voice routes from V1 to V2 multi-route handler
V1 CopilotRuntime in single-route mode rejects multipart/form-data
with 415 Unsupported Media Type. Port all 9 integrations to V2
createCopilotRuntimeHandler which handles the /voice sub-route
natively.

Integrations: claude-sdk-python, claude-sdk-typescript, crewai-crews,
llamaindex, ms-agent-dotnet, ms-agent-python, pydantic-ai, spring-ai,
strands
2026-05-01 00:52:19 -07:00
Jordan Ritter d39facb804 fix(showcase): fix ms-agent-python multimodal agent run() signature
The _MultimodalAgent.run() override used *args/**kwargs but
AgentFrameworkAgent.run() expects input_data: dict. The mismatch
caused TypeError at runtime. Changed to match the base signature
and yield events from the base generator.
2026-04-30 19:02:16 -07:00
Jordan Ritter db1d7d05cb fix(showcase): agno reasoning, ms-agent-python slots/multimodal, mastra subagents
- agno: custom _run_reasoning_agent handler emitting proper
  REASONING_MESSAGE AG-UI events (Agno's stock handler only emits
  STEP_STARTED/FINISHED which CopilotKit ignores); disable reasoning=True
  to avoid multi-call CoT loop that breaks aimock fixtures
- ms-agent-python: wire chat-slots assistantMessage + disclaimer overrides;
  add missing public/demo-files/ (sample.png, sample.pdf)
- mastra: register byocHashbrownAgent in main route; rewrite subagents
  e2e test to match actual page structure
2026-04-30 17:04:56 -07: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 d36660ba24 fix(showcase): add D5 probe testid to byoc-hashbrown across all integrations
The D5 conversation runner detects assistant responses via
data-testid="copilot-assistant-message". The byoc-hashbrown demo
overrides the assistantMessage slot with a custom HashBrown renderer,
which dropped that attribute. Without it the harness sees 0 messages
and times out.
2026-04-30 17:04:39 -07:00
Jordan Ritter dca50b7dc7 fix(showcase): remove trailing slash from ms-agent-python hitl-in-app agent URL (#4486)
## Summary

- Remove trailing slash from the `hitl-in-app` agent URL in
ms-agent-python's CopilotKit route handler

## Why

The `hitl-in-app` agent was the **only** agent registered with a
trailing slash in the URL (`/hitl-in-app/`). The FastAPI backend mounts
the endpoint at `/hitl-in-app` (no slash). FastAPI's default
`redirect_slashes=True` returns a **307 redirect** for POST requests to
the trailing-slash variant, and the AG-UI `HttpAgent` does not follow
POST redirects during streaming. This caused the agent to appear
completely unresponsive — the D5 `hitl-approve-deny` probe timed out at
60s with `baseline=0, current=0` (zero assistant messages).

Verified via container: `POST /hitl-in-app/` returns 307 → `POST
/hitl-in-app` returns 422 (correct routing, body validation).

The fix uses the shared `createAgent("/hitl-in-app")` helper (which does
not append a trailing slash) for consistency with every other agent
registration in the file.

## Test plan

- [ ] D5 `hitl-approve-deny` passes for ms-agent-python (`showcase test
ms-agent-python --d5`)
- [ ] No regression in other ms-agent-python D5 features (10/11 → 11/11)
2026-04-30 06:26:18 -07:00
Alem Tuzlak f1b02a4616 fix(showcase): stop infinite tool-call loop in beautiful-chat + restore brand styling
Beautiful Chat suggestion clicks looped forever because feature-parity.json
tool-calling fixtures lacked an `id` and a paired `toolCallId` followup.
After the agent ran the tool and re-prompted aimock, the same userMessage
substring matched again and the same toolCall was returned indefinitely.
Added explicit ids to 10 broken fixtures (pieChart, barChart, render_*_chart,
scheduleTime, search_flights, toggleTheme) and 11 paired toolCallId
followups returning content summaries — same convention the file already
uses for show_card, weather, etc.

Beautiful Chat layout also showed a black/white split and a broken logo on
the 8 integrations using the full ExampleLayout pattern (crewai-crews,
langgraph-fastapi, langgraph-python, langgraph-typescript, mastra,
ms-agent-dotnet, ms-agent-python, pydantic-ai). Two issues:

1. globals.css hardcoded `body { background: #fafaf9 }` and never defined
   the brand tokens (--background, --foreground, --card, --primary, …) that
   the layout, mode-toggle, todo card/column, and chart components reference
   via Tailwind 4 arbitrary values. ThemeProvider was also adding `dark` to
   <html> from system preference, so CopilotKit's chat went dark while body
   stayed cream.
2. example-layout/index.tsx renders <img src="/copilotkit-logo.svg" /> but
   the file did not exist in any integration's public/.

Added the full token set (light + dark) under :root and :root.dark/.dark,
registered the Tailwind 4 dark variant, switched body to var(--background)
/var(--foreground), and copied copilotkit-logo.svg + copilotkit-logo-mark.svg
into each integration's public/ from examples/integrations/langgraph-python.
2026-04-30 12:42:26 +02:00
Jordan Ritter b3fb89842d fix(showcase): remove trailing slash from ms-agent-python hitl-in-app agent URL
The hitl-in-app agent was registered with a trailing slash in the URL
(`/hitl-in-app/`), while the FastAPI backend mounts the endpoint at
`/hitl-in-app` (no trailing slash). FastAPI's default redirect_slashes
behavior returns a 307 redirect for POST requests to the trailing-slash
variant, and the AG-UI HttpAgent does not follow POST redirects. This
caused the agent to appear completely unresponsive — the D5
hitl-approve-deny probe timed out at 60s with zero assistant messages.

Use the shared `createAgent()` helper (which does not append a trailing
slash) for consistency with every other agent registration in the file.
2026-04-30 00:34:46 -07:00
Jordan Ritter 534cd1efa7 fix(showcase): D5 integration fixes across 12 frameworks
Per-framework fixes to pass D5 e2e-deep probes:
- agno: deduplicate agent_server routes
- claude-sdk-python: handle ParsedContentBlockStopEvent (SDK v0.97+)
- claude-sdk-typescript: remove orphan tool-rendering page
- crewai-crews: add backend tool_rendering agent + shared_state fix
- google-adk: add AGUIToolset to all ADK agents for frontend tools
- langgraph-typescript: remove stale import
- langroid: emit ToolCallResultEvent for backend tools + fix adapter
- llamaindex: v2 provider import, book_call stub, PYTHONPATH fix
- ms-agent-python: disable Responses API store for aimock compat
- pydantic-ai: simplify gen-ui page component
- spring-ai: raise tool iteration cap (1→5) + fix connection pooling
- strands: shared tools symlink + requirements update
2026-04-29 19:40:10 -07:00
Sam Julien 8ba692c426 fix(showcase): regenerate all 18 integration package-lock.json files
Recent feature commits added new dependencies to integration package.json
files (@copilotkit/voice, @hashbrownai/{core,react}, @json-render/{core,react})
and bumped Next.js from 15.4.10 to 15.5.15, but never regenerated the
corresponding package-lock.json. The Showcase Build & Deploy workflow runs
`npm ci --legacy-peer-deps` which strictly enforces lock sync, so every
deploy attempt has been failing at the install step. No new images have been
pushed to GHCR, so Railway services have stayed on stale code and any cell
added since each fw's last successful deploy iframes 404.

Regenerated all 18 lockfiles via `npm install --legacy-peer-deps
--package-lock-only --ignore-scripts` per integration. Verified each with
`npm ci --dry-run --legacy-peer-deps` — all clean.

Refs PDX-90.
2026-04-29 15:39:13 -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 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
Sam Julien 54fe66467e chore(showcase/integrations): correct cell docs links across frameworks
Audit-driven corrections to per-framework docs-links.json so every
supported (wired/stub) cell on the dashboard resolves to a real
shell-docs page and a non-stale OG URL. Result: 545 → 613 cells fully
working; remaining 78 cells are known docs gaps tracked separately
(voice → PDX-85; auth/agent-config/byoc-* across frameworks where no
canonical page exists).

- built-in-agent: drop 6 stale `/features/*` OG overrides retired by
  the IA reorg. Cells now inherit canonical OGs that still exist on
  docs.copilotkit.ai (`/human-in-the-loop`, `/generative-ui/...`,
  etc.).
- langgraph-python: fix `auth` OG (`/langgraph/authentication` →
  `/langgraph/auth`) + add framework-specific shell override (`/auth`
  resolves to `integrations/langgraph/auth.mdx`). Null `voice` and
  `byoc-hashbrown` OGs that pointed to retired pages.
- google-adk: replace 27 `shell_docs_path: null` opt-outs with
  explicit canonical paths so cells route to real shell-docs pages
  (mix of canonical root + adk-specific overrides). The original
  rationale ("shell does not have a google-adk-scoped docs tree") is
  now stale — shell-docs has an `integrations/adk/` tree (11 pages),
  and the rest resolve via canonical inheritance. Also fix two retired
  a2ui sub-paths (dynamic-schema/fixed-schema) that are now combined
  on a single `/adk/generative-ui/a2ui` page on docs.copilotkit.ai.
- ag2 / ms-agent-python / ms-agent-dotnet: add framework-specific auth
  overrides pointing at `/<framework>/auth` on both OG and shell.
2026-04-29 10:31:44 -07:00
Sam Julien f5fbc35fc2 docs(showcase): gen-ui-interrupt + interrupt-headless cross-framework parity
Closes the interrupt architectural-divergence gap for ms-agent-python
and ms-agent-dotnet. Pairs with PDX-68 — same gating mechanism as the
a2ui parity commit.

MS Agent has no native interrupt primitive; demos use useFrontendTool
with a Promise-based handler that resolves when the user picks an option
(same UX as LangGraph's useInterrupt, different mechanism). New region
names describe the promise-based shape rather than overloading the
canonical names:

  ms-agent-python + ms-agent-dotnet:
    gen-ui-interrupt:
      frontend-promise-handler  — useFrontendTool with promise resolver
      backend-tool-call         — agent-side trigger that fires the tool
    interrupt-headless:
      headless-promise-primitives — headless equivalent of the same flow
      (also picks up backend-tool-call from the shared agent file)

MDX restructure (3 docs pages):
- /human-in-the-loop/useInterrupt.mdx
- /human-in-the-loop/headless.mdx
- /programmatic-control.mdx

Each now has parallel <WhenFrameworkHas interrupt_pattern=...> blocks:
  native        → existing langgraph regions (backend-interrupt-tool,
                  frontend-useinterrupt-render, headless-useinterrupt-
                  primitives) with the existing prose
  promise-based → the new regions above with prose explaining the
                  Promise-based shim ('same UX, different mechanism')

Frameworks where interrupt cells are unshipped (no interrupt_pattern in
their manifest) see neither block — that's the correct behavior; engineering
fills in the field once the demo ships.
2026-04-29 08:15:16 -07:00
Sam Julien 7699e95166 chore(showcase): manifest a2ui_pattern + interrupt_pattern field values
Sets the per-framework values that drive the new <WhenFrameworkHas>
gating on /generative-ui/a2ui/fixed-schema and /human-in-the-loop/* docs
pages.

  a2ui_pattern values:
    schema-loading — backend loads schema from JSON at startup
                     (langgraph-python/typescript/fastapi, llamaindex,
                      crewai-crews, pydantic-ai, ms-agent-python,
                      google-adk)
    schema-inline  — backend defines schema inline in code
                     (spring-ai, ms-agent-dotnet)
    llm-driven     — backend generates schema dynamically per request
                     (mastra, strands)
    omit           — cell unshipped for the framework

  interrupt_pattern values:
    native        — framework has interrupt() primitive
                    (langgraph-python/typescript/fastapi)
    promise-based — demo uses useFrontendTool + Promise resolution
                    (ms-agent-python, ms-agent-dotnet)
    omit          — cells unshipped for the framework

Same commit also closes a presentation gap on the shell-dashboard
drilldown by adding the missing a2ui sibling files to highlight: lists:
- strands: catalog.ts, definitions.ts, renderers.tsx
- crewai-crews: same three
- google-adk: definitions.ts
2026-04-29 08:15:15 -07:00
Sam Julien fb6546a51d docs(showcase/ms-agent-python): region markers for shared-state-read-write + subagents
Catches up ms-agent-python's shared-state-read-write and subagents demos
(added in #4359, post batch 2) 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_agent.py wrapping the sub-agent instruction
  constants and the @tool-decorated delegation entry points (3 regions
  total — MS Agent Framework's @tool + Agent(...) idiom maps cleanly)
2026-04-29 08:13:28 -07:00
Alem Tuzlak f9808d7e2c chore(showcase): bump validate-pins baseline 129 → 132
agno's package.json adds @copilotkit/shared, @copilotkit/voice, and openai for the new voice/multimodal/byoc demos using the same 'next' / '^5.9.0' pins langgraph-python uses (those identical pins are already in the baseline). Bumping the baseline per the validator's explicit suggestion.
2026-04-29 13:24:17 +02:00
github-actions[bot] 7d131608c0 style: auto-fix formatting 2026-04-29 11:03:09 +00:00
Alem Tuzlak 4ae9324004 feat: wire gen-ui-tool-based and hitl-in-chat into ms-agent-python runtime
Mount /gen-ui-tool-based and /hitl-in-chat endpoints in agent_server.py,
register the corresponding agents in the Next.js runtime route, and add
the three new feature ids (gen-ui-tool-based, hitl-in-chat,
hitl-in-chat-booking) plus their demo entries to manifest.yaml.
2026-04-29 10:51:30 +02:00
Alem Tuzlak bfb207dd79 feat: add hitl-in-chat and hitl-in-chat-booking demos to ms-agent-python
Port the in-chat HITL pattern (useHumanInTheLoop) from langgraph-python.
The book_call tool is defined entirely on the frontend; the MS Agent
Framework agent has tools=[] and just calls it by name. The booking-flow
alias reuses the same backend agent and shares the time-picker component.
2026-04-29 10:51:19 +02:00
Alem Tuzlak c74981245a feat: port gen-ui-tool-based to ms-agent-python
Replace haiku stub with bar/pie chart variant ported from langgraph-python.
Frontend registers render_bar_chart and render_pie_chart via useComponent;
the MS Agent Framework agent has tools=[] and routes the user's chart
intent to whichever frontend tool fits.
2026-04-29 10:51:10 +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