import type { BotRow, SkillRow, SkillPolicy } from './types.js'; export declare function nativeLibraryLabel(path: string | undefined, tr: (key: string) => string): string | null; export declare function sourceLabel(skill: SkillRow, tr: (key: string) => string): string; export declare function priorityNames(policy?: SkillPolicy | null): string[]; export declare function packIds(policy?: SkillPolicy | null): string[]; /** Build one complete Bot assignment payload. The editor owns both direct * Skills and Skill Packs, so they must be saved in a single request; two * independent full-policy writes race and can silently overwrite each other. * Unknown selectors are retained for forward/downgrade compatibility. */ export declare function mergeBotAssignmentSelectors(current: SkillPolicy | null | undefined, skillNames: string[], packIdsList: string[]): string[]; export declare function policyReferenceCount(policy?: SkillPolicy | null): number; export declare function policyConfigured(policy?: SkillPolicy | null): boolean; export declare function discoveryGroupKey(group: { cliId: string; rootDir: string; }): string; /** Minimal pack shape the graph needs — both the thin `{id,name,include}` * summaries and full SkillPackRow objects satisfy it. */ export interface GraphPackInput { id: string; name?: string; include: string[]; } export interface SkillUsageInfo { name: string; /** false = referenced by a pack or bot but not installed */ installed: boolean; /** ids of packs whose include lists contain this skill */ packIds: string[]; /** larkAppIds of bots referencing this skill via `skill:` directly */ directBotIds: string[]; /** larkAppIds of bots that get this skill through an assigned pack */ viaPackBotIds: string[]; } export interface PackGraphInfo { id: string; /** member skill names that are installed */ resolved: string[]; /** member skill names referenced but not installed */ missing: string[]; /** larkAppIds of bots referencing this pack */ botIds: string[]; } /** 'unknown' = the bot references packs but pack data has never loaded * (packsKnown=false), so pack-derived health cannot be judged either way. */ export type BotHealthLevel = 'ok' | 'default' | 'missing' | 'pack_missing' | 'unknown'; export interface BotGraphInfo { larkAppId: string; /** deduped effective skills with provenance; only installed skills count */ resolved: Array<{ name: string; source: 'direct' | `pack:${string}`; }>; /** referenced skill names (direct or via pack) that are not installed */ missingSkills: string[]; /** referenced pack ids that do not exist */ missingPacks: string[]; finalCount: number; health: BotHealthLevel; } export interface SkillGraph { /** keyed by skill name; includes referenced-but-not-installed skills */ skills: Map; packs: Map; bots: Map; } /** Build the single relationship model all three skill tables derive from. * Referenced-but-not-installed skills get graph nodes with installed=false so * the UI can surface them (and link into the install flow) instead of * silently dropping them. */ export declare function buildSkillGraph(installedSkills: Array>, packs: GraphPackInput[], bots: Array>, opts?: { packsKnown?: boolean; }): SkillGraph; /** All skill names referenced anywhere (packs or bot policies) but not installed. */ export declare function danglingSkillNames(graph: SkillGraph): string[]; /** Decide the default checkbox state for discovered install candidates. * No target → all preselected (existing behavior). With a target: only the * matching candidate — and if the target is absent from the source, select * NOTHING and flag it, so a wrong repo can't be accidentally bulk-installed. */ export declare function selectInstallCandidates(candidates: Array<{ name: string; }>, targetSkill: string | null | undefined): { selected: Set; targetMissing: boolean; }; //# sourceMappingURL=shared.d.ts.map