UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

6 lines (4 loc) • 4.85 kB
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./plugin-help-value-C73_Mgcw.js","./lit-runtime-B8uOr6OX.js","./gateway-runtime-Cr51Pi7N.js","./session-snapshot-database-BurLa_ut.js","./control-ui-boot-shared-Dfs-gZII.js","./control-ui-boot-shared-umGE-sEP.js","./control-ui-boot-shared-Sj2zqjOr.js","./control-ui-boot-shared-em9-jnbz.js","./plugin-contracts-runtime-CNCaYops.js","./control-ui-boot-shared-D4XEBdOG.js","./config-runtime-BecGLziM.js","./markdown-runtime-ORQpioyT.js","./control-ui-boot-chat-VeeaXyJz.js","./control-ui-boot-shared-DJkUdZmL.js","./control-ui-boot-shared-xfDhIVun.js","./control-ui-boot-shared-D3oo_6Fq.js","./control-ui-boot-shared-styles-BaQ2sAfZ.js","./sidebar-update-runtime-DonYLwN5.js","./control-ui-boot-chat-Ck7W_FPO.js","./control-ui-boot-chat-DxoNF0Ad.js","./chat-transcript-styles-Dzr3t9kA.js","./control-ui-boot-chat-styles-BRrYkFSc.js","./config-form.node.shared-BDgoYpu6.js","./config-form.search-DJEvDtN5.js","./control-ui-core-yIvVj14Y.css","./control-ui-boot-shared-styles-DKyMAG_6.css","./control-ui-boot-shared-CXHNz0Bh.css","./sidebar-update-runtime-ah7rgQE7.css","./chat-transcript-styles-B_dd5Ueo.css","./control-ui-boot-chat-styles-C_Ls1c0m.css","./control-ui-boot-chat-mLz7NUiY.css"])))=>i.map(i=>d[i]); import{n as e}from"./rolldown-runtime-8BhlS34s.js";import{Eu as t,_c as n,gc as r,ju as i,lu as a,uu as o,vc as s,yc as c}from"./control-ui-core-BncvAZjR.js";import{Yr as l,ai as u}from"./control-ui-core-9qYjK5B2.js";import{fa as d,oa as f,qi as p,sa as m}from"./ui-DuRgK6kL.js";import{dr as h,fr as g}from"./control-ui-boot-chat-C8hdsB2M.js";function _(e,t){let n=d(t);if(!n)return;let r={incomplete:!0};e.declared=r;let i=()=>JSON.stringify(e).length<=y;if(!i()){delete e.declared;return}let a=n.incomplete===!0;for(let e of b){let t=n[e];if(t===void 0)continue;if(!Array.isArray(t)){a=!0;continue}let o=[];if(r[e]=o,!i()){delete r[e],a=!0;continue}let s=t.filter(e=>typeof e==`string`&&e.length>0&&e.length<=128),c=[...new Set(s)].toSorted();a||=s.length!==t.length||c.length>8;for(let e of c.slice(0,8))o.push(e),i()||(o.pop(),a=!0)}a||delete r.incomplete}function v(e){let t=d(e);if(!t||typeof t.id!=`string`||!/^[A-Za-z0-9@][A-Za-z0-9@._/-]{0,127}$/u.test(t.id)||typeof t.name!=`string`||!t.name.trim()||t.name.length>96)return;let n={id:t.id,name:t.name.trim()};typeof t.installed==`boolean`&&(n.installed=t.installed);let r=d(t.setting);return r&&Array.isArray(r.path)&&r.path.length>0&&r.path.length<=16&&r.path.every(e=>typeof e==`string`&&e.length>0&&e.length<=64)&&typeof r.label==`string`&&r.label.trim()&&r.label.length<=96&&(n.setting={path:[...r.path],label:r.label.trim()}),JSON.stringify(n).length>1024&&delete n.setting,_(n,t.declared),JSON.stringify(n).length<=1024?n:void 0}var y,b;function x(){return(x=e((()=>{y=1024,b=[`tools`,`providers`,`channels`,`contracts`,`skills`,`mcpServers`]})))()}function S(e,t,r,i){let a=c(e),o=a.publication,l=v({...r,installed:i.installed,name:p(r.name,96),setting:o?.reference.id===r.id?o.reference.setting:void 0});if(!l)return C(e,t),()=>void 0;let u={owner:t,reference:l,pathname:s(e),...i};a.publication=u;let d=o?.owner!==t||o.reference.id!==l.id||o.pathname!==u.pathname;return d&&(a.selectionEpoch+=1),(d||o?.overview!==i.overview||o?.installed!==i.installed||JSON.stringify(o?.reference)!==JSON.stringify(l))&&n(a),()=>{a.publication===u&&(a.publication=void 0,a.selectionEpoch+=1,n(a))}}function C(e,t){let r=c(e);r.publication?.owner===t&&(r.publication=void 0,r.selectionEpoch+=1,n(r))}function w(e,t){let r=c(e),a=r.scope,s=r.selectionEpoch;return async u=>{if(c(e).scope===a&&r.selectionEpoch===s){if(window.dispatchEvent(new CustomEvent(l,{detail:{open:!0}})),u&&`question`in u)r.pendingDraft=[r.pendingDraft,u.question].filter(Boolean).join(` `);else if(u){let n=u,l;try{({formatPluginHelpValue:l}=await f(()=>import(`./plugin-help-value-C73_Mgcw.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]),import.meta.url))}catch{c(e).scope===a&&r.selectionEpoch===s&&o({message:i(`custodian.pluginHelpFailed`)});return}if(c(e).scope!==a||r.selectionEpoch!==s)return;let d=l(n.value,n.sensitive),m=`${i(`custodian.pluginHelpQuestion`,{setting:p(n.label,96)})}\n\n${i(`custodian.pluginHelpValue`,{value:d})}`;r.pendingDraft=[r.pendingDraft,m].filter(Boolean).join(` `);let h=r.publication;h?.reference.id===t.id&&(h.reference=v({...h.reference,setting:{path:n.path.map(String),label:p(n.label,96)}})??h.reference)}r.focusRequest+=1,n(r)}}}function T(e){let t=c(e);return t.publication?.pathname===s(e)?t.publication.reference:void 0}function E(e){let t=c(e),n=t.pendingDraft;return t.pendingDraft=``,n}function D(e){return c(e).focusRequest}function O(){return(O=e((()=>{x(),u(),t(),h(),a(),r(),m(),g()})))()}export{S as a,D as i,T as n,E as o,O as r,w as t};