MCPcopy Create free account
hub / github.com/VPSDance/ai-proxy-rules / loadAllProviders

Function loadAllProviders

scripts/data.ts:53–62  ·  view source on GitHub ↗
(inputDir: string)

Source from the content-addressed store, hash-verified

51export async function loadProvider(inputDir: string, provider: string): Promise<ProviderSource> {
52 const filePath = path.join(inputDir, `${provider}.yaml`);
53 return parseProviderFile(filePath);
54}
55
56export async function loadAllProviders(inputDir: string): Promise<ProviderSource[]> {
57 const entries = await readdir(inputDir, { withFileTypes: true });
58 const files = entries
59 .filter((entry) => entry.isFile() && /\.ya?ml$/i.test(entry.name))
60 .map((entry) => path.join(inputDir, entry.name))
61 .sort();
62
63 const providers = await Promise.all(files.map((file) => parseProviderFile(file)));
64 return providers.sort((a, b) => a.provider.localeCompare(b.provider));
65}

Callers 1

selectProvidersFunction · 0.85

Calls 1

parseProviderFileFunction · 0.85

Tested by

no test coverage detected