/** * Read-only skill-catalog access for the D-Robotics/rdk-skills hub (issue #4). * * The hub's own generators maintain the catalog; this module only fetches the * two published JSON files pinned to one commit SHA, validates them, and keeps * an atomic snapshot cache. It never installs skills or runs hub scripts. */ export declare const HUB_REPO = "D-Robotics/rdk-skills"; export declare const SKILL_INDEX_PATH = "skills/rdk-skill-finder/references/skill-index.json"; export declare const PACK_REGISTRY_PATH = "skills/rdk-pack-installer/references/pack-registry.json"; /** The flat skill that installs workspace packs; workspace results hand off to it. */ export declare const PACK_INSTALLER_SKILL = "rdk-pack-installer"; /** Exported for tests only, so the size-limit case does not build a 5 MiB string. */ export declare const MAX_JSON_BYTES_FOR_TESTS: number; export type SkillErrorCode = "invalid_input" | "catalog_unavailable" | "invalid_catalog" | "unsupported_schema" | "unknown_skill" | "missing_installer"; export declare class SkillError extends Error { readonly code: SkillErrorCode; constructor(code: SkillErrorCode, message: string); } export type InstallType = "flat" | "workspace"; export type SkillRecord = { name: string; description: string; pack: string; repo: string; catalog_path: string; install_type: InstallType; }; export type PackRecord = { name: string; repo: string; ref: string; catalog_dir: string; install_script: string; workspace_dir: string; verify_paths: string[]; }; /** One hub snapshot: both JSON files from the same commit SHA. */ export type SkillCatalogSnapshot = { schema: 1; revision: string; /** ISO UTC timestamp of the actual fetch, used for TTL accounting. */ fetched_at: string; skills: SkillRecord[]; packs: PackRecord[]; }; export type CatalogResult = { snapshot: SkillCatalogSnapshot; warnings: string[]; from_cache: boolean; }; export type CatalogHttpResult = { status: number; body: string; }; export type CatalogHttp = (url: string) => Promise; export declare const defaultCatalogHttp: CatalogHttp; /** * Cross-file consistency: unique names, unique pack identity, and every * workspace skill must resolve to a pack record from the same repo. A missing * pack is a hard failure — it must never degrade into a flat install. */ export declare function crossValidate(skills: SkillRecord[], packs: PackRecord[], revision: string): void; export type CatalogLoadDeps = { httpGet?: CatalogHttp; now?: () => number; }; /** Test hook: the loader keeps process-level state; tests must reset it. */ export declare function resetSkillCatalogState(): void; /** * Load the skill catalog snapshot. Fresh in-process state and a fresh disk * snapshot are used directly; otherwise one shared refresh runs, fetching the * revision first and both JSON files from that exact SHA. Concurrent callers * share the in-flight refresh; it is cleared once settled. */ export declare function loadSkillCatalog(deps?: CatalogLoadDeps): Promise; /** Blob URL of a skill's SKILL.md inside the hub at the snapshot revision. */ export declare function skillSourceUrl(snapshot: SkillCatalogSnapshot, catalogPath: string): string; /** Hub install/usage doc pinned to the snapshot revision. */ export declare function hubUsageUrl(snapshot: SkillCatalogSnapshot): string;