import { apiGet } from "@/api/client"; /** * The reply shapes Scribe ships — `GET /api/retrieval/reply-shapes`. * The same catalog the `list_reply_shapes` MCP tool returns, plus what only * the operator's view needs: the preferences mounted on each shape's moment, * and how often each shape was delivered. */ export interface ShapePreference { id: number; title: string; statement: string; } /** How often a shape went out: whole, or as its one-line reminder. */ export interface ShapeDeliveries { full: number; pointer: number; } export interface ReplyShape { key: string; title: string; /** The moment it rides — a preference mounted here adjusts it. */ moment: string; /** What is happening at that moment. */ means: string; /** When the shape arrives, in words. */ delivered: string; /** The shipped text. Product, so read-only. */ text: string; preferences: ShapePreference[]; /** null when the counts could not be read — unknown, not zero. */ deliveries: ShapeDeliveries | null; } export interface ReplyShapesOverview { shapes: ReplyShape[]; total: number; days: number; deliveries_failed: boolean; } export async function getReplyShapes(days?: number): Promise { const q = days ? `?days=${days}` : ""; return apiGet(`/api/retrieval/reply-shapes${q}`); }