/** * Runtime records for skill executions. * * `.skills/runs` and `.skills/exports` hold what skills produced, not what * skills are. Source files and SKILL.md documents are never written here. */ export type SkillRunStatus = "queued" | "running" | "completed" | "failed"; export interface SkillRunArtifact { path: string; mime: string; sha256: string; sizeBytes: number; } export interface SkillRunRecord { id: string; skill: string; status: SkillRunStatus; prompt?: string; args: string[]; startedAt: string; completedAt?: string; remote: boolean; remoteRunId?: string; costCents?: number; error?: string; artifacts: SkillRunArtifact[]; paths: { runDir: string; exportDir: string; logsDir: string; }; } export interface SkillRunContext { targetDir: string; runDir: string; exportDir: string; logsDir: string; record: SkillRunRecord; } export declare function createSkillRun(params: { skill: string; args?: string[]; prompt?: string; remote?: boolean; remoteRunId?: string; costCents?: number; status?: SkillRunStatus; }, targetDir?: string): SkillRunContext; export declare function completeSkillRun(context: SkillRunContext, patch: { status: SkillRunStatus; error?: string; remoteRunId?: string; costCents?: number; }): SkillRunRecord; export declare function updateSkillRun(context: SkillRunContext, patch: Partial): SkillRunRecord; export declare function writeRunLogs(context: SkillRunContext, stdout?: string, stderr?: string): void; export declare function appendRunEvent(context: SkillRunContext, event: string, data?: Record): void; export declare function listSkillRuns(targetDir?: string, limit?: number): SkillRunRecord[]; export declare function findSkillRun(runId: string, targetDir?: string): SkillRunRecord | null; /** * Environment handed to a skill child process so it writes into the project's * `.skills` tree instead of its own installation directory. * * Skills are spawned with `cwd` set to the installed skill package, so every * cwd-relative fallback (`process.env.SKILLS_EXPORTS_DIR || "."`, * `process.env.SKILLS_OUTPUT_DIR || join(process.cwd(), ".skills")`) resolves * inside node_modules unless these are set. The catalog reads three names: * SKILLS_OUTPUT_DIR (the `.skills` root, from which skills derive * `exports/` and `logs/`), plus SKILLS_EXPORTS_DIR and * SKILLS_LOGS_DIR (already-resolved directories). SKILLS_EXPORT_DIR is kept * for back-compat with anything reading the singular CLI-side name. */ export declare function skillRunEnv(context: SkillRunContext): Record; export declare function getRunExportDir(runId: string, skill: string, targetDir?: string): string;