import type { SkillActor } from "@opengeni/contracts"; import { sql, type SQLWrapper } from "drizzle-orm"; import type { Database } from "./database.js"; import { type SkillSourceReleaseReceipt } from "./skill-source-release.js"; export type CapabilityComponentOwnerIdentity = { kind: "direct" | "plugin" | "migration"; id: string; }; export declare class CapabilityComponentVersionConflictError extends Error { readonly pluginKey: string; readonly name = "CapabilityComponentVersionConflictError"; constructor(pluginKey: string); } /** * Plugin ownership is effective only while its installation is active. * Direct and migration ownership is intrinsic. */ export declare function effectiveCapabilityOwnerSql(ownerKind: SQLWrapper, ownerId: SQLWrapper): ReturnType; /** Serialize one workspace-local component identity across direct and Plugin installers. */ export declare function lockCapabilityComponentIdentity(db: Database, workspaceId: string, pluginKey: string): Promise; /** * A child installation selects exactly one immutable Plugin version. Changing * that version is safe only when every retained facet owner is the caller. */ export declare function assertCapabilityComponentVersionCanChange(db: Database, input: { workspaceId: string; pluginKey: string; pluginInstallationId: string; owner: CapabilityComponentOwnerIdentity; }): Promise; export declare function cleanupOrphanedCapabilityComponents(db: Database, workspaceId: string, facetInstallationIds: string[], skillActor?: SkillActor, lockedSkillHeadIds?: readonly string[]): Promise;