@hanfani/providers
v0.1.0
Published
Provider adapters (claude-cli, mock, Mastra) for the Hanfani agent framework.
Maintainers
Readme
@hanfani/providers
Provider adapters for the Hanfani agent framework —
the layer that turns a model backend into a Provider the @hanfani/server pipeline can drive.
Each adapter honors the core two-phase contract: the agent proposes, a human (or a pre-declared
rule) approves, the server acts. A provider's run() emits AG-UI events and a GATE_OPENED
custom event when an approval-named tool fires; it never executes an effect itself.
Install
pnpm add @hanfani/providers @hanfani/core@ai-sdk/anthropic, @mastra/core, and @mastra/pg are optional peers — needed only if you use
the Mastra-backed provider via the ./mastra subpath.
Exports
| Entry | Contents |
|-------|----------|
| . | createClaudeCliProvider, createMockInboxProvider, mapClaudeStream, PROVIDERS, ProviderId |
| ./ids | PROVIDERS, ProviderId — the provider-id registry, importable without the adapters |
| ./mastra | createMastraProvider, makeMastraRunner, mapMastraStream, unwrapStepOutput, and the Mastra* types |
import { createClaudeCliProvider, PROVIDERS } from '@hanfani/providers'
import { createMastraProvider, makeMastraRunner } from '@hanfani/providers/mastra'