import { type ReactNode } from "react"; import type { RepositoryContextPickerProps } from "../components/repository-picker.js"; import { useAppContext } from "../app-context.js"; import type { GitStatusResponse } from "@opengeni/contracts"; import type { ResourceRef, Session } from "../types.js"; /** * What the confirmation knows about the folder: `checking` while Git status * runs, `unknown` when the check failed or timed out, `kept` on a Connected * Machine, whose files Opengeni never deletes. */ export type RepositoryRemovalFolderState = "checking" | "clean" | "unsaved" | "unknown" | "kept"; /** Uncommitted files, unpushed commits, or a local branch that was never pushed. */ export declare function gitStatusHasUnsavedChanges(status: GitStatusResponse): boolean; /** Confirms removing one mounted repository from a chat. */ export declare function RepositoryRemovalDialog(props: { open: boolean; name: string; /** Remove waits while the folder is `checking`. */ folder: RepositoryRemovalFolderState; onClose: () => void; onConfirm: () => Promise; }): import("react").JSX.Element; type RepositoryRefreshContext = Pick, "accessContext" | "captureWorkspaceInvocation" | "refreshGitHub" | "refreshPersonalGitHub" | "repoBusy" | "personalGitHubBusy">; /** * Keep this above the lazily mounted menu so rapid reopenings share one cooldown. * There is no Refresh action: the menu refreshes on open (throttled), and once * the person is back from changing GitHub access (window focus, or the composer * mounting again after the settings page) it refreshes at once and, for an App * manager, syncs from GitHub so newly shared repositories show up. */ export declare function useRepositoryCatalogRefresh(workspaceId: string, context: RepositoryRefreshContext): { refreshAllowed: boolean; onOpenRefresh: () => Promise; onRefresh: () => Promise; onLeaveForGitHub: () => void; }; /** * Session-scoped repository additions for the follow-up composer. Session * resources are additive: accepted resources cannot be retargeted, but a person * can remove one from the chat after a confirmation (`removalDialog`). Only * explicit additions are ever sent, so a stale composer never re-attaches a * repository someone removed elsewhere. */ export declare function useFollowUpRepositories(session: Session, /** Starts workspace App setup from a click; the caller hosts the dialog. */ onConnectWorkspaceApp: () => void): { pendingResources: ResourceRef[]; error: string | null; selectionCount: number; pickerProps: (disabled: boolean) => RepositoryContextPickerProps; commitSent: (resources: ResourceRef[]) => void; /** Render next to the composer; it confirms removing a mounted repository. */ removalDialog: ReactNode; }; export {};