Files
openprose__prose/packages/reactor-cli/package.json
dan 6b49de5221 feat(reactor-cli): route provider: anthropic through native Messages API (#113)
Anthropic's OpenAI-compat endpoint is documented as testing-only and ignores
response_format, so it rejects Reactor's JSON-schema structured outputs with
400 response_format.json_schema.strict. That made `provider: anthropic` a
footgun for the structured compile/render path (compile + render are both
structured, and renders drive tools).

Route the built-in `anthropic` provider through the official @openai/agents
AI-SDK adapter over @ai-sdk/anthropic (native Messages API), where structured
outputs and tools both work. Mechanism:

- ProviderPlan gains a keyless `transport` discriminator (openai-compat |
  anthropic-native); the anthropic built-in resolves to anthropic-native. The
  module stays keyless, so the offline boundary holds.
- live-provider builds an AI-SDK-backed ModelProvider for that transport; every
  other vendor keeps the scoped OpenAIProvider compat path. Both are scoped (no
  global mutation). The compile/run/serve call sites are unchanged.
- doctor --live smokes the native provider for an anthropic project.
- A new gated live test drives a structured render + tool through the native
  adapter (proven live: structured output parsed + tool called); it offline-skips
  like every live test. The reactor BYO live test notes the compat subtest is
  plain-text reachability only.

Bundles @openai/agents-extensions, ai, @ai-sdk/anthropic as CLI deps so an
installed reactor needs no extra setup. reactor-cli 0.2.1 -> 0.2.2.
2026-06-03 12:12:45 -07:00

59 lines
1.4 KiB
JSON

{
"name": "@openprose/reactor-cli",
"version": "0.2.2",
"repository": {
"type": "git",
"url": "git+https://github.com/openprose/prose.git",
"directory": "packages/reactor-cli"
},
"license": "MIT",
"type": "commonjs",
"description": "Deterministic command-line driver for the @openprose/reactor SDK.",
"main": "dist/cli.js",
"bin": {
"reactor": "dist/cli.js"
},
"engines": {
"node": ">=20"
},
"files": [
"dist",
"README.md",
"examples"
],
"scripts": {
"build": "rm -rf dist && tsc -p tsconfig.build.json",
"prepack": "pnpm build",
"build:test": "rm -rf dist-test && tsc -p tsconfig.test.json",
"typecheck": "tsc --noEmit -p tsconfig.json",
"test:runtime": "pnpm build:test && node --test $(find dist-test -name '*.test.js' -type f | sort)",
"test": "pnpm typecheck && pnpm test:runtime",
"test:offline": "REACTOR_OFFLINE=1 pnpm test",
"prepublishOnly": "pnpm build"
},
"dependencies": {
"@ai-sdk/anthropic": "3.0.81",
"@openai/agents-extensions": "0.11.6",
"@openprose/reactor": "workspace:*",
"ai": "6.0.195",
"commander": "^12.0.0"
},
"peerDependencies": {
"@openai/agents": "*",
"zod": "*"
},
"peerDependenciesMeta": {
"@openai/agents": {
"optional": true
},
"zod": {
"optional": true
}
},
"devDependencies": {
"@openprose/reactor": "workspace:*",
"@types/node": "^22.10.7",
"typescript": "^5.6.3"
}
}