import { type MeshEntry, type OutputWarning, type Presentation, type UserBundle } from "@cotal-ai/workspace"; import { type SpaceDetail } from "./space.js"; /** The flags only `space add` takes. */ export declare const ADD_FLAGS: readonly ["file", "from", "server", "root", "mode", "tls", "allow-unencrypted-overlay", "force", "yes"]; export interface AddValues { readonly file?: string; readonly from?: string; readonly server?: string; readonly root?: string; readonly mode?: string; readonly tls?: boolean; readonly "allow-unencrypted-overlay"?: boolean; readonly force?: boolean; readonly yes?: boolean; } export interface SpaceAdded { readonly kind: "space-added"; /** The registration as `cotal space show` reports it. */ readonly space: SpaceDetail; /** Whether the broker was checked before the record was written; false under `--force`. */ readonly verified: boolean; /** Whether it replaced an earlier registration of the same name. */ readonly replaced: boolean; } /** * `cotal space add []` registers a space that runs elsewhere: from `--server` with the trust * under `--root`, or from a user-auth connection bundle (`--file`, or `--from` to fetch the * space's discovery document). Every check runs before anything is written: the address may carry * credentials, the trust composes, the broker enforces the mode, and the credentials open the * space. On a terminal the trust is shown and confirmed first. The selection is left as it is. */ export declare function spaceAdd(rest: readonly string[], v: AddValues, presentation: Presentation): Promise; export type Added = { readonly result: SpaceAdded; readonly warnings: OutputWarning[]; } | undefined; /** A user-auth space: its pins come from a bundle exported where it runs, or from its HTTPS * discovery document, which is fetched only after the operator agrees and is adopted only after * they confirm the pins. Its checks run even under `--force`, which only replaces a record. * `cotal setup --connection-file` registers a self-hosted space through it. */ export declare function addFromBundle(name: string | undefined, v: AddValues, prompt: boolean): Promise; /** A user-auth connection bundle read from `file` and checked; `flag` names the input in a refusal. */ export declare function readConnectionFile(file: string, flag: string, target: unknown): UserBundle; /** What `cotal setup --destination self-hosted` finds for a space: a registration to use as it is, * or a connection file to register it from. */ export type SelfHostedSpace = { readonly kind: "registered"; readonly entry: MeshEntry; } | { readonly kind: "add"; readonly file: string; }; /** * The checks `cotal setup` runs for a self-hosted space before it writes anything. The space must * be one registered here by hand or by a catalog, with `project` as its root, or come with a * connection file that `space add --file` would accept. A connection file for a space already * registered must name the same space and broker, so a rerun with the same answers changes nothing. */ export declare function checkSelfHostedSpace(space: string, project: string, connectionFile: string | undefined): SelfHostedSpace; /** * `cotal space create ` prepares a space to start on this machine: it records the name and * the root, and makes `/.cotal/` so `cotal up` there starts it under that name. It seeds the * default persona there as setup does, so a bare `cotal spawn` in the space has one to launch. It * starts nothing, and the selection is left as it is. The root is `--root`, else this folder. */ export declare function spaceCreate(rest: readonly string[], rootFlag: string | undefined, presentation: Presentation): Promise; /** Where a space this machine starts stands at a root: prepared now, prepared before, or started * there before. */ export type LocalSpaceState = "created" | "prepared" | "started"; /** * The checks `space create` runs before it prepares `name` at `root`; it writes nothing. `flag` * names the input that chose the root. With `again`, a space already prepared or started at this * same root is reported as its state instead of refused, so `cotal setup` run again with the same * answers changes nothing. */ export declare function checkLocalSpace(name: string, root: string, flag: "--root" | "--project", again: boolean): LocalSpaceState; /** Prepares a space {@link checkLocalSpace} cleared: makes `/.cotal/` and records the space. * Returns the record it wrote and when. */ export declare function recordLocalSpace(name: string, root: string): { file: string; preparedAt: string; }; /** * `cotal space forget ` removes a registration this machine keeps. It stops nothing and * deletes nothing on a broker, and the root's files stay. A space this machine is running is * stopped with `cotal down`, which also drops its record, and a discovered space follows its * catalog. A stack member whose process is gone without its stop receipt does not block, and the * result warns about each one. Forgetting the selected space clears the selection. A prepared space * is forgotten the same way, and the `.cotal/` folder `space create` made stays. The stopped stack * definitions saved for the space at its root are removed with it, so the name can start elsewhere; * any that cannot be removed are kept and the result warns about them. */ export declare function spaceForget(rest: readonly string[], presentation: Presentation): Promise; //# sourceMappingURL=space-registration.d.ts.map