import { CompanyProfileLearningWrite, type CompanyProfileActivationEvent, type CompanyProfileContent as CompanyProfileContentType, type CompanyProfileDiffResponse, type CompanyProfileHead, type CompanyProfileListResponse, type CompanyProfileMutationResponse, type CompanyProfilePrincipalKind, type CompanyProfileRevision } from "@opengeni/contracts"; import type { Database } from "./database.js"; export type CompanyProfileAttemptClaims = { accountId: string; workspaceId: string; sessionId: string; turnId: string; attemptId: string; executionGeneration: number; }; export declare class CompanyProfileConflictError extends Error { readonly currentHead: CompanyProfileHead | null; readonly name = "CompanyProfileConflictError"; readonly code = "COMPANY_PROFILE_CONFLICT"; constructor(currentHead: CompanyProfileHead | null); } export declare class CompanyProfileOperationReuseError extends Error { readonly name = "CompanyProfileOperationReuseError"; readonly code = "COMPANY_PROFILE_OPERATION_REUSED"; constructor(); } export declare class CompanyProfileNotFoundError extends Error { readonly name = "CompanyProfileNotFoundError"; constructor(message?: string); } export declare class CompanyProfileInvalidOperationError extends Error { readonly name = "CompanyProfileInvalidOperationError"; } export declare class CompanyProfileSnapshotAuthorityError extends Error { readonly name = "CompanyProfileSnapshotAuthorityError"; } export declare function updateCompanyProfile(db: Database, input: { operationId?: string; accountId: string; workspaceId: string; profile: CompanyProfileContentType; expectedCurrentRevisionId: string | null; expectedActivationVersion: number; actorSubjectId: string; principalKind: CompanyProfilePrincipalKind; reason: string; }): Promise; export declare function activateCompanyProfileRevision(db: Database, input: { operationId?: string; accountId: string; workspaceId: string; revisionId: string; expectedCurrentRevisionId: string | null; expectedActivationVersion: number; actorSubjectId: string; principalKind: CompanyProfilePrincipalKind; reason: string; }): Promise<{ revision: { id: string; revision: number; contentHash: string; operationId: string; accountId: string; intent: "active" | "proposal"; profile: { identity: string | null; mission: string | null; products: { key: string; content: string; }[]; customers: { key: string; content: string; }[]; goals: { key: string; content: string; }[]; constraints: { key: string; content: string; }[]; }; provenance: { source: "agent_admin" | "durable_learning" | "human" | "migration"; sourceId: string | null; }; supersedesRevisionId: string | null; createdBySubjectId: string; createdAt: string; } | null; head: { accountId: string; revisionId: string; revision: number; contentHash: string; activationVersion: number; activatedAt: string; } | null; event: { id: string; operationId: string; accountId: string; type: "activate" | "rollback"; activationVersion: number; oldRevision: { id: string; revision: number; contentHash: string; } | null; newRevision: { id: string; revision: number; contentHash: string; } | null; actorSubjectId: string; reason: string; createdAt: string; } | null; }>; export declare function rollbackCompanyProfileRevision(db: Database, input: { operationId?: string; accountId: string; workspaceId: string; targetRevisionId: string; expectedCurrentRevisionId: string; expectedActivationVersion: number; actorSubjectId: string; principalKind: CompanyProfilePrincipalKind; reason: string; }): Promise<{ revision: { id: string; revision: number; contentHash: string; operationId: string; accountId: string; intent: "active" | "proposal"; profile: { identity: string | null; mission: string | null; products: { key: string; content: string; }[]; customers: { key: string; content: string; }[]; goals: { key: string; content: string; }[]; constraints: { key: string; content: string; }[]; }; provenance: { source: "agent_admin" | "durable_learning" | "human" | "migration"; sourceId: string | null; }; supersedesRevisionId: string | null; createdBySubjectId: string; createdAt: string; } | null; head: { accountId: string; revisionId: string; revision: number; contentHash: string; activationVersion: number; activatedAt: string; } | null; event: { id: string; operationId: string; accountId: string; type: "activate" | "rollback"; activationVersion: number; oldRevision: { id: string; revision: number; contentHash: string; } | null; newRevision: { id: string; revision: number; contentHash: string; } | null; actorSubjectId: string; reason: string; createdAt: string; } | null; }>; export type CompanyProfileLearningWriteResult = { outcome: "applied" | "proposed"; revision: CompanyProfileRevision; head: CompanyProfileHead | null; effectiveBoundary: "next_accepted_attempt"; rollbackToken: string | null; }; export declare function writeCompanyProfileLearning(db: Database, rawInput: CompanyProfileLearningWrite): Promise; export declare function rollbackCompanyProfileLearning(db: Database, input: { operationId: string; accountId: string; workspaceId: string; actorSubjectId: string; actorKind: "human" | "agent" | "service"; token: string; reason: string; }): Promise; export declare function listCompanyProfile(db: Database, input: { accountId: string; workspaceId: string; afterRevision?: number; limit: number; }): Promise; export declare function getCompanyProfileRevision(db: Database, input: { accountId: string; workspaceId: string; revisionId: string; }): Promise; export declare function getCompanyProfileActivationEvent(db: Database, input: { accountId: string; workspaceId: string; eventId: string; }): Promise; export declare function diffCompanyProfileRevisions(db: Database, input: { accountId: string; workspaceId: string; fromRevisionId: string; toRevisionId: string; }): Promise; export declare function getOrCreateCompanyProfileSnapshot(db: Database, claims: CompanyProfileAttemptClaims): Promise<{ id: string; accountId: string; workspaceId: string; sessionId: string; turnId: string; attemptId: string; executionGeneration: number; snapshotHash: string; createdAt: string; profile: { id: string; revision: number; contentHash: string; activationVersion: number; activatedAt: string; provenance: { source: "agent_admin" | "durable_learning" | "human" | "migration"; sourceIdHash: string | null; }; profile: { identity: string | null; mission: string | null; products: { key: string; content: string; }[]; customers: { key: string; content: string; }[]; goals: { key: string; content: string; }[]; constraints: { key: string; content: string; }[]; }; } | null; }>;