/** * The client contract for the Herdr viewer pane. The Pi session owns the workflow server and the * client version, so it resolves the `piw` client once and hands the pane an absolute path plus * these variables. A pane then draws one run, checks nothing about `PATH`, and starts no server. */ export declare const PIW_BIN_ENV = "PIW_BIN"; export declare const PIW_SOCKET_ENV = "PIW_SOCKET"; export declare const PIW_NO_AUTOSTART_ENV = "PIW_NO_AUTOSTART"; export type PiwClientSource = "PIW_BIN" | "package" | "PATH"; export type PiwClientInspection = { ok: true; path: string; source: PiwClientSource; version: string; expectedVersion: string; } | { ok: false; kind: "missing" | "mismatch"; message: string; }; export type PiwVersionCheck = { compatible: true; version: string; } | { compatible: false; reason: string; }; export type PiwClientOptions = { env?: NodeJS.ProcessEnv; packageRoot?: string; platform?: NodeJS.Platform; arch?: string; readVersion?: (file: string) => string | undefined; }; /** * crates.io owns the client binary. The version check binds that distribution to this package, so * the failure message names the one command that resolves it. */ export declare function installHint(expectedVersion: string): string; export declare function piwPackageRoot(): string; export declare function piwPlatformPackageName(platform?: NodeJS.Platform, arch?: string): string | undefined; export declare function piwBinaryNames(platform?: NodeJS.Platform): [string, ...string[]]; export declare function piwPackageBinaryPath(root: string, platform?: NodeJS.Platform, arch?: string): string | undefined; export declare function piwPackageVersion(root?: string): string | undefined; /** Tolerates a `piw ` prefix, a tab, and a leading `v`, so every client build reports a version. */ export declare function parsePiwVersion(output: string | undefined): string | undefined; export declare function checkPiwVersion(actual: string | undefined, expected: string, clientPath: string): PiwVersionCheck; export declare function isExecutableFile(file: string): boolean; export declare function pathEntries(env?: NodeJS.ProcessEnv): string[]; export declare function findOnPath(name: string, env?: NodeJS.ProcessEnv): string | undefined; export declare function readPiwVersion(file: string): string | undefined; /** * Resolve the client once. Resolution order: an explicit `PIW_BIN`; the package-local platform * binary when a platform package is installed; then the first `piw` on `PATH`, which keeps the * behavior of a machine with no package-local binary. An explicit `PIW_BIN` that is unusable is a * loud failure rather than a silent `PATH` fallback. */ export declare function inspectPiwClient(options?: PiwClientOptions): PiwClientInspection; export declare function piwPaneEnvironment(clientPath: string, socketPath?: string): string[];