openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 1.56 kB
JavaScript
import{n as e}from"./rolldown-runtime-8BhlS34s.js";import{Eu as t,ju as n}from"./control-ui-core-BncvAZjR.js";import{gr as r,xr as i}from"./control-ui-core-9qYjK5B2.js";import{At as a,jt as o}from"./control-ui-boot-shared-DJkUdZmL.js";import{Bi as s,zi as c}from"./control-ui-boot-shared-xfDhIVun.js";import{Ga as l,Wa as u}from"./control-ui-boot-shared-D3oo_6Fq.js";async function d(e,t,i,a){let o=i.recovery,c=()=>!a.signal?.aborted&&a.canDispatch()&&r(e.hello?.auth??null);return i.reason===`sandbox-required`||!o||o.action!==`use-native-permissions`||o.sessionId!==a.expectedSessionId||!c()||!await s({title:n(`chat.nativeRuntimeRecovery.title`,{runtime:i.runtimeLabel}),message:`${n(`chat.nativeRuntimeRecovery.reasons.${i.reason}`,{runtime:i.runtimeLabel})}\n\n${n(`chat.nativeRuntimeRecovery.confirmMessage`,{runtime:i.runtimeLabel})}${a.retriesMessage?`\n\n${n(`chat.nativeRuntimeRecovery.retryMessage`)}`:``}`,confirmLabel:n(`chat.nativeRuntimeRecovery.confirm`),danger:!0,signal:a.signal})||!c()?null:l(e,t,{...a.model===void 0?{}:{model:a.model,agentRuntime:i.runtimeId},nativeRuntimeConsent:i.runtimeId,sandboxMode:`off`,permissionMode:`full`,expectedLifecycleRevision:o.lifecycleRevision,expectedPermissionMode:o.expectedPermissionMode,expectedSandboxMode:o.expectedSandboxMode,expectedNativeRuntimeConsent:o.expectedNativeRuntimeConsent},{agentId:a.agentId,expectedSessionId:o.sessionId,ownsModelOverride:a.canDispatch,canDispatch:c})}function f(){return(f=e((()=>{i(),c(),t(),a(),u(),o()})))()}f();export{d as confirmNativeRuntimePermissionRecovery};