//#region vendor/skills/src/types.d.ts type AgentType = 'amp' | 'antigravity' | 'augment' | 'claude-code' | 'openclaw' | 'cline' | 'codebuddy' | 'codex' | 'command-code' | 'continue' | 'cortex' | 'crush' | 'cursor' | 'deepagents' | 'droid' | 'gemini-cli' | 'github-copilot' | 'goose' | 'iflow-cli' | 'junie' | 'kilo' | 'kimi-cli' | 'kiro-cli' | 'kode' | 'mcpjam' | 'mistral-vibe' | 'mux' | 'neovate' | 'opencode' | 'openhands' | 'pi' | 'qoder' | 'qwen-code' | 'replit' | 'roo' | 'trae' | 'trae-cn' | 'warp' | 'windsurf' | 'zencoder' | 'pochi' | 'adal' | 'universal'; interface Skill { name: string; description: string; path: string; /** Raw SKILL.md content for hashing */ rawContent?: string; /** Name of the plugin this skill belongs to (if any) */ pluginName?: string; metadata?: Record; } interface AgentConfig { name: string; displayName: string; skillsDir: string; /** Global skills directory. Set to undefined if the agent doesn't support global installation. */ globalSkillsDir: string | undefined; detectInstalled: () => Promise; /** Whether to show this agent in the universal agents list. Defaults to true. */ showInUniversalList?: boolean; } //#endregion //#region src/types.d.ts /** * Filter item - either a package name/pattern (string) or an object specifying specific skills * Used by both include and exclude filters */ type FilterItem = string | { package: string; skills: string[]; }; interface CommandOptions { /** * Current working directory (defaults to workspace root) * @default searchForWorkspaceRoot(process.cwd()) */ cwd?: string; /** * Target agents to install to (defaults to all detected agents) * @default all detected agents */ agents?: AgentType | AgentType[]; /** * Source to discover skills from * @default 'node_modules' */ source?: 'node_modules' | 'package.json'; /** * Whether to scan recursively for monorepo packages (defaults to false) * @default false */ recursive?: boolean; /** * Skip updating .gitignore * @default true */ gitignore?: boolean; /** * Skip confirmation prompts * @default false */ yes?: boolean; /** * Dry run mode - don't make changes, just report what would be done * @default false */ dryRun?: boolean; /** * Packages or skills to include (only these will be installed) * Supports package wildcard patterns like "@some/*" * @default undefined (include all) */ include?: FilterItem[]; /** * Packages or skills to exclude from being installed * Supports package wildcard patterns like "@some/*" * @default [] */ exclude?: FilterItem[]; /** * Force full reload, ignore cache * @default false */ force?: boolean; /** * Clean up stale npm-* skills from agent directories * @default true */ cleanup?: boolean; } interface ResolvedOptions extends Omit { agents: AgentType[]; } interface NpmSkill { /** * NPM package name */ packageName: string; /** * NPM package version */ packageVersion?: string; /** * Skill directory name inside the package's skills/ folder */ skillName: string; /** * Absolute path to the skill directory */ skillPath: string; /** * Target symlink name with npm- prefix (e.g., "npm-eslint-best-practices") */ targetName: string; /** * Parsed skill metadata from SKILL.md */ name: string; /** * Parsed skill description from SKILL.md */ description: string; } interface ScanOptions { /** * Current working directory (defaults to workspace root) * @default searchForWorkspaceRoot(process.cwd()) */ cwd?: string; /** * Source to discover packages from * @default 'node_modules' */ source?: 'node_modules' | 'package.json'; /** * Whether to scan recursively for monorepo packages (defaults to false) * @default false */ recursive?: boolean; /** * Force full reload, ignore cache * @default false */ force?: boolean; } interface SkillInvalidInfo { /** * NPM package name */ packageName: string; /** * NPM package version */ packageVersion?: string; /** * Skill directory name */ skillName: string; /** * Error describing why the skill is invalid */ error: string; } interface ScanResultBase { /** * Skills found in the scan */ skills: NpmSkill[]; /** * Invalid skills found in the scan */ skillsInvalid: SkillInvalidInfo[]; /** * Root paths scanned */ rootPaths: string[]; } interface ScanResult extends ScanResultBase { /** * Number of packages scanned */ packagesScanned: number; /** * Whether the result was loaded from cache */ fromCache?: boolean; } interface PackageManagerLockfileInfo { /** * Hash of the package manager lockfile */ hash: string; /** * Path to the package manager lockfile */ path: string; } interface SkillsNpmCache extends ScanResultBase { /** * Package manager lockfile information */ lockfile: PackageManagerLockfileInfo; } interface SymlinkOptions { /** * Current working directory (defaults to workspace root) * @default searchForWorkspaceRoot(process.cwd()) */ cwd?: string; /** * Dry run mode - don't make changes, just report what would be done * @default false */ dryRun?: boolean; /** * Target agents to install to (defaults to all detected agents) * @default all detected agents */ agents?: AgentType[]; } interface SymlinkResult { /** * Skill to install */ skill: NpmSkill; /** * Agent to install to */ agent: string; /** * Symlink path to install to */ targetPath: string; /** * Success flag */ success: boolean; /** * Error message */ error?: string; } interface CleanupResult { /** * Agent the stale skill was cleaned from */ agent: string; /** * Target name of the stale skill (e.g., "npm-foo-bar") */ targetName: string; /** * Full path to the removed entry */ targetPath: string; /** * Whether the removal was successful */ success: boolean; /** * Error message if removal failed */ error?: string; } interface FilterResult { /** * Skills that matched the filters */ skills: NpmSkill[]; /** * Number of skills filtered out */ excludedCount: number; } interface SetupResult { /** * Absolute path to the package.json that was (or would be) edited */ packageJsonPath: string; /** * Outcome of wiring the `prepare` script */ prepare: { /** * Whether the prepare script was (or would be) changed */ changed: boolean; /** * The previous prepare script value, if any */ before?: string; /** * The resulting prepare script value */ after: string; }; } //#endregion //#region src/utils/command.d.ts /** * Options for {@link isCommandAvailable}. Every field is a dependency-injection * seam for tests; production callers pass nothing. */ interface CommandProbeOptions { /** Environment to read PATH/PATHEXT from. Defaults to `process.env`. */ env?: NodeJS.ProcessEnv; /** Platform to assume. Defaults to `process.platform` (lets Windows behavior be tested cross-platform). */ platform?: NodeJS.Platform; /** Per-candidate executable check. Defaults to a `stat` + `access(X_OK)` probe. */ isExecutableFile?: (filePath: string) => Promise; } //#endregion //#region vendor/skills/src/agents.d.ts declare const agents: Record; declare function detectInstalledAgents(): Promise; //#endregion //#region src/agents.d.ts /** * Detect installed agents by probing for their CLI command on PATH. * Conservative and additive; see {@link AGENT_COMMANDS}. */ declare function detectAgentsByCommand(options?: CommandProbeOptions): Promise; /** * All detected agents: the union of the vendored directory-based detection and * the command-on-PATH detection, deduplicated. */ declare function getDetectedAgents(): Promise; declare function getAllAgentTypes(): AgentType[]; //#endregion //#region src/gitignore.d.ts declare function hasGitignorePattern(cwd?: string): Promise; declare function gitignoreExists(cwd?: string): Promise; declare function updateGitignore(cwd?: string, dryRun?: boolean): Promise<{ updated: boolean; created: boolean; }>; //#endregion //#region src/scan.d.ts declare function scanNodeModules(options?: ScanOptions): Promise; declare function scanNodeModulesRecursively(options: ScanOptions): Promise; declare function saveCache(cwd: string, result: ScanResult, lockFileInfo: PackageManagerLockfileInfo): Promise; declare function scanCurrentNodeModules(cwd: string, source?: ScanOptions['source']): Promise; declare function scanPackageForSkills(nodeModulesPath: string, packageName: string): Promise<{ skills: NpmSkill[]; skillsInvalid: SkillInvalidInfo[]; }>; //#endregion //#region src/symlink.d.ts declare function symlinkSkill(skill: NpmSkill, options?: SymlinkOptions): Promise; declare function symlinkSkills(skills: NpmSkill[], options?: SymlinkOptions): Promise; declare function cleanupStaleSkills(skills: NpmSkill[], options?: SymlinkOptions): Promise; //#endregion //#region src/utils/fs.d.ts declare function isDirectoryOrSymlink(entry: { isDirectory: () => boolean; isSymbolicLink: () => boolean; }): boolean; /** * Used for monorepo support to find all packages that may have their own node_modules */ declare function searchForPackagesRoot(current: string): Promise; declare function getWorkspacePackages(current: string): Promise; declare function getPnpmWorkspacePackages(current: string): Promise; declare function getPackageDeps(current: string): Promise; declare function getPackageVersion(name: string, path: string): Promise; //#endregion //#region src/utils/package.d.ts declare function sanitizePackageName(packageName: string): string; declare function createTargetName(packageName: string, skillName: string): string; //#endregion //#region src/utils/skills.d.ts declare function hasValidSkillMd(dir: string): Promise<{ valid: boolean; name?: string; description?: string; error?: string; }>; /** * Filter skills by include/exclude options */ declare function filterSkills(skills: NpmSkill[], options: FilterItem[] | undefined, shouldMatch: boolean): NpmSkill[]; /** * Apply include and exclude filters to skills */ declare function processSkills(skills: NpmSkill[], include?: FilterItem[], exclude?: FilterItem[]): FilterResult; //#endregion //#region src/utils/workspace.d.ts /** * Search up for the nearest `package.json` */ declare function searchForPackageRoot(current: string, root?: string): string; /** * Search up for the nearest workspace root */ declare function searchForWorkspaceRoot(current: string, root?: string): string; //#endregion //#region src/index.d.ts declare function defineConfig(config: Partial): Partial; //#endregion export { type AgentConfig, type AgentType, CleanupResult, CommandOptions, FilterItem, FilterResult, NpmSkill, PackageManagerLockfileInfo, ResolvedOptions, ScanOptions, ScanResult, ScanResultBase, SetupResult, type Skill, SkillInvalidInfo, SkillsNpmCache, SymlinkOptions, SymlinkResult, agents, cleanupStaleSkills, createTargetName, defineConfig, detectAgentsByCommand, detectInstalledAgents, filterSkills, getAllAgentTypes, getDetectedAgents, getPackageDeps, getPackageVersion, getPnpmWorkspacePackages, getWorkspacePackages, gitignoreExists, hasGitignorePattern, hasValidSkillMd, isDirectoryOrSymlink, processSkills, sanitizePackageName, saveCache, scanCurrentNodeModules, scanNodeModules, scanNodeModulesRecursively, scanPackageForSkills, searchForPackageRoot, searchForPackagesRoot, searchForWorkspaceRoot, symlinkSkill, symlinkSkills, updateGitignore };