# Changelog

## Pending




### Features

- add Mistral OCR engine with package export, tests, and documentation (ocr)
  - introduces a new `@push.rocks/smartai/ocr` subpath export with `createMistralOcrEngine()` for image OCR via Mistral's Document AI endpoint
  - adds OCR request/response types, configurable transport and options, and normalized page/confidence results
  - includes mocked transport tests for OCR requests and input validation
  - updates package metadata and README content to document the new OCR module

## 2026-05-14 - 4.0.2

### Fixes

- strip unsupported ChatGPT prompt cache retention options while preserving prompt cache keys (openai)
  - Removes promptCacheRetention values before sending requests to the ChatGPT Codex backend.
  - Keeps prompt_cache_key forwarding intact for OpenAI provider options.
  - Only rewrites system prompts into top-level instructions when needed, avoiding unnecessary prompt changes.

## 2026-05-14 - 4.0.1

### Fixes

- map system prompts to top-level instructions for ChatGPT auth requests (openai)
  - wrap OpenAI models using ChatGPT auth with middleware that extracts system messages into provider instructions
  - remove system messages from the serialized prompt payload to match the ChatGPT Codex backend expectations
  - add test coverage to verify authorization headers, workspace routing, and instruction payload mapping

## 2026-05-14 - 4.0.0

### Breaking Changes

- rename OpenAI ChatGPT/Codex subscription auth APIs from `OpenAiMax`/`openAiMaxAuth` to `OpenAiChatGpt`/`openAiChatGptAuth`

### Features

- add Node-only `@push.rocks/smartai/openai-chatgpt-auth` helpers to inspect, normalize, resolve, refresh, and write SmartAI, OpenCode, and Codex ChatGPT auth sources

## 2026-05-14 - 2.3.0

### Features

- add OpenAI Max device-code authentication and unified prompt caching helpers (openai-auth)
  - adds OpenAI Max device-code login, token refresh, and ChatGPT Codex provider routing for OpenAI models
  - introduces reusable SmartAI cache helpers and middleware for prompt/message cache provider options across providers
  - updates Anthropic prompt caching to use opencode-style breakpoint selection with optional longer retention
  - exports the new auth and caching APIs and adds tests and documentation for both features

## 2026-05-06 - 2.2.0 - feat(openai)
add getModelSetup() and typed provider options for OpenAI reasoning settings

- export getModelSetup() to return both the model and request-time providerOptions for AI SDK calls
- add typed OpenAI provider options including reasoningEffort and textVerbosity support
- cover providerOptions passthrough for generateText() and streamText() with tests
- update documentation and dependency versions for the new OpenAI provider options workflow

## 2026-05-06 - 2.1.0 - feat(openai)
add first-class OpenAI provider options for request-time reasoning settings

- add `getModelSetup()` returning a model plus AI SDK `providerOptions`
- add typed OpenAI provider options including `reasoningEffort: 'xhigh'` and `textVerbosity`
- keep `getModel()` backward compatible for existing consumers
- document GPT-5.5 xhigh usage and update dependency versions
- add tests proving provider options pass through `generateText()` and `streamText()`

## 2026-04-30 - 2.0.1 - fix(build)
update toolchain configuration and test error handling for stricter TypeScript builds

- upgrade TypeScript, pnpm, and ai-sdk related dependencies
- enable noImplicitAny in tsconfig and remove allowimplicitany from the build script
- harden tests by safely extracting error messages from unknown exceptions
- relax the streaming token count assertion to avoid brittle test failures
- add project smartconfig metadata to published files

## 2026-03-05 - 2.0.0 - BREAKING CHANGE(vercel-ai-sdk)
migrate to Vercel AI SDK v6 and introduce provider registry (getModel) returning LanguageModelV3

