import { type Database } from "./database.js"; import * as schema from "./schema.js"; export type SlackFileUploadOperation = typeof schema.slackFileUploadOperations.$inferSelect; export type SlackFileUploadPhase = SlackFileUploadOperation["phase"]; export type SlackFileUploadScope = { accountId: string; workspaceId: string; sessionId: string; }; export type ClaimSlackFileUploadInput = SlackFileUploadScope & { interactionId: string; connectionId: string; fileId: string; subjectId: string; operationId: string; requestDigest: string; claimHolderId: string; leaseMs: number; }; export type ClaimSlackFileUploadResult = { status: "claimed" | "busy" | "conflict" | "completed"; operation: SlackFileUploadOperation; }; type ClaimScope = SlackFileUploadScope & { operationId: string; claimHolderId: string; }; /** This ledger is a durability fence, not authority to read files or call Slack. */ export declare class SlackFileUploadRefusedError extends Error { readonly name = "SlackFileUploadRefusedError"; } /** * One workspace-wide operation id binds all intent, including requester and file. * Only an expired/released claim can be taken over. An uncertain completion is * never reset to upload: the caller must reconcile that exact Slack file share. * No provider request or automatic transaction retry occurs in this repository. */ export declare function claimSlackFileUpload(db: Database, input: ClaimSlackFileUploadInput): Promise; export declare function renewSlackFileUploadClaim(db: Database, input: ClaimScope & { leaseMs: number; }): Promise; /** * Save allocated id BEFORE raw upload; save completing BEFORE provider completion. * Only uploading can replace an allocation. uploaded/uncertain/completed recovery * must retain the original id. Completion requires provider success or exact * share reconciliation at the caller, never absence or lease expiry. */ export declare function checkpointSlackFileUpload(db: Database, input: ClaimScope & { expectedPhase: SlackFileUploadPhase; phase: SlackFileUploadPhase; slackFileId?: string; }): Promise; /** Release only a live holder; completing becomes uncertain, never uploadable. */ export declare function releaseSlackFileUploadClaim(db: Database, input: ClaimScope): Promise; export {};