/** * Reading a hosted child's `/status` — the one window the host has onto a node it * runs: its peer id and addresses before the claim, the claim itself, the party * and the owner key after it, and its removal by an owner. Shared by * `HostedNodeService.claimDetails` and the status watcher. */ import type { HealthStatus } from '@serfab/cadre-cli'; /** The party an unclaimed child's config names; the claim replaces it. */ export declare const PLACEHOLDER_PARTY = "unclaimed"; /** The `/status` URL for a spawn's `/health` URL (same server and port). */ export declare function statusUrlFor(healthEndpoint: string): string; /** A `/status` answer from a node that has its peer identity. */ export type NodeStatus = HealthStatus & { peerId: string; }; /** * A `/status` answer from a child an owner removed from its cadre. The child stopped its node * and stays up only to report this, so it has no peer identity. */ export type RemovedNodeStatus = HealthStatus & { node: { removed: NonNullable; }; }; /** * The child's `/status`, fresh every call. Throws `node_unavailable` while the child * does not answer, answers with an error, or has no peer identity yet — every one of * which a caller retries. */ export declare function readNodeStatus(statusEndpoint: string): Promise; /** * {@link readNodeStatus} for the watcher, which also has to hear a removal: a child reporting * one is answered as it is rather than refused for having no peer identity. */ export declare function readWatchedNodeStatus(statusEndpoint: string): Promise; /** Whether the child reports that an owner removed it from its cadre. */ export declare function reportsRemoval(status: HealthStatus): status is RemovedNodeStatus; /** * Whether `/status` reports a finished claim: a claim on record AND the party it * named. `claim` flips to `claimed` the moment the node records the claim, but the * node then restarts in-process into the claimed party, and until that restart * finishes `partyId` is still the placeholder (or empty while the node object is * being rebuilt). Writing `joined` on the flag alone would record the placeholder * as the node's cadre. */ export declare function reportsClaim(status: NodeStatus): status is NodeStatus & { node: { claimedBy: string; }; }; export declare function errorMessage(err: unknown): string;