import { Action, DocumentModelGlobalState, PHDocument, Reducer } from "@powerhousedao/shared/document-model"; //#region codegen/spec-api.d.ts type DocumentModelInfo = { name: string; type: string; description: string; extension: string; authorName: string; authorWebsite: string; }; /** Mirrors reactor-mcp `getDocumentModels`. */ declare function getDocumentModels(): DocumentModelInfo[]; /** Mirrors reactor-mcp `getDocumentModelSchema`. Returns the full * `DocumentModelGlobalState` (schema + operations + errors), same payload * shape reactor-mcp serves. */ declare function getDocumentModelSchema(documentType: string): DocumentModelGlobalState; /** Mirrors reactor-mcp `getDocument`. Path = file location on disk. */ declare function getDocument(path: string): Promise; /** Mirrors reactor-mcp `getDocuments`. `parentId` is the project directory * containing `specs/`. */ declare function getDocuments(projectDir: string, opts?: { documentType?: string; }): Promise; /** Mirrors reactor-mcp `createDocument`. Returns an in-memory document; the * caller persists with `saveSpec`. */ declare function createDocument(documentType: string, opts?: { name?: string; initialState?: { global?: unknown; local?: unknown; }; }): PHDocument; type ActionInput = { type: string; input?: unknown; scope?: string; }; /** Mirrors reactor-mcp `addActions`. Validates every action up front against * the document model's latest specification, then applies them in order via * the reducer. If any action is invalid, throws an aggregated error and * leaves `doc` untouched. */ declare function addActions(doc: PHDocument, actions: ActionInput[]): PHDocument; type ActionValidationError = { /** Position in the input array. */index: number; /** The action's `type` field (or `` when not a string). */ type: string; /** Human-readable reasons the action was rejected. */ errors: string[]; }; /** Validate a list of actions without applying them. Returns one entry per * invalid action with all of its problems aggregated. Used by `addActions` * and exposed for callers that want a dry-run check. */ declare function validateActions(documentType: string, actions: ActionInput[]): ActionValidationError[]; /** Mirrors reactor-mcp `deleteDocument`. Removes the spec file from disk. */ declare function deleteDocument(path: string): Promise<{ success: boolean; }>; declare function addActionsAndSave(path: string, projectDir: string, actions: ActionInput[]): Promise<{ doc: PHDocument; savedPath: string; }>; //#endregion //#region codegen/specs.d.ts declare const SPECS_DIRNAME = "specs"; type ActionsModule = Record Action>; type SpecEntry = { documentType: string; subdir: string; reducer: Reducer; utils: { fileExtension: string; }; actions: ActionsModule; createDocument: (state?: any) => PHDocument; jsonSpec: DocumentModelGlobalState; }; declare function getSpecEntry(documentType: string): SpecEntry; declare function listSpecDocumentTypes(): string[]; /** Returns the directory that holds specs for a given document type. */ declare function specDir(projectDir: string, documentType: string): string; /** * Deterministic path for a doc-type + display name. * Format: `///..phd`. */ declare function specPath(projectDir: string, documentType: string, name: string): string; declare function stripLeadingDot(ext: string): string; /** Saves a document into `/specs//..phd`. */ declare function saveSpec(doc: PHDocument, projectDir: string): Promise; //#endregion export { getDocumentModels as _, specDir as a, ActionInput as c, addActions as d, addActionsAndSave as f, getDocumentModelSchema as g, getDocument as h, saveSpec as i, ActionValidationError as l, deleteDocument as m, getSpecEntry as n, specPath as o, createDocument as p, listSpecDocumentTypes as r, stripLeadingDot as s, SPECS_DIRNAME as t, DocumentModelInfo as u, getDocuments as v, validateActions as y }; //# sourceMappingURL=specs-_7A7Tl_N.d.ts.map