/** * 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; export declare function getRunExportDir(runId: string, skill: string, targetDir?: string): string;