UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

34 lines • 2.1 kB
import { type Dirent } from "node:fs"; import ignore from "ignore"; import { type SkillAllowedSet, type SkillProvenance } from "./skill-access.ts"; /** Bytes read before falling back to the rest of SKILL.md when the closing --- is absent. */ export declare const SKILL_FRONTMATTER_PREFIX_BYTES = 8192; type IgnoreMatcher = ReturnType<typeof ignore>; export type SkillDiscoveryMode = "pi" | "agents"; export interface SkillWalkOptions { readonly provenance?: SkillProvenance; readonly allowedSet?: SkillAllowedSet; readonly ancestry?: ReadonlySet<string>; readonly onDirectory?: (path: string) => void; /** Receives the SKILL.md of each skill folder an ignore file hid from the walk. */ readonly onIgnoredSkill?: (skillFile: string) => void; /** Optional cache owned by a single discovery pass, never retained on a Skill. */ readonly realpath?: (path: string) => string; } export declare function shouldSkipSkillWalkDirectoryName(name: string): boolean; /** * Applies the ignore files present in `entries`, the listing of `dir` the walk already read, so no * directory pays a probe per ignore-file name (omo#11437). Names compare case-insensitively, as the * former existence probe did on case-insensitive volumes; a name that does not open is skipped. */ export declare function addIgnoreRules(ig: IgnoreMatcher, dir: string, rootDir: string, entries: readonly Dirent[]): void; /** * Read enough of a skill markdown file to parse YAML frontmatter. * Stops at the first 8 KiB when that prefix already contains the closing --- (or has no frontmatter). * Falls back to the rest of the file when the delimiter is not in the prefix. */ export declare function readSkillMarkdownSource(filePath: string): string; export declare function collectSkillEntries(dir: string, mode: SkillDiscoveryMode, ignoreMatcher?: IgnoreMatcher, rootDir?: string, options?: SkillWalkOptions): string[]; export declare function collectAutoSkillEntries(dir: string, mode: SkillDiscoveryMode, options?: SkillWalkOptions): string[]; export {}; //# sourceMappingURL=skill-discovery.d.ts.map