Commit Graph

228 Commits

Author SHA1 Message Date
Kayvan Sylvan
af47036bff chore: remove unused gemini_openai plugin and oauth_storage utility
## CHANGES

- Delete `gemini_openai` package and its OpenAI-compatible client wrapper
- Remove `OAuthToken` struct and expiry-check logic from `util`
- Remove `OAuthStorage` persistent token save/load/delete handlers
- Drop `HasValidToken` helper and atomic file-write token saving
- Delete all `oauth_storage` unit tests covering token lifecycle
2026-02-17 23:11:48 -08:00
Kayvan Sylvan
12f34621b9 chore: bump Go dependencies and remove deprecated Anthropic models
- Bump go-sqlite3 from v1.14.33 to v1.14.34
- Bump ollama from v0.15.6 to v0.16.1
- Bump google.golang.org/api from v0.265.0 to v0.266.0
- Bump google.golang.org/grpc from v1.78.0 to v1.79.0
- Remove deprecated Claude 3.x model references from Anthropic client
- Remove claude-3-7-sonnet model from OpenAI-compatible provider config
- Add changelog entry for PR #1996
- Add PDFURL and URLPDF to VSCode spell-check dictionary
- incoming 1996 changelog entry
2026-02-17 21:01:39 -08:00
Kayvan Sylvan
683c860b89 chore: bump anthropic-sdk-go from v1.22.0 to v1.23.0
- Upgrade Anthropic SDK Go dependency to version 1.23.0
- Add Claude Sonnet 4.6 to list of supported models
- Update `go.sum` checksums for new SDK version
2026-02-17 19:40:18 -08:00
Kayvan Sylvan
5dc33873ee Merge branch 'main' into pattern-by-exename 2026-02-16 21:25:48 -08:00
Kayvan Sylvan
2244e2a152 feat: add optional API key authentication to LM Studio client
- Add optional API key setup question to client configuration
- Add `ApiKey` field to the LM Studio `Client` struct
- Create `addAuthorizationHeader` helper to attach Bearer token to requests
- Apply authorization header to all outgoing HTTP requests
- Skip authorization header when API key is empty or unset
2026-02-16 17:52:56 -08:00
Konstantin Tretyakov
40092d7e2c feat: When running from a symlink, use the executable name as the pattern argument 2026-02-17 00:45:43 +01:00
Kayvan Sylvan
f26e328d40 feat: internationalize file manager, Vertex AI, and Copilot error messages via i18n
- Replace hardcoded error strings in `file_manager.go` with i18n translation keys
- Add file manager, Vertex AI, and Copilot i18n keys to all 10 locale files
- Internationalize Copilot plugin error messages and debug logs
- Internationalize Vertex AI model fetching error messages
- Fix JSON trailing comma syntax errors across all locale files
- Normalize German locale JSON indentation from tabs to spaces
- Use `AddSetupQuestionWithEnvName` for Bedrock AWS region setup
2026-02-16 13:10:00 -08:00
Kayvan Sylvan
3f46c45479 chore: gofmt fix 2026-02-16 08:42:39 -08:00
Kayvan Sylvan
c797a84847 feat: add error handling for fetch operations in i18n
- Add new error messages for fetch operations
- Rename `errInvalidLocationFormat` to `errInvalidLocationFormatKey`
- Use `errors.New` instead of `fmt.Errorf` for fetch errors
- Update Chinese locale with fetch-related error messages
2026-02-16 08:38:35 -08:00
Kayvan Sylvan
eeb9567ce0 feat: add i18n translations for VertexAI, Gemini, Bedrock, and fetch plugins
- Add VertexAI error message translations across 10 locale files
- Add Gemini TTS and audio error translations to all locales
- Add AWS Bedrock client error translations to all locales
- Add fetch plugin error message translations to all locales
- Replace hardcoded English strings with `i18n.T()` calls in Bedrock plugin
- Replace hardcoded English strings with `i18n.T()` calls in Gemini plugin
- Replace hardcoded English strings with `i18n.T()` calls in VertexAI plugin
- Replace hardcoded English strings with `i18n.T()` calls in fetch plugin
- Use `errors.New` instead of `fmt.Errorf` for non-formatted error strings
2026-02-16 08:28:54 -08:00
Kayvan Sylvan
5dfae3ac0c refactor: replace hardcoded error string with i18n translation lookup
- Remove `NoSessionPatternUserMessages` constant from `chatter.go`
- Replace direct constant reference with `i18n.T()` translation call
- Update test import from `core` package to `i18n` package
- Update test assertion to use localized error message lookup
2026-02-16 04:32:30 -08:00
Kayvan Sylvan
a71a006f74 feat: add internationalization support for chatter and template file operations
- Replace hardcoded strings with i18n keys in chatter.go
- Add translation keys for errors, warnings, and metadata in locale files
- Update file.go to use i18n for operation messages and errors
- Provide translations in German, English, Spanish, Persian, French, Italian, Japanese, Portuguese, and Chinese
- Enable localized output for stream updates and file plugin operations
- Ensure consistent error handling across supported languages
- Maintain backward compatibility with existing functionality
2026-02-16 04:21:56 -08:00
Kayvan Sylvan
0ceb639c9d MAESTRO: i18n: extract hard-coded strings from internal/tools/spotify/spotify.go
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 00:54:12 -08:00
Kayvan Sylvan
7839ae6fa7 MAESTRO: i18n: extract hard-coded strings from internal/plugins/template/extension_executor.go
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 00:45:46 -08:00
Kayvan Sylvan
398b07f13f MAESTRO: i18n: extract hard-coded strings from internal/plugins/ai/openai/openai.go
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 00:32:38 -08:00
Kayvan Sylvan
c8ca1792b4 MAESTRO: i18n: extract hard-coded strings from internal/plugins/template/extension_registry.go
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 23:52:59 -08:00
Kayvan Sylvan
7382ddaae5 MAESTRO: i18n: extract hard-coded strings from internal/plugins/ai/lmstudio/lmstudio.go
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 23:38:16 -08:00
Kayvan Sylvan
5fbddb2279 MAESTRO: i18n: extract hard-coded strings from internal/plugins/template/extension_manager.go
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 22:10:23 -08:00
Kayvan Sylvan
020656ccdc MAESTRO: i18n: extract hard-coded strings from internal/server/ollama.go
Replace 37 hard-coded error/log strings with i18n.T() calls and add
translations for all 10 supported languages (en, de, es, fa, fr, it,
ja, pt-BR, pt-PT, zh). Keys use ollama_ prefix following project
conventions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 20:49:08 -08:00
Kayvan Sylvan
629257b1c1 feat: enable responses for GrokAI (xAI) provider
### CHANGES
- Set ImplementsResponses to true for GrokAI provider.
2026-02-12 18:32:54 -08:00
Kayvan Sylvan
9a593cbc5a Remove deprecated OpenAI models from image generation support list
- Remove gpt-4o, gpt-4o-mini, gpt-4.1, and gpt-4.1-mini from ImageGenerationSupportedModels
- These models are being retired by OpenAI effective February 13, 2026
- Keep gpt-4.1-nano, o3, gpt-5, gpt-5-nano, gpt-5.2 as supported
- Update tests to use gpt-5.2 instead of gpt-4o as the example supported model
- Update test expectations to reflect deprecated models no longer being supported

