/** * Cross-machine presence (ADR 0016), phase 1: the git-refs transport. * * publishPresence(): serialize this machine's live sessions into a presence * blob and force-push it to `refs/harnery/presence/` on origin — * change-batched (only when the blob materially changed) with a keepalive * (~5 min) so peers can distinguish "no change" from "machine gone". * * fetchPresence(): throttled fetch of every peer machine's presence ref. * * readRemoteMachines(): parse the locally-known refs into render-ready rows * (self machine excluded, stale blobs dropped). * * All entry points are fail-silent and gated on `presenceEnabled()` — presence * must never break a hook, a render, or a repo with no origin. */ import { type PresenceAgent } from "./blob.js"; export type { PresenceAgent, PresenceBlob } from "./blob.js"; export { buildPresenceBlob } from "./blob.js"; export { PRESENCE_REF_PREFIX, parseForEachRefOutput, sanitizeRefComponent } from "./git.js"; export { ensureRelayDaemon, relayDaemonStatus, runRelayDaemon } from "./relay-client.js"; export type PublishResult = { status: "published"; machine: string; agents: number; sha: string; } | { status: "skipped"; reason: string; } | { status: "error"; error: string; }; export type FetchResult = { status: "fetched"; } | { status: "skipped"; reason: string; } | { status: "error"; error: string; }; /** * Publish this machine's presence blob to origin if it changed (or the * keepalive elapsed). `sync: true` pushes in-process and reports errors (CLI * path); default spawns the push detached (hook path). */ export declare function publishPresence(coordRoot: string, opts?: { force?: boolean; sync?: boolean; }): PublishResult; /** Throttled fetch of peer presence refs from origin. */ export declare function fetchPresence(coordRoot: string, opts?: { force?: boolean; sync?: boolean; }): FetchResult; export interface RemoteMachine { machine: string; published_at: string; age_secs: number; agents: PresenceAgent[]; } /** * Render-ready view of every OTHER machine's presence, merged from BOTH * transports: the locally-fetched git refs (the floor) and the relay * daemon's cache files at `.harnery/presence/remote/` (the live upgrade). * Freshest source per machine wins. Self machine excluded; blobs older than * the stale window or with zero agents dropped. */ export declare function readRemoteMachines(coordRoot: string, opts?: { includeSelf?: boolean; includeStale?: boolean; }): RemoteMachine[]; //# sourceMappingURL=index.d.ts.map