# Changelog ## [0.31.0] - 2026-01-02 ### Breaking Changes - **Transport abstraction removed**: `ProviderTransport`, `AppTransport`, and `AgentTransport` interface have been removed. Use the `streamFn` option directly for custom streaming implementations. - **Agent options renamed**: - `transport` → removed (use `streamFn` instead) - `messageTransformer` → `convertToLlm` - `preprocessor` → `transformContext` - **`AppMessage` renamed to `AgentMessage`**: All references to `AppMessage` have been renamed to `AgentMessage` for consistency. - **`CustomMessages` renamed to `CustomAgentMessages`**: The declaration merging interface has been renamed. - **`UserMessageWithAttachments` and `Attachment` types removed**: Attachment handling is now the responsibility of the `convertToLlm` function. - **Agent loop moved from `@mariozechner/pi-ai`**: The `agentLoop`, `agentLoopContinue`, and related types have moved to this package. Import from `@mariozechner/pi-agent` instead. ### Added - `streamFn` option on `Agent` for custom stream implementations. Default uses `streamSimple` from pi-ai. - `streamProxy()` utility function for browser apps that need to proxy LLM calls through a backend server. Replaces the removed `AppTransport`. - `getApiKey` option for dynamic API key resolution (useful for expiring OAuth tokens like GitHub Copilot). - `agentLoop()` and `agentLoopContinue()` low-level functions for running the agent loop without the `Agent` class wrapper. - New exported types: `AgentLoopConfig`, `AgentContext`, `AgentTool`, `AgentToolResult`, `AgentToolUpdateCallback`, `StreamFn`. ### Changed - `Agent` constructor now has all options optional (empty options use defaults). - `queueMessage()` is now synchronous (no longer returns a Promise).