import type { CliSettings } from "./config.js"; import type { StderrLike } from "./update-notice.js"; /** * Skills-staleness / compatibility check. * * Two copies of every skill exist: the SOURCE bundled in the CLI package * (`/skills/`) and the INSTALLED copy under a project's skills root written * by `cloudcruise install --skills`. Only the installed copy drifts, so this check * runs against the current project's skills roots and compares each pack's * install-time manifest to the running CLI version. * * A project may install to more than one root — `.claude/skills/` (Claude Code), * `.cursor/skills/` (Cursor), `.agents/skills/` (Codex/Devin) — so all three are * scanned. A pack installed to several roots is deduped to its OLDEST copy, so * drift surfaces if any copy is stale. (User-level/global roots are not scanned; * install is project-scoped today.) * * Scoped to the command groups the skill family actually drives * (builder/run/workflows); every other command is untouched. A pack with no * manifest (e.g. a hand-edited dev symlink pointing at source) is invisible. */ export declare const MIN_COMPATIBLE_SKILLS_CLI = "0.0.0"; export declare const GATE_MODE: "warn" | "refuse"; export interface SkillManifest { pack: string; cliVersion: string; requiresCli?: string; installedAt?: string; contentHash?: string; } export interface SkillsStatus { stale: string[]; cliBehind: string[]; incompatible: string[]; installedVersion?: string; } /** * Compare two `major.minor.patch` strings. Returns -1 / 0 / 1. Missing or * non-numeric parts are treated as 0 — dependency-free (`semver` is not a direct * dependency of this package). */ export declare function compareVersions(a: string, b: string): number; /** * Read every installed pack manifest across the project's skills roots. A pack * installed to several roots is deduped to its OLDEST-versioned copy, so a stale * copy in any root still surfaces. */ export declare function readInstalledManifests(cwd: string): SkillManifest[]; export declare function computeSkillsStatus(cwd: string): SkillsStatus; /** * Entry point for the `preAction` hook. `topLevelGroup` is the resolved * top-level command group (child of `program`). No-ops for any non-gated group, * and never throws — a broken check must not break a command. */ export declare function checkInstalledSkills(topLevelGroup: string | undefined): void; export interface AutoRefreshOptions { cwd: string; env: Record; settings: CliSettings; stderr: StderrLike; } /** * Reinstall every CLI-managed pack (one carrying a manifest) that an older CLI * stamped, so skills follow a CLI upgrade without a manual * `cloudcruise install --skills`. Packs edited since install are left to an * explicit `install --skills`. Never throws; a pack that is skipped or fails * stays as it was, and the staleness warning still fires for it. */ export declare function autoRefreshSkills(options: AutoRefreshOptions): string[];