import { AgentChatSurface, markAgentChatHomeHandoff, } from "@agent-native/core/client/agent-chat"; import { useT } from "@agent-native/core/client/i18n"; import { useEffect } from "react"; import { useNavigate, useParams } from "react-router"; import { APP_TITLE } from "@/lib/app-config"; import { TAB_ID } from "@/lib/tab-id"; const SEO_TITLE = `${APP_TITLE} - Open Source AI app starter with actions`; const SEO_DESCRIPTION = "Open Source starter for agent-native apps with durable chat, shared actions, UI state, tools, and a backend your agent can extend."; export function meta() { return [ { title: SEO_TITLE }, { name: "description", content: SEO_DESCRIPTION, }, { property: "og:title", content: SEO_TITLE }, { property: "og:description", content: SEO_DESCRIPTION }, { name: "twitter:card", content: "summary" }, { name: "twitter:title", content: SEO_TITLE }, { name: "twitter:description", content: SEO_DESCRIPTION }, ]; } function chatThreadPath(threadId: string | null) { return threadId ? `/chat/${encodeURIComponent(threadId)}` : "/"; } export default function ChatRoute() { const { threadId } = useParams(); const navigate = useNavigate(); const t = useT(); const threadUrlSync = threadId ? { routeThreadId: threadId, getPath: chatThreadPath, navigate, } : undefined; useEffect(() => { function handleChatRunning(event: Event) { const detail = (event as CustomEvent).detail; if (detail?.isRunning === true) markAgentChatHomeHandoff("chat"); } window.addEventListener("agentNative.chatRunning", handleChatRunning); return () => window.removeEventListener("agentNative.chatRunning", handleChatRunning); }, []); return (

{t("chat.heroTitle")}

{t("chat.heroDescription")}

} /> ); }