/** * Cross-vendor Agent Skills distribution. * * Cotal authors a small set of Agent Skills (SKILL.md, the agentskills.io open format). One canonical * copy of each ships inside this CLI package (see package.json `files`) and feeds three delivery * channels from that single source: * 1. Connector-declared harness adapters receive the canonical directory through the generic * setup-provider seam; each adapter owns its native packaging and update path. * 2. Every other harness (Codex, Cursor, OpenCode, Gemini CLI, Windsurf/Devin) reads the cross-vendor * `~/.agents/skills/` directory convention. No remote index reaches them today, so `cotal setup` * (and `cotal setup --skills`) reconciles the files here and `cotal status` reports skew. This module owns that reconcile. * 3. The website Agent Skills discovery index, generated from the same canonical files at build. * * File-level ownership (the safety model): Cotal owns exactly ONE file per skill it ships, * `~/.agents/skills//SKILL.md`, tracked by digest in a validated manifest under `~/.cotal`. It * only ever writes/removes that file: it never recursively deletes a skill directory (a retired skill's * dir is removed only if it is left empty), never touches any other file a user or third party put * there, refuses to follow a symlink anywhere in the managed path, and writes via a stage-and-rename so * it replaces the directory entry instead of writing through a hard-linked inode. That keeps a * destructive reconcile from becoming a data-loss or arbitrary-write primitive. */ /** The canonical `SKILL.md` source dir, shipped in this CLI package. Resolved the same way in a dev * clone (built dist/lib) and an installed binary: two levels up from dist/lib is the package root. */ export declare function canonicalSkillsDir(): string; /** The cross-vendor skills directory the other harnesses read: `~/.agents/skills`. Anchored on the OS * home dir (not `~/.cotal`), because that is the real path those tools scan. */ export declare function agentSkillsHome(): string; /** The Cotal-authored skill names shipped in this binary, one dir with a `SKILL.md` each. Fails LOUD * (repo rule: no silent fallbacks) if the bundle is absent, empty, a child dir lacks its SKILL.md, or a * child name is not a valid slug, so a truncated/corrupt install surfaces instead of shipping zero (or * a malformed) skill. */ export declare function canonicalSkillNames(): string[]; export type AgentSkillsResult = { installed: string[]; backedUp: { name: string; path: string; }[]; removed: string[]; }; /** Reconcile Cotal's authored skills into `~/.agents/skills`, at the file level: * - install/refresh each canonical skill's `SKILL.md` (and only that file, never other files in the * dir); if the destination is a user's or third party's copy (not what we last wrote), copy the * current content into a fresh `SKILL.md.bak` slot (created exclusively, never overwriting an * existing/foreign backup) before overwriting, so every divergent edit stays recoverable; * - remove a skill Cotal previously owned that is no longer canonical (retired), but only its * `SKILL.md`, and only when that file is still exactly what we wrote; then drop the dir if it is now * empty. A user's file in the dir, or a copy they have changed, is never removed. * Idempotent; fails loud on a corrupt bundle or manifest. */ export declare function installAgentSkills(): AgentSkillsResult; export type SkillSkewState = "current" | "stale" | "missing" | "retired"; export type SkillSkew = { name: string; state: SkillSkewState; }; /** Compare the managed `~/.agents/skills` tree against canonical so `cotal status` can surface drift: * `current` (identical), `stale` (present but differs), `missing` (not dropped), or `retired` (a skill * Cotal still owns on disk but no longer ships, awaiting removal on the next `cotal setup --skills`). Throws on * a corrupt bundle or manifest; the caller renders that as an integrity error. */ export declare function agentSkillsSkew(): SkillSkew[]; //# sourceMappingURL=agent-skills.d.ts.map