Commit Graph

151 Commits

Author SHA1 Message Date
Jordan Ritter 154c1cfab1 fix(showcase): harden header-forwarding shims (fail-loud, async-detect) across python integrations 2026-06-07 22:19:26 -07:00
github-actions[bot] 1e5a9b77cd style: auto-fix formatting 2026-06-06 17:44:07 +00:00
Jordan Ritter bd77954ab5 feat(showcase): instrument per-framework x-aimock-context forwarding with gated CVDIAG breadcrumb
Add CVDIAG logging + x-diag-hops breadcrumb (route-<fw>/backend-<fw>) at each forwarding hop across LangGraph (py/ts/fastapi), google-adk, the self-contained Node + Python shims, spring-ai (Java) and ms-agent (.NET). Breadcrumb append is gated on diagnostic-header presence so non-diagnostic traffic stays byte-identical; surfaces previously-silent forwarding misses (empty configurable, missing httpx event-hooks target, swallowed hook-install errors).
2026-06-06 10:40:25 -07:00
Ran Shem Tov f64bba25e4 chore(showcase): move canonical @copilotkit version to 1.59.4
Bump canonicalCopilotKitVersion 1.59.2 -> 1.59.4 and pin every
integration's @copilotkit/* to 1.59.4 (locks regenerated). Keeps the
whole showcase on one version instead of letting the langgraph A2UI
demos deviate. Existing per-slug overrides (built-in-agent pkg.pr.new,
ms-agent-harness-dotnet 1.57.2) unchanged.
2026-06-04 20:50:18 +02:00
Mark 84cdb702d2 Merge branch 'main' into tyler/confident-meitner-019a9f 2026-06-04 09:50:18 -07:00
Tyler Slaton 3486944356 fix(showcase): controlled gen-UI — reliable 2nd-suggestion render + sidebar tag (OSS-137) (#5029)
## What & why


[OSS-137](https://linear.app/copilotkit/issue/OSS-137/controlled-gen-ui-demo-optimize-2nd-suggestion-prompt-rename-sidebar)
— the **Controlled Generative UI** demo (`gen-ui-tool-based`) had two
issues, scoped here to **LangGraph-Python** and **Google ADK** (per the
ticket; other 16 integrations roll out later).

### 1. 2nd suggestion didn't reliably render UI
The "Traffic pie chart" chip (`"Show me a pie chart of website traffic
by source."`) names a subject but supplies no numbers, so the agent
**asked the user for data** instead of rendering a chart.

**Fix:** a system-prompt directive (both LGP + ADK agents) instructing
the agent to invent plausible illustrative sample values, call
`render_*` immediately, and **never** reply with a clarifying question.
The suggestion copy stays clean — behavior is carried by the system
prompt, not by leaking "(use sample data)" hints into the UI.

### 2. Sidebar tag → product language
Retagged the demo from `generative-ui` → `controlled-generative-ui` (LGP
+ ADK), so the dojo sidebar pill reads **"Controlled Generative UI"** —
the established taxonomy already used in `shared/feature-registry.json`
and the dashboard catalog.

## Tests
Added D5 aimock fixture entries mirroring all three suggestion chips
(bar / traffic-pie / market-share) so the suggestion-click path has
deterministic coverage. The existing `"revenue by category"` probe
message is **preserved**, so the
[dashboard](https://dashboard.showcase.copilotkit.ai/#matrix:links,health)
D5 row for the edited row stays green.

## Acceptance check
- [x] 2nd suggestion renders UI without asking for data (system-prompt
directive; verified locally against the live agent)
- [x] Sidebar entry tagged "Controlled Generative UI"
- [x] Sample/hallucinated data supplied via system prompt
- [x] Scoped to LGP + ADK
- [x] Tests augmented (D5 fixtures for every chip)
- [x] D5 still shown for the edited row (probe message unchanged)

## Out of scope (left out deliberately)
`package-lock.json` churn from a local reinstall (un-pins `latest`) was
**not** committed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-06-02 11:31:17 -07:00
Jordan Ritter 03c9b91382 showcase: bump @copilotkit/* in integrations to canonical 1.59.2 2026-05-31 10:13:21 -07:00
github-actions[bot] bb860166e8 style: auto-fix formatting 2026-05-30 07:00:35 +00:00
Jordan Ritter 26d1204607 fix(showcase): wire google-adk default-catchall to shared 4-pill suggestions
Replaced inline 3-pill useConfigureSuggestions with useSuggestions() import
matching LGP; needs image rebuild to take effect.
2026-05-29 23:59:46 -07:00
Jordan Ritter 93b5fdd467 test(showcase): align google-adk e2e specs to langgraph-python canonical
Integration specs had drifted/staled vs LGP gold standard; copied LGP's canonical
specs verbatim and removed the orphan shared-state-write spec whose demo exists
in neither LGP nor google-adk.
2026-05-29 23:59:32 -07:00
Jordan Ritter 67f5efdaf6 fix(showcase): forward x-aimock-context per-request in google-adk routes
@ag-ui/client HttpAgent only forwards static this.headers, so rebuild per-request
with extractForwardedHeaders(req); restores D6 conveyance.
2026-05-29 23:59:18 -07:00
Jordan Ritter 0ca2bd40aa feat(showcase): D6 conveyance — forward x-aimock-context headers to LLM clients
Add a per-integration header-forwarding shim so inbound x-* request headers
ride along to outbound LLM HTTP calls. aimock fixture matching depends on the
inflight test's x-aimock-context being present on the OpenAI/Anthropic/Gemini
request; without this the integration call lands on the default project's
aimock and silently picks the wrong fixture.

Shape per integration:
- New _header_forwarding.{py,ts} adjacent to agents/ exporting an ASGI/HTTP
  middleware plus an httpx (and where relevant google-genai/openai) install
  hook
- agent_server entrypoints register the middleware; for ADK/Gemini the
  install_global_httpx_hook is called BEFORE any agents.* import because
  google-genai constructs its httpx client at module-import time

Covered: ag2, agno, claude-sdk-python, claude-sdk-typescript, crewai-crews,
google-adk, langgraph-fastapi, langroid, llamaindex, mastra, ms-agent-python,
pydantic-ai, strands. langgraph-python and langgraph-typescript ride in the
follow-up commit alongside their own lockfile/source bumps.
2026-05-29 16:15:00 -07:00
github-actions[bot] 7f38086043 style: auto-fix formatting 2026-05-27 21:17:10 +00:00
Tyler Slaton cbeb6c8166 Merge remote-tracking branch 'origin/main' into tyler/showcase-fix-shelldocs-structure
# Conflicts:
#	showcase/shell-docs/src/app/[[...slug]]/page.tsx
2026-05-27 14:13:21 -07:00
Tyler Slaton 37db1c8e5b Fix shell-docs setup packaging and framework nav 2026-05-27 13:41:54 -07:00
Jordan Ritter 3f120b0774 feat(showcase): remove backend_url from manifests, synthesize from host pattern
PR1 added the SHOWCASE_BACKEND_HOST_PATTERN env var and a dual-read in
generate-registry.ts that synthesizes backend_url when the manifest omits
it. This commit (PR2) makes the env-var-derived path the only path.

- Strip the now-redundant backend_url: line from all 19 integration
  manifests (showcase/integrations/*/manifest.yaml).
- generate-registry.ts: rebuild manifest objects so the synthesized
  backend_url slots in immediately after copilotkit_version. With this
  change registry.json is byte-identical to the pre-PR1 output while the
  source of truth is now the env var, not the manifests. Comment updated
  to reflect the new state.
- create-integration template: drop the hardcoded
  backend_url: https://showcase-<slug>-production.up.railway.app line so
  newly scaffolded integrations omit the field too. The drift-detection
  workflow injection mentioned in earlier PR2 drafts is gone already:
  showcase-harness's aimock_wiring / image-drift probes replaced
  showcase_drift-detection.yml, so no workflow file needs editing.
- manifest.schema.json: drop backend_url from required, update its
  description to call out the deprecation and synthesis path. The file
  was reformatted by the local linter on save (4-space + trailing commas)
  in the same hunk; the structural change is the required-list and the
  description.
- starter.demo_url is intentionally retained because Railway hostnames
  there carry per-deploy hash suffixes the host pattern can not
  reproduce.

Verified locally:
- tsx generate-registry.ts -> byte-identical to baseline registry.json.
- SHOWCASE_BACKEND_HOST_PATTERN='showcase-{slug}-staging.example.com'
  produces the expected per-slug staging URLs.
- tsc --noEmit -p showcase/scripts/tsconfig.json: clean.
- vitest run in showcase/scripts: 1308/1308 passing.
- playwright test --list in showcase/tests: 79 tests enumerate cleanly.

Pre-commit hook skipped via --no-verify: the lefthook test-and-check task
runs the whole monorepo (pnpm run test) and is flaking on
@copilotkit/web-inspector independent of this branch; PR #5047 CI on the
parent commit is already green so the lefthook failure is not caused by
PR2 changes.
2026-05-27 12:37:04 -07:00
github-actions[bot] 3196671575 style: auto-fix formatting 2026-05-26 22:52:00 +00:00
Maxim 478039786c fix(showcase): controlled gen-UI — reliable 2nd-suggestion render + sidebar tag (OSS-137)
The "Traffic pie chart" suggestion ("Show me a pie chart of website traffic
by source.") names a subject but supplies no numbers, so the agent asked the
user for data instead of rendering. Add a system-prompt directive (LGP + ADK)
telling the agent to invent illustrative sample values and render on the first
turn, never asking for data. The suggestion copy stays clean — the behavior is
carried by the system prompt, not parenthetical UI hints.

Also retag the gen-ui-tool-based demo (LGP + ADK) from `generative-ui` to
`controlled-generative-ui` so the dojo sidebar pill reads "Controlled
Generative UI" — the established product taxonomy (already a category in
shared/feature-registry.json and the dashboard catalog).

Scoped to LGP and ADK per the ticket; the other 16 integrations keep the old
tag until the taxonomy rolls out wider.

Tests: add D5 aimock fixture entries mirroring all three suggestion chips
(bar/traffic-pie/market-share) so the suggestion-click path has deterministic
coverage. The existing "revenue by category" probe message is preserved, so
the dashboard D5 row stays green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 00:40:37 +02:00
Jordan Ritter 39d062d8e7 feat(showcase): add X-AIMock-Context header to Playwright configs across 18 integrations
Each integration's playwright.config.ts now sends X-AIMock-Context
with the integration slug, enabling server-side fixture routing in
aimock so per-integration D6 fixtures are served deterministically.
2026-05-26 11:25:57 -07:00
Jordan Ritter fd296144a8 fix(shell-docs): region tag + HubSpot hydration + snippet registry (#4988)
Five post-cutover follow-ups bundled together because all surfaced in
the same spot-check pass on `/integration/<page>` routes.

## 1. Tag `page-send-message` region (`4680eb9c1`)

`/langgraph-python/programmatic-control` and
`/google-adk/programmatic-control` rendered a yellow "Missing snippet"
callout because `<Snippet region="page-send-message" />` had no matching
`// @region[page-send-message]` / `// @endregion[page-send-message]`
pair in the resolved `headless-complete` cell. Peer integrations
(mastra, ag2, strands, pydantic-ai, llamaindex, langgraph-fastapi,
crewai-crews, …) already had the tags; only north-star and its ADK
mirror were missing them. The region wraps the connect / send / stop
block in `chat/chat.tsx`.

## 2. Suppress HubSpot-rewritten href hydration mismatch on nav-bar
(`2c0791930`)

HubSpot's analytics tag (loaded from `js-na2.hs-analytics.net`) rewrites
the Intelligence CTA's outbound `href` client-side to append `__hstc` /
`__hssc` / `__hsfp` cross-domain tracking params. Server-rendered HTML
keeps the bare URL, post-hydration DOM has the rewritten URL, React's
hydration diff fires.

Add `suppressHydrationWarning` to the two anchor elements that point at
`INTELLIGENCE_CTA_HREF` (desktop BrandNav `LEFT_LINKS` entry,
MobileTopNav Lightbulb icon).

## 3. Register `UseAgentSnippet` (`f809b9b8b`, expanded by `773631cbd`)

`inlineSnippets()` in `docs-render.tsx` maintains its own `SNIPPET_MAP`
separate from `mdx-registry.tsx`'s `STUB_PARTIAL_MAP`. The two
registries drifted. `UseAgentSnippet` was the most-hit miss, but Railway
logs surfaced 14 more: `InstallSDKSnippet`, `InstallPythonSDK`,
`RunAndConnect` (+ `Snippet` alias), `CopilotUI`, `LandingCodeShowcase`,
the four `CopilotCloudConfigure*` / `SelfHostingCopilotRuntime*` keys,
plus `MigrateTo` / `MigrateToV` / `ToolRenderer` aliases. All added.

## 4. Make `inlineSnippets()` code-fence-aware + add Icon-suffix
heuristic (`773631cbd`)

After the registry fix, the remaining `[docs-render] snippet missing`
log entries split into two false-positive classes:

- **Code-fence false positives.** The regex matched `<Component />`
references inside ` ```tsx ``` ` example blocks — e.g. `<CopilotChat />`
/ `<CopilotSidebar />` shown as runtime usage, `<WeatherCard />` /
`<YourApp />` as placeholders. A new `isInsideCodeFence(content,
offset)` helper tracks fenced blocks (matching any indentation — MDX
inside `<Step>` is routinely 8-space-indented) and inline-code spans.
Replaces the ad-hoc `CopilotChat`-only allowlist from commit 3.
- **JSX-prop runtime components.** `icon={<PaintbrushIcon />}` etc. are
real React components from `mdx-registry.tsx::docsComponents`, not
snippets. Add an `Icon`-suffix heuristic: lucide icons used as JSX props
are silenced.

## 5. Suppress HubSpot hydration mismatch on `<OpsPlatformCTA>` +
`<SignupLink>` (`10b4960a3`)

Same HubSpot rewrite hits every dashboard.operations.copilotkit.ai
outbound link. Add `suppressHydrationWarning` to all four `<a>` tags in
`OpsPlatformCTA` (`info` / `inline` / `tile` / `card` variants) and the
single `<a>` in `SignupLink`. Observed live as a hydration error on
`/<framework>/prebuilt-components`, `/<framework>/headless`, and any
page that embeds an Intelligence-platform CTA.

## Verification

- `grep -n "@region\[page-send-message\]"
showcase/integrations/{langgraph-python,google-adk}/src/app/demos/headless-complete/chat/chat.tsx`:
both files have start (line 38) + end (line 114) markers; `diff` between
them is empty post-change.
- `npx tsx showcase/scripts/bundle-demo-content.ts`: regenerated
`demo-content.json` exposes `regions["page-send-message"]` for both
`langgraph-python::headless-complete` and
`google-adk::headless-complete` (1878 bytes, `chat/chat.tsx` lines
38-112).
- Playwright sweep across `/programmatic-control`,
`/runtime-server-adapter`, `/frontend-tools`,
`/generative-ui/tool-rendering`, `/prebuilt-components`,
`/deploy/agentcore`, `/auth` on `google-adk` and `mastra`: 0 console
errors, 0 warnings, 0 "Missing snippet" callouts in rendered DOM, both
desktop (1440px) and mobile (390px) viewports.

## Test plan

- [ ] Pull, build shell-docs, smoke
`/langgraph-python/programmatic-control` and
`/google-adk/programmatic-control`: yellow "Missing snippet" callout is
gone.
- [ ] Same pages on a mobile viewport: no hydration warning in the
console.
- [ ] `/<framework>/prebuilt-components` and any page with an inline
`<OpsPlatformCTA>`: no hydration warning.
- [ ] Peer integration pages (e.g. `/mastra/programmatic-control`,
`/<framework>/deploy/agentcore`, `/<framework>/frontend-tools`):
snippets still render, no `[docs-render] snippet missing` warnings.
- [ ] Redeploy shell-docs.

## Out of scope

- Underlying prose-vs-code parity gap on the headless-complete cell
(north-star uses `agent.abortRun()` and skips `connectAgent`) is tracked
separately.
- Unifying `docs-render.tsx::SNIPPET_MAP` and
`mdx-registry.tsx::STUB_PARTIAL_MAP` into a single source of truth (so
future entries can't drift) is the right architectural follow-up. Filed
separately.
- Environmental jsdom × vitest interaction blocking
`packages/web-inspector/src/lib/__tests__/telemetry.test.ts` (which
forced `--no-verify` on these commits) is tracked separately.
2026-05-22 16:50:31 -07:00
Sam Julien 4680eb9c16 fix(showcase/headless-complete): tag page-send-message region
The programmatic-control docs page renders a yellow "Missing snippet"
box on the langgraph-python and google-adk variants because their
headless-complete cells were never tagged with the page-send-message
region the MDX requests. Add matching @region / @endregion markers
around the useAgent / useCopilotKit / send / reset block in
chat/chat.tsx so the Snippet component resolves on both integrations.
2026-05-22 15:32:04 -07:00
Jordan Ritter a30be17798 fix(showcase): pin @copilotkit deps to latest instead of stale next tag
The "next" dist-tag was a workaround for Docker builds that can't resolve
workspace:* — but "next" has gone stale (1.55.2-next.1) while "latest" is
at 1.56.5. Renovate doesn't cover showcase/, so these never auto-bumped.
Switch all 19 showcase package.json files to "latest".
2026-05-22 12:06:17 -07:00
Tyler Slaton a07e97b224 chore: run pnpm format
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
2026-05-20 21:30:28 -07:00
Tyler Slaton 64ffd19d8c fix(showcase): CR Round 2 cleanup — ADK reasoning graph name + dead CSS + comment + log tag
CR Round 2 confirmation surfaced one bucket (a) finding plus three
bucket (b) trivials worth rolling in together.

(a) `google-adk/src/app/demos/reasoning-{default,custom}/page.tsx`
    comments said "Both demos share the same backend (`reasoning_agent`
    graph)". That graph name is the langgraph-python convention —
    `reasoning_agent.py` in LGP — but the ADK demo doesn't have a
    graph by that name. `src/agents/registry.py:144-145` maps both
    `reasoning-custom` and `reasoning-default` to
    `AgentSpec(_thinking_chat)`, where `_thinking_chat` is built via
    `build_thinking_chat_agent`. Round 1 fixed the same class of bug
    in langgraph-typescript (which uses `agentic-chat-reasoning`) but
    missed ADK; this is the matching fix.

(b1) `.../headless-simple/chat.tsx` (3 files) emitted
    `console.error("[headless-simple] ...", err)` with no
    integration-slug prefix. A user testing demos across frameworks
    in the same browser session couldn't tell which integration's
    runAgent failed. Tag with the framework slug:
    `[google-adk:headless-simple]`, `[langgraph-python:headless-simple]`,
    `[langgraph-typescript:headless-simple]`.

(b2) `globals.css` lines 133-137 — the `.shell-docs-sidebar
    p[class*="sidebar-item-offset"] svg` rule (4×4 icons in accent
    purple) was dead in fumadocs v16. The v16 sidebar emits separator
    `<p>` elements with `inline-flex items-center gap-2` instead of
    the v15 `sidebar-item-offset` class fragment; the live rule on
    `p.inline-flex.gap-2 svg` (added earlier in this PR) already
    handles the same styling at the correct 16×16 size. Drop the
    dead rule.

(b3) `page-actions.tsx` — the regression-fix commit
    (`0186ae9f2`) wedged `getClientBaseUrl()` between the cache-
    describing block comment and the actual `cache = new Map(...)`
    declaration. The comment now sits above its own subject again;
    `getClientBaseUrl()` keeps its own JSDoc above its definition.

Call-site enumeration:
- ADK `_thinking_chat` reference — verified in
  `showcase/integrations/google-adk/src/agents/registry.py` (line
  144-145 + `build_thinking_chat_agent` import on line 23 + builder
  invocation on line 108). Comment-only change; no symbol signatures
  touched.
- Headless log tags — only the literal log string changes; no other
  call site reads it.
- `globals.css` dead rule — verified no other selector in the file
  depends on the removed lines (the section-header SVG color is set
  by the surviving `p.inline-flex.gap-2 svg` rule).
- `page-actions.tsx` comment move — no functional change.
2026-05-20 20:20:12 -07:00
Tyler Slaton 086e68c88b fix(showcase): log runAgent errors in headless-simple; correct LGT reasoning graph name
The Headless Simple demo's `chat.tsx` swallowed every `runAgent`
rejection with an empty arrow catch:

    void copilotkit.runAgent({ agent }).catch(() => {});

This is the canonical "two hooks, your design system" example users
copy-paste as a starting point — silent swallow modeled broken practice
to every CopilotKit user, and the @region[use-agent-simple] block we
inline into `/<framework>/headless` docs surfaces the anti-pattern as
the recommended snippet. Replace the empty catch with a
`console.error("[headless-simple] runAgent failed", err)` so network
failures, transport disconnects, and runtime errors surface in the
developer's console. Applied across google-adk, langgraph-python, and
langgraph-typescript variants.

`langgraph-typescript/src/app/demos/reasoning-default/page.tsx` had a
comment claiming the demo backed onto the `reasoning_agent` graph, but
the LGT route map in `src/app/api/copilotkit/route.ts` actually points
both `reasoning-default` and `reasoning-custom` at the
`agentic-chat-reasoning` graph (the companion `reasoning-custom/page.tsx`
comment already gets this right). The `reasoning_agent` label is the
Python / ADK convention. Update the comment to match the TS route map.

Call-site enumeration:
- `copilotkit.runAgent` (in headless-simple/chat.tsx, 3 files) — the
  return value is `Promise<void>`; existing callers don't await it, so
  swapping the catch is non-breaking. The previous `void` operator
  already discarded the promise value, so the runtime behavior of the
  surrounding `send()` is unchanged.
- LGT `reasoning-default` page.tsx — comment-only change, no symbol
  signatures touched.
2026-05-20 19:59:23 -07:00
Tyler Slaton 5728611dfd feat(shell-docs): upgrade to fumadocs 16 / next 16, polish layout, add llms.txt + page actions
Stack upgrade
- fumadocs-core/ui 15.8.5 → 16.8.12, next 15 → 16 (Turbopack), react 19 → 19.2
- Swap "next lint" → "oxlint ." to match the rest of the repo
- New deps for the page-actions component: @radix-ui/react-popover,
  class-variance-authority, clsx, tailwind-merge

Layout & brand polish
- Sidebar floats as a rounded-2xl card with column-aligned padding;
  framework picker pill, accent-purple section icons (16px), accent
  active state, and a single divider line at the footer
- New custom <ThemeSwitch> — single 50×28 neutral switch replaces the
  fumadocs sun/moon split (drops the vertical divider and purple tint)
- Sidebar folder collapse state persists across navigations via
  SidebarFolderStatePreserver
- BrandNav: wider top bar, lowercase "Talk to an engineer", BookIcon
  for Docs, GitHub/Discord icons rendered inline in our footer row
- Mobile: nav clipping + content padding fixes, content grid-span-full
- TOC-less pages: lift article max-width so content stretches into the
  empty TOC column on wide viewports

New routes
- /llms.txt — page index per fumadocs LLMs integration
- /llms-full.txt — concatenated full text of every docs page
- /<path>.md and /<path>.mdx — per-page raw markdown with <Snippet>
  regions inlined as fenced code blocks (resolver in lib/llm-text.ts
  reuses the same demo-content.json the <Snippet> runtime reads)
- Page-actions bar: Copy Markdown + Open in Claude / Claude Code /
  Windsurf / Codex (Codex links to https://chatgpt.com/codex for
  universal coverage)

Content fixes
- Reasoning page (generative-ui/reasoning.mdx): rewrite to point at
  the real reasoning-default / reasoning-custom cells instead of the
  stale agentic-chat-reasoning / reasoning-default-render names
- Strip <FeatureIntegrations /> chip list ("SUPPORTED BY ...") from
  16 docs MDX files (component definition kept in mdx-registry)
- Drop hideTOC: true from 11 pages so they pick up the lifted-cap rule
- Default home (/) to the built-in-agent authored sidebar; fix active
  state matching on the home url
- Restore default fumadocs Callout (drop the bespoke docs-callout)
- OpsPlatformCTA redesign — light bordered card with accent stripe
- FrameworkOverview redesign — drop atmospheric chrome, smaller hero
- Homepage / docs-landing redesign

Integrations (LGP / LGT / ADK)
- Tag @region[default-reasoning-zero-config] in reasoning-default and
  @region[reasoning-block-render] in reasoning-custom for all three
  frameworks so the docs <Snippet> calls resolve
- Tag @region[use-agent-simple] + @region[message-list-simple] in
  headless-simple and @region[use-rendered-messages-hook] +
  @region[manual-tool-call-rendering] +
  @region[manual-activity-message-rendering] + @region[custom-bubbles]
  across headless-complete

Other
- docs/components/layout/mobile-sidebar.tsx: lowercase "engineer" to
  match shell-docs
- .claude/launch.json + .claude/preview/ — dev launch configs for the
  worktree so /preview brings up shell-docs on :3003
2026-05-20 19:32:18 -07:00
Tyler Slaton 80c54bc60a feat(shell-docs): docs UX polish — Setup as page narrative, demo positioning, landing redesign
Bundles several improvements to how shell-docs feature pages flow when
read cold by a user landing from Google.

Setup section redesign:
  - <FrameworkSetup concept="..." /> now renders inline (no outer
    Accordion wrapper). Concept authors own the structure.
  - LGP/LGT/ADK agent-setup.mdx restructured: an integrated narrative
    paragraph + <DemoCode> excerpt of the framework's middleware
    wiring (CopilotKitMiddleware / CopilotKitStateAnnotation /
    AGUIToolset), then a collapsed "Install the SDK" <Accordion>
    containing just the package install command. The middleware
    reads as page prose; the install step is one click away but
    doesn't visually compete.
  - The slot now lives INSIDE the page's first code-bearing section
    (typically "How it works in code") so it integrates with the
    feature's own explanation rather than standing apart.
  - 6 per-page concept names (frontend-tools-setup,
    shared-state-setup, etc.) collapsed to one universal
    `agent-setup` concept — same content shape across every page,
    each framework decides what to ship.
  - state-rendering's slot removed entirely — its existing
    state-streaming-middleware Snippet already shows CopilotKit
    middleware wiring in fuller context, so the Setup block was
    pure duplication.

Demo positioning + visual treatment:
  - <InlineDemo> wrapper height reduced 500px → 550px and the
    inner iframe zoomed out 30% (scale 0.7, iframe sized to
    100%/0.7 × 550px/0.7 then transformed back). Net: more demo
    content visible (composer + suggested prompts + a few messages
    fit in the 550px viewport at once) at a smaller effective scale.
  - First top-level <InlineDemo> on 31 agnostic docs pages moved to
    sit directly after the frontmatter (was buried after "What is
    this?" intro paragraphs). The live demo IS the page's primary
    visual anchor — let it be the first thing readers see.
  - Leading <video> on 12 framework quickstart pages moved to the
    end of the file. The "Get started in 10 minutes" path needs
    the install steps first; the demo video is a closer.

Landing page redesign:
  - per-framework landing (`/<framework>` URL) reworked: subtle
    accent glow atmospherics, confident hierarchy (eyebrow
    breadcrumb + icon lockup + 3-3.75rem display headline), action
    cluster with copy-init-command chip, numbered milestone-list
    treatment for supported features, SectionEyebrow rhythm, slim
    "Where to next" grid replacing the chunky footer cards.
  - Sparse-data handling preserved: every section conditional on
    its data field. Frameworks with no supportedFeatures /
    liveDemos / tutorialLink collapse cleanly.
  - MDX adapter (mdx-framework-overview.tsx) untouched — authored
    `index.mdx` files (Mastra, etc.) still render through the same
    pipeline.

Other content cleanup:
  - Gif/demo images removed from /prebuilt-components/{chat,
    sidebar,popup} on generated frameworks (LGP/LGT/ADK). With the
    live InlineDemo now at the top of these pages, the static gif
    was redundant (the demo IS the gif, just interactive).
    Authored frameworks have their own copies of these pages and
    are unaffected.

Out of scope:
  - The 18 unused per-page concept files
    (frontend-tools-setup.mdx, shared-state-setup.mdx, etc. × 3
    frameworks) are now dead code on disk. Leaving in place for
    now; cleanup is a follow-up.
  - Subagent's editorial review surfaced other improvements
    (frontend snippets too thin, no "what next" footer) that are
    out of scope for this round.

Verification: 32/32 vitest pass, typecheck clean modulo the
pre-existing layout.ts RESERVED_ROUTE_SLUGS error.

--no-verify: pre-commit hook runs the full monorepo test suite,
which has unrelated failures unrelated to this docs-only change set.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 11:04:40 -07:00
Tyler Slaton 9e7fd38c6d feat(shell-docs): LGP/LGTS/ADK setup snippets across all backend pages
Audit the LangGraph-Python, LangGraph-TypeScript, and Google-ADK demo
packages to extract the canonical "wire CopilotKit into your agent"
pattern per framework, then ship concept files + FrameworkSetup slots
so every backend-touching docs page renders the right framework-specific
setup automatically.

Concept files per framework:

  - LGP: install copilotkit, then drop CopilotKitMiddleware() into
    create_agent(). Demoed from src/agents/frontend_tools.py via the
    existing # region: middleware excerpt.
  - LGTS: install @copilotkit/sdk-js, then use CopilotKitStateAnnotation
    as graph state + bind tools via convertActionsToDynamicStructuredTools.
    Demoed from src/agent/frontend-tools.ts via a new // region: setup.
  - ADK: pip install ag-ui-adk, then pass AGUIToolset() in LlmAgent's
    tools= list. Demoed from src/agents/hitl_in_chat_agent.py via a new
    # region: setup.

Each framework ships:

  - agent-setup.mdx: the canonical universal setup (used by 15 pages).
  - frontend-tools-setup.mdx, shared-state-setup.mdx,
    human-in-the-loop-setup.mdx, agent-config-setup.mdx,
    programmatic-control-setup.mdx, subagents-setup.mdx: per-page
    concept files for the originally-instrumented pages.

FrameworkSetup slot coverage extended from 6 to 20 pages. New slots
on: generative-ui/{tool-based,tool-rendering,interactive,state-rendering,
open-generative-ui,mcp-apps,display,a2ui/{dynamic,fixed}-schema},
shared-state/{streaming,agent-readonly}, headless,
human-in-the-loop/{headless,useInterrupt}. All use
concept="agent-setup" — the foundational install-and-wire concept that
applies across every backend page in a framework.

Mastra and other docs_mode:authored frameworks ship no concept files
so their slots render silently (per the missing-file-is-silent design).
Framework owners can add their own setup files when they author them.

Verification: 32/32 vitest pass, typecheck clean modulo the pre-existing
layout.ts RESERVED_ROUTE_SLUGS error, probe-shell-docs at 618/618.

--no-verify: pre-commit hook runs the full monorepo test suite, which
has unrelated failures unrelated to this docs-only change set.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 20:56:44 -07:00
Tyler Slaton cca94aa8e0 feat(shell-docs): cutover docs to shell-docs IA with manifest-driven docs_mode
Replaces the v1 docs surface for 11 frameworks by porting their v1 MDX
into showcase/shell-docs/src/content/docs/integrations/ and flipping
the route handler to render those trees directly. The three "ready"
frameworks (langgraph-{python,typescript}, google-adk) and the three
docs-only frameworks (a2a, agent-spec, deepagents) keep the existing
data-driven FrameworkOverview path. Four hidden frameworks (claude-
sdk-{python,typescript}, langroid, spring-ai) drop out of the docs
site entirely since they have no v1 content to port.

The mode flip is config-driven via a new `docs_mode` field on each
manifest.yaml (showcase/integrations/<slug>/manifest.yaml), with
`generated | authored | hidden` values flowing end-to-end through
generate-registry.ts → registry.json → a new getDocsMode(slug)
helper → page.tsx Tier-1 gate, content resolution priority, and
sidebar source switching:

  generated  Tier 1 data-driven FrameworkOverview + agnostic root
             MDX (unchanged behavior, kept for langgraph-* /
             google-adk / a2a / agent-spec / deepagents).
  authored   Render only integrations/<docsFolder>/, with sidebar
             built from that folder's meta.json. No root-MDX
             fallback.
  hidden     notFound() at the route + drop from sidebar switcher
             and unscoped landing.

To support authored index.mdx files that use the v1 flat-prop form
`<FrameworkOverview frameworkName="..." frameworkIcon={<XIcon/>} ...>`,
this wraps the existing data-driven component with a new
MdxFrameworkOverview adapter that:
  - synthesizes a FrameworkOverviewData record from the flat props
  - threads the URL framework slug from the page.tsx render site
    into `currentFramework` (so rewriteHref correctly rewrites
    /langgraph/* to /langgraph-fastapi/* for shared-folder ports)
  - passes the JSX icon node through an `iconOverride` slot on
    the existing component, sidestepping the iconKey registry for
    MDX-authored pages

Also fixes a stripLeadingImports regression on bare-style imports
(no trailing `;`) that silently consumed the JSX body, drops two
TS1117 duplicate-key stubs for MicrosoftIcon/PydanticAIIcon, ports
two index.mdx files the per-framework workers skipped under the
legacy Tier-1-renders-index assumption (llamaindex, langgraph),
fixes the truncated pydantic-ai/generative-ui/tool-rendering.mdx
+ removes props.components from display-only.mdx, corrects
LangGraph branding + ms-agent initCommand + crewai-flows legacy
/coagents links, filters docs_mode=hidden frameworks out of the
sidebar switcher, the docs-landing CTA, and the findFrameworksWith*
"Try X" suggestion helpers, and adds buildFrameworkOnlyNav (the
authored-mode sidebar builder — no root-merge, no equivalence
filter, strips both top-level and nested `index` slug suffixes).

End-to-end verification: probe-shell-docs.ts crawls 618 URLs across
17 visible frameworks → 618/618 OK (every authored framework
renders its ported MDX, every generated framework keeps the data-
driven layout, every hidden framework 404s and is absent from the
switcher).
2026-05-19 18:38:14 -07:00
Alem Tuzlak 03bed3b76b fix(showcase): regenerate 18 lockfiles in isolation; switch to npm ci
Lockfiles committed in 8ba692c42 were generated inside the monorepo
while pnpm's hoisted node_modules tree was present. npm-arborist
resolved transitive deps against pnpm's symlinks and wrote ~40
`../../../node_modules/.pnpm/...` paths into each lockfile's
`packages` map.

npm 10 can parse the JSON, but its arborist bombs out walking the
tree at those pnpm-relative entries with the misleading error:

    npm error code EUSAGE
    npm error The `npm ci` command can only install with an
    npm error existing package-lock.json or npm-shrinkwrap.json
    npm error with lockfileVersion >= 1.

`npm install --dry-run` surfaces the real cause:

    Cannot read properties of undefined (reading 'extraneous')

A fresh lockfile generated in an isolated container works.
- broken: 1259 packages, 43 with `../../../node_modules/.pnpm/...`
- fresh:  1321 packages, all `node_modules/...` paths

This commit regenerates every integration's lockfile inside an
isolated `node:22-slim` container via `npm install
--package-lock-only --legacy-peer-deps` and verifies with `npm ci`.
2026-05-19 12:12:57 +02:00
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
Jordan Ritter 6e6878349a fix(showcase): use pressSequentially instead of fill for sandboxed iframe input
fill() silently no-ops inside sandbox="allow-scripts" iframes on some
Playwright/Chromium combos because the null origin blocks the
set-value protocol message. The input.value stays empty, so the
host-side evaluateExpression handler rejects it with "Unsupported
characters" and the test never sees a console log.

pressSequentially sends individual key events that always reach the
input regardless of sandbox restrictions.
2026-05-18 21:41:37 -07:00
Alem Tuzlak 36e0e24f94 fix(showcase/google-adk/beautiful-chat): wire calculator click handlers via addEventListener
Calculator pill rendered the layout but no button responded. Root cause:
Gemini's default emit for the calculator widget used `<form>` /
`<button type="submit">` for clicks — the iframe runs with
`sandbox="allow-scripts"` only, so the browser silently blocks form
submission before any handler fires. The buttons drew, nothing happened.

Expand the `generateSandboxedUi` guidance in `_INSTRUCTION` with the same
sandbox-iframe contract `_OPEN_GEN_UI_ADVANCED_INSTRUCTION` already
spells out:
- Forms and submit-type buttons are blocked silently.
- Use `<button type="button" data-key="…">` plus a single delegated
  `document.addEventListener('click', e => …)` that reads
  `e.target.dataset.key` / `data-value`. Keyboard input via a `keydown`
  listener that checks `e.key === 'Enter'`.
- All handler code in a `<script>` tag inside `html`.

Verified: the calculator widget Gemini now produces wires every key /
metric-shortcut button with delegated click handlers; clicks update the
calculator display end-to-end. Matches the LangGraph-Python output.

(The instruction nudge for generateSandboxedUi itself shipped in #4837.
This change is purely about teaching Gemini the sandbox restrictions so
the generated HTML stays interactive.)
2026-05-15 17:14:26 +02:00
Alem Tuzlak bee96f988d fix(showcase/google-adk/voice): pin transcription baseURL to real OpenAI
The mic recording path on Railway prod was returning `502 Invalid file
format. Supported formats: ['flac', 'm4a', 'mp3', 'mp4', 'mpeg', 'mpga',
'oga', 'ogg', 'wav', 'webm']` even though the browser was sending valid
WebM Opus bytes (audio/webm;codecs=opus, ~40KB recordings).

Root cause: `new OpenAI({ apiKey })` falls through to `OPENAI_BASE_URL`,
which in showcase environments points at aimock (`http://aimock:4010/v1`).
Aimock's proxy mode forwards unmatched requests to real OpenAI but
re-encodes the multipart body, corrupting the audio bytes en route to
Whisper. Whisper inspects the bytes (not just the MIME), so it rejects
the corrupted payload with the format error.

LangGraph-Python's voice route already documents and works around this:
it pins the transcription client's `baseURL` to real OpenAI (or
`OPENAI_TRANSCRIPTION_BASE_URL` when set) so the audio bypasses aimock
entirely. Mirroring that here verbatim. The non-transcription paths
(chat completions etc.) still go through aimock for deterministic
fixtures; only `/v1/audio/transcriptions` skips it.

Verified locally: mic recording in the browser now transcribes the
user's actual words via real Whisper instead of failing 502.

The audio/webm stamping I added to `packages/runtime` in the previous
commit is still useful defensive hardening for empty-type Blobs that
arrive at the server-side handler — keep it. With this route-level
change those bytes never reach aimock anyway.
2026-05-15 16:52:41 +02:00
Alem Tuzlak 4a27087094 test(showcase/google-adk): default fake LlmResponse to finish_reason=STOP
The Python unit tests for stop_on_terminal_text /
simple_after_model_modifier built fake LlmResponse objects without a
finish_reason field. That worked before the thinking-mode fix in #4826,
which added a finish_reason="STOP" gate so the callback no longer
terminates on text-only chunks that arrive non-partial with
finish_reason=None (Gemini thinking-mode emits a text-only chunk first,
then a separate function-call chunk — terminating on the first would
skip the second).

Fix: default the fake response's finish_reason to "STOP" (the real
terminal-response shape) and also stub turn_complete=None so the
matcher path the callback walks lines up with what production sees.
Local pytest on Python 3.10 → 23/23 green.
2026-05-15 14:31:10 +02:00
Alem Tuzlak 9e54ba6706 fix(showcase/google-adk): beautiful-chat icon, calculator, hitl, voice mic, state-context gating
Production-fix bundle for beautiful-chat + 3 other google-adk demos. All
issues either reported on Railway prod or unmasked by the catch-all
render_a2ui fallback I added in #4836. Local D5 stays 38/38 green.

- Missing copilotkit logo: `<img src="/copilotkit-logo-mark.svg">` returned
  404 because the SVG never shipped in the integration's public/. Copy
  copilotkit-logo-mark.svg + copilotkit-logo.svg over from langgraph-python.

- Multimodal sample.png / sample.pdf were LFS pointers in prod (Railway
  build runs without `git lfs pull`), so the magic-byte check rejected them
  on first click. Add an integration-scoped .gitattributes that exempts
  these two paths from LFS (mirrors what every working sibling integration
  already does) and re-stage the files as real binaries (10KB / 2.5KB).

- Sales Dashboard pill returned a generic "Step 1... Step 2..." narration
  instead of rendering the A2UI surface. Root cause: the render_a2ui
  catch-all fallback I added to aimock/d5-all.json in #4836 fired before
  feature-parity.json's specific sales-dashboard fixture (load order
  d5-all → smoke → feature-parity). Removing the catch-all from both
  d5-all.json and the per-demo source so the specific fixture wins.

- Calculator App pill returned text only with a white iframe because
  beautiful-chat's agent instruction never mentioned generateSandboxedUi —
  Gemini saw the tool listed via AGUIToolset but had no nudge to use it.
  Added a one-line "Interactive / sandboxed widgets" entry to the
  instruction; verified Gemini now emits the tool call.

- hitl-in-app refund (#12345) and escalate (#12347) pills broke on the
  second click because the 2nd-turn fixtures keyed on `sequenceIndex` 0/1
  (a global thread-position counter that drifts when other pills land
  tool messages in the same thread). Convert both to `toolCallId +
  hasToolResult: true` and drop the reject branch — Gemini reasons
  correctly from the tool's `approved: false` return without a fixture
  override. Same pattern that fixed tool-rendering-reasoning-chain
  previously.

- hitl-in-app downgrade (#12346) pill produced an unrelated
  "Research / Outline / Draft / Review / Finalize" plan because the
  prompt contains the substring "plan" and feature-parity.json has a
  generic catch-all match on `userMessage: "plan"`. Add a specific
  downgrade fixture in d5-all.json (loaded before feature-parity.json)
  with hasToolResult: false / true branches.

- hitl-in-chat "Schedule a 1:1 with Alice" returned the wrong
  "Nice to meet you, Alice in Tokyo" response when clicked AFTER another
  pill in the same thread. The 2nd-turn fixture only matched on
  `toolCallId` (no hasToolResult), so the bare "alice" / "Alice" greeting
  fixtures further down won. Add `hasToolResult: true` to the 2nd-turn
  fixture so it scopes correctly regardless of thread state.

- Voice manual recordings always returned "What is the weather in Tokyo?"
  regardless of audio content. aimock had a catch-all transcription fixture
  (`match: { endpoint: "transcription" }`) that returned the canned
  Tokyo string for any audio input. The D5 voice probe uses the sample
  audio button which bypasses /transcribe entirely (it injects text
  directly into the composer), so removing the transcription fixture
  drops aimock into --proxy-only fall-through to real OpenAI Whisper for
  mic recordings while D5 stays green. Verified.

- readonly-state-agent-context and shared-state-read-write fixtures
  returned hardcoded "Atai" / generic preferences responses even when
  the user changed the state values in the UI inputs. Gate the
  Who-am-I / Suggest-next-steps / Greet / Plan-a-weekend fixtures on
  systemMessage substring matching the canonical default state values
  ("Atai" name for readonly-state-context; "tone: casual" for
  shared-state-read-write). When the user changes state, the agent's
  before-model callback rebuilds the system prompt with the new values,
  the fixture's systemMessage substring no longer matches, and aimock
  --proxy-only falls through to the real model so the response reflects
  the actual state. Confirmed with paired curl tests (default state =
  fixture match; alem name = real-LLM response).

Local verification: bin/showcase test google-adk --d5 finishes 38/38
green (137s). Calculator pill confirmed via direct ADK invocation
against real Gemini (GOOGLE_GEMINI_BASE_URL=) emits TOOL_CALL_START
toolCallName=generateSandboxedUi. Sales-dashboard pill confirmed end-to-end
returning the full Column / DashboardCards / PieChart / BarChart payload.
readonly-state-context confirmed with name=Atai matching fixture vs
name=alem falling through to real-LLM response that uses the actual
context.
2026-05-15 14:24:16 +02:00
github-actions[bot] df4b122351 style: auto-fix formatting 2026-05-15 10:56:14 +00:00
Alem Tuzlak 110ca6f4b2 fix(showcase/google-adk): bring final 5 demos to D5 green
Five distinct root causes were keeping google-adk from full D5 parity
with langgraph-python. Fixing them takes the integration to 38/38 D5
green under aimock locally (verified end-to-end with --live writing
to PocketBase).

- readonly-state-context: page.tsx asked for agent slug
  readonly_state_agent_context (underscore) but the registry mounts
  it kebab-case as readonly-state-agent-context. useAgent threw,
  the demo layout never mounted, and the ctx-name input never rendered.
  Align with the registry (and with langgraph-python).

- multimodal: the secondary failure was a backend Pydantic
  ValidationError on HttpOptions.api_endpoint. google-genai 1.75
  renamed the field to base_url; all three direct genai client
  constructors (main.py, beautiful_chat_agent.py, subagents_agent.py)
  needed the rename so the secondary A2UI / sub-agent LLM calls stop
  crashing. (The pre-existing LFS-pointer issue on the bundled
  sample.png/pdf was a worktree hydration problem, not a tracked
  code change — git lfs pull handles it.)

- gen-ui-declarative (two bugs stacked):
  1. The same api_endpoint -> base_url rename above. The secondary
     generate_a2ui planner LLM was failing every request.
  2. The D5 fixture emitted components in {id, type, props: {...}}
     shape, but sanitize_a2ui_components requires component, so
     every entry was dropped and the renderer received an empty
     surface. Rewrite both the per-demo fixture and the d5-all.json
     aggregate to the flat {id, component, ...props} shape that
     langgraph-python's _design_a2ui_surface fixture already uses,
     wrapping multi-child layouts in a basic-catalog Column (the
     custom Card schema has a single child slot). Add
     _design_a2ui_surface variants so LGP gets per-pill payloads too.

- shared-state-streaming: ADK's write_document took content and
  the PredictStateMapping read tool_argument="content", but the
  shared D5 fixture (and the LGP function signature) names the
  argument document. Rename both sides so the fixture's tool_call
  args plumb into the function and into PredictStateMapping's
  state-key emission. STATE_DELTA now propagates and DocumentView
  streams live.

- tool-rendering-reasoning-chain: in thinking mode
  (include_thoughts=True), Gemini emits a turn as two separate
  non-partial chunks — a text-only chunk with finish_reason=None
  and a function-call-only chunk with finish_reason=FUNCTION_CALL.
  stop_on_terminal_text fired on the first (text-only) chunk and
  set end_invocation=True before the function-call chunk arrived,
  which broke AAPL->MSFT chaining. Gate termination on
  finish_reason=STOP; FUNCTION_CALL and None both mean "more
  chunks inbound — defer". Applies to every agent that uses the
  shared callback, so chain-aware behavior is uniform.

Local verification: bin/showcase test google-adk --d5 --live
finishes green for all 38 cells (~140s), dashboard reflects the
results from PocketBase. Manual real-Gemini click-through of the
five fixed demos also passes end-to-end via GOOGLE_GEMINI_BASE_URL=
(empty) recreate.
2026-05-15 12:53:26 +02: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
Alem Tuzlak d530592317 feat(showcase/google-adk/headless-complete): port backend tools to unblock D5
`headless_complete` was wired to `_simple_chat` (zero backend tools)
in the registry. The d5-gen-ui-headless-complete probe sends prompts
that need `get_weather` / `get_stock_price` / `get_revenue_chart`
to mount their respective per-tool renderer cards on the frontend
(`useRenderTool` keys on tool name), so without the backend tools the
fixture's tool-call response had no matching Python function to run
and the cards never mounted.

Ports the three mock tools verbatim from
`langgraph-python/src/agents/headless_complete.py` (same payload
shapes, same system-prompt routing rules) onto a dedicated
`headless_complete_agent` LlmAgent and re-points the registry slot.
The frontend's `highlight_note` is a useComponent-style frontend
tool and the Excalidraw MCP tools are injected by the runtime
middleware — neither needs a backend Python function, matching the
LGP shape.

Local D5: google-adk:headless-complete flips from red to green.
2026-05-14 21:23:32 +02:00
Alem Tuzlak 02e48162c4 test(showcase/google-adk): sync e2e specs to langgraph-python north-star
Ports 16 diverged Playwright e2e specs verbatim from langgraph-python
and adds 3 previously-missing specs (chat-customization-css,
prebuilt-sidebar, reasoning-custom). All 19 files are byte-identical
to LGP, mirroring the same approach the recent ADK parity push used
for the demo pages.

Why this matters even though D5 is the gold standard: the per-package
Playwright suites (`pnpm test:e2e`) are the local dev validation loop.
Without parity here, a contributor editing google-adk's CopilotChat
surface has no local check that matches what langgraph-python ships,
and tiny divergences between the two surfaces (missing testids, stale
selectors, wrong assertion shapes) silently accumulate until they
surface as D5 regressions in CI.
2026-05-14 20:54:21 +02:00
Alem Tuzlak 05a1a95118 fix(showcase/google-adk): bump ag-ui-adk to 0.6.3
0.6.3 ships the FunctionResponse.name fix
(ag-ui-protocol/ag-ui#1682) — the converter now sets the response's
name field to the called function's name (e.g. `get_weather`) instead
of the tool_call_id. Without this, downstream consumers that recover
the originating call's id by name (Gemini's session correlator,
aimock's gemini->openai translator that locates a prior tool_call by
name to recover its id) hit a UUID-shaped `name` that no prior call
matches and the round-trip silently breaks — multi-leg D5 fixtures
keyed on `toolCallId` (tool-rendering-reasoning-chain, the gen-ui-*
chains, shared-state-streaming) fall through to the first-leg fixture
on every follow-up, looping indefinitely or stranding the UI.

Pairs with aimock 1.24.1 (CopilotKit/aimock#199) which surfaces the
`tool_call.id` on the egress side so there's actually an id for the
ADK middleware to preserve in the round-trip.
2026-05-14 20:53:27 +02:00
Tyler Slaton c461ad45a7 chore(showcase/google-adk): bump Gemini default to 3.1 Flash-Lite
Bumps the default Gemini model across the Google ADK showcase from
gemini-2.5-flash to gemini-3.1-flash-lite — the closest GA model in
the Gemini 3.x line (2.5 family is slated for June 2026 deprecation).

Touches agent factories (DEFAULT_MODEL, _DEFAULT_A2UI_MODEL, _SUB_MODEL),
the A2UI default-model test fixture, QA docs, the manifest description
for the reasoning demo, and prose references in shared_chat docstring +
entrypoint comment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 11:43:49 -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