@pmcollab/coworkstream-engine-anthropic
v0.1.0
Published
Anthropic Claude AgentRunner adapter for @pmcollab/coworkstream-engine.
Readme
@pmcollab/coworkstream-engine-anthropic
Coding agents: read
packages/workstream-engine/AGENTS.mdfor the engine integration recipe before wiring this adapter. Migrating an existing setup? Seepackages/workstream-engine/MIGRATION.md.
Anthropic Claude AgentRunner adapter for @pmcollab/coworkstream-engine.
Install
npm install @pmcollab/coworkstream-engine-anthropic @anthropic-ai/sdkUse
import Anthropic from '@anthropic-ai/sdk'
import { createEngine, weightedVote, createMemoryStore, createMemoryTrustModel } from '@pmcollab/coworkstream-engine'
import { createAnthropicAgent } from '@pmcollab/coworkstream-engine-anthropic'
const client = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY })
const engine = createEngine({
agents: [
createAnthropicAgent({
id: 'risk',
client,
model: 'claude-sonnet-4-6',
system: 'You are a risk reviewer. Evaluate proposed actions for risk to revenue.',
}),
createAnthropicAgent({
id: 'finance',
client,
model: 'claude-haiku-4-5',
system: 'You are a finance reviewer. Evaluate cost and budget impact.',
}),
],
alignmentStrategy: weightedVote(),
store: createMemoryStore(),
trustModel: createMemoryTrustModel(),
})
await engine.process({ id: 'i1', category: 'decision', title: 'Discount: Globex Q4' })How it works
- The adapter ships a
respondtool that the model uses to record its decision (position, reasoning, confidence). - Position is taken from the tool's
positionargument (preferred) or extracted from the model's text output (fallback). confidencedefaults to 0.7 when the model returns text instead of using the tool.
Options
createAnthropicAgent({
id, // required
client, // Anthropic SDK instance, required
name?, avatar?, capabilities?,
model?: string, // default 'claude-sonnet-4-6'
system?: string,
maxTokens?: number, // default 1024
defaultConfidence?: number, // default 0.7
formatItem?: (item, ctx) => string,
extraTools?: AnthropicTool[],
})License
Commercial. See LICENSE in the repository root.
