import { ContextChain, ReceiptSigner, hashOutput, enhanceEvent } from "mcp-tap";
// SHA-256 hash chain for ordered integrity
const chain = new ContextChain();
const contextHash = chain.chain(eventObj);
// Ed25519 signing
const signer = new ReceiptSigner(privateKeyPem);
const sig = signer.sign(eventObj);
// → { algorithm: "Ed25519", key_id: "...", value: "base64..." }
// Hash an event's output field
const outputHash = hashOutput(someOutput);
// Add context_hash, output_hash, and signature to an event
enhanceEvent(event, chain, signer);