import { documentsRoot as docsRoot } from "../files/layout.js"; export interface KnowledgeEntry { id: string; title: string; content: string; source: string; createdAt: number; updatedAt: number; } export interface KnowledgeTreeNode { path: string; name: string; kind: "file" | "folder"; title?: string; children?: KnowledgeTreeNode[]; } /** * Normalize an incoming document path. Prevents path traversal and returns a * path RELATIVE to docs/, using POSIX separators for stable IDs. */ declare function normalizeDocPath(docPath: string): string; /** Resolve a normalized relative path to an absolute filesystem path inside docs/. */ declare function absDocPath(relativeDocPath: string): string; export declare function getDocumentTree(): KnowledgeTreeNode; /** Flat list of all documents (used for search and lists that need full content). */ export declare function listEntries(): KnowledgeEntry[]; export declare function getEntry(entryId: string): KnowledgeEntry | null; export declare function getPathType(path: string): "file" | "folder" | null; export declare function getRawEntry(entryId: string): { path: string; contentType: string; data: Buffer; } | null; /** * Write/overwrite a text document. If no extension is provided, `.md` is appended. * Creates intermediate directories. Frontmatter is not injected or parsed. */ export declare function addEntry(title: string, content: string, source: string, path?: string): KnowledgeEntry; export declare function updateEntry(entryId: string, content: string): KnowledgeEntry | null; export declare function writePngEntry(docPath: string, data: Buffer): KnowledgeEntry; export type PathMutation = { ok: true; type: "file" | "folder"; from: string; to?: string; } | { ok: false; error: string; }; export declare function movePath(fromPath: string, toPath: string): PathMutation; export declare function deletePath(path: string): PathMutation; export declare function slugify(input: string): string; /** Re-export path helpers for migration / external callers. */ export declare const _internal: { normalizeDocPath: typeof normalizeDocPath; docsRoot: typeof docsRoot; absDocPath: typeof absDocPath; }; export {}; //# sourceMappingURL=documents.d.ts.map