forked from github/copilot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.ts
More file actions
56 lines (50 loc) · 1.33 KB
/
Copy pathconfig.ts
File metadata and controls
56 lines (50 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/**
* Configuration management for the multi-agent application
*/
import { config as dotenvConfig } from "dotenv";
// Load environment variables
dotenvConfig();
export interface AppConfig {
copilot: {
cliPath: string;
};
figma: {
accessToken: string;
fileId: string;
};
server: {
port: number;
nodeEnv: string;
};
agents: {
maxConcurrent: number;
defaultModel: string;
};
}
function getEnvOrThrow(key: string): string {
const value = process.env[key];
if (!value) {
throw new Error(`Missing required environment variable: ${key}`);
}
return value;
}
function getEnvOrDefault(key: string, defaultValue: string): string {
return process.env[key] || defaultValue;
}
export const config: AppConfig = {
copilot: {
cliPath: getEnvOrDefault("COPILOT_CLI_PATH", "copilot"),
},
figma: {
accessToken: getEnvOrDefault("FIGMA_ACCESS_TOKEN", ""),
fileId: getEnvOrDefault("FIGMA_FILE_ID", ""),
},
server: {
port: parseInt(getEnvOrDefault("PORT", "3000"), 10),
nodeEnv: getEnvOrDefault("NODE_ENV", "development"),
},
agents: {
maxConcurrent: parseInt(getEnvOrDefault("MAX_CONCURRENT_AGENTS", "5"), 10),
defaultModel: getEnvOrDefault("DEFAULT_MODEL", "gpt-4.1"),
},
};