# Changelog

## 1.4.0 (2026-05-18)

### Features

- **Prompt Caching Support**: Reduce costs and latency by up to 90% with built-in prompt caching
  - New `enable_prompt_caching` parameter in `llm_config` for both PSAI and PSAgent ([#prompt-caching](https://pscode.lioncloud.net///commit/prompt-caching))
  - New `cache_system_prompt` parameter to control system message caching
  - New `cache_breakpoints` parameter for advanced cache control in agents
  - Works with all LLM providers (OpenAI, Anthropic, Google Gemini, AWS Bedrock, Azure OpenAI)
  - Automatic cache management through the LLM Gateway
  - See `docs/PROMPT_CACHING.md` for comprehensive guide and examples
  - Updated `PSAI.llm()` and `PSAI.llmStream()` to support prompt caching parameters
  - Enhanced `PSAgentConfig` interface with caching configuration options
  - Improved message formatting to support Anthropic-style cache_control blocks

### Documentation

- Add comprehensive prompt caching guide ([docs/PROMPT_CACHING.md](docs/PROMPT_CACHING.md))
- Add prompt caching examples ([examples/prompt-caching-example.ts](examples/prompt-caching-example.ts))
- Update README with feature highlights and caching documentation link

### Non-Breaking Changes

- All caching features are opt-in via configuration
- Existing code continues to work without modification
- Default behavior unchanged (caching disabled by default)

## 1.3.8 (2026-05-15)

### Features

- **agent-core**: Add new agent-core module for low-level agent runtime
  - Stateful agent wrapper with lifecycle management
  - Event-driven execution loop with tool calling
  - LLM proxy for server-side routing
  - Built on @mariozechner/pi-ai library
  - Import via `psadk/agent-core` subpath export
- **appToken**: Add support for app-level authentication tokens
  - All API methods now support optional `X-App-Authorization` header
  - Pass `appToken` parameter to PSAI constructor

### Dependencies

- Add @mariozechner/pi-ai (^0.73.0)
- Add typebox (^1.1.38) for runtime type validation
- Add undici-types dev dependency

### Build

- Update TypeScript configuration to support DOM types for HeadersInit
- Add skipLibCheck to resolve dependency type issues

## 1.1.0 (2025-09-17)

### Features

- add @modelcontextprotocol/sdk dependency and enhance PSAI class with LLM proxy functionality ([c8cf308](https://pscode.lioncloud.net///commit/c8cf308c1420ffc25cde720df11270e08c253c58))

### Bug Fixes

- update samples link in README.md ([93815a9](https://pscode.lioncloud.net///commit/93815a9a77d595298d363ef31707cdf76a2fd7d2))
