vigiles API reference
    Preparing search index...

    Interface HarnessAdapter

    vigiles/adapter — the harness-adapter authoring kit.

    Everything you need to teach vigiles a new harness, in one import: the five port interfaces to implement, the HarnessAdapter bundle that groups them, the conformance kit to validate yours, and the registry the CLI detects through. vigiles ships a Claude Code adapter; building your own is welcome and supported — see docs/authoring-an-adapter.md.

    import { type HarnessAdapter, type HarnessDialect, type PluginLayout, type HarnessRuntime, type HookProtocol, type ModelMock, assertAdapterConformance, } from "vigiles/adapter";

    export const myHarnessAdapter: HarnessAdapter = { name: "my-harness", … };

    interface HarnessAdapter {
        capabilities: AdapterCapabilities;
        dialect: HarnessDialect;
        harnessTestDriver?: HarnessTestDriver;
        hookProtocol?: HookProtocol;
        layout: PluginLayout;
        modelMock?: ModelMock;
        name: string;
        runtime?: HarnessRuntime;
        detect(root: string): number;
    }
    Index

    Properties

    capabilities: AdapterCapabilities

    What this harness can drive — gates which ports below are required.

    Format axis: tool catalog, hook events, instruction targets, plugin-root token.

    harnessTestDriver?: HarnessTestDriver

    Pillar-2 deterministic-runner driver: how runHarnessTest builds this harness's argv, starts its scripted mock, and parses its stdout. Present iff capabilities.harnessTesting (it composes the runtime + modelMock into the one seam the runner dispatches through). Carried on the bundle so the runner never imports a sibling adapter to find it.

    hookProtocol?: HookProtocol

    Transport axis: how a hook signals a block/deny. Present iff capabilities.shellHooks.

    layout: PluginLayout

    Layout axis: where the instruction file / skills / agents / hooks live on disk.

    modelMock?: ModelMock

    Transport axis: the mock model's wire format + endpoints. Present iff capabilities.harnessTesting.

    name: string

    Stable identifier, e.g. "claude-code". The CLI/registry key.

    runtime?: HarnessRuntime

    Transport axis: the agent binary to spawn + the mock-model env. Present iff capabilities.harnessTesting.

    Methods

    • How strongly a repo at root looks like it targets this harness — the CLI uses it to auto-detect which adapter to use (the library selects by import). Returns a specificity score: 0 = not this harness; higher = a more specific match. The registry picks the highest scorer, so a strong signal (a .claude-plugin/ manifest) beats a weak one (a bare CLAUDE.md, or an AGENTS.md that many harnesses share) regardless of registration order.

      Parameters

      • root: string

      Returns number