Commit Graph

139 Commits

Author SHA1 Message Date
Rodaddy
3cb0be03c7 feat(ai): add VertexAI provider for Claude models
Add support for Google Cloud Vertex AI as a provider to access Claude models
using Application Default Credentials (ADC). This allows users to route their
Fabric requests through Google Cloud Platform instead of directly to Anthropic,
enabling billing through GCP.

Features:
- Support for Claude models (Sonnet 4.5, Opus 4.5, Haiku 4.5, etc.) via Vertex AI
- Uses Google ADC for authentication (no API keys required)
- Configurable project ID and region (defaults to 'global' for cost optimization)
- Full support for streaming and non-streaming requests
- Implements complete ai.Vendor interface

Configuration:
- VERTEXAI_PROJECT_ID: GCP project ID (required)
- VERTEXAI_REGION: Vertex AI region (optional, defaults to 'global')

Closes #1570
2025-12-29 14:33:25 -05:00
lif
6c5487609e feat(gui): add Session ID support for multi-turn conversations
Add session name parameter to GUI chat interface, enabling persistent
multi-turn conversations similar to CLI's --session flag.

Changes:
- Add SessionName field to PromptRequest in chat.go
- Add sessionName to ChatPrompt interface
- Include currentSession in ChatService requests
- Add Session ID input with existing sessions dropdown in DropdownGroup

Closes #680

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 08:11:30 +08:00
Kayvan Sylvan
33130f2087 refactor: optimize HTTP client reuse and simplify error formatting
### CHANGES

- Simplify error wrapping by removing redundant Sprintf calls in CLI
- Pass HTTP client to FetchModelsDirectly to enable connection reuse
- Store persistent HTTP client instance inside the OpenAI provider struct
- Update compatible AI providers to match the new function signature
- Add error handling for pattern loading from absolute file paths
2025-12-25 07:58:49 -08:00
Kayvan Sylvan
58e8ac1012 chore: simplify error formatting and clean up model assignment logic
### CHANGES
- Remove redundant fmt.Sprintf calls from error formatting logic
- Simplify model assignment to always use normalized model names
- Remove unused variadic parameter from the VendorsManager Clear method
2025-12-23 07:51:33 -08:00
Kayvan Sylvan
e2c28c8f19 feat: add MiniMax provider support to OpenAI compatible plugin
- Add MiniMax provider configuration to ProviderMap
- Set MiniMax base URL to api.minimaxi.com/v1
- Configure MiniMax with ImplementsResponses as false
- Add test case for MiniMax provider validation
2025-12-22 14:52:08 -08:00
Kayvan Sylvan
7570e7930b feat: localize setup process and add funding configuration
- Add GitHub and Buy Me a Coffee funding configuration.
- Localize setup prompts and error messages across multiple languages.
- Implement helper for localized questions with static environment keys.
- Update environment variable builder to handle hyphenated plugin names.
- Replace hardcoded console output with localized i18n translation strings.
- Expand locale files with comprehensive pattern and strategy translations.
- Add new i18n keys for optional and required markers
- Remove hardcoded `[required]` markers from description strings
- Add custom patterns, Jina AI, YouTube, and language labels
- Switch plugin descriptions to use i18n translation keys
- Append markers dynamically to setup descriptions in Go code
- Remove trailing newlines from plugin question prompt strings
- Standardize all locale files with consistent formatting changes
2025-12-22 09:39:02 -08:00
Kayvan Sylvan
5e4e4f4bf1 docs: Add YouTube transcript endpoint to Swagger UI.
- Add `/youtube/transcript` POST endpoint to Swagger docs
- Define `YouTubeRequest` schema with URL, language, timestamps fields
- Define `YouTubeResponse` schema with transcript and metadata fields
- Add API security requirement using ApiKeyAuth
- Document 200, 400, and 500 response codes
- Add godoc comments to YouTubeHandler struct methods
- Include example values for all request/response properties
2025-12-19 10:41:55 -08:00
Bob Vandevliet
8a3fa9337c feat: correct video title (instead of id) and added description to yt transcript api response 2025-12-19 13:14:12 +01:00
Kayvan Sylvan
9f79877524 User Experience: implement automated first-time setup and improved configuration validation
### CHANGES

