import type { VanaNetworkName } from "../../core/network.js"; import type { RunningServer } from "./server.js"; /** The pid of a `vana server start` running from `dir`, from its lock. */ export declare function serverPidIn(dir: string): number | null; /** The server's own key address in `dir`, when it has one. */ export declare function serverKeyAddress(dir: string): string | null; /** * Who owns the server an older vana kept straight in the network dir: a * running server answering with its key, its tunnel config, or its start * logs. Null when there is no such server, or nothing says whose it is. */ export declare function legacyServerOwner(network: VanaNetworkName, running?: RunningServer[]): string | null; export type DataDirResolution = { kind: "ready"; dir: string; /** Set when this start moved the owner's server from an older layout. */ movedFrom?: string; } | { /** An older vana's server whose owner nothing on this machine names. */ kind: "unknown-owner"; legacyDir: string; dir: string; }; /** * The data dir `owner`'s server runs from on `network`, created when it is * new. An older vana's server is moved into its owner's dir first, whoever * starts, unless it is running; another account's server is never handed out. */ export declare function resolveServerDataDir(network: VanaNetworkName, owner: string, running?: RunningServer[]): Promise; /** A data dir `vana server start` runs or ran a server from. */ export interface CliServerDir { dir: string; owner: string | null; /** The server's own key address, when it has one. */ identity: string | null; /** Its process, while it runs. */ pid: number | null; } /** Every CLI server data dir on `network`, the older layout's included. */ export declare function listServerDataDirs(network: VanaNetworkName): CliServerDir[]; /** The CLI servers running on `network` right now. */ export declare function runningCliServers(network: VanaNetworkName): CliServerDir[]; /** * Which of the servers vana runs `vana server stop` stops: the signed-in * account's. Without an account, or for a server whose owner nothing names, * the only one running. */ export declare function serverToStop(servers: CliServerDir[], account: string | null): { target: CliServerDir | null; others: CliServerDir[]; }; //# sourceMappingURL=data-dir.d.ts.map