openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
18 lines (17 loc) • 772 B
JavaScript
//#region extensions/codex/src/app-server/client-factory.ts
let sharedClientModulePromise = null;
const loadSharedClientModule = async () => {
sharedClientModulePromise ??= import("./shared-client-CYX2KUjs.js");
return await sharedClientModulePromise;
};
/** Returns a leased shared client so startup can release ownership explicitly. */
const defaultLeasedCodexAppServerClientFactory = (startOptions, authProfileId, agentDir, config, options) => loadSharedClientModule().then(({ getLeasedSharedCodexAppServerClient }) => getLeasedSharedCodexAppServerClient({
startOptions,
authProfileId,
agentDir,
config,
onStartedClient: options?.onStartedClient,
abandonSignal: options?.abandonSignal
}));
//#endregion
export { defaultLeasedCodexAppServerClientFactory as t };