/** * skillRefs → ~/.agenticros/skills-cache resolver (marketplace auto-fetch). * * Declarative refs like `owner/skill`, `owner/skill@main`, or * `@agenticros/foo@^1.0.0` are resolved via the skills marketplace * install API (or directly from npm), cached under ~/.agenticros/skills-cache, * and returned as absolute skillPaths for capability reading / OpenClaw loading. * * Prefer npm when the install descriptor includes `npmPackage` (or the ref * is already a scoped npm name). Fall back to git clone + build. * * Never auto-upgrades: if the cache dir for a pin already exists, reuse it * (optional pull when AGENTICROS_SKILLS_CACHE_PULL=1 for git caches). */ import type { AgenticROSConfig } from "./config.js"; export declare const DEFAULT_SKILLS_API = "https://skills.agenticros.com/api"; export declare const DEFAULT_SKILLS_CACHE_DIR: string; export interface ParsedSkillRef { kind: "marketplace" | "npm"; /** owner/skill (lowercase) — marketplace refs only */ marketplaceRef?: string; owner?: string; skill?: string; /** git ref / branch pin; default main — marketplace refs */ gitRef?: string; /** Scoped npm package name — npm refs */ npmPackage?: string; /** Semver range or exact version pin — npm refs (default: latest resolved) */ npmVersion?: string; } export interface InstallDescriptor { slug: string; marketplaceRef?: string; skillId: string; packageName: string; githubUrl: string; ref: string; buildCmd: string; /** When set, prefer npm pack over git clone. */ npmPackage?: string; /** Pinned npm version when known. */ npmVersion?: string; } export interface ResolveSkillRefsOptions { apiBase?: string; cacheDir?: string; /** When true, git pull --ff-only if cache already exists. */ pullIfPresent?: boolean; /** Skip network / clone (return only paths that already exist in cache). */ offline?: boolean; onLog?: (msg: string) => void; } export interface ResolveSkillRefsResult { /** Absolute directories ready to merge into skillPaths. */ paths: string[]; errors: Array<{ ref: string; error: string; }>; } /** * Parse `owner/skill`, `owner/skill@branch`, or `@scope/name[@semver]`. */ export declare function parseSkillRef(raw: string): ParsedSkillRef | null; export declare function skillsApiBase(override?: string): string; export declare function skillsCacheDir(override?: string): string; export declare function fetchInstallDescriptor(marketplaceRef: string, apiBase?: string): Promise; /** * Pack an npm package into the skills cache and return the absolute dir. */ export declare function ensureNpmPackageCached(npmPackage: string, versionRange: string | undefined, opts?: ResolveSkillRefsOptions): Promise; /** * Ensure one skillRef is present under the cache. Returns absolute path or throws. */ export declare function ensureSkillRefCached(rawRef: string, opts?: ResolveSkillRefsOptions): Promise; /** * Resolve all config.skillRefs into absolute directories. * Does not mutate config — caller merges into skillPaths. */ export declare function resolveSkillRefs(refs: string[], opts?: ResolveSkillRefsOptions): Promise; /** * Return a config copy with skillRefs resolved into skillPaths (deduped). */ export declare function withResolvedSkillRefs(config: AgenticROSConfig, opts?: ResolveSkillRefsOptions): Promise<{ config: AgenticROSConfig; errors: ResolveSkillRefsResult["errors"]; }>; /** * Sync: merge skillRefs that are already present under the skills-cache * into skillPaths. No network — use CLI install / ensureSkillRefCached to * populate the cache first. Safe for OpenClaw's synchronous register(). */ export declare function applyCachedSkillRefs(config: AgenticROSConfig): AgenticROSConfig; /** Repo name hint from github URL (for logging). */ export declare function githubRepoBasename(githubUrl: string): string; //# sourceMappingURL=skill-refs.d.ts.map