Commit Graph

1051 Commits

Author SHA1 Message Date
Benjamin Taylor 3342282bd8 feat(docs): gate trackers behind cookie consent banner
Adds a geo-aware consent banner to the docs site, mirroring the marketing
site approach. Middleware classifies visitors as eu / us-ca / other from
Vercel geo headers; EU/UK/EEA and California default to opt-in (no
trackers until accept), other regions default to opt-out. HubSpot,
RB2B, Reo, Google Analytics, PostHog, and Scarf are all gated behind
Analytics or Marketing categories. Privacy policy link points at
www.copilotkit.ai/privacy-policy. Independent cookie (cpk_docs_consent)
from the marketing site — separate banners by design.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-04 10:00:08 -05:00
Ben Taylor 5fec5261dd feat(docs): add Talk to Our Engineers button to navbar (#4590)
## Summary

- Adds a **Talk to Our Engineers** CTA button to the right side of the
docs navbar, mirroring the new website's nav button.
- Wires the same PostHog `talk_to_us_clicked` event the website fires,
with `{ location: "docs_nav" }` so docs-originated clicks can be
segmented from website clicks (`"nav"`) in PostHog.
- Fixes a pre-existing layout bug where the navbar's slanted SVG borders
were sized in fixed pixels (`w-[24px] h-[60px]` / `xl:w-[29px]
xl:h-[72px]`) and didn't follow the nav's actual height once Chrome's
default font size was scaled above 16px — the wedge of page background
that leaked through the join is now sealed.

## Behavior

| Viewport | Button |
|---|---|
| `>= 1400px` | Visible |
| `1024–1399px` | Hidden (button text would otherwise force the left
links to wrap) |
| `< 1024px` | Hidden — mobile burger menu surfaces the link |

The button uses `text-muted-foreground` for the resting state to match
the existing nav links and an indigo `#7076D5` hover accent that matches
the active-link underline color. Target is
`https://copilotkit.ai/contact-us` (absolute since docs runs on the
`docs.` subdomain).

## Test plan

- [ ] Click the button on a wide viewport — navigates to
`https://copilotkit.ai/contact-us` and fires `talk_to_us_clicked` with
`{ location: "docs_nav" }` in PostHog.
- [ ] Resize from > 1400px down through 1024px and below — button shows
/ hides at the right thresholds with no left-link wrapping.
- [ ] Toggle dark mode — button border and text stay legible, hover
accent still indigo.
- [ ] Set Chrome's default font size to 20px and reload — no wedge gap
at the slanted-border join between the left and right pill containers.
2026-05-01 17:12:56 -05:00
Benjamin Taylor b08da79700 docs: remove Threads + Intelligence Platform docs
Removes the unreleased Threads management surface (useThreads hook,
multi-conversation tutorial, the per-integration Threads how-to, the
shared snippet) and the Intelligence Platform / self-hosting pages
introduced alongside them, plus the ThreadsEarlyAccess gate that wrapped
them. The Learn landing page stays; just drops the Threads card and the
Intelligence Platform card. Sidebars (root, learn, reference/v2/hooks,
12 integrations + their premium subsections) are pruned to match.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 14:56:51 -07:00
Sam Julien 1f9e668980 feat(docs): add Talk to Our Engineers button to navbar
Adds a CTA button to the right side of the docs navbar mirroring the
website's nav button, including matching PostHog instrumentation. Fires
talk_to_us_clicked with { location: "docs_nav" } so docs-originated
clicks can be segmented separately from website clicks (which use
"nav"). Visible at viewports >= 1400px to avoid forcing the left
links to wrap; hidden below that breakpoint where the mobile burger
menu surfaces the link instead. Styled with text-muted-foreground to
match the existing nav links and an indigo #7076D5 hover accent that
matches the active-link underline.
2026-05-01 14:19:56 -07:00
Sam Julien cd405bc7cb fix(docs): scale navbar slanted borders with container height
The slanted SVG borders bridging the navbar's left and right pill
containers were sized with fixed pixels (w-[24px] h-[60px] /
xl:w-[29px] xl:h-[72px]). When users scale Chrome's default font size
above 16px, rem-based content inside the nav grows but the SVGs stay
fixed, leaving a visible wedge of page background at the top of the
join. Switch to h-full w-auto so the SVGs follow the container's
actual height while preserving their viewBox aspect ratio.
2026-05-01 14:18:27 -07:00
Benjamin Taylor 789fc98bdb fix(docs): reverse-proxy PostHog through /ingest
Routes PostHog analytics through docs.copilotkit.ai/ingest/* (rewrites to
eu.i.posthog.com) so requests bypass ad blockers and tracking-protection
that target the PostHog hostname directly. Mirrors the existing setup in
the marketing website.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 20:08:40 -05:00
Martha Kelly Schumann 372bb31e51 Merge branch 'main' into docs/CPK-7187-add-deepagents-section-to-docs 2026-04-29 09:00:24 -07:00
Tyler Slaton 0d70378193 docs(agentcore): add AWS AgentCore integration docs (#3586)
This PR draft documentation to the question: What do I need to do if I
want to add CopilotKit after deploying agent to AgentCore following this
guide
[here](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-agui.html)

So basically, following the guide linked, wanting CopilotKit, "Now
what?"
2026-04-28 20:30:33 -07:00
Benjamin Taylor 08d94575c2 docs(threads): split /threads into CLI quickstart + manual paths
Restructure /threads using TailoredContent so users pick between
bootstrapping a new project with the v-next CLI or wiring threads
into an existing CopilotKit app. The CLI path walks through
`npx -y @copilotkit/cli-vnext@latest create`, enabling Intelligence
when prompted, cd-ing into the project, installing deps, adding the
OpenAI key, and `npm run dev` (which boots the local Intelligence
Platform, BFF, and web app at localhost:3000). The manual path
preserves the original 4-step flow (runtime config, useThreads,
thread switching, pagination).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 14:25:48 -05:00
Ran Shemtov cfd8ec51c2 Merge branch 'main' into claude/add-stateschema-export-DtPiG 2026-04-27 15:15:43 +02:00
Martha Schumann e9da2fd3a9 docs(CPK-7187): drop broken Vite + Direct Connection path, keep LangChain guide link
The Vite + Direct Connection alternative and the matching Step 7
"LangGraph with custom route" tab walked users through a path that
doesn't actually run end-to-end. Verified via test drive: three stacked
failures in the Python SDK (missing v2 JSON-RPC envelope handler in
`add_fastapi_endpoint`; broken `LangGraphAGUIAgent.dict_repr` calling a
`super().dict_repr` that doesn't exist; `LangGraphAGUIAgent` missing
the `.execute` method that `CopilotKitRemoteEndpoint.execute_agent`
dispatches to, since its parent `ag_ui_langgraph.LangGraphAgent` only
exposes `.run(RunAgentInput)`).

Rather than ship docs that walk through a broken path, delete it:

- Remove the `<Tab value="LangGraph with custom route">` from Step 7
  and Step 10; both Tabs go back to `['Deep Agent', 'FastAPI']`.
- Remove the entire "Alternative: Vite + Direct Connection" section.
- Rewrite Step 7's "Using Next.js is optional" callout so it no longer
  references the (now deleted) in-page anchor; it now points only at
  LangChain's CopilotKit integration guide, which is where Christian
  Bromann's original feedback pointed as the canonical reference for
  the custom-route path.

Net effect: Christian's feedback is still addressed — Next.js is
explicitly flagged as optional and users are pointed at the working
upstream guide — without us becoming the maintainer of a parallel
path that doesn't currently work. Direct-connect can be re-added to
the docs once the Python SDK gains a v2 envelope handler and the
`LangGraphAGUIAgent.execute` adapter.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 14:12:22 -07:00
Martha Schumann 722a388c89 docs(CPK-7187): fix Deep Agents quickstart render callback + add port-conflict callout
Two small fixes from E2E test-driving the quickstart:

- Step 9's `useDefaultRenderTool` render callback destructured `args`,
  but the SDK exposes `parameters`. The TS example didn't typecheck
  as written. Swap to the correct prop name.
- Step 10 ("Start your agent") now has a short callout telling users
  what to do if port 8123 is already taken (change `--port` and update
  `LANGGRAPH_DEPLOYMENT_URL` in Step 7).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 13:45:27 -07:00
claudebot 78a4686991 Apply in-scope subset of PR #4269 2026-04-24 11:13:53 -07:00
Claude daee6e4432 docs(CPK-7187): point Deep Agents feature-viewer embeds at /langgraph/ path
The feature-viewer dojo doesn't currently serve /deepagents/feature/*
routes, so every IframeSwitcher in the Deep Agents docs was rendering
a 404 and the landing page 'Features' link broke.

Swap all 25 references across 10 files from /deepagents/feature/ to
/langgraph/feature/. The rendered demos are content-equivalent since
Deep Agents is LangChain-based, so the user experience is unchanged
from what we'd eventually serve under /deepagents/.

Also drops a TODO comment above each IframeSwitcher / FrameworkOverview
so the swap is easy to reverse once the dojo supports the correct path.

Files touched: index, frontend-tools, generative-ui/{state-rendering,
tool-rendering, your-components/{interrupt-based, interactive}},
shared-state/{predictive-state-updates, in-app-agent-write,
in-app-agent-read}, human-in-the-loop/interrupt-flow.
2026-04-24 18:12:55 +00:00
Maxim 118be34424 feat(docs): remove /ag-ui/:path* catch-all redirect
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-24 19:54:42 +02:00
Maxim 805a3e423b feat(docs): redirect /ag-ui to https://docs.ag-ui.com/
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-24 19:54:42 +02:00
Claude 361008a388 docs(CPK-7187): wrap Deep Agents quickstart TS tool with tool() + zod
The TypeScript 'Create your Deep Agent' example in the quickstart was
passing a bare `function getWeather(...)` into `tools: [getWeather]`,
which does not type-check against createDeepAgent — from
libs/deepagents/src/types.ts in deepagentsjs:

  tools?: TTools | StructuredTool[];
  // TTools extends readonly (ClientTool | ServerTool)[]

Bare functions aren't in the union. (Python auto-wraps via type hints +
reflection; TS doesn't.) A copy-paster would hit a type error at best and
a non-functional tool at worst.

Wrap the example with tool(handler, { name, description, schema }) from
langchain plus a zod schema — the same pattern used everywhere else in
this PR and in the official deepagentsjs examples/research/research-agent.ts.
2026-04-24 17:30:59 +00:00
Claude 2bf96c4ee9 docs(CPK-7187): clean up unused imports in Deep Agents Python snippets
Copy-paste-hygiene pass on the Python code blocks — eight unused imports
and one broken-typing reference removed across four files.

- quickstart.mdx (FastAPI tab): drop unused `import os` and
  `CopilotKitState` from the copilotkit import tuple.
- shared-state/predictive-state-updates.mdx: drop unused `typing.Literal`
  from the "Define the state" block, drop unused `CopilotKitState` from
  the predictive-config block and from the prebuilt-agent copilotkit
  import tuple.
- shared-state/state-inputs-outputs.mdx: drop unused `typing.Literal`
  from both Python blocks, and swap `List[str]` (which was never
  imported) for `list[str]` now that the target is Python 3.12.
- shared-state/workflow-execution.mdx: same fixes as state-inputs-outputs.

Users copy-pasting any of these into a fresh project no longer hit
ruff/pylint unused-import warnings or a NameError on `List`.
2026-04-24 17:19:16 +00:00
Claude 147faafd88 docs(CPK-7187): align Step 9 tabs with Step 7 in Deep Agents quickstart
Step 7 "Setup Copilot Runtime" now offers three tabs (Deep Agent, FastAPI,
LangGraph with custom route) but Step 9 "Start your agent" still only
declared two. Because both steps share groupId="deployment_method",
selecting the new tab in Step 7 would carry into Step 9 where it
doesn't exist, causing the tab state to fall back. Adds the matching
third tab to Step 9 — command is the same langgraph-cli invocation
as the Deep Agent tab, since the custom-route path still runs a
LangGraph deployment.
2026-04-24 16:52:29 +00:00
Martha Schumann 368b7ee4dc docs(CPK-7187): promote custom LangGraph route to a Step 7 tab + a2ui polish
Two Christian-facing nudges to make the re-review easier:

1. Step 7 ("Setup Copilot Runtime") now has a third tab alongside
   Deep Agent and FastAPI: "LangGraph with custom route". It shows
   the minimal frontend-only snippet (no app/api/copilotkit/route.ts),
   and links to the Vite + Direct Connection section below for the
   full Python + frontend walkthrough. This promotes Christian's
   preferred path (custom route per the LangChain CopilotKit guide)
   to peer billing with the Next.js options, rather than only
   surfacing it through a callout. The callout is retained and now
   points explicitly at the new tab.

2. a2ui/{dynamic-schema, fixed-schema} "Register the tool" snippets
   now use create_deep_agent from deepagents instead of create_agent
   from langchain. These sit inside the Deep Agents integration tree
   so the LangGraph prebuilt import was off-brand; not flagged by
   Christian but worth pre-empting.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 09:48:58 -07:00
Martha Schumann 096a708895 docs(CPK-7187): rewrite Deep Agents Python tabs using AgentMiddleware hooks
Follow-up to the TS rewrite: the Python tabs on the same feature pages
still showed a custom-graph-style chat_node(state, config) function,
which is not the idiomatic Deep Agents pattern. Users of create_deep_agent
don't define their own chat_node; they use AgentMiddleware classes with
hooks like before_model.

Pages updated:
- human-in-the-loop/interrupt-flow, generative-ui/your-components/
  interrupt-based: rewrote Python to an AgentMiddleware subclass with
  a before_model hook that calls langgraph.types.interrupt. Now
  symmetric with the TS middleware pattern.
- shared-state/in-app-agent-read: dropped the illustrative chat_node
  from the Python tab; a short comment now notes the agent reads state
  from tools or middleware hooks as it runs.
- generative-ui/state-rendering: renamed Python chat_node to
  emit_research_progress and removed the ChatOpenAI invocation so the
  snippet illustrates copilotkit_emit_state usage without implying a
  custom graph node structure.

Custom-graph-labeled branches in predictive-state-updates and the two
input/output schema pages (state-inputs-outputs, workflow-execution)
still show chat_node / answer_node functions — intentional, since
those sections document LangGraph custom-graph usage explicitly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 09:15:22 -07:00
Martha Schumann 8e894df65f docs(CPK-7187): nits on Deep Agents — groupId consistency, idiom cleanups
- tool-rendering: switch groupId from "language_langgraph_agent" to
  "agent_language" so tab selection persists alongside the other
  Deep Agents pages.
- tool-rendering: rewrite both Python and TS tabs to use
  create_deep_agent / createDeepAgent with `tools: [...]` instead of
  the custom-graph `chat_node + bind_tools` pattern that didn't match
  the rest of the docs.
- predictive-state-updates "Prebuilt agent": switch the Python tab to
  `create_deep_agent` from `deepagents` so it matches the TS tab
  (was using `create_agent` from `langchain.agents`). Update the
  TailoredContentOption description to reference both `createDeepAgent`
  and `create_agent` instead of only the LangGraph name.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 09:04:59 -07:00
Martha Schumann 2eae29ee37 docs(CPK-7187): rewrite Deep Agents TS examples using createMiddleware + zod
Christian Bromann flagged that Deep Agents feature pages still used the
legacy `Annotation.Root` state-schema pattern in their TypeScript
examples, which doesn't compose with `createDeepAgent` (no `stateSchema`
field).

Rather than strip the TS tabs, rewrite them using the canonical
LangChain v1 idiom: `createMiddleware` with a zod `stateSchema`, composed
alongside `copilotkitMiddleware`. Pattern typecheck-verified end-to-end
against deepagents@^1.9.0 and the current @copilotkit/sdk-js.

Pages rewritten with TS tabs (9):
- frontend-tools
- shared-state/{in-app-agent-read, in-app-agent-write,
  predictive-state-updates}
- human-in-the-loop/interrupt-flow
- generative-ui/state-rendering
- generative-ui/your-components/{display-only, interactive,
  interrupt-based}

Interrupts use a `beforeModel` middleware hook rather than a custom
graph node — the idiomatic Deep Agents pattern, since users don't
define their own chat_node functions.

Pages left Python-only with a callout (2):
- shared-state/{workflow-execution, state-inputs-outputs}: these
  document LangGraph's input/output schema split, which is not a
  first-class feature of createDeepAgent's middleware model. Callout
  explains the gap and points to the shared-state guides.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 08:56:19 -07:00
Claude 301e8e427e feat(sdk-js): add CopilotKitStateSchema for LangGraph StateSchema API
LangGraph now recommends the `StateSchema` API over `Annotation.Root` for
defining TypeScript agent state. Expose a `CopilotKitStateSchema` (and
`CopilotKitPropertiesSchema`) built on that API so TypeScript users can
compose CopilotKit state with the modern pattern:

    import { StateSchema } from "@langchain/langgraph";
    import { CopilotKitStateSchema } from "@copilotkit/sdk-js/langgraph";
    import { z } from "zod";

    export const AgentStateSchema = new StateSchema({
      language: z.enum(["english", "spanish"]).default("english"),
      ...CopilotKitStateSchema.fields,
    });

The existing `CopilotKitStateAnnotation` export continues to work; this
change is purely additive.

Docs under `docs/content/docs/integrations/langgraph/**` are migrated to
the new pattern. The `deepagents` docs pages are introduced in PR #3707;
the deprecation callout added there can be removed once both land.
2026-04-24 15:10:22 +00:00
Martha Kelly Schumann 2dd846b002 Merge branch 'main' into docs/CPK-7187-add-deepagents-section-to-docs 2026-04-23 13:08:02 -07:00
Sam Julien 0b39b994fe docs: port ag-ui-middleware content upstream from shell-docs
The shell-docs copy of ag-ui-middleware.mdx had been authored with full
content while the upstream file remained a 10-line TODO stub. Port the
70-line authored version up so the docs-sync pipeline stops threatening
to overwrite it.
2026-04-23 10:30:52 -07:00
Sam Julien 386accd457 chore(docs): drop unnecessary agentId specs in built-in agent examples
When the runtime registers an agent as default, CopilotKit hooks auto-select
it; passing agentId: "default" (or a stale "assistant" ID that isn't
actually registered) is noise. Applies to built-in-agent/shared-state.mdx
and unselected/shared-state.mdx across shell-docs and upstream.
2026-04-23 10:30:52 -07:00
Sam Julien 2783d1aa11 chore(docs): switch built-in agent model to openai:gpt-5.4-mini
Goal: fast 'wow that's fast' initial experience for users trying the
built-in agent. Sweeps shell-docs unselected/ and upstream built-in-agent/
so both trees match. Also collapses two mismatched GPT-4o rows in the
model-selection table into a single honest 'GPT-5.4 Mini' row.
2026-04-23 10:30:52 -07:00
Claude 50e68443bc docs(CPK-7187): address Christian Bromann second-round feedback
- Replace LangGraph-branded architectureImage on Deep Agents landing
  page with the generic AG-UI diagram used by other integrations
- Quickstart install: make TypeScript command mirror Python by swapping
  langchain for deepagents so both languages install the Deep Agents package
- Quickstart create-agent step: switch TypeScript example from
  createAgent (langchain) to createDeepAgent (deepagents) so it actually
  creates a Deep Agent
- Setup Copilot Runtime step: add callout noting that the Next.js proxy
  is optional and pointing to the direct-connection alternative below
  and the LangChain CopilotKit integration guide
2026-04-23 16:05:06 +00:00
Claude 0b0cc5d019 Merge remote-tracking branch 'origin/main' into docs/CPK-7187-add-deepagents-section-to-docs 2026-04-23 15:59:58 +00:00
Tyler Slaton 6e25a2ee99 docs: rename navbar "Copilot Cloud" link to "Free Developer Access"
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 17:31:11 -07:00
Tyler Slaton e68d7d6666 docs: update top-bar CTA to "Free Developer Access"
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 15:54:18 -07:00
Jordan Ritter 96e29c886b feat(examples/v2): rename interrupts-langraph→interrupts-langgraph + integration cleanup
Fix the long-standing typo across the example directory name + module
identifiers, align imports + package names. Also touches examples/integrations/adk
docker-compose fixtures and examples/e2e agents reference doc.
2026-04-22 10:50:10 -07:00
Ran Shem Tov 64e806b6bf docs: unify agentcore introduction and quickstart into one 2026-04-22 10:31:42 +02:00
Ran Shem Tov 311101d90b chore: pr review fixes 2026-04-22 10:26:07 +02:00
Ran Shem Tov f1a27f441b docs(agentcore): remove full stack example and unify into quickstart 2026-04-22 10:26:07 +02:00
Ran Shem Tov 5e4be20dd9 docs(agentcore): add AWS CLI quickstart reference 2026-04-22 10:26:07 +02:00
Ran Shem Tov ddaa0feec0 docs(agentcore): review fixes 2026-04-22 10:26:07 +02:00
Ran Shem Tov d289f5cbfc docs(agentcore): change agentcore docs location and link with frameworks 2026-04-22 10:26:07 +02:00
Ran Shem Tov 1a95f4ff38 docs(agentcore): change agentcore docs location and link with frameworks 2026-04-22 10:26:05 +02:00
Ran Shem Tov aeec30e649 docs(agentcore): add usual double path quickstart with cli support 2026-04-22 10:23:45 +02:00
Ran Shem Tov fc1111ff5b docs: add Terraform callout 2026-04-22 10:23:45 +02:00
Ran Shem Tov e5a7a807a9 docs(agentcore): add AWS AgentCore integration docs 2026-04-22 10:23:45 +02:00
Jordan Ritter 4b4923561b feat: VS Code extension — Hook Explorer, AG-UI Inspector, webview-first sidebars (#3935)
## Summary

Three connected features land together so the CopilotKit VS Code
extension becomes a coherent debugger/preview surface:

1. **Hook Explorer** — every V1 + V2 render hook can be discovered and
previewed live with auto-generated controls, an inline `▶️ Preview
Component` CodeLens, and a sidebar that lists every captured site.
2. **AG-UI Event Inspector** — live SSE debug stream of all AG-UI
events, filterable and color-coded, in a sidebar view + editor panel.
3. **A2UI Catalog sidebar → webview** — the last native TreeView gets
replaced with a Tailwind-styled webview that matches the other two, now
with a proper **Go to source** action on components and fixtures.

## Hook Explorer

### Discovery + preview
- oxc-based scanner walks the workspace and finds every call-site of any
hook in the registry (17 across V1 + V2, render + data).
- Preview panel bundles the user's source via Rolldown (IIFE format,
React externalized, CSS collected per `@copilotkit/a2ui-renderer`
pattern), executes it in the webview with a capture-only **stub** for
`@copilotkit/react-core` (+ `/v2`), and mounts the user's component just
long enough to record each hook's config.
- Auto-generated form on the left/top drives the `render` prop's
args/parameters/state/event live. V1 parameter arrays and V2 Zod /
Standard Schema all map through a unified `FormSchema` derived at
runtime from the captured config.
- `useCopilotAction`, `useCopilotAuthenticatedAction_c`,
`useCoAgentStateRender`, `useLangGraphInterrupt`, `useRenderTool`,
`useRenderToolCall`, `useDefaultRenderTool`, `useLazyToolRenderer`,
`useRenderCustomMessages`, `useRenderActivityMessage`,
`useHumanInTheLoop`, `useInterrupt`, `useFrontendTool`, `useComponent`,
`useDefaultTool` all previewable.
- Inline `▶️ Preview Component` CodeLens above every render-hook call
site, backed by the same `copilotkit.hooks.preview` command as the
sidebar.
- Imported render components work: rolldown walks transitive imports
from the hook's `render` prop through any number of sibling files.
- Cross-file hook switches are robust: controls are reset on load,
Harness only mounts once the real HostRoot is ready, a top-level error
boundary auto-recovers when you pick a different hook.

### Why the stub approach
Bundling the real `@copilotkit/react-core` through rolldown's IIFE
output hit a `__commonJSMin` TDZ chain (`require_clipboard`,
`require_graphql`, `require_context_helpers`, …) because the
chat/runtime-client/markdown graph has circular imports. Externalizing
react-core + routing to a Proxy-backed stub that captures hook configs
avoids the whole CJS wrapping problem, shrinks the preview bundle from
~24 MB to ~1.3 KB, and keeps the preview runtime path completely
runnable without a live CopilotKit backend. Tradeoff documented in
`copilotkit-stubs.ts`.

### Weather-themed fixtures
14+ fixtures under `packages/vscode-extension/test-workspace/hooks`,
each a distinct visual scenario (forecast card, severity-palette alerts
with imported CSS, forecast strip, live radar grid, conic-gradient
precipitation gauge, air-quality badge with imported render, pollen
report with a 2-hop import graph, HITL evacuation confirm,
sunrise/sunset gradient, etc.). Used both as regression fixtures and as
the demo surface for video.

### Styling
- Tailwind-via-CDN + VS Code CSS variables for theme-aware chrome.
- User-provided CSS imports collected by rolldown and injected as a
`<style>` tag per load.
- Controls + form fields converted to Tailwind; textarea matches input
styling.
- Framed "Rendered output" card so the render prop is visually
unmistakable.

## AG-UI Event Inspector

### Runtime (`@copilotkit/runtime` + `@copilotkit/shared`)
- `DebugEventBus` — in-memory pub/sub on `BaseCopilotRuntime`, only
instantiated when `NODE_ENV != production`.
- Event tap in `createSseEventResponse` broadcasts every AG-UI event
with metadata (agentId, threadId, runId, timestamp).
- `GET /debug-events` SSE endpoint — returns 404 in production, streams
`DebugEventEnvelope` JSON to connected clients, initial `: connected`
comment flushes headers immediately.

### VSCode Extension
- `DebugStream` — Node SSE client with auto-reconnect, exponential
backoff, URL validation, error surfacing.
- `InspectorPanel` (editor panel, command `CopilotKit: Open AG-UI
Inspector`) and `InspectorViewProvider` (sidebar view) both use a shared
`DebugStream` instance — events persist when switching tabs.
- Inspector React app: `ConnectionBar`, `FilterBar`, `EventList`,
`EventDetail`.
- Color scheme: purple (lifecycle), red (errors), blue (text), orange
(tools), green (reasoning), teal (state), yellow (activity), gray
(unknown).

## A2UI Catalog → webview

- Replaces `ComponentPreviewProvider` (native TreeDataProvider) with
`CatalogListViewProvider` (WebviewViewProvider), matching the Hooks and
Inspector sidebars.
- New React webview with refresh header, component rows (name + relative
path + `auto` badge when no fixture), expandable fixtures list.
- Click a component row → preview (or toggle if it has fixtures); click
a fixture row → preview that fixture.
- Hover action buttons: `▷` preview + `</>` go-to-source on every row.
- "Go to source" opens the component file for component rows; for
fixture rows it opens the fixture file and jumps the cursor to the named
fixture key.

## Test coverage
- Runtime: DebugEventBus unit tests (8), handleDebugEvents endpoint (5),
fetch-router routes (4), integration across Express/Hono/Node/Fetch (9).
- Hooks: scanner + 16 fixture bundle-smoke test, regression guard
against `node_<builtin>` self-references, CSS collector test, stub-based
capture E2E, cross-kind controls remount, FormRenderer defensive
rendering.
- Inspector + webview: DebugStream reconnect (10), inspector components
(17), colors (9).
- Total: **178 tests** passing for the vscode-extension package; runtime
suite unchanged.

## Test plan

- [ ] `pnpm nx run copilotkit-vscode-extension:build` and `pnpm nx run
copilotkit-vscode-extension:test` both green
- [ ] F5 launches the Extension Dev Host with `test-workspace` open
- [ ] Hooks sidebar lists every fixture hook; click a row → preview
opens; `</>` button opens the source
- [ ] `▶️ Preview Component` CodeLens shows above every render hook in a
`.tsx` file; clicking it opens the preview
- [ ] Form controls drive the render live; cross-kind hook switches
(action ↔ custom-message) don't crash; a forced render-prop throw
recovers when a different hook is picked
- [ ] Imported-render fixtures (`ImportedAirQuality`,
`ImportedPollenReport`) bundle and preview correctly
- [ ] A2UI Catalog sidebar is the new webview, refresh works, `</>` on a
fixture opens the fixture file and reveals the named key
- [ ] AG-UI Inspector connects to `GET /debug-events`, filters + detail
work, events survive sidebar/panel switch, invalid URL shows red error
2026-04-21 17:09:45 -07:00
Martha Kelly Schumann de389ce126 docs(fix): microsoft framework (python) improved docs to support upgraded agent framework (mirror of #4128) (#4129)
Mirror of #4128 by @MalaikaAbb.

The PR changes API identifiers (`ChatAgent`→`Agent`,
`chat_client=`→`client=`, `model_id=`→`model=`, `@ai_function`→`@tool`)
across several pages but leaves other sibling docs
(`human-in-the-loop.mdx`, `frontend-tools.mdx`, `auth.mdx`) on the old
API — this is a partial migration that needs human review to confirm the
new API is correct and to coordinate updating the remaining pages.

**Included:**
-
`docs/content/docs/integrations/microsoft-agent-framework/agent-app-context.mdx`
-
`docs/content/docs/integrations/microsoft-agent-framework/generative-ui/state-rendering.mdx`
-
`docs/content/docs/integrations/microsoft-agent-framework/generative-ui/tool-rendering.mdx`
-
`docs/content/docs/integrations/microsoft-agent-framework/quickstart.mdx`
-
`docs/content/docs/integrations/microsoft-agent-framework/shared-state/in-app-agent-read.mdx`
-
`docs/content/docs/integrations/microsoft-agent-framework/shared-state/in-app-agent-write.mdx`

**Excluded:**
- `docs/lib/integration-features.ts`

Assumed these are unrelated to the docs fix and excluded them from the
mirror. The original #4128 was closed as part of this handoff; if the
excluded changes are required, please open a new PR for them.
2026-04-21 14:38:02 -07:00
Martha Schumann 61321bb66b docs(microsoft-agent-framework): apply API renames to remaining sibling pages
Completes the partial migration in PR #4128 — extends the same
identifier rename pattern (ChatAgent→Agent, ChatClientProtocol→
SupportsChatGetResponse, chat_client=→client=, model_id=→model=,
@ai_function→@tool, Dict→dict) to the four sibling pages the fork
PR left on the old API, and patches one Dict annotation in
state-rendering.mdx that slipped through the original mirror.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 14:34:15 -07:00
claudebot b9964843ee Apply in-scope subset of PR #4128 2026-04-21 13:57:14 -07:00
Martha Schumann bb0a9191bb docs(mastra): simplify AG-UI context access in Agent instructions example
Drops the inline TypeScript typecast from the Mastra agent-app-context
example and uses optional chaining + direct access instead, so the doc
snippet is easier to read and copy. Keeps optional chaining on `.find`
so the example stays safe when the AG-UI context is absent. Also fixes
the `[!code highlight:N]` count after the comment line was removed.

Ports @Abubakar-01's changes from #4125 so they can ship together with
the `requestContext` rename, targeting the new `showcase/shell-docs/`
path after the shell restructure on main.

Co-authored-by: Muhammad Abubakar <abubakaran102025@gmail.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 13:44:58 -07:00
Martha Schumann bcd5a92d32 Merge remote-tracking branch 'origin/main' into fix/restore-mastra-readables-content 2026-04-21 13:16:01 -07:00
Benjamin Taylor ef3b8eeeaa docs(learn): surface Intelligence Platform on the Learn landing page
Add a card for the new Intelligence Platform explainer to the Learn
index card grid, positioned between Architecture and Threads so the
landing page reads overall architecture → platform → features → protocols.
Without this, the page is reachable only via the sidebar and is
invisible to evaluators browsing /learn top-down.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 23:12:52 -05:00