UNPKG

@phren/cli

Version:

Knowledge layer for AI agents - CLI, MCP server, and data layer

33 lines (32 loc) • 1.34 kB
import { type Provider } from "./protocol.js"; type PaneIdentity = { server: string; pane: string; terminal?: string; }; type Origin = PaneIdentity & { workspace: string; tab: string; terminal: string; agent: Provider; }; export interface DispatchOriginWindow { rewrite(origin: Origin | undefined): Origin | undefined; finish(): void; } /** Register before a dispatch's first await; only these live operations can * inherit a hand-over alias. A later dispatch starts with no aliases. */ export declare function trackDispatchOrigin(): DispatchOriginWindow; /** Prepare while holding the receipt lock, then seal only after role commit. * Keep prior chains in this snapshot because the role write invalidates them. * Operations started during the commit are included; later ones never are. */ export declare function prepareDispatchOriginHandover(from: PaneIdentity, to: Origin): () => void; /** Called after every successful role write, without acquiring another lock. * A stop or reassignment must not let an earlier move redirect late workers * away from the newly chosen conductor. No aliases survive a Hook restart. */ export declare function conductorOriginChanged(conductor: (PaneIdentity & { source?: Provider; workspace?: string; tab?: string; }) | null | undefined): void; export {};