MCPcopy Create free account
hub / github.com/AI45Lab/Code / resolveConfigPath

Function resolveConfigPath

sdk/node/examples/streaming/test_minimax_stream.ts:14–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12const __dirname = path.dirname(__filename);
13
14function resolveConfigPath(): string {
15 const candidates = [
16 process.env.A3S_CONFIG,
17 path.join(__dirname, '..', '..', '..', '..', '..', '..', '.a3s', 'config.acl'),
18 path.join(process.env.HOME || '', '.a3s', 'config.acl'),
19 ].filter(Boolean) as string[];
20
21 for (const candidate of candidates) {
22 if (fs.existsSync(candidate)) {
23 return candidate;
24 }
25 }
26
27 throw new Error('Config not found. Set A3S_CONFIG or create ~/.a3s/config.acl.');
28}
29
30async function main(): Promise<void> {
31 const configPath = resolveConfigPath();

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected