@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
56 lines • 2.69 kB
TypeScript
export interface SkillInvocationPromptSkill {
name: string;
filePath: string;
baseDir: string;
body: string;
}
/** Format the user-attributed payload for one or more explicit skill invocations. */
export declare function formatSkillInvocationPrompt(skills: readonly SkillInvocationPromptSkill[], userRequest?: string): string;
/** Parsed skill block from a user message */
export interface ParsedSkillBlockSkill {
readonly name: string;
readonly location: string;
readonly content: string;
}
/** `name`/`location`/`content` mirror the first entry of `skills` for older callers. */
export interface ParsedSkillBlock extends ParsedSkillBlockSkill {
readonly skills: readonly ParsedSkillBlockSkill[];
readonly userMessage: string | undefined;
}
/**
* Parse every chained skill block from message text.
* Returns null if the text doesn't contain a skill block.
*/
export declare function parseSkillBlock(text: string): ParsedSkillBlock | null;
export type SkillInvocationSyntax = "dollar" | "slash";
export interface SkillInvocationToken {
name: string;
syntax: SkillInvocationSyntax;
start: number;
end: number;
position: "inline" | "leading";
}
export interface ParseSkillInvocationOptions {
/** Loaded skill names; a bare inline `$name` is executable only when it is one of them. */
readonly knownSkillNames?: ReadonlySet<string>;
}
/**
* Find explicit skill invocation tokens without treating ordinary inline dollar
* prose (for example `$HOME`) as executable.
*
* Leading runs accept `/skill:name`, `$name`, and `$skill:name`. Outside the
* leading run the explicit `$skill:name` token is always executable and a bare
* `$name` is executable when it names a loaded skill.
*/
export declare function parseSkillInvocationTokens(text: string, options?: ParseSkillInvocationOptions): SkillInvocationToken[];
/** Remove expanded invocation tokens, leaving `[skill: name]` where an inline one stood. */
export declare function removeSkillInvocationTokens(text: string, tokens: readonly SkillInvocationToken[]): string;
/**
* Skill-body characters one prompt inlines. Every invoked skill still loads: once the inlined bodies
* would pass this budget, a skill is expanded as a reference to its file instead (the first skill is
* always inlined), so composing many skills never drops one and never grows the prompt without bound.
*/
export declare const SKILL_INLINE_BUDGET_CHARS: number;
/** Body of a skill block whose instructions stay in the skill file, for the model to read before acting. */
export declare function formatSkillReferenceBody(filePath: string): string;
//# sourceMappingURL=skill-invocation.d.ts.map