mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
7762c43863
Restores #5151 (north-star + batch 1 + crewai-flows + llamaindex), #5196 (pydantic-ai), #5205 (a2a-middleware), #5211 (mcp-apps), reconciled onto the current main baseline rather than the pre-revert tree: - keep main's 1.59.3 pins, AGENT_URL normalization, default agent keys, useConfigureSuggestions, available:false, useRenderTool status/parameters API, call-time agent.state reads, and crewai-crews' rebuilt page (not yet threads-migrated) - graft the threads layer (drawer/gate/provider, env-gated route intelligence block, next.config gate, env docs, drawer deps) on top - drop threads-era sidebar suggestions props where main now registers suggestions via useConfigureSuggestions (or omits them) - fix the stale pydantic-ai doc link main reintroduced in ms-af-dotnet Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
"use client";
|
|
|
|
import {
|
|
CopilotChat,
|
|
CopilotChatConfigurationProvider,
|
|
} from "@copilotkit/react-core/v2";
|
|
import { useState } from "react";
|
|
|
|
import { ThreadsDrawer } from "./components/threads-drawer";
|
|
import { ThreadsPanelGate } from "./components/threads-drawer/locked-state";
|
|
import styles from "./components/threads-drawer/threads-drawer.module.css";
|
|
|
|
const agentId = "default";
|
|
|
|
export default function CopilotKitPage() {
|
|
const [threadId, setThreadId] = useState<string | undefined>(undefined);
|
|
|
|
return (
|
|
<div className={`${styles.layout} threadsLayout`}>
|
|
<ThreadsPanelGate>
|
|
<ThreadsDrawer
|
|
agentId={agentId}
|
|
threadId={threadId}
|
|
onThreadChange={setThreadId}
|
|
/>
|
|
</ThreadsPanelGate>
|
|
<div className={styles.mainPanel}>
|
|
<CopilotChatConfigurationProvider agentId={agentId} threadId={threadId}>
|
|
<main className="h-screen w-screen flex justify-center items-center">
|
|
<CopilotChat
|
|
key={threadId ?? "new-thread"}
|
|
agentId={agentId}
|
|
threadId={threadId}
|
|
className="w-1/2 h-full"
|
|
/>
|
|
</main>
|
|
</CopilotChatConfigurationProvider>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|