Commit fa5307a
feat(agents): modular SDK runtimes + Anthropic fixes + OpenCode SDK (#293)
* feat: add anthropic-sdk agent type for web/API-key-based usage
- Add 'anthropic-sdk' to AgentType union
- Add apiKey field to AgentRunOptions and LoopOptions
- Implement runAnthropicSdkAgent using @anthropic-ai/sdk with streaming
- Update detectAvailableAgents/detectBestAgent to accept apiKeys option
- SDK agents are available when API key is provided (no CLI binary needed)
- Enables ralph-starter usage in web applications without CLI dependencies
Amp-Thread-ID: https://ampcode.com/threads/T-019ce458-6e75-7448-b1cd-1839264ca386
Co-authored-by: Amp <amp@ampcode.com>
* chore: release v0.4.4
Amp-Thread-ID: https://ampcode.com/threads/T-019ce458-6e75-7448-b1cd-1839264ca386
Co-authored-by: Amp <amp@ampcode.com>
* fix: update agent test to expect 7 agents (includes anthropic-sdk)
Amp-Thread-ID: https://ampcode.com/threads/T-019ce458-6e75-7448-b1cd-1839264ca386
Co-authored-by: Amp <amp@ampcode.com>
* fix: anthropic-sdk agent with proper tool-use loop
- Add file tools (read_file, write_file, list_directory, run_command)
- Implement multi-turn tool-use loop so agent can actually edit files
- Fix timeout: pass as RequestOptions (2nd arg), not in message body
- Fix max_tokens: use fixed 16384 instead of deriving from maxTurns
- Fix system prompt: accurately describes tool capabilities
Amp-Thread-ID: https://ampcode.com/threads/T-019ce458-6e75-7448-b1cd-1839264ca386
Co-authored-by: Amp <amp@ampcode.com>
* fix: buffer onOutput to emit complete lines, matching CLI agent contract
Amp-Thread-ID: https://ampcode.com/threads/T-019ce458-6e75-7448-b1cd-1839264ca386
Co-authored-by: Amp <amp@ampcode.com>
* fix: security hardening for anthropic-sdk agent
- Prevent path traversal: resolve + realpath guard on all file tools
- Gate run_command behind allowShellExecution option (default: false)
- Exclude run_command from tool list entirely when shell disabled
- Use remaining time budget for per-request timeout instead of full value
Amp-Thread-ID: https://ampcode.com/threads/T-019ce458-6e75-7448-b1cd-1839264ca386
Co-authored-by: Amp <amp@ampcode.com>
* feat(agents): modularize SDK runtimes and add opencode-sdk
Amp-Thread-ID: https://ampcode.com/threads/T-019ce48e-f36c-74d2-abf4-e980f10d7bdf
Co-authored-by: Amp <amp@ampcode.com>
* fix: address greptile env fragility and model warning
Amp-Thread-ID: https://ampcode.com/threads/T-019ce48e-f36c-74d2-abf4-e980f10d7bdf
Co-authored-by: Amp <amp@ampcode.com>
* fix(agents): harden opencode event flow and anthropic command execution
Amp-Thread-ID: https://ampcode.com/threads/T-019ce48e-f36c-74d2-abf4-e980f10d7bdf
Co-authored-by: Amp <amp@ampcode.com>
* fix(opencode-sdk): stream events and provider-aware auth handling
Amp-Thread-ID: https://ampcode.com/threads/T-019ce48e-f36c-74d2-abf4-e980f10d7bdf
Co-authored-by: Amp <amp@ampcode.com>
* fix: address minor greptile feedback on execa and sdk availability
Amp-Thread-ID: https://ampcode.com/threads/T-019ce48e-f36c-74d2-abf4-e980f10d7bdf
Co-authored-by: Amp <amp@ampcode.com>
* fix(opencode-sdk): prevent duplicate text output after delta streaming
Amp-Thread-ID: https://ampcode.com/threads/T-019ce48e-f36c-74d2-abf4-e980f10d7bdf
Co-authored-by: Amp <amp@ampcode.com>
* fix(opencode-sdk): guard stream promise rejections
Amp-Thread-ID: https://ampcode.com/threads/T-019ce4df-e4cc-77c7-b880-50cdc69cd3db
Co-authored-by: Amp <amp@ampcode.com>
* fix(sdk-agents): honor apiKey fallback and preserve command streams
Amp-Thread-ID: https://ampcode.com/threads/T-019ce4df-e4cc-77c7-b880-50cdc69cd3db
Co-authored-by: Amp <amp@ampcode.com>
---------
Co-authored-by: Amp <amp@ampcode.com>1 parent 2b3385a commit fa5307a
File tree
10 files changed
+944
-216
lines changed- src
- loop
- __tests__
- agents
10 files changed
+944
-216
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| |||
415 | 418 | | |
416 | 419 | | |
417 | 420 | | |
418 | | - | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
419 | 425 | | |
420 | 426 | | |
421 | 427 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
| |||
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
62 | 84 | | |
63 | 85 | | |
64 | 86 | | |
| |||
89 | 111 | | |
90 | 112 | | |
91 | 113 | | |
| 114 | + | |
92 | 115 | | |
93 | 116 | | |
94 | 117 | | |
95 | | - | |
| 118 | + | |
96 | 119 | | |
97 | 120 | | |
98 | 121 | | |
| |||
0 commit comments