/** * Skill discovery, validation, and config-file mutation primitives. * * An AgenticROS skill is a Node package whose `package.json` carries an * `agenticros` block (with at least an `id`) and exports a * `registerSkill(api, config, context)` function from its `main` entry. The OpenClaw AgenticROS plugin loads them * at gateway start by walking two arrays in its config: * * - `skillPaths[]` — absolute directories to scan (validate `package.json`) * - `skillPackages[]` — npm-resolvable names (e.g. `agenticros-skill-find`) * * This module is the single place the CLI talks to those arrays. It also * encapsulates discovery (where on disk users typically clone skill repos) * and the `deriveSkillId` convention shared with `@agenticros/agenticros`'s * skill-loader so menu / list output uses the same short ids the plugin * surfaces (e.g. `followme`, `find`). */ export interface SkillRef { /** Short id (matches what the OpenClaw plugin uses for `config.skills.`). */ id: string; /** npm package name (from `package.json.name`). */ packageName: string; /** Absolute directory containing `package.json`, when known. */ dir?: string; /** Where the skill is currently registered with the gateway. */ registeredAs: ("path" | "package")[]; /** * Absolute path the skill's `package.json` declares as its entry (`main`), * resolved against `dir`. Only set when we inspected the directory. */ entry?: string; /** True when `entry` exists on disk; false when the skill needs `pnpm build`. */ built?: boolean; } /** * Apply the same short-id transform the OpenClaw plugin's skill-loader uses, * so menu output and the plugin's `config.skills.` keys line up exactly. * `agenticros-skill-followme` → `followme`; scoped packages drop the scope. */ export declare function deriveSkillId(packageName: string): string; /** * Inspect a directory and decide whether it's a valid AgenticROS skill clone. * Returns a partial `SkillRef` (no `registeredAs`) or `undefined` when the * directory is missing, lacks `package.json`, or doesn't declare a valid * `agenticros` block (with at least `id`). */ export declare function inspectSkillDir(dir: string): Omit | undefined; /** * Read `agenticros.capabilities[].requires` from a skill directory. * Used to warn (never fail) when a robot profile cannot satisfy a skill. */ export declare function readSkillCapabilityRequires(dir: string): Array<{ id: string; requires: string[]; }>; /** * Return a deduped list of "places we should look for skill clones" — the * directories whose children the CLI scans on `agenticros skills discover`. * * We include both the parent of the active repo / install dir (so siblings * of `agenticros/` work, e.g. `../agenticros-skill-find`) and `$HOME` / * `$HOME/Projects/` / `$HOME/Code/` so a vanilla clone-into-Projects flow * is found without configuration. */ export declare function discoveryRoots(extra?: string[]): string[]; /** * Walk every directory in `roots`, returning a `SkillRef` for each child * directory that passes `inspectSkillDir`. Used by both `discover` and * `list` (which uses it to render orphaned-but-cloned skills). */ export declare function scanForSkills(extra?: string[]): SkillRef[]; export interface SkillsListing { /** Skills currently registered in the OpenClaw config (path-loaded or package-loaded). */ registered: SkillRef[]; /** Skill clones that exist on disk in known discovery roots but aren't registered. */ available: SkillRef[]; /** `skillPaths` entries that refer to a directory that no longer exists. */ brokenPaths: string[]; } /** * Build a snapshot of the user's current skill state: what's registered, * what's available-but-not-registered, and what registrations are broken. * The single source of truth for the `agenticros skills` (list) view. */ export declare function listSkills(): SkillsListing; export interface AddResult { ok: boolean; /** Human-readable summary of what changed (or why nothing changed). */ message: string; skill?: SkillRef; } /** * Add a skill to the OpenClaw plugin config by absolute directory path. * Idempotent: re-adding an existing entry is a no-op and returns `ok: true` * with an explanatory message. The directory must contain a valid * `package.json` with an `agenticros` block (with at least `id`). */ export declare function addSkillByPath(dir: string): AddResult; /** * Add a skill by npm package name (must be resolvable on the gateway's * Node search path). Mainly intended for skills published to a registry — * for local clones, prefer `addSkillByPath` so the absolute directory is * recorded. */ export declare function addSkillByPackage(name: string): AddResult; export interface RemoveResult { ok: boolean; message: string; removedPaths: string[]; removedPackages: string[]; } /** * Remove every registration that matches `idOrName` — either a derived skill * id (e.g. `find`), a full package name (e.g. `agenticros-skill-find`), or an * absolute path that appears in `skillPaths`. Both `skillPaths` (matched by * resolving each path back through `inspectSkillDir`) and `skillPackages` * are cleaned in a single pass. */ export declare function removeSkill(idOrName: string): RemoveResult; /** * Append a marketplace skillRef (e.g. `agenticros/navigate-to`) to the * OpenClaw plugin config and `~/.agenticros/config.json` when present. * Idempotent. */ export declare function addSkillRef(marketplaceRef: string): AddResult; //# sourceMappingURL=skills.d.ts.map