@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
71 lines • 2.74 kB
TypeScript
import type { ResourceDiagnostic } from "./diagnostics.ts";
import { type SkillAllowedSet, type SkillProvenance } from "./skill-access.ts";
import { type SourceInfo } from "./source-info.ts";
export { formatSkillsForPrompt } from "./skills-prompt.ts";
export interface SkillFrontmatter {
name?: string;
description?: string;
"disable-model-invocation"?: boolean;
"argument-hint"?: string;
"requires-arguments"?: boolean;
[key: string]: unknown;
}
export interface Skill {
name: string;
description: string;
filePath: string;
baseDir: string;
sourceInfo: SourceInfo;
disableModelInvocation: boolean;
/** Usage hint from the `argument-hint` frontmatter. */
argumentHint?: string;
/** `requires-arguments` frontmatter; defaults to true when a hint is declared, else false. */
requiresArguments?: boolean;
/** Root authority is retained for invocation and sidecar reads. */
provenance?: SkillProvenance;
allowedSet?: SkillAllowedSet;
}
export interface LoadSkillsResult {
skills: Skill[];
diagnostics: ResourceDiagnostic[];
}
export interface LoadSkillsFromDirOptions {
/** Directory to scan for skills */
dir: string;
/** Source identifier for these skills */
source: string;
provenance?: SkillProvenance;
allowedSet?: SkillAllowedSet;
}
/**
* Load skills from a directory.
*
* Discovery rules:
* - if a directory contains SKILL.md, treat it as a skill root and do not recurse further
* - otherwise, load direct .md children in the root
* - recurse into subdirectories to find SKILL.md
*/
export declare function loadSkillsFromDir(options: LoadSkillsFromDirOptions): LoadSkillsResult;
export interface LoadSkillsOptions {
/** Working directory for project-local skills. */
cwd: string;
/** Agent config directory for global skills. Default: ~/.senpi/agent */
agentDir: string;
/** Explicit skill paths (files or directories) */
skillPaths: string[];
/** Include default skills directories. */
includeDefaults: boolean;
provenanceByPath?: ReadonlyMap<string, SkillProvenance>;
userSkillRoots?: readonly string[];
}
/**
* Load skills from all configured locations.
* Returns skills and any validation diagnostics.
*/
export declare function loadSkills(options: LoadSkillsOptions): LoadSkillsResult;
/**
* Warnings for skill folders an ignore file hid from discovery (senpi#5060). A folder whose name a loaded
* skill already carries is skipped: another root supplied that skill, so nothing is missing.
*/
export declare function ignoredSkillDiagnostics(ignoredSkillFiles: readonly string[], loadedSkills: readonly Skill[]): ResourceDiagnostic[];
//# sourceMappingURL=skills.d.ts.map