Files
Benjamin Taylor 94130333c6 feat(examples/integrations): Intelligence threads (batch 1) on @copilotkit 1.59.1
Activation-gated Intelligence/threads added to the batch-1 integration
examples (langgraph-js, mastra, adk, agno, ms-agent-framework-python,
ms-agent-framework-dotnet) and standardized — with the langgraph-python
north-star — on @copilotkit 1.59.1.

Per-example:
- env-gated CopilotKitIntelligence route branch (multi-route endpoint +
  `useSingleEndpoint={false}` REST transport; no organizationId);
- bespoke themed threads-drawer panel + locked-state tease;
- next.config `NEXT_PUBLIC_COPILOTKIT_THREADS_ENABLED` gate; demo-user identity.

Demo migration to v2 hooks (the 1.59.1 bump broke the V1-era demos):
- `useAgent({ agentId })` -> `{ agent }` with `agent.state`/`setState`;
- `useFrontendTool` params as Zod schemas; CopilotSidebar content as a sibling
  (v2 slot model), not children; guarded card state.

Shared `_intelligence/` overlay: composite image 0.2.0, idempotent
`provision-user` one-shot (demo-user), and `CHECK_ORIGIN=false` so the local
realtime-gateway accepts the app's websocket origin.

Verified end-to-end on mastra (threads CRUD create/list/auto-name + agent run +
live updates, clean console); the other five build clean and await per-example
visual review.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 12:03:24 -05:00

26 lines
1.0 KiB
TypeScript

import type { NextConfig } from "next";
const nextConfig: NextConfig = {
serverExternalPackages: ["@copilotkit/runtime"],
env: {
// The public Threads UI flag is DERIVED from the server-side license token.
// Set COPILOTKIT_LICENSE_TOKEN (only) to enable Threads — do not set this
// flag directly. NOTE: NEXT_PUBLIC_* resolves at BUILD time while the
// runtime reads the token per-request, so the UI gate and runtime agree
// only when the token is present at build time (the standard `next dev` /
// host-build flow).
NEXT_PUBLIC_COPILOTKIT_THREADS_ENABLED: process.env.COPILOTKIT_LICENSE_TOKEN
? "true"
: "false",
},
typescript: {
// The verbatim demo (useFrontendTool/useRenderToolCall parameter shapes)
// has type drift against the installed @copilotkit/react-core@1.55.2 v2
// typings — the same demo-vs-installed-types mismatch the sibling examples
// (mastra, langgraph-python) absorb with this flag.
ignoreBuildErrors: true,
},
};
export default nextConfig;