/** * Init's answer to "where is this repository hosted?" (gitlab-and-plain-git/AC-7 … AC-13). * * Pure except for the prompt, so every branch is testable with a prompter double. The order * is flag, then a valid saved value, then detection from `origin`; only when all three are * silent is anyone asked — and a non-interactive init writes nothing at all, which reads as * `github`, exactly what the project did before the key existed. * * Detection runs in every init mode (design D5): it is one local `git` call, and writing what * it finds is what makes a GitLab project right after a plain `aidlc init --non-interactive`. * * @module */ import { type Host } from '../core/host.js'; import type { Prompter } from '../core/prompt.js'; export type HostPlan = { kind: 'known'; host: Host; source: 'flag' | 'saved' | 'detected'; remote: string | null; } | { kind: 'unknown'; preselect: Host; }; export interface HostPlanInput { /** `--host`, already validated. */ flag: Host | undefined; /** `host` as the existing config holds it, unvalidated. */ saved: unknown; /** `git remote get-url origin`, or null when there is no origin. */ origin: string | null; } /** What init knows about the host before asking anything. */ export declare function planHost(input: HostPlanInput): HostPlan; /** The `--host` value, or an error naming the three valid ones (gitlab-and-plain-git/AC-8). */ export declare function parseHostFlag(value: string): { ok: true; host: Host; } | { ok: false; error: string; }; /** The warning for a saved value that is not a host name, or null (gitlab-and-plain-git/AC-3). */ export declare function invalidSavedHost(saved: unknown): string | null; /** The one line init prints for a host it detected (gitlab-and-plain-git/AC-10). Only the host name, never the URL. */ export declare function detectedLine(host: Host, remote: string | null): string; /** The host the answers should carry, or undefined to leave the file alone (gitlab-and-plain-git/AC-12). */ export declare function plannedHost(plan: HostPlan): Host | undefined; /** Ask where the repository is hosted; null is a cancel, which cancels init (gitlab-and-plain-git/AC-11). */ export declare function askHost(prompt: Prompter, preselect: Host): Promise; //# sourceMappingURL=host.d.ts.map