/** * Per-source-type discovery walkers. * * Each walker takes a `SkillSource` config entry and resolves the list of * skill directories that source contributes. The manager then parses + * validates each directory and assembles the catalog with shadowing * and FQN namespacing. * * Walkers do NOT parse `SKILL.md` content — they only locate directories. * Per-source error handling is best-effort: a missing source resolves to * an empty list with no error; an unreadable source surfaces an * `sdk.skill.error` event with `severity: 'error'` so the manager can * include it in telemetry without poisoning other sources' contributions. */ import type { SkillSource } from '../types.js'; import type { WalkedSkill } from './walk.js'; /** * Result of one source's walk. `errors` carries unreadable-path / * permission / IO failures the manager forwards as `sdk.skill.error`. */ export interface SourceWalkResult { readonly source: SkillSource; readonly skills: readonly WalkedSkill[]; readonly errors: readonly { readonly path?: string; readonly message: string; }[]; /** Resolved vendor for the source — populated for `package` / `cli-fetched` whose vendor is derived from path/ref. */ readonly resolvedVendor?: string; } /** Resolve a `cwd` for project / config walks. Tests inject; production uses `process.cwd()`. */ export interface WalkerEnv { readonly cwd: string; readonly homedir: string; readonly env: Readonly>; } export declare function defaultWalkerEnv(): WalkerEnv; /** * Dispatch by source `type`. Unknown types are rejected; the caller is * expected to validate `SkillsConfig.sources` at construction time. */ export declare function walkSource(source: SkillSource, env: WalkerEnv): Promise; /** * Validate an npm package name before it gets `path.join`-ed onto a * `node_modules` root. This is *not* the canonical npm name regex * (that allows things we don't need), it's an allowlist of: * * - unscoped: `name` — one-to-many of `[a-z0-9._-]`, must start with * `[a-z0-9_]` (npm allows leading `-` but it's rarely used and * creates argv parsing ambiguity; reject for our purposes). * - scoped: `@scope/name` where both segments match the unscoped rule. * * Rejects: empty input, leading `.`, path separators (`/` outside the * exactly-one scoped separator, any `\\`), `..`, absolute paths, drive * prefixes (`C:`), and any character outside the allowlist. */ export declare function isValidPackageName(name: string): boolean; export type { WalkedSkill }; //# sourceMappingURL=index.d.ts.map