- Add automated first-time setup for patterns and strategies.
- Implement configuration validation to warn about missing required components.
- Update setup menu to group plugins into required and optional.
- Provide helpful guidance when no patterns are found in listing.
- Expand localization support for setup and error messaging across languages.
- Enhance strategy manager to reload and count installed strategies.
- Improve pattern error handling with specific guidance for empty directories.
2025-12-18 14:48:50 -08:00
Kayvan Sylvan
c06c94f8b8 # CHANGES
- Add Swagger UI at `/swagger/index.html` endpoint
- Generate OpenAPI spec files (JSON and YAML)
- Document chat, patterns, and models endpoints
- Update contributing guide with Swagger annotation instructions
- Add swaggo dependencies to project
- Configure authentication bypass for Swagger documentation
- Add custom YAML handler for OpenAPI spec
- Update REST API documentation with Swagger links
- Add dictionary entries for new tools
2025-12-18 07:12:08 -08:00
Kayvan Sylvan
fdadeae1e7 modernize: update GitHub Actions and modernize Go code with latest stdlib features
## CHANGES

- Upgrade GitHub Actions to latest versions (v6, v21)
- Add modernization check step in CI workflow
- Replace strings manipulation with `strings.CutPrefix` and `strings.CutSuffix`
- Replace manual loops with `slices.Contains` for validation
- Use `strings.SplitSeq` for iterator-based string splitting
- Replace `bytes.TrimPrefix` with `bytes.CutPrefix` for clarity
- Use `strings.Builder` instead of string concatenation
- Replace `fmt.Sprintf` with `fmt.Appendf` for efficiency
- Simplify padding calculation with `max` builtin
2025-12-15 23:55:37 -08:00
Kayvan Sylvan
a4484d4e01 refactor: modernize Go code with TypeFor and range loops
- Replace reflect.TypeOf with TypeFor generic syntax
- Convert traditional for loops to range-based iterations
- Simplify reflection usage in CLI flag handling
- Update test loops to use range over integers
- Refactor string processing loops in template plugin
2025-12-15 23:29:41 -08:00
Kayvan Sylvan
dccdfbac8c test: update benchmarks to use b.Loop and refactor map copying
# CHANGES

- update benchmark loops to use cleaner `b.Loop()` syntax
- remove unnecessary `b.ResetTimer()` call in token benchmark
- use `maps.Copy` for merging variables in patterns handler
2025-12-15 22:40:55 -08:00
Kayvan Sylvan
66025d516c refactor: replace interface{} with any across codebase
- Part 1 of incorporating `modernize` tool into Fabric.
- Replace `interface{}` with `any` in slice type declarations
- Update map types from `map[string]interface{}` to `map[string]any`
- Change variadic function parameters to use `...any` instead of `...interface{}`
- Modernize JSON unmarshaling variables to `any` for consistency
- Update struct fields and method signatures to prefer `any` alias
- Ensure all type assertions and conversions use `any` throughout codebase
- Add PR guidelines in docs to encourage focused, reviewable changes
2025-12-15 22:25:18 -08:00
Kayvan Sylvan
deb59bdd21 fix: write CLI and streaming errors to stderr
## CHANGES
- Route CLI execution errors to standard error output
- Print Anthropic stream errors to stderr consistently
- Add os import to support stderr error writes
- Preserve help-output suppression and exit behavior
2025-12-13 00:02:44 -08:00
Kayvan Sylvan
5b723c9e92 fix: allow resetting required settings without validation errors
CHANGES
- update `Ask` to detect reset command and bypass validation
- refactor `OnAnswer` to support new `isReset` parameter logic
- invoke `ConfigureCustom` in `Setup` to avoid redundant re-validation
- add unit tests ensuring required fields can be reset
- add incoming 1860 changelog entry
2025-12-11 02:39:35 -08:00
Kayvan Sylvan
b1eb7a82d9 feat: add support for new ClaudeHaiku models in client
### CHANGES

- Add `ModelClaudeHaiku4_5` to supported models
- Add `ModelClaudeHaiku4_5_20251001` to supported models
2025-12-08 08:21:18 +08:00
Kayvan Sylvan
4badfecadb feat: add multi-modal image support to Ollama client
## CHANGES

- Add base64 and io imports for image handling
- Store httpClient separately in Client struct for reuse
- Convert createChatRequest to return error for validation
- Implement convertMessage to handle multi-content chat messages
- Add loadImageBytes to fetch images from URLs
- Support base64 data URLs for inline images
- Handle HTTP image URLs with context propagation
- Replace debug print with proper debuglog usage
2025-12-08 07:48:36 +08:00
Kayvan Sylvan
894459ddec feat: add static model support and register Abacus provider
CHANGES

