export declare const PACKAGE_NAME = "@ours.network/fleet"; export declare const BIN_NAME = "ours-fleet"; /** Stand-in build id for artifacts built before this module existed. */ export declare const UNKNOWN_BUILD = "unknown"; /** Identity of one built artifact, written into dist/ at build time. */ export interface BuildInfo { version: string; /** First 12 hex of a sha256 over every other file in dist/. */ buildId: string; /** Commit the build was cut from, when git was available. */ commit?: string; /** Whether that working tree had uncommitted changes. */ dirty?: boolean; builtAt?: string; capabilities: string[]; } /** One @ours.network/fleet package directory on this host. */ export interface Install { packageRoot: string; version: string; /** Absent for a pre-provenance build — its identity is unknowable. */ build?: BuildInfo; } export interface InstallRecord extends Install { /** The PATH candidate that reaches this install, if any. */ bin?: string; realBin?: string; /** Position of `bin`'s directory in PATH; absent when off PATH. */ pathIndex?: number; /** Whether this is the install executing right now. */ running: boolean; } export type SkewKind = 'version-build-conflict' | 'shadowed-runtime' | 'unknown-build-identity'; export interface InstallSkew { kind: SkewKind; severity: 'error' | 'warn'; message: string; } /** Read the install rooted at `packageRoot`, or undefined if that is not one. */ export declare function readInstall(packageRoot: string): Install | undefined; /** Walk up from `from` to the @ours.network/fleet package directory containing it. */ export declare function findPackageRoot(from: string): string | undefined; /** * Every install reachable from PATH, plus the one executing right now. * PATH order is preserved; an install reached by several PATH entries is listed * once, at its earliest position. */ export declare function discoverInstalls(opts?: { path?: string; argv1?: string; binName?: string; platform?: NodeJS.Platform; }): InstallRecord[]; /** * sha256 over an install's dist/ tree, first 12 hex — the same bytes and order * `scripts/build-info.mjs` hashes, so a stamped install's digest equals its * buildId. This is what tells two PRE-provenance installs apart: they both * report `unknown`, but they are not the same artifact, and the host that * motivated this module had exactly that pair. */ export declare function contentDigest(packageRoot: string): string | undefined; /** `0.17.0+9f1c2a3b4d5e`, or `…+unknown` for a pre-provenance build. */ export declare const buildLabel: (install: Pick) => string; /** What an install says it can do — never guessed from its version. */ export declare const capabilitySummary: (install: Install) => string; /** * Conflicts an operator must know about. `version-build-conflict` is the one * that bit this host: same semver, different artifact, silently different rules. * * `digest` is only consulted inside a version group of two or more, so the * common single-install case never hashes anything. */ export declare function analyzeInstalls(records: InstallRecord[], digest?: (packageRoot: string) => string | undefined): InstallSkew[]; /** Identity of the build executing right now. */ export declare function buildInfo(): BuildInfo; /** `ours-fleet 0.17.0+9f1c2a3b4d5e` — one line, safe for any operator output. */ export declare const runningLabel: () => string;