import { type CapabilityCatalogAuthKind, type SkillActor, type PluginUninstallPreview } from "@opengeni/contracts"; import { type Database } from "./database.js"; import { type SkillSourceReleaseReceipt } from "./skill-source-release.js"; import type { SkillPublicationReceipt } from "@opengeni/contracts"; export type PluginBomComponent = { key: string; kind: "skill" | "integration" | "mcp"; capabilityId: string; digest: string; }; export type InstalledPluginPackage = { pluginKey: string; version: string; pluginId: string; pluginVersionId: string; pluginInstallationId: string; installationVersion: number; manifest: Record; status: string; /** Who added (or last updated) this installation; see {@link uninstallPluginPackage}. */ installedBySubjectId: string; }; export type InstalledPluginPackageSummary = { pluginKey: string; version: string; name: string; description: string; category: string; tags: string[]; sourceUrl: string | null; logoUrl: string | null; manifestDigest: string; installationVersion: number; componentCount: number; status: "active" | "needs_attention"; installedAt: string; updatedAt: string; /** Who added (or last updated) it: a member removes only what they added. */ installedBySubjectId: string; }; export type PreparedPluginPackage = InstalledPluginPackage & { operationId: string; replayResult: Record | null; }; export declare class PluginOperationIdempotencyError extends Error { readonly name = "PluginOperationIdempotencyError"; } export declare class PluginInstallationVersionConflictError extends Error { readonly name = "PluginInstallationVersionConflictError"; } export declare class PluginUninstallPreviewChangedError extends Error { readonly preview?: PluginUninstallPreview | undefined; readonly code = "plugin_uninstall_preview_changed"; constructor(preview?: PluginUninstallPreview | undefined); } export declare class PluginInstallationVersionRequiredError extends Error { readonly name = "PluginInstallationVersionRequiredError"; } export declare function getInstalledPluginPackage(db: Database, workspaceId: string, pluginKey: string): Promise; export declare function listInstalledPluginPackages(db: Database, workspaceId: string): Promise; export declare function preparePluginPackageInstall(db: Database, input: { accountId: string; workspaceId: string; subjectId: string; pluginKey: string; version: string; name: string; description: string; category: string; tags: string[]; manifestDigest: string; manifest: Record; idempotencyKey: string; requestDigest: string; expectedInstallationVersion?: number; /** * A member's install: adding a plugin that is not installed (or was * removed) and retrying or resuming the same request are allowed; * updating an installed plugin throws {@link IntegrationChangeRequiresAdminError}. */ memberCreate?: boolean; }): Promise; export declare function checkpointPluginPackageOperation(db: Database, input: { workspaceId: string; operationId: string; phase: string; completedKeys: string[]; }): Promise; export declare function deferPluginPackageOperation(db: Database, input: { workspaceId: string; operationId: string; phase: string; errorCode: string; }): Promise; export declare function finalizePluginPackageInstall(db: Database, input: { accountId: string; workspaceId: string; subjectId: string; operationId: string; pluginInstallationId: string; retainedFacetInstallationIds: string[]; retainedBindingIds: string[]; result: Record; skillActor?: SkillActor; }): Promise<{ skillReleases: SkillSourceReleaseReceipt[]; skillPublications: SkillPublicationReceipt[]; }>; export declare function installPluginMcpReference(db: Database, input: { accountId: string; workspaceId: string; subjectId: string; ownerPluginInstallationId: string; serverId: string; name: string; url: string; allowedTools: string[]; timeoutMs?: number; cacheToolsList?: boolean; requireApproval?: boolean | string[]; connectionRef?: Record; authKind: CapabilityCatalogAuthKind; digest: string; /** * A member's install (no integration management): a configured server that * is already set up, or turned off, is never rewritten or turned back on. */ memberCreate?: boolean; }): Promise<{ capabilityId: string; facetInstallationId: string; }>; export declare function getPluginPackageUninstallPreview(db: Database, workspaceId: string, pluginKey: string, subjectId?: string): Promise>; export declare function uninstallPluginPackage(db: Database, input: { accountId: string; workspaceId: string; subjectId: string; pluginKey: string; expectedInstallationVersion: number; expectedPreviewToken?: string; idempotencyKey: string; skillActor?: SkillActor; /** * A member's removal: only a plugin this subject added. Anything an admin * or another person added throws {@link IntegrationChangeRequiresAdminError}. */ memberRemoval?: boolean; }): Promise<{ status: "not_installed" | "uninstalled"; retainedComponents: string[]; skillReleases?: SkillSourceReleaseReceipt[]; }>;