import type { ContextEntry, ContextManifest, ContextVaultConfig } from '../types/context-vault.js'; declare const DEFAULT_ALLOWED_FOLDERS: string[]; declare const DEFAULT_CONFIG: ContextVaultConfig; export { DEFAULT_ALLOWED_FOLDERS, DEFAULT_CONFIG }; /** * Strips path traversal sequences, null bytes, and non-printable chars from a filename. * Returns just the basename with unsafe characters replaced. */ export declare function sanitizeFilename(name: string): string; /** * Validates that a MIME type is in the allowlist. */ export declare function validateMime(mimeType: string, config?: ContextVaultConfig): boolean; /** * Initializes the context vault directory structure and manifest file. * Creates the context root and all default folders. If the manifest already exists, it is preserved. */ export declare function initVault(workspaceCwd: string): ContextManifest; /** * Reads and parses the manifest file. Returns a fresh empty manifest if the file does not exist. */ export declare function readManifest(workspaceCwd: string): ContextManifest; /** * Writes the manifest atomically using temp + rename. */ export declare function writeManifest(workspaceCwd: string, manifest: ContextManifest): void; export type AddEntryInput = { filename: string; folder: string; mimeType: string; tags?: string[]; description?: string; data: Buffer; }; /** * Adds a new file entry to the vault. * Stores the physical file as `/-` and updates the manifest. * If the file is a PDF or DOCX, automatically extracts text and stores a linked markdown transcript. * Returns the created entry (with transcriptId populated when extraction succeeds). */ export declare function addEntry(workspaceCwd: string, input: AddEntryInput): Promise; /** * Removes an entry from the manifest and deletes its physical file. * * Cascades across the PDF/DOCX ⇄ auto-extracted-transcript link so no orphan is * ever left behind. Removing an ORIGINAL that has a `transcriptId` also removes * its transcript (file + manifest entry) — otherwise the `.transcript.md` would * dangle with a "Source:" pointer to a file that no longer exists. Removing a * TRANSCRIPT clears the now-dangling `transcriptId` on its parent so the parent * no longer points at a deleted entry. * * Returns true if the requested entry was found and removed, false otherwise. */ export declare function removeEntry(workspaceCwd: string, entryId: string): boolean; export type UpdateEntryInput = { tags?: string[]; description?: string; folder?: string; }; /** * Updates metadata fields (tags, description, folder) of an existing entry. * If folder changes, the physical file is moved. * Returns the updated entry or null if not found. */ export declare function updateEntry(workspaceCwd: string, entryId: string, updates: UpdateEntryInput): ContextEntry | null; /** * Returns the absolute file path for an entry, or null if the entry doesn't exist. */ export declare function getEntryFile(workspaceCwd: string, entryId: string): string | null;