import { organizationSkills } from "@rudderhq/db";
import type { AgentSkillEntry, AgentSkillSourceClass, AgentSkillSyncMode, OrganizationSkill, OrganizationSkillCreateRequest, OrganizationSkillCompatibility, OrganizationSkillFileInventoryEntry, OrganizationSkillListItem, OrganizationSkillSourceBadge, OrganizationSkillSourceType, OrganizationSkillTrustLevel, OrganizationSkillUsageAgent } from "@rudderhq/shared";
export type OrganizationSkillRow = typeof organizationSkills.$inferSelect;
export type ImportedSkill = {
    key: string;
    slug: string;
    name: string;
    description: string | null;
    markdown: string;
    packageDir?: string | null;
    sourceType: OrganizationSkillSourceType;
    sourceLocator: string | null;
    sourceRef: string | null;
    trustLevel: OrganizationSkillTrustLevel;
    compatibility: OrganizationSkillCompatibility;
    fileInventory: OrganizationSkillFileInventoryEntry[];
    metadata: Record<string, unknown> | null;
};
export type PackageSkillConflictStrategy = "replace" | "rename" | "skip";
export type ImportPackageSkillResult = {
    skill: OrganizationSkill;
    action: "created" | "updated" | "skipped";
    originalKey: string;
    originalSlug: string;
    requestedRefs: string[];
    reason: string | null;
};
export type ParsedSkillImportSource = {
    resolvedSource: string;
    requestedSkillSlug: string | null;
    originalSkillsShUrl: string | null;
    warnings: string[];
};
export type SkillSourceMeta = {
    skillKey?: string;
    sourceKind?: string;
    owner?: string;
    repo?: string;
    ref?: string;
    trackingRef?: string;
    repoSkillDir?: string;
    projectId?: string;
    projectName?: string;
    workspaceId?: string;
    workspaceName?: string;
    workspaceCwd?: string;
};
export type LocalSkillInventoryMode = "full" | "project_root";
export type ProjectSkillScanTarget = {
    projectId: string;
    projectName: string;
    workspaceId: string;
    workspaceName: string;
    workspaceCwd: string;
};
export type RuntimeSkillEntryOptions = {
    materializeMissing?: boolean;
};
export type AgentWorkspaceRow = {
    id: string;
    name: string;
    workspaceKey: string | null;
};
export type AgentSkillCatalogEntry = AgentSkillEntry & {
    organizationSkillKey: string | null;
    runtimeSourcePath: string | null;
};
export type AgentSkillCatalog = {
    desiredSkills: string[];
    entries: AgentSkillCatalogEntry[];
    warnings: string[];
};
export type AgentSkillSelectionResolution = {
    desiredSkills: string[];
    warnings: string[];
};
export type EnabledSkillsAgentRef = {
    id: string | null;
    orgId: string;
    agentRuntimeConfig: unknown;
    agentRuntimeType: string;
} | null;
export type AdapterSkillHomeDefinition = {
    mode: AgentSkillSyncMode;
    label: string;
    locationLabel: string;
    resolveRoot: (config: Record<string, unknown>) => string;
};
export type CommunityPresetDefinition = {
    slug: string;
    source: "repo";
} | {
    slug: string;
    source: "github";
    sourceUrl: string;
};
export declare const skillInventoryRefreshPromises: Map<string, Promise<void>>;
export declare const CANONICAL_BUNDLED_SKILL_KEYS: Set<string>;
export declare const COMMUNITY_PRESET_SKILLS: readonly CommunityPresetDefinition[];
export declare const COMMUNITY_PRESET_SKILL_SLUGS: string[];
export declare const BUNDLED_SELECTION_PREFIX = "bundled:";
export declare const ORGANIZATION_SELECTION_PREFIX = "org:";
export declare const AGENT_SELECTION_PREFIX = "agent:";
export declare const GLOBAL_SELECTION_PREFIX = "global:";
export declare const ADAPTER_SELECTION_PREFIX = "adapter:";
export declare const AGENT_SKILL_SOURCE_CLASS_ORDER: Record<AgentSkillSourceClass, number>;
export declare const ADAPTER_SKILL_HOME_DEFINITIONS: Record<string, AdapterSkillHomeDefinition>;
export declare const PROJECT_SCAN_DIRECTORY_ROOTS: readonly ["skills", "skills/.curated", "skills/.experimental", "skills/.system", ".agents/skills", ".agent/skills", ".augment/skills", ".claude/skills", ".codebuddy/skills", ".commandcode/skills", ".continue/skills", ".cortex/skills", ".crush/skills", ".factory/skills", ".goose/skills", ".junie/skills", ".iflow/skills", ".kilocode/skills", ".kiro/skills", ".kode/skills", ".mcpjam/skills", ".vibe/skills", ".mux/skills", ".openhands/skills", ".pi/skills", ".qoder/skills", ".qwen/skills", ".roo/skills", ".trae/skills", ".windsurf/skills", ".zencoder/skills", ".neovate/skills", ".pochi/skills", ".adal/skills"];
export declare const PROJECT_ROOT_SKILL_SUBDIRECTORIES: readonly ["references", "scripts", "assets"];
export declare function asString(value: unknown): string | null;
export declare function normalizeSkillDescription(value: unknown): string | null;
export declare function isPlainRecord(value: unknown): value is Record<string, unknown>;
export declare function resolveConfigEnvRecord(config: Record<string, unknown>): Record<string, unknown>;
export declare function resolveConfiguredHomeDir(config: Record<string, unknown>): string;
export declare function resolveConfiguredCodexHomeDir(config: Record<string, unknown>): string;
export declare function normalizePortablePath(input: string): string;
export declare function statPath(targetPath: string): Promise<import("fs").Stats | null>;
export declare function normalizePackageFileMap(files: Record<string, string>): Record<string, string>;
export declare function normalizeSkillSlug(value: string | null | undefined): string | null;
export declare function normalizeSkillKey(value: string | null | undefined): string | null;
export declare function isBundledRudderSourceKind(value: string | null | undefined): value is "rudder_bundled" | "paperclip_bundled";
export declare function isBundledRudderSkillKey(value: string | null | undefined): boolean;
export declare function buildBundledSelectionKey(skillKey: string): string;
export declare function buildOrganizationSelectionKey(skillKey: string): string;
export declare function buildAgentSelectionKey(slug: string): string;
export declare function buildGlobalSelectionKey(slug: string): string;
export declare function buildAdapterSelectionKey(agentRuntimeType: string, slug: string): string;
export declare function parseSelectionKey(selectionKey: string): {
    sourceClass: AgentSkillSourceClass | null;
    orgKey: string | null;
    slug: string | null;
    agentRuntimeType: string | null;
};
export declare function normalizeSelectionRef(reference: string, skills: OrganizationSkill[], orgId: string, agentRuntimeType: string): string | null;
export declare function discoverLocalSkillDirectories(root: string): Promise<string[]>;
export declare function readDiscoveredSkillEntries(orgId: string, root: string, selectionKeyForSlug: (slug: string) => string, options: {
    sourceClass: "agent_home" | "global" | "adapter_home";
    originLabel: string;
    locationLabel: string;
}): Promise<AgentSkillCatalogEntry[]>;
export declare function buildDraftSkillMarkdown(input: OrganizationSkillCreateRequest): string;
export declare function buildAgentPrivateSkillEntry(orgId: string, slug: string, skillDir: string, description: string | null): AgentSkillCatalogEntry;
export declare function normalizeGitHubSkillDirectory(value: string | null | undefined, fallback: string): string;
export interface SkillWithMetadata {
    id: string;
    key: string;
    metadata: {
        sourceKind?: string | null;
    } | null;
}
export declare function listStaleBundledSkillIds(existingSkills: SkillWithMetadata[], currentBundledKeys: string[]): string[];
export declare function listStaleCommunityPresetSkillIds(existingSkills: SkillWithMetadata[], currentCommunityPresetKeys: string[]): string[];
export declare function hashSkillValue(value: string): string;
export declare function uniqueSkillSlug(baseSlug: string, usedSlugs: Set<string>): string;
export declare function uniqueImportedSkillKey(orgId: string, baseSlug: string, usedKeys: Set<string>): string;
export declare function buildSkillRuntimeName(key: string, slug: string): string;
export declare function readCanonicalSkillKey(frontmatter: Record<string, unknown>, metadata: Record<string, unknown> | null): string | null;
export declare function deriveCanonicalSkillKey(orgId: string, input: Pick<ImportedSkill, "slug" | "sourceType" | "sourceLocator" | "metadata">): string;
export declare function classifyInventoryKind(relativePath: string): OrganizationSkillFileInventoryEntry["kind"];
export declare function deriveTrustLevel(fileInventory: OrganizationSkillFileInventoryEntry[]): OrganizationSkillTrustLevel;
export declare function toCompanySkill(row: OrganizationSkillRow): OrganizationSkill;
export declare function serializeFileInventory(fileInventory: OrganizationSkillFileInventoryEntry[]): Array<Record<string, unknown>>;
export declare function getSkillMeta(skill: OrganizationSkill): SkillSourceMeta;
export declare function resolveSkillReference(skills: OrganizationSkill[], reference: string, orgId: string): {
    skill: OrganizationSkill | null;
    ambiguous: boolean;
};
export declare function resolveRequestedSkillKeysOrThrow(skills: OrganizationSkill[], requestedReferences: string[], orgId: string): string[];
export declare function resolveDesiredSkillKeys(skills: OrganizationSkill[], config: Record<string, unknown>, orgId: string): string[];
export declare function getRequiredBundledSkillKeys(skills: Array<Pick<OrganizationSkill, "key">>): string[];
export declare function sortUniqueSkillKeys(skillKeys: string[]): string[];
export declare function sortUniqueSelectionRefs(selectionRefs: string[]): string[];
export declare function arraysEqual(left: string[], right: string[]): boolean;
export declare function buildMissingSelectionEntry(selectionKey: string, agentRuntimeType: string): AgentSkillCatalogEntry;
export declare function applyDesiredSelectionsToCatalog(entries: AgentSkillCatalogEntry[], desiredSelectionRefs: string[], agentRuntimeType: string): AgentSkillCatalog;
export declare function stripBundledRequiredSkillKeys(skillKeys: string[]): string[];
export declare function mergeRequiredBundledSkillKeys(skills: Array<Pick<OrganizationSkill, "key">>, skillKeys: string[]): string[];
export declare function normalizeSkillDirectory(skill: OrganizationSkill): string | null;
export declare function normalizeSourceLocatorDirectory(sourceLocator: string | null): string | null;
export declare function findMissingLocalSkillIds(skills: Array<Pick<OrganizationSkill, "id" | "sourceType" | "sourceLocator">>): Promise<string[]>;
export declare function resolveManagedSkillsRoot(orgId: string): string;
export declare function resolveWorkspaceEditPath(orgId: string, sourcePath: string | null | undefined): string | null;
export declare function resolveLocalSkillFilePath(skill: OrganizationSkill, relativePath: string): string | null;
export declare function inferLanguageFromPath(filePath: string): "json" | "html" | "markdown" | "typescript" | "tsx" | "javascript" | "jsx" | "yaml" | "bash" | "python" | "css" | null;
export declare function isMarkdownPath(filePath: string): boolean;
export declare function deriveSkillSourceInfo(skill: OrganizationSkill): {
    editable: boolean;
    editableReason: string | null;
    sourceLabel: string | null;
    sourceBadge: OrganizationSkillSourceBadge;
    sourcePath: string | null;
};
export declare function enrichSkill(skill: OrganizationSkill, attachedAgentCount: number, usedByAgents?: OrganizationSkillUsageAgent[]): {
    workspaceEditPath: string | null;
    editable: boolean;
    editableReason: string | null;
    sourceLabel: string | null;
    sourceBadge: OrganizationSkillSourceBadge;
    sourcePath: string | null;
    attachedAgentCount: number;
    usedByAgents: OrganizationSkillUsageAgent[];
    id: string;
    orgId: string;
    key: string;
    slug: string;
    name: string;
    description: string | null;
    markdown: string;
    sourceType: OrganizationSkillSourceType;
    sourceLocator: string | null;
    sourceRef: string | null;
    trustLevel: OrganizationSkillTrustLevel;
    compatibility: OrganizationSkillCompatibility;
    fileInventory: OrganizationSkillFileInventoryEntry[];
    metadata: Record<string, unknown> | null;
    createdAt: Date;
    updatedAt: Date;
};
export declare function toCompanySkillListItem(skill: OrganizationSkill, attachedAgentCount: number): OrganizationSkillListItem;
export declare function compareOrganizationSkillListItems(left: OrganizationSkillListItem, right: OrganizationSkillListItem): number;
//# sourceMappingURL=organization-skills.catalog.d.ts.map