import { withEditNotes as withEditNotesMjs } from "./edit-guard.mjs"; // THE one wrapper every manifest writer's route goes through: the manifest is // read before and after the write, and on a GENERATED manifest every change // becomes an `edit` note for the agent that generates it. The implementation // is ./edit-guard.mjs, plain JS so the `umtool window` CLI runs the same one; // this file only types it for the routes. export type EditNotes = { generatedBy: string; added: number; updated: number; deleted: number; errors: string[] }; export async function withEditNotes( project: { id: string; dir: string; kind: string }, write: () => Promise, ): Promise<{ result: T; editNotes: EditNotes | null }> { return withEditNotesMjs(project, write) as Promise<{ result: T; editNotes: EditNotes | null }>; }