This ensures users get accurate warnings when attempting image generation with
retired models, while maintaining support for currently available models.

Co-Authored-By: Warp <agent@warp.dev>
2026-02-12 17:04:25 -08:00
Kayvan Sylvan
191edb56ca chore: remove deprecated GPT-4 models from image generation supported list
- Remove `gpt-4o` from image generation supported models
- Remove `gpt-4o-mini` from image generation supported models
- Remove `gpt-4.1` from image generation supported models
- Remove `gpt-4.1-mini` from image generation supported models
- Keep `gpt-4.1-nano`, `o3`, and `gpt-5` as supported models
2026-02-12 16:56:58 -08:00
Kayvan Sylvan
0894ec28c1 chore: update model references to latest versions across docs and code
- Update default summarize model to `claude-sonnet-4-5`
- Replace `gpt-4o` references with `gpt-5.2` throughout docs
- Replace `gpt-4o-mini` references with `gpt-5-mini`
- Add MiniMax-M2.5 and M2.5-lightning to static models list
- Update image generation warning to suggest `gpt-5.2`
- Update OpenAI chat example script to use `gpt-5-mini`
- Update REST API docs and examples with current model names
2026-02-12 16:45:05 -08:00
Kayvan Sylvan
92b53c8876 feat: add dynamic Abacus RouteLLM model fetching and update static model lists
- Add `fetchAbacusModels()` to dynamically retrieve models from Abacus RouteLLM API
- Fall back to static model list when Abacus API fetch fails
- Add GPT-5 Codex variants (5, 5.1, 5.1-max, 5.2) to static models
- Add GPT-5.2 and GPT-5.2-chat-latest to static model list
- Add claude-opus-4-6 and gemini-3-flash-preview to static models
- Add kimi-k2.5, glm-4.7, and glm-5 to static model list
- Rename `qwen/qwen3-Max` to lowercase `qwen3-max`
- Handle `static:abacus` as special case in `ListModels` routing
2026-02-12 13:33:20 -08:00
Kayvan Sylvan
3dc83584b9 chore: bump anthropic SDK to v1.21.0 and clean up unused dependencies
See https://www.anthropic.com/news/claude-opus-4-6

