UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines 6.43 kB
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./session-placement-move-dialog-hC-FO17_.js","./rolldown-runtime-DkW27tQK.js","./control-ui-core-Rwzhj6nO.js","./control-ui-foundation-Cydpkyqa.js","./lit-runtime-CV_MH99K.js","./control-ui-core-YphAl4aM.js","./control-ui-core-vvcQQV2m.js","./gateway-runtime-Bqqcp9-I.js","./control-ui-core-ClxHIvNM.css","./control-ui-boot-shared-CXVvK2AW.js","./control-ui-boot-shared-BYq7Cchl.js","./control-ui-boot-shared-Deak_Sjt.js","./control-ui-boot-shared-gfE6fZcA.js","./markdown-runtime-Bn6OdBVq.js","./control-ui-boot-shared-DfZ39Yj9.js","./control-ui-boot-shared-3juXI2I2.js","./control-ui-boot-shared-BVNXvWX-.js","./control-ui-boot-shared-KspYIvAF.css","./control-ui-boot-new-Bj2SAUyl.js","./control-ui-boot-new-DTUE5TUM.css","./confirm-dialog-CCkeF-g9.js","./control-ui-boot-chat-_QSl8fbH.js","./control-ui-boot-chat-Cgwe4GEM.js","./config-runtime-D-5ybyEi.js"])))=>i.map(i=>d[i]); import{n as e}from"./rolldown-runtime-DkW27tQK.js";import{ii as t,ri as n}from"./control-ui-foundation-Cydpkyqa.js";import{As as r,Ls as i,ea as a,ta as o}from"./control-ui-core-Rwzhj6nO.js";import{Zt as s,nn as c}from"./control-ui-core-YphAl4aM.js";import{Yt as l,en as u}from"./control-ui-core-vvcQQV2m.js";import{Hr as d,Vr as f}from"./control-ui-boot-shared-DfZ39Yj9.js";import{_n as p,gn as m,hn as h,un as g}from"./control-ui-boot-shared-CXVvK2AW.js";import{d as _,f as v}from"./control-ui-boot-new-Bj2SAUyl.js";import{c as y,u as b}from"./control-ui-boot-chat-Bia0O-uD.js";import{n as x,t as S}from"./cloud-worker-stop.runtime-CEd3IinU.js";async function C(e,t,n,r){let i=await h(e,n);return{profiles:t?i.profiles:[],devices:v(i.environments,r)}}async function w(e){let{showSessionPlacementTargetDialog:t}=await n(async()=>{let{showSessionPlacementTargetDialog:e}=await import(`./session-placement-move-dialog-hC-FO17_.js`);return{showSessionPlacementTargetDialog:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url),r=e.row.agentRuntime;return await t({mode:e.mode,sessionLabel:e.row.label||e.row.key,activeRun:e.row.hasActiveRun===!0,deviceDisabledReason:r&&!r.devicePlacement?u(`newSession.deviceRuntimeUnsupported`):void 0,profileDisabledReason:e=>r?.cloudPlacementSupported===!1?u(`newSession.cloudRuntimeUnsupported`,{runtime:r.id}):r?.cloudPlacementExecutionMode&&!m(e,r.cloudPlacementExecutionMode)?u(`newSession.cloudProfileRuntimeUnsupported`,{runtime:r.id}):void 0,loadCatalog:async()=>await C(e.client,s(e.gatewaySnapshot.hello?.auth??null),r?.id,r?.devicePlacement)})}async function T(e){let t=e.client,r=e.row.placement;if(!t||e.movingKey===e.row.key||e.row.placementMove!==void 0&&e.row.placementMove.error===void 0||r?.state!==`active`)return;let a=o(e.gatewaySnapshot,{method:`sessions.move`,requiredScope:`operator.write`});if(!a.allowed){e.publishError(a.reason);return}let s=i(e.row.key)?.agentId,c=r.runner?.kind===`device`&&r.runner.status===`offline`,l;if(c){let{showConfirmDialog:t}=await n(async()=>{let{showConfirmDialog:e}=await import(`./confirm-dialog-CCkeF-g9.js`);return{showConfirmDialog:e}},__vite__mapDeps([20,6,1,3,2,4,5,7,8,21,10,11,12,13,14,9,15,16,17,22,23]),import.meta.url);l=await t({message:u(`sessionsView.continueOnGatewayConfirm`,{session:e.row.label||e.row.key}),confirmLabel:u(`sessionsView.continueOnGatewayAction`),danger:!0})?{kind:`gateway`}:null}else l=await w({client:t,gatewaySnapshot:e.gatewaySnapshot,mode:`move`,row:e.row});if(l){if(!e.isCurrent(t,e.connectionGeneration)){e.publishError(u(`sessionsView.actionUnavailable`));return}e.onMovingChange(e.row.key);try{await t.request(`sessions.move`,{key:e.row.key,...s?{agentId:s}:{},expected:{generation:r.generation,environmentId:r.environmentId,ownerEpoch:r.activeOwnerEpoch},target:l,...c?{abandonSource:!0}:{}}),e.isCurrent(t,e.connectionGeneration)&&await e.refreshReplacement(s)}catch(n){e.isCurrent(t,e.connectionGeneration)&&(await e.refreshReplacement(s).catch(()=>void 0),e.publishError(n))}finally{e.onMovingChange(null),e.requestUpdate()}}}async function E(e){let t=e.client,n=e.row.placement;if(!t||e.restartingKey===e.row.key||n?.state!==`failed`||n.recoveryAction!==`restart`)return;let r=o(e.gatewaySnapshot,{method:`sessions.dispatch`,requiredScope:`operator.write`});if(!r.allowed){e.publishError(r.reason);return}let a=await w({client:t,gatewaySnapshot:e.gatewaySnapshot,mode:`restart`,row:e.row});if(!a||a.kind===`gateway`)return;if(!e.isCurrent(t,e.connectionGeneration)){e.publishError(u(`sessionsView.actionUnavailable`));return}let s=i(e.row.key)?.agentId;e.onRestartingChange(e.row.key);try{await t.request(`sessions.dispatch`,{key:e.row.key,...s?{agentId:s}:{},...a.kind===`profile`?{profileId:a.profileId,...a.machineClass?{machineClass:a.machineClass}:{}}:{deviceId:a.deviceId}}),e.isCurrent(t,e.connectionGeneration)&&await e.refreshReplacement(s)}catch(n){e.isCurrent(t,e.connectionGeneration)&&(await e.refreshReplacement(s).catch(()=>void 0),e.publishError(n))}finally{e.onRestartingChange(null),e.requestUpdate()}}async function D(e){let t=e.client,r=e.connectionGeneration,a=d(e.row.placement),s=e.reclaimingKey===e.row.key,c=e.row.placement,l=c?.state===`active`&&c.runner?.kind===`device`&&c.runner.status===`offline`;if(!t||s||l||a?.blocksActiveRun&&e.row.hasActiveRun===!0||a?.method!==`sessions.reclaim`)return;let f=o(e.gatewaySnapshot,{method:`sessions.reclaim`,requiredScope:`operator.write`});if(!f.allowed){e.publishError(f.reason);return}let{showConfirmDialog:p}=await n(async()=>{let{showConfirmDialog:e}=await import(`./confirm-dialog-CCkeF-g9.js`);return{showConfirmDialog:e}},__vite__mapDeps([20,6,1,3,2,4,5,7,8,21,10,11,12,13,14,9,15,16,17,22,23]),import.meta.url),m=b(e.row,e.placementStartup.get(e.row.key));if(!await p({message:m.confirmMessage,confirmLabel:m.confirmLabel,danger:!0}))return;if(!e.isCurrent(t,r)){e.publishError(u(`sessionsView.actionUnavailable`));return}let h=i(e.row.key)?.agentId;e.onReclaimingChange(e.row.key);try{await x(t,{key:e.row.key,...h?{agentId:h}:{}},e.placementStartup),e.isCurrent(t,r)&&await e.refreshReplacement(h)}catch(n){e.isCurrent(t,r)&&e.publishError(n)}finally{e.onReclaimingChange(null),e.requestUpdate()}}function O(){return(O=e((()=>{c(),S(),f(),l(),a(),r(),g(),_(),p(),y(),t()})))()}O();export{T as moveChatPanePlacement,D as reclaimChatPanePlacement,E as restartChatPanePlacement}; //# sourceMappingURL=chat-pane-placement.runtime-BxxU9dFh.js.map