/** * Repo Sync — export/import Squad configuration to/from a GitHub repository. * * Uses the GitHub Contents API via `gh api` for authentication and transport. * The bundle is stored at a configurable path (default: `.squad/squad-export.json`) * in the target repository. */ export interface RepoSpec { owner: string; repo: string; branch?: string; path?: string; } export interface RepoSyncResult { success: boolean; message: string; sha?: string; } /** * Abstracted GitHub operations for repo-sync — enables test injection. */ export interface RepoSyncOperations { /** Get file content and metadata from a repo. Returns null if not found. */ getFile(owner: string, repo: string, path: string, branch?: string): Promise<{ content: string; sha: string; } | null>; /** Create or update a file in a repo. Requires sha for updates. */ putFile(owner: string, repo: string, path: string, content: string, message: string, sha?: string, branch?: string): Promise<{ sha: string; }>; /** Get the default branch of a repo. */ getDefaultBranch(owner: string, repo: string): Promise; } /** * Parse an "owner/repo" string into components. */ export declare function parseRepoString(repoStr: string): { owner: string; repo: string; }; /** * Validate a repo file path is safe (relative, no traversal). */ export declare function validateRepoPath(filePath: string): void; /** * Create default operations using `gh api` CLI. */ export declare function createGhOperations(): RepoSyncOperations; export interface ExportToRepoOptions { /** Commit message for the push. */ message?: string; /** Branch to push to. If omitted, uses repo default branch. */ branch?: string; /** Path in the repo for the bundle file. */ path?: string; /** Operations interface (injectable for testing). */ ops?: RepoSyncOperations; } /** * Export a local Squad bundle JSON string to a GitHub repository. */ export declare function exportToRepo(bundleJson: string, repoSpec: RepoSpec, options?: ExportToRepoOptions): Promise; export interface ImportFromRepoOptions { /** Branch to import from. If omitted, uses repo default branch. */ branch?: string; /** Path in the repo for the bundle file. */ path?: string; /** Operations interface (injectable for testing). */ ops?: RepoSyncOperations; } /** * Import a Squad bundle JSON string from a GitHub repository. * Returns the raw JSON content for the caller to apply. */ export declare function importFromRepo(repoSpec: RepoSpec, options?: ImportFromRepoOptions): Promise<{ content: string; sha: string; }>; //# sourceMappingURL=repo-sync.d.ts.map