/** * Result of uploading a single image asset. */ export interface UploadedAsset { /** Original local file path */ localPath: string; /** The filename (e.g., "screenshot.png") */ filename: string; /** The GitHub URL for the uploaded image */ url: string; /** Markdown image reference: ![filename](url) */ markdown: string; } /** * Service for uploading image assets to GitHub via the REST API. * * Uploads images to a dedicated `hublaunch-assets` branch in the * repository using the Git database API (blobs, trees, commits). * This works with the standard OAuth token from `gh auth` / `hula login` * and supports files up to 100 MB. * * The resulting raw.githubusercontent.com URLs inherit the repository's * visibility — images on private repos require authentication to view. */ export declare class AssetUploadService { private token; private repoInfo; private assetsBranchReady; /** * Get the GitHub auth token from the gh CLI. */ private getToken; /** * Get repo info (cached). */ private getRepo; /** * Make an authenticated GitHub API request. */ private githubApi; /** * Ensure the assets branch exists in the remote. Creates it from the * default branch if it doesn't exist yet. */ private ensureAssetsBranch; /** * Validate that a file path points to a supported image file. * Returns the resolved absolute path, or throws with a descriptive error. */ validateImageFile(filePath: string): string; /** * Upload a single image file via the GitHub Git database API. * * Uses the blob → tree → commit → ref update flow to support * files up to 100 MB without command-line length limits. * * @param filePath - Absolute or relative path to the image file * @returns UploadedAsset with the GitHub URL and markdown reference */ uploadImage(filePath: string): Promise; /** * Upload multiple image files. * * @param filePaths - Array of file paths to upload * @returns Array of UploadedAsset results (one per file) */ uploadImages(filePaths: string[]): Promise; /** * Scan a markdown body for local image references and return the * file paths that need uploading. * * Detects patterns like: * - ![alt](./screenshot.png) * - ![alt](screenshot.png) * - ![alt](../assets/image.jpg) * - ![alt](/absolute/path/to/image.png) * * Only matches paths that: * 1. Have a supported image extension * 2. Do NOT start with http:// or https:// (those are already URLs) * 3. Point to files that exist on disk * * @param body - The markdown content to scan * @param basePath - The directory to resolve relative paths against * (typically the directory containing the plan file) * @returns Array of { match, localPath, altText } for each local image found */ scanForLocalImages(body: string, basePath: string): Array<{ match: string; localPath: string; altText: string; }>; /** * Process a plan body: find local image references, upload them, * and replace the local paths with GitHub URLs. * * @param body - The plan markdown body * @param basePath - Directory to resolve relative image paths against * @returns The updated body with local image paths replaced by GitHub URLs */ resolveLocalImages(body: string, basePath: string): Promise; } //# sourceMappingURL=AssetUploadService.d.ts.map