export declare const SKILL_VERSION_MARKER_FILENAME = ".workos-skill-version"; /** * Read the bundled @workos/skills version by walking up from the skills * directory to the package.json. The package's `exports` map doesn't expose * package.json, so we resolve it by filesystem convention. * Returns null if the version can't be determined — callers treat that as * "no marker written" rather than failing the install. */ export declare function getBundledSkillsVersion(skillsDir?: string): Promise; export interface AgentConfig { name: string; displayName: string; globalSkillsDir: string; detect: () => boolean; } export declare function createAgents(home: string): Record; export interface InstallSkillOptions { skill?: string[]; agent?: string[]; } export declare function getSkillsDir(): string; export declare function discoverSkills(skillsDir: string): Promise; export declare function detectAgents(agents: Record, filter?: string[]): AgentConfig[]; /** * Recursively install a skill directory (SKILL.md + references/ + any other * files) with prune-replace semantics. Uses a sibling temp dir + backup-rename * pattern so the operation is effectively atomic per skill: the target either * matches the source exactly, or (on rollback) is restored to its prior state. * * Returns `{ success, error }` rather than throwing — callers (autoInstallSkills, * runInstallSkill) accumulate failures across the (skill × agent) matrix. */ export declare function installSkill(skillsDir: string, skillName: string, agent: AgentConfig): Promise<{ success: boolean; error?: string; }>; export declare function runInstallSkill(options: InstallSkillOptions): Promise; export interface AutoInstallResult { skills: string[]; agents: string[]; version: string | null; } export interface RefreshOptions { /** Pre-detected agents. Default: detect from $HOME. */ agents?: AgentConfig[]; /** Skill names to install. Default: all bundled skills. */ skills?: string[]; /** Whether to write the version marker after a successful per-agent install. Default: true. */ writeMarker?: boolean; } export interface RefreshResult { /** Agents where at least one skill installed successfully. */ agents: AgentConfig[]; /** Skills that were attempted (the resolved set after filtering). */ skills: string[]; /** Bundled skills package version, or null if it couldn't be resolved. */ version: string | null; /** Marker version per agent.name BEFORE refresh (null = no marker / unreadable). */ perAgentBefore: Record; /** Marker version per agent.name AFTER refresh. */ perAgentAfter: Record; } /** * Reusable primitive: discover bundled skills, install each one to each agent, * write per-agent version markers, and report before/after marker state. * * Both `autoInstallSkills` (best-effort hook called from install/login) and * `doctor --fix` (Phase 3) call this — there is no duplicate copy logic. * * Returns null when nothing applied (no agents detected, no skills found, or * every install attempt failed). */ export declare function refreshWorkOSSkills(opts?: RefreshOptions): Promise; /** * Install all bundled skills to all detected coding agents. * Returns a summary when anything was installed, or null when nothing applied. * Performs minimal IO: writes a version marker file alongside installed * skills so `workos doctor` can detect staleness later. Errors are swallowed * so skill install never disrupts the calling flow. * * Thin back-compat wrapper around `refreshWorkOSSkills` — the install/auth-login * call sites use this; doctor `--fix` (Phase 3) calls `refreshWorkOSSkills` * directly to surface the per-agent before/after marker state. */ export declare function autoInstallSkills(): Promise;