Skip to content

feat(OnlyAgent): add Claude (Anthropic) as AI provider - #204

Merged
jacklandrin merged 1 commit into
jacklandrin:mainfrom
lou1s19:feature/claude-provider
Jun 28, 2026
Merged

feat(OnlyAgent): add Claude (Anthropic) as AI provider#204
jacklandrin merged 1 commit into
jacklandrin:mainfrom
lou1s19:feature/claude-provider

Conversation

@lou1s19

@lou1s19 lou1s19 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Claude (Anthropic) as a fourth AI provider in Only Agent, alongside Ollama, OpenAI, Codex and Gemini.

Changes

New — ClaudeSettings/ module:

  • ClaudeService.swift — SSE streaming via URLSession against api.anthropic.com/v1/messages
  • ClaudeSettingReducer.swift — TCA reducer (appear / check / getModels / verify)
  • ClaudeSettingView.swift — API key input + Check button + model list
  • ClaudeTool.swift, ClaudeDataModels.swift, ClaudeSharedKey.swift — tool wrapper, model type, Keychain storage
  • claude.imageset/ — tab icon

Modified:

  • ModelTool.swiftcase claude in ModelProvider
  • ModelProviderService.swiftClaudeLive wired into all switch statements
  • AgentCommand.swift.claude: ClaudeTool() branch
  • ModelProviderSettingView.swift — Claude tab + content case
  • UserDefaultsKeys.swiftclaudeAPI key constant
  • ProviderModelsResponse.swiftcase claude + ("anthropic", "claude") mapping
  • models.jsonclaude-opus-4-8, claude-sonnet-4-6, claude-haiku-4-5-20251001

API

Endpoint https://api.anthropic.com/v1/messages
Auth x-api-key header
Version anthropic-version: 2023-06-01
Streaming SSE content_block_delta / text_delta
No new dependency uses URLSession directly

Test plan

  • Valid API key → Check shows ✅
  • Invalid key → ❌
  • Claude model selected → agent command streams response correctly
  • Existing providers unaffected

- Add ClaudeLive service using URLSession SSE streaming against
  https://api.anthropic.com/v1/messages with x-api-key and
  anthropic-version headers
- Add ClaudeSettingReducer (TCA), ClaudeSettingView, ClaudeTool,
  ClaudeDataModels and ClaudeSharedKey (Keychain storage)
- Register .claude case in ModelProvider enum and wire all switch
  statements in ModelProviderService, AgentCommand and
  ModelProviderSettingView
- Add claude.imageset to Assets catalog
- Add claude models (claude-opus-4-8, claude-sonnet-4-6,
  claude-haiku-4-5-20251001) to models.json and extend
  RemoteModelProviderKey / ProviderModelsResponse accordingly
@jacklandrin
jacklandrin merged commit 1cf4adb into jacklandrin:main Jun 28, 2026
@lou1s19

lou1s19 commented Jul 1, 2026 via email

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants