Core TypeScript types for the @mariozechner/pi-agent-core package.
Import
Agent Types
AgentState
Complete agent state.
AgentMessage
Union of LLM messages and custom messages.
Apps can extend with custom message types via declaration merging:
Tool definition.
Tool execution result.
Content blocks sent to LLM
Metadata for UI/logging (not sent to LLM)
ThinkingLevel
Reasoning intensity.
Context Types
AgentContext
Context passed to agent loop.
AgentLoopConfig
Configuration for agent loop.
Event Types
AgentEvent
Union of all agent events.
AgentStartEvent
AgentEndEvent
MessageStartEvent
MessageUpdateEvent
MessageEndEvent
TurnStartEvent
TurnEndEvent
Callback Types
Callback for streaming tool execution progress.
Use this to stream tool output:
Stream Function Type
StreamFn
Custom stream function type.
Used for custom transports (see Transport).
Example: Type-Safe Agent