@bazilion/api-types
v0.5.1
Published
Hermetic wire-shape types for the Bazilion HTTP/IPC surface (zero deps).
Readme
@bazilion/api-types
Hermetic TypeScript wire types for the Bazilion HTTP/IPC surface. Zero runtime deps, zero node-only imports — safe to consume from any environment (Node, browsers, React Native, Cloudflare Workers, edge runtimes).
This package is the canonical source of truth for everything that crosses the daemon's HTTP wire: entity shapes (Agent, Group, Profile, Message, WebToken, AgentTrigger, ResolvedAgent, LoadedProfile, …), chat/provider events (ChatFrame, SessionEvent, ProviderMessage, ToolCall, ToolDef), memory wire types, and request/response envelopes. The daemon, the official @bazilion/client, and the bazilion CLI all import their types from here.
Install
npm install @bazilion/api-typesRequires Node 24+ (or any TypeScript ≥5.0 environment).
When to use this directly
Most consumers should pull in @bazilion/client, which re-exports the relevant types alongside a typed fetch wrapper. Reach for @bazilion/api-types directly when:
- you're writing your own HTTP client and only need the type definitions
- you're writing a Slack/Raycast/webhook bridge that consumes daemon payloads
- you're typing inbound NDJSON frames in a stream consumer that doesn't need the full client
Usage
import type { Agent, ChatFrame, Profile } from '@bazilion/api-types'
function renderAgentList(agents: Agent[]): string {
return agents.map((a) => `${a.id} ${a.name} (${a.status})`).join('\n')
}
function handleChatFrame(frame: ChatFrame): void {
switch (frame.kind) {
case 'event':
console.log(frame.event)
break
case 'done':
console.log(`turn finished: ${frame.messages.length} messages`)
break
case 'fatal':
console.error(frame.error)
break
}
}Documentation
- Full project: https://github.com/rullopat/bazilion
- Typed HTTP client: https://www.npmjs.com/package/@bazilion/client
