import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent"; import type { FabricSessionLabelConfig } from "./session-label-settings.js"; /** * The label a session recorded for `participantId` in its `pi-fabric-peer` * entries, newest first. Forks and clones carry the entry but get a new id, * and labels from an older counter generation are retired. */ export declare const recordedPeerLabel: (context: ExtensionContext, participantId: string) => string | undefined; /** Footer status key; Pi sorts extension statuses by key. */ export declare const SESSION_LABEL_STATUS_KEY = "fabric-label"; export interface SessionLabelPresenterOptions { /** The minted peer label, once the participant directory has one. */ label: () => string | undefined; /** This session's participant id, recorded beside the label for headless hosts. */ participantId?: () => string | undefined; /** Read on every sync, so a config reload takes effect on the next one. */ settings: () => FabricSessionLabelConfig; /** * True while Fabric's TUI widget heads its agent list with the label. The * footer then stays empty, so the label shows once. RPC clients have no * widget and always get the footer status. */ shownInWidget?: () => boolean; environment?: NodeJS.ProcessEnv; /** 0 disables the timer; tests drive sync() directly. */ intervalMs?: number; } /** * Shows a root session's Fabric peer label (for example `FAB-3`) in the Pi * footer and, when configured, adds it to the Herdr tab or pane name. * * Herdr names have other writers (Pi name sync renames the pane on every * session-name change), so Fabric never caches a name: each sync reads the * live label, adds its own token only when missing, and on close or opt-out * strips only that token so another writer's changes survive. */ export declare class SessionLabelPresenter { #private; private readonly pi; private readonly context; private readonly options; constructor(pi: ExtensionAPI, context: ExtensionContext, options: SessionLabelPresenterOptions); /** The label the session shows, or undefined while unminted or turned off by `ui.sessionLabel.footer`. */ get visibleLabel(): string | undefined; /** True while the session will show a label the directory has not minted yet. */ get labelPending(): boolean; /** True when this process may rename Herdr names: an interactive Pi inside Herdr. */ get herdrAvailable(): boolean; /** * Bring the footer and Herdr names in line with the label and settings. * Never rejects: a failed socket request is retried on the next sync, and a * stale context (the session was replaced or reloaded) stops the timers. */ sync(): Promise; /** Resolves after any scheduled or running sync has finished. */ settled(): Promise; /** Stop syncing, clear the footer, and remove the label from every Herdr name Fabric changed. */ close(): Promise; } //# sourceMappingURL=session-label.d.ts.map