The teaching agent no longer runs on pi. Stack: - ToolLoopAgent (ai@7) + OpenRouter (OPENROUTER_API_KEY), model via LH_MODEL, default anthropic/claude-sonnet-4.5 with reasoning tokens - quiz/ask_user_question = client-side tools (no server execute): the call lands as a typed tool part in input-available state; the card grades via src/core/question-core.ts; addToolOutput sends the verdict; the teacher's reaction continues the same assistant message - resume-mid-quiz is free: the pending tool part persists in the transcript - persistence: one JSON per chat (data/chats/), full UIMessage transcripts, saved onFinish (also on abort) - UI: AI Elements (owned copy-paste components, pruned to the five in use) + button-based QuizCard/AnsweredCard (ask answers never graded) - pi fully removed: TUI, extensions, Fastify+WS server, bridge, custom protocol all deleted (recoverable from git history) - tests: question-core units carry over; chat-flow integration drives handleChatRequest with MockLanguageModelV4 (48 tests, zero tokens); render smoke tests guard the cards (renderToStaticMarkup) Carried over unchanged: teacher system prompt, question-core, schema/ ledger/derive/extract pipeline, data model.
45 lines
1.5 KiB
TypeScript
45 lines
1.5 KiB
TypeScript
"use client"
|
|
|
|
import * as React from "react"
|
|
import { HoverCard as HoverCardPrimitive } from "radix-ui"
|
|
|
|
import { cn } from "@/lib/utils"
|
|
|
|
function HoverCard({
|
|
...props
|
|
}: React.ComponentProps<typeof HoverCardPrimitive.Root>) {
|
|
return <HoverCardPrimitive.Root data-slot="hover-card" {...props} />
|
|
}
|
|
|
|
function HoverCardTrigger({
|
|
...props
|
|
}: React.ComponentProps<typeof HoverCardPrimitive.Trigger>) {
|
|
return (
|
|
<HoverCardPrimitive.Trigger data-slot="hover-card-trigger" {...props} />
|
|
)
|
|
}
|
|
|
|
function HoverCardContent({
|
|
className,
|
|
align = "center",
|
|
sideOffset = 4,
|
|
...props
|
|
}: React.ComponentProps<typeof HoverCardPrimitive.Content>) {
|
|
return (
|
|
<HoverCardPrimitive.Portal data-slot="hover-card-portal">
|
|
<HoverCardPrimitive.Content
|
|
data-slot="hover-card-content"
|
|
align={align}
|
|
sideOffset={sideOffset}
|
|
className={cn(
|
|
"z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
className
|
|
)}
|
|
{...props}
|
|
/>
|
|
</HoverCardPrimitive.Portal>
|
|
)
|
|
}
|
|
|
|
export { HoverCard, HoverCardTrigger, HoverCardContent }
|