Files
dan 0061ca35f1 feat(reactor-cli): configurable LLM provider + accurate cost labels (#109)
Reactor was hard-wired to OpenRouter on the CLI (only OPENROUTER_API_KEY was
ever read), stranding users holding OpenAI / Anthropic / Google keys. The SDK
already supported a scoped provider; this makes it real and elegant at the CLI.

reactor-cli (0.2.0 -> 0.2.1):
- reactor.yml model.provider now switches the live provider; built-ins
  openrouter|openai|anthropic|google resolve their endpoint + key env, and any
  OpenAI-compatible vendor works via model.base_url + model.api_key_env.
- A keyless ProviderPlan resolver + a model-bearing OpenAIProvider factory
  (reached only past the dynamic-import offline boundary), threaded into compile
  sessions and the run/serve render (incl. the configured render_model, which
  the run phase previously ignored).
- doctor reports the configured provider's key (not only OPENROUTER_API_KEY) and
  doctor --live smokes the configured endpoint; a missing key fails non-zero with
  the exact env var (never misdirects to OpenRouter, never exits 0).
- Tests: ProviderPlan resolver + a hermetic missing-key compile.

reactor (0.3.0 -> 0.3.1):
- Receipt Cost now reports the real provider + model instead of a hardcoded
  openrouter / gemini-3.5-flash (cost-only labels, never fingerprinted). New
  optional RunProjectRender.providerLabel + CostLabels.
- Tests: cost-labels + a key-gated bring-your-own-provider live smoke.

Build: each reactor package cleans its output dir before tsc, so local
incremental builds cannot accumulate orphaned dist test artifacts.

Known limitation: Anthropic's direct OpenAI-compat endpoint rejects our
structured-output response_format unless strict:true; route Anthropic models
through OpenRouter today (documented).
2026-06-02 23:15:00 -07:00

100 lines
2.6 KiB
JSON

{
"name": "@openprose/reactor",
"version": "0.3.1",
"description": "OpenProse Reactor runtime: fresh model spend scales with surprise, not the clock.",
"type": "commonjs",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"typesVersions": {
"*": {
"agents": ["./dist/agents/index.d.ts"],
"adapters": ["./dist/adapters/index.d.ts"],
"run": ["./dist/run/index.d.ts"],
"run/types": ["./dist/run/types.d.ts"],
"internals": ["./dist/internals/index.d.ts"]
}
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./agents": {
"types": "./dist/agents/index.d.ts",
"default": "./dist/agents/index.js"
},
"./adapters": {
"types": "./dist/adapters/index.d.ts",
"default": "./dist/adapters/index.js"
},
"./run": {
"types": "./dist/run/index.d.ts",
"default": "./dist/run/index.js"
},
"./run/types": {
"types": "./dist/run/types.d.ts",
"default": "./dist/run/types.js"
},
"./internals": {
"types": "./dist/internals/index.d.ts",
"default": "./dist/internals/index.js"
},
"./package.json": "./package.json"
},
"files": [
"dist/**/*.js",
"dist/**/*.d.ts",
"dist/**/*.d.ts.map",
"!dist/**/__tests__/**",
"!dist/**/*.test.js",
"!dist/**/*.test.d.ts",
"!dist/**/*.test.d.ts.map",
"skill/**",
"ADOPTION.md",
"EVALS.md",
"README.md"
],
"sideEffects": false,
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/openprose/prose.git",
"directory": "packages/reactor"
},
"scripts": {
"build": "rm -rf dist && tsc -p tsconfig.build.json",
"bundle-skill": "node scripts/bundle-skill.mjs",
"prepack": "pnpm build && node scripts/bundle-skill.mjs",
"typecheck": "tsc --noEmit -p tsconfig.json",
"test:runtime": "pnpm build && node --test $(find dist -name '*.test.js' -type f | sort)",
"test": "pnpm typecheck && pnpm test:runtime",
"test:offline": "REACTOR_OFFLINE=1 pnpm test"
},
"peerDependencies": {
"@openai/agents": "^0.11.6",
"zod": "^4.0.0"
},
"peerDependenciesMeta": {
"@openai/agents": {
"optional": true
},
"zod": {
"optional": true
}
},
"devDependencies": {
"@openai/agents": "^0.11.6",
"@openai/agents-openai": "^0.11.6",
"@types/node": "^22.10.7",
"typescript": "^5.9.3",
"zod": "^4.0.0"
},
"publishConfig": {
"access": "public",
"provenance": true
},
"engines": {
"node": ">=20.0.0"
}
}