> ## Documentation Index
> Fetch the complete documentation index at: https://hibi.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# The Hibi Resolver SDK

> The @npupko/hibi/resolver export handles JSONL-RPC framing so a TypeScript resolver only implements describe, resolve, and verify.

A resolver is a program Hibi spawns to grade an anchor kind, run a verifier, or attach advisories. Hibi talks to it in JSONL-RPC over stdio. The SDK is one export from the main package that handles the framing:

```ts theme={null}
import { serveResolver } from "@npupko/hibi/resolver";
```

For the protocol, the manifest, and `override`, see [Resolvers](/resolvers).

## The handler

```ts theme={null}
import { serveResolver, type ResolverHandler } from "@npupko/hibi/resolver";

const handler: ResolverHandler = {
  describe: () => ({
    name: "echo", version: "1", kinds: ["echo"], tier: 2, advisory: false,
    verifierKinds: ["echo-cmd"],
  }),
  resolve: ({ assertion, files }) => ({ verdict: /* … */ }),
  verify: ({ assertion, verifier, changedEvidence }) => ({ behavior: "supported" }),
};

serveResolver(handler);
```

| Method     | Params                                              | Returns                                                       |
| ---------- | --------------------------------------------------- | ------------------------------------------------------------- |
| `describe` | none                                                | `{ name, version, kinds, tier, advisory, verifierKinds? }`    |
| `resolve`  | `{ assertion, files: { doc, code }, proposition? }` | `{ verdict?, advisories? }`                                   |
| `verify`   | `{ assertion, verifier, changedEvidence }`          | `{ behavior: "supported" \| "refuted", advisories?, notes? }` |

`verify` receives no file contents. A grader that only handles anchors omits `verify` (the server answers with an unknown-method error, and the engine records no result). A runner can return an empty `kinds` list and handle only `verify`. `tier` defaults to 1; 3 is the advisory tier.

## Exports

`@npupko/hibi/resolver` exports `serveResolver`, `ResolverHandler`, the protocol types (`DescribeResult`, `ResolveParams`, `ResolveResult`, `VerifyParams`, `VerifyResult`, `RpcRequest`, `RpcResponse`, `PROTOCOL_VERSION`, `LineFramer`, `encodeLine`), and the model types (`Assertion`, `Anchor`, `AnchorState`, `BehaviorState`, `Selector`, `SelectorBundle`, `Verdict`, `VerdictEvidence`, `Verifier`, `Advisory`, `ChangedEvidence`, `Enforcement`, `Proposition`).

## Other languages

Every message has a JSON Schema generated from the Zod model. Print one with `hibi schema --name <Name>`, or read `schemas/*.v3.json` in the repository. A resolver in any language reads one JSON object per line on stdin and writes one per line on stdout.

## Next

<CardGroup cols={2}>
  <Card title="Resolvers" icon="puzzle-piece" href="/resolvers">
    The protocol, the manifest, and the `override` flag.
  </Card>

  <Card title="Behavioral claims" icon="flask-vial" href="/behavioral">
    Where `verify` fits.
  </Card>
</CardGroup>
