import type { SourceMeta } from "../capability/types"; import type { SkillsSettings } from "../config/settings"; import type { SkillPromptDetails } from "../session/messages"; import type { LoadedSubskillActivation } from "./gjc-plugins"; /** Metadata-only handle returned by bounded skill discovery. */ export interface SkillDescriptor { readonly metadata: Omit; readonly loadContent: () => Promise; } export interface Skill { name: string; description: string; filePath: string; baseDir: string; source: string; /** * When `true`, the skill is loaded and reachable via `skill://` and * skill slash aliases, but is excluded from the rendered system prompt's * `` listing. */ hide?: boolean; /** Source metadata for display */ _source?: SourceMeta; /** Embedded SKILL.md content for bundled defaults that survive .gjc deletion. */ /** Lazily load the full skill body when prompt injection needs it. */ loadContent?: () => Promise; content?: string; } export interface SkillWarning { skillPath: string; message: string; } export interface LoadSkillsResult { skills: Skill[]; warnings: SkillWarning[]; } /** * Process-global snapshot of skills the active session loaded. * Read by internal URL protocol handlers (skill://). */ export declare function getActiveSkills(): readonly Skill[]; /** Replace the active skill snapshot. Called once per top-level session. */ export declare function setActiveSkills(value: readonly Skill[]): void; /** Reset the active skill snapshot. Test-only. */ export declare function resetActiveSkillsForTests(): void; export interface LoadSkillsFromDirOptions { /** Directory to scan for skills */ dir: string; /** Source identifier for these skills */ source: string; } export declare function loadSkillsFromDir(options: LoadSkillsFromDirOptions): Promise; export interface LoadSkillsOptions extends SkillsSettings { /** Working directory for project-local skills. Default: getProjectDir() */ cwd?: string; /** Explicit user home for skill discovery. Default: getTrustedHomeDir(). */ home?: string; /** Explicit user agent directory for native user-scope skill discovery. */ agentDir?: string; } /** * Load skills from all configured locations. * Returns skills and any validation warnings. */ export declare function loadSkills(options?: LoadSkillsOptions): Promise; export interface BuiltSkillPromptMessage { message: string; details: SkillPromptDetails; } export interface BuildSkillPromptMessageContext { subskillActivation?: LoadedSubskillActivation; subskillActivationSet?: LoadedSubskillActivation[]; currentPhase?: string; cwd?: string; sessionId?: string; } export declare function getSkillSlashCommandName(skill: Pick): string; export declare function isNamespacedSkillSlashCommandName(commandName: string): boolean; export declare function getSkillSlashCommandNames(skill: Pick): string[]; export declare function isSkillSlashCommandName(commandName: string, skill: Pick): boolean; export interface ResolvedSkillSlashCommand { name: string; description: string; skill: Skill; } export interface ParsedSkillInvocation { commandName: string; args: string; skill: Skill; } export declare function parseSkillInvocations(text: string, skillsByCommandName: ReadonlyMap): ParsedSkillInvocation[]; export declare function resolveSkillSlashCommands(skills: readonly Skill[], _reservedDirectCommandNames: ReadonlySet): ResolvedSkillSlashCommand[]; export declare function buildSkillPromptMessage(skill: Pick, args: string, context?: BuildSkillPromptMessageContext): Promise;