## CHANGES

- Upgrade anthropic-sdk-go from v1.20.0 to v1.21.0
- Add `ClaudeOpus4_6` to supported Anthropic model list
- Remove unused indirect dependencies from go.mod and go.sum
- Clean up legacy protobuf and gRPC version references
- Remove stale tensor, math, and image processing libraries
- Drop unused table writer and console dependencies
- Prune obsolete cloud.google.com version pins
2026-02-05 10:54:22 -08:00
Baker Tamory
ed6d004790 style: remove trailing blank line in azure.go to fix gofmt check 2026-02-02 14:43:47 +11:00
Baker Tamory
ef1ee793e1 fix(azure): support GPT-5 and o-series reasoning models
- Update default API version from 2024-05-01-preview to 2025-04-01-preview
  (required for o-series and GPT-5 models)
- Remove NeedsRawMode override that always returned false, inheriting parent
  logic that correctly skips temperature/top_p for reasoning models
- Add /responses route to deployment middleware for future v1 API support

Tested against Azure OpenAI gpt-5.2-chat deployment.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 13:09:16 +11:00
Kayvan Sylvan
0285e52c7b feat: update Anthropic SDK to v1.20.0 and reorganize model definitions**
## CHANGES

- Bump `anthropic-sdk-go` dependency from v1.19.0 to v1.20.0
- Add deprecation notice for pre-February 2026 legacy models
- Add new Claude Sonnet 4.0 and Opus 4.0 model aliases
- Extend 1M context beta support to all Sonnet 4 variants
- Reorganize model list to separate deprecated from current models
- Add `neturl` to VS Code spell-check dictionary
2026-01-31 12:58:44 -08:00
Kayvan Sylvan
9f752f45af chore: remove OAuth support from Anthropic client
- Remove OAuth support from Anthropic client
- Delete `oauth.go` and related test files
- Simplify `IsConfigured` to check only API key
- Update configuration handling to remove OAuth references
- Clean up imports and unused variables in `anthropic.go`
- Adjust `GetConfig` and `UpdateConfig` methods in server configuration
- Remove OAuth-related environment variables from configuration
2026-01-29 19:49:50 -08:00
Kayvan Sylvan
bd38f5ae20 Merge pull request #1965 from infinitelyloopy-bt/fix/azure-openai-deployment-url
fix(azure): Fix deployment URL path for Azure OpenAI API
2026-01-24 12:00:09 -08:00
Baker Tamory
a61007b3b1 Apply PR review feedback from @ksylvan
- Add changelog file for PR #1965
- Fix trailing space formatting in deploymentRoutes map

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-25 01:39:18 +11:00
Kayvan Sylvan
8469665cab chore: add MiniMax provider support and update API endpoints
## CHANGES

