openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
22 lines (21 loc) • 1.05 kB
JavaScript
import { i as reloadSharedAuthStoreOwnership } from "./path-resolve-qRO5Wefj.mjs";
import { m as prepareModelRuntimeSnapshot } from "./prepared-model-runtime-CE49vbuU.mjs";
import { u as refreshActiveProviderAuthRuntimeSnapshot } from "./runtime-9X_042yF.mjs";
import { n as resolveModelAuthAgentScope, t as modelAuthAgentScopeError } from "./model-auth-agent-scope-DICFf697.mjs";
import { t as clearModelAuthStatusUsageCache } from "./models-auth-status-usage-cache-tXWdRJiM.mjs";
//#region src/gateway/model-auth-refresh.ts
async function refreshModelAuthStateAfterMutation(getRuntimeConfig, agentId) {
reloadSharedAuthStoreOwnership();
clearModelAuthStatusUsageCache();
await refreshActiveProviderAuthRuntimeSnapshot();
const config = getRuntimeConfig();
const scope = resolveModelAuthAgentScope(config, agentId);
if (!scope.ok) throw new Error(modelAuthAgentScopeError(scope).message);
await prepareModelRuntimeSnapshot({
config,
agentId,
agentDir: scope.agentDir
});
}
//#endregion
export { refreshModelAuthStateAfterMutation as t };