/** * Platform-triggered asset deployment. * * Takes catalog entries (with source_path relative to ai-assets/) and deploys * them to a session's .claude/skills/ directory. Handles skill context injection * and catalog priority-based name resolution. */ /** * A single user-facing input parameter declared in a SKILL.md. * * @docLink packages/asset-manager/concepts#catalog-deployer */ export interface InputSpec { /** Input parameter key used in skill invocation. */ key: string; /** Whether the input must be provided before running the skill. */ required?: boolean; /** Question string shown to the user when collecting this input. */ prompt?: string; /** Short display label for UI forms. */ label?: string; /** Input data type hint (e.g. `"string"`, `"number"`, `"file"`). */ type?: string; /** Additional guidance text shown alongside the input field. */ hint?: string; } /** * A compiled catalog entry (skill or flow). * * @docLink packages/asset-manager/concepts#catalog-deployer */ export interface CatalogEntryCompiled { /** Unique ID in `domain/name` form (e.g. `skaileup-conceptualization/cf_overview`). */ id: string; /** Asset kind. */ kind: "skill" | "flow"; /** Human-readable asset name. */ name: string; /** One-line description. */ description: string; /** Semantic version string. */ version: string; /** Maturity stage. */ stage: "alpha" | "beta" | "stable"; /** Searchable keywords. */ keywords: string[]; /** User-facing input specifications. */ inputs: InputSpec[]; /** Domain directory name. */ source_domain: string; /** Asset path relative to assetsRoot. */ source_path: string; /** Optional icon identifier. */ icon?: string; /** Flow-only: required skill names. */ required_skills?: string[]; /** Flow-only: optional skill names. */ optional_skills?: string[]; } /** * Options controlling how platform-triggered skill deployment is performed. * * @docLink packages/asset-manager/concepts#catalog-deployer */ export interface DeployFromCatalogOptions { /** Root directory of ai-assets (where `source_path` in catalog entries is relative to). */ assetsRoot: string; /** Target directory for deployed skills (e.g. `/workspace/.claude/skills/`). */ skillsDir: string; /** Optional context markdown appended to the deployed skill directory as `CONTEXT.md`. */ context?: string; } /** * Result of a platform-triggered batch skill deployment. * * @docLink packages/asset-manager/concepts#catalog-deployer */ export interface DeployResult { /** IDs of catalog entries successfully deployed. */ deployed: string[]; /** IDs of catalog entries skipped (non-skill kinds). */ skipped: string[]; /** Error messages for entries that could not be deployed. */ errors: string[]; } /** * Env override for the workspace-mount path(s), comma-separated. * * Set it when the runner binds the mount somewhere other than * {@link DEFAULT_WORKSPACE_MOUNT_DIR}; set it to the empty string to disable * the guard entirely (single-machine dev, where nothing is a network mount). */ export declare const WORKSPACE_MOUNT_ENV_VAR = "SKAILE_WORKSPACE_MOUNT_DIR"; /** * Resolve the directories treated as network mounts. * * Read per call rather than cached: the runner mutates `process.env` while * wiring a session, so a module-load snapshot would pin a pre-configuration * value. * * @returns Absolute mount paths; empty when the guard is disabled. * @docLink packages/asset-manager/concepts#catalog-deployer */ export declare function workspaceMountDirs(): string[]; /** * Is `candidate` at, or inside, one of the known workspace mount paths? * * Pure path arithmetic — deliberately no filesystem access, because the whole * point is to decide *before* touching a path that might be unresponsive. * * @param candidate - Path to test. * @param mountDirs - Mount roots; defaults to {@link workspaceMountDirs}. * @docLink packages/asset-manager/concepts#catalog-deployer */ export declare function isUnderWorkspaceMount(candidate: string, mountDirs?: string[]): boolean; /** * Walk upward from `startDir` looking for an `ai-assets/` directory. * * Two properties matter beyond "find the folder": * * 1. **Never synchronous.** The walk probes up to six directories; any one of * them can be on a FUSE mount, and the former `existsSync` chain blocked the * event loop on the first unresponsive probe. Each probe is now awaited and * deadline-bounded, so a wedged mount costs one skipped candidate. * 2. **Never resolves onto a mount.** A hit under the workspace mount is * skipped with a warning rather than returned: accepting it would wire every * later skill deploy — a recursive copy — to a remote filesystem. The walk * continues upward, so a legitimate `ai-assets/` in a parent still wins. * * Only a **directory** counts. An `ai-assets` file would otherwise be returned * as a root and every later `join(root, source_path)` would fail with ENOTDIR. * * @param startDir - Directory to start from (typically the project dir). * @param opts - `levels` caps the upward walk; `mountDirs` overrides the mount * roots (defaults to {@link workspaceMountDirs}). * @returns Absolute path to the `ai-assets/` directory, or `null` if none is * reachable within `levels`. * @docLink packages/asset-manager/concepts#catalog-deployer */ export declare function findAiAssetsRoot(startDir: string, opts?: { levels?: number; mountDirs?: string[]; }): Promise; /** * Deploy a single catalog entry to the session skills directory. * * Copies the entire skill source directory into `skillsDir//`. * If `context` is provided, a separate `CONTEXT.md` is written alongside * `SKILL.md` so the source file is never modified. * * Only `skill` entries are deployable; other kinds return an error. * * **Async by necessity.** This runs from the `session_init` command handler * with the WebSocket live, and both `assetsRoot` and `skillsDir` can sit on a * network mount. The former `cpSync`/`rmSync` pair parked the event loop for * the whole copy; every call is now awaited and deadline-bounded, so an * unresponsive mount fails one deployment instead of the session. * * @param entry - Compiled catalog entry to deploy. * @param options - Deployment target and optional context. * @returns `{ success: true }` on success, `{ success: false, error }` on failure. * @docLink packages/asset-manager/concepts#catalog-deployer */ export declare function deployCatalogEntry(entry: CatalogEntryCompiled, options: DeployFromCatalogOptions): Promise<{ success: boolean; error?: string; }>; /** * Remove a deployed skill directory from the session skills directory. * * @param name - Skill name (directory basename under `skillsDir`). * @param skillsDir - Absolute path to the session skills directory. * @returns `true` if the skill was found and removed; `false` if it was not * deployed, or if the directory could not be reached within the deadline. * @docLink packages/asset-manager/concepts#catalog-deployer */ export declare function undeployCatalogEntry(name: string, skillsDir: string): Promise; /** * Deploy multiple catalog entries in a single batch operation. * * Non-skill entries (flows, agents, etc.) are automatically skipped and * recorded in `result.skipped`. Deployment failures are collected in * `result.errors` without aborting the rest of the batch. * * @param entries - Compiled catalog entries to deploy. * @param options - Deployment target and optional context. * @returns Aggregated {@link DeployResult} with deployed, skipped, and error lists. * @docLink packages/asset-manager/concepts#catalog-deployer */ export declare function deployAll(entries: CatalogEntryCompiled[], options: DeployFromCatalogOptions): Promise; /** * Resolve a flow's skill dependencies from the full catalog entry list. * * Partitions `flow.required_skills` and `flow.optional_skills` into resolved * entries and a list of names that could not be found. Missing optional skills * are silently ignored (they do not appear in `missing`). * * @param flow - Compiled flow entry whose skill dependencies should be resolved. * @param allEntries - Full set of compiled catalog entries to search. * @returns Object containing resolved `required` entries, resolved `optional` entries, * and `missing` skill names that were listed as required but not found. * @docLink packages/asset-manager/concepts#catalog-deployer */ export declare function resolveFlowSkills(flow: CatalogEntryCompiled, allEntries: CatalogEntryCompiled[]): { required: CatalogEntryCompiled[]; optional: CatalogEntryCompiled[]; missing: string[]; }; //# sourceMappingURL=catalog-deployer.d.ts.map