/** Pure helpers: slugify, artifact file I/O, browser open. */ /** Absolute path to the artifacts dir for the current project. */ export declare function artifactDir(): string; /** Ensure the artifacts dir exists, return its absolute path. */ export declare function ensureArtifactDir(): string; /** Kebab-case slug from a title. Lowercase, alnum + hyphens, trimmed. */ export declare function slugify(title: string): string; /** Reject path traversal; a slug must be a bare filename (no separators, no dots-prefix). */ export declare function isSafeSlug(slug: string): boolean; /** Absolute path to a single artifact file. */ export declare function artifactPath(slug: string): string; /** Write artifact HTML to .html, creating the dir lazily. */ export declare function writeArtifact(slug: string, html: string): string; /** Absolute path to a slug's annotations sidecar (.annotations.json). */ export declare function annotationsPath(slug: string): string; /** Absolute path to a slug's raw markdown source mirror (.md). */ export declare function sourcePath(slug: string): string; /** Write the raw markdown source mirror for a slug, creating the dir lazily. */ export declare function writeSourceMirror(slug: string, content: string): string; /** Read an artifact file, or null if missing. */ export declare function readArtifact(slug: string): string | null; /** Does the artifact file exist? */ export declare function artifactExists(slug: string): boolean; export interface ArtifactEntry { slug: string; title: string; kind: 'markdown' | 'html'; mtime: number; absPath: string; } /** List artifacts newest-first: slug + title (from ) + kind + mtime. */ export declare function listArtifacts(): ArtifactEntry[]; /** Normalize a request path and confirm it resolves inside the artifacts dir. Returns null if unsafe. */ export declare function safeArtifactPath(reqPath: string): string | null; /** * Open a URL in the default browser. * On darwin: `open`; on win32: `rundll32 url.dll,FileProtocolHandler` (avoids `start` which * is a cmd.exe built-in and cannot be spawned directly); on linux: `xdg-open`. */ export declare function openInBrowser(url: string): void; /** Copy text to the system clipboard (pbcopy / clip / wl-copy). */ export declare function copyToClipboard(text: string): Promise<void>; /** Reveal a file in the OS file manager (Finder / Explorer / xdg-open on its directory). */ export declare function revealFile(absPath: string): void; /** Upload an artifact file as a GitHub gist via the gh CLI. Returns the gist URL. */ export declare function createGist(absPath: string, title: string, isPublic: boolean): Promise<string>; /** * Screenshot a URL to a PNG via headless Chrome-family flags. * The artifact server must already be running (the caller ensures it). */ export declare function screenshotUrl(url: string, outPath: string, width: number, height: number): Promise<void>; /** * Print a URL to PDF via headless Chrome-family flags. * The artifact server must already be running (the caller ensures it). */ export declare function pdfToFile(url: string, outPath: string): Promise<void>; /** Copy any file to the clipboard as a file reference (macOS only). Returns false elsewhere or on failure. */ export declare function copyFileToClipboard(absPath: string): Promise<boolean>; /** Copy a PNG file to the clipboard as an image (macOS only). Returns false on other platforms or failure. */ export declare function copyImageToClipboard(absPath: string): Promise<boolean>;