Skip to content

About

Sapper clients for agents, Hardhat, MCP and MetaMask, and the kit for Checkers and operators.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Sapper SDK

Client code for Sapper. Your agents and builds use it to check a contract before they touch it, and to buy a one-off scan of a contract you control. Operators use it to replay findings and vote on them.

Sapper watches contracts their owners opt in. Its agents attack every change on a private fork, staked Checkers replay each finding, and bounties settle from the owner's pot on chain.

Sapper settles on Elysium (chain 99901): bounty pots hold USDC, and Checkers stake $SAPR. The TypeScript packages install from npm. The Python packages install directly from a pinned commit in this public repository; their READMEs give the commands. They are not on PyPI yet. sapperagents.com/status shows what runs today.

Packages

Folder Package What you get
agents/typescript/client @sapper-agents/client A TypeScript client, with tools for the OpenAI Agents SDK: check a contract's watch status, buy a scan, open the sealed report.
agents/typescript/agentkit @sapper-agents/agentkit The same actions for Coinbase AgentKit.
agents/typescript/plugin-sapper @sapper-agents/plugin-sapper An ElizaOS plugin that tells the agent whether Sapper watches a contract before it acts.
agents/python/sapper-agents sapper-agents The Python client, with tools for the OpenAI Agents SDK.
agents/python/langchain-sapper langchain-sapper LangChain tools and a toolkit.
mcp @sapper-agents/mcp A local MCP server for clients that cannot reach Sapper's hosted one, and helpers that sign and open reports with your own key.
hardhat @sapper-agents/hardhat-sapper npx hardhat sapper: Sapper attacks your contracts on a private fork before you deploy them.
operator @sapper-agents/operator Run a Checker that replays findings and votes on them, or claim findings as a Breaker operator.
metamask-snap @sapper-agents/snap A MetaMask Snap that shows, before you confirm a transaction on Elysium, whether the contract is watched and what its bounty pot holds.
clear-signing ERC-7730 descriptors so wallets that read the Clear Signing registry show Sapper transactions in plain words.

agents/test-vectors.json pins the report key derivation both agent clients share. The replay engine on its own, with the bundle and rule formats, is in sapper-replay; the contracts are in sapper-contracts; the GitHub Action is sapper-action.

Tests

Each package runs its own tests; CI runs every one of them. Clone with the contracts submodule, which the operator kit and the Snap deploy on a local chain:

git clone --recurse-submodules https://github.com/sapper-agents/sapper-sdk.git
Package Needs Run
agents/typescript Node 24, Bun 1.3 npm ci && npm run build && npm test && npm run typecheck
agents/python Python 3.12, uv see agents/README.md
mcp Node 20+ npm ci && npm test
hardhat Node 22, Bun 1.3 npm ci && npm test
operator Bun 1.3, Foundry v1.8.1 see operator/README.md
metamask-snap Node 24, Bun 1.3, Foundry v1.8.1 (cd ../contracts && forge soldeer install) && npm ci && npm test && npm run test:robinhood
clear-signing Python 3.12, Node 22, jq, Foundry v1.8.1 ./prepare.sh <registry checkout>, then python3 check-abi.py 4663=<sapper-contracts v1.0.0 build> 99901=../contracts (see clear-signing/README.md)

No test needs Sapper's API, an RPC endpoint or a funded key. The clear-signing checks read the verified contracts from Sourcify.

Maintainers

MAINTAINERS.md says which path of Sapper's main repository each folder mirrors and how to sync.

Publishing is done by hand, from a clean checkout of main with CI green. Versions and tags are in MAINTAINERS.md.

npm. You need an npm login in the sapper-agents organisation, Node 24, Bun 1.3 (the agent packages' tests and the Hardhat build) and Foundry v1.8.1 (the operator kit's and the Snap's tests, which deploy Sapper's contracts from the submodule and the fixtures). Run every package's checks first, then the release script:

git clone --recurse-submodules https://github.com/sapper-agents/sapper-sdk.git && cd sapper-sdk
(cd contracts && forge soldeer install && forge build)
forge build --root fixtures

(cd agents/typescript && npm ci && npm run build && npm run typecheck && npm test)
(cd mcp && npm ci && npm test)
(cd hardhat && npm ci && npx tsc --noEmit && npm test)
(cd operator && bun install --frozen-lockfile && bunx tsc --noEmit && bun test)
(cd metamask-snap && npm ci && node scripts/sync-deployment.mjs --check && npm test && npm run test:robinhood)

node scripts/publish.mjs --dry-run
node scripts/publish.mjs

scripts/publish.mjs publishes @sapper-agents/client first, then the AgentKit and ElizaOS packages built on it, then the MCP server, the Hardhat plugin, the operator kit and the Snap. It skips any version the registry already lists. After each publish it waits until the registry serves the new version, checking every 15 seconds for up to 10 minutes, so the next package installs against it; if the wait runs out, it stops there. --dry-run runs npm publish --dry-run for each package and publishes nothing. A prerelease version goes out under the next tag.

npm publish runs each package's own scripts: prepublishOnly builds and tests the agent packages, prepack builds them and the Hardhat plugin, and the Snap's prepack builds the Snap and refuses a build that does not come from contracts/deployments. The Snap asks only for permissions MetaMask exempts from its allowlist, so the extension installs it from npm. A listing in the MetaMask Snaps Directory, where people find Snaps, is a separate submission once it is on npm.

PyPI. With a PyPI token in UV_PUBLISH_TOKEN:

cd agents/python
uv build --out-dir dist/sapper-agents sapper-agents && uv publish dist/sapper-agents/*
uv build --out-dir dist/langchain-sapper langchain-sapper && uv publish dist/langchain-sapper/*

Clear Signing registry. The descriptors go in by a pull request to ethereum/clear-signing-erc7730-registry that adds registry/sapper/, after prepare.sh passes against its current master.

License

MIT. See LICENSE. Each package carries its own copy.

About

Sapper clients for agents, Hardhat, MCP and MetaMask, and the kit for Checkers and operators.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages