export declare const LOCAL_RUNTIME_OWNER_KINDS: readonly ["cli", "desktop", "dev_runner", "server"];
export type LocalRuntimeOwnerKind = (typeof LOCAL_RUNTIME_OWNER_KINDS)[number];
export type LocalRuntimeDescriptor = {
    instanceId: string;
    localEnv: string | null;
    pid: number;
    listenPort: number;
    apiUrl: string;
    version: string;
    ownerKind: LocalRuntimeOwnerKind;
    startedAt: string;
};
export type RuntimeHealthSnapshot = {
    status: "ok";
    version?: string;
    instanceId?: string;
    localEnv?: string | null;
    runtimeOwnerKind?: LocalRuntimeOwnerKind | null;
};
export type LocalRuntimePaths = {
    runtimeDir: string;
    descriptorPath: string;
    lockPath: string;
};
export type LocalRuntimeProbe = {
    kind: "missing";
} | {
    kind: "unusable";
    reason: "invalid_descriptor" | "pid_dead" | "health_unreachable" | "health_mismatch";
    descriptor?: LocalRuntimeDescriptor;
    health?: RuntimeHealthSnapshot | null;
} | {
    kind: "healthy";
    descriptor: LocalRuntimeDescriptor;
    health: RuntimeHealthSnapshot;
    versionMatches: boolean;
};
export declare function parseRuntimeOwnerKind(value: string | null | undefined): LocalRuntimeOwnerKind | null;
export declare function resolveRuntimeOwnerKind(value?: string | null | undefined): LocalRuntimeOwnerKind | null;
export declare function inferLocalEnvFromInstanceId(instanceId: string): string | null;
export declare function resolveEffectiveLocalEnvName(instanceId?: string, value?: string | null | undefined): string | null;
export declare function normalizeLangfuseEnvironmentName(value: string | null | undefined): string | null;
export declare function resolveCanonicalStageName(value: string | null | undefined): string | null;
export declare function resolveLangfuseEnvironmentName(value: string | null | undefined, fallbackLocalEnv?: string | null | undefined): string | null;
export declare function resolveLocalRuntimePaths(instanceId?: string): LocalRuntimePaths;
export declare function readLocalRuntimeDescriptor(instanceId?: string): Promise<LocalRuntimeDescriptor | null>;
export declare function writeLocalRuntimeDescriptor(descriptor: LocalRuntimeDescriptor): Promise<void>;
export declare function removeLocalRuntimeDescriptorIfOwned(input?: {
    instanceId?: string;
    pid?: number;
    apiUrl?: string;
}): Promise<void>;
export declare function isPidRunning(pid: number): boolean;
export declare function withRuntimeStartLock<T>(input: {
    instanceId?: string;
    ownerKind?: LocalRuntimeOwnerKind | null;
    timeoutMs?: number;
}, fn: () => Promise<T>): Promise<T>;
export declare function fetchRuntimeHealth(apiUrl: string, timeoutMs?: number): Promise<RuntimeHealthSnapshot | null>;
export declare function probeLocalRuntime(input?: {
    instanceId?: string;
    localEnv?: string | null;
    expectedVersion?: string | null;
}): Promise<LocalRuntimeProbe>;
export declare function gracefullyStopRuntime(descriptor: Pick<LocalRuntimeDescriptor, "pid" | "instanceId" | "apiUrl">, timeoutMs?: number): Promise<boolean>;
export declare function localRuntimeDescriptorExists(instanceId?: string): boolean;
//# sourceMappingURL=local-runtime.d.ts.map