export declare const WEB_APP_TEMPLATE_FILES: { readonly "app/_components/agent-chat.tsx": '"use client";\n\nimport type { UserContent } from "ai";\nimport { useEveAgent } from "eve/react";\nimport { AlertCircleIcon, BrainIcon, PlusIcon, SquareIcon } from "lucide-react";\nimport { useState } from "react";\nimport {\n Conversation,\n ConversationContent,\n ConversationScrollButton,\n ConversationTopFade,\n} from "@/components/ai-elements/conversation";\nimport { Message, MessageContent } from "@/components/ai-elements/message";\nimport {\n PromptInput,\n PromptInputButton,\n type PromptInputMessage,\n PromptInputSubmit,\n PromptInputTextarea,\n usePromptInputAttachments,\n} from "@/components/ai-elements/prompt-input";\nimport { Shimmer } from "@/components/ai-elements/shimmer";\nimport { Button } from "@/components/ui/button";\nimport { cn } from "@/lib/utils";\nimport { AgentMessage } from "./agent-message";\nimport { WEB_CHAT_AGENT } from "@/app/eve-agent";\n\nconst DEFAULT_AGENT_NAME = "__EVE_INIT_APP_NAME__";\nconst AGENT_NAME = WEB_CHAT_AGENT ?? DEFAULT_AGENT_NAME;\n\nexport function AgentChat({\n sessionId,\n sessionless = false,\n}: {\n readonly sessionId?: string;\n readonly sessionless?: boolean;\n}) {\n const [cancellationError, setCancellationError] = useState();\n const [hasInputText, setHasInputText] = useState(false);\n const agent = useEveAgent({\n agent: WEB_CHAT_AGENT,\n initialSession:\n sessionId === undefined\n ? undefined\n : {\n sessionId,\n streamIndex: 0,\n },\n resume: sessionId !== undefined,\n onSessionChange(session) {\n if (sessionId === undefined && session !== undefined) {\n // Framework routers (Next.js, TanStack Router) patch window.history; navigating\n // through them would remount this route and detach the active stream.\n History.prototype.replaceState.call(\n window.history,\n window.history.state,\n "",\n `/s/${encodeURIComponent(session.sessionId)}`,\n );\n }\n },\n });\n\n const isBusy = agent.status === "submitted" || agent.status === "streaming";\n const isResuming = agent.status === "resuming";\n const isEmpty = agent.data.messages.length === 0;\n const lastMessage = agent.data.messages.at(-1);\n const isPendingAssistantShell =\n lastMessage?.role === "assistant" &&\n lastMessage.parts.every((part) => part.type === "step-start");\n const showPendingThinking =\n isBusy &&\n (agent.status === "submitted" || lastMessage?.role !== "assistant" || isPendingAssistantShell);\n const turnFailure = isBusy || isResuming ? undefined : getLatestTurnFailure(agent.events);\n const errorMessage = cancellationError ?? agent.error?.message ?? turnFailure;\n const hasConversationContent = sessionless || !isEmpty || errorMessage !== undefined;\n const showConversationLayout = isResuming || hasConversationContent;\n const activeSessionId = sessionId ?? agent.session?.sessionId;\n // Answers are accepted while work runs; the server\'s settlement closes each request.\n const canRespond = (requestId: string) =>\n !isResuming && agent.data.inputs[requestId]?.status === "open";\n // A tool call can ask several questions at once, and its message part holds only the latest.\n const questionsFor = (callId: string) =>\n Object.values(agent.data.inputs).filter(\n (input) => input.request.kind === "question" && input.request.action.callId === callId,\n );\n\n const requestCancellation = () => {\n setCancellationError(undefined);\n void agent.cancel().catch((error: unknown) => {\n setCancellationError(toErrorMessage(error));\n });\n };\n\n const handleSubmit = async (message: PromptInputMessage) => {\n const text = message.text.trim();\n if ((text.length === 0 && message.files.length === 0) || isResuming) return;\n\n setHasInputText(false);\n setCancellationError(undefined);\n const options = isBusy ? { turnPolicy: "steer" as const } : undefined;\n\n if (message.files.length === 0) {\n await agent.send(text, options);\n return;\n }\n\n const parts: UserContent = [];\n if (text.length > 0) {\n parts.push({ text, type: "text" });\n }\n for (const file of message.files) {\n parts.push({\n data: file.url,\n filename: file.filename,\n mediaType: file.mediaType,\n type: "file",\n });\n }\n\n await agent.send(parts, options);\n };\n\n const composer = (\n \n setHasInputText(event.currentTarget.value.trim().length > 0)}\n placeholder="Send a message…"\n />\n \n \n );\n\n return (\n
\n {showConversationLayout ? (\n \n ) : null}\n\n {showConversationLayout ? (\n \n \n \n {agent.data.messages.map((message, index) =>\n showPendingThinking &&\n isPendingAssistantShell &&\n message.id === lastMessage.id ? null : (\n {\n setCancellationError(undefined);\n return agent.respond(inputResponses);\n }}\n />\n ),\n )}\n {showPendingThinking ? : null}\n {errorMessage ? : null}\n \n \n \n ) : null}\n\n \n {showConversationLayout ? null : (\n
\n

{AGENT_NAME}

\n
\n )}\n
{composer}
\n \n
\n );\n}\n\nfunction ComposerAction({\n hasInputText,\n isBusy,\n isResuming,\n onCancel,\n}: {\n readonly hasInputText: boolean;\n readonly isBusy: boolean;\n readonly isResuming: boolean;\n readonly onCancel: () => void;\n}) {\n const attachments = usePromptInputAttachments();\n const canSubmit = hasInputText || attachments.files.length > 0;\n\n if (!isBusy || canSubmit) {\n return ;\n }\n\n return (\n \n \n \n );\n}\n\nfunction ErrorMessage({ message }: { readonly message: string }) {\n return (\n \n \n \n \n
\n

Request failed

\n

{message}

\n
\n \n
\n
\n );\n}\n\nfunction ChatHeader({ canStartNewChat }: { readonly canStartNewChat: boolean }) {\n return (\n
\n
\n {AGENT_NAME}\n {canStartNewChat ? (\n window.location.assign("/s")}\n size="sm"\n type="button"\n variant="ghost"\n >\n \n New chat\n \n ) : null}\n
\n
\n );\n}\n\nfunction PendingThinking() {\n return (\n \n \n
\n \n Thinking\n
\n
\n
\n );\n}\n\nfunction toErrorMessage(error: unknown): string {\n return error instanceof Error ? error.message : "Unable to cancel the response.";\n}\n\nfunction getLatestTurnFailure(\n events: ReturnType["events"],\n): string | undefined {\n for (let index = events.length - 1; index >= 0; index -= 1) {\n const event = events[index];\n\n if (event.type === "turn.failed") {\n return event.data.code === "MODEL_CALL_FAILED"\n ? "The model is temporarily unavailable. Please try again."\n : event.data.message;\n }\n\n if (event.type === "turn.completed" || event.type === "turn.cancelled") {\n return undefined;\n }\n\n if (event.type === "message.received") {\n return undefined;\n }\n }\n\n return undefined;\n}\n'; readonly "app/_components/agent-message.tsx": '"use client";\n\nimport type {\n ConversationInput,\n EveAuthorizationPart,\n EveDynamicToolPart,\n EveMessage,\n EveMessageInputRequest,\n EveMessagePart,\n} from "eve/react";\nimport type { FormEvent } from "react";\nimport {\n CheckCircleIcon,\n ExternalLinkIcon,\n FileIcon,\n ImageIcon,\n KeyRoundIcon,\n XCircleIcon,\n} from "lucide-react";\nimport { Message, MessageContent, MessageResponse } from "@/components/ai-elements/message";\nimport { Reasoning, ReasoningContent, ReasoningTrigger } from "@/components/ai-elements/reasoning";\nimport {\n BashToolContent,\n Tool,\n ToolContent,\n ToolHeader,\n ToolInput,\n ToolOutput,\n} from "@/components/ai-elements/tool";\nimport { Button } from "@/components/ui/button";\nimport {\n Questionnaire,\n QuestionnaireActions,\n QuestionnaireChoice,\n QuestionnaireChoiceDescription,\n QuestionnaireChoices,\n QuestionnaireError,\n QuestionnaireInput,\n QuestionnaireItem,\n QuestionnaireSubmit,\n QuestionnaireTitle,\n} from "@/components/ui/questionnaire";\nimport { cn } from "@/lib/utils";\n\nexport type AgentInputResponse = {\n readonly optionId?: string;\n readonly requestId: string;\n readonly text?: string;\n};\n\ntype EveFilePart = Extract;\n\nexport function AgentMessage({\n canRespond,\n isStreaming,\n message,\n onInputResponses,\n questionsFor,\n}: {\n readonly canRespond: (requestId: string) => boolean;\n readonly isStreaming: boolean;\n readonly message: EveMessage;\n readonly onInputResponses: (responses: readonly AgentInputResponse[]) => void | Promise;\n readonly questionsFor: (callId: string) => readonly ConversationInput[];\n}) {\n const lastTextIndex = message.parts.reduce(\n (last, part, index) => (part.type === "text" ? index : last),\n -1,\n );\n const hasAssistantText =\n message.role === "assistant" &&\n message.parts.some((part) => part.type === "text" && part.text.length > 0);\n\n return (\n \n \n {message.parts.map((part, index) =>\n hasAssistantText && part.type === "reasoning" ? null : (\n \n ),\n )}\n \n \n );\n}\n\nfunction AgentMessagePart({\n canRespond,\n onInputResponses,\n part,\n questionsFor,\n showCaret,\n}: {\n readonly canRespond: (requestId: string) => boolean;\n readonly onInputResponses: (responses: readonly AgentInputResponse[]) => void | Promise;\n readonly part: EveMessagePart;\n readonly questionsFor: (callId: string) => readonly ConversationInput[];\n readonly showCaret: boolean;\n}) {\n switch (part.type) {\n case "step-start":\n return null;\n case "text":\n return (\n \n {part.text}\n \n );\n case "reasoning":\n return (\n \n \n {part.text}\n \n );\n case "file":\n return ;\n case "authorization":\n return ;\n case "dynamic-tool": {\n const questions = questionsFor(part.toolCallId);\n if (questions.length > 0) {\n return (\n
\n {questions.map(({ request, response }) => (\n \n ))}\n
\n );\n }\n\n return (\n <>\n \n \n \n {part.toolName === "bash" ? (\n \n ) : (\n <>\n \n \n \n )}\n \n \n {/* Kept outside the collapsed card so a pending approval is always visible. */}\n \n \n );\n }\n }\n}\n\nfunction QuestionRequest({\n canRespond,\n inputRequest,\n inputResponse,\n onInputResponses,\n}: {\n readonly canRespond: boolean;\n readonly inputRequest: EveMessageInputRequest;\n readonly inputResponse?: AgentInputResponse;\n readonly onInputResponses: (responses: readonly AgentInputResponse[]) => void | Promise;\n}) {\n const options = inputRequest.options ?? [];\n const acceptsFreeform = inputRequest.allowFreeform === true || options.length === 0;\n const disabled = !canRespond || inputResponse !== undefined;\n\n const submitResponse = (event: FormEvent) => {\n event.preventDefault();\n const answer = new FormData(event.currentTarget).get(inputRequest.requestId);\n if (typeof answer !== "string") {\n return;\n }\n\n const option = options.find(({ id }) => id === answer);\n void onInputResponses([\n option === undefined\n ? { requestId: inputRequest.requestId, text: answer.trim() }\n : { optionId: option.id, requestId: inputRequest.requestId },\n ]);\n };\n\n return (\n \n \n \n {inputRequest.prompt}\n \n \n {options.map((option) => (\n \n {option.label}\n {option.description ? (\n \n {option.description}\n \n ) : null}\n \n ))}\n {acceptsFreeform ? (\n \n ) : null}\n \n \n \n {disabled ? null : (\n \n Answer\n \n )}\n \n );\n}\n\nfunction AttachmentPart({ part }: { readonly part: EveFilePart }) {\n const label = part.filename ?? "Attachment";\n const detail = [part.mediaType, formatBytes(part.size)].filter(Boolean).join(" - ");\n const isImage = part.mediaType.startsWith("image/") && part.url !== undefined;\n const Icon = isImage ? ImageIcon : FileIcon;\n const body = (\n \n {isImage ? (\n {label}\n ) : (\n \n \n \n )}\n \n {label}\n {detail ? {detail} : null}\n \n {part.url ? : null}\n \n );\n\n return part.url ? (\n \n {body}\n \n ) : (\n body\n );\n}\n\nfunction AuthorizationPrompt({ part }: { readonly part: EveAuthorizationPart }) {\n const isAuthorized = part.state === "completed" && part.outcome === "authorized";\n const isCompleted = part.state === "completed";\n const Icon = isAuthorized ? CheckCircleIcon : isCompleted ? XCircleIcon : KeyRoundIcon;\n const instructions = part.authorization?.instructions;\n const shouldShowInstructions = instructions !== undefined && instructions !== part.description;\n\n return (\n \n
\n \n \n \n
\n

{authorizationTitle(part)}

\n

{authorizationDescription(part)}

\n {shouldShowInstructions ? (\n

{instructions}

\n ) : null}\n {part.state === "required" && part.authorization?.userCode ? (\n
\n Code\n \n {part.authorization.userCode}\n \n
\n ) : null}\n {part.state === "required" && part.authorization?.url ? (\n \n ) : null}\n
\n
\n \n );\n}\n\nfunction authorizationTitle(part: EveAuthorizationPart): string {\n if (part.state === "required") {\n return `Connect ${part.displayName}`;\n }\n if (part.outcome === "authorized") {\n return `${part.displayName} connected`;\n }\n return `${part.displayName} authorization ${formatAuthorizationOutcome(part.outcome)}`;\n}\n\nfunction authorizationDescription(part: EveAuthorizationPart): string {\n if (part.state === "required") {\n return part.description;\n }\n if (part.outcome === "authorized") {\n return `${part.displayName} connected.`;\n }\n const tail = part.reason !== undefined ? ` (${part.reason})` : "";\n return `${part.displayName} authorization ${formatAuthorizationOutcome(part.outcome)}${tail}.`;\n}\n\nfunction formatAuthorizationOutcome(outcome: NonNullable): string {\n switch (outcome) {\n case "authorized":\n return "authorized";\n case "declined":\n return "declined";\n case "failed":\n return "failed";\n case "timed-out":\n return "timed out";\n }\n}\n\nfunction formatBytes(size: number | undefined): string | undefined {\n if (size === undefined) {\n return undefined;\n }\n if (size < 1024) {\n return `${size} B`;\n }\n if (size < 1024 * 1024) {\n return `${(size / 1024).toFixed(1)} KB`;\n }\n return `${(size / (1024 * 1024)).toFixed(1)} MB`;\n}\n\nfunction InputRequestActions({\n canRespond,\n onInputResponses,\n part,\n}: {\n readonly canRespond: (requestId: string) => boolean;\n readonly onInputResponses: (responses: readonly AgentInputResponse[]) => void | Promise;\n readonly part: EveDynamicToolPart;\n}) {\n const inputRequest = part.toolMetadata?.eve?.inputRequest;\n if (!inputRequest) {\n return null;\n }\n\n const inputResponse = part.toolMetadata?.eve?.inputResponse;\n const selectedOption = inputRequest.options?.find(\n (option) => option.id === inputResponse?.optionId,\n );\n // An approval can settle before its batch resolves, without an input response.\n const settledApproval =\n part.approval?.approved === undefined\n ? undefined\n : part.approval.approved\n ? "Approved"\n : "Denied";\n\n return (\n
\n

{inputRequest.prompt}

\n {inputResponse || settledApproval ? (\n

\n Responded:{" "}\n {selectedOption?.label ??\n inputResponse?.text ??\n inputResponse?.optionId ??\n settledApproval}\n

\n ) : (\n
\n {inputRequest.options?.map((option) => (\n {\n void onInputResponses([\n {\n optionId: option.id,\n requestId: inputRequest.requestId,\n },\n ]);\n }}\n size="sm"\n type="button"\n variant={option.style === "danger" ? "destructive" : "default"}\n >\n {option.label}\n \n ))}\n
\n )}\n
\n );\n}\n\nfunction partKey(part: EveMessagePart, index: number): string {\n switch (part.type) {\n case "authorization":\n return part.attemptId === undefined\n ? `authorization:${part.turnId}:${part.stepIndex}:${part.name}`\n : `authorization:${part.attemptId}`;\n case "dynamic-tool":\n return part.toolCallId;\n case "reasoning":\n case "text":\n return `${part.type}:${part.id ?? index}`;\n default:\n return `${part.type}:${index}`;\n }\n}\n'; readonly "app/apple-icon.tsx": 'import { ImageResponse } from "next/og";\n\nexport const size = {\n width: 180,\n height: 180,\n};\n\nexport const contentType = "image/png";\n\nexport default function AppleIcon() {\n return new ImageResponse(\n \n \n \n ,\n size,\n );\n}\n'; readonly "app/eve-agent.ts": '/** Named workspace agent selected by the Web Chat installer. */\nexport const WEB_CHAT_AGENT: string | undefined = undefined;\n'; readonly "app/globals.css": '@import "tailwindcss";\n@source "../node_modules/streamdown/dist/*.js";\n\n@theme inline {\n --color-background: var(--background);\n --color-foreground: var(--foreground);\n --color-card: var(--card);\n --color-card-foreground: var(--card-foreground);\n --color-popover: var(--popover);\n --color-popover-foreground: var(--popover-foreground);\n --color-primary: var(--primary);\n --color-primary-foreground: var(--primary-foreground);\n --color-secondary: var(--secondary);\n --color-secondary-foreground: var(--secondary-foreground);\n --color-muted: var(--muted);\n --color-muted-foreground: var(--muted-foreground);\n --color-accent: var(--accent);\n --color-accent-foreground: var(--accent-foreground);\n --color-destructive: var(--destructive);\n --color-border: var(--border);\n --color-input: var(--input);\n --color-ring: var(--ring);\n --radius-sm: calc(var(--radius) - 4px);\n --radius-md: calc(var(--radius) - 2px);\n --radius-lg: var(--radius);\n --radius-xl: calc(var(--radius) + 4px);\n}\n\n/* Not inline: font utilities must read the variables so each host\'s font loader can override them. */\n@theme {\n --font-sans: "Geist", "Geist Fallback", ui-sans-serif, system-ui, sans-serif;\n --font-mono: "Geist Mono", "Geist Mono Fallback", ui-monospace, monospace;\n}\n\n:root {\n color-scheme: light;\n /* Soft neutral page with white elevated surfaces so cards/composer pop. */\n --background: oklch(0.971 0 0);\n --foreground: oklch(0.16 0 0);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.16 0 0);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.16 0 0);\n --primary: oklch(0.19 0 0);\n --primary-foreground: oklch(0.985 0 0);\n --secondary: oklch(0.94 0 0);\n --secondary-foreground: oklch(0.19 0 0);\n --muted: oklch(0.94 0 0);\n --muted-foreground: oklch(0.6 0 0);\n --accent: oklch(0.94 0 0);\n --accent-foreground: oklch(0.19 0 0);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.916 0 0);\n --input: oklch(0.916 0 0);\n --ring: oklch(0.708 0 0);\n --radius: 0.625rem;\n}\n\n@media (prefers-color-scheme: dark) {\n :root {\n color-scheme: dark;\n --background: oklch(0.145 0 0);\n --foreground: oklch(0.985 0 0);\n --card: oklch(0.205 0 0);\n --card-foreground: oklch(0.985 0 0);\n --popover: oklch(0.205 0 0);\n --popover-foreground: oklch(0.985 0 0);\n --primary: oklch(0.922 0 0);\n --primary-foreground: oklch(0.205 0 0);\n --secondary: oklch(0.269 0 0);\n --secondary-foreground: oklch(0.985 0 0);\n --muted: oklch(0.269 0 0);\n --muted-foreground: oklch(0.708 0 0);\n --accent: oklch(0.269 0 0);\n --accent-foreground: oklch(0.985 0 0);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.556 0 0);\n }\n}\n\n* {\n border-color: var(--border);\n}\n\nhtml {\n height: 100%;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\nbody {\n min-height: 100%;\n margin: 0;\n background: var(--background);\n font-family: var(--font-sans);\n}\n\nbutton,\ninput,\ntextarea {\n font: inherit;\n}\n'; readonly "app/icon.svg": '\n \n \n\n'; readonly "app/layout.tsx": 'import type { Metadata } from "next";\nimport { Geist, Geist_Mono } from "next/font/google";\nimport type { ReactNode } from "react";\nimport { TooltipProvider } from "@/components/ui/tooltip";\nimport { cn } from "@/lib/utils";\nimport "./globals.css";\n\nconst sans = Geist({\n variable: "--font-sans",\n subsets: ["latin"],\n weight: "variable",\n display: "swap",\n});\n\nconst mono = Geist_Mono({\n variable: "--font-mono",\n subsets: ["latin"],\n weight: "variable",\n display: "swap",\n});\n\nexport const metadata: Metadata = {\n title: "__EVE_INIT_APP_NAME__",\n description: "A Next.js starter for eve agents with AI Elements.",\n};\n\nexport default function RootLayout({ children }: { readonly children: ReactNode }) {\n return (\n \n \n {children}\n \n \n );\n}\n'; readonly "app/page.tsx": 'import { AgentChat } from "@/app/_components/agent-chat";\n\nexport default function Page() {\n return ;\n}\n'; readonly "app/s/[sessionId]/page.tsx": 'import { AgentChat } from "@/app/_components/agent-chat";\n\nexport default async function SessionPage({\n params,\n}: {\n readonly params: Promise<{ readonly sessionId: string }>;\n}) {\n const { sessionId } = await params;\n return ;\n}\n'; readonly "app/s/page.tsx": 'import { AgentChat } from "@/app/_components/agent-chat";\n\nexport default function NewSessionPage() {\n return ;\n}\n'; readonly "components/ai-elements/chain-of-thought.tsx": '"use client";\n\nimport { useControllableState } from "@radix-ui/react-use-controllable-state";\nimport { Badge } from "@/components/ui/badge";\nimport { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible";\nimport { cn } from "@/lib/utils";\nimport type { LucideIcon } from "lucide-react";\nimport { BrainIcon, ChevronDownIcon, DotIcon } from "lucide-react";\nimport type { ComponentProps, ReactNode } from "react";\nimport { createContext, memo, useContext, useMemo } from "react";\n\ninterface ChainOfThoughtContextValue {\n isOpen: boolean;\n setIsOpen: (open: boolean) => void;\n}\n\nconst ChainOfThoughtContext = createContext(null);\n\nconst useChainOfThought = () => {\n const context = useContext(ChainOfThoughtContext);\n if (!context) {\n throw new Error("ChainOfThought components must be used within ChainOfThought");\n }\n return context;\n};\n\nexport type ChainOfThoughtProps = ComponentProps<"div"> & {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n};\n\nexport const ChainOfThought = memo(\n ({\n className,\n open,\n defaultOpen = false,\n onOpenChange,\n children,\n ...props\n }: ChainOfThoughtProps) => {\n const [isOpen, setIsOpen] = useControllableState({\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n prop: open,\n });\n\n const chainOfThoughtContext = useMemo(() => ({ isOpen, setIsOpen }), [isOpen, setIsOpen]);\n\n return (\n \n
\n {children}\n
\n
\n );\n },\n);\n\nexport type ChainOfThoughtHeaderProps = ComponentProps;\n\nexport const ChainOfThoughtHeader = memo(\n ({ className, children, ...props }: ChainOfThoughtHeaderProps) => {\n const { isOpen, setIsOpen } = useChainOfThought();\n\n return (\n \n \n \n {children ?? "Chain of Thought"}\n \n \n \n );\n },\n);\n\nexport type ChainOfThoughtStepProps = ComponentProps<"div"> & {\n icon?: LucideIcon;\n label: ReactNode;\n description?: ReactNode;\n status?: "complete" | "active" | "pending";\n};\n\nconst stepStatusStyles = {\n active: "text-foreground",\n complete: "text-muted-foreground",\n pending: "text-muted-foreground/50",\n};\n\nexport const ChainOfThoughtStep = memo(\n ({\n className,\n icon: Icon = DotIcon,\n label,\n description,\n status = "complete",\n children,\n ...props\n }: ChainOfThoughtStepProps) => (\n \n
\n \n
\n
\n
\n
{label}
\n {description &&
{description}
}\n {children}\n
\n
\n ),\n);\n\nexport type ChainOfThoughtSearchResultsProps = ComponentProps<"div">;\n\nexport const ChainOfThoughtSearchResults = memo(\n ({ className, ...props }: ChainOfThoughtSearchResultsProps) => (\n
\n ),\n);\n\nexport type ChainOfThoughtSearchResultProps = ComponentProps;\n\nexport const ChainOfThoughtSearchResult = memo(\n ({ className, children, ...props }: ChainOfThoughtSearchResultProps) => (\n \n {children}\n \n ),\n);\n\nexport type ChainOfThoughtContentProps = ComponentProps;\n\nexport const ChainOfThoughtContent = memo(\n ({ className, children, ...props }: ChainOfThoughtContentProps) => {\n const { isOpen } = useChainOfThought();\n\n return (\n \n \n {children}\n \n \n );\n },\n);\n\nexport type ChainOfThoughtImageProps = ComponentProps<"div"> & {\n caption?: string;\n};\n\nexport const ChainOfThoughtImage = memo(\n ({ className, children, caption, ...props }: ChainOfThoughtImageProps) => (\n
\n
\n {children}\n
\n {caption &&

{caption}

}\n
\n ),\n);\n\nChainOfThought.displayName = "ChainOfThought";\nChainOfThoughtHeader.displayName = "ChainOfThoughtHeader";\nChainOfThoughtStep.displayName = "ChainOfThoughtStep";\nChainOfThoughtSearchResults.displayName = "ChainOfThoughtSearchResults";\nChainOfThoughtSearchResult.displayName = "ChainOfThoughtSearchResult";\nChainOfThoughtContent.displayName = "ChainOfThoughtContent";\nChainOfThoughtImage.displayName = "ChainOfThoughtImage";\n'; readonly "components/ai-elements/code-block.tsx": '"use client";\n\nimport { Button } from "@/components/ui/button";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from "@/components/ui/select";\nimport { cn } from "@/lib/utils";\nimport { CheckIcon, CopyIcon } from "lucide-react";\nimport type { ComponentProps, CSSProperties, HTMLAttributes } from "react";\nimport {\n createContext,\n memo,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from "react";\nimport type { BundledLanguage, BundledTheme, HighlighterGeneric, ThemedToken } from "shiki";\nimport { createHighlighter } from "shiki";\n\n// Shiki uses bitflags for font styles: 1=italic, 2=bold, 4=underline\n// oxlint-disable-next-line eslint(no-bitwise)\nconst isItalic = (fontStyle: number | undefined) => fontStyle && fontStyle & 1;\n// oxlint-disable-next-line eslint(no-bitwise)\nconst isBold = (fontStyle: number | undefined) => fontStyle && fontStyle & 2;\nconst isUnderline = (fontStyle: number | undefined) =>\n // oxlint-disable-next-line eslint(no-bitwise)\n fontStyle && fontStyle & 4;\n\n// Transform tokens to include pre-computed keys to avoid noArrayIndexKey lint\ninterface KeyedToken {\n token: ThemedToken;\n key: string;\n}\ninterface KeyedLine {\n tokens: KeyedToken[];\n key: string;\n}\n\nconst addKeysToTokens = (lines: ThemedToken[][]): KeyedLine[] =>\n lines.map((line, lineIdx) => ({\n key: `line-${lineIdx}`,\n tokens: line.map((token, tokenIdx) => ({\n key: `line-${lineIdx}-${tokenIdx}`,\n token,\n })),\n }));\n\n// Token rendering component\nconst TokenSpan = ({ token }: { token: ThemedToken }) => (\n \n {token.content}\n \n);\n\n// Line number styles using CSS counters\nconst LINE_NUMBER_CLASSES = cn(\n "block",\n "before:content-[counter(line)]",\n "before:inline-block",\n "before:[counter-increment:line]",\n "before:w-8",\n "before:mr-4",\n "before:text-right",\n "before:text-muted-foreground/50",\n "before:font-mono",\n "before:select-none",\n);\n\n// Line rendering component\nconst LineSpan = ({\n keyedLine,\n showLineNumbers,\n}: {\n keyedLine: KeyedLine;\n showLineNumbers: boolean;\n}) => (\n \n {keyedLine.tokens.length === 0\n ? "\\n"\n : keyedLine.tokens.map(({ token, key }) => )}\n \n);\n\n// Types\ntype CodeBlockProps = HTMLAttributes & {\n code: string;\n language: BundledLanguage;\n showLineNumbers?: boolean;\n};\n\ninterface TokenizedCode {\n tokens: ThemedToken[][];\n fg: string;\n bg: string;\n}\n\ninterface CodeBlockContextType {\n code: string;\n}\n\n// Context\nconst CodeBlockContext = createContext({\n code: "",\n});\n\n// Highlighter cache (singleton per language)\nconst highlighterCache = new Map<\n string,\n Promise>\n>();\n\n// Token cache\nconst tokensCache = new Map();\n\n// Subscribers for async token updates\nconst subscribers = new Map void>>();\n\nconst getTokensCacheKey = (code: string, language: BundledLanguage) => {\n const start = code.slice(0, 100);\n const end = code.length > 100 ? code.slice(-100) : "";\n return `${language}:${code.length}:${start}:${end}`;\n};\n\nconst getHighlighter = (\n language: BundledLanguage,\n): Promise> => {\n const cached = highlighterCache.get(language);\n if (cached) {\n return cached;\n }\n\n const highlighterPromise = createHighlighter({\n langs: [language],\n themes: ["github-light", "github-dark"],\n });\n\n highlighterCache.set(language, highlighterPromise);\n return highlighterPromise;\n};\n\n// Create raw tokens for immediate display while highlighting loads\nconst createRawTokens = (code: string): TokenizedCode => ({\n bg: "transparent",\n fg: "inherit",\n tokens: code.split("\\n").map((line) =>\n line === ""\n ? []\n : [\n {\n color: "inherit",\n content: line,\n } as ThemedToken,\n ],\n ),\n});\n\n// Synchronous highlight with callback for async results\nexport const highlightCode = (\n code: string,\n language: BundledLanguage,\n // oxlint-disable-next-line eslint-plugin-promise(prefer-await-to-callbacks)\n callback?: (result: TokenizedCode) => void,\n): TokenizedCode | null => {\n const tokensCacheKey = getTokensCacheKey(code, language);\n\n // Return cached result if available\n const cached = tokensCache.get(tokensCacheKey);\n if (cached) {\n return cached;\n }\n\n // Subscribe callback if provided\n if (callback) {\n if (!subscribers.has(tokensCacheKey)) {\n subscribers.set(tokensCacheKey, new Set());\n }\n subscribers.get(tokensCacheKey)?.add(callback);\n }\n\n // Start highlighting in background - fire-and-forget async pattern\n getHighlighter(language)\n // oxlint-disable-next-line eslint-plugin-promise(prefer-await-to-then)\n .then((highlighter) => {\n const availableLangs = highlighter.getLoadedLanguages();\n const langToUse = availableLangs.includes(language) ? language : "text";\n\n const result = highlighter.codeToTokens(code, {\n lang: langToUse,\n themes: {\n dark: "github-dark",\n light: "github-light",\n },\n });\n\n const tokenized: TokenizedCode = {\n bg: result.bg ?? "transparent",\n fg: result.fg ?? "inherit",\n tokens: result.tokens,\n };\n\n // Cache the result\n tokensCache.set(tokensCacheKey, tokenized);\n\n // Notify all subscribers\n const subs = subscribers.get(tokensCacheKey);\n if (subs) {\n for (const sub of subs) {\n sub(tokenized);\n }\n subscribers.delete(tokensCacheKey);\n }\n })\n // oxlint-disable-next-line eslint-plugin-promise(prefer-await-to-then), eslint-plugin-promise(prefer-await-to-callbacks)\n .catch((error) => {\n console.error("Failed to highlight code:", error);\n subscribers.delete(tokensCacheKey);\n });\n\n return null;\n};\n\nconst CodeBlockBody = memo(\n ({\n tokenized,\n showLineNumbers,\n className,\n }: {\n tokenized: TokenizedCode;\n showLineNumbers: boolean;\n className?: string;\n }) => {\n const preStyle = useMemo(\n () => ({\n backgroundColor: tokenized.bg,\n color: tokenized.fg,\n }),\n [tokenized.bg, tokenized.fg],\n );\n\n const keyedLines = useMemo(() => addKeysToTokens(tokenized.tokens), [tokenized.tokens]);\n\n return (\n \n \n {keyedLines.map((keyedLine) => (\n \n ))}\n \n \n );\n },\n (prevProps, nextProps) =>\n prevProps.tokenized === nextProps.tokenized &&\n prevProps.showLineNumbers === nextProps.showLineNumbers &&\n prevProps.className === nextProps.className,\n);\n\nCodeBlockBody.displayName = "CodeBlockBody";\n\nexport const CodeBlockContainer = ({\n className,\n language,\n style,\n ...props\n}: HTMLAttributes & { language: string }) => (\n \n);\n\nexport const CodeBlockHeader = ({\n children,\n className,\n ...props\n}: HTMLAttributes) => (\n \n {children}\n
\n);\n\nexport const CodeBlockTitle = ({\n children,\n className,\n ...props\n}: HTMLAttributes) => (\n
\n {children}\n
\n);\n\nexport const CodeBlockFilename = ({\n children,\n className,\n ...props\n}: HTMLAttributes) => (\n \n {children}\n \n);\n\nexport const CodeBlockActions = ({\n children,\n className,\n ...props\n}: HTMLAttributes) => (\n
\n {children}\n
\n);\n\nexport const CodeBlockContent = ({\n code,\n language,\n showLineNumbers = false,\n}: {\n code: string;\n language: BundledLanguage;\n showLineNumbers?: boolean;\n}) => {\n // Memoized raw tokens for immediate display\n const rawTokens = useMemo(() => createRawTokens(code), [code]);\n\n // Synchronous cache lookup — avoids setState in effect for cached results\n const syncTokens = useMemo(\n () => highlightCode(code, language) ?? rawTokens,\n [code, language, rawTokens],\n );\n\n // Async highlighting result (populated after shiki loads)\n const [asyncTokens, setAsyncTokens] = useState(null);\n const asyncKeyRef = useRef({ code, language });\n\n // Invalidate stale async tokens synchronously during render\n if (asyncKeyRef.current.code !== code || asyncKeyRef.current.language !== language) {\n asyncKeyRef.current = { code, language };\n setAsyncTokens(null);\n }\n\n useEffect(() => {\n let cancelled = false;\n\n highlightCode(code, language, (result) => {\n if (!cancelled) {\n setAsyncTokens(result);\n }\n });\n\n return () => {\n cancelled = true;\n };\n }, [code, language]);\n\n const tokenized = asyncTokens ?? syncTokens;\n\n return (\n
\n \n
\n );\n};\n\nexport const CodeBlock = ({\n code,\n language,\n showLineNumbers = false,\n className,\n children,\n ...props\n}: CodeBlockProps) => {\n const contextValue = useMemo(() => ({ code }), [code]);\n\n return (\n \n \n {children}\n \n \n \n );\n};\n\nexport type CodeBlockCopyButtonProps = ComponentProps & {\n onCopy?: () => void;\n onError?: (error: Error) => void;\n timeout?: number;\n};\n\nexport const CodeBlockCopyButton = ({\n onCopy,\n onError,\n timeout = 2000,\n children,\n className,\n ...props\n}: CodeBlockCopyButtonProps) => {\n const [isCopied, setIsCopied] = useState(false);\n const timeoutRef = useRef(0);\n const { code } = useContext(CodeBlockContext);\n\n const copyToClipboard = useCallback(async () => {\n if (typeof window === "undefined" || !navigator?.clipboard?.writeText) {\n onError?.(new Error("Clipboard API not available"));\n return;\n }\n\n try {\n if (!isCopied) {\n await navigator.clipboard.writeText(code);\n setIsCopied(true);\n onCopy?.();\n timeoutRef.current = window.setTimeout(() => setIsCopied(false), timeout);\n }\n } catch (error) {\n onError?.(error as Error);\n }\n }, [code, onCopy, onError, timeout, isCopied]);\n\n useEffect(\n () => () => {\n window.clearTimeout(timeoutRef.current);\n },\n [],\n );\n\n const Icon = isCopied ? CheckIcon : CopyIcon;\n\n return (\n \n {children ?? }\n \n );\n};\n\nexport type CodeBlockLanguageSelectorProps = ComponentProps;\n\nexport const CodeBlockLanguageSelector = (props: CodeBlockLanguageSelectorProps) => (\n ;\n\nexport type PromptInputSelectTriggerProps = ComponentProps;\n\nexport const PromptInputSelectTrigger = ({\n className,\n ...props\n}: PromptInputSelectTriggerProps) => (\n \n);\n\nexport type PromptInputSelectContentProps = ComponentProps;\n\nexport const PromptInputSelectContent = ({\n className,\n ...props\n}: PromptInputSelectContentProps) => ;\n\nexport type PromptInputSelectItemProps = ComponentProps;\n\nexport const PromptInputSelectItem = ({ className, ...props }: PromptInputSelectItemProps) => (\n \n);\n\nexport type PromptInputSelectValueProps = ComponentProps;\n\nexport const PromptInputSelectValue = ({ className, ...props }: PromptInputSelectValueProps) => (\n \n);\n\nexport type PromptInputHoverCardProps = ComponentProps;\n\nexport const PromptInputHoverCard = ({\n openDelay = 0,\n closeDelay = 0,\n ...props\n}: PromptInputHoverCardProps) => (\n \n);\n\nexport type PromptInputHoverCardTriggerProps = ComponentProps;\n\nexport const PromptInputHoverCardTrigger = (props: PromptInputHoverCardTriggerProps) => (\n \n);\n\nexport type PromptInputHoverCardContentProps = ComponentProps;\n\nexport const PromptInputHoverCardContent = ({\n align = "start",\n ...props\n}: PromptInputHoverCardContentProps) => ;\n\nexport type PromptInputTabsListProps = HTMLAttributes;\n\nexport const PromptInputTabsList = ({ className, ...props }: PromptInputTabsListProps) => (\n
\n);\n\nexport type PromptInputTabProps = HTMLAttributes;\n\nexport const PromptInputTab = ({ className, ...props }: PromptInputTabProps) => (\n
\n);\n\nexport type PromptInputTabLabelProps = HTMLAttributes;\n\nexport const PromptInputTabLabel = ({ className, ...props }: PromptInputTabLabelProps) => (\n // Content provided via children in props\n // oxlint-disable-next-line eslint-plugin-jsx-a11y(heading-has-content)\n

\n);\n\nexport type PromptInputTabBodyProps = HTMLAttributes;\n\nexport const PromptInputTabBody = ({ className, ...props }: PromptInputTabBodyProps) => (\n
\n);\n\nexport type PromptInputTabItemProps = HTMLAttributes;\n\nexport const PromptInputTabItem = ({ className, ...props }: PromptInputTabItemProps) => (\n \n);\n\nexport type PromptInputCommandProps = ComponentProps;\n\nexport const PromptInputCommand = ({ className, ...props }: PromptInputCommandProps) => (\n \n);\n\nexport type PromptInputCommandInputProps = ComponentProps;\n\nexport const PromptInputCommandInput = ({ className, ...props }: PromptInputCommandInputProps) => (\n \n);\n\nexport type PromptInputCommandListProps = ComponentProps;\n\nexport const PromptInputCommandList = ({ className, ...props }: PromptInputCommandListProps) => (\n \n);\n\nexport type PromptInputCommandEmptyProps = ComponentProps;\n\nexport const PromptInputCommandEmpty = ({ className, ...props }: PromptInputCommandEmptyProps) => (\n \n);\n\nexport type PromptInputCommandGroupProps = ComponentProps;\n\nexport const PromptInputCommandGroup = ({ className, ...props }: PromptInputCommandGroupProps) => (\n \n);\n\nexport type PromptInputCommandItemProps = ComponentProps;\n\nexport const PromptInputCommandItem = ({ className, ...props }: PromptInputCommandItemProps) => (\n \n);\n\nexport type PromptInputCommandSeparatorProps = ComponentProps;\n\nexport const PromptInputCommandSeparator = ({\n className,\n ...props\n}: PromptInputCommandSeparatorProps) => ;\n'; readonly "components/ai-elements/reasoning.tsx": '"use client";\n\nimport { useControllableState } from "@radix-ui/react-use-controllable-state";\nimport { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible";\nimport { cn } from "@/lib/utils";\nimport { cjk } from "@streamdown/cjk";\nimport { code } from "@streamdown/code";\nimport { math } from "@streamdown/math";\nimport { mermaid } from "@streamdown/mermaid";\nimport { BrainIcon, ChevronDownIcon } from "lucide-react";\nimport type { ComponentProps, ReactNode } from "react";\nimport {\n createContext,\n memo,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from "react";\nimport { Streamdown } from "streamdown";\n\nimport { Shimmer } from "./shimmer";\n\ninterface ReasoningContextValue {\n isStreaming: boolean;\n isOpen: boolean;\n setIsOpen: (open: boolean) => void;\n duration: number | undefined;\n}\n\nconst ReasoningContext = createContext(null);\n\nexport const useReasoning = () => {\n const context = useContext(ReasoningContext);\n if (!context) {\n throw new Error("Reasoning components must be used within Reasoning");\n }\n return context;\n};\n\nexport type ReasoningProps = ComponentProps & {\n isStreaming?: boolean;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n duration?: number;\n};\n\nconst MS_IN_S = 1000;\n\nexport const Reasoning = memo(\n ({\n className,\n isStreaming = false,\n open,\n defaultOpen,\n onOpenChange,\n duration: durationProp,\n children,\n ...props\n }: ReasoningProps) => {\n const resolvedDefaultOpen = defaultOpen ?? isStreaming;\n // Track if defaultOpen was explicitly set to false (to prevent auto-open)\n const isExplicitlyClosed = defaultOpen === false;\n\n const [isOpen, setIsOpen] = useControllableState({\n defaultProp: resolvedDefaultOpen,\n onChange: onOpenChange,\n prop: open,\n });\n const [duration, setDuration] = useControllableState({\n defaultProp: undefined,\n prop: durationProp,\n });\n\n const hasEverStreamedRef = useRef(isStreaming);\n const [hasAutoClosed, setHasAutoClosed] = useState(false);\n const startTimeRef = useRef(null);\n\n // Track when streaming starts and compute duration\n useEffect(() => {\n if (isStreaming) {\n hasEverStreamedRef.current = true;\n if (startTimeRef.current === null) {\n startTimeRef.current = Date.now();\n }\n } else if (startTimeRef.current !== null) {\n setDuration(Math.ceil((Date.now() - startTimeRef.current) / MS_IN_S));\n startTimeRef.current = null;\n }\n }, [isStreaming, setDuration]);\n\n // Auto-open when streaming starts (unless explicitly closed)\n useEffect(() => {\n if (isStreaming && !isOpen && !isExplicitlyClosed) {\n setIsOpen(true);\n }\n }, [isStreaming, isOpen, setIsOpen, isExplicitlyClosed]);\n\n // Auto-close when streaming ends (once only, and only if it ever streamed)\n useEffect(() => {\n if (hasEverStreamedRef.current && !isStreaming && isOpen && !hasAutoClosed) {\n setIsOpen(false);\n setHasAutoClosed(true);\n }\n }, [isStreaming, isOpen, setIsOpen, hasAutoClosed]);\n\n const handleOpenChange = useCallback(\n (newOpen: boolean) => {\n setIsOpen(newOpen);\n },\n [setIsOpen],\n );\n\n const contextValue = useMemo(\n () => ({ duration, isOpen, isStreaming, setIsOpen }),\n [duration, isOpen, isStreaming, setIsOpen],\n );\n\n return (\n \n \n {children}\n \n \n );\n },\n);\n\nexport type ReasoningTriggerProps = ComponentProps & {\n getThinkingMessage?: (isStreaming: boolean, duration?: number) => ReactNode;\n};\n\nconst defaultGetThinkingMessage = (isStreaming: boolean, duration?: number) => {\n if (isStreaming || duration === 0) {\n return Thinking...;\n }\n if (duration === undefined) {\n return

Thought for a few seconds

;\n }\n return

Thought for {duration} seconds

;\n};\n\nexport const ReasoningTrigger = memo(\n ({\n className,\n children,\n getThinkingMessage = defaultGetThinkingMessage,\n ...props\n }: ReasoningTriggerProps) => {\n const { isStreaming, isOpen, duration } = useReasoning();\n\n return (\n \n {children ?? (\n <>\n \n {getThinkingMessage(isStreaming, duration)}\n \n \n )}\n \n );\n },\n);\n\nexport type ReasoningContentProps = ComponentProps & {\n children: string;\n};\n\nconst streamdownPlugins = { cjk, code, math, mermaid };\n\nexport const ReasoningContent = memo(({ className, children, ...props }: ReasoningContentProps) => (\n \n {children}\n \n));\n\nReasoning.displayName = "Reasoning";\nReasoningTrigger.displayName = "ReasoningTrigger";\nReasoningContent.displayName = "ReasoningContent";\n'; readonly "components/ai-elements/shimmer.tsx": '"use client";\n\nimport { cn } from "@/lib/utils";\nimport type { MotionProps } from "motion/react";\nimport { motion } from "motion/react";\nimport type { CSSProperties, ElementType, JSX } from "react";\nimport { memo, useMemo } from "react";\n\ntype MotionHTMLProps = MotionProps & Record;\n\n// Cache motion components at module level to avoid creating during render\nconst motionComponentCache = new Map<\n keyof JSX.IntrinsicElements,\n React.ComponentType\n>();\n\nconst getMotionComponent = (element: keyof JSX.IntrinsicElements) => {\n let component = motionComponentCache.get(element);\n if (!component) {\n component = motion.create(element);\n motionComponentCache.set(element, component);\n }\n return component;\n};\n\nexport interface TextShimmerProps {\n children: string;\n as?: ElementType;\n className?: string;\n duration?: number;\n spread?: number;\n}\n\nconst ShimmerComponent = ({\n children,\n as: Component = "p",\n className,\n duration = 2,\n spread = 2,\n}: TextShimmerProps) => {\n const MotionComponent = getMotionComponent(Component as keyof JSX.IntrinsicElements);\n\n const dynamicSpread = useMemo(() => (children?.length ?? 0) * spread, [children, spread]);\n\n return (\n \n {children}\n \n );\n};\n\nexport const Shimmer = memo(ShimmerComponent);\n'; readonly "components/ai-elements/tool.tsx": '"use client";\n\nimport { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible";\nimport { cn } from "@/lib/utils";\nimport type { DynamicToolUIPart, ToolUIPart } from "ai";\nimport { ChevronRightIcon, TerminalIcon, WrenchIcon } from "lucide-react";\nimport type { ComponentProps, ReactNode } from "react";\nimport { isValidElement } from "react";\n\nimport { CodeBlock } from "./code-block";\n\nconst compactCodeBlockClassName =\n "rounded-none border-0 bg-transparent [&_pre]:!bg-transparent [&_pre]:px-3 [&_pre]:pt-2 [&_pre]:pb-3 [&_pre]:text-xs [&_code]:text-xs";\n\nexport type ToolProps = ComponentProps;\n\nexport const Tool = ({ className, ...props }: ToolProps) => (\n \n);\n\nexport type ToolPart = ToolUIPart | DynamicToolUIPart;\n\nexport type ToolHeaderProps = {\n title?: string;\n className?: string;\n} & (\n | { type: ToolUIPart["type"]; state: ToolUIPart["state"]; toolName?: never }\n | {\n type: DynamicToolUIPart["type"];\n state: DynamicToolUIPart["state"];\n toolName: string;\n }\n);\n\nconst statusLabels: Record = {\n "approval-requested": "Awaiting Approval",\n "approval-responded": "Responded",\n "input-available": "Running",\n "input-streaming": "Pending",\n "output-available": "Completed",\n "output-denied": "Denied",\n "output-error": "Error",\n};\n\nexport const getStatusIndicator = (status: ToolPart["state"]) =>\n status === "output-available" ? null : (\n \n {statusLabels[status]}\n \n );\n\nexport const ToolHeader = ({\n className,\n title,\n type,\n state,\n toolName,\n ...props\n}: ToolHeaderProps) => {\n const derivedName = type === "dynamic-tool" ? toolName : type.split("-").slice(1).join("-");\n const displayName = title ?? derivedName;\n\n return (\n \n {displayName === "bash" ? (\n \n ) : (\n \n )}\n {displayName}\n {getStatusIndicator(state)}\n \n \n );\n};\n\nexport type ToolContentProps = ComponentProps;\n\nexport const ToolContent = ({ className, ...props }: ToolContentProps) => (\n \n);\n\nexport type BashToolContentProps = ComponentProps<"div"> & {\n input: ToolPart["input"];\n output: ToolPart["output"];\n errorText: ToolPart["errorText"];\n};\n\nexport const BashToolContent = ({\n className,\n input,\n output,\n errorText,\n ...props\n}: BashToolContentProps) => {\n const command = getRecordValue(input, "command");\n const stdout = getRecordValue(output, "stdout") ?? (typeof output === "string" ? output : "");\n const stderr = getRecordValue(output, "stderr") ?? errorText ?? "";\n const exitCode = getRecordValue(output, "exitCode");\n const hasResult = Boolean(stdout || stderr || (typeof exitCode === "number" && exitCode !== 0));\n\n return (\n
\n
\n        \n          $ \n          {command ?? "…"}\n        \n      
\n {hasResult ? (\n
\n          \n            \n              Output\n            \n            {stdout ? {String(stdout).trimEnd()} : null}\n            {stderr ? (\n              {String(stderr).trimEnd()}\n            ) : null}\n            {typeof exitCode === "number" && exitCode !== 0 ? (\n              Exited with code {exitCode}\n            ) : null}\n          \n        
\n ) : null}\n
\n );\n};\n\nconst getRecordValue = (value: unknown, key: string): string | number | undefined => {\n if (typeof value !== "object" || value === null || !(key in value)) {\n return undefined;\n }\n\n const property = value[key as keyof typeof value];\n return typeof property === "string" || typeof property === "number" ? property : undefined;\n};\n\nexport type ToolInputProps = ComponentProps<"div"> & {\n input: ToolPart["input"];\n};\n\nexport const ToolInput = ({ className, input, ...props }: ToolInputProps) => (\n
\n \n Parameters\n \n
\n \n
\n
\n);\n\nexport type ToolOutputProps = ComponentProps<"div"> & {\n output: ToolPart["output"];\n errorText: ToolPart["errorText"];\n};\n\nexport const ToolOutput = ({ className, output, errorText, ...props }: ToolOutputProps) => {\n if (!(output || errorText)) {\n return null;\n }\n\n let Output =
{output as ReactNode}
;\n\n if (typeof output === "object" && !isValidElement(output)) {\n Output = (\n \n );\n } else if (typeof output === "string") {\n Output = ;\n }\n\n return (\n \n \n {errorText ? "Error" : "Result"}\n \n {errorText &&
{errorText}
}\n {Output}\n
\n );\n};\n'; readonly "components/ui/badge.tsx": 'import * as React from "react";\nimport { cva, type VariantProps } from "class-variance-authority";\nimport { Slot } from "radix-ui";\n\nimport { cn } from "@/lib/utils";\n\nconst badgeVariants = cva(\n "inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",\n {\n variants: {\n variant: {\n default: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90",\n secondary: "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",\n destructive:\n "bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",\n outline:\n "border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",\n ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",\n link: "text-primary underline-offset-4 [a&]:hover:underline",\n },\n },\n defaultVariants: {\n variant: "default",\n },\n },\n);\n\nfunction Badge({\n className,\n variant = "default",\n asChild = false,\n ...props\n}: React.ComponentProps<"span"> & VariantProps & { asChild?: boolean }) {\n const Comp = asChild ? Slot.Root : "span";\n\n return (\n \n );\n}\n\nexport { Badge, badgeVariants };\n'; readonly "components/ui/button-group.tsx": 'import { cva, type VariantProps } from "class-variance-authority";\nimport { Slot } from "radix-ui";\n\nimport { cn } from "@/lib/utils";\nimport { Separator } from "@/components/ui/separator";\n\nconst buttonGroupVariants = cva(\n "flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*=\'w-\'])]:w-fit [&>input]:flex-1",\n {\n variants: {\n orientation: {\n horizontal:\n "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",\n vertical:\n "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none",\n },\n },\n defaultVariants: {\n orientation: "horizontal",\n },\n },\n);\n\nfunction ButtonGroup({\n className,\n orientation,\n ...props\n}: React.ComponentProps<"div"> & VariantProps) {\n return (\n \n );\n}\n\nfunction ButtonGroupText({\n className,\n asChild = false,\n ...props\n}: React.ComponentProps<"div"> & {\n asChild?: boolean;\n}) {\n const Comp = asChild ? Slot.Root : "div";\n\n return (\n \n );\n}\n\nfunction ButtonGroupSeparator({\n className,\n orientation = "vertical",\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nexport { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants };\n'; readonly "components/ui/button.tsx": 'import * as React from "react";\nimport { cva, type VariantProps } from "class-variance-authority";\nimport { Slot } from "radix-ui";\n\nimport { cn } from "@/lib/utils";\n\nconst buttonVariants = cva(\n "inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4",\n {\n variants: {\n variant: {\n default: "bg-primary text-primary-foreground hover:bg-primary/90",\n destructive:\n "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",\n outline:\n "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",\n secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",\n ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",\n link: "text-primary underline-offset-4 hover:underline",\n },\n size: {\n default: "h-9 px-4 py-2 has-[>svg]:px-3",\n xs: "h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*=\'size-\'])]:size-3",\n sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",\n lg: "h-10 rounded-md px-6 has-[>svg]:px-4",\n icon: "size-9",\n "icon-xs": "size-6 rounded-md [&_svg:not([class*=\'size-\'])]:size-3",\n "icon-sm": "size-8",\n "icon-lg": "size-10",\n },\n },\n defaultVariants: {\n variant: "default",\n size: "default",\n },\n },\n);\n\nfunction Button({\n className,\n variant = "default",\n size = "default",\n asChild = false,\n ...props\n}: React.ComponentProps<"button"> &\n VariantProps & {\n asChild?: boolean;\n }) {\n const Comp = asChild ? Slot.Root : "button";\n\n return (\n \n );\n}\n\nexport { Button, buttonVariants };\n'; readonly "components/ui/collapsible.tsx": '"use client";\n\nimport { Collapsible as CollapsiblePrimitive } from "radix-ui";\n\nfunction Collapsible({ ...props }: React.ComponentProps) {\n return ;\n}\n\nfunction CollapsibleTrigger({\n ...props\n}: React.ComponentProps) {\n return ;\n}\n\nfunction CollapsibleContent({\n ...props\n}: React.ComponentProps) {\n return ;\n}\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent };\n'; readonly "components/ui/command.tsx": '"use client";\n\nimport * as React from "react";\nimport { Command as CommandPrimitive } from "cmdk";\nimport { SearchIcon } from "lucide-react";\n\nimport { cn } from "@/lib/utils";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from "@/components/ui/dialog";\n\nfunction Command({ className, ...props }: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction CommandDialog({\n title = "Command Palette",\n description = "Search for a command to run...",\n children,\n className,\n showCloseButton = true,\n ...props\n}: React.ComponentProps & {\n title?: string;\n description?: string;\n className?: string;\n showCloseButton?: boolean;\n}) {\n return (\n \n \n {title}\n {description}\n \n \n \n {children}\n \n \n \n );\n}\n\nfunction CommandInput({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n
\n \n \n
\n );\n}\n\nfunction CommandList({ className, ...props }: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction CommandEmpty({ ...props }: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction CommandGroup({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction CommandSeparator({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction CommandItem({ className, ...props }: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction CommandShortcut({ className, ...props }: React.ComponentProps<"span">) {\n return (\n \n );\n}\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n'; readonly "components/ui/dialog.tsx": '"use client";\n\nimport * as React from "react";\nimport { XIcon } from "lucide-react";\nimport { Dialog as DialogPrimitive } from "radix-ui";\n\nimport { cn } from "@/lib/utils";\nimport { Button } from "@/components/ui/button";\n\nfunction Dialog({ ...props }: React.ComponentProps) {\n return ;\n}\n\nfunction DialogTrigger({ ...props }: React.ComponentProps) {\n return ;\n}\n\nfunction DialogPortal({ ...props }: React.ComponentProps) {\n return ;\n}\n\nfunction DialogClose({ ...props }: React.ComponentProps) {\n return ;\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n ...props\n}: React.ComponentProps & {\n showCloseButton?: boolean;\n}) {\n return (\n \n \n \n {children}\n {showCloseButton && (\n \n \n Close\n \n )}\n \n \n );\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<"div">) {\n return (\n \n );\n}\n\nfunction DialogFooter({\n className,\n showCloseButton = false,\n children,\n ...props\n}: React.ComponentProps<"div"> & {\n showCloseButton?: boolean;\n}) {\n return (\n \n {children}\n {showCloseButton && (\n \n \n \n )}\n

\n );\n}\n\nfunction DialogTitle({ className, ...props }: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n'; readonly "components/ui/dropdown-menu.tsx": '"use client";\n\nimport * as React from "react";\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";\nimport { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";\n\nimport { cn } from "@/lib/utils";\n\nfunction DropdownMenu({ ...props }: React.ComponentProps) {\n return ;\n}\n\nfunction DropdownMenuPortal({\n ...props\n}: React.ComponentProps) {\n return ;\n}\n\nfunction DropdownMenuTrigger({\n ...props\n}: React.ComponentProps) {\n return ;\n}\n\nfunction DropdownMenuContent({\n className,\n sideOffset = 4,\n ...props\n}: React.ComponentProps) {\n return (\n \n \n \n );\n}\n\nfunction DropdownMenuGroup({ ...props }: React.ComponentProps) {\n return ;\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = "default",\n ...props\n}: React.ComponentProps & {\n inset?: boolean;\n variant?: "default" | "destructive";\n}) {\n return (\n \n );\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps) {\n return (\n \n \n \n \n \n \n {children}\n \n );\n}\n\nfunction DropdownMenuRadioGroup({\n ...props\n}: React.ComponentProps) {\n return ;\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps) {\n return (\n \n \n \n \n \n \n {children}\n \n );\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps & {\n inset?: boolean;\n}) {\n return (\n \n );\n}\n\nfunction DropdownMenuSeparator({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">) {\n return (\n \n );\n}\n\nfunction DropdownMenuSub({ ...props }: React.ComponentProps) {\n return ;\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps & {\n inset?: boolean;\n}) {\n return (\n \n {children}\n \n \n );\n}\n\nfunction DropdownMenuSubContent({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n};\n'; readonly "components/ui/hover-card.tsx": '"use client";\n\nimport * as React from "react";\nimport { HoverCard as HoverCardPrimitive } from "radix-ui";\n\nimport { cn } from "@/lib/utils";\n\nfunction HoverCard({ ...props }: React.ComponentProps) {\n return ;\n}\n\nfunction HoverCardTrigger({ ...props }: React.ComponentProps) {\n return ;\n}\n\nfunction HoverCardContent({\n className,\n align = "center",\n sideOffset = 4,\n ...props\n}: React.ComponentProps) {\n return (\n \n \n \n );\n}\n\nexport { HoverCard, HoverCardTrigger, HoverCardContent };\n'; readonly "components/ui/input-group.tsx": '"use client";\n\nimport * as React from "react";\nimport { cva, type VariantProps } from "class-variance-authority";\n\nimport { cn } from "@/lib/utils";\nimport { Button } from "@/components/ui/button";\nimport { Input } from "@/components/ui/input";\nimport { Textarea } from "@/components/ui/textarea";\n\nfunction InputGroup({ className, ...props }: React.ComponentProps<"div">) {\n return (\n textarea]:h-auto",\n\n // Variants based on alignment.\n "has-[>[data-align=inline-start]]:[&>input]:pl-2",\n "has-[>[data-align=inline-end]]:[&>input]:pr-2",\n "has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3",\n "has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",\n\n // Focus state.\n "has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50",\n\n // Error state.\n "has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",\n\n className,\n )}\n {...props}\n />\n );\n}\n\nconst inputGroupAddonVariants = cva(\n "flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*=\'size-\'])]:size-4",\n {\n variants: {\n align: {\n "inline-start": "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",\n "inline-end": "order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",\n "block-start":\n "order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3",\n "block-end":\n "order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3",\n },\n },\n defaultVariants: {\n align: "inline-start",\n },\n },\n);\n\nfunction InputGroupAddon({\n className,\n align = "inline-start",\n ...props\n}: React.ComponentProps<"div"> & VariantProps) {\n return (\n {\n if ((e.target as HTMLElement).closest("button")) {\n return;\n }\n e.currentTarget.parentElement?.querySelector("input")?.focus();\n }}\n {...props}\n />\n );\n}\n\nconst inputGroupButtonVariants = cva("flex items-center gap-2 text-sm shadow-none", {\n variants: {\n size: {\n xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*=\'size-\'])]:size-3.5",\n sm: "h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5",\n "icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",\n "icon-sm": "size-8 p-0 has-[>svg]:p-0",\n },\n },\n defaultVariants: {\n size: "xs",\n },\n});\n\nfunction InputGroupButton({\n className,\n type = "button",\n variant = "ghost",\n size = "xs",\n ...props\n}: Omit, "size"> &\n VariantProps) {\n return (\n \n );\n}\n\nfunction InputGroupText({ className, ...props }: React.ComponentProps<"span">) {\n return (\n \n );\n}\n\nfunction InputGroupInput({ className, ...props }: React.ComponentProps<"input">) {\n return (\n \n );\n}\n\nfunction InputGroupTextarea({ className, ...props }: React.ComponentProps<"textarea">) {\n return (\n \n );\n}\n\nexport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupText,\n InputGroupInput,\n InputGroupTextarea,\n};\n'; readonly "components/ui/input.tsx": 'import * as React from "react";\n\nimport { cn } from "@/lib/utils";\n\nfunction Input({ className, type, ...props }: React.ComponentProps<"input">) {\n return (\n \n );\n}\n\nexport { Input };\n'; readonly "components/ui/questionnaire.tsx": '"use client";\n\nimport * as React from "react";\nimport { Questionnaire as QuestionnairePrimitive } from "@shadcn/react/questionnaire";\nimport { CheckIcon } from "lucide-react";\n\nimport { buttonVariants, type Button } from "@/components/ui/button";\nimport { cn } from "@/lib/utils";\n\nfunction Questionnaire({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction QuestionnaireProgress({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction QuestionnaireItem({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction QuestionnaireTitle({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction QuestionnaireDescription({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction QuestionnaireChoices({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction QuestionnaireChoice({\n children,\n className,\n ...props\n}: React.ComponentProps) {\n return (\n input:focus-visible]:border-ring has-[>input:focus-visible]:ring-3 has-[>input:focus-visible]:ring-ring/50 data-invalid:border-destructive dark:bg-input/20 data-checked:border-primary/40 data-checked:bg-muted dark:data-checked:bg-muted",\n "data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:opacity-50",\n className,\n )}\n {...props}\n >\n \n
\n );\n}\n\nfunction QuestionnaireError({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction QuestionnaireActions({ className, ...props }: React.ComponentProps<"div">) {\n return (\n \n );\n}\n\nfunction QuestionnairePrevious({\n children,\n className,\n size = "default",\n variant = "outline",\n ...props\n}: React.ComponentProps &\n Pick, "size" | "variant">) {\n return (\n \n {children ?? "Previous"}\n \n );\n}\n\nfunction QuestionnaireSkip({\n children,\n className,\n size = "default",\n variant = "outline",\n ...props\n}: React.ComponentProps &\n Pick, "size" | "variant">) {\n return (\n \n {children ?? "Skip"}\n \n );\n}\n\nfunction QuestionnaireNext({\n children,\n className,\n size = "default",\n variant = "default",\n ...props\n}: React.ComponentProps &\n Pick, "size" | "variant">) {\n return (\n \n {children ?? "Next"}\n \n );\n}\n\nfunction QuestionnaireSubmit({\n children,\n className,\n size = "default",\n variant = "default",\n ...props\n}: React.ComponentProps &\n Pick, "size" | "variant">) {\n return (\n \n {children ?? "Submit"}\n \n );\n}\n\nexport {\n Questionnaire,\n QuestionnaireActions,\n QuestionnaireChoice,\n QuestionnaireChoiceDescription,\n QuestionnaireChoices,\n QuestionnaireDescription,\n QuestionnaireError,\n QuestionnaireInput,\n QuestionnaireItem,\n QuestionnaireNext,\n QuestionnairePrevious,\n QuestionnaireProgress,\n QuestionnaireSkip,\n QuestionnaireSubmit,\n QuestionnaireTitle,\n};\n'; readonly "components/ui/select.tsx": '"use client";\n\nimport * as React from "react";\nimport { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";\nimport { Select as SelectPrimitive } from "radix-ui";\n\nimport { cn } from "@/lib/utils";\n\nfunction Select({ ...props }: React.ComponentProps) {\n return ;\n}\n\nfunction SelectGroup({ ...props }: React.ComponentProps) {\n return ;\n}\n\nfunction SelectValue({ ...props }: React.ComponentProps) {\n return ;\n}\n\nfunction SelectTrigger({\n className,\n size = "default",\n children,\n ...props\n}: React.ComponentProps & {\n size?: "sm" | "default";\n}) {\n return (\n \n {children}\n \n \n \n \n );\n}\n\nfunction SelectContent({\n className,\n children,\n position = "item-aligned",\n align = "center",\n ...props\n}: React.ComponentProps) {\n return (\n \n \n \n \n {children}\n \n \n \n \n );\n}\n\nfunction SelectLabel({ className, ...props }: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction SelectItem({\n className,\n children,\n ...props\n}: React.ComponentProps) {\n return (\n \n \n \n \n \n \n {children}\n \n );\n}\n\nfunction SelectSeparator({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction SelectScrollUpButton({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n \n \n );\n}\n\nfunction SelectScrollDownButton({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n \n \n );\n}\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n};\n'; readonly "components/ui/separator.tsx": '"use client";\n\nimport * as React from "react";\nimport { Separator as SeparatorPrimitive } from "radix-ui";\n\nimport { cn } from "@/lib/utils";\n\nfunction Separator({\n className,\n orientation = "horizontal",\n decorative = true,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nexport { Separator };\n'; readonly "components/ui/spinner.tsx": 'import { Loader2Icon } from "lucide-react";\n\nimport { cn } from "@/lib/utils";\n\nfunction Spinner({ className, ...props }: React.ComponentProps<"svg">) {\n return (\n \n );\n}\n\nexport { Spinner };\n'; readonly "components/ui/textarea.tsx": 'import * as React from "react";\n\nimport { cn } from "@/lib/utils";\n\nfunction Textarea({ className, ...props }: React.ComponentProps<"textarea">) {\n return (\n \n );\n}\n\nexport { Textarea };\n'; readonly "components/ui/tooltip.tsx": '"use client";\n\nimport * as React from "react";\nimport { Tooltip as TooltipPrimitive } from "radix-ui";\n\nimport { cn } from "@/lib/utils";\n\nfunction TooltipProvider({\n delayDuration = 0,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction Tooltip({ ...props }: React.ComponentProps) {\n return ;\n}\n\nfunction TooltipTrigger({ ...props }: React.ComponentProps) {\n return ;\n}\n\nfunction TooltipContent({\n className,\n sideOffset = 0,\n children,\n ...props\n}: React.ComponentProps) {\n return (\n \n \n {children}\n \n \n \n );\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n'; readonly "components.json": '{\n "$schema": "https://ui.shadcn.com/schema.json",\n "style": "new-york",\n "rsc": true,\n "tsx": true,\n "tailwind": {\n "config": "",\n "css": "app/globals.css",\n "baseColor": "neutral",\n "cssVariables": true,\n "prefix": ""\n },\n "iconLibrary": "lucide",\n "aliases": {\n "components": "@/components",\n "utils": "@/lib/utils",\n "ui": "@/components/ui",\n "lib": "@/lib",\n "hooks": "@/hooks"\n },\n "registries": {}\n}\n'; readonly "css.d.ts": 'declare module "*.css";\n'; readonly "lib/utils.ts": 'import { clsx, type ClassValue } from "clsx";\nimport { twMerge } from "tailwind-merge";\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n'; readonly "next-env.d.ts": '/// \n/// \nimport "./.next/types/routes.d.ts";\nimport "./.next/types/root-params.d.ts";\n\n// NOTE: This file should not be edited\n// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.\n'; readonly "next.config.ts": 'import type { NextConfig } from "next";\nimport { withEve } from "eve/next";\n\nconst nextConfig: NextConfig = {};\n\nexport default withEve(nextConfig__EVE_INIT_WITH_EVE_OPTIONS__);\n'; readonly "postcss.config.mjs": 'const config = {\n plugins: {\n "@tailwindcss/postcss": {},\n },\n};\n\nexport default config;\n'; readonly "proxy.ts": 'import type { NextRequest } from "next/server";\nimport { NextResponse } from "next/server";\n\nexport function proxy(request: NextRequest) {\n const routerHost = process.env.VERCEL_URL;\n const forwardedHost = request.headers.get("x-forwarded-host");\n if (process.env.__VERCEL_DEV_RUNNING === "1" && routerHost && forwardedHost !== routerHost) {\n const target = request.nextUrl.clone();\n target.protocol = "http:";\n target.host = routerHost;\n return NextResponse.redirect(target);\n }\n return NextResponse.next();\n}\n'; readonly "tsconfig.json": '{\n "$schema": "https://json.schemastore.org/tsconfig",\n "compilerOptions": {\n "target": "ES2017",\n "lib": ["dom", "dom.iterable", "esnext"],\n "allowJs": true,\n "skipLibCheck": true,\n "strict": true,\n "noEmit": true,\n "esModuleInterop": true,\n "module": "esnext",\n "moduleResolution": "Bundler",\n "resolveJsonModule": true,\n "isolatedModules": true,\n "jsx": "react-jsx",\n "incremental": true,\n "plugins": [\n {\n "name": "next"\n }\n ],\n "paths": {\n "@/*": ["./*"]\n }\n },\n "include": [\n "next-env.d.ts",\n "**/*.ts",\n "**/*.tsx",\n ".next/types/**/*.ts",\n ".next/dev/types/**/*.ts"\n ],\n "exclude": ["node_modules"]\n}\n'; }; export declare const WEB_CHANNEL_TEMPLATES: { readonly default: 'import { eveChannel } from "eve/channels/eve";\nimport { localDev, placeholderAuth, vercelOidc } from "eve/channels/auth";\n\nexport default eveChannel({\n auth: [\n // Lets the eve TUI and your Vercel deployments reach the deployed agent.\n vercelOidc(),\n // Open on localhost for `eve dev` and the REPL; ignored in production.\n localDev(),\n // This placeholder will not allow browser requests in production.\n // Replace it with your app\'s auth provider, like Auth.js or Clerk,\n // or use none() for a public demo.\n placeholderAuth(),\n ],\n});\n'; readonly "sign-in-with-vercel": 'import { eveChannel } from "eve/channels/eve";\nimport { localDev, type AuthFn, vercelOidc } from "eve/channels/auth";\nimport { auth } from "@/lib/auth";\n\nconst betterAuthSession: AuthFn = async (request) => {\n const session = await auth.api.getSession({ headers: request.headers });\n if (!session) return null;\n\n const attributes: Record = {\n email: session.user.email,\n name: session.user.name,\n };\n if (session.user.image) {\n attributes.picture = session.user.image;\n }\n\n return {\n attributes,\n authenticator: "better-auth:vercel",\n principalId: session.user.id,\n principalType: "user",\n };\n};\n\nexport default eveChannel({\n auth: [betterAuthSession, vercelOidc(), localDev()],\n});\n'; }; export declare const WEB_APP_SIGN_IN_WITH_VERCEL_TEMPLATE_FILES: { readonly "app/_components/authenticated-agent-chat.tsx": 'import { headers } from "next/headers";\nimport { auth } from "@/lib/auth";\nimport { AgentChat } from "./agent-chat";\nimport { AccountControl, SignIn } from "./web-chat-auth";\n\nexport async function AuthenticatedAgentChat({\n sessionId,\n sessionless,\n}: {\n readonly sessionId?: string;\n readonly sessionless?: boolean;\n}) {\n if (process.env.NODE_ENV === "development") {\n return ;\n }\n\n const session = await auth.api.getSession({ headers: await headers() });\n if (!session) return ;\n\n return (\n <>\n \n \n \n );\n}\n'; readonly "app/_components/web-chat-auth.tsx": '"use client";\n\nimport { LogOutIcon } from "lucide-react";\nimport { useState } from "react";\nimport { Button } from "@/components/ui/button";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from "@/components/ui/dropdown-menu";\nimport { authClient } from "@/lib/auth-client";\n\nconst AGENT_NAME = "__EVE_INIT_APP_NAME__";\n\nexport function SignIn() {\n const [pending, setPending] = useState(false);\n const [error, setError] = useState();\n\n async function signIn() {\n setPending(true);\n setError(undefined);\n try {\n const result = await authClient.signIn.social({\n callbackURL: "/",\n provider: "vercel",\n });\n if (!result.error) return;\n setPending(false);\n setError("Sign-in failed. Try again.");\n } catch {\n setPending(false);\n setError("Sign-in failed. Try again.");\n }\n }\n\n return (\n
\n
\n
\n \n
\n
\n

{AGENT_NAME}

\n

\n \n \n \n Sign in to start a session\n

\n \n {error ? (\n

\n {error}\n

\n ) : null}\n
\n
\n
\n );\n}\n\nfunction EveWordmark({ className }: { readonly className?: string }) {\n return (\n