- feat: detect modelsURL starting with 'static:' and route
- feat: implement getStaticModels returning curated Abacus model list
- feat: register Abacus provider with ModelsURL 'static:abacus'
- chore: add fmt import for error formatting in provider code
- test: extend provider tests to include Abacus existence
- chore: update .vscode settings add 'kimi' and 'qwen' contributors
2025-12-04 21:22:57 +08:00
Kayvan Sylvan
4b080fd6dd feat: add Z AI provider and glm model support
- Add Z AI provider configuration to ProviderMap
- Include BaseURL for Z AI API endpoint
- Add test case for Z AI provider existence
- Add glm to OpenAI model prefixes list
- Reorder gpt-5 in model prefixes list
- Support new Z AI provider in OpenAI compatible plugins
2025-12-04 12:06:55 +08:00
Kayvan Sylvan
42fabab352 feat: improve model name matching in Ollama plugin
- Add "conceptmap" to VSCode dictionary settings
- Rename `ollamaPrefixes` variable to `ollamaSearchStrings`
- Replace `HasPrefix` with `Contains` for model matching
- Enable substring matching for Ollama model names
- chore: incoming 1847 changelog entry
2025-11-28 10:00:08 +08:00
Kayvan Sylvan
7eb67ee82d chore: update Go dependencies and add new Claude Opus 4.5 model support
- Upgrade anthropic-sdk-go from v1.16.0 to v1.19.0
- Bump golang.org/x/text from v0.28.0 to v0.31.0
- Update golang.org/x/crypto from v0.41.0 to v0.45.0
- Upgrade golang.org/x/net from v0.43.0 to v0.47.0
- Bump golang.org/x/sync from v0.16.0 to v0.18.0
- Update golang.org/x/sys from v0.35.0 to v0.38.0
- Add Claude Opus 4.5 model variants to Anthropic client
- chore: incoming 1845 changelog entry
2025-11-26 21:34:54 +08:00
Kayvan Sylvan
817e75853e fix: implement case-insensitive vendor and model name matching across the application
## CHANGES

- Add case-insensitive vendor lookup in VendorsManager
- Implement model name normalization in GetChatter method
- Add FilterByVendor method with case-insensitive matching
- Add FindModelNameCaseInsensitive helper for model queries
- Update group/item comparison to use case-insensitive checks
- Store vendors with lowercase keys internally
- Add comprehensive tests for case-insensitive functionality
- Fix vendor filtering for model listing command
2025-11-24 21:36:17 +08:00
Kayvan Sylvan
3c728cfacb feat: add GitHub Models provider and refactor model fetching with direct API fallback
- Add GitHub Models to supported OpenAI-compatible providers list
- Implement direct HTTP fallback for non-standard model responses
- Centralize model fetching logic in openai package
- Upgrade openai-go SDK dependency from v1.8.2 to v1.12.0
- Remove redundant model fetching code from openai_compatible package
- Add comprehensive GitHub Models setup documentation (700+ lines)
- Support custom models URL endpoint per provider configuration
- Add unit tests for direct model fetching functionality
- Update internationalization strings for model fetching errors
- Add VSCode dictionary entries for "azureml" and "Jamba"
2025-11-23 15:02:33 +07:00
Kayvan Sylvan
6708c7481b refactor: implement i18n support for YouTube tool error messages
CHANGES
- replace hardcoded error strings with i18n translation calls
- add localization keys for YouTube errors to all locale files
- introduce `extractAndValidateVideoId` helper to reduce code duplication
- update timestamp parsing logic to handle localized error formats
- standardize error handling in `yt-dlp` execution with i18n
- ensure rate limit and bot detection warnings use localized strings
2025-11-21 06:14:18 +07:00
Kayvan Sylvan
b7fa02d91e docs: clarify --raw flag behavior for OpenAI and Anthropic providers
- Update `--raw` flag description across all documentation files
- Clarify flag only affects OpenAI-compatible providers behavior
- Document Anthropic models use smart parameter selection
- Remove outdated reference to system/user role changes
- Update help text in CLI flags definition
- Translate updated description to all supported locales
- Update shell completion descriptions for zsh and fish
- chore: incoming 1836 changelog entry
2025-11-18 04:27:38 -08:00
Kayvan Sylvan
ca96c9c629 fix: improve channel management in Gemini streaming method
- Add deferred channel close at function start
- Return error immediately instead of breaking loop
- Remove redundant channel close statements from loop
- Ensure channel closes on all exit paths consistently
- chore: incoming 1832 changelog entry
2025-11-16 13:06:09 -08:00
Kayvan Sylvan
c936f8e77b feat: ensure newline in CreateOutputFile and improve tests
- Add newline to `CreateOutputFile` if missing
- Use `t.Cleanup` for file removal in tests
- Add test for message with trailing newline
- Introduce `printedStream` flag in `Chatter.Send`
- Print newline if stream printed without trailing newline
2025-11-16 11:15:47 -08:00
Kayvan Sylvan
729d092754 chore: improve message handling by trimming whitespace in content checks
### CHANGES

