@zanii/openai-agents
v0.1.0
Published
Receipt every tool call an OpenAI Agents SDK run makes, via lifecycle RunHooks - no changes to your agents. Signed, verifiable Zanii proofs.
Readme
@zanii/openai-agents
Receipt every tool call an OpenAI Agents SDK run makes — via the SDK's own
lifecycle RunHooks, with no changes to your agents. When a tool finishes, its
result becomes a signed, verifiable Zanii receipt.
npm install @zanii/openai-agents @zanii/sdk @openai/agentsUsage
import { Runner } from '@openai/agents';
import { ZaniiRunHooks } from '@zanii/openai-agents';
import { ZaniiAgent } from '@zanii/sdk';
const zanii = new ZaniiAgent({ /* … */ });
await Runner.run(agent, input, { hooks: new ZaniiRunHooks(zanii) });
// every completed tool call → a receipt targeting tools.<toolName>Each receipt targets tools.<toolName> (override with { prefix }) and carries
the tool's output. If a SDK version's hook signature differs, call
recordToolResult(agent, tool, result) from your own hook — same receipt, wired
by hand.
The Agents SDK's tool hooks surface the tool and its result, not the raw input arguments, so receipts record the tool and its output. To capture inputs too, wrap the tool's implementation with the SDK's
agent.wrapToolbefore registering it.
Changelog
- 0.1.0 — initial release:
ZaniiRunHooks,zaniiRunHooks,recordToolResult.
License
Apache-2.0.
