/** * skills/service.ts * * The single canonical skill service. It sits over an injectable `SkillStore` * (store.ts) and owns the rules every consumer must share: name validation, * create-vs-update semantics, and honest absence. It is deliberately transport- * neutral, the daemon CRUD gateway verbs (control-plane/routes/skills.ts) are * a thin adapter over this, and a consumer embedding the SDK directly can call * the same methods without any gateway. * * Progressive disclosure is preserved end to end: `list` returns index lines * (no bodies), `get` returns the one full skill a caller asked for. * * Errors are thrown as `SkillServiceError` carrying a stable `code` so an * adapter can map them to the right wire status without string-matching. */ import { type Skill, type SkillFrontmatterValue, type SkillIndexEntry } from './model.js'; import type { SkillStore } from './store.js'; /** Stable, adapter-mappable failure codes for skill operations. */ export type SkillErrorCode = 'INVALID_ARGUMENT' | 'NOT_FOUND' | 'ALREADY_EXISTS'; /** A skill-operation failure with a stable code (never a bare prose Error). */ export declare class SkillServiceError extends Error { readonly code: SkillErrorCode; constructor(message: string, code: SkillErrorCode); } /** Fields accepted when creating a new skill. */ export interface CreateSkillInput { readonly name: string; readonly description: string; readonly body: string; readonly metadata?: Readonly> | undefined; } /** Fields accepted when updating an existing skill. Every field is optional; absent means unchanged. */ export interface UpdateSkillInput { readonly description?: string | undefined; readonly body?: string | undefined; readonly metadata?: Readonly> | undefined; } /** Result of a delete: an honest boolean, never a 200 that pretends a phantom skill was removed. */ export interface DeleteSkillResult { readonly name: string; readonly deleted: boolean; } export declare class SkillService { private readonly store; constructor(store: SkillStore); /** List every skill's index line (name + description + metadata), cheap, no bodies. */ list(): Promise; /** Read one skill in full, including its Markdown body. Throws NOT_FOUND when absent. */ get(name: string): Promise; /** Create a new skill. Throws ALREADY_EXISTS when the name is taken. */ create(input: CreateSkillInput): Promise; /** Update an existing skill's description, body, and/or metadata. Throws NOT_FOUND when absent. */ update(name: string, patch: UpdateSkillInput): Promise; /** Delete a skill. Returns { deleted:false } when no skill with that name existed. */ delete(name: string): Promise; } //# sourceMappingURL=service.d.ts.map