- Remove default space in `BuildSession` message content
- Trim whitespace in `anthropic` message content check
- Trim whitespace in `gemini` message content check
2025-11-14 21:13:08 -08:00
Kayvan Sylvan
d02a55ee01 feat: make YouTube API key optional in setup
- Change API key setup question to optional
- Add test for optional API key behavior
- Ensure plugin configuration without API key
- chore: incoming 1827 changelog entry
2025-11-13 23:44:41 -08:00
Kayvan Sylvan
4996832e64 Merge pull request #1802 from nickarino/input-extension-bug-fix
fix: improve template extension handling for {{input}} and add examples
2025-11-11 17:21:13 -08:00
Kayvan Sylvan
c7206c0a01 docs: minor formatting fixes 2025-11-11 17:16:55 -08:00
Kayvan Sylvan
73dec534c4 feat: update anthropic-sdk-go to v1.16.0 and update models
- Upgrade `anthropic-sdk-go` to version 1.16.0
- Remove outdated model `ModelClaude3_5SonnetLatest`
- Add new model `ModelClaudeSonnet4_5_20250929`
- Include `ModelClaudeSonnet4_5_20250929` in `modelBetas` map
2025-11-04 17:47:15 -08:00
Nick Skriloff
b8027582f4 docs: clarify extensions only work within patterns, not stdin
- Add prominent warning at top of Extensions guide with visual indicators
- Update main README with brief Extensions section and link to full guide
- Remove misleading examples showing direct piping to fabric
- Add clear examples:  what DOES NOT WORK vs  what WORKS
- Consolidate all extension documentation in Examples/README.md
- Explain technical reason: extensions only processed via ApplyTemplate()
- Prevents user confusion about extension syntax processing
2025-10-31 19:53:47 -04:00
Nick Skriloff
4b82534708 refactor: address PR review feedback
- Extract InputSentinel constant to shared constants.go file
- Remove duplicate inputSentinel definitions from template.go and patterns.go
- Create withTestExtension helper function to reduce test code duplication
- Refactor 3 test functions to use the helper (reduces ~40 lines per test)
- Fix shell script to use $@ instead of $* for proper argument quoting

