Wrap Your Agent
Use the SDK to wrap your agent execution and emit a verifiable receipt.
Install
npm install @commandlayer/agent-sdk
Quickstart
import { CommandLayer } from "@commandlayer/agent-sdk";
const cl = new CommandLayer({
agent: "runtime.commandlayer.eth",
privateKey: process.env.CL_PRIVATE_KEY_PEM,
keyId: "vC4WbcNoq2znSCiQ"
});
const { output, receipt } = await cl.wrap("summarize", async () => {
return { summary: "hello world" };
});
const check = await cl.verify(receipt);
console.log(output);
console.log(check.valid);
wrap() return values
output: the result from your wrapped function.receipt: the signed proof payload for verification.
verify()
Use verify() to validate receipt signatures in-app, or open /verify.html to verify a receipt in the browser.