Wave 0: shared contracts + extension points

- src/core/contracts.ts: plan tree / graph / ledger / job protocol / artifact
  registry types — the single source of truth for all workstreams
- tools: per-request factory createTeacherTools({chatId}) composing
  questionTools + planTools (stub) + jobTools (stub); quiz gains nodeId
- prompt composition: system-prompt.md + sorted src/agent/prompts/*.md
- ChatRecord.tree + saveTree; pending gate scoped to quiz/ask (+findPendingJobCall)
- chat.tsx: artifact renderer extension point + ChatActionsContext.syncFromServer
This commit is contained in:
Amos
2026-08-22 09:06:24 +03:00
parent c338f468f8
commit c55bae0de6
11 changed files with 429 additions and 23 deletions
+19
View File
@@ -0,0 +1,19 @@
import type { ComponentType } from "react";
import type { ArtifactPartProps } from "@/src/core/contracts";
/**
* 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
* (poll 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>> = {
// W2: "research" → job activity card
// W6: "demo" → sandboxed iframe card, "visual" → svg card
};