import { DirectoryEntry, PutManyRequestPayload, PutManyResponsePayload } from '../dbfs/types.js';
import { ApiToSign, ApiToVerify, AppToSign, AppToVerify, ApplicationSignatureTreeSigned, Signature } from '../signing/constants.js';
import { ApplicationConfiguration, ApplicationPageClonePayload, CreateApplicationPageResponseBody, CreateApplicationPageSocketPayload, GetMultiPageApplicationResponseBody, GetApiResponseBody, IApplicationV2Dto, PageSummary, PostApiBranchCreateResponseBody, PostApplicationBranchCreateResponseBody, PostApplicationCreateRequestBody, RemoteCommitDto, ResponseMeta, ExportedMultiPageApplicationDto, ExportViewMode, ExportedApiV3Dto, ModifyEntitiesPayload, ModifyEntitiesResponse, GetAppBranchLockResponseBody, LockInfo, DegradedMode, CheckpointSkipReason } from '../types';
import { AiChatMessageDto, AiChatMessagePayload, AiPromptCostRequest, AiPromptCostResponse, AiWorkflowEvent, AiResolveAttachmentLeasesRequest, AiResolveAttachmentLeasesResponse, FactCreate, FactDto, FactListQuery, ListFactsResponse, NpmInstallBlockedAuditReport } from '../types/index.js';
import { MethodSchema } from './types.js';
export declare const serverWsPath = "v1/rpc-ws";
type ResponseDto<T> = {
    responseMeta: ResponseMeta;
    data: T;
};
type ServerMethodSchema<Params, Response> = MethodSchema<Params, ResponseDto<Response>>;
export interface ServerMethods {
    v1: {
        echo: ServerMethodSchema<{
            message: string;
        }, {
            message: string;
        }>;
        public: {
            application: {
                component: {
                    register: ServerMethodSchema<{
                        applicationId: string;
                        branchName: string;
                        cliVersion: string;
                        componentEvent: string;
                        components: Record<string, unknown>;
                    }, {
                        success: boolean;
                    }>;
                    update: ServerMethodSchema<{
                        applicationId: string;
                        branchName?: string;
                        srcFiles: string[];
                        buildFiles: string[];
                        registeredComponents: Record<string, never>;
                        cliVersion: string | undefined;
                        componentBaseUrl: string;
                        signingRequired: boolean;
                    }, {
                        success: boolean;
                    }>;
                };
                pushCommit: ServerMethodSchema<{
                    applicationId: string;
                    branchName: string;
                    commitId: string;
                    commitMessage: string;
                    application: Record<string, unknown>;
                    page: Record<string, unknown>;
                    apis: Record<string, unknown>[];
                    gitState: Record<string, unknown>;
                }, RemoteCommitDto>;
            };
            api: {
                pushCommit: ServerMethodSchema<{
                    apiId: string;
                    branchName: string;
                    commitId: string;
                    commitMessage: string;
                    apiPb: Record<string, unknown>;
                    gitState: Record<string, unknown>;
                    skipCommit?: boolean;
                }, RemoteCommitDto | {
                    updated: Date;
                }>;
                get: ServerMethodSchema<{
                    apiId: string;
                    branchName?: string;
                    viewMode: ExportViewMode;
                    commitId?: string;
                }, ExportedApiV3Dto>;
            };
        };
        dbfs: {
            fileContents: {
                get: ServerMethodSchema<{
                    hash: string;
                }, {
                    contents: string;
                }>;
                getByPath: ServerMethodSchema<{
                    directoryHash: string;
                    path: string;
                }, {
                    contents: string;
                }>;
                put: ServerMethodSchema<{
                    contents: string;
                }, {
                    hash: string;
                }>;
            };
            directoryContents: {
                get: ServerMethodSchema<{
                    hash: string;
                }, {
                    contents: DirectoryEntry[];
                }>;
                getByPath: ServerMethodSchema<{
                    directoryHash: string;
                    path: string;
                }, {
                    contents: DirectoryEntry[];
                }>;
                put: ServerMethodSchema<{
                    contents: DirectoryEntry[];
                }, {
                    hash: string;
                }>;
            };
            /**
             * This method is used to put multiple files and directories at once. It is more efficient than calling the put method
             * for each file and directory. The response is a list of hashes for the items that were put, in the same order as the items
             * in the request.
             */
            putMany: ServerMethodSchema<PutManyRequestPayload, PutManyResponsePayload>;
        };
        ai: {
            chat: {
                pushMessage: ServerMethodSchema<{
                    applicationId: string;
                    payload: AiChatMessagePayload;
                    version?: number;
                    branchName?: string | null;
                }, {
                    chatmessageId: string;
                }>;
                getMessages: ServerMethodSchema<{
                    applicationId: string;
                    branchName?: string | null;
                    limit?: number;
                }, {
                    messages: AiChatMessageDto[];
                }>;
                new: ServerMethodSchema<{
                    applicationId: string;
                    branchName?: string | null;
                }, void>;
                truncateAfterTimestamp: ServerMethodSchema<{
                    applicationId: string;
                    sinceTimestamp: number;
                }, void>;
            };
            billing: {
                promptCost: {
                    calculate: ServerMethodSchema<AiPromptCostRequest, AiPromptCostResponse>;
                };
                workflowSummary: {
                    submit: ServerMethodSchema<AiWorkflowEvent, void>;
                };
            };
            /**
             * Resolve attachment leases and return fresh signed URLs.
             * Called by ai-service to refresh attachment leases before sending to LLM.
             */
            resolveAttachmentLeases: ServerMethodSchema<AiResolveAttachmentLeasesRequest, AiResolveAttachmentLeasesResponse>;
        };
        fact: {
            list: ServerMethodSchema<FactListQuery, ListFactsResponse>;
            create: ServerMethodSchema<FactCreate, FactDto>;
        };
        audit: {
            /**
             * Report a controlled-install `NpmInstallBlocked` so the server can write a
             * throttled OCSF audit row (APPS-4191 / P6.3). Org + actor are derived from
             * the authenticated connection; `recorded` is false when the event was
             * dropped by the per-org or global throttle.
             */
            npmInstallBlocked: ServerMethodSchema<NpmInstallBlockedAuditReport, {
                recorded: boolean;
            }>;
        };
    };
    v2: {
        application: {
            create: ServerMethodSchema<PostApplicationCreateRequestBody, IApplicationV2Dto>;
            clone: ServerMethodSchema<{
                applicationId: string;
            }, IApplicationV2Dto>;
            createBranch: ServerMethodSchema<{
                applicationId: string;
                branchName: string;
                baseBranchName: string;
            }, PostApplicationBranchCreateResponseBody>;
            page: {
                clone: ServerMethodSchema<ApplicationPageClonePayload, {
                    page: PageSummary;
                    updated: Date;
                    signature: ApplicationSignatureTreeSigned | null;
                    configuration: ApplicationConfiguration;
                }>;
                create: ServerMethodSchema<CreateApplicationPageSocketPayload, CreateApplicationPageResponseBody>;
            };
            modifyEntities: ServerMethodSchema<ModifyEntitiesPayload, ModifyEntitiesResponse>;
        };
        public: {
            application: {
                pushCommit: ServerMethodSchema<{
                    applicationId: string;
                    branchName: string;
                    commitId: string;
                    commitMessage: string;
                    application: Record<string, unknown>;
                    pages: Record<string, unknown>[];
                    apis: Record<string, unknown>[];
                    gitState: Record<string, unknown>;
                    skipCommit?: boolean;
                }, RemoteCommitDto | {
                    updated: Date;
                }>;
                get: ServerMethodSchema<{
                    applicationId: string;
                    viewMode: ExportViewMode;
                    branchName?: string;
                    commitId?: string;
                }, ExportedMultiPageApplicationDto>;
            };
        };
    };
    v3: {
        application: {
            get: ServerMethodSchema<{
                applicationId: string;
                branchName?: string;
            }, GetMultiPageApplicationResponseBody>;
            liveEditDirectoryContents: {
                /**
                 * @deprecated Use `v3.application.directoryContents.get` instead.
                 */
                get: ServerMethodSchema<{
                    applicationId: string;
                    branchName?: string;
                }, {
                    hash: string;
                }>;
                set: ServerMethodSchema<{
                    applicationId: string;
                    branchName?: string;
                    hash: string;
                    source?: string;
                    targetTemplateName?: string;
                    migrationGeneration?: number;
                }, {
                    hash: string;
                    degradedMode?: DegradedMode;
                    commitId?: string;
                    checkpointSkipped?: CheckpointSkipReason;
                }>;
            };
            directoryContents: {
                get: ServerMethodSchema<{
                    applicationId: string;
                    branchName?: string;
                    commitId?: string;
                    viewMode: ExportViewMode;
                }, {
                    hash: string;
                    latestNonDraftCommitId?: string;
                }>;
            };
            draftState: {
                set: ServerMethodSchema<{
                    applicationId: string;
                    branchName?: string;
                    hasDraft: boolean;
                }, void>;
            };
            pushCommit: ServerMethodSchema<{
                applicationId: string;
                branch?: string;
                localDirectoryPath: string;
                commitId: string;
                commitMessage: string;
                forcePush?: boolean;
                gitState: Record<string, unknown>;
                skipCommit?: boolean;
                directoryHash?: string;
            }, RemoteCommitDto>;
        };
        api: {
            createBranch: ServerMethodSchema<{
                apiId: string;
                branchName: string;
                baseBranchName: string;
            }, PostApiBranchCreateResponseBody>;
            get: ServerMethodSchema<{
                apiId: string;
                branchName?: string;
            }, GetApiResponseBody>;
        };
        lock: {
            acquire: ServerMethodSchema<{
                applicationId: string;
                branchName: string;
                sessionType: string;
            }, GetAppBranchLockResponseBody>;
            release: ServerMethodSchema<{
                applicationId: string;
                branchName: string;
                lockId: string;
            }, void>;
            transfer: ServerMethodSchema<{
                applicationId: string;
                fromBranchName: string;
                toBranchName: string;
                lockId: string;
            }, GetAppBranchLockResponseBody>;
            grab: ServerMethodSchema<{
                applicationId: string;
                branchName: string;
                lockId: string;
            }, GetAppBranchLockResponseBody>;
            inspect: ServerMethodSchema<{
                applicationId: string;
                branchName: string;
            }, LockInfo>;
            forceTake: ServerMethodSchema<{
                applicationId: string;
                branchName: string;
                sessionType: string;
            }, GetAppBranchLockResponseBody>;
        };
    };
}
export interface ClientMethods {
    v1: {
        signing: {
            signApplication: MethodSchema<{
                branchName: string;
                toSign: AppToSign;
            }, {
                signature: Signature;
            }>;
            signApis: MethodSchema<{
                branchName: string;
                toSign: ApiToSign[];
            }, {
                signatures: Signature[];
            }>;
            verifyApplication: MethodSchema<{
                branchName: string;
                toVerify: AppToVerify;
            }, {
                ok: boolean;
            }>;
            verifyApi: MethodSchema<{
                branchName: string;
                toVerify: ApiToVerify[];
            }, {
                ok: boolean;
            }>;
        };
    };
}
export {};
//# sourceMappingURL=protocol.d.ts.map