UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

26 lines (25 loc) • 915 B
import { i as normalizeProviderIdForAuth } from "./provider-id-b5XGSf9C.mjs"; import { r as resolveProviderModelRouteAuthRequirement } from "./provider-model-route-auth-dD2KD9io.mjs"; //#region src/agents/model-auth-selected-credential.ts /** Normalize a selection made by availability or the physical attempt's auth owner. */ function resolveSelectedModelCredential(e) { if (e.runtimeAuth) return { source: "harness" }; if (!e.profileId && !e.mode) return; const t = { mode: e.mode, requirement: resolveProviderModelRouteAuthRequirement(e.mode, e.authRequirement) }; return e.profileId ? { ...t, source: "profile", profileId: e.profileId, identityKey: `profile:${e.profileId}` } : { ...t, source: "direct", provider: normalizeProviderIdForAuth(e.provider), identityKey: `direct:${normalizeProviderIdForAuth(e.provider)}` }; } //#endregion export { resolveSelectedModelCredential as t };