/** * Skill Sync * * Installs Zenox's bundled skills into the OpenCode global skills directory * (~/.config/opencode/skills//) and keeps them in sync with the running * package version. Used by both the CLI installer and the plugin runtime so * skills auto-update whenever Zenox itself updates. * * Safety: * - A per-skill manifest (.zenox.json) records the package version + file hashes. * - Zenox only overwrites files it manages and that the user has NOT edited. * - All failures are non-fatal (read-only FS, partial writes, etc.). */ export interface SkillSyncResult { installed: string[]; updated: string[]; skipped: string[]; } /** * Resolve the OpenCode global skills directory. * Mirrors the XDG logic used elsewhere in the codebase. */ export declare function getGlobalSkillsDir(): string; /** * Locate the bundled `skills/` directory at runtime. * Walks up from this module's location looking for a `skills/` folder that * contains at least one SKILL.md. Works whether running from src (tests), * dist/index.js (plugin), or dist/cli/index.js (CLI). */ export declare function findBundledSkillsDir(startUrl?: string): string | null; /** * Read the Zenox package version by walking up from the bundled location to the * nearest package.json named "zenox". Falls back to "0.0.0" if not found. */ export declare function readPackageVersion(startUrl?: string): string; export interface SyncOptions { /** Current Zenox package version (stamped into the manifest). */ packageVersion: string; /** Skill names the user disabled; these are not installed. */ disabledSkills?: string[]; /** Override the bundled source dir (mainly for tests). */ bundledSkillsDir?: string; /** Override the target dir (mainly for tests). */ targetSkillsDir?: string; } /** * Install/update bundled skills. Idempotent and safe to call on every startup. * Never throws — returns a summary of what changed. */ export declare function syncBundledSkills(options: SyncOptions): SkillSyncResult;