import { SynthOSConfig } from './init'; import { SectionMode } from './builders/types'; /** * Derive the list of required page names by scanning *.html files * across one or more requiredPages folders. */ export declare function getRequiredPages(requiredPagesFolders: string[]): Promise; export declare const PAGE_VERSION = 3; export interface PageInfo { name: string; title: string; description: string; categories: string[]; pinned: boolean; showInAll: boolean; createdDate: string; lastModified: string; pageVersion: number; mode: 'unlocked' | 'locked'; greeting: string; firstRunGreeting: string; /** * Per-page overrides for builder context-section modes. Maps a section * title (e.g. "") to a SectionMode that overrides * the producer-declared default. Optional and rarely needed. */ sectionModes?: Record; } export type PageMetadata = Omit; export declare function loadPageMetadata(config: SynthOSConfig, name: string, fallbackFolders?: string[]): Promise; export declare function parseMetadata(parsed: Record): PageMetadata; export declare function savePageMetadata(config: SynthOSConfig, name: string, metadata: PageMetadata): Promise; export declare function listPages(config: SynthOSConfig, fallbackPagesFolders: string[]): Promise; export declare function loadPageState(config: SynthOSConfig, name: string): Promise; export declare function normalizePageName(name: string | undefined): string | undefined; export declare function savePageState(config: SynthOSConfig, name: string, content: string, title?: string, categories?: string[]): Promise; export declare function deletePage(config: SynthOSConfig, name: string): Promise; export interface ChatMessage { role: 'user' | 'assistant'; content: string; } /** * Save the HTML produced by change : page.c.html */ export declare function saveChangeHtml(config: SynthOSConfig, name: string, n: number, html: string): Promise; /** * Load the HTML produced by change (undefined if missing). */ export declare function loadChangeHtml(config: SynthOSConfig, name: string, n: number): Promise; /** * Highest N such that page.c.html exists (0 if none). */ export declare function getLatestChangeHtmlNumber(config: SynthOSConfig, name: string): Promise; /** * Highest N across both .html and .json files (0 if none) — used when * assigning the next change number so errors (JSON only) still advance. */ export declare function getLatestChangeNumber(config: SynthOSConfig, name: string): Promise; /** * Save the messages list for change : page.c.json */ export declare function saveChangeMessages(config: SynthOSConfig, name: string, n: number, messages: ChatMessage[]): Promise; /** * Load the messages list for change . Returns [] if the file doesn't * exist or is corrupted. */ export declare function loadChangeMessages(config: SynthOSConfig, name: string, n: number): Promise; /** * Append a single message to the current page.c.json (creating it if * missing). Used for errors — always targets the highest existing N, or * creates c1 if none exist. */ export declare function appendMessageToCurrentChange(config: SynthOSConfig, name: string, message: ChatMessage): Promise; /** * Flat concat of all page.c.json messages in numeric order. */ export declare function loadAllChangeMessages(config: SynthOSConfig, name: string): Promise; /** * Delete a single change's html + json pair (either may be missing). */ export declare function deleteChange(config: SynthOSConfig, name: string, n: number): Promise; /** * Delete all page.c*.html and page.c*.json files for a page. */ export declare function clearChanges(config: SynthOSConfig, name: string): Promise; /** * One-shot lazy migration: on first touch of a page, rename any * legacy page.v.html to page.c.html and split any legacy * chat-history.json into page.c.json files grouped by user turn. * Idempotent — does nothing if no legacy files remain. */ export declare function migrateLegacyChangeFiles(config: SynthOSConfig, name: string): Promise; export interface CopyPageOptions { copyTables?: boolean; copyFiles?: boolean; } export declare function copyPage(config: SynthOSConfig, sourceName: string, targetName: string, title: string, categories: string[], requiredPagesFolders: string[], options?: CopyPageOptions): Promise; //# sourceMappingURL=pages.d.ts.map