Addresses review comments from @ksylvan and @Copilot AI
2025-10-31 13:27:38 -04:00
Nick Skriloff
eb1cfe8340 Complete merge from upstream/main 2025-10-30 21:13:46 -04:00
Changelog Bot
4f20f7a16b chore: incoming 1810 changelog entry 2025-10-28 07:29:34 -07:00
Anthony Metzidis
3211f6f35c improve subtitle lang, retry, debugging & error handling 2025-10-27 21:53:53 -07:00
Nick Skriloff
f8f9f6ba65 Update internal/plugins/template/Examples/openai.yaml
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-20 20:42:52 -04:00
Nick Skriloff
29c24c8387 fix: improve template extension handling for {{input}} and add examples 2025-10-20 19:49:33 -04:00
Kayvan Sylvan
94e8d69dac feat: update anthropic-sdk-go to v1.13.0 and add new model
- Upgrade `anthropic-sdk-go` to version 1.13.0
- Add `ModelClaudeSonnet4_5` to supported models list
2025-09-30 06:49:39 -07:00
Kayvan Sylvan
4715440652 fix: improve PT-BR translation naturalness and fluency
- Thanks to @JuracyAmerico for Brazilian Portugese native speaker expertise!
- Replace "dos" with "entre" for better preposition usage
- Add definite articles where natural in Portuguese
- Clarify "configurações padrão" instead of just "padrões"
- Keep technical terms visible like "padrões/patterns"
- Remove unnecessary quotes around "URL"
- Make phrasing more natural "Exportar para arquivo"
2025-09-24 07:52:31 -07:00
Kayvan Sylvan
b34112d7ed feat(i18n): add i18n support for language variants (pt-BR/pt-PT)
• Add Brazilian Portuguese (pt-BR) translation file
• Add European Portuguese (pt-PT) translation file
• Implement BCP 47 locale normalization system
• Create fallback chain for language variants
• Add default variant mapping for Portuguese
• Update help text to show variant examples
• Add comprehensive test suite for variants
• Create documentation for i18n variant architecture
2025-09-21 16:04:59 -07:00
Kayvan Sylvan
3a42fa7ece feat: migrate Azure client to openai-go/azure and default API version
CHANGES
- switch Azure OpenAI config to openai-go azure helpers
- require API key and base URL during configuration
- default API version to 2024-05-01-preview when unspecified
- trim and parse deployments input into clean slice
- update dependencies to support azure client and authentication flow
- add tests for configuration and default API version behavior
- remove latest-tag boundary logic from changelog walker (revert to the v1.4.213 version)
- simplify version assignment by matching commit messages directly
2025-09-18 15:50:36 -07:00
Kayvan Sylvan
c4e6cb370f feat(i18n): add de/fr/ja/pt/zh/fa locales; expand tests, improve changelog spacing
CHANGES
- Add DE, FR, JA, PT, ZH, FA i18n locale files.
- Expand i18n tests with table-driven multilingual coverage.
- Verify 'html_readability_error' translations across all supported languages.
- Update README with release notes for added languages.
- Watch new locale and test files in VSCode.
- Insert blank lines between aggregated PR changelog sections.
- Append direct commits section only when content exists.
2025-09-13 08:23:40 -07:00
Kayvan Sylvan
78280810f4 feat: add Windows-style forward slash flag support to CLI argument parser
- Add runtime OS detection for Windows platform
- Support `/flag` syntax for Windows command line
- Handle Windows colon delimiter `/flag:value` format
- Maintain backward compatibility with Unix-style flags
- Add comprehensive test coverage for flag extraction
- Support both `:` and `=` delimiters on Windows
- Preserve existing dash-based flag parsing logic
2025-09-10 06:30:20 -07:00
Kayvan Sylvan
651c5743f1 feat: add comprehensive internationalization support with English and Spanish locales
- Replace hardcoded strings with i18n.T translations
- Add en and es JSON locale files
- Implement custom translated help system
- Enable language detection from CLI args
- Add locale download capability
- Localize error messages throughout codebase
- Support TTS and notification translations
2025-09-09 09:34:54 -07:00
Kayvan Sylvan
20080fcb78 feat: add i18n support with Spanish localization and documentation improvements
- Add internationalization system with Spanish support
- Create contexts and sessions tutorial documentation
- Fix broken Warp sponsorship image URL
- Add locale detection from environment variables
- Update VSCode settings with new dictionary words
- Exclude VSCode settings from version workflows
- Update pattern descriptions and explanations
- Add comprehensive i18n test coverage
2025-09-08 09:17:23 -07:00
Kayvan Sylvan
4008125e37 refactor: replace stderr prints with centralized debuglog.Log and improve auth messaging
- Replace fmt.Fprintf/os.Stderr with centralized debuglog.Log across CLI
- Add unconditional Log function to debuglog for important messages
- Improve OAuth flow messaging and token refresh diagnostics
- Update tests to capture debuglog output via SetOutput
- Convert Perplexity streaming errors to unified debug logging
- Emit file write notifications through debuglog instead of stderr
- Warn on ambiguous model selection using centralized logger
- Announce large audio processing steps via debuglog progress messages
- Standardize extension registry and patterns warnings through debuglog
2025-08-25 20:09:55 -07:00
Kayvan Sylvan
772337bf0d refactor: route Anthropic beta failure logs through internal debug logger
CHANGES
- Replace fmt.Fprintf stderr with debuglog.Debug for beta failures
- Import internal log package and remove os dependency
- Standardize logging level to debuglog.Basic for beta errors
- Preserve fallback stream behavior when beta features fail
- Maintain message send fallback when beta options fail
2025-08-24 13:10:57 -07:00