import { type HubCompatibilityResult, type HubProtocolMetadata } from "@cline/shared"; import { resolveClineDataDir, resolveClineDir } from "@cline/shared/storage"; export interface HubServerDiscoveryRecord { hubId: string; protocolVersion: string; minClientProtocolVersion?: string; maxClientProtocolVersion?: string; capabilities?: readonly string[]; coreVersion?: string; buildId?: string; authToken: string; host: string; port: number; url: string; pid?: number; startedAt: string; updatedAt: string; } export type HubServerProbeRecord = { protocolVersion: string; minClientProtocolVersion?: string; maxClientProtocolVersion?: string; capabilities?: readonly string[]; coreVersion?: string; buildId?: string; host: string; port: number; url: string; hubId?: string; authToken?: string; pid?: number; startedAt?: string; updatedAt?: string; }; export interface HubOwnerContext { ownerId: string; discoveryPath: string; } export declare function createHubAuthToken(): string; export declare function resolveHubBuildId(): string; export type ManagedHubCompatibilityResult = { compatible: true; } | { compatible: false; reason: Exclude["reason"] | "missing_build" | "build_mismatch"; }; /** * Compatibility for a managed local Hub discovered through Cline's owner * record. Unlike explicit endpoints, a managed Hub is code that this client * is responsible for keeping current, so wire compatibility alone is not * enough: reusing a daemon from another build would keep executing stale * runtime, scheduler, connector, and command-handler code after an upgrade. */ export declare function getManagedHubCompatibility(record: HubProtocolMetadata & { buildId?: string; }, expectedBuildId?: string): ManagedHubCompatibilityResult; export declare function resolveHubOwnerContext(ownerBasis?: string): HubOwnerContext; export declare function createInMemoryHubOwnerContext(label?: string): HubOwnerContext; export declare function readHubDiscovery(discoveryPath: string): Promise; export declare function writeHubDiscovery(discoveryPath: string, record: HubServerDiscoveryRecord): Promise; export declare function clearHubDiscovery(discoveryPath: string): Promise; export declare function withHubStartupLock(discoveryPath: string, callback: () => Promise): Promise; export declare function probeHubServer(url: string, options?: { authToken?: string; }): Promise; export declare function createHubServerUrl(host: string, port: number, pathname?: string): string; export declare function toHubHealthUrl(wsUrl: string): string; export declare function toHubStatusUrl(wsUrl: string): string; export declare function isDiscoveryFilePresent(pathname: string): boolean; export { resolveClineDataDir, resolveClineDir };