@stratusagent/provider-anthropic 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# @stratusagent/provider-anthropic
|
|
2
|
+
|
|
3
|
+
The Claude provider for [Stratus Agent](https://github.com/stratuslabs/agent), built on the official `@anthropic-ai/sdk`.
|
|
4
|
+
|
|
5
|
+
- **Multi-turn tool calling** — advertises kernel tools with wire-safe names, parses `tool_use` blocks, and replays results as `tool_result` blocks.
|
|
6
|
+
- **Persona and memory** — the agent's identity and long-term memory are rendered as the system prompt, so an agent is the same person on every provider.
|
|
7
|
+
- **Adaptive thinking, handled correctly** — `claude-opus-5` (the default) thinks adaptively; the thinking blocks that precede tool calls are persisted in session metadata and replayed verbatim, surviving tool waits, provider restarts, and resuming a session in another process. Use `redactAnthropicRawTurns(session)` before showing a session to people — replay state is never meant to be displayed.
|
|
8
|
+
- **Auth** — an Anthropic API key (`apiKey`), or an OAuth bearer token (`authToken`). Note: Claude Pro/Max setup tokens are only honored by Anthropic inside the Claude Code harness, so they do not work against the raw Messages API this provider calls — subscription-billed runs land with the Claude Agent SDK provider ([stratuslabs/agent#25](https://github.com/stratuslabs/agent/issues/25)). Use an API key today.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import { createAnthropicProvider } from '@stratusagent/provider-anthropic';
|
|
14
|
+
|
|
15
|
+
const provider = createAnthropicProvider({
|
|
16
|
+
apiKey: process.env.ANTHROPIC_API_KEY,
|
|
17
|
+
model: 'claude-opus-5', // default
|
|
18
|
+
});
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Pass the provider to `AgentRunner` from `@stratusagent/core` and it handles the loop: tools are executed locally and results are fed back to Claude until the model answers in plain text.
|
|
22
|
+
|
|
23
|
+
Options: `model`, `maxTokens` (default 4096), `systemPrompt`, `baseUrl`, `thinking: 'disabled'`, and an injectable `fetch` for tests.
|
|
24
|
+
|
|
25
|
+
Most users won't wire this directly — `@stratusagent/cli` sets it up from a menu: `npm i -g @stratusagent/cli && stratus setup`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stratusagent/provider-anthropic",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@anthropic-ai/sdk": "^0.70.0",
|
|
18
|
-
"@stratusagent/core": "0.2.
|
|
18
|
+
"@stratusagent/core": "0.2.1"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/node": "^24.6.0",
|