import type { FabricActorRunBinding } from "../actors/types.js"; import { MeshStore, type MeshIdentity } from "../mesh/store.js"; import type { FabricMessageSender } from "../protocol.js"; export declare const STALE_INCARNATION_ERROR = "Fabric control command targets a previous owner incarnation; the owner restarted. Re-resolve the participant and retry."; export type FabricControlOperation = "steer" | "followUp" | "stop" | "ask" | "cancel"; export interface FabricControlCommand { version: 1; commandId: string; targetId: string; operation: FabricControlOperation; replyTo: string; message?: string; data?: unknown; triggerTurn?: boolean; binding?: FabricActorRunBinding; cancelCommandId?: string; /** Owner process incarnation the requester resolved; absent from older senders. */ ownerIncarnation?: string; requestedAt: number; deadlineAt?: number; /** The command event's host stamp, copied by the receiving owner; never read from command data. */ sender?: FabricMessageSender; } export interface FabricControlAcceptance { accepted: boolean; messageId?: string; result?: unknown; error?: string; } export interface FabricControlResult { queued: true; messageId: string; routed: "mesh"; acknowledged: true; } export type FabricControlHandler = (command: FabricControlCommand, from: MeshIdentity, signal: AbortSignal) => Promise | FabricControlAcceptance; export interface FabricControlPlaneOptions { enabled: boolean; hostId: string; pollMs?: number; acknowledgementTimeoutMs?: number; } export interface FabricControlInput { message?: string; data?: unknown; triggerTurn?: boolean; binding?: FabricActorRunBinding; /** * The target participant record's `ownerIncarnation`. When set, a restarted * owner refuses the command and acknowledgements from other incarnations are ignored. */ ownerIncarnation?: string; } export interface FabricControlRequestOptions { timeoutMs?: number; signal?: AbortSignal; } export declare class FabricControlPlane { #private; readonly mesh: MeshStore; readonly identity: MeshIdentity; readonly options: FabricControlPlaneOptions; constructor(mesh: MeshStore, identity: MeshIdentity, options: FabricControlPlaneOptions); /** Random per-instance id; owners stamp it on participant records they publish. */ get incarnation(): string; start(handler: FabricControlHandler): void; request(ownerHostId: string, targetId: string, operation: FabricControlOperation, input?: FabricControlInput, ownerIdentityId?: string): Promise; requestResult(ownerHostId: string, targetId: string, operation: FabricControlOperation, input?: FabricControlInput, ownerIdentityId?: string, options?: FabricControlRequestOptions): Promise; close(): Promise; } //# sourceMappingURL=control-plane.d.ts.map