import { SkillCard, SkillReference } from './skill-card'; import { LintFinding, LintReport } from './skill-lint'; export interface PinnedCard { checksum: string; provenance: string; permissions: string[]; pinnedAt: string; } export interface QuarantineEntry { reason: string; at: string; } export declare class QuarantineError extends Error { constructor(message: string); } export declare function loadPinnedCards(): Record; /** Pin a vetted card so future serves can detect tampering (checksum drift). */ export declare function pinSkillCard(name: string, card: SkillCard): PinnedCard; export declare function loadQuarantine(): Record; export declare function isQuarantined(name: string): boolean; export declare function quarantineSkill(name: string, reason: string): QuarantineEntry; /** Release a skill from quarantine (vet it). Returns true when it was present. */ export declare function releaseSkill(name: string): boolean; export declare function listQuarantined(): Array<{ name: string; } & QuarantineEntry>; export interface VettingVerdict { name: string; provenance: string; permissions: string[]; checksum: string; firstParty: boolean; lintStatus: LintReport['status']; lintFindings: LintFinding[]; /** A pinned card exists for this skill (it has been vetted at least once). */ hasCard: boolean; /** true/false against the pinned checksum; null when no pinned card. */ checksumMatch: boolean | null; /** true/false against the pinned permissions+provenance; null when no card. */ manifestMatch: boolean | null; quarantined: boolean; quarantineReason?: string; /** false only when quarantined (the single blocking control at serve time). */ servable: boolean; /** Human-readable issues for `cortex doctor` (advisory unless quarantined). */ issues: string[]; } export interface VetInput { name: string; content: string; references?: SkillReference[]; declaredRef?: string | null; permissions?: string[]; defaultOwner?: string; } /** * Produce a full servability verdict for a skill. Never throws — it reports. * Use `assertServable` for the fail-loud serve-time gate. */ export declare function vetSkill(input: VetInput): VettingVerdict; /** * Serve-time gate (FAIL-LOUD). Throws QuarantineError when the skill is * quarantined, so the Store refuses to serve it. Advisory issues (no card, * checksum drift, red lint on a first-party skill) do NOT throw here — they are * surfaced by `cortex doctor`; blocking is reserved for explicit quarantine. */ export declare function assertServable(name: string): void; /** * Collect a skill's reference files from its on-disk directory (everything that * is not SKILL.md), so the checksum covers the whole bundle. Best-effort and * shallow-recursive; returns [] on any error. */ export declare function collectReferences(skillDir: string): SkillReference[];