- Major API rewrite and module reorganization; bump package version to 1.0.0
- Replace many legacy provider implementations with @ai-sdk/* providers and a new Ollama adapter (LanguageModelV3-based)
- Add subpath exports for capability packages: ./vision, ./audio, ./image, ./document, ./research
- Introduce Anthropic prompt-caching middleware and provider-level promptCaching option
- Split functionality into focused ts_* packages (ts_audio, ts_image, ts_document, ts_vision, ts_research) and adapt tests accordingly
- Update dependencies and devDependencies to use ai SDK providers and newer package versions

## 2026-01-20 - 0.13.3 - fix()
no changes detected

- No files changed in the provided diff.
- No version bump required.

## 2026-01-20 - 0.13.2 - fix(repo)
no changes detected in diff; nothing to commit

- Git diff reported no changes — no files modified
- No code or dependency updates detected, so no version bump required

## 2026-01-20 - 0.13.1 - fix()
no changes detected; no release required

- No changes found in the provided git diff
- Current package version is 0.13.0

## 2026-01-20 - 0.13.0 - feat(provider.ollama)
add chain-of-thought reasoning support to chat messages and Ollama provider

- Added optional reasoning?: string to chat message and chat response interfaces to surface chain-of-thought data.
- Propagates reasoning from message history into formatted requests sent to Ollama.
- Maps Ollama response fields (thinking or reasoning) into ChatResponse.reasoning so downstream code can access model reasoning output.

## 2026-01-20 - 0.12.1 - fix(docs)
update documentation: clarify provider capabilities, add provider capabilities summary, polish examples and formatting, and remove Serena project config

- Removed .serena/project.yml and cleaned up .serena/.gitignore
- Added Provider Capabilities Summary and expanded/clarified provider tables in readme.md and readme.hints.md
- Clarified Anthropic extended thinking details and Mistral native PDF OCR notes
- Polished example code snippets and fixed minor typos/formatting (GPT-5 mention, ElevenLabs model note, consistent punctuation)
- Updated test command references and other README usage instructions

## 2026-01-20 - 0.12.0 - feat(ollama)
add support for base64-encoded images in chat messages and forward them to the Ollama provider

- Add optional images?: string[] to ChatMessage and ChatOptions interfaces (multimodal/vision support)
- Propagate images from messageHistory and ChatOptions to the Ollama API payload in chat, chatStreaming, and streaming handlers
- Changes are non-breaking: images are optional and existing behavior is preserved when absent

## 2026-01-20 - 0.11.0 - feat(ollama)
support defaultOptions and defaultTimeout for ollama provider

- Added ollama.defaultOptions object with fields: num_ctx, temperature, top_k, top_p, repeat_penalty, num_predict, stop, seed
- Added ollama.defaultTimeout option
- Pass defaultOptions and defaultTimeout into OllamaProvider constructor when initializing the provider
- Non-breaking change: existing behavior preserved if new fields are undefined

## 2026-01-20 - 0.10.1 - fix()
no changes detected — no release necessary

- No files changed in the provided diff; there are no code, documentation, or configuration modifications to release.

## 2026-01-18 - 0.10.0 - feat(mistral)
add Mistral provider with native PDF OCR and chat integration

- Adds dependency @mistralai/mistralai
- Implements ts/provider.mistral.ts providing chat() and document() (OCR) functionality
- Registers and exposes MistralProvider in SmartAi (options, lifecycle, conversation routing)
- Adds unit/integration tests: test.chat.mistral.ts and test.document.mistral.ts
- Updates readme.hints.md with Mistral usage, configuration and notes

## 2026-01-18 - 0.9.0 - feat(providers)
Add Anthropic extended thinking and adapt providers to new streaming/file APIs; bump dependencies and update docs, tests and configuration

- Add IAnthropicProviderOptions.extendedThinking with thinking modes (quick/normal/deep/off) and getThinkingConfig mapping budgets; apply thinking to Anthropic requests and omit temperature when thinking is enabled.
- Update Anthropic research flow to include thinking configuration and conditionally set temperature.
- OpenAI image editing: use openai.toFile to convert image/mask Buffers to uploadable files (image/png) before sending.
- ElevenLabs streaming: switch from response.streamNode() to response.stream() and convert web stream to Node stream using Readable.fromWeb().
- Upgrade dependencies and dev tools: @anthropic-ai/sdk ^0.71.2, @push.rocks/smartrequest ^5.0.1, @git.zone/tsbuild and related @git.zone packages, and other bumps in package.json.
- Tests and test imports updated to use @git.zone/tstest/tapbundle; many test files adjusted accordingly.
- Docs and hints updated: README and readme.hints.md include extended thinking docs, examples, formatting fixes, security/issue reporting guidance, and trademark/license clarifications.
- Project config tweaks: package build script changed, tsconfig baseUrl/paths added, npmextra.json reorganized (release registries added), .gitignore updated to ignore .claude/.serena local tooling files.

## 2025-10-30 - 0.8.0 - feat(provider.anthropic)

Add extended thinking modes to AnthropicProvider and apply thinking budgets to API calls

- Introduce IAnthropicProviderOptions.extendedThinking to configure thinking modes: 'quick' | 'normal' | 'deep' | 'off'.
- Add getThinkingConfig() helper mapping modes to token budgets (quick=2048, normal=8000, deep=16000, off=0).
- Apply thinking configuration to Anthropic API calls (chat, chatStream, vision, document, research) and increase max_tokens where appropriate (up to 20000).
- Add comprehensive tests (test/test.thinking.anthropic.ts) and update readme.hints.md with usage examples and recommendations.
- Add .claude/settings.local.json for local assistant permissions used in development/testing.

## 2025-10-10 - 0.7.7 - fix(MultiModalModel)

Lazy-load SmartPdf and guard document processing across providers; ensure SmartPdf is initialized only when needed

- Make SmartPdf lazy-loaded: smartpdfInstance is now nullable and no longer started automatically in start()
- Add ensureSmartpdfReady() to initialize and start SmartPdf on demand before document processing
- Providers updated (OpenAI, Anthropic, Ollama, xAI) to call ensureSmartpdfReady() and use the smartpdfInstance for PDF -> image conversion
- stop() now cleans up and nullifies smartpdfInstance to release resources
- Avoids starting a browser/process unless document() is actually used (reduces unnecessary resource usage)
- Add local Claude permissions file (.claude/settings.local.json) for tooling/configuration

## 2025-10-09 - 0.7.6 - fix(provider.elevenlabs)

Provide default ElevenLabs TTS voice fallback and add local tool/project configs

- ElevenLabsProvider: fallback to Samara voice id ('19STyYD15bswVz51nqLf') when no voiceId or defaultVoiceId is provided — avoids throwing an error on TTS calls.
- ElevenLabsProvider: continue to use 'eleven_v3' as the default model for TTS.
- Add .claude/settings.local.json with expanded allowed permissions for local tooling and web search.
- Add .serena/project.yml and .serena/.gitignore to include Serena project configuration and ignore cache.

## 2025-10-08 - 0.7.5 - fix(provider.elevenlabs)

Update ElevenLabs default TTS model to eleven_v3 and add local Claude permissions file

- Changed default ElevenLabs modelId from 'eleven_multilingual_v2' to 'eleven_v3' in ts/provider.elevenlabs.ts to use the newer/default TTS model.
- Added .claude/settings.local.json with a permissions allow-list for local Claude tooling and CI tasks.

## 2025-10-03 - 0.7.4 - fix(provider.anthropic)

Use image/png for embedded PDF images in Anthropic provider and add local Claude settings for development permissions

- AnthropicProvider: change media_type from 'image/jpeg' to 'image/png' when embedding images extracted from PDFs to ensure correct format in Anthropic requests.
- Add .claude/settings.local.json with development/testing permissions for local Claude usage (shell commands, webfetch, websearch, test/run tasks).

## 2025-10-03 - 0.7.3 - fix(tests)

Add extensive provider/feature tests and local Claude CI permissions

- Add many focused test files covering providers and features: OpenAI, Anthropic, Perplexity, Groq, Ollama, Exo, XAI (chat, audio, vision, document, research, image generation, stubs, interfaces, basic)
- Introduce .claude/settings.local.json to declare allowed permissions for local Claude/CI actions
- Replace older aggregated test files with modular per-feature tests (removed legacy combined tests and split into smaller suites)
- No changes to library runtime code — this change adds tests and CI/local agent configuration only

## 2025-10-03 - 0.7.2 - fix(anthropic)

Update Anthropic provider branding to Claude Sonnet 4.5 and add local Claude permissions

- Docs: Replace 'Claude 3 Opus' with 'Claude Sonnet 4.5' in README provider capabilities matrix.
- Config: Add .claude/settings.local.json to define local Claude permissions for tests and development commands.

## 2025-10-03 - 0.7.1 - fix(docs)

Add README image generation docs and .claude local settings

- Add .claude/settings.local.json with permission allow-list for local assistant tooling and web search
- Update README provider capabilities table to include an Images column and reference gpt-image-1
- Add Image Generation & Editing section with examples, options, and gpt-image-1 advantages
- Mark image generation support as implemented in the roadmap and remove duplicate entry

## 2025-10-03 - 0.7.0 - feat(providers)

Add research API and image generation/editing support; extend providers and tests

- Introduce ResearchOptions and ResearchResponse to the MultiModalModel interface and implement research() where supported
- OpenAiProvider: implement research(), add imageGenerate() and imageEdit() methods (gpt-image-1 / DALL·E support), and expose imageModel option
- AnthropicProvider: implement research() and vision handling; explicitly throw for unsupported image generation/editing
- PerplexityProvider: implement research() (sonar / sonar-pro support) and expose citation parsing
- Add image/document-related interfaces (ImageGenerateOptions, ImageEditOptions, ImageResponse) to abstract API
- Add image generation/editing/no-op stubs for other providers (Exo, Groq, Ollama, XAI) that throw informative errors to preserve API compatibility
- Add comprehensive OpenAI image generation tests and helper to save test outputs (test/test.image.openai.ts)
- Update README with Research & Web Search documentation, capability matrix, and roadmap entry for Research & Web Search API
- Add local Claude agent permissions file (.claude/settings.local.json) and various provider type/import updates

## 2025-09-28 - 0.6.1 - fix(provider.anthropic)

Fix Anthropic research tool identifier and add tests + local Claude permissions

- Replace Anthropic research tool type from 'computer_20241022' to 'web_search_20250305' to match the expected web-search tool schema.
- Add comprehensive test suites and fixtures for providers and research features (new/updated tests under test/ including anthropic, openai, research.\* and stubs).
- Fix test usage of XAI provider class name (use XAIProvider) and adjust basic provider test expectations (provider instantiation moved to start()).
- Add .claude/settings.local.json with local Claude permissions to allow common CI/dev commands and web search during testing.

## 2025-09-28 - 0.6.0 - feat(research)

Introduce research API with provider implementations, docs and tests

- Add ResearchOptions and ResearchResponse interfaces and a new abstract research() method to MultiModalModel
- Implement research() for OpenAiProvider (deep research model selection, optional web search/tools, background flag, source extraction)
- Implement research() for AnthropicProvider (web search tool support, domain filters, citation extraction)
- Implement research() for PerplexityProvider (sonar / sonar-pro model usage and citation parsing)
- Add research() stubs to Exo, Groq, Ollama and XAI providers that throw a clear 'not yet supported' error to preserve interface compatibility
- Add tests for research interfaces and provider research methods (test files updated/added)
- Add documentation: readme.research.md describing the research API, usage and configuration
- Export additional providers from ts/index.ts and update provider typings/imports across files
- Add a 'typecheck' script to package.json
- Add .claude/settings.local.json (local agent permissions for CI/dev tasks)

## 2025-08-12 - 0.5.11 - fix(openaiProvider)

Update default chat model to gpt-5-mini and bump dependency versions

- Changed default chat model in OpenAiProvider from 'o3-mini' and 'o4-mini' to 'gpt-5-mini'
- Upgraded @anthropic-ai/sdk from ^0.57.0 to ^0.59.0
- Upgraded openai from ^5.11.0 to ^5.12.2
- Added new local Claude settings configuration (.claude/settings.local.json)

## 2025-08-03 - 0.5.10 - fix(dependencies)

Update SmartPdf to v4.1.1 for enhanced PDF processing capabilities

- Updated @push.rocks/smartpdf from ^3.3.0 to ^4.1.1
- Enhanced PDF conversion with improved scale options and quality controls
- Dependency updates for better performance and compatibility

## 2025-08-01 - 0.5.9 - fix(documentation)

Remove contribution section from readme

- Removed the contribution section from readme.md as requested
- Kept the roadmap section for future development plans

## 2025-08-01 - 0.5.8 - fix(core)

Fix SmartPdf lifecycle management and update dependencies

- Moved SmartPdf instance management to the MultiModalModel base class for better resource sharing
- Fixed memory leaks by properly implementing cleanup in the base class stop() method
- Updated SmartAi class to properly stop all providers on shutdown
- Updated @push.rocks/smartrequest from v2.1.0 to v4.2.1 with migration to new API
- Enhanced readme with professional documentation and feature matrix

## 2025-07-26 - 0.5.7 - fix(provider.openai)

Fix stream type mismatch in audio method

- Fixed type error where OpenAI SDK returns a web ReadableStream but the audio method needs to return a Node.js ReadableStream
- Added conversion using Node.js's built-in Readable.fromWeb() method

## 2025-07-25 - 0.5.5 - feat(documentation)

Comprehensive documentation enhancement and test improvements

- Completely rewrote readme.md with detailed provider comparisons, advanced usage examples, and performance tips
- Added comprehensive examples for all supported providers (OpenAI, Anthropic, Perplexity, Groq, XAI, Ollama, Exo)
- Included detailed sections on chat interactions, streaming, TTS, vision processing, and document analysis
- Added verbose flag to test script for better debugging

## 2025-05-13 - 0.5.4 - fix(provider.openai)

Update dependency versions, clean test imports, and adjust default OpenAI model configurations

- Bump dependency versions in package.json (@git.zone/tsbuild, @push.rocks/tapbundle, openai, etc.)
- Change default chatModel from 'gpt-4o' to 'o4-mini' and visionModel from 'gpt-4o' to '04-mini' in provider.openai.ts
- Remove unused 'expectAsync' import from test file

## 2025-04-03 - 0.5.3 - fix(package.json)

Add explicit packageManager field to package.json

- Include the packageManager property to specify the pnpm version and checksum.
- Align package metadata with current standards.

## 2025-04-03 - 0.5.2 - fix(readme)

Remove redundant conclusion section from README to streamline documentation.

- Eliminated the conclusion block describing SmartAi's capabilities and documentation pointers.

## 2025-02-25 - 0.5.1 - fix(OpenAiProvider)

Corrected audio model ID in OpenAiProvider

- Fixed audio model identifier from 'o3-mini' to 'tts-1-hd' in the OpenAiProvider's audio method.
- Addressed minor code formatting issues in test suite for better readability.
- Corrected spelling errors in test documentation and comments.

## 2025-02-25 - 0.5.0 - feat(documentation and configuration)

Enhanced package and README documentation

- Expanded the package description to better reflect the library's capabilities.
- Improved README with detailed usage examples for initialization, chat interactions, streaming chat, audio generation, document analysis, and vision processing.
- Provided error handling strategies and advanced streaming customization examples.

## 2025-02-25 - 0.4.2 - fix(core)

Fix OpenAI chat streaming and PDF document processing logic.

- Updated OpenAI chat streaming to handle new async iterable format.
- Improved PDF document processing by filtering out empty image buffers.
- Removed unsupported temperature options from OpenAI requests.

## 2025-02-25 - 0.4.1 - fix(provider)

Fix provider modules for consistency

- Updated TypeScript interfaces and options in provider modules for better type safety.
- Modified transform stream handlers in Exo, Groq, and Ollama providers for consistency.
- Added optional model options to OpenAI provider for custom model usage.

## 2025-02-08 - 0.4.0 - feat(core)

Added support for Exo AI provider

- Introduced ExoProvider with chat functionalities.
- Updated SmartAi class to initialize ExoProvider.
- Extended Conversation class to support ExoProvider.

## 2025-02-05 - 0.3.3 - fix(documentation)

Update readme with detailed license and legal information.

- Added explicit section on License and Legal Information in the README.
- Clarified the use of trademarks and company information.

## 2025-02-05 - 0.3.2 - fix(documentation)

Remove redundant badges from readme

- Removed Build Status badge from the readme file.
- Removed License badge from the readme file.

## 2025-02-05 - 0.3.1 - fix(documentation)

Updated README structure and added detailed usage examples

- Introduced a Table of Contents
- Included comprehensive sections for chat, streaming chat, audio generation, document processing, and vision processing
- Added example code and detailed configuration steps for supported AI providers
- Clarified the development setup with instructions for running tests and building the project

## 2025-02-05 - 0.3.0 - feat(integration-xai)

Add support for X.AI provider with chat and document processing capabilities.

- Introduced XAIProvider class for integrating X.AI features.
- Implemented chat streaming and synchronous chat for X.AI.
- Enabled document processing capabilities with PDF conversion in X.AI.

## 2025-02-03 - 0.2.0 - feat(provider.anthropic)

Add support for vision and document processing in Anthropic provider

- Implemented vision tasks for Anthropic provider using Claude-3-opus-20240229 model.
- Implemented document processing for Anthropic provider, supporting conversion of PDF documents to images and analysis with Claude-3-opus-20240229 model.
- Updated documentation to reflect the new capabilities of the Anthropic provider.

## 2025-02-03 - 0.1.0 - feat(providers)

Add vision and document processing capabilities to providers

- OpenAI and Ollama providers now support vision tasks using GPT-4 Vision and Llava models respectively.
- Document processing has been implemented for OpenAI and Ollama providers, converting PDFs to images for analysis.
- Introduced abstract methods for vision and document processing in the MultiModalModel class.
- Updated the readme file with examples for vision and document processing.

## 2025-02-03 - 0.0.19 - fix(core)

Enhanced chat streaming and error handling across providers

- Refactored chatStream method to properly handle input streams and processes in Perplexity, OpenAI, Ollama, and Anthropic providers.
- Improved error handling and message parsing in chatStream implementations.
- Defined distinct interfaces for chat options, messages, and responses.
- Adjusted the test logic in test/test.ts for the new classification response requirement.

## 2024-09-19 - 0.0.18 - fix(dependencies)

Update dependencies to the latest versions.

- Updated @git.zone/tsbuild from ^2.1.76 to ^2.1.84
- Updated @git.zone/tsrun from ^1.2.46 to ^1.2.49
- Updated @push.rocks/tapbundle from ^5.0.23 to ^5.3.0
- Updated @types/node from ^20.12.12 to ^22.5.5
- Updated @anthropic-ai/sdk from ^0.21.0 to ^0.27.3
- Updated @push.rocks/smartfile from ^11.0.14 to ^11.0.21
- Updated @push.rocks/smartpromise from ^4.0.3 to ^4.0.4
- Updated @push.rocks/webstream from ^1.0.8 to ^1.0.10
- Updated openai from ^4.47.1 to ^4.62.1

## 2024-05-29 - 0.0.17 - Documentation

Updated project description.

- Improved project description for clarity and details.

## 2024-05-17 - 0.0.16 to 0.0.15 - Core

Fixes and updates.

- Various core updates and fixes for stability improvements.

## 2024-04-29 - 0.0.14 to 0.0.13 - Core

Fixes and updates.

- Multiple core updates and fixes for enhanced functionality.

## 2024-04-29 - 0.0.12 - Core

Fixes and updates.

- Core update and bug fixes.

## 2024-04-29 - 0.0.11 - Provider

Fix integration for anthropic provider.

- Correction in the integration process with anthropic provider for better compatibility.

## 2024-04-27 - 0.0.10 to 0.0.9 - Core

Fixes and updates.

- Updates and fixes to core components.
- Updated tsconfig for improved TypeScript configuration.

## 2024-04-01 - 0.0.8 to 0.0.7 - Core and npmextra

Core updates and npmextra configuration.

- Core fixes and updates.
- Updates to npmextra.json for githost configuration.

## 2024-03-31 - 0.0.6 to 0.0.2 - Core

Initial core updates and fixes.

- Multiple updates and fixes to core following initial versions.

This summarizes the relevant updates and changes based on the provided commit messages. The changelog excludes commits that are version tags without meaningful content or repeated entries.
