/** * Materialize the Skills authorized for one turn into the runtime's skills directory. * * DeepSeek TUI 0.8.39 discovers global Skills from * `/.deepseek/skills//SKILL.md` and exposes them through its native * `load_skill` tool. That path does not involve MCP, which * matters because `deepseek serve --http` — the mode the daemon runs — never loads an MCP * config at all, so the previous relay could not reach the model. * * The directory is rewritten per turn rather than created fresh each time: its path is * baked into the runtime process environment at spawn, and that process is pooled and * reused. A per-turn path would leave a reused process pointing at a stale directory, * and the authorized set genuinely differs between a task turn (global set plus the * task's set) and ordinary conversation (global set only). */ import type { PreparedRuntimeSkillProvider, RuntimeSkillCatalogEntry } from "./runtime-skills.js"; /** Standard DeepSeek path created under the activation-scoped runtime home. */ export declare const RUNTIME_SKILLS_RELATIVE_PATH: string; export declare class RuntimeSkillMaterializationError extends Error { readonly code: string; constructor(code: string, message: string); } export interface MaterializedSkill { ref: string; /** Directory name under the skills root; also the name the model passes to load_skill. */ name: string; files: number; bytes: number; } export interface MaterializeCourseSkillsResult { skillsDir: string; skills: MaterializedSkill[]; /** Stable fingerprint of the materialized set, for logging and reuse assertions. */ fingerprint: string; } export interface MaterializeCourseSkillsOptions { prepared: PreparedRuntimeSkillProvider; /** Activation-scoped runtime home; Skills use DeepSeek's standard global path below it. */ profileRoot: string; /** Managed sessions hand the directory to a separate runtime UID via the group bit. */ managed: boolean; } /** * The directory name the model will use. Derived from the grant's logical id, never from * manifest text, so a package cannot rename itself into another Skill's directory. */ export declare function skillDirectoryName(entry: RuntimeSkillCatalogEntry): string; export declare function skillSetFingerprint(refs: readonly string[]): string; /** * Prepare the supported runtime state directories before the server starts. * * DeepSeek 0.8 uses `.deepseek`; Codewhale 0.9 uses `.codewhale`. Both create task and * automation subdirectories under their state home, so the * runtime group needs write access there. The sticky bit prevents that separate UID from * replacing the control-process-owned `skills` entry. */ export declare function prepareRuntimeSkillsHome(profileRoot: string, managed: boolean): string; /** * Rewrite `/.deepseek/skills` so it contains exactly the authorized Skills. * * Throws on any failure. A partial or stale directory must never be handed to the model: * silently continuing without a Skill is the failure mode this whole change exists to * remove. */ export declare function materializeCourseSkills(options: MaterializeCourseSkillsOptions): Promise; export declare function cleanupCourseSkills(profileRoot: string | undefined): void;