/** * Skill evolution — agent-authored SKILL.md files. * * 0.6.0 split the single `write_skill` tool into `create_skill` + `update_skill` * (one fails if the skill exists, the other fails if it doesn't). The split * forces deliberate intent at the call site and lets the user-confirmation * prompt be more specific ("Create new skill 'X'?" vs "Update existing 'Y'?"). * * The underlying file write (with .bak. backup on overwrite) is identical * for both; only the existence pre-check differs. * * Per the "Behavior-changing autonomy requires inline gate" principle, the * tool descriptions instruct agents to propose the skill name + description + * body in chat FIRST and only call this after explicit user approval. The * file write itself is unguarded — the gate lives in the tool description + * (optionally) pi's per-tool permission "ask" mode. */ export type WriteSkillResult = { ok: true; path: string; backedUpTo?: string; } | { ok: false; reason: "invalid-name" | "package-conflict" | "io-error" | "already-exists" | "not-found"; detail: string; }; export interface WriteSkillInput { name: string; description: string; body: string; /** Host repo root (parent of .pi-mind). Required to locate .pi/skills/. */ hostRoot: string; /** Override for tests; defaults to new Date(). */ now?: Date; } /** Create a NEW skill. Fails if a skill with the same name already exists. */ export declare function createSkill(input: WriteSkillInput): WriteSkillResult; /** Update an EXISTING skill. Fails if the skill doesn't already exist. * Previous content is backed up to a same-dir SKILL.md.bak.. */ export declare function updateSkill(input: WriteSkillInput): WriteSkillResult; //# sourceMappingURL=skill-evolution.d.ts.map