- useFramework() now throws when called outside FrameworkProvider instead
of returning a silent no-op context. Silent fallback was masking wiring
bugs where components rendered outside the provider would report no
framework forever.
- readStoredFramework / writeStoredFramework now log once per session on
failure (guarded by module-scope flags) instead of swallowing errors
entirely. localStorage may still be unavailable (SSR, private mode),
but devs get a warning the first time.
- Dropped 'stored' from the URL-persist effect's deps. It was causing
redundant re-check cycles every time we called setStored from within.
The internal !== guard still short-circuits the no-op case.
- setStoredFramework now validates against knownFrameworks. Previously
any string could poison the stored preference (e.g. a route segment
like 'docs'); invalid slugs now warn and no-op.
`docs_pageview` was firing on every matched request — HEAD probes,
POSTs, and Next.js router prefetches all counted as pageviews, which
inflated counts and polluted funnels. Next.js App Router prefetches
links via low-priority fetches that still hit middleware, so they're
especially noisy on pages with long link lists.
We now bail out of tracking when:
- the method is not GET
- `next-router-prefetch: 1` is set (Next.js App Router)
- `purpose: prefetch` is set (generic prefetch hint)
The response is still served normally; only the PostHog capture is
skipped.
- Add aria-hidden=true so the SHA is not announced by screen readers.
- Shorten to the conventional 7-char git short-sha (was 9).
- Distinguish 'dev' (NEXT_PUBLIC_COMMIT_SHA undefined) from 'unknown'
(env present but empty string) so Docker ARG-scope bugs surface as
something other than a misleading 'dev' label in production.
Three smaller cleanups to the middleware:
1. Matcher regex: `(?!api|...)` matched `/apidocs` as well as `/api`,
dropping analytics for any docs path whose first segment starts with
'api'. The pattern now uses `api/` with a terminator, and also
excludes `robots.txt`, `sitemap.xml`, `manifest.webmanifest`, and
the `.well-known/` prefix, which some static-path tooling expects
to reach without middleware interception.
2. Capture errors are now logged via `console.warn` rather than
silently swallowed. PostHog 401/403/5xx, DNS failures, etc. were
invisible to operators.
3. The missing-`POSTHOG_PROJECT_KEY` warning now fires once at module
load rather than via a module-scoped mutable flag. Edge runtime
isolates are short-lived and per-request, so the in-memory
warn-once flag was unreliable. Module-load is the cleanest
available single-fire hook.
If a registry integration ever ships a slug matching a top-level route
segment (docs, ag-ui, reference, api, matrix, integrations), the
FrameworkProvider.urlFramework resolver would treat the route as a
framework scope and hijack navigation. Filter those slugs out in the
root layout and log a dev-only console.error so the collision is
visible to the maintainer.
The previous hard-coded distinct_id ("docs-pageview-tracker") collapsed
every visitor into a single synthetic PostHog person, which destroyed
unique-visitor analytics.
Each visitor now gets a stable UUID minted on first visit, persisted
in a first-party `ph_distinct_id` cookie (Lax, Secure, ~2 year TTL)
and read back on subsequent requests. This avoids IP+UA hashing and
the PII concerns that come with it.
Also wraps the PostHog capture POST in `event.waitUntil()` — the
middleware signature now takes `NextFetchEvent` — so the Edge runtime
keeps the request alive until the POST resolves. A bare fire-and-forget
fetch can be torn down as soon as `NextResponse.next()` returns,
dropping events.
Matches shell/ and shell-dashboard/ which commit their npm lockfiles to
pin standalone (non-pnpm-workspace) install closures. Ensures reproducible
Docker builds in CI.
shell-docs renders pure MDX docs with iframed live demos (via <InlineDemo>
and <IframeSwitcher>) — it never instantiates the live copilot runtime
inline, so it doesn't need @copilotkitnext/react or its styles. Dropping
the import also removes the package from shell-docs's dep closure, keeping
the docs shell lean.
These files were added in #4085 but landed in showcase/shell/src/content/docs/
after the MDX-docs extraction had already moved the rest of content/docs into
shell-docs. Follow The Rule (MDX docs content belongs in shell-docs) and
relocate them so they render correctly on docs.showcase.copilotkit.ai.
Extracts everything that exists to render MDX documentation (docs/[[...slug]],
[framework]/[[...slug]], ag-ui/[[...slug]], reference/[...slug]) out of shell
into the new shell-docs package that will serve docs.showcase.copilotkit.ai.
Moves (git mv preserves history):
- App routes: /docs, /[framework], /ag-ui, /reference
- Docs-only components: docs-page-view, docs-callout, docs-steps, docs-tabs,
mdx-components, framework-tabs, framework-selector, sidebar-*, snippet,
property-reference, router-pivot, stored-framework-highlight, react/*
- Docs-only libs: lib/docs-render, lib/mdx-registry
- All content: content/docs, content/ag-ui, content/reference, content/snippets
- .docs-sync-sha marker (follows the content)
Duplicates into shell-docs (both shells need them):
- brand-nav, search-modal, search-trigger, copy-button, framework-provider
- lib/registry.ts, data/registry.json, data/demo-content.json,
data/search-index.json
- app/layout.tsx + globals.css + public/{images,logos}
shell-docs gets its own minimal middleware (PostHog-only — no SEO redirect
table, docs host never served legacy URLs). shell keeps seo-redirects.ts
for the legacy-URL migration table; framework-scope protection in its
middleware is now effectively dead but harmless (next.config.ts redirects
fire before middleware ever sees /<framework>/ paths).
InlineDemo updated for cross-host context: 'Open full demo' link points
at the shell host (showcase.copilotkit.ai) since the integration profile
route only exists there.