2026-08-22 02:18:27 +03:00
|
|
|
import type { UIMessage } from "ai";
|
2026-08-31 19:51:17 +03:00
|
|
|
import type { AskToolInput, QuestionAnswerData, QuizToolInput } from "./question-core.ts";
|
2026-08-22 02:18:27 +03:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The typed UI message for the teacher chat — gives the frontend typed tool
|
|
|
|
|
* parts ("tool-quiz" / "tool-ask_user_question" with typed input/output)
|
|
|
|
|
* without importing the server-side agent into the client bundle.
|
|
|
|
|
*
|
|
|
|
|
* Declared explicitly (not via InferUITools) because a client-side tool has
|
|
|
|
|
* no execute function, so its OUTPUT type lives only here: the structured
|
|
|
|
|
* answer record the client builds and sends via addToolOutput.
|
|
|
|
|
*/
|
|
|
|
|
export type TeacherUITools = {
|
|
|
|
|
quiz: { input: QuizToolInput; output: QuestionAnswerData };
|
|
|
|
|
ask_user_question: { input: AskToolInput; output: QuestionAnswerData };
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type TeacherUIMessage = UIMessage<unknown, never, TeacherUITools>;
|