import type { ProjectStore } from "../store/project-store.js";
import type { EventSource, JsonObject, Root, Workspace, WorkspaceIntegrations, WorkspaceKind } from "../types/workspace.js";
export type GitHubVisibility = "public" | "private";
export type GitHubRemoteProtocol = "https" | "ssh";
export interface WorkspaceGitHubPublishOptions {
    org?: string;
    repoName?: string;
    visibility?: GitHubVisibility;
    description?: string;
    remoteProtocol?: GitHubRemoteProtocol;
    push?: boolean;
    dryRun?: boolean;
    agent_id?: string;
    source?: EventSource;
    prompt?: string;
    command?: string;
}
export interface WorkspaceGitHubPublishResult {
    status: "planned" | "published";
    dry_run: boolean;
    workspace: Workspace;
    full_name: string;
    repo_name: string;
    org: string;
    visibility: GitHubVisibility;
    url: string;
    remote: string;
    remote_protocol: GitHubRemoteProtocol;
    remote_only: boolean;
    local_path: string | null;
    commands: string[];
    pushed: boolean;
    git_remote_updated: boolean;
}
export interface WorkspaceGitHubUnpublishOptions {
    clearIntegrations?: boolean;
    dryRun?: boolean;
    agent_id?: string;
    source?: EventSource;
    prompt?: string;
    command?: string;
}
export interface WorkspaceGitHubUnpublishResult {
    status: "planned" | "unpublished";
    dry_run: boolean;
    workspace: Workspace;
    local_path: string | null;
    remote_removed: boolean;
    integrations_cleared: boolean;
}
export interface WorkspaceGitHubImportOptions {
    root?: string;
    path?: string;
    clone?: boolean;
    remoteOnly?: boolean;
    tags?: string[];
    metadata?: JsonObject;
    kind?: WorkspaceKind;
    visibility?: GitHubVisibility;
    remoteProtocol?: GitHubRemoteProtocol;
    dryRun?: boolean;
    agent_id?: string;
    source?: EventSource;
    prompt?: string;
    command?: string;
}
export interface WorkspaceGitHubImportResult {
    status: "planned" | "imported" | "skipped";
    dry_run: boolean;
    full_name: string;
    repo_name: string;
    org: string;
    url: string;
    remote: string;
    remote_protocol: GitHubRemoteProtocol;
    remote_only: boolean;
    path: string | null;
    root_id: string | null;
    kind: WorkspaceKind;
    tags: string[];
    commands: string[];
    workspace?: Workspace;
    skipped?: string;
}
export declare function normalizeWorkspaceIntegrations(integrations: WorkspaceIntegrations): WorkspaceIntegrations;
export declare function parseGitHubRepo(input: string): {
    org: string;
    repo: string;
    fullName: string;
};
export declare function planWorkspaceGitHubPublish(store: ProjectStore, workspace: Workspace, options?: WorkspaceGitHubPublishOptions): Promise<WorkspaceGitHubPublishResult>;
export declare function publishWorkspaceToGitHub(store: ProjectStore, workspace: Workspace, options?: WorkspaceGitHubPublishOptions): Promise<WorkspaceGitHubPublishResult>;
export declare function unpublishWorkspaceFromGitHub(store: ProjectStore, workspace: Workspace, options?: WorkspaceGitHubUnpublishOptions): Promise<WorkspaceGitHubUnpublishResult>;
export declare function planWorkspaceGitHubImport(store: ProjectStore, repoInput: string, options?: WorkspaceGitHubImportOptions): Promise<WorkspaceGitHubImportResult>;
export declare function importWorkspaceFromGitHub(store: ProjectStore, repoInput: string, options?: WorkspaceGitHubImportOptions): Promise<WorkspaceGitHubImportResult>;
export interface WorkspaceGitHubRootSyncOptions extends Omit<WorkspaceGitHubImportOptions, "root" | "path" | "remoteOnly" | "dryRun"> {
    root?: string;
    repoPrefix?: string;
    limit?: number;
    clone?: boolean;
    dryRun?: boolean;
    repoNamesByOrg?: Record<string, string[]>;
}
export interface WorkspaceGitHubRootSyncRootResult {
    root: Root;
    repos: string[];
    results: WorkspaceGitHubImportResult[];
    errors: Array<{
        repo: string;
        error: string;
    }>;
}
export interface WorkspaceGitHubRootSyncResult {
    dry_run: boolean;
    roots: WorkspaceGitHubRootSyncRootResult[];
    imported: WorkspaceGitHubImportResult[];
    planned: WorkspaceGitHubImportResult[];
    skipped: WorkspaceGitHubImportResult[];
    errors: Array<{
        root: string;
        repo: string;
        error: string;
    }>;
}
export declare function syncWorkspaceGitHubRoots(store: ProjectStore, options?: WorkspaceGitHubRootSyncOptions): Promise<WorkspaceGitHubRootSyncResult>;
export declare function linkWorkspaceExternalIntegrations(store: ProjectStore, workspace: Workspace, integrations: WorkspaceIntegrations, options?: Pick<WorkspaceGitHubPublishOptions, "agent_id" | "source" | "prompt" | "command">): Promise<Workspace>;
//# sourceMappingURL=workspace-github.d.ts.map