feat: introduce opus 4.7 (#682)

* feat: introduce opus 4.7
- Bump claude-agent-sdk from 0.2.59 to 0.2.116
- Forward process.env to SDK subprocess so ANTHROPIC_BASE_URL and other env vars work
- Add claude-opus-4-6 as a distinct mode

* feat: add "claude" as fallback in the cli path

* fix: base url config
This commit is contained in:
Simos Mikelatos
2026-04-21 18:26:25 +02:00
committed by GitHub
parent 09dd407648
commit c5e55adc89
5 changed files with 717 additions and 331 deletions

View File

@@ -149,9 +149,15 @@ function mapCliOptionsToSDK(options = {}) {
const sdkOptions = {};
if (process.env.CLAUDE_CLI_PATH) {
sdkOptions.pathToClaudeCodeExecutable = process.env.CLAUDE_CLI_PATH;
}
// Forward all host env vars (e.g. ANTHROPIC_BASE_URL) to the subprocess.
// Since SDK 0.2.113, options.env replaces process.env instead of overlaying it.
sdkOptions.env = { ...process.env };
// Use CLAUDE_CLI_PATH if explicitly set, otherwise fall back to 'claude' on PATH.
// The SDK 0.2.113+ looks for a bundled native binary optional dep by default;
// this fallback ensures users who installed via the official installer still work
// even when npm prune --production has removed those optional deps.
sdkOptions.pathToClaudeCodeExecutable = process.env.CLAUDE_CLI_PATH || 'claude';
// Map working directory
if (cwd) {

View File

@@ -4,10 +4,13 @@
"module": "NodeNext",
"moduleResolution": "NodeNext",
"lib": ["ES2022"],
"baseUrl": ".",
// baseUrl is the project root (one level above this config file) so that tsc-alias
// resolves @/ imports relative to the compiled output structure in dist-server/server/.
// With rootDir ".." tsc emits server files under dist-server/server/, so paths must
// include the "server/" prefix to match that layout.
"baseUrl": "..",
"paths": {
// In the backend config, "@" maps to the /server directory itself.
"@/*": ["*"]
"@/*": ["server/*"]
},
// The backend is still mostly JavaScript today, so allowJs lets us add a real
// TypeScript build without forcing a large rename before the tooling is usable.