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
+13
View File
@@ -0,0 +1,13 @@
import type { ToolSet } from "ai";
import type { TeacherToolContext } from "../tools.ts";
/**
* Async sub-agent job tools — W2 workstream (research; W6 adds demo + visual).
* CLIENT-SIDE semantics (no execute): the turn ends with the part pending, a
* background runner fulfills it, and the client continuation resumes the
* teacher. See src/core/contracts.ts "THE ASYNC PROTOCOL" — read it first.
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function jobTools(ctx: TeacherToolContext): ToolSet {
return {};
}
+16
View File
@@ -0,0 +1,16 @@
import type { ToolSet } from "ai";
import type { TeacherToolContext } from "../tools.ts";
/**
* Plan-tree tools — W1 workstream (docs/plan.md Wave 1; src/core/contracts.ts
* "Plan tree" section). Server-side tools WITH execute that mutate the chat's
* stored PlanTree and return the full updated tree (PlanToolResult).
*
* Tool names to implement: plan_init, plan_add_node, plan_update_node,
* plan_remove_node, plan_add_edge, plan_remove_edge, plan_set_current,
* plan_mark_done.
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function planTools(ctx: TeacherToolContext): ToolSet {
return {};
}