- PracticeDock (components/practice-dock.tsx): the active problem replaces the composer — statement (markdown+LaTeX) above, the 'Your thinking' composer-twin below with the two submit lanes (Nudge = thinking without a commit; Commit = answer commit; ⌘/Ctrl+Enter commits). Dictation claims the thinking field. - Transcript cards (practice-cards.tsx + the artifact registry): the problem card (compact-expandable statement — the commitment NEVER renders), the conclude card (outcome + verdict + reveal; the dismissal synthesis is one muted line), and the user-side thinking register cards (Your thinking / Your solution). - view.ts: the problem pose joins the placeholder fork (the ack never flips the part); practice-thinking markers project as data parts; problem-dismissed markers project nothing. - chat.tsx: activeProblemOf drives the dock branch (question > problem > composer), the esc layering gains the problem rung (below question, above turn) with its discard confirm + the silent marker route; the thinking submissions POST through the session's optimistic appends.
54 lines
2.6 KiB
TypeScript
54 lines
2.6 KiB
TypeScript
import type { ComponentType } from "react";
|
|
import type { ArtifactPartProps } from "@/src/core";
|
|
import { DemoCard } from "@/components/artifacts/demo-card";
|
|
import { JobCard, PdfJobCard } from "@/components/artifacts/job-card";
|
|
import { VisualCard } from "@/components/artifacts/visual-card";
|
|
import { ProbeDoneCard } from "@/components/artifacts/probe-done-card";
|
|
import { ToolCallCard } from "@/components/artifacts/tool-call-card";
|
|
import { ProblemCard, ConcludeCard } from "@/components/practice-cards";
|
|
|
|
/**
|
|
* Artifact renderer registry — the extension point for tool-part UI.
|
|
*
|
|
* chat.tsx renders any tool part it doesn't specially handle (i.e. not
|
|
* quiz/ask) by looking the tool name up here. Add your renderer — do NOT
|
|
* edit chat.tsx (see docs/plan.md file-ownership rules).
|
|
*
|
|
* Typical shape: while the part is input-available render an activity card
|
|
* (the chat view's jobs feed reads GET /api/jobs?chatId=…; on completion call
|
|
* ChatActionsContext.syncFromServer()); when output-available render the
|
|
* artifact itself from part.output.
|
|
*/
|
|
export const artifactRenderers: Record<string, ComponentType<ArtifactPartProps>> = {
|
|
research: JobCard,
|
|
pdf: PdfJobCard, // sources v0 — live smoke 2026-09-19 caught the gap: without this the tool-pdf dispatch part rendered nothing
|
|
// plan_* parts render nothing inline by design: the phase seam is a
|
|
// message-level boundary, drawn by PhaseDivider in chat.tsx (the old
|
|
// part-level plan_init divider retired with it).
|
|
// Artifacts (W6 fills in the components):
|
|
demo: DemoCard,
|
|
visual: VisualCard,
|
|
// The probe conclusion: the assessment belongs to the learner as much as
|
|
// to the transcript (docs/probe-teach-split.md §2). Plain v1 card.
|
|
probe_done: ProbeDoneCard,
|
|
// The learner-filesystem set (sources v1): one quiet expandable
|
|
// tool-call card each — collapsed one-liner (tool name + headline
|
|
// argument), full input/output on expand.
|
|
read: ToolCallCard,
|
|
ls: ToolCallCard,
|
|
find: ToolCallCard,
|
|
grep: ToolCallCard,
|
|
// The practice pair (2026-10-04): the pose renders the statement ONLY
|
|
// (the commitment lives in the call's arguments and never renders);
|
|
// the conclusion carries the outcome + verdict + the reveal.
|
|
problem: ProblemCard,
|
|
conclude: ConcludeCard,
|
|
// The prober's graph tools (wave 7): same quiet expandable card —
|
|
// collapsed one-liner (tool name + the session id for
|
|
// list_propositions), the tool's own compact row-per-line output
|
|
// (name / level / date) verbatim on expand, exactly the read/ls
|
|
// discipline (their results are pre-formatted strings too).
|
|
list_sessions: ToolCallCard,
|
|
list_propositions: ToolCallCard,
|
|
};
|