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{Pu as t,zu as n}from"./control-ui-core-CBJ5efDh.js";import{wr as r,yr as i}from"./control-ui-core-DtLivg_r.js";import{ct as a,st as o}from"./control-ui-boot-shared-UG5ko-VG.js";import{na as s,ta as c}from"./control-ui-boot-shared-XreXSF7h.js";import{do as l,fo as u}from"./control-ui-boot-shared-dOnP4mAA.js";async function d(e,t,r,a){let o=r.recovery,c=()=>!a.signal?.aborted&&a.canDispatch()&&i(e.hello?.auth??null);return r.reason===`sandbox-required`||!o||o.action!==`use-native-permissions`||o.sessionId!==a.expectedSessionId||!c()||!await s({title:n(`chat.nativeRuntimeRecovery.title`,{runtime:r.runtimeLabel}),message:`${n(`chat.nativeRuntimeRecovery.reasons.${r.reason}`,{runtime:r.runtimeLabel})}\n\n${n(`chat.nativeRuntimeRecovery.confirmMessage`,{runtime:r.runtimeLabel})}${a.retriesMessage?`\n\n${n(`chat.nativeRuntimeRecovery.retryMessage`)}`:``}`,confirmLabel:n(`chat.nativeRuntimeRecovery.confirm`),danger:!0,signal:a.signal})||!c()?null:u(e,t,{...a.model===void 0?{}:{model:a.model,agentRuntime:r.runtimeId},nativeRuntimeConsent:r.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((()=>{r(),c(),t(),o(),l(),a()})))()}f();export{d as confirmNativeRuntimePermissionRecovery};