mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-25 20:05:46 -06:00
20d6ddc4c7
* refactor(agents): privatize models config test seams * chore(deadcode): shrink models config export baseline
21 lines
758 B
TypeScript
21 lines
758 B
TypeScript
import "./models-config.js";
|
|
|
|
type ModelsConfigTestApi = {
|
|
ensureModelsFileModeForModelsJson(pathname: string): Promise<void>;
|
|
writeModelsFileAtomicForModelsJson(targetPath: string, contents: string): Promise<void>;
|
|
};
|
|
|
|
function getTestApi(): ModelsConfigTestApi {
|
|
return (globalThis as Record<PropertyKey, unknown>)[
|
|
Symbol.for("openclaw.modelsConfigTestApi")
|
|
] as ModelsConfigTestApi;
|
|
}
|
|
|
|
export const ensureModelsFileModeForModelsJson = async (pathname: string): Promise<void> =>
|
|
await getTestApi().ensureModelsFileModeForModelsJson(pathname);
|
|
|
|
export const writeModelsFileAtomicForModelsJson = async (
|
|
targetPath: string,
|
|
contents: string,
|
|
): Promise<void> => await getTestApi().writeModelsFileAtomicForModelsJson(targetPath, contents);
|