feat(global-env): add global environment variables injection for third-party profiles

- add global_env config section to unified config types and loader

- inject global env vars at runtime for cliproxy and copilot profiles

- add GET/PUT /api/global-env endpoints for UI management

- add Global Env tab to Settings page with enable toggle and var management

- add GlobalEnvIndicator component showing injected vars in profile editors

- support ?tab=globalenv query param for direct navigation from indicators
This commit is contained in:
kaitranntt committed 2025-12-18 22:38:25 -05:00
1 parent 25cfb5b65e
commit 5d343260c7
11 files changed
+1091 -353

No files matched your search

+5
View File
@@ -11,6 +11,7 @@ import {
displayWebSearchStatus,
getWebSearchHookEnv,
} from './utils/websearch-manager';
import { getGlobalEnvConfig } from './config/unified-config-loader';
// Import extracted command handlers
import { handleVersionCommand } from './commands/version-command';
@@ -494,7 +495,11 @@ async function main(): Promise<void> {
// Use --settings flag (backward compatible)
const expandedSettingsPath = getSettingsPath(profileInfo.name);
const webSearchEnv = getWebSearchHookEnv();
// Get global env vars (DISABLE_TELEMETRY, etc.) for third-party profiles
const globalEnvConfig = getGlobalEnvConfig();
const globalEnv = globalEnvConfig.enabled ? globalEnvConfig.env : {};
const envVars: NodeJS.ProcessEnv = {
...globalEnv,
...webSearchEnv,
CCS_PROFILE_TYPE: 'settings', // Signal to WebSearch hook this is a third-party provider
};