import type { SqliteExecutor } from "./storage/database.js"; /** * The part of the bundled Intercom package's `broker/control.ts` that `atomic storage status` and * `atomic intercom restart` use. Intercom owns its broker protocol, socket paths and shared-state tables; the CLI * loads that module from the bundled package, as it loads extensions, rather than reimplementing them. */ export interface BrokerMultiNodeStatus { readonly status: "off" | "starting" | "on" | "unavailable"; readonly reason?: string; readonly adapter?: string; readonly prefix?: string; readonly peers?: readonly string[]; } export interface BrokerStatusReport { readonly pid: number; readonly sessions: number; readonly storage?: { readonly digest: string; readonly source: "env" | "settings"; }; readonly multiNode: BrokerMultiNodeStatus; } export type BrokerQuery = { readonly state: "stopped"; } | { readonly state: "running"; readonly report: BrokerStatusReport; } | { readonly state: "legacy"; readonly pid?: number; }; export interface ExpectedBrokerStorage { readonly digest: string; readonly source: "env" | "settings"; readonly adapter: string; readonly prefix?: string; } export type RestartOutcome = { readonly status: "not-running"; } | { readonly status: "stopped"; readonly previous: { readonly pid: number; readonly sessions?: number; }; } | { readonly status: "restarted"; readonly previous: { readonly pid: number; readonly sessions?: number; }; readonly current: Exclude; }; export interface IntercomBrokerControl { queryIntercomBroker(agentDir: string): Promise; expectedBrokerStorage(agentDir: string, env?: NodeJS.ProcessEnv): ExpectedBrokerStorage | undefined; readLiveBrokers(database: SqliteExecutor, prefix: string | undefined): Promise; restartIntercomBroker(agentDir: string, options?: { readonly onProgress?: (line: string) => void; }): Promise; describeMultiNodeStatus(multiNode: BrokerMultiNodeStatus): string; } /** Load `broker/control.ts` from the bundled Intercom package, in the npm package and the standalone binary alike. */ export declare function loadIntercomBrokerControl(): Promise; //# sourceMappingURL=intercom-broker-control.d.ts.map