import type { Check } from "./check.js"; import type { Trace } from "./harness-test.js"; export interface SkillContractOptions { /** * The plugin namespace, so activation is asserted on the real `:` * id. Resolved from the enclosing plugin manifest when omitted. */ readonly plugin?: string; } export interface SkillContract { /** The skill's `name:` (falls back to its directory name). */ readonly name: string; /** What `skill()` matches — `:`, or bare `name` if unresolvable. */ readonly id: string; /** `allowed-tools:` exactly as declared. Empty when undeclared or malformed. */ readonly declared: readonly string[]; /** The skill activated at all. */ readonly activation: Check; /** The run stayed inside the declared surface. */ readonly surface: readonly Check[]; /** * No `allowed-tools:` line — nothing was claimed, so there is no declared * surface a run can be held to. (Every skill inherits every tool the session * grants either way; `allowed-tools:` pre-approves, it does not fence.) */ readonly undeclared: boolean; /** A frontmatter block exists but is not valid YAML, so nothing parsed. */ readonly malformed: boolean; } /** * Read `/SKILL.md` and return its declaration as checks. * * Two states are FINDINGS rather than empty contracts, and both return a * `surface` that FAILS instead of passing vacuously: * * - **`undeclared`** — no `allowed-tools:` line, so nothing was claimed and there * is no surface for a run to stay inside. Silently reporting "no violations" * would present the widest possible capability surface as the cleanest one. * - **`malformed`** — a frontmatter block that is not valid YAML. A strict * loader rejects it, so the declared list is unknown, not empty; a regex * salvage of it would be a guess. A declaration that does not parse is not an * enforcement. (Observed live: a single unquoted `: ` inside the description * silently voided a skill's whole tool contract.) */ export declare function skillContract(skillDir: string, options?: SkillContractOptions): SkillContract; //# sourceMappingURL=skill-contract.d.ts.map