feat(coach): serve a message's stored tables and publish the stream contract

GET /api/insights/chat/{id}/messages/{messageId}/results returns the
tables one assistant message read, narrowed to the conversation's owner
like the conversation read, with a table withheld as module_disabled when
its domain's module is off and as unavailable when it cannot be read. A
data read: no AI capability.

The published document now describes every stream frame as the
CoachStreamEvent union, including the suggestedAction frame it never
named, the new step, result, followUps and clarification frames, their
components, the provenance fields, the followUp and clarification request
fields, and the reuse provider type.
This commit is contained in:
Marc-André Bombeck committed 2026-09-27 10:45:18 +02:00
1 parent 8fcd204172
commit ad72ae3e4c
7 files changed
+1523 -167

No files matched your search

@@ -217,6 +217,8 @@ export const DATA_ROUTES: Readonly<Record<string, string>> = {
"One stored conversation: read, rename, delete.",
"src/app/api/insights/chat/messages/[id]/feedback/route.ts":
"A rating on a message that already exists.",
"src/app/api/insights/chat/[id]/messages/[messageId]/results/route.ts":
"The stored tables of one message: the person's record, withheld per module, never per AI capability.",
"src/app/api/insights/breathing-screening/route.ts":
"Device breathing data, owned by the sleep module.",
"src/app/api/insights/labs-changes/route.ts":