Split translation providers into six presets; fix popup version - #8
Merged
Conversation
- add a native Anthropic provider built on @anthropic-ai/sdk: Claude Messages API with SSE streaming into the existing TR_TRANSLATE_PARTIAL pipeline, typed error mapping, and free count-tokens validation; default model claude-opus-4-8, editable in Options - flatten DeepSeek and OpenAI out of the generic OpenAI-compatible provider into first-class presets with pinned base URLs and default models (deepseek-chat / gpt-4o-mini) — only an API key is required; the generic provider remains as "Custom" for any compatible endpoint - provider picker now offers Google, DeepL, Anthropic, DeepSeek, OpenAI, and Custom, each with its own glyph; popup readiness/summary logic understands the fixed-endpoint presets - add api.anthropic.com / api.deepseek.com / api.openai.com host permissions - popup header version was hardcoded as v0.1 — now reads chrome.runtime.getManifest().version Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
The provider picker now offers six providers instead of three:
@anthropic-ai/sdkclaude-opus-4-8(editable)api.deepseek.comdeepseek-chat(editable)api.openai.com/v1gpt-4o-mini(editable)Anthropic provider
@anthropic-ai/sdk(browser mode in the MV3 service worker; host permission scopes the origin)TR_TRANSLATE_PARTIALpipeline, so Claude subtitle translations render token-by-token like DeepSeektemperaturesent (removed on Opus 4.7+ — would 400); typed SDK error classes mapped to the existingTranslationErrorcodes;refusalstop reason surfaced as an error instead of an empty translationcount_tokensendpoint (checks both key and model id)claude-opus-4-8; for faster/cheaper subtitle translation users can setclaude-haiku-4-5in the model fieldDeepSeek / OpenAI presets
Misc
api.anthropic.com,api.deepseek.com,api.openai.comv0.1; it now readschrome.runtime.getManifest().versionValidation
pnpm type-check,pnpm lint, content-script tests (25),pnpm buildall green; built manifest carries the new host permissions and the popup bundle no longer contains the hardcoded versiontemperaturein the request body)🤖 Generated with Claude Code