Files
jatmn 188d6507c2 Migrate provider catalog to TOML
- replace JSON provider/model descriptors with TOML definitions and global model metadata

- add provider discovery for OpenAI-compatible, gateway, and localhost catalog entries

- resolve global model references, first-party ownership, and per-model transport overrides

- update provider auth/header handling, dynamic discovery cache behavior, and provider command parsing

- harden file/search tools and align tests/docs/build embedding with the TOML catalog
2026-05-31 13:11:22 -07:00

36 lines
926 B
TypeScript

import { Glob } from 'bun';
import { mkdirSync } from 'fs';
const catalogFiles = [
...new Glob('src/providers/catalog/definitions/*.toml').scanSync('.'),
...new Glob('src/providers/catalog/models/*.toml').scanSync('.'),
];
mkdirSync('.zero-build', { recursive: true });
mkdirSync('dist', { recursive: true });
const catalogAssetEntrypoint = '.zero-build/provider-catalog-assets.ts';
await Bun.write(
catalogAssetEntrypoint,
catalogFiles
.map((file, index) => {
const importPath = `../${file.replaceAll('\\', '/')}`;
return `import catalogAsset${index} from '${importPath}' with { type: 'file' };\nvoid catalogAsset${index};`;
})
.join('\n')
);
const result = await Bun.build({
entrypoints: ['src/index.ts', catalogAssetEntrypoint],
compile: {
outfile: 'dist/zero',
},
});
if (!result.success) {
for (const log of result.logs) {
console.error(log);
}
process.exit(1);
}