Commit Graph

7 Commits

Author SHA1 Message Date
Leandro Barbosa
f6362ce7b1 feat: add cli-based LLM provider
Add ClaudeCliProvider that executes the local CLI as a subprocess,
enabling PicoClaw to leverage advanced capabilities (MCP tools,
workspace awareness, session management) through any messaging channel.

- Implement LLMProvider interface via subprocess execution
- Support --system-prompt, --model, --output-format json flags
- Parse real v2.x JSON response format including usage tokens
- Handle error responses, stderr, context cancellation
- Register "claude-cli", "claude-code", "claudecode" aliases in CreateProvider
- 56 unit tests with mock scripts + 3 integration tests against real binary
- 100% coverage on all functions except stripToolCallsJSON (85.7%)
2026-02-12 11:51:51 -03:00
mxrain
a9a7a89c07 feat: add Moonshot/Kimi and NVIDIA provider support with proxy 2026-02-12 22:39:38 +08:00
Wutachi
f4a8ff7571 Add provider field support for explicit provider selection
- Add Provider field to AgentDefaults struct
- Modify CreateProvider to use explicit provider field first, fallback to model name detection
- Allows using models without provider prefix (e.g., llama-3.1-8b-instant instead of groq/llama-3.1-8b-instant)
- Supports all providers: groq, openai, anthropic, openrouter, zhipu, gemini, vllm
- Backward compatible with existing configs

Fixes issue where models without provider prefix could not use configured API keys.
2026-02-12 01:01:23 -03:00
Cory LaNou
fbad753b2a feat(providers): add SDK-based providers for subscription OAuth login
Add ClaudeProvider (anthropic-sdk-go) and CodexProvider (openai-go) that
use the correct subscription endpoints and API formats:

- CodexProvider: chatgpt.com/backend-api/codex/responses (Responses API)
  with OAuth Bearer auth and Chatgpt-Account-Id header
- ClaudeProvider: api.anthropic.com/v1/messages (Messages API) with
  Authorization: Bearer token auth

Update CreateProvider() routing to use new SDK-based providers when
auth_method is "oauth" or "token", removing the stopgap that sent
subscription tokens to pay-per-token endpoints.

Closes #18

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 13:27:59 -06:00
Cory LaNou
5efe8a2020 feat(auth): add OAuth and token-based login for OpenAI and Anthropic
Add `picoclaw auth` CLI command supporting:
- OpenAI OAuth2 (PKCE + browser callback or device code flow)
- Anthropic paste-token flow
- Token storage at ~/.picoclaw/auth.json with 0600 permissions
- Auto-refresh for expired OAuth tokens in provider

Closes #18

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 11:41:13 -06:00
Only_Xianzo
6ccd9d0a99 Fix: prioritize explicit provider prefixes and update max_tokens schema 2026-02-11 22:49:47 +08:00
lxowalle
e17693b17c * First commit 2026-02-09 19:20:19 +08:00