/** * Plugin eval gates G1 and G2 — the green signal an authored or installed plugin * must produce before anything activates it. * * Nothing used to run between "the model writes a plugin" and "the plugin is * live". These gates fill that gap, and they run against the **draft dir**, not * a production home: a failure discards the draft, so a plugin that does not * pass never reaches `~/.claude/skills/` where Claude Code would load it. * * G1 structural + conformant — does it parse, is the id legal, is the content * portable, and does the *target platform* accept it * G2 static safety — can the executable content plausibly run, and is it * obviously dangerous * * G1 measures conformance against the vendor where it can. Round-tripping * through our own parser only proves the emitter and the reader agree with each * other; it says nothing about whether Claude Code will accept the artifact. So * when the `claude` CLI is present, its own `plugin validate` is the authority — * it is the exact check the vendor's review pipeline runs, and inventing a * second opinion where the vendor ships one would just be a different set of * bugs. Copilot has no equivalent, so `github` targets get round-trip + schema. * * G3 (sandboxed behavioral smoke) and G4 (trigger eval) are separate; see * docs/plugin-system-architecture.md §4. */ import type { PluginPlatform } from "./formats/platform-targets.js"; import { type NormalizedPlugin } from "./manifest.js"; export interface GateFinding { gate: "G1" | "G2" | "G3" | "G4"; /** * `error` fails the gate. `warning` is reported and passes, unless `strict`. * `info` always passes — it exists so a *successful* check can be shown to the * human in the confirmation prompt without `strict` treating "the hook ran * fine" as a reason to refuse. */ severity: "error" | "warning" | "info"; message: string; } export interface GateResult { ok: boolean; findings: GateFinding[]; /** How conformance was established, for the record and for the confirm prompt. */ conformance: "claude-plugin-validate" | "round-trip"; plugin: NormalizedPlugin | null; } export interface GateOptions { /** Target platform, which decides whether a vendor validator applies. */ platform?: PluginPlatform; /** Treat warnings as errors. Used on the publish path. */ strict?: boolean; /** Skip the vendor validator (tests, and callers that must stay hermetic). */ skipVendorValidator?: boolean; } /** First executable token of a shell command, ignoring `VAR=x` prefixes. */ export declare function commandBinary(command: string): string | undefined; /** Whether a set of findings fails the gate. `info` never does. */ export declare function findingsFail(findings: readonly GateFinding[], strict?: boolean): boolean; /** Run G1 and G2 over a plugin directory. */ export declare function runStaticGates(dir: string, opts?: GateOptions): GateResult; /** Fold additional findings (G3) into an existing result. */ export declare function withFindings(result: GateResult, extra: readonly GateFinding[], strict?: boolean): GateResult; /** Render findings for a tool result or a confirmation prompt. */ export declare function formatGateFindings(result: GateResult): string; //# sourceMappingURL=gates.d.ts.map