mirror of
https://github.com/openprose/prose.git
synced 2026-09-19 05:55:05 +08:00
08f41ac3f2
Add @openprose/reactor-cli: a Commander-based CLI (reactor --help/--version) with a `doctor` command and an offline-safe entrypoint. - package.json: bin reactor -> dist/cli.js; @openprose/reactor as a peer; @openai/agents + zod as OPTIONAL peers (peerDependenciesMeta optional:true, not optionalDependencies). test:runtime mirrors the SDK's `node --test $(find dist -name '*.test.js' ...)` (node:test, not vitest). - tsconfig + tsconfig.build.json mirror the SDK (CommonJS); build compiles tests so dist/**/*.test.js exists for the runtime suite. - cli.ts static-imports only keyless modules. env.ts reimplements isOfflineForced/hasOpenRouterKey locally so the model-bearing agent-render/provider.ts never lands on the offline path; it reads OPENROUTER_API_KEY from env then walks up for a .env (no dev-only abs path). - doctor reports node version (floor 20, matching SDK engines), SDK resolvability+version (require.resolve, no barrel execution), live-key presence, optional live-dep presence (probed lazily, never static-imported), and offline mode. Exit 0 = healthy-for-offline. - Tests (node:test): arg parsing, doctor behavior, and a spawn-based offline boundary test asserting @openai/agents and zod are NOT in require.cache after loading the compiled entrypoint, plus zero-env doctor/--version/--help. CLI offline: 18/0/0. SDK test:offline unchanged at 411/0/7 (418 total). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
21 lines
477 B
JSON
21 lines
477 B
JSON
{
|
|
"compilerOptions": {
|
|
"target": "ES2021",
|
|
"module": "CommonJS",
|
|
"moduleResolution": "Node",
|
|
"lib": ["ES2021"],
|
|
"declaration": true,
|
|
"declarationMap": true,
|
|
"sourceMap": true,
|
|
"outDir": "./dist",
|
|
"rootDir": "./src",
|
|
"strict": true,
|
|
"esModuleInterop": true,
|
|
"skipLibCheck": true,
|
|
"forceConsistentCasingInFileNames": true,
|
|
"resolveJsonModule": true
|
|
},
|
|
"include": ["src/**/*"],
|
|
"exclude": ["node_modules", "dist"]
|
|
}
|