- add MiniMax provider configuration with API endpoint updates
- implement NeedsRawMode method for MiniMax model handling
- define static MiniMax model list with M2 variants
- add Infermatic and Novita to VS Code extensions
- update test to use proper context.TODO() parameter
- configure MiniMax models as static discovery
- set ModelsURL to static:minimax for model listing
2026-01-23 22:45:54 -08:00
Baker Tamory
82974a6a2a fix(azure): Fix deployment URL path for Azure OpenAI API
The OpenAI Go SDK's azure.WithEndpoint() middleware has a bug where it
expects request paths like /openai/chat/completions but the SDK actually
sends paths like /chat/completions (without the /openai/ prefix since
that's included in the base URL). This causes the SDK's route matching
to fail, resulting in deployment names not being injected into the URL.

Azure OpenAI requires URLs like:
  /openai/deployments/{deployment-name}/chat/completions
But the SDK was generating:
  /openai/chat/completions

This fix:
1. Adds custom middleware that correctly transforms API paths to include
   the deployment name extracted from the request body's model field
2. Moves StreamOptions to only be set for streaming requests (Azure
   rejects stream_options for non-streaming requests)

Fixes #1954

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 13:31:04 +11:00
Kayvan Sylvan
cc56013004 fix: consume all positional arguments as input
Changed from using only the last positional argument (args[len(args)-1])
to joining all positional arguments with spaces. This allows commands like:
  fabric -p pattern_name How do I use fabric to list available models
to consume the entire phrase instead of just "models".

Fixes #1958

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-23 09:29:11 -08:00
Kayvan Sylvan
f18d6cc574 feat: add Novita AI as a new OpenAI-compatible provider
- Add Novita AI provider configuration with API endpoint
- Update README to include Novita AI in supported providers list
- Configure Novita AI to use OpenAI-compatible interface
2026-01-22 21:33:20 -08:00
Kayvan Sylvan
816e1bab89 chore: add documentation and improve code style per review feedback
- Add documentation comments for messageTextFromParts, contentBlocksFromMessage,
  prependSystemContentToBlocks, contentBlockFromAttachmentURL, and parseDataURL
- Consolidate two switch statements in normalizeImageMimeType into single
  idiomatic Go switch with direct returns

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 15:52:29 -08:00
Kayvan Sylvan
8c38cef1f1 chore: address Copilot review feedback for attachments handling
- Add debug logging for failed data URL parsing
- Add debug logging for unsupported MIME types
- Add debug logging for non-base64 data URLs
- Add documentation for normalizeImageMimeType with API reference
- Add documentation for isPDFURL explaining extension-only limitation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 15:12:23 -08:00
Kayvan Sylvan
bcce1bef99 fix for \\n -> \n 2026-01-21 14:56:16 -08:00
Kayvan Sylvan
eea80f3bee feat: add multi-content support for images and PDFs in Anthropic client
### CHANGES
- Update toMessages to handle multi-content messages with text and attachments
- Add contentBlocksFromMessage to convert message parts to Anthropic blocks
- Implement support for image URLs including data URLs and base64 images
- Add PDF attachment handling via data URLs and URL-based PDFs
- Introduce parseDataURL for extracting MIME type and data from data URLs
- Create normalizeImageMimeType to standardize supported image MIME types
- Add isPDFURL to detect PDF files from URL paths
- Refactor system content accumulation to use text extraction from parts
- Update tests to verify PDF attachment processing in multi-content messages
2026-01-21 14:19:40 -08:00
Kayvan Sylvan
719590abb6 feat: add Spotify metadata retrieval via --spotify flag
## CHANGES
- Add Spotify plugin with OAuth token handling and metadata
- Wire --spotify flag into CLI processing and output
- Register Spotify in plugin setup, env, and registry
- Update shell completions to include --spotify option
- Add i18n strings for Spotify configuration errors
- Add unit and integration tests for Spotify API
- Set gopls integration build tags for workspace
2026-01-20 15:57:59 -08:00
Kayvan Sylvan
a23c698947 feat: add image generation compatibility warnings for unsupported models
## CHANGES

- Add warning to stderr when using incompatible models with image generation
- Add GPT-5, GPT-5-nano, and GPT-5.2 to supported image generation models
- Create `checkImageGenerationCompatibility` function in OpenAI plugin
- Add comprehensive tests for image generation compatibility warnings
- Add integration test scenarios for CLI image generation workflows
- Suggest gpt-4o as alternative in incompatibility warning messages
2026-01-20 11:55:18 -08:00
Kayvan Sylvan
387610bcf8 Add Infermatic provider test case
Adds test coverage for the Infermatic AI provider in
TestCreateClient to verify the provider exists and
creates a valid client.

Part of #1033: Add Infermatic AI provider support

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 06:38:38 -08:00
Kayvan Sylvan
9e1ee4d48e WIP: Phase 1 - Add Infermatic provider to ProviderMap
Issue: #1033
Phase: 1 of 2
Status: Pending verification

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 06:25:31 -08:00
Kayvan Sylvan
da34f5823a chore: refactor parseOllamaNumCtx for cleaner errors and type fixes
### CHANGES
- Remove value from fractional part error message
- Update overflow check to use float64 for consistency
- Ensure error messages omit unnecessary details for clarity
2026-01-18 10:12:18 -08:00
Kayvan Sylvan
14358a1c1b fix: Edit comments per review comments 2026-01-18 09:59:35 -08:00
Kayvan Sylvan
ce74e881be fix: add validation for NaN, Inf, and negative values in parseOllamaNumCtx
## CHANGES

- Add NaN and Infinity validation for float64 values
- Add NaN and Infinity validation for float32 values
- Add negative value check for int64 type
- Add negative value check for json.Number type
- Add comprehensive test cases for special float values
- Add test cases for negative int64 and json.Number inputs
- Update line reference comments for validation checks
2026-01-18 07:42:10 -08:00
Kayvan Sylvan
6f804d7e46 fix: changes based on PR review 2026-01-18 01:46:09 -08:00
Kayvan Sylvan
8c015b09a1 test: add comprehensive tests for parseOllamaNumCtx and simplify error handling
- Add comprehensive unit tests for `parseOllamaNumCtx` function
- Remove redundant negative value checks in float parsing
- Simplify error messages to avoid exposing internal type info
- Streamline error response in `ollamaChat` handler
- Add helper functions for string containment in tests
- Cover edge cases including overflow, invalid types, and boundaries
2026-01-18 01:34:03 -08:00
Kayvan Sylvan
03108cc69d format fix 2026-01-18 01:02:46 -08:00
Kayvan Sylvan
556e098fc1 fix: Ollama server now respects the default context window
This commit fixes the Ollama server /api/chat endpoint which was ignoring
the client-provided num_ctx parameter and global DEFAULT_MODEL_CONTEXT_LENGTH,
always using a hardcoded value of 2048 tokens.

- Add parseOllamaNumCtx() function in ollama.go with type-safe extraction
  supporting 6 numeric types (float64, float32, int, int64, json.Number, string)
- Extract num_ctx from client request options in ollamaChat()
- Add ModelContextLength field to ChatRequest struct in chat.go
- Replace hardcoded 2048 with request.ModelContextLength in GetChatter() call

- Platform-aware integer overflow protection for 32-bit systems
- DoS protection via 1,000,000 token maximum limit
- Long string truncation in error messages (50 char limit)
- Sanitized error messages (no internal stdlib details exposed)

- Missing/null num_ctx returns (0, nil) to trigger existing default fallback
- Zero API contract changes
- Invalid values return 400 Bad Request with clear error messages

- All existing tests pass
- Compilation successful with no errors or warnings

Fixes #1942
2026-01-18 00:47:37 -08:00