import { type DomindsAppInstallJson } from '@longrun-ai/kernel/app-json';
export type AppsResolutionSchemaVersion = 1;
export type AppsResolutionSource = Readonly<{
    kind: 'npx';
    spec: string;
}> | Readonly<{
    kind: 'local';
    pathAbs: string;
}>;
export type AppsResolutionEntry = Readonly<{
    id: string;
    enabled: boolean;
    source: AppsResolutionSource;
    assignedPort: number | null;
    installJson: DomindsAppInstallJson;
}>;
export type AppsResolutionFile = Readonly<{
    schemaVersion: AppsResolutionSchemaVersion;
    apps: ReadonlyArray<AppsResolutionEntry>;
}>;
export declare const APPS_RESOLUTION_REL_PATH: string;
export declare function loadAppsResolutionFile(params: {
    rtwsRootAbs: string;
}): Promise<Readonly<{
    kind: 'ok';
    file: AppsResolutionFile;
    filePathAbs: string;
    exists: boolean;
}> | Readonly<{
    kind: 'error';
    errorText: string;
    filePathAbs: string;
}>>;
export declare function writeAppsResolutionFile(params: {
    rtwsRootAbs: string;
    file: AppsResolutionFile;
}): Promise<void>;
export declare function writeAppsResolutionFileIfChanged(params: {
    rtwsRootAbs: string;
    file: AppsResolutionFile;
}): Promise<void>;
export declare function findResolvedApp(file: AppsResolutionFile, appId: string): AppsResolutionEntry | null;
export declare function upsertResolvedApp(params: {
    existing: AppsResolutionFile;
    next: AppsResolutionEntry;
}): AppsResolutionFile;
export declare function removeResolvedApp(params: {
    existing: AppsResolutionFile;
    appId: string;
}): AppsResolutionFile;
export declare function setResolvedAppEnabled(params: {
    existing: AppsResolutionFile;
    appId: string;
    enabled: boolean;
}): AppsResolutionFile;
export declare function setResolvedAppAssignedPort(params: {
    existing: AppsResolutionFile;
    appId: string;
    assignedPort: number | null;
}): AppsResolutionFile;
