UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 2.01 kB
import{t as isUserModelAuthProfileId}from"./user-model-account-id-CU4k7NMV.mjs";import{s as FailoverError}from"./error-oegzzI05.mjs";import{n as recordModelFallbackStop}from"./model-fallback-stop-BR_49mUQ.mjs";import{o as buildOAuthRefreshFailureLoginCommand}from"./oauth-refresh-failure-BdZMhNvV.mjs";import{l as findPersistedAuthProfileCredentialAsync}from"./store-runtime-GNz-2GjY.mjs";import"./failover-error-DWH-eolC.mjs"; //!src/agents/cli-runner/auth-profile-preparation-error.ts function createCliCredentialUseCheck(e,t){return async()=>{if(await findPersistedAuthProfileCredentialAsync({profileId:e,agentDir:t}))return;const n=new CliCredentialRemovedError(e);recordModelFallbackStop(n);throw n}}function credentialRemovedMessage(e){return`${e?isUserModelAuthProfileId(e)?`Selected personal account`:`Saved account "${e}"`:`The selected account`} was removed. Select a connected account or sign in again under Models, then retry. OpenClaw did not submit this turn.`}var CliCredentialRemovedError=class extends Error{constructor(e){super(credentialRemovedMessage(e));this.profileId=e;this.name=`CliCredentialRemovedError`}userMessage(e=false){return credentialRemovedMessage(e?this.profileId:void 0)}};function createCliProfileResolutionError(e,t,n){return(r,i)=>{const a=buildOAuthRefreshFailureLoginCommand(r,{profileId:t});const o=i!==void 0?`selected auth profile "${t}" resolved as "${i}"`:`could not materialize selected auth profile "${t}"`;return new CliAuthProfilePreparationError({message:`CLI backend "${e}" ${o}. Re-authenticate with: ${a}. OpenClaw did not start the run.`,profileId:t,provider:r,agentDir:n})}}var CliAuthProfilePreparationError=class extends FailoverError{constructor(e){super(e.message,{reason:`auth`,provider:e.provider,profileId:e.profileId,cause:e.cause});this.name=`CliAuthProfilePreparationError`;this.agentDir=e.agentDir}};export{createCliProfileResolutionError as i,CliCredentialRemovedError as n,createCliCredentialUseCheck as r,CliAuthProfilePreparationError as t};