feat: add CLI settings export/import functionality

- Implemented exportSettings and importSettings APIs for CLI settings.
- Added hooks useExportSettings and useImportSettings for managing export/import operations in the frontend.
- Updated SettingsPage to include buttons for exporting and importing CLI settings.
- Enhanced backend to handle export and import requests, including validation and conflict resolution.
- Introduced new data structures for exported settings and import options.
- Updated localization files to support new export/import features.
- Refactored CLI tool configurations to remove hardcoded model defaults, allowing dynamic model retrieval.
This commit is contained in:
catlog22
2026-02-25 21:40:24 +08:00
parent 4c2bf31525
commit b2b8688d26
24 changed files with 1287 additions and 651 deletions

View File

@@ -335,11 +335,15 @@ export class CliSessionManager {
}
// Merge endpoint env vars with process.env (endpoint overrides process.env)
const spawnEnv: Record<string, string> = {
const spawnEnv: Record<string, string | undefined> = {
...(process.env as Record<string, string>),
...endpointEnv,
};
// Unset CLAUDECODE to allow nested Claude Code sessions (SDK/subagent use case)
// See: https://github.com/anthropics/claude-agent-sdk-python/issues/573
delete spawnEnv.CLAUDECODE;
let pty: nodePty.IPty;
try {
pty = nodePty.spawn(file, args, {