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

+7 -1
View File
@@ -7,6 +7,7 @@
import { spawn } from 'child_process';
import { CopilotConfig } from '../config/unified-config-types';
import { getGlobalEnvConfig } from '../config/unified-config-loader';
import { checkAuthStatus, isCopilotApiInstalled } from './copilot-auth';
import { isDaemonRunning, startDaemon } from './copilot-daemon';
import { ensureCopilotApi } from './copilot-package-manager';
@@ -127,9 +128,14 @@ export async function executeCopilotProfile(
// Generate environment for Claude
const copilotEnv = generateCopilotEnv(config);
// Merge with current environment
// Get global env vars (DISABLE_TELEMETRY, etc.) for third-party profiles
const globalEnvConfig = getGlobalEnvConfig();
const globalEnv = globalEnvConfig.enabled ? globalEnvConfig.env : {};
// Merge with current environment (global env first, copilot overrides)
const env = {
...process.env,
...globalEnv,
...copilotEnv,
};