UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 1.56 kB
import{n as e}from"./rolldown-runtime-8BhlS34s.js";import{hu as t,uu as n}from"./control-ui-core-3P365fbR.js";import{_r as r,fr as i}from"./control-ui-core-CFW9Qtjn.js";import{Fn as a,Pn as o}from"./control-ui-boot-shared-DoKu-5Ju.js";import{To as s,wo as c}from"./control-ui-boot-shared-CG9HtEG-.js";import{et as l,tt as u}from"./control-ui-boot-shared-73R4ErOy.js";async function d(e,n,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:t(`chat.nativeRuntimeRecovery.title`,{runtime:r.runtimeLabel}),message:`${t(`chat.nativeRuntimeRecovery.reasons.${r.reason}`,{runtime:r.runtimeLabel})}\n\n${t(`chat.nativeRuntimeRecovery.confirmMessage`,{runtime:r.runtimeLabel})}${a.retriesMessage?`\n\n${t(`chat.nativeRuntimeRecovery.retryMessage`)}`:``}`,confirmLabel:t(`chat.nativeRuntimeRecovery.confirm`),danger:!0,signal:a.signal})||!c()?null:u(e,n,{...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(),n(),o(),l(),a()})))()}f();export{d as confirmNativeRuntimePermissionRecovery};