sealclaw 2026.9.21 → 2026.9.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-info.json +2 -2
- package/dist/cli-startup-metadata.json +1 -1
- package/dist/control-ui/assets/{agents-BY4aXME8.js → agents-B3eGrySi.js} +2 -2
- package/dist/control-ui/assets/{channels-D-QByuhk.js → channels-CuNr3x8S.js} +2 -2
- package/dist/control-ui/assets/{cron-BgVlNDdc.js → cron-CS9cgBJT.js} +2 -2
- package/dist/control-ui/assets/{cron-task-list-D2nXZpo2.js → cron-task-list-CU6ybcB9.js} +2 -2
- package/dist/control-ui/assets/{debug-CuGSEgIy.js → debug-DR6YkUV-.js} +2 -2
- package/dist/control-ui/assets/{filespace-DicgLi9K.js → filespace-jYEFvxIi.js} +2 -2
- package/dist/control-ui/assets/{index-CwOuBWjW.js → index-BTFXLjRb.js} +9 -9
- package/dist/control-ui/assets/{instances-uGReSAlG.js → instances-BXXkA07m.js} +2 -2
- package/dist/control-ui/assets/{nodes-DmSj9fyO.js → nodes-CJ48zMNM.js} +2 -2
- package/dist/control-ui/assets/{pdf-9NuP_4_b.js → pdf-DyX3XLCf.js} +2 -2
- package/dist/control-ui/assets/{pdf.worker-C3u58bx7.js → pdf.worker-BbbExAx6.js} +2 -2
- package/dist/control-ui/assets/{plugins-DlhMPMhL.js → plugins-B5NdnLkj.js} +2 -2
- package/dist/control-ui/assets/request-Cif3b33V.js +2 -0
- package/dist/control-ui/assets/{sessions-ltqOEThv.js → sessions-C0-Brdmh.js} +2 -2
- package/dist/control-ui/assets/{skill-center-T5345ywM.js → skill-center-B0-YuHLe.js} +2 -2
- package/dist/control-ui/assets/{skill-publish-DAkF1LGc.js → skill-publish-C7InyITi.js} +2 -2
- package/dist/control-ui/assets/{skills-CPiV0PPn.js → skills-DBun6Ded.js} +2 -2
- package/dist/control-ui/assets/{workspace-browser-B3o_ElYg.js → workspace-browser-oC_m4pwR.js} +2 -2
- package/dist/control-ui/index.html +2 -2
- package/dist/extensions/xicheng-bi/index.js +1 -1
- package/dist/plugin-sdk/.boundary-entry-shims.stamp +1 -1
- package/dist/postinstall-inventory.json +18 -18
- package/package.json +1 -1
- package/dist/control-ui/assets/request-C_ZSS118.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/docx-preview-DMEG690f.js","assets/chunk-62oNxeRG.js","assets/jszip.min-C9xvYp-s.js","assets/pptx-preview.es-eMvLaQpR.js","assets/pdf.worker-
|
|
2
|
-
import{i as e,n as t,t as n}from"./chunk-62oNxeRG.js";import{a as r,c as i,i as a,l as o,n as s,o as c,r as l,s as u,t as d,u as f}from"./lit-BpL4H2cG.js";import{t as p}from"./request-C_ZSS118.js";import{n as m,r as h,t as g}from"./string-coerce-_7w9q4Tr.js";import{n as _,t as v}from"./local-storage-cu5-dJx1.js";import{n as y,r as b,t as x}from"./directive-Ckb1BD7Q.js";import{a as S,c as C,i as w,n as T,o as E,r as D,s as ee,t as O}from"./skill-recency-Baqg_pl3.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})(),typeof Array.prototype.toSorted!=`function`&&Object.defineProperty(Array.prototype,`toSorted`,{value:function(e){return[...this].sort(e)},writable:!0,configurable:!0}),typeof Array.prototype.toReversed!=`function`&&Object.defineProperty(Array.prototype,`toReversed`,{value:function(){return[...this].reverse()},writable:!0,configurable:!0}),typeof Array.prototype.toSpliced!=`function`&&Object.defineProperty(Array.prototype,`toSpliced`,{value:function(e,t,...n){let r=[...this];return t===void 0?r.splice(e):r.splice(e,t,...n),r},writable:!0,configurable:!0}),typeof Array.prototype.with!=`function`&&Object.defineProperty(Array.prototype,`with`,{value:function(e,t){let n=[...this],r=e<0?n.length+e:e;if(r<0||r>=n.length)throw RangeError(`Invalid index`);return n[r]=t,n},writable:!0,configurable:!0});var te={attribute:!0,type:String,converter:o,reflect:!1,hasChanged:i},k=(e=te,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function A(e){return(t,n)=>typeof n==`object`?k(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function j(e){return A({...e,state:!0,attribute:!1})}var M=(e,t,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&typeof t!=`object`&&Object.defineProperty(e,t,n),n);function N(e,t){return(n,r,i)=>{let a=t=>{var n;return((n=t.renderRoot)==null?void 0:n.querySelector(e))??null};if(t){let{get:e,set:t}=typeof r==`object`?n:i??(()=>{let e=Symbol();return{get(){return this[e]},set(t){this[e]=t}}})();return M(n,r,{get(){let n=e.call(this);return n===void 0&&(n=a(this),(n!==null||this.hasUpdated)&&t.call(this,n)),n}})}return M(n,r,{get(){return a(this)}})}}var P=e=>p(`/api/sealclaw/api-keys`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}),ne=()=>p(`/api/sealclaw/api-keys`),re=e=>p(`/api/sealclaw/api-keys/${e}`,{method:`DELETE`}),ie=e=>p(`/api/sealclaw/v1/models`,e?{headers:{Authorization:`Bearer ${e}`,token:e}}:void 0),F=n((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ee(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var O=/\/+/g;function te(e,t){return typeof e==`object`&&e&&e.key!=null?ee(``+e.key):t.toString(36)}function k(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+te(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(O,`$&/`)+`/`),k(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(O,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+te(s,l);c+=k(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+te(s,l++),c+=k(s,r,i,u,o);else if(s===`object`)throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`);return c}function A(e,t,n){if(e==null)return e;var r=[],i=0;return k(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function j(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var M={current:null},N={transition:null},P={ReactCurrentDispatcher:M,ReactCurrentBatchConfig:N,ReactCurrentOwner:C};function ne(){throw Error(`act(...) is not supported in production builds of React.`)}e.Children={map:A,forEach:function(e,t,n){A(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return A(e,function(){t++}),t},toArray:function(e){return A(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}},e.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=P,e.act=ne,e.cloneElement=function(e,n,r){if(e==null)throw Error(`React.cloneElement(...): The argument must be a React element, but you passed `+e+`.`);var i=h({},e.props),a=e.key,o=e.ref,s=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,s=C.current),n.key!==void 0&&(a=``+n.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in n)S.call(n,l)&&!w.hasOwnProperty(l)&&(i[l]=n[l]===void 0&&c!==void 0?c[l]:n[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:t,type:e.type,key:a,ref:o,props:i,_owner:s}},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o,_context:e},e.Consumer=e},e.createElement=T,e.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:j}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=N.transition;N.transition={};try{e()}finally{N.transition=t}},e.unstable_act=ne,e.useCallback=function(e,t){return M.current.useCallback(e,t)},e.useContext=function(e){return M.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return M.current.useDeferredValue(e)},e.useEffect=function(e,t){return M.current.useEffect(e,t)},e.useId=function(){return M.current.useId()},e.useImperativeHandle=function(e,t,n){return M.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return M.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return M.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return M.current.useMemo(e,t)},e.useReducer=function(e,t,n){return M.current.useReducer(e,t,n)},e.useRef=function(e){return M.current.useRef(e)},e.useState=function(e){return M.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return M.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return M.current.useTransition()},e.version=`18.3.1`})),I=n(((e,t)=>{t.exports=F()})),L=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,A(x);else{var t=n(l);t!==null&&j(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&j(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function ee(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?O():(S=!1,C=null)}}else S=!1}var O;if(typeof v==`function`)O=function(){v(ee)};else if(typeof MessageChannel<`u`){var te=new MessageChannel,k=te.port2;te.port1.onmessage=ee,O=function(){k.postMessage(null)}}else O=function(){g(ee,0)};function A(e){C=e,S||(S=!0,O())}function j(t,n){w=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,A(x))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,j(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,A(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),ae=n(((e,t)=>{t.exports=L()})),oe=n((e=>{var t=I(),n=ae();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var i=new Set,a={};function o(e,t){s(e,t),s(e+`Capture`,t)}function s(e,t){for(a[e]=t,e=0;e<t.length;e++)i.add(t[e])}var c=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,d={},f={};function p(e){return l.call(f,e)?!0:l.call(d,e)?!1:u.test(e)?f[e]=!0:(d[e]=!0,!1)}function m(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function h(e,t,n,r){if(t==null||m(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function g(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var _={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){_[e]=new g(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];_[t]=new g(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){_[e]=new g(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){_[e]=new g(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){_[e]=new g(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){_[e]=new g(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){_[e]=new g(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){_[e]=new g(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){_[e]=new g(e,5,!1,e.toLowerCase(),null,!1,!1)});var v=/[\-:]([a-z])/g;function y(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){_[e]=new g(e,1,!1,e.toLowerCase(),null,!1,!1)}),_.xlinkHref=new g(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){_[e]=new g(e,1,!1,e.toLowerCase(),null,!0,!0)});function b(e,t,n,r){var i=_.hasOwnProperty(t)?_[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(h(t,n,i,r)&&(n=null),r||i===null?p(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var x=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,S=Symbol.for(`react.element`),C=Symbol.for(`react.portal`),w=Symbol.for(`react.fragment`),T=Symbol.for(`react.strict_mode`),E=Symbol.for(`react.profiler`),D=Symbol.for(`react.provider`),ee=Symbol.for(`react.context`),O=Symbol.for(`react.forward_ref`),te=Symbol.for(`react.suspense`),k=Symbol.for(`react.suspense_list`),A=Symbol.for(`react.memo`),j=Symbol.for(`react.lazy`),M=Symbol.for(`react.offscreen`),N=Symbol.iterator;function P(e){return typeof e!=`object`||!e?null:(e=N&&e[N]||e[`@@iterator`],typeof e==`function`?e:null)}var ne=Object.assign,re;function ie(e){if(re===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);re=t&&t[1]||``}return`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/docx-preview-DMEG690f.js","assets/chunk-62oNxeRG.js","assets/jszip.min-C9xvYp-s.js","assets/pptx-preview.es-eMvLaQpR.js","assets/pdf.worker-BbbExAx6.js","assets/classPrivateFieldSet2-DSsIYuru.js","assets/pdf-DyX3XLCf.js","assets/agents-B3eGrySi.js","assets/string-coerce-_7w9q4Tr.js","assets/lit-BpL4H2cG.js","assets/directive-Ckb1BD7Q.js","assets/channel-config-extras-DA53eIxW.js","assets/skills-shared-BBT67HQZ.js","assets/channels-CuNr3x8S.js","assets/cron-CS9cgBJT.js","assets/cron-task-list-CU6ybcB9.js","assets/debug-DR6YkUV-.js","assets/instances-BXXkA07m.js","assets/logs-BQrW9h4P.js","assets/nodes-CJ48zMNM.js","assets/sessions-C0-Brdmh.js","assets/skills-DBun6Ded.js","assets/skill-center-B0-YuHLe.js","assets/skill-recency-Baqg_pl3.js","assets/plugins-B5NdnLkj.js","assets/filespace-jYEFvxIi.js","assets/workspace-browser-oC_m4pwR.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e,n as t,t as n}from"./chunk-62oNxeRG.js";import{a as r,c as i,i as a,l as o,n as s,o as c,r as l,s as u,t as d,u as f}from"./lit-BpL4H2cG.js";import{t as p}from"./request-Cif3b33V.js";import{n as m,r as h,t as g}from"./string-coerce-_7w9q4Tr.js";import{n as _,t as v}from"./local-storage-cu5-dJx1.js";import{n as y,r as b,t as x}from"./directive-Ckb1BD7Q.js";import{a as S,c as C,i as w,n as T,o as E,r as D,s as ee,t as O}from"./skill-recency-Baqg_pl3.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})(),typeof Array.prototype.toSorted!=`function`&&Object.defineProperty(Array.prototype,`toSorted`,{value:function(e){return[...this].sort(e)},writable:!0,configurable:!0}),typeof Array.prototype.toReversed!=`function`&&Object.defineProperty(Array.prototype,`toReversed`,{value:function(){return[...this].reverse()},writable:!0,configurable:!0}),typeof Array.prototype.toSpliced!=`function`&&Object.defineProperty(Array.prototype,`toSpliced`,{value:function(e,t,...n){let r=[...this];return t===void 0?r.splice(e):r.splice(e,t,...n),r},writable:!0,configurable:!0}),typeof Array.prototype.with!=`function`&&Object.defineProperty(Array.prototype,`with`,{value:function(e,t){let n=[...this],r=e<0?n.length+e:e;if(r<0||r>=n.length)throw RangeError(`Invalid index`);return n[r]=t,n},writable:!0,configurable:!0});var te={attribute:!0,type:String,converter:o,reflect:!1,hasChanged:i},k=(e=te,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function A(e){return(t,n)=>typeof n==`object`?k(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function j(e){return A({...e,state:!0,attribute:!1})}var M=(e,t,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&typeof t!=`object`&&Object.defineProperty(e,t,n),n);function N(e,t){return(n,r,i)=>{let a=t=>{var n;return((n=t.renderRoot)==null?void 0:n.querySelector(e))??null};if(t){let{get:e,set:t}=typeof r==`object`?n:i??(()=>{let e=Symbol();return{get(){return this[e]},set(t){this[e]=t}}})();return M(n,r,{get(){let n=e.call(this);return n===void 0&&(n=a(this),(n!==null||this.hasUpdated)&&t.call(this,n)),n}})}return M(n,r,{get(){return a(this)}})}}var P=e=>p(`/api/sealclaw/api-keys`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}),ne=()=>p(`/api/sealclaw/api-keys`),re=e=>p(`/api/sealclaw/api-keys/${e}`,{method:`DELETE`}),ie=e=>p(`/api/sealclaw/v1/models`,e?{headers:{Authorization:`Bearer ${e}`,token:e}}:void 0),F=n((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ee(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var O=/\/+/g;function te(e,t){return typeof e==`object`&&e&&e.key!=null?ee(``+e.key):t.toString(36)}function k(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+te(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(O,`$&/`)+`/`),k(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(O,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+te(s,l);c+=k(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+te(s,l++),c+=k(s,r,i,u,o);else if(s===`object`)throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`);return c}function A(e,t,n){if(e==null)return e;var r=[],i=0;return k(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function j(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var M={current:null},N={transition:null},P={ReactCurrentDispatcher:M,ReactCurrentBatchConfig:N,ReactCurrentOwner:C};function ne(){throw Error(`act(...) is not supported in production builds of React.`)}e.Children={map:A,forEach:function(e,t,n){A(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return A(e,function(){t++}),t},toArray:function(e){return A(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}},e.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=P,e.act=ne,e.cloneElement=function(e,n,r){if(e==null)throw Error(`React.cloneElement(...): The argument must be a React element, but you passed `+e+`.`);var i=h({},e.props),a=e.key,o=e.ref,s=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,s=C.current),n.key!==void 0&&(a=``+n.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in n)S.call(n,l)&&!w.hasOwnProperty(l)&&(i[l]=n[l]===void 0&&c!==void 0?c[l]:n[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:t,type:e.type,key:a,ref:o,props:i,_owner:s}},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o,_context:e},e.Consumer=e},e.createElement=T,e.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:j}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=N.transition;N.transition={};try{e()}finally{N.transition=t}},e.unstable_act=ne,e.useCallback=function(e,t){return M.current.useCallback(e,t)},e.useContext=function(e){return M.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return M.current.useDeferredValue(e)},e.useEffect=function(e,t){return M.current.useEffect(e,t)},e.useId=function(){return M.current.useId()},e.useImperativeHandle=function(e,t,n){return M.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return M.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return M.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return M.current.useMemo(e,t)},e.useReducer=function(e,t,n){return M.current.useReducer(e,t,n)},e.useRef=function(e){return M.current.useRef(e)},e.useState=function(e){return M.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return M.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return M.current.useTransition()},e.version=`18.3.1`})),I=n(((e,t)=>{t.exports=F()})),L=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,A(x);else{var t=n(l);t!==null&&j(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&j(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function ee(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?O():(S=!1,C=null)}}else S=!1}var O;if(typeof v==`function`)O=function(){v(ee)};else if(typeof MessageChannel<`u`){var te=new MessageChannel,k=te.port2;te.port1.onmessage=ee,O=function(){k.postMessage(null)}}else O=function(){g(ee,0)};function A(e){C=e,S||(S=!0,O())}function j(t,n){w=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,A(x))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,j(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,A(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),ae=n(((e,t)=>{t.exports=L()})),oe=n((e=>{var t=I(),n=ae();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var i=new Set,a={};function o(e,t){s(e,t),s(e+`Capture`,t)}function s(e,t){for(a[e]=t,e=0;e<t.length;e++)i.add(t[e])}var c=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,d={},f={};function p(e){return l.call(f,e)?!0:l.call(d,e)?!1:u.test(e)?f[e]=!0:(d[e]=!0,!1)}function m(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function h(e,t,n,r){if(t==null||m(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function g(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var _={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){_[e]=new g(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];_[t]=new g(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){_[e]=new g(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){_[e]=new g(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){_[e]=new g(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){_[e]=new g(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){_[e]=new g(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){_[e]=new g(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){_[e]=new g(e,5,!1,e.toLowerCase(),null,!1,!1)});var v=/[\-:]([a-z])/g;function y(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){_[e]=new g(e,1,!1,e.toLowerCase(),null,!1,!1)}),_.xlinkHref=new g(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){_[e]=new g(e,1,!1,e.toLowerCase(),null,!0,!0)});function b(e,t,n,r){var i=_.hasOwnProperty(t)?_[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(h(t,n,i,r)&&(n=null),r||i===null?p(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var x=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,S=Symbol.for(`react.element`),C=Symbol.for(`react.portal`),w=Symbol.for(`react.fragment`),T=Symbol.for(`react.strict_mode`),E=Symbol.for(`react.profiler`),D=Symbol.for(`react.provider`),ee=Symbol.for(`react.context`),O=Symbol.for(`react.forward_ref`),te=Symbol.for(`react.suspense`),k=Symbol.for(`react.suspense_list`),A=Symbol.for(`react.memo`),j=Symbol.for(`react.lazy`),M=Symbol.for(`react.offscreen`),N=Symbol.iterator;function P(e){return typeof e!=`object`||!e?null:(e=N&&e[N]||e[`@@iterator`],typeof e==`function`?e:null)}var ne=Object.assign,re;function ie(e){if(re===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);re=t&&t[1]||``}return`
|
|
3
3
|
`+re+e}var F=!1;function L(e,t){if(!e||F)return``;F=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(`
|
|
4
4
|
`),a=r.stack.split(`
|
|
5
5
|
`),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=`
|
|
@@ -3600,7 +3600,7 @@ ${e.outputText}</pre
|
|
|
3600
3600
|
`}
|
|
3601
3601
|
</div>
|
|
3602
3602
|
</div>
|
|
3603
|
-
`}function Vq(e,t){let n={...t,lastActiveSessionKey:h(t.lastActiveSessionKey)??h(t.sessionKey)??`main`};e.settings=n,HI(n),$F(n.customTheme),(t.theme!==e.theme||t.themeMode!==e.themeMode)&&(e.theme=t.theme,e.themeMode=t.themeMode,sJ(e,sI(t.theme,t.themeMode))),oJ(t.borderRadius),e.applySessionKey=e.settings.lastActiveSessionKey}function Hq(e,t){let n=fI({name:e.userName,avatar:e.userAvatar,...t});e.userName=n.name,e.userAvatar=n.avatar,WI(n)}function Uq(e,t){e.sessionKey=t,Vq(e,{...e.settings,sessionKey:t,lastActiveSessionKey:t})}var Wq=!1,Gq=`openclaw.control.qiankun-tab.v1`;function Kq(){return typeof window>`u`?!1:!!window.__POWERED_BY_QIANKUN__}function qq(){let e=v();if(!e)return null;try{let t=e.getItem(Gq);if(t&&DS(t))return t}catch{}return null}function Jq(e){let t=v();if(t)try{t.setItem(Gq,e)}catch{}}function Yq(e){if(!window.location.search&&!window.location.hash)return;let t=new URL(window.location.href),n=new URLSearchParams(t.search),r=t.hash.startsWith(`#`)?t.hash.slice(1):t.hash,i=``,a=r;if(r.startsWith(`/`)){let e=r.indexOf(`&`);e>=0?(i=r.slice(0,e),a=r.slice(e+1)):(i=r,a=``)}let o=new URLSearchParams(a),s=n.get(`gatewayUrl`)??o.get(`gatewayUrl`),c=h(s)??``,l=!!(c&&c!==e.settings.gatewayUrl),u=n.get(`token`),d=o.get(`token`),f=d!=null||u!=null||!1,p=h(d??u??null),m=h(n.get(`session`)??o.get(`session`)),g=m===`__draft__`?null:m,_=!!(p&&!g&&!l&&!Kq()),v=!1;if(n.has(`token`)&&(n.delete(`token`),v=!0),f&&(u!=null&&(Wq=!0,console.warn(`[openclaw] Auth token passed as query parameter (?token=). Use URL fragment instead: #token=<token>. Query parameters may appear in server logs.`)),p&&l?e.pendingGatewayToken=p:p&&p!==e.settings.token&&Vq(e,{...e.settings,token:p}),o.delete(`token`),v=!0),_&&(e.sessionKey=`main`,Vq(e,{...e.settings,sessionKey:`main`,lastActiveSessionKey:`main`})),(n.has(`password`)||o.has(`password`))&&(n.delete(`password`),o.delete(`password`),v=!0),g&&Uq(e,g),s!=null&&(e.pendingGatewayUrl=l?c:null,e.pendingGatewayToken=l?p??null:null,n.delete(`gatewayUrl`),o.delete(`gatewayUrl`),v=!0),!v)return;t.search=n.toString();let y=o.toString();t.hash=i?`#${i}${y?`&${y}`:``}`:y?`#${y}`:``,fJ(t,!0)}function Xq(e,t){mJ(e,t,{refreshPolicy:`always`,syncUrl:!0})}function Zq(e,t,n,r){YI({nextTheme:t,applyTheme:n,context:r,currentTheme:e.themeResolved}),cJ(e)}function Qq(e,t,n){Zq(e,sI(t,e.themeMode),()=>Vq(e,{...e.settings,theme:t}),n)}function $q(e,t,n){Zq(e,sI(e.theme,t),()=>Vq(e,{...e.settings,themeMode:t}),n)}async function eJ(e,t){var n,r,i;await Eg(t),await sm(t);let a=((n=e.agentsList)==null||(n=n.agents)==null?void 0:n.map(e=>e.id))??[];a.length>0&&KO(t,a);let o=e.agentsSelectedId??((r=e.agentsList)==null?void 0:r.defaultId)??((i=e.agentsList)==null||(i=i.agents)==null||(i=i[0])==null?void 0:i.id);if(o)switch(GO(t,o),e.agentsPanel){case`files`:HO(t,o);return;case`skills`:qO(t,o);return;case`channels`:vp(t,!1);return;case`cron`:TJ(e);return;case`overview`:case`tools`:case void 0:return}}async function tJ(e){let t=e,n=MO(e,e.tab);try{switch(e.tab){case`config`:case`communications`:case`appearance`:case`automation`:case`infrastructure`:case`aiAgents`:await cm(t),await sm(t);break;case`overview`:await yJ(e);break;case`channels`:await wJ(e);break;case`instances`:await UA(t);break;case`usage`:await mj(t);break;case`sessions`:await L_(t);break;case`cron`:await TJ(e);break;case`cronTasks`:await Promise.allSettled([TJ(e),L_(t),!t.skillsReport&&!t.skillsLoading?KA(t,{}):Promise.resolve()]);break;case`skills`:await KA(t);break;case`agents`:await eJ(e,t);break;case`nodes`:await fO(t),await Promise.allSettled([Ik(t),sm(t),FA(t)]);break;case`dreams`:await sm(t),await Promise.all([_A(t),vA(t),yA(t),bA(t)]);break;case`chat`:await _D(e),!t.skillsReport&&!t.skillsLoading&&KA(t,{}),e.sessionKey!==`__draft__`&&Lv(e,!e.chatHasAutoScrolled);break;case`debug`:await iO(t),e.eventLog=e.eventLogBuffer;break;case`logs`:e.logsAtBottom=!0,await dO(t,{reset:!0}),Hv(e,!0);break}PO(e,n,`ok`)}catch(t){throw PO(e,n,`error`),t}}function nJ(){if(typeof window>`u`)return``;let e=window.__OPENCLAW_CONTROL_UI_BASE_PATH__,t=h(e);return t?OS(t):MS(window.location.pathname)}function rJ(e){$F(e.settings.customTheme);let t=e.settings.theme===`custom`&&!e.settings.customTheme?`claw`:e.settings.theme??`claw`;e.theme=t,e.themeMode=e.settings.themeMode??`system`,t!==e.settings.theme&&(e.settings={...e.settings,theme:t},HI(e.settings)),sJ(e,sI(e.theme,e.themeMode)),oJ(e.settings.borderRadius??50),cJ(e)}function iJ(e){var t;(t=e.systemThemeCleanup)==null||t.call(e),e.systemThemeCleanup=null}var aJ={sm:6,md:10,lg:14,xl:20,full:9999,default:10};function oJ(e){if(typeof document>`u`)return;let t=document.documentElement,n=e/50;t.style.setProperty(`--radius-sm`,`${Math.round(aJ.sm*n)}px`),t.style.setProperty(`--radius-md`,`${Math.round(aJ.md*n)}px`),t.style.setProperty(`--radius-lg`,`${Math.round(aJ.lg*n)}px`),t.style.setProperty(`--radius-xl`,`${Math.round(aJ.xl*n)}px`),t.style.setProperty(`--radius-full`,`${Math.round(aJ.full*n)}px`),t.style.setProperty(`--radius`,`${Math.round(aJ.default*n)}px`)}function sJ(e,t){var n;if(e.themeResolved=t,typeof document>`u`)return;let r=document.documentElement,i=t.endsWith(`light`)?`light`:`dark`;r.dataset.theme=t,r.dataset.themeMode=i,r.style.colorScheme=i,(n=document.querySelector(`.ss-shell`))==null||n.classList.toggle(`ss-shell--aiCreation`,i===`dark`);let a=``;try{a=getComputedStyle(r).getPropertyValue(`--bg`).trim()}catch{}yO(a)}function cJ(e){if(e.themeMode!==`system`){var t;(t=e.systemThemeCleanup)==null||t.call(e),e.systemThemeCleanup=null;return}if(e.systemThemeCleanup||typeof globalThis.matchMedia!=`function`)return;let n=globalThis.matchMedia(`(prefers-color-scheme: light)`),r=()=>{e.themeMode===`system`&&sJ(e,sI(e.theme,`system`))};if(typeof n.addEventListener==`function`){n.addEventListener(`change`,r),e.systemThemeCleanup=()=>n.removeEventListener(`change`,r);return}typeof n.addListener==`function`&&(n.addListener(r),e.systemThemeCleanup=()=>n.removeListener(r))}function lJ(e,t){if(typeof window>`u`)return;let n=(Kq()?qq():null)??jS(window.location.pathname,e.basePath)??`chat`;_J(e,n),dJ(e,n),hJ(e,n,t)}function uJ(e){if(typeof window>`u`)return;let t=new URL(window.location.href),n=h(t.searchParams.get(`session`)),r=n===`__draft__`?null:n,i=!!r&&r!==e.sessionKey;if(Kq()){if(!pJ())return;if(i&&r){var a;(a=e.switchSessionFromHistory)==null||a.call(e,r)}let n=h(t.searchParams.get(`tab`)),o=n&&DS(n)?n:`chat`;_J(e,o),o!==e.tab&&dJ(e,o);return}let o=jS(window.location.pathname,e.basePath);if(o){if(i&&r){var s;(s=e.switchSessionFromHistory)==null||s.call(e,r)}_J(e,o),dJ(e,o)}}function dJ(e,t){mJ(e,t,{refreshPolicy:`connected`})}function fJ(e,t){let n=typeof window>`u`?void 0:window.history;if(!n)return;let r={sealclawNav:!0};return t?n.replaceState(r,``,e.toString()):n.pushState(r,``,e.toString())}function pJ(){var e;return typeof window>`u`?!1:!!(!((e=window.history)==null||(e=e.state)==null)&&e.sealclawNav)}function mJ(e,t,n){let r=e.tab;e.tab=t,Kq()&&Jq(t),r!==t&&jO(e,r,t),r===`chat`&&t!==`chat`&&uq(),t===`chat`&&(e.chatHasAutoScrolled=!1),(t===`logs`?hO:gO)(e),(t===`debug`?_O:vO)(e),(n.refreshPolicy===`always`||e.connected)&&tJ(e),n.syncUrl&&hJ(e,t,!1)}function hJ(e,t,n){var r,i;let a=typeof window>`u`||(r=window.location)==null?void 0:r.href;if(!a)return;let o=new URL(a);if(t===`chat`&&e.sessionKey&&e.sessionKey!==`__draft__`?o.searchParams.set(`session`,e.sessionKey):o.searchParams.delete(`session`),t===`settings`?o.searchParams.set(`settingsMenu`,e.settingsActiveMenu??`general`):o.searchParams.delete(`settingsMenu`),Kq()){t===`chat`?o.searchParams.delete(`tab`):o.searchParams.set(`tab`,t),fJ(o,n);return}let s=(i=window.location)==null?void 0:i.pathname;if(!s)return;let c=kS(AS(t,e.basePath));kS(s)!==c&&(o.pathname=c),fJ(o,n)}function gJ(e,t,n){var r;let i=typeof window>`u`||(r=window.location)==null?void 0:r.href;if(!i)return;e.settingsActiveMenu=t;let a=new URL(i);a.searchParams.set(`settingsMenu`,t),fJ(a,n)}function _J(e,t){if(t!==`settings`||typeof window>`u`)return;let n=new URL(window.location.href).searchParams.get(`settingsMenu`);e.settingsActiveMenu=n===`identity`||n===`backup`?n:`general`}function vJ(e,t,n){var r;let i=typeof window>`u`||(r=window.location)==null?void 0:r.href;if(!i)return;let a=new URL(i);t===`__draft__`?a.searchParams.delete(`session`):a.searchParams.set(`session`,t),fJ(a,n)}async function yJ(e,t){let n=e,r=(e.controlUiOverviewRefreshSeq??0)+1;e.controlUiOverviewRefreshSeq=r;let i=()=>e.controlUiOverviewRefreshSeq===r&&e.tab===`overview`;await Promise.allSettled([vp(n,!1),UA(n),L_(n),ik(n),sk(n)]),i()&&CJ(n);let a=wO();Promise.allSettled([iO(n),mj(n),SJ(n),HA(n,{refresh:t==null?void 0:t.refresh})]).then(e=>{if(!i())return;let t=e.some(e=>e.status===`rejected`)?`error`:`ok`;CJ(n),kO(n,`control-ui.overview.secondary`,{phase:`end`,status:t,durationMs:TO(wO()-a)},{console:!1})})}function bJ(e){return e!=null&&e.scopes?rO({role:e.role??`operator`,requestedScopes:[`operator.read`],allowedScopes:e.scopes}):!1}function xJ(e){return e?Object.values(e).some(e=>Array.isArray(e)&&e.length>0):!1}async function SJ(e){if(!(!e.client||!e.connected))try{let t=await e.client.request(`logs.tail`,{cursor:e.overviewLogCursor||void 0,limit:100,maxBytes:5e4}),n=Array.isArray(t.lines)?t.lines.filter(e=>typeof e==`string`):[];e.overviewLogLines=[...e.overviewLogLines,...n].slice(-500),typeof t.cursor==`number`&&(e.overviewLogCursor=t.cursor)}catch{}}function CJ(e){var t;let n=[];e.lastError&&n.push({severity:`error`,icon:`x`,title:`Gateway Error`,description:e.lastError});let r=e.hello,i=(r==null?void 0:r.auth)??null;i!=null&&i.scopes&&!bJ(i)&&n.push({severity:`warning`,icon:`key`,title:`Missing operator.read scope`,description:`This connection does not have the operator.read scope. Some features may be unavailable.`,href:`https://docs.openclaw.ai/web/dashboard`,external:!0});let a=((t=e.skillsReport)==null?void 0:t.skills)??[],o=a.filter(e=>!e.disabled&&xJ(e.missing));if(o.length>0){let e=o.slice(0,3).map(e=>e.name),t=o.length>3?` +${o.length-3} more`:``;n.push({severity:`warning`,icon:`zap`,title:`Skills with missing dependencies`,description:`${e.join(`, `)}${t}`})}let s=a.filter(e=>e.blockedByAllowlist);s.length>0&&n.push({severity:`warning`,icon:`shield`,title:`${s.length} skill${s.length>1?`s`:``} blocked`,description:s.map(e=>e.name).join(`, `)});let c=e.cronJobs??[],l=c.filter(e=>{var t;return((t=e.state)==null?void 0:t.lastStatus)===`error`});l.length>0&&n.push({severity:`error`,icon:`clock`,title:`${l.length} cron job${l.length>1?`s`:``} failed`,description:l.map(e=>e.name).join(`, `)});let u=Date.now(),d=c.filter(e=>{var t;return e.enabled&&((t=e.state)==null?void 0:t.nextRunAtMs)!=null&&u-e.state.nextRunAtMs>3e5});d.length>0&&n.push({severity:`warning`,icon:`clock`,title:`${d.length} overdue job${d.length>1?`s`:``}`,description:d.map(e=>e.name).join(`, `)});let f=e.modelAuthStatusResult;if(f){let e=(f.providers??[]).filter(eI),t=e.filter(e=>e.status===`expired`||e.status===`missing`);t.length>0&&n.push({severity:`error`,icon:`key`,title:`模型认证已过期`,description:`${t.map(e=>e.displayName).join(`, `)} — 使用 openclaw models auth 重新认证`});let r=e.filter(e=>e.status===`expiring`);r.length>0&&n.push({severity:`warning`,icon:`key`,title:`模型认证即将过期`,description:r.map(e=>{var t;return`${e.displayName}(${((t=e.expiry)==null?void 0:t.label)??`soon`})`}).join(`, `)})}e.attentionItems=n}async function wJ(e){let t=e;await Promise.all([vp(t,!0),cm(t),sm(t)])}async function TJ(e){let t=e,n=t.cronRunsScope===`job`?t.cronRunsJobId:null,r=(e.controlUiCronRefreshSeq??0)+1;e.controlUiCronRefreshSeq=r;let i=()=>e.controlUiCronRefreshSeq===r&&e.tab===`cron`,a=wO();kk(t,n).catch(()=>`error`).then(e=>{i()&&kO(t,`control-ui.cron.runs`,{phase:`end`,status:e,durationMs:TO(wO()-a)},{console:!1})}),await Promise.all([vp(t,!1),ik(t),sk(t),ck(t)])}async function EJ(e){await ck(e)}var DJ=/^\s*NO_REPLY\s*$/;function OJ(e){if(!e||typeof e!=`object`)return!1;let t=e,n=g(t.role);if(n&&n!==`assistant`||!(`content`in t)&&!(`text`in t))return!1;let r=Lb(e);return typeof r==`string`&&r.trim()!==``&&!DJ.test(r)}function kJ(e){return!!(e&&e.state===`final`&&!OJ(e.message))}function AJ(e){if(!e||typeof e!=`object`)return null;let t=e;if(t.kind!==`btw`)return null;let n=h(t.runId),r=h(t.sessionKey),i=h(t.question),a=h(t.text);return n&&r&&i&&a?{kind:`btw`,runId:n,sessionKey:r,question:i,text:a,isError:t.isError===!0,ts:typeof t.ts==`number`&&Number.isFinite(t.ts)?t.ts:Date.now()}:null}var jJ=new WeakMap;function MJ(e){let t=e,n=(jJ.get(t)??0)+1;return jJ.set(t,n),n}function NJ(e,t,n){return jJ.get(e)===t&&e.sessionKey.trim()===n}async function PJ(e,t){var n;if(!e.client||!e.connected)return;let r=(t==null||(n=t.sessionKey)==null?void 0:n.trim())||e.sessionKey.trim(),i=r?{sessionKey:r}:{},a=MJ(e);try{let t=await e.client.request(`agent.identity.get`,i);if(!NJ(e,a,r)||!t)return;let n=rE(t);e.assistantName=n.name,e.assistantAvatar=n.avatar,e.assistantAvatarSource=n.avatarSource??null,e.assistantAvatarStatus=n.avatarStatus??null,e.assistantAvatarReason=n.avatarReason??null,e.assistantAgentId=n.agentId??null;let o=GI().avatar;o&&(e.assistantAvatar=o,e.assistantAvatarSource=o,e.assistantAvatarStatus=`data`,e.assistantAvatarReason=null)}catch{}}function FJ(e,t){KI({avatar:t}),t?(e.assistantAvatar=t,e.assistantAvatarSource=t,e.assistantAvatarStatus=`data`,e.assistantAvatarReason=null):(e.assistantAvatar=null,e.assistantAvatarSource=null,e.assistantAvatarStatus=null,e.assistantAvatarReason=null)}var IJ=`/__openclaw/control-ui-config.json`;function LJ(e){var t;let n=(t=vg(e.sessionKey))==null?void 0:t.agentId;if(n)return bg(n);let r=h(e.assistantAgentId);return r?bg(r):null}function RJ(e){let t=h(e);return t?bg(t):null}function zJ(e){let t=GI().avatar;t&&(e.assistantAvatar=t,e.assistantAvatarSource=t,e.assistantAvatarStatus=`data`,e.assistantAvatarReason=null)}async function BJ(e,t){if(typeof window>`u`||typeof fetch!=`function`)return;let n=OS(e.basePath??``),r=n?`${n}${IJ}`:IJ;try{let n=new URL(r,window.location.origin).origin===window.location.origin?Ju(e):[],i=n.length>0?n:[``],a=null;for(let e of i){let t={Accept:`application/json`};if(e&&(t.Authorization=`Bearer ${e}`),a=await fetch(r,{method:`GET`,headers:t,credentials:`same-origin`}),a.ok)break;if(a.status!==401&&a.status!==403)return}if(!a||!a.ok)return;let o=await a.json();if((t==null?void 0:t.applyIdentity)!==!1){let t=LJ(e),n=RJ(o.assistantAgentId??null);if(!t||!n||t===n){let t=rE({agentId:o.assistantAgentId??null,name:o.assistantName,avatar:o.assistantAvatar??null,avatarSource:o.assistantAvatarSource??null,avatarStatus:o.assistantAvatarStatus??null,avatarReason:o.assistantAvatarReason??null});e.assistantName=t.name,e.assistantAvatar=t.avatar,e.assistantAvatarSource=t.avatarSource??null,e.assistantAvatarStatus=t.avatarStatus??null,e.assistantAvatarReason=t.avatarReason??null,e.assistantAgentId=t.agentId??null}zJ(e)}e.serverVersion=o.serverVersion??null,e.localMediaPreviewRoots=Array.isArray(o.localMediaPreviewRoots)?o.localMediaPreviewRoots.filter(e=>typeof e==`string`):[],e.embedSandboxMode=o.embedSandbox===`trusted`?`trusted`:o.embedSandbox===`strict`?`strict`:`scripts`,e.allowExternalEmbedUrls=o.allowExternalEmbedUrls===!0,e.chatMessageMaxWidth=typeof o.chatMessageMaxWidth==`string`&&o.chatMessageMaxWidth.trim()?o.chatMessageMaxWidth:null}catch{}}function VJ(e){let t=e.request.sessionKey;return typeof t==`string`&&t.trim()||null}function HJ(e,t){return JJ(e).find(e=>e.kind===`plugin`&&VJ(e)===t)??null}function UJ(e,t){let n=JJ(e);return t?n.find(e=>e.id===t)??null:n[0]??null}function WJ(e){return typeof e==`object`&&!!e}function GJ(e){if(!WJ(e))return null;let t=h(e.id)??``,n=e.request;if(!t||!WJ(n))return null;let r=h(n.command)??``;if(!r)return null;let i=typeof e.createdAtMs==`number`?e.createdAtMs:0,a=typeof e.expiresAtMs==`number`?e.expiresAtMs:0;return!i||!a?null:{id:t,kind:`exec`,request:{command:r,cwd:typeof n.cwd==`string`?n.cwd:null,host:typeof n.host==`string`?n.host:null,security:typeof n.security==`string`?n.security:null,ask:typeof n.ask==`string`?n.ask:null,agentId:typeof n.agentId==`string`?n.agentId:null,resolvedPath:typeof n.resolvedPath==`string`?n.resolvedPath:null,sessionKey:typeof n.sessionKey==`string`?n.sessionKey:null},createdAtMs:i,expiresAtMs:a}}function KJ(e){if(!WJ(e))return null;let t=h(e.id)??``;return t?{id:t,decision:typeof e.decision==`string`?e.decision:null,resolvedBy:typeof e.resolvedBy==`string`?e.resolvedBy:null,ts:typeof e.ts==`number`?e.ts:null}:null}function qJ(e){if(!WJ(e))return null;let t=h(e.id)??``;if(!t)return null;let n=typeof e.createdAtMs==`number`?e.createdAtMs:0,r=typeof e.expiresAtMs==`number`?e.expiresAtMs:0;if(!n||!r)return null;let i=WJ(e.request)?e.request:{},a=h(i.title)??``;if(!a)return null;let o=typeof i.description==`string`?i.description:null,s=typeof i.severity==`string`?i.severity:null,c=typeof i.pluginId==`string`?i.pluginId:null;return{id:t,kind:`plugin`,request:{command:a,agentId:typeof i.agentId==`string`?i.agentId:null,sessionKey:typeof i.sessionKey==`string`?i.sessionKey:null},pluginTitle:a,pluginDescription:o,pluginSeverity:s,pluginId:c,createdAtMs:n,expiresAtMs:r}}function JJ(e){let t=Date.now();return e.filter(e=>e.expiresAtMs>t)}function YJ(e,t){let n=JJ(e).filter(e=>e.id!==t.id);return n.unshift(t),n}function XJ(e,t){return JJ(e).filter(e=>e.id!==t)}var ZJ={ok:!1,ts:0,durationMs:0,heartbeatSeconds:0,defaultAgentId:``,agents:[],sessions:{path:``,count:0,recent:[]}};async function QJ(e){try{return await e.request(`health`,{})??ZJ}catch{return ZJ}}async function $J(e){if(!(!e.client||!e.connected)&&!e.healthLoading){e.healthLoading=!0,e.healthError=null;try{e.healthResult=await QJ(e.client)}catch(t){e.healthError=String(t)}finally{e.healthLoading=!1}}}function eY(){return`https://gatewaytest.sealseek.cn`}var tY=`sealseek-canvas`,nY=3600*1e3,rY=3600*1e3;function iY(){let e=v();return(e==null?void 0:e.getItem(`jwt`))??``}function aY(){return`${eY()}/api/sealseek-infinitecanvas/mcp`}function oY(e){let t=e?{transport:`streamable-http`,url:aY(),headers:{Authorization:`Bearer ${e}`,Accept:`application/json, text/event-stream`,token:e},toolTimeouts:{generate_image:nY,generate_video:rY}}:null;return JSON.stringify({mcp:{servers:{[tY]:t}}})}async function sY(e){if(e.getConfig){let t=e.getConfig();if(e.jwt&&lY(t,e.jwt)||!e.jwt&&!cY(t))return!1}return await Cp({request:e.request,reload:e.reload,getBaseHash:e.getBaseHash,raw:oY(e.jwt)}),!0}function cY(e){var t;let n=e==null||(t=e.mcp)==null?void 0:t.servers;return!!(n&&n[`sealseek-canvas`])}function lY(e,t){var n,r,i,a;let o=e==null||(n=e.mcp)==null||(n=n.servers)==null?void 0:n[tY];return o?typeof((r=o.headers)==null?void 0:r.token)==`string`&&o.headers.token===t&&((i=o.toolTimeouts)==null?void 0:i.generate_image)===nY&&((a=o.toolTimeouts)==null?void 0:a.generate_video)===rY:!1}function uY(){return[`把当前会话内容总结成画布,调用 sealseek-canvas MCP 工具,按 read_me 说明生成,完成后预览画布链接`,`文本里标点符号用字面量,换行等别用字面量`,`若本轮对话中已创建过画布,则用 update_canvas 追加;否则用 create_canvas 新建`].join(`
|
|
3603
|
+
`}function Vq(e,t){let n={...t,lastActiveSessionKey:h(t.lastActiveSessionKey)??h(t.sessionKey)??`main`};e.settings=n,HI(n),$F(n.customTheme),(t.theme!==e.theme||t.themeMode!==e.themeMode)&&(e.theme=t.theme,e.themeMode=t.themeMode,sJ(e,sI(t.theme,t.themeMode))),oJ(t.borderRadius),e.applySessionKey=e.settings.lastActiveSessionKey}function Hq(e,t){let n=fI({name:e.userName,avatar:e.userAvatar,...t});e.userName=n.name,e.userAvatar=n.avatar,WI(n)}function Uq(e,t){e.sessionKey=t,Vq(e,{...e.settings,sessionKey:t,lastActiveSessionKey:t})}var Wq=!1,Gq=`openclaw.control.qiankun-tab.v1`;function Kq(){return typeof window>`u`?!1:!!window.__POWERED_BY_QIANKUN__}function qq(){let e=v();if(!e)return null;try{let t=e.getItem(Gq);if(t&&DS(t))return t}catch{}return null}function Jq(e){let t=v();if(t)try{t.setItem(Gq,e)}catch{}}function Yq(e){if(!window.location.search&&!window.location.hash)return;let t=new URL(window.location.href),n=new URLSearchParams(t.search),r=t.hash.startsWith(`#`)?t.hash.slice(1):t.hash,i=``,a=r;if(r.startsWith(`/`)){let e=r.indexOf(`&`);e>=0?(i=r.slice(0,e),a=r.slice(e+1)):(i=r,a=``)}let o=new URLSearchParams(a),s=n.get(`gatewayUrl`)??o.get(`gatewayUrl`),c=h(s)??``,l=!!(c&&c!==e.settings.gatewayUrl),u=n.get(`token`),d=o.get(`token`),f=d!=null||u!=null||!1,p=h(d??u??null),m=h(n.get(`session`)??o.get(`session`)),g=m===`__draft__`?null:m,_=!!(p&&!g&&!l&&!Kq()),v=!1;if(n.has(`token`)&&(n.delete(`token`),v=!0),f&&(u!=null&&(Wq=!0,console.warn(`[openclaw] Auth token passed as query parameter (?token=). Use URL fragment instead: #token=<token>. Query parameters may appear in server logs.`)),p&&l?e.pendingGatewayToken=p:p&&p!==e.settings.token&&Vq(e,{...e.settings,token:p}),o.delete(`token`),v=!0),_&&(e.sessionKey=`main`,Vq(e,{...e.settings,sessionKey:`main`,lastActiveSessionKey:`main`})),(n.has(`password`)||o.has(`password`))&&(n.delete(`password`),o.delete(`password`),v=!0),g&&Uq(e,g),s!=null&&(e.pendingGatewayUrl=l?c:null,e.pendingGatewayToken=l?p??null:null,n.delete(`gatewayUrl`),o.delete(`gatewayUrl`),v=!0),!v)return;t.search=n.toString();let y=o.toString();t.hash=i?`#${i}${y?`&${y}`:``}`:y?`#${y}`:``,fJ(t,!0)}function Xq(e,t){mJ(e,t,{refreshPolicy:`always`,syncUrl:!0})}function Zq(e,t,n,r){YI({nextTheme:t,applyTheme:n,context:r,currentTheme:e.themeResolved}),cJ(e)}function Qq(e,t,n){Zq(e,sI(t,e.themeMode),()=>Vq(e,{...e.settings,theme:t}),n)}function $q(e,t,n){Zq(e,sI(e.theme,t),()=>Vq(e,{...e.settings,themeMode:t}),n)}async function eJ(e,t){var n,r,i;await Eg(t),await sm(t);let a=((n=e.agentsList)==null||(n=n.agents)==null?void 0:n.map(e=>e.id))??[];a.length>0&&KO(t,a);let o=e.agentsSelectedId??((r=e.agentsList)==null?void 0:r.defaultId)??((i=e.agentsList)==null||(i=i.agents)==null||(i=i[0])==null?void 0:i.id);if(o)switch(GO(t,o),e.agentsPanel){case`files`:HO(t,o);return;case`skills`:qO(t,o);return;case`channels`:vp(t,!1);return;case`cron`:TJ(e);return;case`overview`:case`tools`:case void 0:return}}async function tJ(e){let t=e,n=MO(e,e.tab);try{switch(e.tab){case`config`:case`communications`:case`appearance`:case`automation`:case`infrastructure`:case`aiAgents`:await cm(t),await sm(t);break;case`overview`:await yJ(e);break;case`channels`:await wJ(e);break;case`instances`:await UA(t);break;case`usage`:await mj(t);break;case`sessions`:await L_(t);break;case`cron`:await TJ(e);break;case`cronTasks`:await Promise.allSettled([TJ(e),L_(t),!t.skillsReport&&!t.skillsLoading?KA(t,{}):Promise.resolve()]);break;case`skills`:await KA(t);break;case`agents`:await eJ(e,t);break;case`nodes`:await fO(t),await Promise.allSettled([Ik(t),sm(t),FA(t)]);break;case`dreams`:await sm(t),await Promise.all([_A(t),vA(t),yA(t),bA(t)]);break;case`chat`:await _D(e),!t.skillsReport&&!t.skillsLoading&&KA(t,{}),e.sessionKey!==`__draft__`&&Lv(e,!e.chatHasAutoScrolled);break;case`debug`:await iO(t),e.eventLog=e.eventLogBuffer;break;case`logs`:e.logsAtBottom=!0,await dO(t,{reset:!0}),Hv(e,!0);break}PO(e,n,`ok`)}catch(t){throw PO(e,n,`error`),t}}function nJ(){if(typeof window>`u`)return``;let e=window.__OPENCLAW_CONTROL_UI_BASE_PATH__,t=h(e);return t?OS(t):MS(window.location.pathname)}function rJ(e){$F(e.settings.customTheme);let t=e.settings.theme===`custom`&&!e.settings.customTheme?`claw`:e.settings.theme??`claw`;e.theme=t,e.themeMode=e.settings.themeMode??`system`,t!==e.settings.theme&&(e.settings={...e.settings,theme:t},HI(e.settings)),sJ(e,sI(e.theme,e.themeMode)),oJ(e.settings.borderRadius??50),cJ(e)}function iJ(e){var t;(t=e.systemThemeCleanup)==null||t.call(e),e.systemThemeCleanup=null}var aJ={sm:6,md:10,lg:14,xl:20,full:9999,default:10};function oJ(e){if(typeof document>`u`)return;let t=document.documentElement,n=e/50;t.style.setProperty(`--radius-sm`,`${Math.round(aJ.sm*n)}px`),t.style.setProperty(`--radius-md`,`${Math.round(aJ.md*n)}px`),t.style.setProperty(`--radius-lg`,`${Math.round(aJ.lg*n)}px`),t.style.setProperty(`--radius-xl`,`${Math.round(aJ.xl*n)}px`),t.style.setProperty(`--radius-full`,`${Math.round(aJ.full*n)}px`),t.style.setProperty(`--radius`,`${Math.round(aJ.default*n)}px`)}function sJ(e,t){var n;if(e.themeResolved=t,typeof document>`u`)return;let r=document.documentElement,i=t.endsWith(`light`)?`light`:`dark`;r.dataset.theme=t,r.dataset.themeMode=i,r.style.colorScheme=i,(n=document.querySelector(`.ss-shell`))==null||n.classList.toggle(`ss-shell--aiCreation`,i===`dark`);let a=``;try{a=getComputedStyle(r).getPropertyValue(`--bg`).trim()}catch{}yO(a)}function cJ(e){if(e.themeMode!==`system`){var t;(t=e.systemThemeCleanup)==null||t.call(e),e.systemThemeCleanup=null;return}if(e.systemThemeCleanup||typeof globalThis.matchMedia!=`function`)return;let n=globalThis.matchMedia(`(prefers-color-scheme: light)`),r=()=>{e.themeMode===`system`&&sJ(e,sI(e.theme,`system`))};if(typeof n.addEventListener==`function`){n.addEventListener(`change`,r),e.systemThemeCleanup=()=>n.removeEventListener(`change`,r);return}typeof n.addListener==`function`&&(n.addListener(r),e.systemThemeCleanup=()=>n.removeListener(r))}function lJ(e,t){if(typeof window>`u`)return;let n=(Kq()?qq():null)??jS(window.location.pathname,e.basePath)??`chat`;_J(e,n),dJ(e,n),hJ(e,n,t)}function uJ(e){if(typeof window>`u`)return;let t=new URL(window.location.href),n=h(t.searchParams.get(`session`)),r=n===`__draft__`?null:n,i=!!r&&r!==e.sessionKey;if(Kq()){if(!pJ())return;if(i&&r){var a;(a=e.switchSessionFromHistory)==null||a.call(e,r)}let n=h(t.searchParams.get(`tab`)),o=n&&DS(n)?n:`chat`;_J(e,o),o!==e.tab&&dJ(e,o);return}let o=jS(window.location.pathname,e.basePath);if(o){if(i&&r){var s;(s=e.switchSessionFromHistory)==null||s.call(e,r)}_J(e,o),dJ(e,o)}}function dJ(e,t){mJ(e,t,{refreshPolicy:`connected`})}function fJ(e,t){let n=typeof window>`u`?void 0:window.history;if(!n)return;let r={sealclawNav:!0};return t?n.replaceState(r,``,e.toString()):n.pushState(r,``,e.toString())}function pJ(){var e;return typeof window>`u`?!1:!!(!((e=window.history)==null||(e=e.state)==null)&&e.sealclawNav)}function mJ(e,t,n){let r=e.tab;e.tab=t,Kq()&&Jq(t),r!==t&&jO(e,r,t),r===`chat`&&t!==`chat`&&uq(),t===`chat`&&(e.chatHasAutoScrolled=!1),(t===`logs`?hO:gO)(e),(t===`debug`?_O:vO)(e),(n.refreshPolicy===`always`||e.connected)&&tJ(e),n.syncUrl&&hJ(e,t,!1)}function hJ(e,t,n){var r,i;let a=typeof window>`u`||(r=window.location)==null?void 0:r.href;if(!a)return;let o=new URL(a);if(t===`chat`&&e.sessionKey&&e.sessionKey!==`__draft__`?o.searchParams.set(`session`,e.sessionKey):o.searchParams.delete(`session`),t===`settings`?o.searchParams.set(`settingsMenu`,e.settingsActiveMenu??`general`):o.searchParams.delete(`settingsMenu`),Kq()){t===`chat`?o.searchParams.delete(`tab`):o.searchParams.set(`tab`,t),fJ(o,n);return}let s=(i=window.location)==null?void 0:i.pathname;if(!s)return;let c=kS(AS(t,e.basePath));kS(s)!==c&&(o.pathname=c),fJ(o,n)}function gJ(e,t,n){var r;let i=typeof window>`u`||(r=window.location)==null?void 0:r.href;if(!i)return;e.settingsActiveMenu=t;let a=new URL(i);a.searchParams.set(`settingsMenu`,t),fJ(a,n)}function _J(e,t){if(t!==`settings`||typeof window>`u`)return;let n=new URL(window.location.href).searchParams.get(`settingsMenu`);e.settingsActiveMenu=n===`identity`||n===`backup`?n:`general`}function vJ(e,t,n){var r;let i=typeof window>`u`||(r=window.location)==null?void 0:r.href;if(!i)return;let a=new URL(i);t===`__draft__`?a.searchParams.delete(`session`):a.searchParams.set(`session`,t),fJ(a,n)}async function yJ(e,t){let n=e,r=(e.controlUiOverviewRefreshSeq??0)+1;e.controlUiOverviewRefreshSeq=r;let i=()=>e.controlUiOverviewRefreshSeq===r&&e.tab===`overview`;await Promise.allSettled([vp(n,!1),UA(n),L_(n),ik(n),sk(n)]),i()&&CJ(n);let a=wO();Promise.allSettled([iO(n),mj(n),SJ(n),HA(n,{refresh:t==null?void 0:t.refresh})]).then(e=>{if(!i())return;let t=e.some(e=>e.status===`rejected`)?`error`:`ok`;CJ(n),kO(n,`control-ui.overview.secondary`,{phase:`end`,status:t,durationMs:TO(wO()-a)},{console:!1})})}function bJ(e){return e!=null&&e.scopes?rO({role:e.role??`operator`,requestedScopes:[`operator.read`],allowedScopes:e.scopes}):!1}function xJ(e){return e?Object.values(e).some(e=>Array.isArray(e)&&e.length>0):!1}async function SJ(e){if(!(!e.client||!e.connected))try{let t=await e.client.request(`logs.tail`,{cursor:e.overviewLogCursor||void 0,limit:100,maxBytes:5e4}),n=Array.isArray(t.lines)?t.lines.filter(e=>typeof e==`string`):[];e.overviewLogLines=[...e.overviewLogLines,...n].slice(-500),typeof t.cursor==`number`&&(e.overviewLogCursor=t.cursor)}catch{}}function CJ(e){var t;let n=[];e.lastError&&n.push({severity:`error`,icon:`x`,title:`Gateway Error`,description:e.lastError});let r=e.hello,i=(r==null?void 0:r.auth)??null;i!=null&&i.scopes&&!bJ(i)&&n.push({severity:`warning`,icon:`key`,title:`Missing operator.read scope`,description:`This connection does not have the operator.read scope. Some features may be unavailable.`,href:`https://docs.openclaw.ai/web/dashboard`,external:!0});let a=((t=e.skillsReport)==null?void 0:t.skills)??[],o=a.filter(e=>!e.disabled&&xJ(e.missing));if(o.length>0){let e=o.slice(0,3).map(e=>e.name),t=o.length>3?` +${o.length-3} more`:``;n.push({severity:`warning`,icon:`zap`,title:`Skills with missing dependencies`,description:`${e.join(`, `)}${t}`})}let s=a.filter(e=>e.blockedByAllowlist);s.length>0&&n.push({severity:`warning`,icon:`shield`,title:`${s.length} skill${s.length>1?`s`:``} blocked`,description:s.map(e=>e.name).join(`, `)});let c=e.cronJobs??[],l=c.filter(e=>{var t;return((t=e.state)==null?void 0:t.lastStatus)===`error`});l.length>0&&n.push({severity:`error`,icon:`clock`,title:`${l.length} cron job${l.length>1?`s`:``} failed`,description:l.map(e=>e.name).join(`, `)});let u=Date.now(),d=c.filter(e=>{var t;return e.enabled&&((t=e.state)==null?void 0:t.nextRunAtMs)!=null&&u-e.state.nextRunAtMs>3e5});d.length>0&&n.push({severity:`warning`,icon:`clock`,title:`${d.length} overdue job${d.length>1?`s`:``}`,description:d.map(e=>e.name).join(`, `)});let f=e.modelAuthStatusResult;if(f){let e=(f.providers??[]).filter(eI),t=e.filter(e=>e.status===`expired`||e.status===`missing`);t.length>0&&n.push({severity:`error`,icon:`key`,title:`模型认证已过期`,description:`${t.map(e=>e.displayName).join(`, `)} — 使用 openclaw models auth 重新认证`});let r=e.filter(e=>e.status===`expiring`);r.length>0&&n.push({severity:`warning`,icon:`key`,title:`模型认证即将过期`,description:r.map(e=>{var t;return`${e.displayName}(${((t=e.expiry)==null?void 0:t.label)??`soon`})`}).join(`, `)})}e.attentionItems=n}async function wJ(e){let t=e;await Promise.all([vp(t,!0),cm(t),sm(t)])}async function TJ(e){let t=e,n=t.cronRunsScope===`job`?t.cronRunsJobId:null,r=(e.controlUiCronRefreshSeq??0)+1;e.controlUiCronRefreshSeq=r;let i=()=>e.controlUiCronRefreshSeq===r&&e.tab===`cron`,a=wO();kk(t,n).catch(()=>`error`).then(e=>{i()&&kO(t,`control-ui.cron.runs`,{phase:`end`,status:e,durationMs:TO(wO()-a)},{console:!1})}),await Promise.all([vp(t,!1),ik(t),sk(t),ck(t)])}async function EJ(e){await ck(e)}var DJ=/^\s*NO_REPLY\s*$/;function OJ(e){if(!e||typeof e!=`object`)return!1;let t=e,n=g(t.role);if(n&&n!==`assistant`||!(`content`in t)&&!(`text`in t))return!1;let r=Lb(e);return typeof r==`string`&&r.trim()!==``&&!DJ.test(r)}function kJ(e){return!!(e&&e.state===`final`&&!OJ(e.message))}function AJ(e){if(!e||typeof e!=`object`)return null;let t=e;if(t.kind!==`btw`)return null;let n=h(t.runId),r=h(t.sessionKey),i=h(t.question),a=h(t.text);return n&&r&&i&&a?{kind:`btw`,runId:n,sessionKey:r,question:i,text:a,isError:t.isError===!0,ts:typeof t.ts==`number`&&Number.isFinite(t.ts)?t.ts:Date.now()}:null}var jJ=new WeakMap;function MJ(e){let t=e,n=(jJ.get(t)??0)+1;return jJ.set(t,n),n}function NJ(e,t,n){return jJ.get(e)===t&&e.sessionKey.trim()===n}async function PJ(e,t){var n;if(!e.client||!e.connected)return;let r=(t==null||(n=t.sessionKey)==null?void 0:n.trim())||e.sessionKey.trim(),i=r?{sessionKey:r}:{},a=MJ(e);try{let t=await e.client.request(`agent.identity.get`,i);if(!NJ(e,a,r)||!t)return;let n=rE(t);e.assistantName=n.name,e.assistantAvatar=n.avatar,e.assistantAvatarSource=n.avatarSource??null,e.assistantAvatarStatus=n.avatarStatus??null,e.assistantAvatarReason=n.avatarReason??null,e.assistantAgentId=n.agentId??null;let o=GI().avatar;o&&(e.assistantAvatar=o,e.assistantAvatarSource=o,e.assistantAvatarStatus=`data`,e.assistantAvatarReason=null)}catch{}}function FJ(e,t){KI({avatar:t}),t?(e.assistantAvatar=t,e.assistantAvatarSource=t,e.assistantAvatarStatus=`data`,e.assistantAvatarReason=null):(e.assistantAvatar=null,e.assistantAvatarSource=null,e.assistantAvatarStatus=null,e.assistantAvatarReason=null)}var IJ=`/__openclaw/control-ui-config.json`;function LJ(e){var t;let n=(t=vg(e.sessionKey))==null?void 0:t.agentId;if(n)return bg(n);let r=h(e.assistantAgentId);return r?bg(r):null}function RJ(e){let t=h(e);return t?bg(t):null}function zJ(e){let t=GI().avatar;t&&(e.assistantAvatar=t,e.assistantAvatarSource=t,e.assistantAvatarStatus=`data`,e.assistantAvatarReason=null)}async function BJ(e,t){if(typeof window>`u`||typeof fetch!=`function`)return;let n=OS(e.basePath??``),r=n?`${n}${IJ}`:IJ;try{let n=new URL(r,window.location.origin).origin===window.location.origin?Ju(e):[],i=n.length>0?n:[``],a=null;for(let e of i){let t={Accept:`application/json`};if(e&&(t.Authorization=`Bearer ${e}`),a=await fetch(r,{method:`GET`,headers:t,credentials:`same-origin`}),a.ok)break;if(a.status!==401&&a.status!==403)return}if(!a||!a.ok)return;let o=await a.json();if((t==null?void 0:t.applyIdentity)!==!1){let t=LJ(e),n=RJ(o.assistantAgentId??null);if(!t||!n||t===n){let t=rE({agentId:o.assistantAgentId??null,name:o.assistantName,avatar:o.assistantAvatar??null,avatarSource:o.assistantAvatarSource??null,avatarStatus:o.assistantAvatarStatus??null,avatarReason:o.assistantAvatarReason??null});e.assistantName=t.name,e.assistantAvatar=t.avatar,e.assistantAvatarSource=t.avatarSource??null,e.assistantAvatarStatus=t.avatarStatus??null,e.assistantAvatarReason=t.avatarReason??null,e.assistantAgentId=t.agentId??null}zJ(e)}e.serverVersion=o.serverVersion??null,e.localMediaPreviewRoots=Array.isArray(o.localMediaPreviewRoots)?o.localMediaPreviewRoots.filter(e=>typeof e==`string`):[],e.embedSandboxMode=o.embedSandbox===`trusted`?`trusted`:o.embedSandbox===`strict`?`strict`:`scripts`,e.allowExternalEmbedUrls=o.allowExternalEmbedUrls===!0,e.chatMessageMaxWidth=typeof o.chatMessageMaxWidth==`string`&&o.chatMessageMaxWidth.trim()?o.chatMessageMaxWidth:null}catch{}}function VJ(e){let t=e.request.sessionKey;return typeof t==`string`&&t.trim()||null}function HJ(e,t){return JJ(e).find(e=>e.kind===`plugin`&&VJ(e)===t)??null}function UJ(e,t){let n=JJ(e);return t?n.find(e=>e.id===t)??null:n[0]??null}function WJ(e){return typeof e==`object`&&!!e}function GJ(e){if(!WJ(e))return null;let t=h(e.id)??``,n=e.request;if(!t||!WJ(n))return null;let r=h(n.command)??``;if(!r)return null;let i=typeof e.createdAtMs==`number`?e.createdAtMs:0,a=typeof e.expiresAtMs==`number`?e.expiresAtMs:0;return!i||!a?null:{id:t,kind:`exec`,request:{command:r,cwd:typeof n.cwd==`string`?n.cwd:null,host:typeof n.host==`string`?n.host:null,security:typeof n.security==`string`?n.security:null,ask:typeof n.ask==`string`?n.ask:null,agentId:typeof n.agentId==`string`?n.agentId:null,resolvedPath:typeof n.resolvedPath==`string`?n.resolvedPath:null,sessionKey:typeof n.sessionKey==`string`?n.sessionKey:null},createdAtMs:i,expiresAtMs:a}}function KJ(e){if(!WJ(e))return null;let t=h(e.id)??``;return t?{id:t,decision:typeof e.decision==`string`?e.decision:null,resolvedBy:typeof e.resolvedBy==`string`?e.resolvedBy:null,ts:typeof e.ts==`number`?e.ts:null}:null}function qJ(e){if(!WJ(e))return null;let t=h(e.id)??``;if(!t)return null;let n=typeof e.createdAtMs==`number`?e.createdAtMs:0,r=typeof e.expiresAtMs==`number`?e.expiresAtMs:0;if(!n||!r)return null;let i=WJ(e.request)?e.request:{},a=h(i.title)??``;if(!a)return null;let o=typeof i.description==`string`?i.description:null,s=typeof i.severity==`string`?i.severity:null,c=typeof i.pluginId==`string`?i.pluginId:null;return{id:t,kind:`plugin`,request:{command:a,agentId:typeof i.agentId==`string`?i.agentId:null,sessionKey:typeof i.sessionKey==`string`?i.sessionKey:null},pluginTitle:a,pluginDescription:o,pluginSeverity:s,pluginId:c,createdAtMs:n,expiresAtMs:r}}function JJ(e){let t=Date.now();return e.filter(e=>e.expiresAtMs>t)}function YJ(e,t){let n=JJ(e).filter(e=>e.id!==t.id);return n.unshift(t),n}function XJ(e,t){return JJ(e).filter(e=>e.id!==t)}var ZJ={ok:!1,ts:0,durationMs:0,heartbeatSeconds:0,defaultAgentId:``,agents:[],sessions:{path:``,count:0,recent:[]}};async function QJ(e){try{return await e.request(`health`,{})??ZJ}catch{return ZJ}}async function $J(e){if(!(!e.client||!e.connected)&&!e.healthLoading){e.healthLoading=!0,e.healthError=null;try{e.healthResult=await QJ(e.client)}catch(t){e.healthError=String(t)}finally{e.healthLoading=!1}}}function eY(){return`https://gateway.sealseek.cn`}var tY=`sealseek-canvas`,nY=3600*1e3,rY=3600*1e3;function iY(){let e=v();return(e==null?void 0:e.getItem(`jwt`))??``}function aY(){return`${eY()}/api/sealseek-infinitecanvas/mcp`}function oY(e){let t=e?{transport:`streamable-http`,url:aY(),headers:{Authorization:`Bearer ${e}`,Accept:`application/json, text/event-stream`,token:e},toolTimeouts:{generate_image:nY,generate_video:rY}}:null;return JSON.stringify({mcp:{servers:{[tY]:t}}})}async function sY(e){if(e.getConfig){let t=e.getConfig();if(e.jwt&&lY(t,e.jwt)||!e.jwt&&!cY(t))return!1}return await Cp({request:e.request,reload:e.reload,getBaseHash:e.getBaseHash,raw:oY(e.jwt)}),!0}function cY(e){var t;let n=e==null||(t=e.mcp)==null?void 0:t.servers;return!!(n&&n[`sealseek-canvas`])}function lY(e,t){var n,r,i,a;let o=e==null||(n=e.mcp)==null||(n=n.servers)==null?void 0:n[tY];return o?typeof((r=o.headers)==null?void 0:r.token)==`string`&&o.headers.token===t&&((i=o.toolTimeouts)==null?void 0:i.generate_image)===nY&&((a=o.toolTimeouts)==null?void 0:a.generate_video)===rY:!1}function uY(){return[`把当前会话内容总结成画布,调用 sealseek-canvas MCP 工具,按 read_me 说明生成,完成后预览画布链接`,`文本里标点符号用字面量,换行等别用字面量`,`若本轮对话中已创建过画布,则用 update_canvas 追加;否则用 create_canvas 新建`].join(`
|
|
3604
3604
|
`)}function dY(e,t){e.storeItemLoading||(e.storeItemLoading=tY,t==null||t(),(async()=>{try{if(!e.client||!e.configSnapshot){Y.error(`网关未就绪,请稍后重试`);return}if(!cY(e.configSnapshot.config)){let t=iY();if(!t){Y.error(`未登录,无法启用画布能力`);return}let n=e.client;Y.info(`正在启用画布能力…`),await sY({request:(e,t)=>n.request(e,t),reload:()=>sm(e),getBaseHash:()=>{var t;return(t=e.configSnapshot)==null?void 0:t.hash},jwt:t,getConfig:()=>{var t;return(t=e.configSnapshot)==null?void 0:t.config}})}await e.handleSendChat(uY())}catch(e){Y.error(e instanceof Error?e.message:`生成画布失败,请重试`)}finally{e.storeItemLoading=null,t==null||t()}})())}var fY=new Set([`docx`,`xlsx`,`pptx`]);function pY(e){return!!(e&&typeof e==`object`&&!Array.isArray(e))}function mY(e){var t;let n=e.trim();if(!n)return null;let r=n;if(/^file:/i.test(n))try{let e=new URL(n),t=decodeURIComponent(e.pathname);r=e.hostname?`//${e.hostname}${t}`:/^\/[a-zA-Z]:\//.test(t)?t.slice(1):t}catch{return null}let i=(t=r.split(/[?#]/,1)[0])==null||(t=t.match(/\.([^.\\/]+)$/))==null||(t=t[1])==null?void 0:t.toLowerCase();return i&&fY.has(i)?r:null}async function hY(e,t){let n=mY(t);if(!e||!n)return null;try{let t=await e.request(`officecli.renderHtml`,{path:n});return typeof(t==null?void 0:t.html)==`string`&&t.html.trim()?t.html:null}catch{return null}}function gY(e){if(!pY(e))return null;let t=pY(e.details)?e.details:e;return typeof t.previewPath==`string`?mY(t.previewPath):null}async function _Y(e,t){var n;let r=gY(e),i=(n=window.sealclawElectron)==null?void 0:n.openLocalPath;if(!r||typeof i!=`function`)return!1;try{let e=await i(r,t);return(e==null?void 0:e.ok)===!0}catch{return!1}}var vY=`概览`;function yY(e){return(e==null?void 0:e.kind)===`overview`}function bY(e){return(e==null?void 0:e.kind)===`subagent`}function xY(e){let t=e.tabs.find(yY);if(t)return t;let n={localKey:`overview-${CY++}`,kind:`overview`,webContentsTabId:null,url:``,title:vY,active:!e.tabs.some(e=>e.active),loading:!1,canGoBack:!1,canGoForward:!1,partition:wY};return e.tabs.unshift(n),n}function SY(e){if(!(e!=null&&e.webContentsTabId))return!1;try{let t=new URL(e.url).protocol;return t===`http:`||t===`https:`}catch{return!1}}var CY=1,wY=`persist:workspace-browser`,TY=[{partition:`persist:taobao-seller`,rootDomains:[`alimama.com`],exactHosts:[`seller.taobao.com`,`myseller.taobao.com`,`sycm.taobao.com`,`work.taobao.com`]},{partition:`persist:taobao-front`,rootDomains:[`taobao.com`,`tmall.com`,`fliggy.com`]}];function EY(e,t){return e===t||e.endsWith(`.${t}`)}function DY(e){let t=``;try{t=new URL(e).hostname.toLowerCase()}catch{return wY}if(!t)return wY;for(let e of TY){var n;if((n=e.exactHosts)!=null&&n.includes(t))return e.partition}for(let e of TY)if(e.rootDomains.some(e=>EY(t,e)))return e.partition;return wY}var OY=`openclaw.control.workspace-browser.bookmarks.v1`;function kY(e){let t=e;return!!t&&typeof t.id==`string`&&typeof t.url==`string`&&typeof t.title==`string`&&(t.faviconUrl===void 0||typeof t.faviconUrl==`string`)}function AY(){let e=v();if(!e)return[];try{let t=e.getItem(OY);if(t==null)return[];let n=JSON.parse(t);return Array.isArray(n)?n.filter(kY):[]}catch{return[]}}function jY(e){let t=v();if(t)try{t.setItem(OY,JSON.stringify(e))}catch{}}function MY(e){return e.length>1&&e.endsWith(`/`)?e.slice(0,-1):e}var NY=`openclaw.control.workspace-browser.session.v1`;function PY(e){return`${NY}.${e}`}function FY(e){let t=e;return!t||typeof t!=`object`?!1:t.screen===`list`?!0:t.screen===`detail`&&typeof t.sessionKey==`string`}function IY(e){let t=e;return!!t&&typeof t.url==`string`&&typeof t.title==`string`&&(t.markdownSource===void 0||typeof t.markdownSource==`string`)&&(t.pdfPreview===void 0||typeof t.pdfPreview==`boolean`)&&(t.officePreview===void 0||typeof t.officePreview==`boolean`)&&(t.kind===void 0||t.kind===`subagent`)&&(t.subagentView===void 0||FY(t.subagentView))}function LY(e){let t=v();if(!t)return null;try{let n=t.getItem(PY(e));if(n==null)return null;let r=JSON.parse(n);if(!r||typeof r!=`object`)return null;let i=Array.isArray(r.tabs)?r.tabs.filter(IY):[];return{panelOpen:!!r.panelOpen,expanded:!!r.expanded,panelWidth:typeof r.panelWidth==`number`?r.panelWidth:null,tabs:i,activeIndex:typeof r.activeIndex==`number`?r.activeIndex:0}}catch{return null}}var RY=new Map;function zY(e,t){let n=v();if(!n)return;let r=t.tabs.filter(e=>!yY(e)&&(bY(e)||e.url&&e.url!==`about:blank`)),i=t.tabs.some(e=>e.active&&yY(e))?-1:Math.max(0,r.findIndex(e=>e.active)),a={panelOpen:t.panelOpen,expanded:t.expanded,panelWidth:t.panelWidth,tabs:r.map(e=>({url:e.url,title:e.title,markdownSource:e.markdownSource,pdfPreview:e.pdfPreview,officePreview:e.officePreview,kind:e.kind===`subagent`?e.kind:void 0,subagentView:e.subagentView})),activeIndex:i},o=JSON.stringify(a);if(RY.get(e)!==o){RY.set(e,o);try{n.setItem(PY(e),o)}catch{}}}function BY(e,t,n){zY(e,t);for(let[t,r]of Object.entries(n))t!==e&&zY(t,r)}function VY(e,t){let n=MY(t);return e.some(e=>MY(e.url)===n)}function HY(e,t,n,r){let i=MY(t),a=e.bookmarks.findIndex(e=>MY(e.url)===i);if(a>=0){e.bookmarks.splice(a,1);return}e.bookmarks.push({id:`bm-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,url:t,title:n||t,faviconUrl:r})}function UY(e,t){e.bookmarks=e.bookmarks.filter(e=>e.id!==t)}function WY(e){var t;let n=e.annotationDraft,r=(n==null?void 0:n.description.trim())??``,i=n==null||(t=n.attachment)==null?void 0:t.annotateMeta;if(!n||!n.attachment||!i||n.preparing)return null;e.annotationDraft=null;let a={...i};return delete a.description,r&&(a.description=r),{...n.attachment,annotateMeta:a}}function GY(e,t,n){let r=MY(t),i=e.bookmarks.find(e=>MY(e.url)===r);return!i||i.faviconUrl===n?!1:(i.faviconUrl=n,!0)}function KY(){return{bookmarks:AY(),downloads:[],downloadAttention:`none`}}function qY(e){let t=LY(e),n={tabs:[],addressInput:``,panelOpen:(t==null?void 0:t.panelOpen)??!1,panelWidth:(t==null?void 0:t.panelWidth)??null,expanded:(t==null?void 0:t.expanded)??!1,menuOpen:!1,allBookmarksMenuOpen:!1,resizing:!1,annotateMode:!1,annotationDraft:null,captureMode:!1,downloadsMenuOpen:!1,aiActive:!1,recordingActive:!1,recordingStartedAt:null,recordingApiCount:0,recordingOpsCount:0,recordingResult:null,recordingSkillResult:null,autoCollapsedPendingRestore:!1},r=xY(n);if(t){let e=[];for(let r of t.tabs){if(r.kind===`subagent`){let t=QY(n);r.subagentView&&(t.subagentView=r.subagentView),e.push(t);continue}let t=ZY(n,r.url||void 0,r.markdownSource);e.push(t),r.pdfPreview&&(t.pdfPreview=!0,t.pdfSource=void 0),r.officePreview&&(t.officePreview=!0,t.officeSource=void 0),t.title=r.title||t.title}if(e.length&&t.activeIndex>=0){let r=e[Math.min(t.activeIndex,e.length-1)];aX(n,r.localKey),n.addressInput=r.url}else aX(n,r.localKey),n.addressInput=``}return n}function JY(e){let t=e.trim();return/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:/^(localhost|127\.0\.0\.1)(:\d+)?(\/.*)?$/i.test(t)?`http://${t}`:/^[\w-]+(\.[\w-]+)+(:\d+)?(\/.*)?$/i.test(t)?`https://${t}`:`https://www.bing.com/search?q=${encodeURIComponent(t)}`}function YY(){if(typeof window>`u`)return!1;let e=window.sealclawElectron;return typeof(e==null?void 0:e.onWorkspaceBrowserCreateTab)==`function`}async function XY(e){var t;if(typeof window>`u`)return;let n=(t=window.sealclawElectron)==null?void 0:t.setWorkspaceBrowserAuthToken;typeof n==`function`&&await n(e??``)}function ZY(e,t,n,r,i){for(let t of e.tabs)t.active=!1;let a={localKey:`local-${CY++}`,webContentsTabId:null,url:t??``,title:t||`新标签页`,active:!0,loading:!!t,canGoBack:!1,canGoForward:!1,pendingUrl:t,markdownSource:n,markdownPreview:n==null?void 0:!0,pdfSource:r,pdfPreview:r==null?void 0:!0,officeSource:i,officePreview:i==null?void 0:!0,partition:t?DY(t):wY};return e.tabs.push(a),a}function QY(e,t){let n=e.tabs.find(bY);if(n)return aX(e,n.localKey),t&&(n.subagentView={screen:`detail`,sessionKey:t}),n;for(let t of e.tabs)t.active=!1;let r={localKey:`subagent-${CY++}`,kind:`subagent`,subagentView:t?{screen:`detail`,sessionKey:t}:{screen:`list`},webContentsTabId:null,url:``,title:`子智能体`,active:!0,loading:!1,canGoBack:!1,canGoForward:!1,partition:wY};return e.tabs.push(r),r}function $Y(e){let t=e.tabs.find(bY);t&&(t.subagentView={screen:`list`})}function eX(e){if(!/^file:/i.test(e))return null;try{let t=new URL(e);return t.search=``,t.hash=``,t.href}catch{return null}}function tX(e,t,n){let r=eX(t);if(!r)return null;let i=e.tabs.find(e=>eX(e.url)===r);if(!i)return null;for(let t of e.tabs)t.active=t===i;return i.url=t,i.title=t,i.loading=!0,i.pendingUrl=t,i.markdownSource=void 0,i.markdownPreview=void 0,i.pdfSource=void 0,i.pdfPreview=void 0,i.officeSource=n,i.officePreview=!0,i.partition=DY(t),e.addressInput=t,i}function nX(e,t){let n=e.tabs.findIndex(e=>e.localKey===t);if(n===-1||yY(e.tabs[n]))return;let r=e.tabs[n].active;if(e.tabs.splice(n,1),r&&e.tabs.length){let t=e.tabs[n-1],r=t&&!yY(t)?t:e.tabs[n]??t;r&&(r.active=!0)}}function rX(e,t){let n=e.tabs.find(e=>e.webContentsTabId===t);n&&nX(e,n.localKey)}function iX(e){e.pendingUrl=void 0,e.markdownSource=void 0,e.markdownPreview=void 0,e.pdfSource=void 0,e.pdfPreview=void 0,e.officeSource=void 0,e.officePreview=void 0}function aX(e,t){for(let n of e.tabs)n.active=n.localKey===t}function oX(e,t,n){let r=e.tabs.find(e=>e.localKey===t);r&&(r.webContentsTabId=n)}var sX=50;function cX(e,t){if(t.phase===`started`){let n=e.downloads.findIndex(e=>e.id===t.id);if(n!==-1){e.downloads=e.downloads.map((e,r)=>r===n?t:e);return}e.downloads=[t,...e.downloads].slice(0,sX);return}let n=e.downloads.findIndex(e=>e.id===t.id);n!==-1&&(e.downloads=e.downloads.map((e,r)=>r===n?t:e),t.phase===`done`&&(t.state===`interrupted`?e.downloadAttention=`failed`:t.state===`completed`&&e.downloadAttention===`none`&&(e.downloadAttention=`completed`)))}function lX(e){e.downloadAttention=`none`}function uX(e,t){e.downloads=t.slice(0,sX)}function dX(e,t){e.downloads=e.downloads.filter(e=>e.id!==t)}function fX(e,t){let n=e.tabs.some(e=>e.active&&e.webContentsTabId===null);for(let r of t){let t=e.tabs.find(e=>e.webContentsTabId===r.tabId);t&&(!t.markdownPreview&&!t.pdfPreview&&!t.officePreview&&(t.url=r.url,r.title&&(t.title=r.title)),t.loading=r.loading,n||(t.active=r.active))}}function pX(e){let t=window.sealclawElectron;return YY()?[t.onWorkspaceBrowserCreateTab(t=>e.addTab(t.url,t.sessionKey,t.markdown,t.pdf,t.office)),t.onWorkspaceBrowserCloseTab(t=>e.removeTabByServerId(t.tabId,t.sessionKey)),t.onWorkspaceBrowserTabsChanged(t=>e.mergeTabsPush(t)),t.onWorkspaceBrowserDownloadEvent(t=>e.onDownloadEvent(t)),t.onWorkspaceBrowserAiActivity(t=>e.onAiActivity(t.sessionKey))]:[]}function mX(e){return/^(?:typeerror:\s*)?(?:fetch failed|failed to fetch)$/i.test(e.trim())}function hX(e,t){if(!t)return;e.execApprovalQueue=YJ(e.execApprovalQueue,t),e.execApprovalError=null;let n=Math.max(0,t.expiresAtMs-Date.now()+500);window.setTimeout(()=>{e.execApprovalQueue=XJ(e.execApprovalQueue,t.id)},n)}function gX(e,t){let n=KJ(t);n&&(e.execApprovalQueue=XJ(e.execApprovalQueue,n.id))}function _X(e,t){var n;if(!t)return;let r=e.interactiveFormQueue.filter(e=>e.id!==t.id&&e.request.sessionKey===t.request.sessionKey).map(e=>e.id);e.interactiveFormQueue=pB(e.interactiveFormQueue,t);let i={...e.interactiveFormDrafts};for(let e of r)delete i[e];i[n=t.id]??(i[n]=gB(t.request.form)),e.interactiveFormDrafts=i,e.interactiveFormError=null,Mw(e,t.request.sessionKey,t.createdAtMs)}function vX(e,t){if(!t||typeof t!=`object`||Array.isArray(t))return;let n=t.id;if(typeof n!=`string`)return;let r=e.interactiveFormQueue.find(e=>e.id===n);e.interactiveFormQueue=mB(e.interactiveFormQueue,n);let i={...e.interactiveFormDrafts};if(delete i[n],e.interactiveFormDrafts=i,r){let n=t.ts;Nw(e,r.request.sessionKey,typeof n==`number`?n:Date.now())}}function yX(e){return e===`final`||e===`aborted`||e===`error`}function bX(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return t.phase===`start`||t.phase===`message`||t.phase===`end`||t.phase===`error`||t.reason===`send`||t.reason===`steer`}function xX(e){return{tone:`danger`,text:`Update installed but running version did not change — restart may have been blocked.${e.actualVersion?` Expected v${e.expectedVersion}, running v${e.actualVersion}.`:``}`}}function SX(e){let t=(e==null?void 0:e.trim())||`restart-unhealthy`;return{tone:`danger`,text:`Update error: ${t}. ${t===`restart-unhealthy`?`The replacement process never became healthy and the previous process stayed up.`:`Check the gateway logs for the replacement failure.`}`}}async function CX(e,t){var n,r;let i=(n=e.pendingUpdateExpectedVersion)==null?void 0:n.trim();if(!i)return;let a=Date.now()+1e4;for(;e.client===t&&e.connected&&Date.now()<a;){var o;let n=null;try{n=await t.request(`update.status`,{})}catch{n=null}let r=n==null?void 0:n.sentinel,a=(r==null||(o=r.stats)==null||(o=o.after)==null||(o=o.version)==null?void 0:o.trim())||null;if((r==null?void 0:r.kind)===`update`&&a){if(e.pendingUpdateExpectedVersion=null,r.status&&r.status!==`ok`){var s;e.updateStatusBanner=SX(((s=r.stats)==null?void 0:s.reason)??null);return}a!==i&&(e.updateStatusBanner=xX({expectedVersion:i,actualVersion:a}));return}await new Promise(e=>{setTimeout(e,250)})}if(e.client!==t||!e.connected)return;let c=((r=e.hello)==null||(r=r.server)==null||(r=r.version)==null?void 0:r.trim())||null;e.pendingUpdateExpectedVersion=null,c!==i&&(e.updateStatusBanner=xX({expectedVersion:i,actualVersion:c}))}function wX(e){var t;let n=(t=e.serverVersion)==null?void 0:t.trim();if(!n)return;let r=e.pageUrl??(typeof window>`u`?void 0:window.location.href);if(r)try{let t=new URL(r),i=new URL(e.gatewayUrl,t);return!new Set([`ws:`,`wss:`,`http:`,`https:`]).has(i.protocol)||!TX(t,i)?void 0:n}catch{return}}function TX(e,t){return t.host===e.host?!0:EX(e.hostname)&&EX(t.hostname)&&DX(e)===DX(t)}function EX(e){let t=e.trim().toLowerCase().replace(/^\[/,``).replace(/\]$/,``);return t===`localhost`||t===`::1`||t===`0:0:0:0:0:0:0:1`||t===`127.0.0.1`||t.startsWith(`127.`)}function DX(e){if(e.port)return e.port;switch(e.protocol){case`http:`:case`ws:`:return`80`;case`https:`:case`wss:`:return`443`;default:return``}}function OX(e,t){var n,r,i;let a=(e??``).trim(),o=(n=t.mainSessionKey)==null?void 0:n.trim();if(!o)return a;if(!a)return o;let s=((r=t.mainKey)==null?void 0:r.trim())||`main`,c=(i=t.defaultAgentId)==null?void 0:i.trim();return a===`main`||a===s||c&&(a===`agent:${c}:main`||a===`agent:${c}:${s}`)?o:a}function kX(e,t){if(!(t!=null&&t.mainSessionKey))return;if(OX(e.sessionKey,t)===e.sessionKey){let n=OX(e.settings.lastActiveSessionKey,t);n!==e.settings.lastActiveSessionKey&&Vq(e,{...e.settings,lastActiveSessionKey:n});return}let n=OX(e.sessionKey,t),r=OX(e.settings.sessionKey,t),i=OX(e.settings.lastActiveSessionKey,t),a=n||r||e.sessionKey,o={...e.settings,sessionKey:r||a,lastActiveSessionKey:i||a},s=o.sessionKey!==e.settings.sessionKey||o.lastActiveSessionKey!==e.settings.lastActiveSessionKey;a!==e.sessionKey&&(e.sessionKey=a),s&&Vq(e,o)}async function AX(e,t){var n,r,i;let a=(n=e.sessionsResult)==null?void 0:n.sessions.find(t=>t.key===e.sessionKey);if(await L_(e),e.client!==t||!e.connected)return;let o=e.sessionsResult,s=o==null?void 0:o.sessions.find(t=>t.key===e.sessionKey);if(!s)return;let c=e,l=_w(c,e.sessionKey),u=typeof s.activeRunId==`string`?s.activeRunId.trim():``,d=a==null?void 0:a.compactionCount,f=s.compactionCount;if(typeof d==`number`&&Number.isFinite(d)&&typeof f==`number`&&Number.isFinite(f)&&f>d){let t={runId:u||l.chatRunId||`compaction-${f}`,seq:0,stream:`compaction`,ts:Date.now(),sessionKey:e.sessionKey,data:{phase:`end`,completed:!0,willRetry:!1,...s.totalTokensFresh===!0&&typeof s.totalTokens==`number`?{tokensAfter:s.totalTokens,totalTokensFresh:!0}:{totalTokensFresh:!1}}};Dy(l,t),Dy(e,t),yw(c)}if(s.hasActiveRun===!0){u&&l.chatRunId!==u&&fT(c,l,u),l.sessionKey===c.sessionKey&&yw(c);return}if(!l.chatRunId||s.hasActiveRun!==!1)return;let p=e;if(((r=p.compactionStatus)==null?void 0:r.phase)===`active`||((i=p.compactionStatus)==null?void 0:i.phase)===`retrying`){let t={runId:p.compactionStatus.runId??l.chatRunId??`recovered-compaction`,seq:0,stream:`compaction`,ts:Date.now(),sessionKey:e.sessionKey,data:{phase:`end`,completed:!0,willRetry:!1,...s.totalTokensFresh===!0&&typeof s.totalTokens==`number`?{tokensAfter:s.totalTokens,totalTokensFresh:!0}:{totalTokensFresh:!1}}};Dy(l,t),Dy(e,t),yw(c)}l.chatRunId=null,l.chatRunAdopted=!1,l.chatStream=null,l.chatStreamStartedAt=null,l.chatStreamPausedAt=null,l.chatRunPhase=null,l.chatRunPhaseLastProgressAt=null,l.pendingHistoryReconcile=!0,my(l),l.sessionKey===c.sessionKey&&(yw(c),await Ww(c))}function jX(e,t){let n=e,r=(t==null?void 0:t.reason)??`initial`;n.pendingShutdownMessage=null,n.resumeChatQueueAfterReconnect=!1,e.lastError=null,e.lastErrorCode=null,e.hello=null,e.connected=!1,r===`seq-gap`?(e.execApprovalQueue=JJ(e.execApprovalQueue),oD(e,e.chatRunId??void 0),n.resumeChatQueueAfterReconnect=!0):e.execApprovalQueue=JJ(e.execApprovalQueue),e.execApprovalError=null,e.interactiveFormError=null;let i=e.client,a=wX({gatewayUrl:e.settings.gatewayUrl,serverVersion:e.serverVersion}),o=new ree({url:e.settings.gatewayUrl,token:e.settings.token.trim()?e.settings.token:void 0,password:e.password.trim()?e.password:void 0,clientName:`openclaw-control-ui`,clientVersion:a,mode:`webchat`,instanceId:e.clientInstanceId,onHello:t=>{var r,i;if(e.client===o){if(n.pendingShutdownMessage=null,e.connected=!0,e.lastError=null,e.lastErrorCode=null,e.hello=t,RX(e,t),o.request(`chat.form.list`,{}).then(t=>{for(let n of t)_X(e,fB(n))}).catch(()=>void 0),BJ(e,{applyIdentity:!1}),i_.hydrate(o,()=>{var t;return(t=e.requestUpdate)==null?void 0:t.call(e)}),e.pendingAbort){let t=e.pendingAbort;e.client.request(`chat.abort`,{sessionKey:t.sessionKey,...t.runId?{runId:t.runId}:{},...t.subagentInterruptReason?{subagentInterruptReason:t.subagentInterruptReason}:{}}).then(n=>{e.pendingAbort===t&&(e.pendingAbort=null),(n==null?void 0:n.aborted)!==!1&&t.runId&&(yT(e,{runId:t.runId,sessionKey:t.sessionKey}),yD(e))}).catch(e=>{console.warn(`[openclaw] pending abort failed:`,e)})}if(!e.chatRunId){e.chatStream=null,e.chatStreamStartedAt=null,e.chatStreamPausedAt=null;let t=e;t.chatStreamTickTimer!=null&&(clearInterval(t.chatStreamTickTimer),t.chatStreamTickTimer=null),t.chatStreamLastDurationSec=null,t.chatStreamLastModel=null,t.chatStreamLastThinkingBlocks=null,t.chatTypewriterTimer!=null&&(clearInterval(t.chatTypewriterTimer),t.chatTypewriterTimer=null),my(e)}(r=e.chatSideResultTerminalRuns)==null||r.clear(),n.resumeChatQueueAfterReconnect&&(n.resumeChatQueueAfterReconnect=!1,yD(e)),I_(e),AX(e,o),PJ(e),e.tab!==`chat`&&MD(e),Eg(e),$J(e),fO(e,{quiet:!0}),Ik(e,{quiet:!0}),setTimeout(()=>void tJ(e),300),(i=e.reconcileWebPushState)==null||i.call(e),CX(e,o)}},onClose:({code:t,reason:r,error:i})=>{if(e.client===o)if(e.connected=!1,e.lastErrorCode=sp(i)??(typeof(i==null?void 0:i.code)==`string`?i.code:null),t!==1012){if(i!=null&&i.message){e.lastError=e.lastErrorCode&&(e.lastErrorCode===Yu.PAIRING_REQUIRED||mX(i.message))?LC({message:i.message,details:i.details,code:i.code}):i.message;return}e.lastError=n.pendingShutdownMessage??`disconnected (${t}): ${r||`no reason`}`}else e.lastError=n.pendingShutdownMessage??null,e.lastErrorCode=null},onEvent:t=>{e.client===o&&MX(e,t)},onRequestTiming:t=>{e.client===o&&FO(e,t)},onGap:({expected:t,received:n})=>{e.client===o&&(e.lastError=`event gap detected (expected seq ${t}, got ${n}); reconnecting`,e.lastErrorCode=null,jX(e,{reason:`seq-gap`}))}});e.client=o,i==null||i.stop(),o.start()}function MX(e,t){try{LX(e,t)}catch(e){console.error(`[gateway] handleGatewayEvent error:`,t.event,e)}}function NX(e,t,n,r){if(n!==`final`&&n!==`error`&&n!==`aborted`||PX(t,r))return!1;let i=e,a=_w(i,i.sessionKey),o=a,s=o.toolStreamOrder.length>0,c=()=>void yD(e);oD(e,t==null?void 0:t.runId,{aborted:n===`aborted`});let l=t==null?void 0:t.runId;if(l&&e.refreshSessionsAfterChat.has(l)&&(e.refreshSessionsAfterChat.delete(l),n===`final`&&L_(e)),s&&n===`final`){let t=l??null;return my(o),yw(i),a.chatTerminalReloadPending=!0,Ww(i).finally(()=>{if(a.chatTerminalReloadPending=!1,e.sessionKey!==a.sessionKey){yD(FE(e,a.sessionKey));return}t&&e.chatRunId&&e.chatRunId!==t||c()}),!0}return my(o),yw(i),c(),!1}function PX(e,t){return!!(t&&e&&e.runId!==t)}function FX(e,t){var n,r,i,a;t!=null&&t.sessionKey&&kv(e,t.sessionKey);let o=e;if(yX(t==null?void 0:t.state)&&typeof(t==null?void 0:t.runId)==`string`&&((n=o.chatSideResultTerminalRuns)==null?void 0:n.has(t.runId))===!0&&t!=null&&t.runId){var s;(s=o.chatSideResultTerminalRuns)==null||s.delete(t.runId);return}let c=e.workspaceBrowserState.tabs.find(bY),l=!!(t!=null&&t.sessionKey)&&(c==null||(r=c.subagentView)==null?void 0:r.screen)===`detail`&&c.subagentView.sessionKey===(t==null?void 0:t.sessionKey),u=e.chatRunId;if(t!=null&&t.runId&&t.sessionKey&&_w(e,t.sessionKey).completedRunIds.has(t.runId))return;let d=vT(e,t,{preserveBackgroundArtifacts:l});if(t!=null&&t.sessionKey){if(_w(e,t.sessionKey).chatRunId==null){let n=e.resolveWorkspaceBrowserBucket(t.sessionKey);if(n.aiActive&&(n.aiActive=!1),yX(t.state)&&(DT(e,t.sessionKey),t.sessionKey!==e.sessionKey)){let n=FE(e,t.sessionKey);oD(n,t.runId),n.chatQueue.length>0&&yD(n).finally(()=>{var t;(t=e.requestUpdate)==null||t.call(e)})}}if(l){var f;(f=e.requestUpdate)==null||f.call(e)}}let p=PX(t,u),m=NX(e,t,d,u),h=e,g=(i=h.pendingSessionMessageReloadSessionKey)==null?void 0:i.trim(),_=t==null||(a=t.sessionKey)==null?void 0:a.trim();d===`aborted`&&!p&&_&&_===e.sessionKey&&(_w(e,_).pendingHistoryReconcile=!0);let v=d===`final`&&kJ(t),y=!!(g&&_&&g===_&&yX(d)&&!p&&_===e.sessionKey&&!e.chatRunId),b=y;if(y&&(h.pendingSessionMessageReloadSessionKey=null),v&&!m&&!p){Ww(e);return}b&&!m&&Ww(e)}function IX(e,t){var n;F_(e,t);let r=e,i=t==null||(n=t.sessionKey)==null?void 0:n.trim();if(!(!i||i!==e.sessionKey)){if(e.chatRunId){r.pendingSessionMessageReloadSessionKey=i;return}_w(e,i).pendingHistoryReconcile||(r.pendingSessionMessageReloadSessionKey=null,Ww(e))}}function LX(e,t){if(e.eventLogBuffer=[{ts:Date.now(),event:t.event,payload:t.payload},...e.eventLogBuffer].slice(0,250),(e.tab===`debug`||e.tab===`overview`)&&(e.eventLog=e.eventLogBuffer),t.event===`agent`){if(e.onboarding)return;let l=t.payload,u=l==null?void 0:l.stream;if(u===`tool`||u===`thinking`){var n,r,i;let t=e,d=_w(t,(l==null?void 0:l.sessionKey)??t.sessionKey);if(l!=null&&l.runId&&d.completedRunIds.has(l.runId))return;if(d.chatRunId==null&&typeof(l==null?void 0:l.runId)==`string`&&l.runId.trim()&&typeof l.sessionKey==`string`&&l.sessionKey.trim()&&fT(t,d,l.runId),Dy(d,l),TC(d,l),u===`tool`){var a,o;console.log(`[canvas-auto-open] tool event:`,l==null||(a=l.data)==null?void 0:a.name,l==null||(o=l.data)==null?void 0:o.phase)}if(u===`tool`&&(l==null||(n=l.data)==null?void 0:n.name)===`workspace_browser`&&l.data.phase===`start`&&(e.resolveWorkspaceBrowserBucket(d.sessionKey).aiActive=!0),u===`tool`&&typeof(l==null||(r=l.data)==null?void 0:r.name)==`string`&&[`officecli`,`exec`,`bash`].includes(l.data.name)&&l.data.phase===`result`&&!l.data.isError&&_Y(l.data.result,l.sessionKey),u===`tool`&&!(l==null||(i=l.data)==null||(i=i.name)==null)&&i.endsWith(`__create_canvas`)&&l.data.phase===`result`&&!l.data.isError){let t=l.data.result,n=typeof t==`string`?t:t==null?void 0:JSON.stringify(t);console.log(`[canvas-auto-open] create_canvas result raw:`,t),console.log(`[canvas-auto-open] create_canvas result text:`,n);let r=qD(n,`create_canvas`);if(console.log(`[canvas-auto-open] extractCanvasFromText preview:`,r),r!=null&&r.url){let t=r.url;XY(iY());let n=e.workspaceBrowserState;ZY(n,t),n.panelOpen=!0}else{let t=(n??``).match(/https?:\/\/[^\s"'<>]*\/board\/#\/canvas\/[^\s"'<>)]+/);if(console.log(`[canvas-auto-open] fallback urlMatch:`,t==null?void 0:t[0]),t){let n=t[0];XY(iY());let r=e.workspaceBrowserState;ZY(r,n),r.panelOpen=!0}}}if(d.sessionKey===t.sessionKey){var s;yw(t),u===`tool`&&(l==null||(s=l.data)==null?void 0:s.name)===`workspace_browser`&&l.data.phase===`start`&&!e.workspaceBrowserState.panelOpen&&(e.workspaceBrowserState.panelOpen=!0)}else if((()=>{var t;let n=e.workspaceBrowserState.tabs.find(bY);return(n==null||(t=n.subagentView)==null?void 0:t.screen)===`detail`&&n.subagentView.sessionKey===d.sessionKey})()){var c;(c=e.requestUpdate)==null||c.call(e)}Aw(t);return}if(u===`lifecycle`||u===`compaction`||u===`fallback`||u===`recovery`||u===`approval`){let t=e,n=_w(t,(l==null?void 0:l.sessionKey)??t.sessionKey);if(l!=null&&l.runId&&n.completedRunIds.has(l.runId))return;(u===`compaction`||u===`lifecycle`)&&Dy(n,l),TC(n,l),n.sessionKey===t.sessionKey&&yw(t)}Dy(e,l);return}if(t.event===`knowledge.open-page`){YD(e,t.payload);return}if(t.event===`chat`){FX(e,t.payload);return}if(t.event===`chat.side_result`){var l;let n=AJ(t.payload);if(!n||n.sessionKey!==e.sessionKey)return;let r=e;r.chatSideResult=n,(l=r.chatSideResultTerminalRuns)==null||l.add(n.runId);return}if(t.event===`session.tool`){let n=t.payload;if((n==null?void 0:n.stream)===`tool`){let t=e,r=_w(t,(n==null?void 0:n.sessionKey)??t.sessionKey),i=typeof n.runId==`string`?n.runId.trim():``;if(r.completedRunIds.has(i))return;let a=r.chatRunId!=null&&r.chatRunId===i&&!r.chatRunAdopted,o=r.chatRunId!=null&&r.chatRunId!==i&&n.internalMaintenance!==!0;if(!(a||o)){var u;if(r.chatRunId==null&&i&&(u=n.sessionKey)!=null&&u.trim()&&fT(t,r,i),Dy(r,n),TC(r,n),r.sessionKey===t.sessionKey)yw(t);else{var d;let t=e.workspaceBrowserState.tabs.find(bY);if((t==null||(d=t.subagentView)==null?void 0:d.screen)===`detail`&&t.subagentView.sessionKey===r.sessionKey){var f;(f=e.requestUpdate)==null||f.call(e)}}Aw(t)}}return}if(t.event===`session.message`){IX(e,t.payload);return}if(t.event===`presence`){let n=t.payload;n!=null&&n.presence&&Array.isArray(n.presence)&&(e.presenceEntries=n.presence,e.presenceError=null,e.presenceStatus=null);return}if(t.event===`shutdown`){let n=t.payload,r=n&&typeof n.reason==`string`&&n.reason.trim()?n.reason.trim():`gateway stopping`,i=typeof(n==null?void 0:n.restartExpectedMs)==`number`?`Restarting: ${r}`:`Disconnected: ${r}`;e.pendingShutdownMessage=i,e.lastError=i,e.lastErrorCode=null;return}if(t.event===`sessions.changed`){let n=F_(e,t.payload),r=t.payload&&typeof t.payload==`object`&&`sessionKey`in t.payload?t.payload.sessionKey:void 0;if(typeof r==`string`&&DT(e,r),n.applied||bX(t.payload))return;L_(e);return}if(t.event===`cron`&&(EJ(e),e.tab===`cron`&&TJ(e)),(t.event===`device.pair.requested`||t.event===`device.pair.resolved`)&&Ik(e,{quiet:!0}),t.event===`exec.approval.requested`){hX(e,GJ(t.payload));return}if(t.event===`exec.approval.resolved`){gX(e,t.payload);return}if(t.event===`plugin.approval.requested`){hX(e,qJ(t.payload));return}if(t.event===`plugin.approval.resolved`){gX(e,t.payload);return}if(t.event===`chat.form.requested`){_X(e,fB(t.payload));return}if(t.event===`chat.form.resolved`){vX(e,t.payload);return}if(t.event===`update.available`){let n=t.payload;e.updateAvailable=(n==null?void 0:n.updateAvailable)??null}}function RX(e,t){let n=t.snapshot;n!=null&&n.presence&&Array.isArray(n.presence)&&(e.presenceEntries=n.presence),n!=null&&n.health&&(e.debugHealth=n.health,e.healthResult=n.health),n!=null&&n.sessionDefaults&&kX(e,n.sessionDefaults),e.updateAvailable=(n==null?void 0:n.updateAvailable)??null}function zX(e){let t=++e.connectGeneration;e.basePath=nJ(),Yq(e);let n=BJ(e);lJ(e,!0),rJ(e),window.addEventListener(`popstate`,e.popStateHandler),n.finally(()=>{e.connectGeneration===t&&jX(e)}),pO(e),e.tab===`logs`&&hO(e),e.tab===`debug`&&_O(e),e.controlUiResponsivenessObserver??(e.controlUiResponsivenessObserver=BO(e))}function BX(e){Yv(e),Xv(e)}function VX(e){e!=null&&typeof window.cancelAnimationFrame==`function`&&window.cancelAnimationFrame(e)}function HX(e){e!=null&&typeof window.clearTimeout==`function`&&window.clearTimeout(e)}function UX(e){var t,n,r,i,a;e.connectGeneration+=1,e.controlUiTabPaintSeq=(e.controlUiTabPaintSeq??0)+1,window.removeEventListener(`popstate`,e.popStateHandler),mO(e),gO(e),vO(e),VX(e.chatScrollFrame),e.chatScrollFrame=null,VX(e.logsScrollFrame),e.logsScrollFrame=null,HX(e.chatScrollTimeout),e.chatScrollTimeout=null,(t=e.realtimeTalkSession)==null||t.stop(),e.realtimeTalkSession=null,e.realtimeTalkActive=!1,e.realtimeTalkStatus=`idle`,e.realtimeTalkDetail=null,e.realtimeTalkTranscript=null,(n=e.client)==null||n.stop(),e.client=null,e.connected=!1,i_.disconnect(),iJ(e),(r=e.topbarObserver)==null||r.disconnect(),e.topbarObserver=null,(i=e.shellWidthObserver)==null||i.disconnect(),e.shellWidthObserver=null,(a=e.controlUiResponsivenessObserver)==null||a.disconnect(),e.controlUiResponsivenessObserver=null}function WX(e,t){if(!(e.tab===`chat`&&e.chatManualRefreshInFlight)){if(e.tab===`chat`&&(t.has(`chatMessages`)||t.has(`chatToolMessages`)||t.has(`chatStream`)||t.has(`chatLoading`)||t.has(`tab`))){let n=t.has(`tab`),r=t.has(`chatLoading`)&&t.get(`chatLoading`)===!0&&!e.chatLoading,i=t.get(`chatStream`),a=t.has(`chatStream`)&&i==null&&typeof e.chatStream==`string`,o=t.get(`chatMessages`),s=t.has(`chatMessages`)&&Array.isArray(o)&&o.length>0&&e.chatMessages.length===0,c=e.chatMessages.length===0&&e.chatToolMessages.length===0&&!e.chatStream;if(s||c||e.pendingChatScrollMessageId)return;let l=t.get(`chatToolMessages`),u=t.has(`chatMessages`)&&Array.isArray(o)&&e.chatMessages.length>o.length,d=t.has(`chatToolMessages`)&&Array.isArray(l)&&e.chatToolMessages.length>l.length,f=t.has(`chatStream`)&&typeof e.chatStream==`string`&&e.chatStream.length>(typeof i==`string`?i.length:0),p=u||d||f;Lv(e,n||r||a||!e.chatHasAutoScrolled,!1,p)}e.tab===`logs`&&(t.has(`logsEntries`)||t.has(`logsAutoFollow`)||t.has(`tab`))&&e.logsAutoFollow&&e.logsAtBottom&&Hv(e,t.has(`tab`)||t.has(`logsAutoFollow`))}}function GX(e){return e.message.trim().length===0&&e.attachments.length===0&&e.knowledgeRefs.length===0&&e.browserRefs.length===0}function KX(e,t){let n=e.chatComposerDraftsBySession??(e.chatComposerDraftsBySession={});if(!t)return;let r={message:e.chatMessage??``,attachments:[...e.chatAttachments??[]],knowledgeRefs:[...e.chatKnowledgeRefs??[]],browserRefs:[...e.chatBrowserRefs??[]]};if(GX(r)){t in n&&(delete n[t],e.chatComposerDraftsBySession={...n});return}n[t]=r,e.chatComposerDraftsBySession={...n}}function qX(e,t,n){let r=e.chatComposerDraftsBySession??(e.chatComposerDraftsBySession={}),i=r[t];i&&t in r&&(delete r[t],e.chatComposerDraftsBySession={...r});let a=(n==null?void 0:n.includeBrowserRefs)!==!1;e.chatMessage=(i==null?void 0:i.message)??``,e.chatAttachments=i?[...i.attachments]:[],e.chatKnowledgeRefs=i?[...i.knowledgeRefs]:[],e.chatBrowserRefs=i&&a?[...i.browserRefs]:[]}function JX(e,t){let n=e.chatComposerDraftsBySession,r=n==null?void 0:n[t];!n||!r||(Ry(r.attachments),delete n[t],e.chatComposerDraftsBySession={...n})}function YX(e,t){let n=t.trim();return n?e.filter(e=>{var t,r;return(((t=e.resultSessionKey)==null?void 0:t.trim())||((r=e.sessionKey)==null?void 0:r.trim()))===n}):[]}async function XX(e,t){let n=t.trim();if(!n)return[];let r=[],i=0;for(let t=0;t<25;t+=1){let t=await e.request(`cron.list`,{includeDisabled:!0,enabled:`all`,limit:200,offset:i}),n=Array.isArray(t.jobs)?t.jobs:[];if(r.push(...n),!t.hasMore||n.length===0)break;i=t.nextOffset??i+n.length}return YX(r,n)}async function ZX(e,t,n){for(let t of n)try{await e.request(`cron.remove`,{id:t.id})}catch(e){return{ok:!1,stage:`cron`,failedJobId:t.id,error:String(e)}}try{await e.request(`sessions.delete`,{key:t,deleteTranscript:!0})}catch(e){return{ok:!1,stage:`session`,error:String(e)}}return{ok:!0}}var QX=`openclaw.control.chat-queue.v1:`,$X=1440*60*1e3;function eZ(e){return`${QX}${e}`}function tZ(e){return typeof e.mediaRef==`string`&&e.mediaRef.length>0}function nZ(e){var t,n,r;let i=(e.attachments??[]).filter(tZ),a=(((t=e.attachments)==null?void 0:t.length)??0)>i.length;return{id:e.id,text:e.text,createdAt:e.createdAt,...e.kind===`steered`?{}:e.kind?{kind:e.kind}:{},...i.length?{attachments:i}:{},...(n=e.knowledgeRefs)!=null&&n.length?{knowledgeRefs:e.knowledgeRefs}:{},...(r=e.browserRefs)!=null&&r.length?{browserRefs:e.browserRefs}:{},...e.refreshSessions?{refreshSessions:e.refreshSessions}:{},...e.localCommandName?{localCommandName:e.localCommandName,localCommandArgs:e.localCommandArgs}:{},...e.pausedReason?{pausedReason:e.pausedReason}:{},...a||e.attachmentsDegraded?{attachmentsDegraded:!0}:{}}}function rZ(e){return!e.pendingRunId}var iZ=new Map,aZ=new Set;function oZ(e){aZ.add(e)}function sZ(e,t){let n=v();if(!n)return;let r=t.filter(rZ).map(nZ);if(!r.length&&!aZ.has(e))return;let i=r.length?JSON.stringify({savedAt:Date.now(),items:r}):``,a=JSON.stringify(r);if(iZ.get(e)!==a){iZ.set(e,a);try{i?n.setItem(eZ(e),i):n.removeItem(eZ(e))}catch{}}}function cZ(e,t,n){sZ(e,t);for(let[t,r]of Object.entries(n))t!==e&&sZ(t,r)}function lZ(e){oZ(e);let t=v();if(!t)return[];let n=null;try{n=t.getItem(eZ(e))}catch{return[]}if(!n)return[];try{let r=JSON.parse(n);if(!r||!Array.isArray(r.items))return[];if(typeof r.savedAt==`number`&&Date.now()-r.savedAt>$X){try{t.removeItem(eZ(e))}catch{}return[]}return r.items.filter(e=>!!e&&typeof e.id==`string`&&typeof e.text==`string`)}catch{return[]}}function uZ(e){iZ.delete(e);let t=v();if(t)try{t.removeItem(eZ(e))}catch{}}var dZ={weixin:`微信`,feishu:`飞书`,wecom:`企微`,dingtalk:`钉钉`};function fZ(e){let t=e.match(/^agent:[^:]+:([^:]+):(?:direct|group):.+$/);if(!t)return null;let n=t[1],r=dZ[n];return r?{label:r,channel:n}:null}function pZ(e){if(!e||!Number.isFinite(e))return null;let t=Math.floor(Math.max(0,Date.now()-e)/6e4);if(t<1)return`刚刚`;if(t<60)return`${t}分钟前`;let n=Math.floor(t/60);return n<24?`${n}小时前`:`${Math.floor(n/24)}天前`}var mZ=null;function hZ(e,t,n){if(e.sidebarMoreMenuKey===t){e.sidebarMoreMenuKey=null,e.sidebarMoveMenuKey=null,e.sidebarMoreMenuPos=null;return}let r=n.getBoundingClientRect(),i=window.innerHeight-r.bottom>=112?r.bottom+4:r.top-104-4;e.sidebarMoreMenuPos={top:Math.max(8,i)},e.sidebarMoreMenuKey=t,e.sidebarMoveMenuKey=null,document.addEventListener(`click`,()=>{e.sidebarMoreMenuKey=null,e.sidebarMoveMenuKey=null,e.sidebarMoreMenuPos=null},{once:!0})}function gZ(e,t){e.sidebarMoveMenuKey=e.sidebarMoveMenuKey===t?null:t}function _Z(e,t,n){if(e.sidebarGroupMoreMenuId===t){e.sidebarGroupMoreMenuId=null,e.sidebarMoreMenuPos=null;return}let r=n.getBoundingClientRect(),i=window.innerHeight-r.bottom>=80?r.bottom+4:r.top-72-4;e.sidebarMoreMenuPos={top:Math.max(8,i)},e.sidebarGroupMoreMenuId=t,document.addEventListener(`click`,()=>{e.sidebarGroupMoreMenuId=null,e.sidebarMoreMenuPos=null},{once:!0})}function vZ(e,t,n){e.sidebarMoreMenuKey=null,e.sidebarMoveMenuKey=null,e.sidebarMoreMenuPos=null,e.sidebarEditingSessionKey=t,e.sidebarEditingSessionLabel=n}function yZ(e,t,n){let r=e.sidebarEditingSessionLabel.trim();e.sidebarEditingSessionKey=null,e.sidebarEditingSessionLabel=``,r&&n(t,r)}function bZ(e){e.sidebarEditingSessionKey=null,e.sidebarEditingSessionLabel=``}function xZ(e,t,n){e.sidebarGroupMoreMenuId=null,e.sidebarMoreMenuPos=null,e.sidebarEditingGroupId=t,e.sidebarEditingGroupLabel=n}function SZ(e){let t=e.sidebarEditingGroupLabel.trim(),n=e.sidebarEditingGroupId;e.sidebarEditingGroupId=null,e.sidebarEditingGroupLabel=``,t&&n&&i_.renameGroup(n,t),e.sidebarGroupVersion++}function CZ(e){e.sidebarEditingGroupId=null,e.sidebarEditingGroupLabel=``}function wZ(e){e instanceof HTMLInputElement&&setTimeout(()=>{e.focus(),e.select()},0)}function TZ(e,t,n){e.sidebarMoreMenuKey=null,e.sidebarMoveMenuKey=null,e.sidebarMoreMenuPos=null,n?n(t):e.sidebarDeleteConfirmKey=t}function EZ(e){e.sidebarDeleteConfirmKey=null,e.sidebarDeleteLinkedJobs=null,e.sidebarDeleteLinkedJobsLoading=!1,e.sidebarDeleteInFlight=!1,e.sidebarDeleteError=null}function DZ(e,t){e.sidebarGroupMoreMenuId=null,e.sidebarMoreMenuPos=null,e.sidebarDeleteGroupConfirmId=t}function OZ(e){e.sidebarDeleteGroupConfirmId=null}function kZ(e,t,n){if(!e.sidebarDeleteConfirmKey)return s;let i=`删除会话`,a=e.sidebarDeleteLinkedJobsLoading,o=e.sidebarDeleteLinkedJobs,c=!a&&o===null&&!!e.sidebarDeleteError,l;l=a?`正在检查关联的定时任务…`:c?`无法确认关联的定时任务,请稍后重试。`:o&&o.length>0?`删除此会话将同时删除以下 ${o.length} 个定时任务:`:`确定删除「${t}」吗?删除后将无法恢复。`;let u=a||o===null||e.sidebarDeleteInFlight;return r`
|
|
3605
3605
|
<openclaw-modal-dialog
|
|
3606
3606
|
label=${i}
|
|
@@ -3968,7 +3968,7 @@ ${e.outputText}</pre
|
|
|
3968
3968
|
${kZ(e,y,a)}
|
|
3969
3969
|
${AZ(e)}
|
|
3970
3970
|
</div>
|
|
3971
|
-
`}var MZ=5e3,NZ=3e4,PZ={ok:`正常`,warn:`注意`,danger:`异常`,unknown:`未知`},FZ=PZ,IZ={ok:0,unknown:1,warn:2,danger:3};function LZ(){return`https://
|
|
3971
|
+
`}var MZ=5e3,NZ=3e4,PZ={ok:`正常`,warn:`注意`,danger:`异常`,unknown:`未知`},FZ=PZ,IZ={ok:0,unknown:1,warn:2,danger:3};function LZ(){return`https://gateway.sealseek.cn`}async function RZ(e){let t=performance.now(),n=localStorage.getItem(`jwt`)??``;try{return await fetch(e,{cache:`no-store`,headers:{Authorization:`Bearer ${n}`,token:n},signal:AbortSignal.timeout(MZ)}),performance.now()-t}catch{return null}}async function zZ(e){let t=LZ(),[n,r]=await Promise.all([RZ(t),RZ(t)]),i=[n,r].filter(e=>e!=null),a=i.length>0?Math.min(...i):null,o=navigator.connection;e.diagnosticsNetwork={latencyMs:a,downlinkMbps:typeof(o==null?void 0:o.downlink)==`number`?o.downlink:null,effectiveType:typeof(o==null?void 0:o.effectiveType)==`string`?o.effectiveType:null,measuredAt:Date.now(),checking:!1}}async function BZ(e){let t=window.sealclawElectron;if(typeof(t==null?void 0:t.getRuntimeInstallState)==`function`&&(e.diagnosticsRuntimeInstall=await t.getRuntimeInstallState().catch(()=>null)),typeof(t==null?void 0:t.getRuntimeEnvironments)==`function`){e.diagnosticsRuntimes=await t.getRuntimeEnvironments();return}if(typeof(t==null?void 0:t.checkNodeNpmAvailability)==`function`){let n=await t.checkNodeNpmAvailability(),r=e=>e?{ok:e.ok,version:e.version,source:e.ok?`bundled`:`none`,error:e.error}:null;e.diagnosticsRuntimes={node:r(n.node),npm:r(n.npm)}}}var VZ=new WeakSet;function HZ(e){if(VZ.has(e))return;let t=window.sealclawElectron;typeof(t==null?void 0:t.onRuntimeInstallProgress)==`function`&&(VZ.add(e),t.onRuntimeInstallProgress(t=>{e.diagnosticsRuntimeInstall=t,t.active||BZ(e)}))}async function UZ(e){e.diagnosticsChecking=!0,e.diagnosticsNetwork={...e.diagnosticsNetwork,checking:!0},HZ(e);try{let t=[zZ(e),BZ(e)];e.client&&e.connected&&t.push(e.client.request(`diagnostics.report`,{}).then(t=>{e.diagnosticsSnapshot=t}).catch(()=>{})),await Promise.all(t)}finally{e.diagnosticsChecking=!1}}function WZ(e){let t=e.diagnosticsNetwork.measuredAt;t!=null&&Date.now()-t<NZ||UZ(e)}function GZ(e){var t;if(e.updateRunning)return{key:`update`,label:`更新状态`,level:`warn`,detail:`检查中`};if(e.updateStatusBanner)return{key:`update`,label:`更新状态`,level:e.updateStatusBanner.tone===`danger`?`danger`:`warn`,detail:e.updateStatusBanner.text};if(e.updateAvailable!=null&&e.updateAvailable.latestVersion!==e.updateAvailable.currentVersion)return{key:`update`,label:`更新状态`,level:`warn`,detail:`发现新版本 v${e.updateAvailable.latestVersion}`};let n=(t=e.diagnosticsSnapshot)==null?void 0:t.updateLastCheckedAt;return n?{key:`update`,label:`更新状态`,level:`ok`,detail:`已是最新版本(${KZ(n)} 检查)`}:{key:`update`,label:`更新状态`,level:`unknown`,detail:`尚未检查更新`}}function KZ(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return`未知时间`;let n=e=>String(e).padStart(2,`0`);return`${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function qZ(e){return typeof e!=`number`||!Number.isFinite(e)?`未知`:`${Math.round(e/(1024*1024))} MB`}function JZ(e){var t;let n=(t=e.diagnosticsSnapshot)==null?void 0:t.memory;if(!n)return{key:`memory`,label:`内存状态`,level:`unknown`,detail:`暂未获取`};let r=n.systemTotalBytes>0?n.systemFreeBytes/n.systemTotalBytes:0,i=r>=.1?`ok`:`warn`;return{key:`memory`,label:`内存状态`,level:i,detail:i===`ok`?`内存充足,服务进程约 ${qZ(n.appRssBytes)}`:`系统可用内存偏低(约 ${Math.round(r*100)}%),服务进程约 ${qZ(n.appRssBytes)}`}}function YZ(e){if(!Number.isFinite(e)||e<0)return`-`;let t=Math.floor(e/1e3);if(t<60)return`刚刚连接`;let n=Math.floor(t/60);if(n<60)return`${n} 分钟`;let r=Math.floor(n/60),i=n%60;if(r<24)return i>0?`${r} 小时 ${i} 分钟`:`${r} 小时`;let a=Math.floor(r/24),o=r%24;return o>0?`${a} 天 ${o} 小时`:`${a} 天`}function XZ(e){let t=e.diagnosticsNetwork.latencyMs!=null;return e.connected&&t?{key:`connectivity`,label:`网络连接`,level:`ok`,detail:`玺虾云端可正常访问`}:e.connected||t?{key:`connectivity`,label:`网络连接`,level:`warn`,detail:`部分链路不稳定,可能影响使用`}:{key:`connectivity`,label:`网络连接`,level:`danger`,detail:`无法连接`}}function ZZ(e){let t=e.diagnosticsNetwork.latencyMs;if(t==null)return{key:`latency`,label:`网络延迟`,level:`unknown`,detail:`未知`};let n=Math.round(t);return t<150?{key:`latency`,label:`网络延迟`,level:`ok`,detail:`约 ${n} ms`}:t<400?{key:`latency`,label:`网络延迟`,level:`warn`,detail:`约 ${n} ms,略有延迟`}:{key:`latency`,label:`网络延迟`,level:`danger`,detail:`约 ${n} ms,延迟较高`}}function QZ(e){let t=e.diagnosticsNetwork.downlinkMbps;return t==null?{key:`bandwidth`,label:`下行带宽`,level:`unknown`,detail:`未知`}:t>=5?{key:`bandwidth`,label:`下行带宽`,level:`ok`,detail:`约 ${t} Mbps`}:t>=1.5?{key:`bandwidth`,label:`下行带宽`,level:`warn`,detail:`约 ${t} Mbps,带宽一般`}:{key:`bandwidth`,label:`下行带宽`,level:`danger`,detail:`约 ${t} Mbps,带宽不足`}}function $Z(e){let t=e.diagnosticsNetwork.effectiveType;return t?t===`4g`?{key:`quality`,label:`网络质量`,level:`ok`,detail:`网络类型良好(4G / 宽带)`}:t===`3g`?{key:`quality`,label:`网络质量`,level:`warn`,detail:`网络类型一般(3G)`}:{key:`quality`,label:`网络质量`,level:`danger`,detail:`网络类型较差(${t})`}:{key:`quality`,label:`网络质量`,level:`unknown`,detail:`未知`}}function eQ(){let e=window.sealclawElectron;return typeof(e==null?void 0:e.getRuntimeEnvironments)==`function`||typeof(e==null?void 0:e.checkNodeNpmAvailability)==`function`}var tQ={managed:`托管`,system:`系统`,bundled:`内置`,none:``};function nQ(e){let t=e.match(/^.*[/\\](\.sealseek[/\\].*)$/);return t?`~/${t[1].replace(/\\/g,`/`)}`:e}function rQ(e,t,n){var r;if(!eQ())return{key:e,label:t,level:`unknown`,detail:`仅桌面端支持`};let i=(r=n.diagnosticsRuntimeInstall)==null||(r=r.items)==null?void 0:r[e===`node`||e===`npm`?`node`:`python`];if(i&&(i.phase===`downloading`||i.phase===`installing`))return{key:e,label:t,level:`unknown`,detail:i.phase===`downloading`&&i.percent!=null?`安装中 ${i.percent}%`:`安装中…`};let a=n.diagnosticsRuntimes[e];if(!a)return{key:e,label:t,level:`unknown`,detail:`尚未检测`};if(a.ok){let n=a.source===`none`?``:tQ[a.source],r=a.version?`v${a.version}`:`可用`;return{key:e,label:t,level:`ok`,detail:n?`${r} · ${n}`:r,path:a.path}}return a.source===`none`?(i==null?void 0:i.phase)===`failed`?{key:e,label:t,level:`warn`,detail:`安装失败,重启应用后自动重试`}:{key:e,label:t,level:e===`node`||e===`npm`?`danger`:`warn`,detail:`未安装`}:{key:e,label:t,level:`danger`,detail:`不可用,可能影响插件安装 / AI 命令执行`,path:a.path}}function iQ(e){var t,n;let r=(t=e.hello)==null||(t=t.server)==null?void 0:t.version,i=r?{key:`version`,label:`玺虾版本`,level:`ok`,detail:`当前版本 ${r}`}:{key:`version`,label:`玺虾版本`,level:`unknown`,detail:`未知`},a=(n=e.hello)==null||(n=n.server)==null?void 0:n.startedAtMs,o=typeof a==`number`&&a>0?{key:`uptime`,label:`运行时长`,level:`ok`,detail:`已运行 ${YZ(Date.now()-a)}`}:{key:`uptime`,label:`运行时长`,level:`unknown`,detail:`未知`};return[i,GZ(e),JZ(e),o,rQ(`node`,`Node.js`,e),rQ(`npm`,`npm`,e),rQ(`python`,`Python`,e),rQ(`pip`,`pip`,e),XZ(e),ZZ(e),QZ(e),$Z(e)]}function aQ(e){let t=`ok`;for(let n of e)IZ[n.level]>IZ[t]&&(t=n.level);return t}function oQ(){let e=/Chrome\/([\d.]+)/.exec(navigator.userAgent);return e?e[1]:`未知`}function sQ(e,t){var n;let r=aQ(t),i=e.diagnosticsSnapshot;return[`玺虾运行状态与环境诊断报告`,`生成时间: ${new Date().toISOString()}`,`总体级别: ${FZ[r]}`,`设备标识: ${(i==null?void 0:i.deviceId)??`未知`}`,`内存: 系统可用 ${qZ(i==null?void 0:i.memory.systemFreeBytes)} / 总量 ${qZ(i==null?void 0:i.memory.systemTotalBytes)},服务进程约 ${qZ(i==null?void 0:i.memory.appRssBytes)}`,`版本: app=${((n=e.hello)==null||(n=n.server)==null?void 0:n.version)??`未知`} node=${(i==null?void 0:i.nodeVersion)??`未知`} chrome=${oQ()} electron=未知`,``,`状态检测:`,...t.slice(0,8).map(e=>`- ${e.label}: ${FZ[e.level]}(${e.detail}${e.path?` · ${e.path}`:``})`),``,`网络检测:`,...t.slice(8).map(e=>`- ${e.label}: ${FZ[e.level]}(${e.detail})`)].join(`
|
|
3972
3972
|
`)}function cQ(e,t){e.diagnosticsBusy={...e.diagnosticsBusy,export:!0};try{let n=sQ(e,t),r=new Blob([n],{type:`text/plain`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`sealclaw-diagnostics-${Date.now()}.txt`,a.click(),URL.revokeObjectURL(i),Y.success(`已导出诊断报告`)}finally{e.diagnosticsBusy={...e.diagnosticsBusy,export:!1}}}function lQ(){var e;return typeof((e=window.sealclawElectron)==null?void 0:e.uploadDiagnosticLogs)==`function`}function uQ(e){let t=e.filter(e=>!e.ok);if(t.length===0){Y.success(`已上传诊断日志`,{description:e.map(e=>e.fileName).join(`、`)});return}let n=t.map(e=>`${e.fileName}: ${e.error??`未知错误`}`).join(`;`);t.length===e.length?Y.error(`上传诊断日志失败`,{description:n}):Y.warning(`部分日志上传失败`,{description:n})}async function dQ(e,t){let n=sQ(e,t),r=window.sealclawElectron;if(typeof(r==null?void 0:r.uploadDiagnosticLogs)==`function`){e.diagnosticsBusy={...e.diagnosticsBusy,upload:!0};try{uQ(await r.uploadDiagnosticLogs(n))}catch(e){Y.error(`上传诊断日志失败`,{description:e instanceof Error?e.message:String(e)})}finally{e.diagnosticsBusy={...e.diagnosticsBusy,upload:!1}}return}if(!e.client||!e.connected){Y.error(`上传失败`,{description:`网关未连接`});return}e.diagnosticsBusy={...e.diagnosticsBusy,upload:!0};try{await e.client.request(`diagnostics.upload`,{reportText:n}),Y.success(`已上传诊断报告`)}catch(e){Y.error(`上传诊断报告失败`,{description:e instanceof Error?e.message:String(e)})}finally{e.diagnosticsBusy={...e.diagnosticsBusy,upload:!1}}}function fQ(){let e=window.sealclawElectron;if(typeof(e==null?void 0:e.openMainLogFolder)!=`function`){Y.info(`仅桌面端支持`,{description:`请在玺虾桌面客户端中使用该功能`});return}e.openMainLogFolder().then(e=>{e.ok||Y.error(`打开日志目录失败`,{description:e.error??`未知错误`})})}function pQ(e){e.chatStreamTickTimer!=null&&(clearInterval(e.chatStreamTickTimer),e.chatStreamTickTimer=null),e.chatStreamLastDurationSec=null,e.chatStreamLastModel=null,e.chatStreamLastThinkingBlocks=null,e.chatTypewriterTimer!=null&&(clearInterval(e.chatTypewriterTimer),e.chatTypewriterTimer=null),e.chatStreamRevealLen=0,e.chatStreamRevealReasoningLen=0,e.chatPendingFinal=null}function mQ(e){return Ku(e)}function hQ(e){return Ju(e)}function gQ(e){var t,n;let r=Sg(e.sessionKey),i=(t=e.agentsList)==null?void 0:t.agents.find(e=>g(e.id)===r);return{agentLabel:h(i==null||(n=i.identity)==null?void 0:n.name)??h(i==null?void 0:i.name)??r}}function _Q(e,t){let n=e.chatQueueBySession??(e.chatQueueBySession={});if(e.chatQueue.length>0){n[t]=[...e.chatQueue],e.chatQueueBySession={...n};return}Object.prototype.hasOwnProperty.call(n,t)&&(delete n[t],e.chatQueueBySession={...n})}function vQ(e,t){var n;let r=(n=e.chatQueueBySession)==null?void 0:n[t];return r?[...r]:lZ(t)}function yQ(e,t){let n=e.workspaceBrowserStateBySession??(e.workspaceBrowserStateBySession={});n[t]=e.workspaceBrowserState}function bQ(e,t){var n;return((n=e.workspaceBrowserStateBySession)==null?void 0:n[t])??qY(t)}function xQ(e,t){let n=e,r=e.sessionKey;if(_Q(e,r),KX(e,r),yQ(e,r),r&&r!==`__draft__`&&e.chatMessages.length>0){let t=e.currentSessionId??null;Ig(r,{messages:e.chatMessages,sessionId:t,thinkingLevel:e.chatThinkingLevel,fetchedAt:Date.now()})}pQ(n),xw(e,t),e.currentSessionId=null,qX(e,t),e.chatThinkingLevel=null,e.chatSideResult=null,e.lastError=null,e.fallbackStatus=null,e.chatAvatarUrl=null,e.chatAvatarSource=null,e.chatAvatarStatus=null,e.chatAvatarReason=null,e.chatQueue=vQ(e,t),e.workspaceBrowserState=bQ(e,t),n.resetChatInputHistoryNavigation(),n.chatSideResultTerminalRuns.clear(),n.resetChatScroll(),Aw(e),e.applySettings({...e.settings,sessionKey:t,lastActiveSessionKey:t}),e.chatDraftMode=!1,e.chatDraftParentSessionKey=null,e.chatDraftAgentId=null}function SQ(e,t,n){let i=AS(t,e.basePath),a=t===`chat`?e.tab===`chat`&&e.chatDraftMode:e.tab===t,o=(n==null?void 0:n.collapsed)??e.settings.navCollapsed;return r`
|
|
3973
3973
|
<a
|
|
3974
3974
|
href=${i}
|
|
@@ -5467,7 +5467,7 @@ ${e.outputText}</pre
|
|
|
5467
5467
|
</div>
|
|
5468
5468
|
`}
|
|
5469
5469
|
</div>
|
|
5470
|
-
`}function M0(e,t){if(!e)return t;if(!t)return e;let n={fresh:0,partial:1,stale:2,refreshing:3};return{status:n[t.status]>n[e.status]?t.status:e.status,cachedFiles:Math.max(e.cachedFiles,t.cachedFiles),pendingFiles:Math.max(e.pendingFiles,t.pendingFiles),staleFiles:Math.max(e.staleFiles,t.staleFiles),refreshedAt:Math.max(e.refreshedAt??0,t.refreshedAt??0)||void 0}}var N0=null,P0=e=>{N0&&clearTimeout(N0),N0=window.setTimeout(()=>void mj(e),400)};function F0(e){var t,n,r,i,a,o,c;return e.tab===`usage`?j0({data:{loading:e.usageLoading,error:e.usageError,sessions:((t=e.usageResult)==null?void 0:t.sessions)??[],sessionsLimitReached:(((n=e.usageResult)==null||(n=n.sessions)==null?void 0:n.length)??0)>=1e3,totals:((r=e.usageResult)==null?void 0:r.totals)??null,aggregates:((i=e.usageResult)==null?void 0:i.aggregates)??null,costDaily:((a=e.usageCostSummary)==null?void 0:a.daily)??[],cacheStatus:M0((o=e.usageResult)==null?void 0:o.cacheStatus,(c=e.usageCostSummary)==null?void 0:c.cacheStatus)},filters:{startDate:e.usageStartDate,endDate:e.usageEndDate,selectedSessions:e.usageSelectedSessions,selectedDays:e.usageSelectedDays,selectedHours:e.usageSelectedHours,query:e.usageQuery,queryDraft:e.usageQueryDraft,timeZone:e.usageTimeZone},display:{chartMode:e.usageChartMode,dailyChartMode:e.usageDailyChartMode,sessionSort:e.usageSessionSort,sessionSortDir:e.usageSessionSortDir,recentSessions:e.usageRecentSessions,sessionsTab:e.usageSessionsTab,visibleColumns:e.usageVisibleColumns,contextExpanded:e.usageContextExpanded,headerPinned:e.usageHeaderPinned},detail:{timeSeriesMode:e.usageTimeSeriesMode,timeSeriesBreakdownMode:e.usageTimeSeriesBreakdownMode,timeSeries:e.usageTimeSeries,timeSeriesLoading:e.usageTimeSeriesLoading,timeSeriesCursorStart:e.usageTimeSeriesCursorStart,timeSeriesCursorEnd:e.usageTimeSeriesCursorEnd,sessionLogs:e.usageSessionLogs,sessionLogsLoading:e.usageSessionLogsLoading,sessionLogsExpanded:e.usageSessionLogsExpanded,logFilters:{roles:e.usageLogFilterRoles,tools:e.usageLogFilterTools,hasTools:e.usageLogFilterHasTools,query:e.usageLogFilterQuery}},callbacks:{filters:{onStartDateChange:t=>{e.usageStartDate=t,e.usageSelectedDays=[],e.usageSelectedHours=[],e.usageSelectedSessions=[],P0(e)},onEndDateChange:t=>{e.usageEndDate=t,e.usageSelectedDays=[],e.usageSelectedHours=[],e.usageSelectedSessions=[],P0(e)},onRefresh:()=>mj(e),onTimeZoneChange:t=>{e.usageTimeZone=t,e.usageSelectedDays=[],e.usageSelectedHours=[],e.usageSelectedSessions=[],mj(e)},onToggleHeaderPinned:()=>{e.usageHeaderPinned=!e.usageHeaderPinned},onSelectHour:(t,n)=>{if(n&&e.usageSelectedHours.length>0){let n=Array.from({length:24},(e,t)=>t),r=e.usageSelectedHours[e.usageSelectedHours.length-1],i=n.indexOf(r),a=n.indexOf(t);if(i!==-1&&a!==-1){let[t,r]=i<a?[i,a]:[a,i],o=n.slice(t,r+1);e.usageSelectedHours=[...new Set([...e.usageSelectedHours,...o])]}}else e.usageSelectedHours.includes(t)?e.usageSelectedHours=e.usageSelectedHours.filter(e=>e!==t):e.usageSelectedHours=[...e.usageSelectedHours,t]},onQueryDraftChange:t=>{e.usageQueryDraft=t,e.usageQueryDebounceTimer&&window.clearTimeout(e.usageQueryDebounceTimer),e.usageQueryDebounceTimer=window.setTimeout(()=>{e.usageQuery=e.usageQueryDraft,e.usageQueryDebounceTimer=null},250)},onApplyQuery:()=>{e.usageQueryDebounceTimer&&(window.clearTimeout(e.usageQueryDebounceTimer),e.usageQueryDebounceTimer=null),e.usageQuery=e.usageQueryDraft},onClearQuery:()=>{e.usageQueryDebounceTimer&&(window.clearTimeout(e.usageQueryDebounceTimer),e.usageQueryDebounceTimer=null),e.usageQueryDraft=``,e.usageQuery=``},onSelectDay:(t,n)=>{if(n&&e.usageSelectedDays.length>0){var r;let n=(((r=e.usageCostSummary)==null?void 0:r.daily)??[]).map(e=>e.date),i=e.usageSelectedDays[e.usageSelectedDays.length-1],a=n.indexOf(i),o=n.indexOf(t);if(a!==-1&&o!==-1){let[t,r]=a<o?[a,o]:[o,a],i=n.slice(t,r+1);e.usageSelectedDays=[...new Set([...e.usageSelectedDays,...i])]}}else e.usageSelectedDays.includes(t)?e.usageSelectedDays=e.usageSelectedDays.filter(e=>e!==t):e.usageSelectedDays=[t]},onClearDays:()=>{e.usageSelectedDays=[]},onClearHours:()=>{e.usageSelectedHours=[]},onClearSessions:()=>{e.usageSelectedSessions=[],e.usageTimeSeries=null,e.usageSessionLogs=null},onClearFilters:()=>{e.usageSelectedDays=[],e.usageSelectedHours=[],e.usageSelectedSessions=[],e.usageTimeSeries=null,e.usageSessionLogs=null}},display:{onChartModeChange:t=>{e.usageChartMode=t},onDailyChartModeChange:t=>{e.usageDailyChartMode=t},onSessionSortChange:t=>{e.usageSessionSort=t},onSessionSortDirChange:t=>{e.usageSessionSortDir=t},onSessionsTabChange:t=>{e.usageSessionsTab=t},onToggleColumn:t=>{e.usageVisibleColumns.includes(t)?e.usageVisibleColumns=e.usageVisibleColumns.filter(e=>e!==t):e.usageVisibleColumns=[...e.usageVisibleColumns,t]}},details:{onToggleContextExpanded:()=>{e.usageContextExpanded=!e.usageContextExpanded},onToggleSessionLogsExpanded:()=>{e.usageSessionLogsExpanded=!e.usageSessionLogsExpanded},onLogFilterRolesChange:t=>{e.usageLogFilterRoles=t},onLogFilterToolsChange:t=>{e.usageLogFilterTools=t},onLogFilterHasToolsChange:t=>{e.usageLogFilterHasTools=t},onLogFilterQueryChange:t=>{e.usageLogFilterQuery=t},onLogFilterClear:()=>{e.usageLogFilterRoles=[],e.usageLogFilterTools=[],e.usageLogFilterHasTools=!1,e.usageLogFilterQuery=``},onSelectSession:(t,n)=>{if(e.usageTimeSeries=null,e.usageSessionLogs=null,e.usageRecentSessions=[t,...e.usageRecentSessions.filter(e=>e!==t)].slice(0,8),n&&e.usageSelectedSessions.length>0){var r;let n=e.usageChartMode===`tokens`,i=[...((r=e.usageResult)==null?void 0:r.sessions)??[]].toSorted((e,t)=>{var r,i,a,o;let s=n?((r=e.usage)==null?void 0:r.totalTokens)??0:((i=e.usage)==null?void 0:i.totalCost)??0;return(n?((a=t.usage)==null?void 0:a.totalTokens)??0:((o=t.usage)==null?void 0:o.totalCost)??0)-s}).map(e=>e.key),a=e.usageSelectedSessions[e.usageSelectedSessions.length-1],o=i.indexOf(a),s=i.indexOf(t);if(o!==-1&&s!==-1){let[t,n]=o<s?[o,s]:[s,o],r=i.slice(t,n+1);e.usageSelectedSessions=[...new Set([...e.usageSelectedSessions,...r])]}}else e.usageSelectedSessions.length===1&&e.usageSelectedSessions[0]===t?e.usageSelectedSessions=[]:e.usageSelectedSessions=[t];e.usageTimeSeriesCursorStart=null,e.usageTimeSeriesCursorEnd=null,e.usageSelectedSessions.length===1&&(gj(e,e.usageSelectedSessions[0]),_j(e,e.usageSelectedSessions[0]))},onTimeSeriesModeChange:t=>{e.usageTimeSeriesMode=t},onTimeSeriesBreakdownChange:t=>{e.usageTimeSeriesBreakdownMode=t},onTimeSeriesCursorRangeChange:(t,n)=>{e.usageTimeSeriesCursorStart=t,e.usageTimeSeriesCursorEnd=n}}}}):s}function I0(e){if(!e||typeof e!=`object`)return 0;let t=e.timestamp;return typeof t==`number`&&Number.isFinite(t)?t:0}function L0(e){if(!e||typeof e!=`object`)return!1;let t=e.role;return typeof t==`string`&&t.toLowerCase()===`user`}function R0(e){try{return new URL(e).hostname}catch{return e}}function z0(e){let t=new Map,n=(e,n,r)=>{if(!e)return;let i=t.get(e);if(!i){t.set(e,{url:e,title:n||R0(e),referencedAtMs:r});return}r>i.referencedAtMs&&(i.referencedAtMs=r),n&&(!i.title||i.title===R0(e))&&(i.title=n)};for(let t of e){if(!L0(t))continue;let e=I0(t);for(let r of QS(t))n(r.url,r.title,r.capturedAt||e);for(let r of XS(t))r.url&&n(r.url,r.title??``,e)}return[...t.values()].sort((e,t)=>t.referencedAtMs-e.referencedAtMs)}async function B0(e){if(!(!e.client||!e.connected||e.fileSpaceLoading)){e.fileSpaceLoading=!0,e.fileSpaceError=null;try{var t;let n=(((t=e.sessionsResult)==null?void 0:t.sessions)??[]).filter(e=>!e.spawnedBy&&!e.archived);e.fileSpaceData=(await Promise.all(n.map(async t=>{let n=Sg(t.key),r=t.sessionId,i=t.displayName??t.label??t.key,a=await e.client.request(`workspace.output.list`,{agentId:n,...r?{sessionId:r}:{}}).then(e=>{var t;return(e==null||(t=e.files)==null?void 0:t.filter(e=>!e.isDir))??[]}).catch(()=>[]),o=await e.client.request(`chat.attachments.list`,{sessionKey:t.key}).then(e=>(e==null?void 0:e.files)??[]).catch(()=>[]);return{sessionKey:t.key,sessionLabel:i,agentId:n,outputFiles:a,refFiles:o}}))).filter(e=>e.outputFiles.length>0||e.refFiles.length>0)}catch(t){e.fileSpaceError=String(t)}finally{e.fileSpaceLoading=!1}}}var V0=()=>p(`/api/sealclaw/client/sync`,{method:`POST`}),H0=(e,t)=>p(`/api/sealclaw/client/skills/${e}/download`,{method:`GET`,params:{token:t}}),U0=e=>p(`/api/sealclaw/share/${encodeURIComponent(e)}`,{method:`GET`}),W0=e=>p(`/api/sealclaw/share/${encodeURIComponent(e)}/claim`,{method:`POST`}),G0=e=>p(`/api/sealclaw/share/my`,{method:`GET`,params:e}),K0=e=>p(`/api/sealclaw/enterprise/skills`,{method:`GET`,params:e}),q0=e=>p(`/api/sealclaw/enterprise/skills/${e}/install`,{method:`POST`}),J0=()=>p(`/api/sealclaw/store/categories`),Y0=e=>p(`/api/sealclaw/store/skills`,{method:`GET`,params:e}).then(e=>e.data),X0=(e,t)=>p(`/api/sealclaw/store/skills/${e}/acquire`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),Z0=t({claimImportShare:()=>p2,closeImportDialog:()=>u2,closePublishDialog:()=>v2,closeShareDialog:()=>c2,confirmShareSkill:()=>s2,installEnterpriseSkillAction:()=>g2,loadEnterpriseSkills:()=>h2,loadMySharesForMatching:()=>a2,loadSkillCenterCategories:()=>e2,loadSkillCenterSkills:()=>t2,loadSyncVersionMap:()=>$0,nextPatchVersion:()=>i2,openImportDialog:()=>l2,openPublishDialog:()=>_2,openShareDialog:()=>o2,previewImportShare:()=>f2,publishSkillAction:()=>y2,uninstallSkillCenterItem:()=>r2,updateSyncSkill:()=>m2,useSkillCenterItem:()=>n2});function Q0(e){e==null||e()}async function $0(e,t){if(!e.syncVersionMapLoaded){e.syncVersionMapLoaded=!0;try{var n;let t=await V0(),r=(t==null||(n=t.data)==null?void 0:n.skills)??[],i=new Map,a=new Map;for(let e of r)e.name&&e.version&&i.set(e.name,e.version),e.skillId&&e.version&&a.set(e.skillId,e.version);e.syncVersionMap=i,e.syncVersionByIdMap=a}catch{e.syncVersionMapLoaded=!1}Q0(t)}}async function e2(e,t){if(!(e.skillCenterCategories||e.skillCenterCategoriesLoading)){e.skillCenterCategoriesLoading=!0,Q0(t);try{let t=await J0();e.skillCenterCategories=(t==null?void 0:t.data)??[]}catch{e.skillCenterCategories=[]}finally{e.skillCenterCategoriesLoading=!1,Q0(t)}}}async function t2(e,t){e.storeSkillsLoading=!0,e.storeSkills=null,Q0(t);try{let t=await Y0({page:1,size:100});e.storeSkills=(t==null?void 0:t.data)??[]}catch{e.storeSkills=[]}finally{e.storeSkillsLoading=!1,Q0(t)}}async function n2(e,t,n){e.skillCenterItemBusy=t.name,e.skillCenterItemError=null,Q0(n);try{var r,i;let o=await V0(),s=((o==null||(r=o.data)==null?void 0:r.skills)??[]).find(e=>e.skillId===t.id);if(!s){var a;await X0(t.id,{type:`FREE`});let e=await V0();s=e==null||(a=e.data)==null||(a=a.skills)==null?void 0:a.find(e=>e.skillId===t.id)}if(!s){let t=`获取技能授权失败`;return e.skillCenterItemError=t,Q0(n),{ok:!1,error:t}}let c=await H0(s.skillId,s.downloadToken),l=c==null||(i=c.data)==null?void 0:i.url;if(!l){let t=`获取下载链接失败`;return e.skillCenterItemError=t,Q0(n),{ok:!1,error:t}}return{ok:!0,url:l}}catch(t){let r=t instanceof Error?t.message:String(t);return e.skillCenterItemError=r,Q0(n),{ok:!1,error:r}}finally{e.skillCenterItemBusy=null,Q0(n)}}async function r2(e,t,n){if(e.client){e.skillCenterItemBusy=t,e.skillCenterItemError=null,Q0(n);try{await e.client.request(`skills.uninstall`,{name:t})}catch(t){e.skillCenterItemError=t instanceof Error?t.message:String(t)}finally{e.skillCenterItemBusy=null,Q0(n)}}}function i2(e){let t=e.split(`.`);if(t.length!==3)return`1.0.0`;let[n,r,i]=t.map(Number);return[n,r,i].some(e=>!Number.isFinite(e))?`1.0.0`:`${n}.${r}.${i+1}`}async function a2(e,t){if(!e.mySharesLoaded){try{var n;let t=await G0({page:1,size:200});e.mySharesForMatching=(t==null||(n=t.data)==null?void 0:n.data)??[]}catch{}e.mySharesLoaded=!0,Q0(t)}}async function o2(e,t,n){e.mySharesLoaded=!1,await a2(e,n);let r=e.mySharesForMatching.find(e=>e.skillName===t&&e.status===1);e.shareDialogSkill=t,e.shareDialogError=null,e.shareDialogResult=null,r?(e.shareDialogPhase=`view`,e.shareDialogExisting=r,e.shareDialogVersion=r.version?i2(r.version):`1.0.0`):(e.shareDialogPhase=`confirm`,e.shareDialogExisting=null,e.shareDialogVersion=`1.0.0`),Q0(n)}async function s2(e,t){if(!(!e.client||!e.shareDialogSkill)){e.shareDialogPhase=`loading`,e.shareDialogError=null,Q0(t);try{var n,r,i;let a=typeof localStorage<`u`?localStorage.getItem(`jwt`)??void 0:void 0,o=(n=e.skillsReport)==null||(n=n.skills)==null?void 0:n.find(t=>t.name===e.shareDialogSkill),s=(o==null||(r=o.storeExtra)==null?void 0:r.skillId)??((i=e.shareDialogExisting)==null?void 0:i.skillId),c=await e.client.request(`skills.share`,{name:e.shareDialogSkill,version:e.shareDialogVersion,title:e.shareDialogSkill,skillId:s,token:a,apiBase:`https://gatewaytest.sealseek.cn/api/sealclaw`});if(c!=null&&c.shareUrl){e.shareDialogPhase=`success`,e.shareDialogResult={shareCode:c.shareCode,shareUrl:c.shareUrl};let n=e.shareDialogSkill;e.mySharesForMatching=[{shareCode:c.shareCode,skillName:n,skillTitle:n,skillId:0,version:e.shareDialogVersion,status:1,claimedCount:0},...e.mySharesForMatching.filter(e=>!(e.skillName===n&&e.status===1))],e.mySharesLoaded=!1,a2(e,t),e.enterpriseSkillsLoaded=!1,h2(e,void 0,t),e.syncVersionMapLoaded=!1,$0(e,t)}else e.shareDialogError=`分享失败:服务端未返回分享链接`,e.shareDialogPhase=e.shareDialogExisting?`view`:`confirm`}catch(t){e.shareDialogError=t instanceof Error?t.message:String(t),e.shareDialogPhase=e.shareDialogExisting?`view`:`confirm`}Q0(t)}}function c2(e,t){e.shareDialogSkill=null,e.shareDialogResult=null,e.shareDialogError=null,e.shareDialogExisting=null,Q0(t)}function l2(e,t){e.importDialogOpen=!0,e.importShareCode=``,e.importPreview=null,e.importPreviewLoading=!1,e.importClaimLoading=!1,e.importClaimResult=null,e.importError=null,Q0(t)}function u2(e,t){e.importDialogOpen=!1,Q0(t)}function d2(e){var t;let n=(e??``).trim();return n?n.includes(`/s/`)?((t=n.split(`/s/`).pop())==null?void 0:t.trim())??``:n:``}async function f2(e,t,n){let r=d2(t);if(!r){e.importError=`请先输入分享码或链接`,Q0(n);return}e.importShareCode=r,e.importPreviewLoading=!0,e.importPreview=null,e.importClaimResult=null,e.importError=null,Q0(n);try{let t=await U0(r);e.importPreview=(t==null?void 0:t.data)??null}catch(t){e.importError=t instanceof Error?t.message:String(t)}finally{e.importPreviewLoading=!1,Q0(n)}}async function p2(e,t){if(!e.importShareCode)return{ok:!1};e.importClaimLoading=!0,e.importClaimResult=null,e.importError=null,Q0(t);try{var n,r,i,a;await W0(e.importShareCode);let t=((n=await V0())==null||(n=n.data)==null?void 0:n.skills)??[],o=(r=e.importPreview)==null?void 0:r.skillId,s=o==null?t.at(-1):t.find(e=>e.skillId===o);if(!s)return e.importClaimResult=`领取成功!技能正在同步,请稍后在技能中心刷新。`,{ok:!1};let c=(i=await H0(s.skillId,s.downloadToken))==null||(i=i.data)==null?void 0:i.url;return c?{ok:!0,url:c,name:s.name,version:s.version,authorUuid:(a=e.importPreview)==null?void 0:a.authorUuid,skillId:s.skillId}:(e.importError=`获取下载链接失败`,{ok:!1})}catch(t){return e.importError=t instanceof Error?t.message:String(t),{ok:!1}}finally{e.importClaimLoading=!1,Q0(t)}}async function m2(e,t,n){if(e.client){e.skillCenterItemBusy=t,Q0(n);try{var r,i,a;let n=(r=e.skillsReport)==null||(r=r.skills)==null?void 0:r.find(e=>e.name===t),o=(n==null?void 0:n.storeExtra)??{},s=o.skillId,c=await V0(),l=(c==null||(i=c.data)==null?void 0:i.skills)??[],u=s?l.find(e=>e.skillId===s):l.find(e=>e.name===t);if(!u){e.skillCenterItemError=`未找到该技能的服务端记录`;return}let d=await H0(u.skillId,u.downloadToken),f=d==null||(a=d.data)==null?void 0:a.url;if(!f){e.skillCenterItemError=`获取下载链接失败`;return}await e.client.request(`skills.install`,{source:`url`,url:f,name:u.name,force:!0,storeExtra:{...o,currentVersion:u.version,skillId:u.skillId}})}catch(t){e.skillCenterItemError=t instanceof Error?t.message:String(t)}finally{e.skillCenterItemBusy=null,Q0(n)}}}async function h2(e,t,n){if(!(e.enterpriseSkillsLoaded&&t===void 0)){e.enterpriseSkillsLoading=!0,Q0(n);try{var r;let n=await K0({keyword:t,page:1,size:50});e.enterpriseSkills=(n==null||(r=n.data)==null?void 0:r.data)??[]}catch{}e.enterpriseSkillsLoaded=!0,e.enterpriseSkillsLoading=!1,Q0(n)}}async function g2(e,t,n){let r=e.enterpriseSkills.find(e=>e.skillId===t);if(r){var i,a;let t=(i=e.skillsReport)==null||(i=i.skills)==null?void 0:i.find(e=>e.name===r.name),o=t==null||(a=t.storeExtra)==null?void 0:a.source;if(t&&o&&o!==`enterprise`){e.enterpriseError=`本地已有同名技能「${r.name}」(来源:${o===`share`?`分享`:`商店`}),请先卸载后再安装`,Q0(n);return}}e.enterpriseInstallLoading=t,e.enterpriseError=null,Q0(n);try{var o;await q0(t);let n=await V0(),i=((n==null||(o=n.data)==null?void 0:o.skills)??[]).find(e=>e.skillId===t);if(i&&e.client){var s;let n=await H0(i.skillId,i.downloadToken),a=n==null||(s=n.data)==null?void 0:s.url;if(a){await e.client.request(`skills.install`,{source:`url`,url:a,name:i.name,force:!0,storeExtra:{currentVersion:i.version,source:`enterprise`,authorUuid:r==null?void 0:r.authorUuid,skillId:t}});let n=e.enterpriseSkills.find(e=>e.skillId===t);n&&(n.owned=!0)}}}catch(t){e.enterpriseError=t instanceof Error?t.message:String(t)}finally{e.enterpriseInstallLoading=null,Q0(n)}}function _2(e,t,n){let r=e.enterpriseSkills.find(e=>e.name===t);e.publishDialogOpen=!0,e.publishingSkill=t,e.publishTarget=r?`enterprise`:null,e.publishLoading=!1,e.publishError=null,e.publishSuccess=null,Q0(n)}function v2(e,t){e.publishDialogOpen=!1,e.publishingSkill=null,e.publishTarget=null,e.publishLoading=!1,e.publishError=null,e.publishSuccess=null,Q0(t)}async function y2(e,t){if(!(!e.client||!e.publishingSkill||!e.publishTarget)){e.publishLoading=!0,e.publishError=null,e.publishSuccess=null,Q0(t);try{let i=typeof localStorage<`u`?localStorage.getItem(`jwt`)??void 0:void 0;if(e.publishTarget===`enterprise`){var n,r;let a=(n=e.skillsReport)==null||(n=n.skills)==null?void 0:n.find(t=>t.name===e.publishingSkill),o=a==null||(r=a.storeExtra)==null?void 0:r.skillId,s=o?e.enterpriseSkills.find(e=>e.skillId===o):e.enterpriseSkills.find(t=>t.name===e.publishingSkill),c=(s==null?void 0:s.latestVersion)??(s==null?void 0:s.version);await e.client.request(`skills.publishEnterprise`,{name:e.publishingSkill,skillId:s==null?void 0:s.skillId,version:c?i2(c):void 0,token:i,apiBase:`https://gatewaytest.sealseek.cn/api/sealclaw`}),e.publishSuccess=`发布成功,企业成员可在企业技能中安装。`,e.enterpriseSkillsLoaded=!1,h2(e,void 0,t),e.syncVersionMapLoaded=!1,$0(e,t),e.mySharesLoaded=!1,a2(e,t)}else e.publishError=`公开商店发布暂未开放`}catch(t){e.publishError=t instanceof Error?t.message:String(t)}finally{e.publishLoading=!1,Q0(t)}}}function b2(e){e==null||e()}async function x2(e,t){let n=e.storeSkills!==null&&e.storeSkills!==void 0;e.skillStoreOpen=!0,n||(e.storeSkillsLoading=!0),b2(t);try{let t=await Y0({page:1,size:50});e.storeSkills=(t==null?void 0:t.data)??[]}catch{e.storeSkills||(e.storeSkills=[])}finally{e.storeSkillsLoading=!1,b2(t)}}function S2(e,t){e.skillStoreOpen=!1,e.storeItemError=null,b2(t)}async function C2(e,t,n){e.storeItemLoading=t.name,e.storeItemError=null,b2(n);try{var r,i;let o=await V0(),s=((o==null||(r=o.data)==null?void 0:r.skills)??[]).find(e=>e.skillId===t.id);if(!s){var a;await X0(t.id,{type:`FREE`});let e=await V0();s=e==null||(a=e.data)==null||(a=a.skills)==null?void 0:a.find(e=>e.skillId===t.id)}if(!s){let t=`获取技能授权失败`;return e.storeItemError=t,b2(n),{ok:!1,error:t}}let c=await H0(s.skillId,s.downloadToken),l=c==null||(i=c.data)==null?void 0:i.url;if(!l){let t=`获取下载链接失败`;return e.storeItemError=t,b2(n),{ok:!1,error:t}}return{ok:!0,url:l}}catch(t){let r=t instanceof Error?t.message:String(t);return e.storeItemError=r,b2(n),{ok:!1,error:r}}finally{e.storeItemLoading=null,b2(n)}}var w2=`(function () {
|
|
5470
|
+
`}function M0(e,t){if(!e)return t;if(!t)return e;let n={fresh:0,partial:1,stale:2,refreshing:3};return{status:n[t.status]>n[e.status]?t.status:e.status,cachedFiles:Math.max(e.cachedFiles,t.cachedFiles),pendingFiles:Math.max(e.pendingFiles,t.pendingFiles),staleFiles:Math.max(e.staleFiles,t.staleFiles),refreshedAt:Math.max(e.refreshedAt??0,t.refreshedAt??0)||void 0}}var N0=null,P0=e=>{N0&&clearTimeout(N0),N0=window.setTimeout(()=>void mj(e),400)};function F0(e){var t,n,r,i,a,o,c;return e.tab===`usage`?j0({data:{loading:e.usageLoading,error:e.usageError,sessions:((t=e.usageResult)==null?void 0:t.sessions)??[],sessionsLimitReached:(((n=e.usageResult)==null||(n=n.sessions)==null?void 0:n.length)??0)>=1e3,totals:((r=e.usageResult)==null?void 0:r.totals)??null,aggregates:((i=e.usageResult)==null?void 0:i.aggregates)??null,costDaily:((a=e.usageCostSummary)==null?void 0:a.daily)??[],cacheStatus:M0((o=e.usageResult)==null?void 0:o.cacheStatus,(c=e.usageCostSummary)==null?void 0:c.cacheStatus)},filters:{startDate:e.usageStartDate,endDate:e.usageEndDate,selectedSessions:e.usageSelectedSessions,selectedDays:e.usageSelectedDays,selectedHours:e.usageSelectedHours,query:e.usageQuery,queryDraft:e.usageQueryDraft,timeZone:e.usageTimeZone},display:{chartMode:e.usageChartMode,dailyChartMode:e.usageDailyChartMode,sessionSort:e.usageSessionSort,sessionSortDir:e.usageSessionSortDir,recentSessions:e.usageRecentSessions,sessionsTab:e.usageSessionsTab,visibleColumns:e.usageVisibleColumns,contextExpanded:e.usageContextExpanded,headerPinned:e.usageHeaderPinned},detail:{timeSeriesMode:e.usageTimeSeriesMode,timeSeriesBreakdownMode:e.usageTimeSeriesBreakdownMode,timeSeries:e.usageTimeSeries,timeSeriesLoading:e.usageTimeSeriesLoading,timeSeriesCursorStart:e.usageTimeSeriesCursorStart,timeSeriesCursorEnd:e.usageTimeSeriesCursorEnd,sessionLogs:e.usageSessionLogs,sessionLogsLoading:e.usageSessionLogsLoading,sessionLogsExpanded:e.usageSessionLogsExpanded,logFilters:{roles:e.usageLogFilterRoles,tools:e.usageLogFilterTools,hasTools:e.usageLogFilterHasTools,query:e.usageLogFilterQuery}},callbacks:{filters:{onStartDateChange:t=>{e.usageStartDate=t,e.usageSelectedDays=[],e.usageSelectedHours=[],e.usageSelectedSessions=[],P0(e)},onEndDateChange:t=>{e.usageEndDate=t,e.usageSelectedDays=[],e.usageSelectedHours=[],e.usageSelectedSessions=[],P0(e)},onRefresh:()=>mj(e),onTimeZoneChange:t=>{e.usageTimeZone=t,e.usageSelectedDays=[],e.usageSelectedHours=[],e.usageSelectedSessions=[],mj(e)},onToggleHeaderPinned:()=>{e.usageHeaderPinned=!e.usageHeaderPinned},onSelectHour:(t,n)=>{if(n&&e.usageSelectedHours.length>0){let n=Array.from({length:24},(e,t)=>t),r=e.usageSelectedHours[e.usageSelectedHours.length-1],i=n.indexOf(r),a=n.indexOf(t);if(i!==-1&&a!==-1){let[t,r]=i<a?[i,a]:[a,i],o=n.slice(t,r+1);e.usageSelectedHours=[...new Set([...e.usageSelectedHours,...o])]}}else e.usageSelectedHours.includes(t)?e.usageSelectedHours=e.usageSelectedHours.filter(e=>e!==t):e.usageSelectedHours=[...e.usageSelectedHours,t]},onQueryDraftChange:t=>{e.usageQueryDraft=t,e.usageQueryDebounceTimer&&window.clearTimeout(e.usageQueryDebounceTimer),e.usageQueryDebounceTimer=window.setTimeout(()=>{e.usageQuery=e.usageQueryDraft,e.usageQueryDebounceTimer=null},250)},onApplyQuery:()=>{e.usageQueryDebounceTimer&&(window.clearTimeout(e.usageQueryDebounceTimer),e.usageQueryDebounceTimer=null),e.usageQuery=e.usageQueryDraft},onClearQuery:()=>{e.usageQueryDebounceTimer&&(window.clearTimeout(e.usageQueryDebounceTimer),e.usageQueryDebounceTimer=null),e.usageQueryDraft=``,e.usageQuery=``},onSelectDay:(t,n)=>{if(n&&e.usageSelectedDays.length>0){var r;let n=(((r=e.usageCostSummary)==null?void 0:r.daily)??[]).map(e=>e.date),i=e.usageSelectedDays[e.usageSelectedDays.length-1],a=n.indexOf(i),o=n.indexOf(t);if(a!==-1&&o!==-1){let[t,r]=a<o?[a,o]:[o,a],i=n.slice(t,r+1);e.usageSelectedDays=[...new Set([...e.usageSelectedDays,...i])]}}else e.usageSelectedDays.includes(t)?e.usageSelectedDays=e.usageSelectedDays.filter(e=>e!==t):e.usageSelectedDays=[t]},onClearDays:()=>{e.usageSelectedDays=[]},onClearHours:()=>{e.usageSelectedHours=[]},onClearSessions:()=>{e.usageSelectedSessions=[],e.usageTimeSeries=null,e.usageSessionLogs=null},onClearFilters:()=>{e.usageSelectedDays=[],e.usageSelectedHours=[],e.usageSelectedSessions=[],e.usageTimeSeries=null,e.usageSessionLogs=null}},display:{onChartModeChange:t=>{e.usageChartMode=t},onDailyChartModeChange:t=>{e.usageDailyChartMode=t},onSessionSortChange:t=>{e.usageSessionSort=t},onSessionSortDirChange:t=>{e.usageSessionSortDir=t},onSessionsTabChange:t=>{e.usageSessionsTab=t},onToggleColumn:t=>{e.usageVisibleColumns.includes(t)?e.usageVisibleColumns=e.usageVisibleColumns.filter(e=>e!==t):e.usageVisibleColumns=[...e.usageVisibleColumns,t]}},details:{onToggleContextExpanded:()=>{e.usageContextExpanded=!e.usageContextExpanded},onToggleSessionLogsExpanded:()=>{e.usageSessionLogsExpanded=!e.usageSessionLogsExpanded},onLogFilterRolesChange:t=>{e.usageLogFilterRoles=t},onLogFilterToolsChange:t=>{e.usageLogFilterTools=t},onLogFilterHasToolsChange:t=>{e.usageLogFilterHasTools=t},onLogFilterQueryChange:t=>{e.usageLogFilterQuery=t},onLogFilterClear:()=>{e.usageLogFilterRoles=[],e.usageLogFilterTools=[],e.usageLogFilterHasTools=!1,e.usageLogFilterQuery=``},onSelectSession:(t,n)=>{if(e.usageTimeSeries=null,e.usageSessionLogs=null,e.usageRecentSessions=[t,...e.usageRecentSessions.filter(e=>e!==t)].slice(0,8),n&&e.usageSelectedSessions.length>0){var r;let n=e.usageChartMode===`tokens`,i=[...((r=e.usageResult)==null?void 0:r.sessions)??[]].toSorted((e,t)=>{var r,i,a,o;let s=n?((r=e.usage)==null?void 0:r.totalTokens)??0:((i=e.usage)==null?void 0:i.totalCost)??0;return(n?((a=t.usage)==null?void 0:a.totalTokens)??0:((o=t.usage)==null?void 0:o.totalCost)??0)-s}).map(e=>e.key),a=e.usageSelectedSessions[e.usageSelectedSessions.length-1],o=i.indexOf(a),s=i.indexOf(t);if(o!==-1&&s!==-1){let[t,n]=o<s?[o,s]:[s,o],r=i.slice(t,n+1);e.usageSelectedSessions=[...new Set([...e.usageSelectedSessions,...r])]}}else e.usageSelectedSessions.length===1&&e.usageSelectedSessions[0]===t?e.usageSelectedSessions=[]:e.usageSelectedSessions=[t];e.usageTimeSeriesCursorStart=null,e.usageTimeSeriesCursorEnd=null,e.usageSelectedSessions.length===1&&(gj(e,e.usageSelectedSessions[0]),_j(e,e.usageSelectedSessions[0]))},onTimeSeriesModeChange:t=>{e.usageTimeSeriesMode=t},onTimeSeriesBreakdownChange:t=>{e.usageTimeSeriesBreakdownMode=t},onTimeSeriesCursorRangeChange:(t,n)=>{e.usageTimeSeriesCursorStart=t,e.usageTimeSeriesCursorEnd=n}}}}):s}function I0(e){if(!e||typeof e!=`object`)return 0;let t=e.timestamp;return typeof t==`number`&&Number.isFinite(t)?t:0}function L0(e){if(!e||typeof e!=`object`)return!1;let t=e.role;return typeof t==`string`&&t.toLowerCase()===`user`}function R0(e){try{return new URL(e).hostname}catch{return e}}function z0(e){let t=new Map,n=(e,n,r)=>{if(!e)return;let i=t.get(e);if(!i){t.set(e,{url:e,title:n||R0(e),referencedAtMs:r});return}r>i.referencedAtMs&&(i.referencedAtMs=r),n&&(!i.title||i.title===R0(e))&&(i.title=n)};for(let t of e){if(!L0(t))continue;let e=I0(t);for(let r of QS(t))n(r.url,r.title,r.capturedAt||e);for(let r of XS(t))r.url&&n(r.url,r.title??``,e)}return[...t.values()].sort((e,t)=>t.referencedAtMs-e.referencedAtMs)}async function B0(e){if(!(!e.client||!e.connected||e.fileSpaceLoading)){e.fileSpaceLoading=!0,e.fileSpaceError=null;try{var t;let n=(((t=e.sessionsResult)==null?void 0:t.sessions)??[]).filter(e=>!e.spawnedBy&&!e.archived);e.fileSpaceData=(await Promise.all(n.map(async t=>{let n=Sg(t.key),r=t.sessionId,i=t.displayName??t.label??t.key,a=await e.client.request(`workspace.output.list`,{agentId:n,...r?{sessionId:r}:{}}).then(e=>{var t;return(e==null||(t=e.files)==null?void 0:t.filter(e=>!e.isDir))??[]}).catch(()=>[]),o=await e.client.request(`chat.attachments.list`,{sessionKey:t.key}).then(e=>(e==null?void 0:e.files)??[]).catch(()=>[]);return{sessionKey:t.key,sessionLabel:i,agentId:n,outputFiles:a,refFiles:o}}))).filter(e=>e.outputFiles.length>0||e.refFiles.length>0)}catch(t){e.fileSpaceError=String(t)}finally{e.fileSpaceLoading=!1}}}var V0=()=>p(`/api/sealclaw/client/sync`,{method:`POST`}),H0=(e,t)=>p(`/api/sealclaw/client/skills/${e}/download`,{method:`GET`,params:{token:t}}),U0=e=>p(`/api/sealclaw/share/${encodeURIComponent(e)}`,{method:`GET`}),W0=e=>p(`/api/sealclaw/share/${encodeURIComponent(e)}/claim`,{method:`POST`}),G0=e=>p(`/api/sealclaw/share/my`,{method:`GET`,params:e}),K0=e=>p(`/api/sealclaw/enterprise/skills`,{method:`GET`,params:e}),q0=e=>p(`/api/sealclaw/enterprise/skills/${e}/install`,{method:`POST`}),J0=()=>p(`/api/sealclaw/store/categories`),Y0=e=>p(`/api/sealclaw/store/skills`,{method:`GET`,params:e}).then(e=>e.data),X0=(e,t)=>p(`/api/sealclaw/store/skills/${e}/acquire`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),Z0=t({claimImportShare:()=>p2,closeImportDialog:()=>u2,closePublishDialog:()=>v2,closeShareDialog:()=>c2,confirmShareSkill:()=>s2,installEnterpriseSkillAction:()=>g2,loadEnterpriseSkills:()=>h2,loadMySharesForMatching:()=>a2,loadSkillCenterCategories:()=>e2,loadSkillCenterSkills:()=>t2,loadSyncVersionMap:()=>$0,nextPatchVersion:()=>i2,openImportDialog:()=>l2,openPublishDialog:()=>_2,openShareDialog:()=>o2,previewImportShare:()=>f2,publishSkillAction:()=>y2,uninstallSkillCenterItem:()=>r2,updateSyncSkill:()=>m2,useSkillCenterItem:()=>n2});function Q0(e){e==null||e()}async function $0(e,t){if(!e.syncVersionMapLoaded){e.syncVersionMapLoaded=!0;try{var n;let t=await V0(),r=(t==null||(n=t.data)==null?void 0:n.skills)??[],i=new Map,a=new Map;for(let e of r)e.name&&e.version&&i.set(e.name,e.version),e.skillId&&e.version&&a.set(e.skillId,e.version);e.syncVersionMap=i,e.syncVersionByIdMap=a}catch{e.syncVersionMapLoaded=!1}Q0(t)}}async function e2(e,t){if(!(e.skillCenterCategories||e.skillCenterCategoriesLoading)){e.skillCenterCategoriesLoading=!0,Q0(t);try{let t=await J0();e.skillCenterCategories=(t==null?void 0:t.data)??[]}catch{e.skillCenterCategories=[]}finally{e.skillCenterCategoriesLoading=!1,Q0(t)}}}async function t2(e,t){e.storeSkillsLoading=!0,e.storeSkills=null,Q0(t);try{let t=await Y0({page:1,size:100});e.storeSkills=(t==null?void 0:t.data)??[]}catch{e.storeSkills=[]}finally{e.storeSkillsLoading=!1,Q0(t)}}async function n2(e,t,n){e.skillCenterItemBusy=t.name,e.skillCenterItemError=null,Q0(n);try{var r,i;let o=await V0(),s=((o==null||(r=o.data)==null?void 0:r.skills)??[]).find(e=>e.skillId===t.id);if(!s){var a;await X0(t.id,{type:`FREE`});let e=await V0();s=e==null||(a=e.data)==null||(a=a.skills)==null?void 0:a.find(e=>e.skillId===t.id)}if(!s){let t=`获取技能授权失败`;return e.skillCenterItemError=t,Q0(n),{ok:!1,error:t}}let c=await H0(s.skillId,s.downloadToken),l=c==null||(i=c.data)==null?void 0:i.url;if(!l){let t=`获取下载链接失败`;return e.skillCenterItemError=t,Q0(n),{ok:!1,error:t}}return{ok:!0,url:l}}catch(t){let r=t instanceof Error?t.message:String(t);return e.skillCenterItemError=r,Q0(n),{ok:!1,error:r}}finally{e.skillCenterItemBusy=null,Q0(n)}}async function r2(e,t,n){if(e.client){e.skillCenterItemBusy=t,e.skillCenterItemError=null,Q0(n);try{await e.client.request(`skills.uninstall`,{name:t})}catch(t){e.skillCenterItemError=t instanceof Error?t.message:String(t)}finally{e.skillCenterItemBusy=null,Q0(n)}}}function i2(e){let t=e.split(`.`);if(t.length!==3)return`1.0.0`;let[n,r,i]=t.map(Number);return[n,r,i].some(e=>!Number.isFinite(e))?`1.0.0`:`${n}.${r}.${i+1}`}async function a2(e,t){if(!e.mySharesLoaded){try{var n;let t=await G0({page:1,size:200});e.mySharesForMatching=(t==null||(n=t.data)==null?void 0:n.data)??[]}catch{}e.mySharesLoaded=!0,Q0(t)}}async function o2(e,t,n){e.mySharesLoaded=!1,await a2(e,n);let r=e.mySharesForMatching.find(e=>e.skillName===t&&e.status===1);e.shareDialogSkill=t,e.shareDialogError=null,e.shareDialogResult=null,r?(e.shareDialogPhase=`view`,e.shareDialogExisting=r,e.shareDialogVersion=r.version?i2(r.version):`1.0.0`):(e.shareDialogPhase=`confirm`,e.shareDialogExisting=null,e.shareDialogVersion=`1.0.0`),Q0(n)}async function s2(e,t){if(!(!e.client||!e.shareDialogSkill)){e.shareDialogPhase=`loading`,e.shareDialogError=null,Q0(t);try{var n,r,i;let a=typeof localStorage<`u`?localStorage.getItem(`jwt`)??void 0:void 0,o=(n=e.skillsReport)==null||(n=n.skills)==null?void 0:n.find(t=>t.name===e.shareDialogSkill),s=(o==null||(r=o.storeExtra)==null?void 0:r.skillId)??((i=e.shareDialogExisting)==null?void 0:i.skillId),c=await e.client.request(`skills.share`,{name:e.shareDialogSkill,version:e.shareDialogVersion,title:e.shareDialogSkill,skillId:s,token:a,apiBase:`https://gateway.sealseek.cn/api/sealclaw`});if(c!=null&&c.shareUrl){e.shareDialogPhase=`success`,e.shareDialogResult={shareCode:c.shareCode,shareUrl:c.shareUrl};let n=e.shareDialogSkill;e.mySharesForMatching=[{shareCode:c.shareCode,skillName:n,skillTitle:n,skillId:0,version:e.shareDialogVersion,status:1,claimedCount:0},...e.mySharesForMatching.filter(e=>!(e.skillName===n&&e.status===1))],e.mySharesLoaded=!1,a2(e,t),e.enterpriseSkillsLoaded=!1,h2(e,void 0,t),e.syncVersionMapLoaded=!1,$0(e,t)}else e.shareDialogError=`分享失败:服务端未返回分享链接`,e.shareDialogPhase=e.shareDialogExisting?`view`:`confirm`}catch(t){e.shareDialogError=t instanceof Error?t.message:String(t),e.shareDialogPhase=e.shareDialogExisting?`view`:`confirm`}Q0(t)}}function c2(e,t){e.shareDialogSkill=null,e.shareDialogResult=null,e.shareDialogError=null,e.shareDialogExisting=null,Q0(t)}function l2(e,t){e.importDialogOpen=!0,e.importShareCode=``,e.importPreview=null,e.importPreviewLoading=!1,e.importClaimLoading=!1,e.importClaimResult=null,e.importError=null,Q0(t)}function u2(e,t){e.importDialogOpen=!1,Q0(t)}function d2(e){var t;let n=(e??``).trim();return n?n.includes(`/s/`)?((t=n.split(`/s/`).pop())==null?void 0:t.trim())??``:n:``}async function f2(e,t,n){let r=d2(t);if(!r){e.importError=`请先输入分享码或链接`,Q0(n);return}e.importShareCode=r,e.importPreviewLoading=!0,e.importPreview=null,e.importClaimResult=null,e.importError=null,Q0(n);try{let t=await U0(r);e.importPreview=(t==null?void 0:t.data)??null}catch(t){e.importError=t instanceof Error?t.message:String(t)}finally{e.importPreviewLoading=!1,Q0(n)}}async function p2(e,t){if(!e.importShareCode)return{ok:!1};e.importClaimLoading=!0,e.importClaimResult=null,e.importError=null,Q0(t);try{var n,r,i,a;await W0(e.importShareCode);let t=((n=await V0())==null||(n=n.data)==null?void 0:n.skills)??[],o=(r=e.importPreview)==null?void 0:r.skillId,s=o==null?t.at(-1):t.find(e=>e.skillId===o);if(!s)return e.importClaimResult=`领取成功!技能正在同步,请稍后在技能中心刷新。`,{ok:!1};let c=(i=await H0(s.skillId,s.downloadToken))==null||(i=i.data)==null?void 0:i.url;return c?{ok:!0,url:c,name:s.name,version:s.version,authorUuid:(a=e.importPreview)==null?void 0:a.authorUuid,skillId:s.skillId}:(e.importError=`获取下载链接失败`,{ok:!1})}catch(t){return e.importError=t instanceof Error?t.message:String(t),{ok:!1}}finally{e.importClaimLoading=!1,Q0(t)}}async function m2(e,t,n){if(e.client){e.skillCenterItemBusy=t,Q0(n);try{var r,i,a;let n=(r=e.skillsReport)==null||(r=r.skills)==null?void 0:r.find(e=>e.name===t),o=(n==null?void 0:n.storeExtra)??{},s=o.skillId,c=await V0(),l=(c==null||(i=c.data)==null?void 0:i.skills)??[],u=s?l.find(e=>e.skillId===s):l.find(e=>e.name===t);if(!u){e.skillCenterItemError=`未找到该技能的服务端记录`;return}let d=await H0(u.skillId,u.downloadToken),f=d==null||(a=d.data)==null?void 0:a.url;if(!f){e.skillCenterItemError=`获取下载链接失败`;return}await e.client.request(`skills.install`,{source:`url`,url:f,name:u.name,force:!0,storeExtra:{...o,currentVersion:u.version,skillId:u.skillId}})}catch(t){e.skillCenterItemError=t instanceof Error?t.message:String(t)}finally{e.skillCenterItemBusy=null,Q0(n)}}}async function h2(e,t,n){if(!(e.enterpriseSkillsLoaded&&t===void 0)){e.enterpriseSkillsLoading=!0,Q0(n);try{var r;let n=await K0({keyword:t,page:1,size:50});e.enterpriseSkills=(n==null||(r=n.data)==null?void 0:r.data)??[]}catch{}e.enterpriseSkillsLoaded=!0,e.enterpriseSkillsLoading=!1,Q0(n)}}async function g2(e,t,n){let r=e.enterpriseSkills.find(e=>e.skillId===t);if(r){var i,a;let t=(i=e.skillsReport)==null||(i=i.skills)==null?void 0:i.find(e=>e.name===r.name),o=t==null||(a=t.storeExtra)==null?void 0:a.source;if(t&&o&&o!==`enterprise`){e.enterpriseError=`本地已有同名技能「${r.name}」(来源:${o===`share`?`分享`:`商店`}),请先卸载后再安装`,Q0(n);return}}e.enterpriseInstallLoading=t,e.enterpriseError=null,Q0(n);try{var o;await q0(t);let n=await V0(),i=((n==null||(o=n.data)==null?void 0:o.skills)??[]).find(e=>e.skillId===t);if(i&&e.client){var s;let n=await H0(i.skillId,i.downloadToken),a=n==null||(s=n.data)==null?void 0:s.url;if(a){await e.client.request(`skills.install`,{source:`url`,url:a,name:i.name,force:!0,storeExtra:{currentVersion:i.version,source:`enterprise`,authorUuid:r==null?void 0:r.authorUuid,skillId:t}});let n=e.enterpriseSkills.find(e=>e.skillId===t);n&&(n.owned=!0)}}}catch(t){e.enterpriseError=t instanceof Error?t.message:String(t)}finally{e.enterpriseInstallLoading=null,Q0(n)}}function _2(e,t,n){let r=e.enterpriseSkills.find(e=>e.name===t);e.publishDialogOpen=!0,e.publishingSkill=t,e.publishTarget=r?`enterprise`:null,e.publishLoading=!1,e.publishError=null,e.publishSuccess=null,Q0(n)}function v2(e,t){e.publishDialogOpen=!1,e.publishingSkill=null,e.publishTarget=null,e.publishLoading=!1,e.publishError=null,e.publishSuccess=null,Q0(t)}async function y2(e,t){if(!(!e.client||!e.publishingSkill||!e.publishTarget)){e.publishLoading=!0,e.publishError=null,e.publishSuccess=null,Q0(t);try{let i=typeof localStorage<`u`?localStorage.getItem(`jwt`)??void 0:void 0;if(e.publishTarget===`enterprise`){var n,r;let a=(n=e.skillsReport)==null||(n=n.skills)==null?void 0:n.find(t=>t.name===e.publishingSkill),o=a==null||(r=a.storeExtra)==null?void 0:r.skillId,s=o?e.enterpriseSkills.find(e=>e.skillId===o):e.enterpriseSkills.find(t=>t.name===e.publishingSkill),c=(s==null?void 0:s.latestVersion)??(s==null?void 0:s.version);await e.client.request(`skills.publishEnterprise`,{name:e.publishingSkill,skillId:s==null?void 0:s.skillId,version:c?i2(c):void 0,token:i,apiBase:`https://gateway.sealseek.cn/api/sealclaw`}),e.publishSuccess=`发布成功,企业成员可在企业技能中安装。`,e.enterpriseSkillsLoaded=!1,h2(e,void 0,t),e.syncVersionMapLoaded=!1,$0(e,t),e.mySharesLoaded=!1,a2(e,t)}else e.publishError=`公开商店发布暂未开放`}catch(t){e.publishError=t instanceof Error?t.message:String(t)}finally{e.publishLoading=!1,Q0(t)}}}function b2(e){e==null||e()}async function x2(e,t){let n=e.storeSkills!==null&&e.storeSkills!==void 0;e.skillStoreOpen=!0,n||(e.storeSkillsLoading=!0),b2(t);try{let t=await Y0({page:1,size:50});e.storeSkills=(t==null?void 0:t.data)??[]}catch{e.storeSkills||(e.storeSkills=[])}finally{e.storeSkillsLoading=!1,b2(t)}}function S2(e,t){e.skillStoreOpen=!1,e.storeItemError=null,b2(t)}async function C2(e,t,n){e.storeItemLoading=t.name,e.storeItemError=null,b2(n);try{var r,i;let o=await V0(),s=((o==null||(r=o.data)==null?void 0:r.skills)??[]).find(e=>e.skillId===t.id);if(!s){var a;await X0(t.id,{type:`FREE`});let e=await V0();s=e==null||(a=e.data)==null||(a=a.skills)==null?void 0:a.find(e=>e.skillId===t.id)}if(!s){let t=`获取技能授权失败`;return e.storeItemError=t,b2(n),{ok:!1,error:t}}let c=await H0(s.skillId,s.downloadToken),l=c==null||(i=c.data)==null?void 0:i.url;if(!l){let t=`获取下载链接失败`;return e.storeItemError=t,b2(n),{ok:!1,error:t}}return{ok:!0,url:l}}catch(t){let r=t instanceof Error?t.message:String(t);return e.storeItemError=r,b2(n),{ok:!1,error:r}}finally{e.storeItemLoading=null,b2(n)}}var w2=`(function () {
|
|
5471
5471
|
if (window.__sealclawAnnotateActive) return true;
|
|
5472
5472
|
window.__sealclawAnnotateActive = true;
|
|
5473
5473
|
window.__sealclawAnnotatePicks = window.__sealclawAnnotatePicks || [];
|
|
@@ -6261,7 +6261,7 @@ html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
|
|
|
6261
6261
|
text-align: center;
|
|
6262
6262
|
}
|
|
6263
6263
|
.sheet-preview-status--error { color: #d1242f; }
|
|
6264
|
-
`,Q4=50,$4=940,e3=.85,t3=null;function n3(){return t3||(t3=(async()=>{let e=globalThis;return e.pdfjsWorker||(e.pdfjsWorker={WorkerMessageHandler:(await m4(()=>import(`./pdf.worker-
|
|
6264
|
+
`,Q4=50,$4=940,e3=.85,t3=null;function n3(){return t3||(t3=(async()=>{let e=globalThis;return e.pdfjsWorker||(e.pdfjsWorker={WorkerMessageHandler:(await m4(()=>import(`./pdf.worker-BbbExAx6.js`),__vite__mapDeps([4,5]))).WorkerMessageHandler}),m4(()=>import(`./pdf-DyX3XLCf.js`),__vite__mapDeps([6,5]))})().catch(e=>{throw t3=null,e})),t3}function r3(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}async function i3(e){let t=await(await n3()).getDocument({data:r3(e)}).promise;try{let e=t.numPages,n=Math.min(e,Q4),r=[];for(let e=1;e<=n;e++){let n=await t.getPage(e);r.push(await a3(n))}return{dataUrls:r,totalPages:e,truncated:e>n}}finally{t.destroy().catch(()=>{})}}async function a3(e){let t=$4/e.getViewport({scale:1}).width,n=e.getViewport({scale:t}),r=document.createElement(`canvas`);r.width=Math.max(1,Math.floor(n.width)),r.height=Math.max(1,Math.floor(n.height));let i=r.getContext(`2d`);if(!i)throw Error(`无法创建 canvas 2d 上下文`);return i.fillStyle=`#ffffff`,i.fillRect(0,0,r.width,r.height),await e.render({canvas:r,canvasContext:i,viewport:n}).promise,r.toDataURL(`image/jpeg`,e3)}function o3(e){if(/^file:/i.test(e))try{let t=new URL(e).pathname.split(`/`).filter(Boolean).pop()??``;if(t)return decodeURIComponent(t)}catch{}return e||`PDF 预览`}function s3(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function c3(e,t,n={}){let r=s3(o3(t)),i=e.map((e,t)=>`<img class="pdf-page" alt="第 ${t+1} 页" src="${e}">`).join(`
|
|
6265
6265
|
`);return`<!DOCTYPE html>
|
|
6266
6266
|
<html lang="zh-CN">
|
|
6267
6267
|
<head>
|
|
@@ -10320,7 +10320,7 @@ body {
|
|
|
10320
10320
|
</div>
|
|
10321
10321
|
`:s}
|
|
10322
10322
|
</div>
|
|
10323
|
-
`}var y7=!1;window.toggleProModeSwitch=()=>{var e;y7=!y7;let t=document.querySelector(`openclaw-app`);t==null||(e=t.requestUpdate)==null||e.call(t)};function b7(){let e=typeof localStorage<`u`?localStorage.getItem(`jwt`):null;if(!e)return null;try{let t=e.split(`.`);if(t.length<2)return null;let n=t[1].replace(/-/g,`+`).replace(/_/g,`/`);for(;n.length%4;)n+=`=`;return JSON.parse(atob(n)).companyUuid||null}catch{return null}}function Woe(){let e=typeof localStorage<`u`?localStorage.getItem(`jwt`):null;if(!e)return null;try{let t=e.split(`.`);if(t.length<2)return null;let n=t[1].replace(/-/g,`+`).replace(/_/g,`/`);for(;n.length%4;)n+=`=`;return JSON.parse(atob(n)).userUuid||null}catch{return null}}var Goe=r4(()=>m4(()=>import(`./agents-BY4aXME8.js`),__vite__mapDeps([7,8,9,10,11,12])),m7),Koe=r4(()=>m4(()=>import(`./channels-D-QByuhk.js`),__vite__mapDeps([13,9,11])),m7),qoe=r4(()=>m4(()=>import(`./cron-BgVlNDdc.js`),__vite__mapDeps([14,9])),m7),Joe=r4(()=>m4(()=>import(`./cron-task-list-D2nXZpo2.js`),__vite__mapDeps([15,9])),m7),Yoe=r4(()=>m4(()=>import(`./debug-CuGSEgIy.js`),__vite__mapDeps([16,9])),m7),Xoe=r4(()=>m4(()=>import(`./instances-uGReSAlG.js`),__vite__mapDeps([17,9])),m7),Zoe=r4(()=>m4(()=>import(`./logs-BQrW9h4P.js`),__vite__mapDeps([18,8,9])),m7),Qoe=r4(()=>m4(()=>import(`./nodes-DmSj9fyO.js`),__vite__mapDeps([19,8,9])),m7),$oe=r4(()=>m4(()=>import(`./sessions-ltqOEThv.js`),__vite__mapDeps([20,8,9])),m7),ese=r4(()=>m4(()=>import(`./skills-CPiV0PPn.js`),__vite__mapDeps([21,8,9,12])),m7),tse=r4(()=>m4(()=>import(`./skill-center-T5345ywM.js`),__vite__mapDeps([22,9,23])),m7),x7=r4(()=>m4(()=>import(`./plugins-DlhMPMhL.js`),__vite__mapDeps([24,9])),m7),nse=r4(()=>m4(()=>import(`./filespace-DicgLi9K.js`),__vite__mapDeps([25,9])),m7),rse=r4(()=>m4(()=>import(`./workspace-browser-B3o_ElYg.js`),__vite__mapDeps([26,9])),m7);function ise(e,t){let n=Object.entries(e),r=Object.entries(t);return n.length===r.length&&n.every(([e,n])=>t[e]===n)}function ase(e){return typeof e!=`number`||!Number.isFinite(e)?null:new Date(e).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function ose(e){if(!(e!=null&&e.phases))return null;let t;for(let n of Object.values(e.phases))!n.enabled||typeof n.nextRunAtMs!=`number`||(t===void 0||n.nextRunAtMs<t)&&(t=n.nextRunAtMs);return ase(t)}var S7=`openclaw:control-ui:update-banner-dismissed:v1`,sse=[`off`,`minimal`,`low`,`medium`,`high`],cse=[`UTC`,`America/Los_Angeles`,`America/Denver`,`America/Chicago`,`America/New_York`,`Europe/London`,`Europe/Berlin`,`Asia/Tokyo`];function lse(e){return/^https?:\/\//i.test(e.trim())}function C7(e){return typeof e==`string`?e.trim():``}function w7(e){let t=new Set,n=[];for(let r of e){let e=r.trim();if(!e)continue;let i=e.toLowerCase();t.has(i)||(t.add(i),n.push(e))}return n}function use(){try{var e;let t=(e=v())==null?void 0:e.getItem(S7);if(!t)return null;let n=JSON.parse(t);return!n||typeof n.latestVersion!=`string`?null:{latestVersion:n.latestVersion,channel:typeof n.channel==`string`?n.channel:null,dismissedAtMs:typeof n.dismissedAtMs==`number`?n.dismissedAtMs:Date.now()}}catch{return null}}function dse(e){let t=use();if(!t)return!1;let n=e,r=n&&typeof n.latestVersion==`string`?n.latestVersion:null,i=n&&typeof n.channel==`string`?n.channel:null;return!!(r&&t.latestVersion===r&&t.channel===i)}function fse(e){let t=e,n=t&&typeof t.latestVersion==`string`?t.latestVersion:null;if(!n)return;let r={latestVersion:n,channel:t&&typeof t.channel==`string`?t.channel:null,dismissedAtMs:Date.now()};try{var i;(i=v())==null||i.setItem(S7,JSON.stringify(r))}catch{}}var T7=[`channels`,`messages`,`broadcast`,`__notifications__`,`talk`,`audio`],E7=[`__appearance__`,`ui`,`wizard`],D7=[`commands`,`hooks`,`bindings`,`cron`,`approvals`],O7=[`gateway`,`web`,`nodeHost`,`canvasHost`,`discovery`,`media`,`acp`,`mcp`],k7=[`agents`,`models`,`skills`,`tools`,`memory`,`session`],pse=new Set([...T7,...E7,...D7,...O7,...k7]);function mse(e,t){return e&&pse.has(e)?{activeSection:null,activeSubsection:null}:{activeSection:e,activeSubsection:t}}function A7(e,t,n){return e&&!n.includes(e)?{activeSection:null,activeSubsection:null}:{activeSection:e,activeSubsection:t}}function hse(e){var t,n;let r=((t=e.agentsList)==null?void 0:t.agents)??[],i=vg(e.sessionKey),a=(i==null?void 0:i.agentId)??((n=e.agentsList)==null?void 0:n.defaultId)??`main`,o=r.find(e=>e.id===a),s=o==null?void 0:o.identity,c=(s==null?void 0:s.avatarUrl)??(s==null?void 0:s.avatar);if(c&&uE(c))return c}function gse(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.ui;if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t.assistant;return!n||typeof n!=`object`||Array.isArray(n)?null:h(n.avatar)??null}function _se(e,t){let n=OS(e??``),r=encodeURIComponent(t);return n?`${n}/avatar/${r}`:`/avatar/${r}`}var j7=[{id:`telegram`,label:`Telegram`},{id:`discord`,label:`Discord`},{id:`slack`,label:`Slack`},{id:`whatsapp`,label:`WhatsApp`},{id:`signal`,label:`Signal`},{id:`imessage`,label:`iMessage`}];function vse(e){let t=e.trim();return t?t.split(/[-_]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `):`Unknown`}function yse(e){var t;let n=e.configForm??((t=e.configSnapshot)==null?void 0:t.config);if(!n||typeof n!=`object`)return[];let r=`channels`in n&&n.channels&&typeof n.channels==`object`?n.channels:{},i=Object.keys(r).filter(e=>e.trim().length>0),a=i.length>0?i.toSorted((e,t)=>e.localeCompare(t)):j7.map(({id:e})=>e),o=new Map(j7.map(({id:e,label:t})=>[e,t])),s=[];for(let e of a){let t=r[e],n=typeof t==`object`&&!!t&&Object.keys(t).length>0;s.push({id:e,label:o.get(e)??vse(e),connected:n,detail:n?`Configured`:void 0})}return s}function bse(e){var t;let n=e.configForm??((t=e.configSnapshot)==null?void 0:t.config);if(!n||typeof n!=`object`)return 0;let r=n.mcp;if(!r||typeof r!=`object`)return 0;let i=`servers`in r&&r.servers&&typeof r.servers==`object`?r.servers:{};return Object.keys(i).length}function xse(e){var t;let n=e.configForm??((t=e.configSnapshot)==null?void 0:t.config);if(!n||typeof n!=`object`)return{gatewayAuth:`unknown`,execPolicy:`unknown`,deviceAuth:!1};let r=n,i=`gateway`in r&&r.gateway&&typeof r.gateway==`object`?r.gateway:null,a=i&&`auth`in i&&i.auth&&typeof i.auth==`object`?i.auth:null,o=`unknown`;a&&(o=(typeof a.mode==`string`?a.mode.trim():``)||(a.password?`password`:a.token?`token`:a.trustedProxy?`trusted-proxy`:`none`));let s=r.agents,c=`allowlist`;if(s&&typeof s==`object`){let e=s.defaults;if(e&&typeof e==`object`){let t=e.exec;if(t&&typeof t==`object`){let e=t.security;typeof e==`string`&&(c=e)}}}let l=!0;if(i){let e=`controlUi`in i&&i.controlUi&&typeof i.controlUi==`object`?i.controlUi:null;(e==null?void 0:e.dangerouslyDisableDeviceAuth)===!0&&(l=!1)}return{gatewayAuth:o,execPolicy:c,deviceAuth:l}}function Sse(e){var t;return(t=e.sessionsResult)==null||(t=t.sessions)==null?void 0:t.find(t=>t.key===e.sessionKey)}function Cse(e,t){return Iie({open:e.cronQuickCreateOpen,step:e.cronQuickCreateStep,draft:e.cronQuickCreateDraft??d8(),onDraftChange:n=>{e.cronQuickCreateDraft={...e.cronQuickCreateDraft??d8(),...n},t==null||t()},onStepChange:n=>{e.cronQuickCreateStep=n,t==null||t()},onCreate:()=>{let n=Aie(e.cronQuickCreateDraft??d8());e.cronEditingJobId=null,e.cronForm={...FD,...n},t==null||t(),(async()=>{if(await Tk(e),e.cronError||nk(e.cronFieldErrors)){t==null||t();return}e.cronQuickCreateOpen=!1,e.cronQuickCreateStep=`what`,e.cronQuickCreateDraft=null,t==null||t()})()},onCancel:()=>{e.cronQuickCreateOpen=!1,e.cronQuickCreateStep=`what`,e.cronQuickCreateDraft=null,t==null||t()}})}function M7(e){var t,n,r;return{storeSkills:e.storeSkills,storeSkillsLoading:e.storeSkillsLoading,storeItemLoading:e.storeItemLoading,installedSkillNames:new Set(((t=e.skillsReport)==null||(t=t.skills)==null?void 0:t.filter(e=>e.extra!==void 0).map(e=>e.name))??[]),customInstalledSkills:((n=e.skillsReport)==null||(n=n.skills)==null?void 0:n.filter(e=>e.extra===void 0&&(e.source===`openclaw-workspace`||e.source===`openclaw-extra`)))??[],storeSkillLabels:new Map((((r=e.skillsReport)==null?void 0:r.skills)??[]).filter(e=>e.storeExtra).map(e=>{var t;return[e.name.toLowerCase().replace(/-/g,`_`),((t=e.storeExtra)==null?void 0:t.title)??e.name]})),recommendedSkills:[]}}function wse(e,t){var n;let r=(((n=e.sessionsResult)==null?void 0:n.sessions)??[]).filter(e=>!gv(e.key)).map(e=>({key:e.key,label:e.label??e.displayName??e.subject??``}));return Jie({open:e.cronTaskDialogOpen,mode:e.cronTaskDialogMode,form:e.cronForm,fieldErrors:e.cronFieldErrors,error:e.cronError,busy:e.cronBusy,canSubmit:!nk(e.cronFieldErrors),sessions:r,sessionQuery:e.cronTaskSessionQuery,onSessionQueryChange:n=>{e.cronTaskSessionQuery=n,t==null||t()},onFormChange:n=>{e.cronForm=ek({...e.cronForm,...n});let r=tk(e.cronForm),i=new Set([...Object.keys(e.cronFieldErrors),...Object.keys(n)]);e.cronFieldErrors=Object.fromEntries(Object.entries(r).filter(([e])=>i.has(e))),t==null||t()},onSubmit:()=>{(async()=>{if(!await Ck(e)){t==null||t();return}await Tk(e)&&(e.cronTaskDialogOpen=!1,e.skillDropdownOpen=!1),t==null||t()})()},onCancel:()=>{e.cronTaskDialogOpen=!1,e.skillDropdownOpen=!1,Fk(e),e.cronError=null,t==null||t()},onOpenAdvanced:()=>{e.cronTaskDialogOpen=!1,e.cronFormCollapsed=!1,e.setTab(`cron`),t==null||t()},proMode:e.settings.proMode,skills:M7(e),skillDropdownOpen:e.skillDropdownOpen,onToggleSkillDropdown:n=>{e.skillDropdownOpen=n,n&&(!e.skillsReport&&!e.skillsLoading&&KA(e,{}),!e.storeSkills&&!e.storeSkillsLoading&&t2(e,t??(()=>{}))),t==null||t()},onNavigateToSkillCenter:()=>{e.cronTaskDialogOpen=!1,e.skillDropdownOpen=!1,e.setTab(`skillcenter`),t==null||t()},onInstallAndUseSkill:async n=>{let r=await C2(e,n,t);if(!r.ok||!r.url||!e.client)return!1;e.storeItemLoading=n.name,t==null||t();try{await e.client.request(`skills.install`,{source:`url`,url:r.url,name:n.name,storeExtra:n,force:!0}),await KA(e,{});let t=e.cronForm.payloadText,i=t.startsWith(`/`)?t.slice(t.search(/\s/u)+1||t.length).trimStart():t;return e.cronForm=ek({...e.cronForm,payloadText:`/${n.name} ${i}`,payloadKind:`agentTurn`}),!0}catch{return!1}finally{e.storeItemLoading=null,t==null||t()}}})}function Tse(e,t,n){let r=[...t].sort((e,t)=>e.createdAtMs-t.createdAtMs);return{basePath:e.basePath??``,view:e.cronTasksView,loading:e.cronLoading,loaded:e.cronJobsLoaded,error:e.cronError,busy:e.cronBusy,jobs:r,jobsTotal:e.cronJobsTotal,jobsHasMore:e.cronJobsHasMore,jobsLoadingMore:e.cronJobsLoadingMore,openMenuJobId:e.cronTaskMenuJobId,runs:e.cronRuns,runsLoadingMore:e.cronRunsLoadingMore,runsHasMore:e.cronRunsHasMore,historyJobFilter:e.cronTaskHistoryJobFilter,historyDateFilter:e.cronTaskHistoryDateFilter,skills:M7(e),onViewChange:t=>{e.cronTasksView=t,t===`history`&&(jk(e,{cronRunsScope:`all`}),kk(e,null)),n==null||n()},onRefresh:()=>e.loadCron(),onNew:()=>{fk(e),n==null||n()},onToggle:(t,n)=>Ek(e,t,n),onRun:t=>Dk(e,t,`force`),onEdit:t=>{Mk(e,t),e.cronTaskSessionQuery=``,e.cronTaskDialogMode=`edit`,e.cronTaskDialogOpen=!0,n==null||n()},onAdvanced:t=>{Mk(e,t),e.cronFormCollapsed=!1,e.setTab(`cron`)},onViewHistory:t=>{e.cronTasksView=`history`,e.cronTaskHistoryJobFilter=t.id,jk(e,{cronRunsScope:`job`}),kk(e,t.id)},onGoToSession:t=>{var r;let i=((r=t.resultSessionKey)==null?void 0:r.trim())||t.sessionKey;i&&(async()=>{if(!await wk(e,i)){n==null||n();return}jQ(e,i),e.setTab(`chat`)})()},onRemove:t=>Ok(e,t),deleteConfirmJobId:e.cronTaskDeleteConfirmJobId,onRequestRemove:t=>{e.cronTaskDeleteConfirmJobId=t.id,n==null||n()},onCancelRemove:()=>{e.cronTaskDeleteConfirmJobId=null,n==null||n()},onOpenMenu:t=>{e.cronTaskMenuJobId=t,n==null||n(),t&&document.addEventListener(`click`,()=>{e.cronTaskMenuJobId!==null&&(e.cronTaskMenuJobId=null,n==null||n())},{once:!0})},onLoadMoreJobs:()=>sk(e,{append:!0}),onLoadMoreRuns:()=>Ak(e),onHistoryJobFilterChange:t=>{e.cronTaskHistoryJobFilter=t,t?(jk(e,{cronRunsScope:`job`}),kk(e,t)):(jk(e,{cronRunsScope:`all`}),kk(e,null))},onHistoryDateFilterChange:t=>{e.cronTaskHistoryDateFilter=t,n==null||n()},onNavigateToChat:(t,r)=>{(async()=>{if(!await wk(e,t)){n==null||n();return}jQ(e,t),e.setTab(`chat`),e.pendingChatScrollMessageId=(r==null?void 0:r.trim())||null})()},proMode:e.settings.proMode}}function N7(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function P7(e){let t=e.lastIndexOf(`.`),n=t>=0?e.slice(t+1).toLowerCase():``;return[`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`,`ico`,`bmp`].includes(n)?{iconClass:`file-tree-panel__item-icon--image`,icon:J.image,ext:n}:[`ts`,`tsx`,`js`,`jsx`,`py`,`rs`,`go`,`sh`,`json`,`yaml`,`yml`,`toml`].includes(n)?{iconClass:`file-tree-panel__item-icon--code`,icon:J.fileCode,ext:n}:[`md`,`txt`,`pdf`,`docx`,`csv`].includes(n)?{iconClass:`file-tree-panel__item-icon--doc`,icon:J.fileText,ext:n}:{iconClass:`file-tree-panel__item-icon--default`,icon:J.fileText,ext:n}}function Ese(e){var t;let n=new Map;for(let r of((t=e.sessionsResult)==null?void 0:t.sessions)??[])r.sessionId&&n.set(r.sessionId,r.displayName??r.label??r.key);return n}async function F7(e,t,n,r){let i=window.sealclawElectron;if(t===`workspace.output.open`&&typeof(i==null?void 0:i.openLocalPath)==`function`){try{let e=await i.openLocalPath(n.filePath);e&&typeof e==`object`&&e.ok===!1&&Y.error(r,{description:e.error||`请重试`})}catch(e){Y.error(r,{description:e instanceof Error?e.message:String(e)})}return}if(t===`workspace.output.reveal`&&typeof(i==null?void 0:i.showItemInFolder)==`function`){try{await i.showItemInFolder(n.filePath)}catch(e){Y.error(r,{description:e instanceof Error?e.message:String(e)})}return}try{var a;let i=await((a=e.client)==null?void 0:a.request(t,n));i&&!i.ok&&Y.error(r,{description:i.error||`请重试`})}catch(e){Y.error(r,{description:e instanceof Error?e.message:String(e)})}}function I7(e,t,n,i,a,o){let c=a*16;return i.map(i=>{if(i.isDir){let l=e.fileTreeExpandedDirs.includes(i.path),u=e.fileTreeDirLoading.includes(i.path),d=e.fileTreeDirChildren[i.path];return r`
|
|
10323
|
+
`}var y7=!1;window.toggleProModeSwitch=()=>{var e;y7=!y7;let t=document.querySelector(`openclaw-app`);t==null||(e=t.requestUpdate)==null||e.call(t)};function b7(){let e=typeof localStorage<`u`?localStorage.getItem(`jwt`):null;if(!e)return null;try{let t=e.split(`.`);if(t.length<2)return null;let n=t[1].replace(/-/g,`+`).replace(/_/g,`/`);for(;n.length%4;)n+=`=`;return JSON.parse(atob(n)).companyUuid||null}catch{return null}}function Woe(){let e=typeof localStorage<`u`?localStorage.getItem(`jwt`):null;if(!e)return null;try{let t=e.split(`.`);if(t.length<2)return null;let n=t[1].replace(/-/g,`+`).replace(/_/g,`/`);for(;n.length%4;)n+=`=`;return JSON.parse(atob(n)).userUuid||null}catch{return null}}var Goe=r4(()=>m4(()=>import(`./agents-B3eGrySi.js`),__vite__mapDeps([7,8,9,10,11,12])),m7),Koe=r4(()=>m4(()=>import(`./channels-CuNr3x8S.js`),__vite__mapDeps([13,9,11])),m7),qoe=r4(()=>m4(()=>import(`./cron-CS9cgBJT.js`),__vite__mapDeps([14,9])),m7),Joe=r4(()=>m4(()=>import(`./cron-task-list-CU6ybcB9.js`),__vite__mapDeps([15,9])),m7),Yoe=r4(()=>m4(()=>import(`./debug-DR6YkUV-.js`),__vite__mapDeps([16,9])),m7),Xoe=r4(()=>m4(()=>import(`./instances-BXXkA07m.js`),__vite__mapDeps([17,9])),m7),Zoe=r4(()=>m4(()=>import(`./logs-BQrW9h4P.js`),__vite__mapDeps([18,8,9])),m7),Qoe=r4(()=>m4(()=>import(`./nodes-CJ48zMNM.js`),__vite__mapDeps([19,8,9])),m7),$oe=r4(()=>m4(()=>import(`./sessions-C0-Brdmh.js`),__vite__mapDeps([20,8,9])),m7),ese=r4(()=>m4(()=>import(`./skills-DBun6Ded.js`),__vite__mapDeps([21,8,9,12])),m7),tse=r4(()=>m4(()=>import(`./skill-center-B0-YuHLe.js`),__vite__mapDeps([22,9,23])),m7),x7=r4(()=>m4(()=>import(`./plugins-B5NdnLkj.js`),__vite__mapDeps([24,9])),m7),nse=r4(()=>m4(()=>import(`./filespace-jYEFvxIi.js`),__vite__mapDeps([25,9])),m7),rse=r4(()=>m4(()=>import(`./workspace-browser-oC_m4pwR.js`),__vite__mapDeps([26,9])),m7);function ise(e,t){let n=Object.entries(e),r=Object.entries(t);return n.length===r.length&&n.every(([e,n])=>t[e]===n)}function ase(e){return typeof e!=`number`||!Number.isFinite(e)?null:new Date(e).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function ose(e){if(!(e!=null&&e.phases))return null;let t;for(let n of Object.values(e.phases))!n.enabled||typeof n.nextRunAtMs!=`number`||(t===void 0||n.nextRunAtMs<t)&&(t=n.nextRunAtMs);return ase(t)}var S7=`openclaw:control-ui:update-banner-dismissed:v1`,sse=[`off`,`minimal`,`low`,`medium`,`high`],cse=[`UTC`,`America/Los_Angeles`,`America/Denver`,`America/Chicago`,`America/New_York`,`Europe/London`,`Europe/Berlin`,`Asia/Tokyo`];function lse(e){return/^https?:\/\//i.test(e.trim())}function C7(e){return typeof e==`string`?e.trim():``}function w7(e){let t=new Set,n=[];for(let r of e){let e=r.trim();if(!e)continue;let i=e.toLowerCase();t.has(i)||(t.add(i),n.push(e))}return n}function use(){try{var e;let t=(e=v())==null?void 0:e.getItem(S7);if(!t)return null;let n=JSON.parse(t);return!n||typeof n.latestVersion!=`string`?null:{latestVersion:n.latestVersion,channel:typeof n.channel==`string`?n.channel:null,dismissedAtMs:typeof n.dismissedAtMs==`number`?n.dismissedAtMs:Date.now()}}catch{return null}}function dse(e){let t=use();if(!t)return!1;let n=e,r=n&&typeof n.latestVersion==`string`?n.latestVersion:null,i=n&&typeof n.channel==`string`?n.channel:null;return!!(r&&t.latestVersion===r&&t.channel===i)}function fse(e){let t=e,n=t&&typeof t.latestVersion==`string`?t.latestVersion:null;if(!n)return;let r={latestVersion:n,channel:t&&typeof t.channel==`string`?t.channel:null,dismissedAtMs:Date.now()};try{var i;(i=v())==null||i.setItem(S7,JSON.stringify(r))}catch{}}var T7=[`channels`,`messages`,`broadcast`,`__notifications__`,`talk`,`audio`],E7=[`__appearance__`,`ui`,`wizard`],D7=[`commands`,`hooks`,`bindings`,`cron`,`approvals`],O7=[`gateway`,`web`,`nodeHost`,`canvasHost`,`discovery`,`media`,`acp`,`mcp`],k7=[`agents`,`models`,`skills`,`tools`,`memory`,`session`],pse=new Set([...T7,...E7,...D7,...O7,...k7]);function mse(e,t){return e&&pse.has(e)?{activeSection:null,activeSubsection:null}:{activeSection:e,activeSubsection:t}}function A7(e,t,n){return e&&!n.includes(e)?{activeSection:null,activeSubsection:null}:{activeSection:e,activeSubsection:t}}function hse(e){var t,n;let r=((t=e.agentsList)==null?void 0:t.agents)??[],i=vg(e.sessionKey),a=(i==null?void 0:i.agentId)??((n=e.agentsList)==null?void 0:n.defaultId)??`main`,o=r.find(e=>e.id===a),s=o==null?void 0:o.identity,c=(s==null?void 0:s.avatarUrl)??(s==null?void 0:s.avatar);if(c&&uE(c))return c}function gse(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.ui;if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t.assistant;return!n||typeof n!=`object`||Array.isArray(n)?null:h(n.avatar)??null}function _se(e,t){let n=OS(e??``),r=encodeURIComponent(t);return n?`${n}/avatar/${r}`:`/avatar/${r}`}var j7=[{id:`telegram`,label:`Telegram`},{id:`discord`,label:`Discord`},{id:`slack`,label:`Slack`},{id:`whatsapp`,label:`WhatsApp`},{id:`signal`,label:`Signal`},{id:`imessage`,label:`iMessage`}];function vse(e){let t=e.trim();return t?t.split(/[-_]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `):`Unknown`}function yse(e){var t;let n=e.configForm??((t=e.configSnapshot)==null?void 0:t.config);if(!n||typeof n!=`object`)return[];let r=`channels`in n&&n.channels&&typeof n.channels==`object`?n.channels:{},i=Object.keys(r).filter(e=>e.trim().length>0),a=i.length>0?i.toSorted((e,t)=>e.localeCompare(t)):j7.map(({id:e})=>e),o=new Map(j7.map(({id:e,label:t})=>[e,t])),s=[];for(let e of a){let t=r[e],n=typeof t==`object`&&!!t&&Object.keys(t).length>0;s.push({id:e,label:o.get(e)??vse(e),connected:n,detail:n?`Configured`:void 0})}return s}function bse(e){var t;let n=e.configForm??((t=e.configSnapshot)==null?void 0:t.config);if(!n||typeof n!=`object`)return 0;let r=n.mcp;if(!r||typeof r!=`object`)return 0;let i=`servers`in r&&r.servers&&typeof r.servers==`object`?r.servers:{};return Object.keys(i).length}function xse(e){var t;let n=e.configForm??((t=e.configSnapshot)==null?void 0:t.config);if(!n||typeof n!=`object`)return{gatewayAuth:`unknown`,execPolicy:`unknown`,deviceAuth:!1};let r=n,i=`gateway`in r&&r.gateway&&typeof r.gateway==`object`?r.gateway:null,a=i&&`auth`in i&&i.auth&&typeof i.auth==`object`?i.auth:null,o=`unknown`;a&&(o=(typeof a.mode==`string`?a.mode.trim():``)||(a.password?`password`:a.token?`token`:a.trustedProxy?`trusted-proxy`:`none`));let s=r.agents,c=`allowlist`;if(s&&typeof s==`object`){let e=s.defaults;if(e&&typeof e==`object`){let t=e.exec;if(t&&typeof t==`object`){let e=t.security;typeof e==`string`&&(c=e)}}}let l=!0;if(i){let e=`controlUi`in i&&i.controlUi&&typeof i.controlUi==`object`?i.controlUi:null;(e==null?void 0:e.dangerouslyDisableDeviceAuth)===!0&&(l=!1)}return{gatewayAuth:o,execPolicy:c,deviceAuth:l}}function Sse(e){var t;return(t=e.sessionsResult)==null||(t=t.sessions)==null?void 0:t.find(t=>t.key===e.sessionKey)}function Cse(e,t){return Iie({open:e.cronQuickCreateOpen,step:e.cronQuickCreateStep,draft:e.cronQuickCreateDraft??d8(),onDraftChange:n=>{e.cronQuickCreateDraft={...e.cronQuickCreateDraft??d8(),...n},t==null||t()},onStepChange:n=>{e.cronQuickCreateStep=n,t==null||t()},onCreate:()=>{let n=Aie(e.cronQuickCreateDraft??d8());e.cronEditingJobId=null,e.cronForm={...FD,...n},t==null||t(),(async()=>{if(await Tk(e),e.cronError||nk(e.cronFieldErrors)){t==null||t();return}e.cronQuickCreateOpen=!1,e.cronQuickCreateStep=`what`,e.cronQuickCreateDraft=null,t==null||t()})()},onCancel:()=>{e.cronQuickCreateOpen=!1,e.cronQuickCreateStep=`what`,e.cronQuickCreateDraft=null,t==null||t()}})}function M7(e){var t,n,r;return{storeSkills:e.storeSkills,storeSkillsLoading:e.storeSkillsLoading,storeItemLoading:e.storeItemLoading,installedSkillNames:new Set(((t=e.skillsReport)==null||(t=t.skills)==null?void 0:t.filter(e=>e.extra!==void 0).map(e=>e.name))??[]),customInstalledSkills:((n=e.skillsReport)==null||(n=n.skills)==null?void 0:n.filter(e=>e.extra===void 0&&(e.source===`openclaw-workspace`||e.source===`openclaw-extra`)))??[],storeSkillLabels:new Map((((r=e.skillsReport)==null?void 0:r.skills)??[]).filter(e=>e.storeExtra).map(e=>{var t;return[e.name.toLowerCase().replace(/-/g,`_`),((t=e.storeExtra)==null?void 0:t.title)??e.name]})),recommendedSkills:[]}}function wse(e,t){var n;let r=(((n=e.sessionsResult)==null?void 0:n.sessions)??[]).filter(e=>!gv(e.key)).map(e=>({key:e.key,label:e.label??e.displayName??e.subject??``}));return Jie({open:e.cronTaskDialogOpen,mode:e.cronTaskDialogMode,form:e.cronForm,fieldErrors:e.cronFieldErrors,error:e.cronError,busy:e.cronBusy,canSubmit:!nk(e.cronFieldErrors),sessions:r,sessionQuery:e.cronTaskSessionQuery,onSessionQueryChange:n=>{e.cronTaskSessionQuery=n,t==null||t()},onFormChange:n=>{e.cronForm=ek({...e.cronForm,...n});let r=tk(e.cronForm),i=new Set([...Object.keys(e.cronFieldErrors),...Object.keys(n)]);e.cronFieldErrors=Object.fromEntries(Object.entries(r).filter(([e])=>i.has(e))),t==null||t()},onSubmit:()=>{(async()=>{if(!await Ck(e)){t==null||t();return}await Tk(e)&&(e.cronTaskDialogOpen=!1,e.skillDropdownOpen=!1),t==null||t()})()},onCancel:()=>{e.cronTaskDialogOpen=!1,e.skillDropdownOpen=!1,Fk(e),e.cronError=null,t==null||t()},onOpenAdvanced:()=>{e.cronTaskDialogOpen=!1,e.cronFormCollapsed=!1,e.setTab(`cron`),t==null||t()},proMode:e.settings.proMode,skills:M7(e),skillDropdownOpen:e.skillDropdownOpen,onToggleSkillDropdown:n=>{e.skillDropdownOpen=n,n&&(!e.skillsReport&&!e.skillsLoading&&KA(e,{}),!e.storeSkills&&!e.storeSkillsLoading&&t2(e,t??(()=>{}))),t==null||t()},onNavigateToSkillCenter:()=>{e.cronTaskDialogOpen=!1,e.skillDropdownOpen=!1,e.setTab(`skillcenter`),t==null||t()},onInstallAndUseSkill:async n=>{let r=await C2(e,n,t);if(!r.ok||!r.url||!e.client)return!1;e.storeItemLoading=n.name,t==null||t();try{await e.client.request(`skills.install`,{source:`url`,url:r.url,name:n.name,storeExtra:n,force:!0}),await KA(e,{});let t=e.cronForm.payloadText,i=t.startsWith(`/`)?t.slice(t.search(/\s/u)+1||t.length).trimStart():t;return e.cronForm=ek({...e.cronForm,payloadText:`/${n.name} ${i}`,payloadKind:`agentTurn`}),!0}catch{return!1}finally{e.storeItemLoading=null,t==null||t()}}})}function Tse(e,t,n){let r=[...t].sort((e,t)=>e.createdAtMs-t.createdAtMs);return{basePath:e.basePath??``,view:e.cronTasksView,loading:e.cronLoading,loaded:e.cronJobsLoaded,error:e.cronError,busy:e.cronBusy,jobs:r,jobsTotal:e.cronJobsTotal,jobsHasMore:e.cronJobsHasMore,jobsLoadingMore:e.cronJobsLoadingMore,openMenuJobId:e.cronTaskMenuJobId,runs:e.cronRuns,runsLoadingMore:e.cronRunsLoadingMore,runsHasMore:e.cronRunsHasMore,historyJobFilter:e.cronTaskHistoryJobFilter,historyDateFilter:e.cronTaskHistoryDateFilter,skills:M7(e),onViewChange:t=>{e.cronTasksView=t,t===`history`&&(jk(e,{cronRunsScope:`all`}),kk(e,null)),n==null||n()},onRefresh:()=>e.loadCron(),onNew:()=>{fk(e),n==null||n()},onToggle:(t,n)=>Ek(e,t,n),onRun:t=>Dk(e,t,`force`),onEdit:t=>{Mk(e,t),e.cronTaskSessionQuery=``,e.cronTaskDialogMode=`edit`,e.cronTaskDialogOpen=!0,n==null||n()},onAdvanced:t=>{Mk(e,t),e.cronFormCollapsed=!1,e.setTab(`cron`)},onViewHistory:t=>{e.cronTasksView=`history`,e.cronTaskHistoryJobFilter=t.id,jk(e,{cronRunsScope:`job`}),kk(e,t.id)},onGoToSession:t=>{var r;let i=((r=t.resultSessionKey)==null?void 0:r.trim())||t.sessionKey;i&&(async()=>{if(!await wk(e,i)){n==null||n();return}jQ(e,i),e.setTab(`chat`)})()},onRemove:t=>Ok(e,t),deleteConfirmJobId:e.cronTaskDeleteConfirmJobId,onRequestRemove:t=>{e.cronTaskDeleteConfirmJobId=t.id,n==null||n()},onCancelRemove:()=>{e.cronTaskDeleteConfirmJobId=null,n==null||n()},onOpenMenu:t=>{e.cronTaskMenuJobId=t,n==null||n(),t&&document.addEventListener(`click`,()=>{e.cronTaskMenuJobId!==null&&(e.cronTaskMenuJobId=null,n==null||n())},{once:!0})},onLoadMoreJobs:()=>sk(e,{append:!0}),onLoadMoreRuns:()=>Ak(e),onHistoryJobFilterChange:t=>{e.cronTaskHistoryJobFilter=t,t?(jk(e,{cronRunsScope:`job`}),kk(e,t)):(jk(e,{cronRunsScope:`all`}),kk(e,null))},onHistoryDateFilterChange:t=>{e.cronTaskHistoryDateFilter=t,n==null||n()},onNavigateToChat:(t,r)=>{(async()=>{if(!await wk(e,t)){n==null||n();return}jQ(e,t),e.setTab(`chat`),e.pendingChatScrollMessageId=(r==null?void 0:r.trim())||null})()},proMode:e.settings.proMode}}function N7(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function P7(e){let t=e.lastIndexOf(`.`),n=t>=0?e.slice(t+1).toLowerCase():``;return[`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`,`ico`,`bmp`].includes(n)?{iconClass:`file-tree-panel__item-icon--image`,icon:J.image,ext:n}:[`ts`,`tsx`,`js`,`jsx`,`py`,`rs`,`go`,`sh`,`json`,`yaml`,`yml`,`toml`].includes(n)?{iconClass:`file-tree-panel__item-icon--code`,icon:J.fileCode,ext:n}:[`md`,`txt`,`pdf`,`docx`,`csv`].includes(n)?{iconClass:`file-tree-panel__item-icon--doc`,icon:J.fileText,ext:n}:{iconClass:`file-tree-panel__item-icon--default`,icon:J.fileText,ext:n}}function Ese(e){var t;let n=new Map;for(let r of((t=e.sessionsResult)==null?void 0:t.sessions)??[])r.sessionId&&n.set(r.sessionId,r.displayName??r.label??r.key);return n}async function F7(e,t,n,r){let i=window.sealclawElectron;if(t===`workspace.output.open`&&typeof(i==null?void 0:i.openLocalPath)==`function`){try{let e=await i.openLocalPath(n.filePath);e&&typeof e==`object`&&e.ok===!1&&Y.error(r,{description:e.error||`请重试`})}catch(e){Y.error(r,{description:e instanceof Error?e.message:String(e)})}return}if(t===`workspace.output.reveal`&&typeof(i==null?void 0:i.showItemInFolder)==`function`){try{await i.showItemInFolder(n.filePath)}catch(e){Y.error(r,{description:e instanceof Error?e.message:String(e)})}return}try{var a;let i=await((a=e.client)==null?void 0:a.request(t,n));i&&!i.ok&&Y.error(r,{description:i.error||`请重试`})}catch(e){Y.error(r,{description:e instanceof Error?e.message:String(e)})}}function I7(e,t,n,i,a,o){let c=a*16;return i.map(i=>{if(i.isDir){let l=e.fileTreeExpandedDirs.includes(i.path),u=e.fileTreeDirLoading.includes(i.path),d=e.fileTreeDirChildren[i.path];return r`
|
|
10324
10324
|
<li
|
|
10325
10325
|
class="file-tree-panel__item file-tree-panel__item--dir"
|
|
10326
10326
|
style="padding-left: ${10+c}px"
|
|
@@ -10980,5 +10980,5 @@ ${t.error}</pre
|
|
|
10980
10980
|
aria-label="折叠侧边栏"
|
|
10981
10981
|
></button>`,z9),B9=setTimeout(()=>{B9=null,V9()},Bce))}function V9(){B9&&(clearTimeout(B9),B9=null),z9&&(l(s,z9),z9.remove(),z9=null)}function H9(e){let t=document.querySelector(`.shell-nav`);if(!t)return;if(e){t.parentElement!==document.body&&document.body.appendChild(t);return}let n=document.querySelector(`[data-shell-nav-anchor]`);n&&n.nextElementSibling!==t&&n.insertAdjacentElement(`afterend`,t)}var Uce=200,Wce=200,U9=null,W9=null,G9=null,K9=null;function Gce(e,t){if(!e){Kce();return}W9&&(clearTimeout(W9),W9=null),U9||(U9=document.createElement(`div`),document.body.appendChild(U9)),l(r`<div class="workspace-browser-backdrop" @click=${t}></div>`,U9)}function Kce(){!U9||W9||(l(r`<div class="workspace-browser-backdrop workspace-browser-backdrop--closing"></div>`,U9),W9=setTimeout(()=>{W9=null,q9()},Uce))}function q9(){W9&&(clearTimeout(W9),W9=null),U9&&(l(s,U9),U9.remove(),U9=null)}function J9(e,t,n=!1){let r=e&&!n;if(!t){qce(r);return}K9&&(clearTimeout(K9),K9=null),G9&&(G9.remove(),G9=null);let i=document.querySelector(`.workspace-browser-panel`);if(!i)return;if(r){i.parentElement!==document.body&&document.body.appendChild(i);return}let a=document.querySelector(`[data-workspace-browser-panel-anchor]`);a&&a.nextElementSibling!==i&&a.insertAdjacentElement(`afterend`,i)}function qce(e){if(K9)return;let t=document.querySelector(`.workspace-browser-panel`);if(t){if(!e){t.remove();return}t.classList.add(`workspace-browser-panel--hidden`),G9=t,K9=setTimeout(()=>{K9=null,G9==null||G9.remove(),G9=null},Wce)}}var Y9=rE({}),X9=UI();function Jce(){if(!window.location.search)return!1;let e=new URLSearchParams(window.location.search).get(`onboarding`);if(!e)return!1;let t=e.trim().toLowerCase();return t===`1`||t===`true`||t===`yes`||t===`on`}var $=class extends d{constructor(){super(),this.clientInstanceId=ap(),this.connectGeneration=0,this.settings=VI(),this.password=``,this.loginShowGatewayToken=!1,this.loginShowGatewayPassword=!1,this.tab=`chat`,this.onboarding=Jce(),this.connected=!1,this.backupOperation=null,this.theme=this.settings.theme??`claw`,this.themeMode=this.settings.themeMode??`system`,this.themeResolved=`dark`,this.systemAutoLaunch=!1,this.systemSettingsLoading=!0,this.systemSettingsBusy=!1,this.themeOrder=this.buildThemeOrder(this.theme),this.customThemeImportUrl=``,this.customThemeImportBusy=!1,this.customThemeImportMessage=null,this.customThemeImportExpanded=!1,this.customThemeImportFocusToken=0,this.customThemeImportSelectOnSuccess=!1,this.hello=null,this.lastError=null,this.lastErrorCode=null,this.eventLog=[],this.eventLogBuffer=[],this.toolStreamSyncTimer=null,this.sidebarCloseTimer=null,this.assistantName=Y9.name,this.assistantAvatar=Y9.avatar,this.assistantAvatarSource=Y9.avatarSource??null,this.assistantAvatarStatus=Y9.avatarStatus??null,this.assistantAvatarReason=Y9.avatarReason??null,this.assistantAvatarUploadBusy=!1,this.assistantAvatarUploadError=null,this.assistantAgentId=Y9.agentId??null,this.userName=X9.name,this.userAvatar=X9.avatar,this.localMediaPreviewRoots=[],this.embedSandboxMode=`scripts`,this.allowExternalEmbedUrls=!1,this.chatMessageMaxWidth=null,this.serverVersion=null,this.sessionKey=this.settings.sessionKey,this.currentSessionId=null,this.chatLoading=!0,this.chatSending=!1,this.chatQueueActionInFlight=!1,this.chatMessage=``,this.chatMessages=[],this.chatToolMessages=[],this.chatStreamSegments=[],this.chatStream=null,this.chatStreamStartedAt=null,this.chatStreamPausedAt=null,this.chatRunPhase=null,this.chatRunPhaseLastProgressAt=null,this.chatStreamTick=0,this.chatStreamLastDurationSec=null,this.chatStreamLastModel=null,this.chatStreamLastThinkingBlocks=null,this.chatStreamTickTimer=null,this.chatStreamRevealLen=0,this.chatStreamRevealReasoningLen=0,this.chatTypewriterTimer=null,this.chatPendingFinal=null,this.chatRunId=null,this.chatHistoryHasMore=!1,this.chatHistoryOldestCursor=null,this.chatHistoryLoadingEarlier=!1,this.chatAbortingSessionKeys=new Set,this.chatSideResult=null,this.compactionStatus=null,this.compactionNotices=[],this.fallbackStatus=null,this.chatAvatarUrl=null,this.chatAvatarSource=null,this.chatAvatarStatus=null,this.chatAvatarReason=null,this.chatThinkingLevel=null,this.chatModelOverrides={},this.chatModelsLoading=!1,this.chatModelCatalog=[],this.sessionSwitchNotice=null,this.sessionSwitchFlashKey=null,this.sessionSwitchNoticeSeq=0,this.sessionSwitchNoticeTimer=null,this.sessionSwitchFlashTimer=null,this.chatQueue=[],this.chatQueueBySession={},this.editingQueueItemId=null,this.chatComposerDraftsBySession={},this.chatAttachments=[],this.chatKnowledgeRefs=[],this.chatBrowserRefs=[],this.realtimeTalkActive=!1,this.realtimeTalkStatus=`idle`,this.realtimeTalkDetail=null,this.realtimeTalkTranscript=null,this.skillStoreOpen=!1,this.chatSkillStoreOpenBySession={},this.storeSkills=null,this.storeSkillsLoading=!1,this.storeSkillsRegistry=new Map,this.storeItemLoading=null,this.storeItemError=null,this.realtimeTalkSession=null,this.chatManualRefreshInFlight=!1,this.chatHeaderControlsHidden=!1,this.chatMobileControlsOpen=!1,this.chatMobileControlsTrigger=null,this.navDrawerOpen=!1,this.chatLocalInputHistoryBySession={},this.chatInputHistorySessionKey=null,this.chatInputHistoryItems=null,this.chatInputHistoryIndex=-1,this.chatDraftBeforeHistory=null,this.chatDraftMode=!1,this.chatDraftParentSessionKey=null,this.chatDraftAgentId=null,this.sidebarOpen=!1,this.sidebarContent=null,this.sidebarError=null,this.sidebarEditingSessionKey=null,this.sidebarEditingSessionLabel=``,this.sidebarMoreMenuKey=null,this.sidebarMoreMenuPos=null,this.sidebarDeleteConfirmKey=null,this.sidebarDeleteLinkedJobs=null,this.sidebarDeleteLinkedJobsLoading=!1,this.sidebarDeleteInFlight=!1,this.sidebarDeleteError=null,this.sidebarCreatingGroup=!1,this.sidebarEditingGroupId=null,this.sidebarEditingGroupLabel=``,this.sidebarGroupMoreMenuId=null,this.sidebarDeleteGroupConfirmId=null,this.sidebarMoveMenuKey=null,this.sidebarGroupVersion=0,this.splitRatio=this.settings.splitRatio,this.nodesLoading=!1,this.nodes=[],this.devicesLoading=!1,this.devicesError=null,this.devicesList=null,this.execApprovalsLoading=!1,this.execApprovalsSaving=!1,this.execApprovalsDirty=!1,this.execApprovalsSnapshot=null,this.execApprovalsForm=null,this.execApprovalsSelectedAgent=null,this.execApprovalsTarget=`gateway`,this.execApprovalsTargetNodeId=null,this.execApprovalQueue=[],this.execApprovalBusy=!1,this.execApprovalError=null,this.interactiveFormQueue=[],this.interactiveFormDrafts={},this.interactiveFormBusyId=null,this.interactiveFormError=null,this.pendingGatewayUrl=null,this.pendingGatewayToken=null,this.configLoading=!1,this.configRaw=`{
|
|
10982
10982
|
}
|
|
10983
|
-
`,this.configRawOriginal=``,this.configValid=null,this.configIssues=[],this.configSaving=!1,this.configApplying=!1,this.updateRunning=!1,this.applySessionKey=this.settings.lastActiveSessionKey,this.configSnapshot=null,this.configSchema=null,this.configSchemaVersion=null,this.configSchemaLoading=!1,this.configUiHints={},this.configForm=null,this.configFormOriginal=null,this.dreamingStatusLoading=!1,this.dreamingStatusError=null,this.dreamingStatus=null,this.dreamingModeSaving=!1,this.dreamingRestartConfirmOpen=!1,this.dreamingRestartConfirmLoading=!1,this.dreamingPendingEnabled=null,this.dreamDiaryLoading=!1,this.dreamDiaryActionLoading=!1,this.dreamDiaryActionMessage=null,this.dreamDiaryActionArchivePath=null,this.dreamDiaryError=null,this.dreamDiaryPath=null,this.dreamDiaryContent=null,this.wikiImportInsightsLoading=!1,this.wikiImportInsightsError=null,this.wikiImportInsights=null,this.wikiMemoryPalaceLoading=!1,this.wikiMemoryPalaceError=null,this.wikiMemoryPalace=null,this.configFormDirty=!1,this.configSettingsMode=`quick`,this.settingsActiveMenu=`general`,this.identitySettings=noe(),this.outputRootSettings=coe(),this.configFormMode=`form`,this.configSearchQuery=``,this.configActiveSection=null,this.configActiveSubsection=null,this.pendingUpdateExpectedVersion=null,this.updateStatusBanner=null,this.communicationsFormMode=`form`,this.communicationsSearchQuery=``,this.communicationsActiveSection=null,this.communicationsActiveSubsection=null,this.appearanceFormMode=`form`,this.appearanceSearchQuery=``,this.appearanceActiveSection=null,this.appearanceActiveSubsection=null,this.automationFormMode=`form`,this.automationSearchQuery=``,this.automationActiveSection=null,this.automationActiveSubsection=null,this.pluginsTab=`market`,this.pluginsSelectedChannel=null,this.officeCliModalOpen=!1,this.officeCliStatusLoading=!1,this.officeCliStatus=null,this.xichengBiModalOpen=!1,this.xichengBiStatusLoading=!1,this.xichengBiStatus=null,this.xichengBiShopsLoading=!1,this.xichengBiShops=null,this.xichengBiShopsError=null,this.imChannelsSelectedChannel=null,this.infrastructureFormMode=`form`,this.infrastructureSearchQuery=``,this.infrastructureActiveSection=null,this.infrastructureActiveSubsection=null,this.aiAgentsFormMode=`form`,this.aiAgentsSearchQuery=``,this.aiAgentsActiveSection=null,this.aiAgentsActiveSubsection=null,this.channelsLoading=!1,this.channelsSnapshot=null,this.channelsError=null,this.channelsLastSuccess=null,this.whatsappLoginMessage=null,this.whatsappLoginQrDataUrl=null,this.whatsappLoginConnected=null,this.whatsappBusy=!1,this.nostrProfileFormState=null,this.nostrProfileAccountId=null,this.presenceLoading=!1,this.presenceEntries=[],this.presenceError=null,this.presenceStatus=null,this.agentsLoading=!1,this.agentsList=null,this.agentsError=null,this.agentsSelectedId=null,this.toolsCatalogLoading=!1,this.toolsCatalogError=null,this.toolsCatalogResult=null,this.toolsEffectiveLoading=!1,this.toolsEffectiveLoadingKey=null,this.toolsEffectiveResultKey=null,this.toolsEffectiveError=null,this.toolsEffectiveResult=null,this.agentsPanel=`files`,this.agentFilesLoading=!1,this.agentFilesError=null,this.agentFilesList=null,this.agentFileContents={},this.agentFileDrafts={},this.agentFileActive=null,this.agentFileSaving=!1,this.agentIdentityLoading=!1,this.agentIdentityError=null,this.agentIdentityById={},this.agentSkillsLoading=!1,this.agentSkillsError=null,this.agentSkillsReport=null,this.agentSkillsAgentId=null,this.sessionsLoading=!1,this.sessionsResult=null,this.sessionsError=null,this.contextWeight=null,this.contextWeightKey=null,this.contextWeightLoading=!1,this.sessionsFilterActive=PD.activeMinutes,this.sessionsFilterLimit=PD.limit,this.sessionsIncludeGlobal=!0,this.sessionsIncludeUnknown=!1,this.sessionsShowArchived=!1,this.sessionsFiltersCollapsed=!1,this.sessionsHideCron=!0,this.sessionsSearchQuery=``,this.sessionsSortColumn=`updated`,this.sessionsSortDir=`desc`,this.sessionsPage=0,this.sessionsPageSize=25,this.sessionsSelectedKeys=new Set,this.sessionsExpandedCheckpointKey=null,this.sessionsCheckpointItemsByKey={},this.sessionsCheckpointLoadingKey=null,this.sessionsCheckpointBusyKey=null,this.sessionsCheckpointErrorByKey={},this.usageLoading=!1,this.usageResult=null,this.usageCostSummary=null,this.usageError=null,this.usageStartDate=(()=>{let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`})(),this.usageEndDate=(()=>{let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`})(),this.usageSelectedSessions=[],this.usageSelectedDays=[],this.usageSelectedHours=[],this.usageChartMode=`tokens`,this.usageDailyChartMode=`by-type`,this.usageTimeSeriesMode=`per-turn`,this.usageTimeSeriesBreakdownMode=`by-type`,this.usageTimeSeries=null,this.usageTimeSeriesLoading=!1,this.usageTimeSeriesCursorStart=null,this.usageTimeSeriesCursorEnd=null,this.usageSessionLogs=null,this.usageSessionLogsLoading=!1,this.usageSessionLogsExpanded=!1,this.usageQuery=``,this.usageQueryDraft=``,this.usageSessionSort=`recent`,this.usageSessionSortDir=`desc`,this.usageRecentSessions=[],this.usageTimeZone=`local`,this.usageContextExpanded=!1,this.usageHeaderPinned=!1,this.usageSessionsTab=`all`,this.usageVisibleColumns=[`channel`,`agent`,`provider`,`model`,`messages`,`tools`,`errors`,`duration`],this.usageLogFilterRoles=[],this.usageLogFilterTools=[],this.usageLogFilterHasTools=!1,this.usageLogFilterQuery=``,this.activePanelId=null,this.sidebarStatusPopoverOpen=!1,this.diagnosticsSnapshot=null,this.diagnosticsNetwork={latencyMs:null,downlinkMbps:null,effectiveType:null,measuredAt:null,checking:!1},this.diagnosticsRuntimes={},this.diagnosticsRuntimeInstall=null,this.diagnosticsChecking=!1,this.diagnosticsBusy={export:!1,upload:!1},this.fileTreeLoading=!1,this.fileTreeError=null,this.fileTreeResult=null,this.fileTreeSessionId=void 0,this.fileTreeExpandedDirs=[],this.fileTreeDirChildren={},this.fileTreeDirLoading=[],this.fileTreeRefFiles=null,this.fileTreeRefLoading=!1,this.fileTreeSplitRatio=this.settings.fileTreeSplitRatio,this.fileTreeOutputCollapsed=!1,this.fileTreeRefCollapsed=!1,this.overviewOutputFilter=`document`,this.overviewRefFilter=`all`,this.overviewContentVisible=!1,this.cnChannelsLoading=!1,this.cnChannelsData=null,this.cnChannelsError=null,this.cnConnecting=null,this.cnQrcodeChannel=null,this.cnQrcodeImg=null,this.cnQrcodeToken=null,this.cnQrcodeOpenUrl=null,this.cnQrcodeLoading=!1,this.cnQrcodePollTimer=null,this.cnFeishuAuthorizing=!1,this.cnFeishuQrCancelled=!1,this.cnFeishuCliStatusLoading=!1,this.cnFeishuCliStatus=null,this.cnDingtalkAuthorizing=!1,this.cnDingtalkCliStatusLoading=!1,this.cnDingtalkCliStatus=null,this.skillCenterTab=`center`,this.centerSegment=`store`,this.skillCenterCategory=null,this.skillCenterSearch=``,this.mySkillsSearch=``,this.mySkillsSortOrder=`desc`,this.skillCenterCategories=null,this.skillCenterCategoriesLoading=!1,this.skillCenterItemBusy=null,this.skillCenterItemError=null,this.enterpriseSkills=[],this.enterpriseSkillsLoaded=!1,this.enterpriseSkillsLoading=!1,this.enterpriseInstallLoading=null,this.enterpriseError=null,this.publishDialogOpen=!1,this.publishTarget=null,this.publishingSkill=null,this.publishLoading=!1,this.publishError=null,this.publishSuccess=null,this.mySharesForMatching=[],this.mySharesLoaded=!1,this.syncVersionMap=new Map,this.syncVersionByIdMap=new Map,this.syncVersionMapLoaded=!1,this.shareDialogSkill=null,this.shareDialogPhase=`confirm`,this.shareDialogVersion=`1.0.0`,this.shareDialogResult=null,this.shareDialogError=null,this.shareDialogExisting=null,this.importDialogOpen=!1,this.importShareCode=``,this.importPreview=null,this.importPreviewLoading=!1,this.importClaimLoading=!1,this.importClaimResult=null,this.importError=null,this.skillPublishState=null,this.skillGroups=xoe(),this.skillGroupMap=Soe(),this.selectedSkillGroupId=null,this.creatingSkillGroup=!1,this.renamingSkillGroupId=null,this.deleteSkillGroupTarget=null,this.fileSpaceLoading=!1,this.fileSpaceError=null,this.fileSpaceData=null,this.fileSpaceSearch=``,this.fileSpaceCollapsed=[],this.workspaceBrowserState=qY(this.sessionKey),this.workspaceBrowserStateBySession={},this.workspaceBrowserGlobal=KY(),this.usageQueryDebounceTimer=null,this.workspaceBrowserUnsubscribers=[],this.cronLoading=!1,this.cronJobsLoaded=!1,this.cronQuickCreateOpen=!1,this.cronQuickCreateStep=`what`,this.cronQuickCreateDraft=null,this.cronJobsLoadingMore=!1,this.cronJobs=[],this.cronResultSessionKeys=new Set,this.cronResultSessionJobs=new Map,this.cronJobsTotal=0,this.cronJobsHasMore=!1,this.cronJobsNextOffset=null,this.cronJobsLimit=50,this.cronJobsQuery=``,this.cronJobsEnabledFilter=`all`,this.cronJobsScheduleKindFilter=`all`,this.cronJobsLastStatusFilter=`all`,this.cronJobsSortBy=`nextRunAtMs`,this.cronJobsSortDir=`asc`,this.cronStatus=null,this.cronError=null,this.cronForm={...FD},this.cronFormCollapsed=!1,this.cronFieldErrors={},this.cronEditingJobId=null,this.cronRunsJobId=null,this.cronRunsLoadingMore=!1,this.cronRuns=[],this.cronRunsTotal=0,this.cronRunsHasMore=!1,this.cronRunsNextOffset=null,this.cronRunsLimit=50,this.cronRunsScope=`all`,this.cronRunsStatuses=[],this.cronRunsDeliveryStatuses=[],this.cronRunsStatusFilter=`all`,this.cronRunsQuery=``,this.cronRunsSortDir=`desc`,this.cronModelSuggestions=[],this.cronBusy=!1,this.cronTasksView=`list`,this.cronTaskDialogOpen=!1,this.cronTaskDialogMode=`create`,this.cronTaskMenuJobId=null,this.cronTaskDeleteConfirmJobId=null,this.cronTaskSessionQuery=``,this.skillDropdownOpen=!1,this.cronTaskHistoryJobFilter=``,this.cronTaskHistoryDateFilter=`7d`,this.updateAvailable=null,this.attentionItems=[],this.paletteOpen=!1,this.sessionSwitcherOpen=!1,this.paletteQuery=``,this.paletteActiveIndex=0,this.overviewShowGatewayToken=!1,this.overviewShowGatewayPassword=!1,this.overviewLogLines=[],this.overviewLogCursor=0,this.skillsLoading=!1,this.skillsReport=null,this.skillsError=null,this.skillsFilter=``,this.skillsStatusFilter=`all`,this.skillEdits={},this.skillsBusyKey=null,this.skillMessages={},this.skillsDetailKey=null,this.healthLoading=!1,this.healthResult=null,this.healthError=null,this.modelAuthStatusLoading=!1,this.modelAuthStatusResult=null,this.modelAuthStatusError=null,this.debugLoading=!1,this.debugStatus=null,this.debugHealth=null,this.debugModels=[],this.debugHeartbeat=null,this.debugCallMethod=``,this.debugCallParams=`{}`,this.debugCallResult=null,this.debugCallError=null,this.apiKeys=[],this.webPushSupported=!1,this.webPushPermission=`unsupported`,this.webPushSubscribed=!1,this.webPushLoading=!1,this.logsLoading=!1,this.logsError=null,this.logsFile=null,this.logsEntries=[],this.logsFilterText=``,this.logsLevelFilters={...ND},this.logsAutoFollow=!0,this.logsTruncated=!1,this.logsCursor=null,this.logsLastFetchAt=null,this.logsLimit=500,this.logsMaxBytes=25e4,this.logsAtBottom=!0,this.client=null,this.chatScrollFrame=null,this.chatScrollTimeout=null,this.chatLastScrollTop=0,this.chatHasAutoScrolled=!1,this.chatUserNearBottom=!0,this.chatStreamAutoFollow=!0,this.chatNearTop=!1,this.pendingChatScrollMessageId=null,this.chatDeepLinkScrollInFlight=!1,this.chatNewMessagesBelow=!1,this.chatTocActiveIndex=null,this.nodesPollInterval=null,this.logsPollInterval=null,this.debugPollInterval=null,this.logsScrollFrame=null,this.controlUiResponsivenessObserver=null,this.toolStreamById=new Map,this.toolStreamOrder=[],this.refreshSessionsAfterChat=new Set,this.chatSideResultTerminalRuns=new Set,this.basePath=``,this.popStateHandler=()=>uJ(this),this.topbarObserver=null,this.desktopTaskRunning=null,this.shellWidthPx=null,this.shellWidthObserver=null,this.globalKeydownHandler=e=>{(e.metaKey||e.ctrlKey)&&!e.shiftKey&&e.key===`k`&&(e.preventDefault(),this.paletteOpen=!this.paletteOpen,this.paletteOpen&&(this.paletteQuery=``,this.paletteActiveIndex=0))},this.navDrawerMediaQuery=null,this.navDrawerMediaHandler=e=>{!e.matches&&this.navDrawerOpen&&(this.navDrawerOpen=!1)},this.chatMobileControlsKeydownHandler=e=>{e.key!==`Escape`||!this.chatMobileControlsOpen||(e.preventDefault(),this.setChatMobileControlsOpen(!1,{restoreFocus:!0}))},this.chatMobileControlsPointerdownHandler=e=>{if(!this.chatMobileControlsOpen)return;let t=this.querySelector(`.chat-mobile-controls-wrapper`);t&&e.composedPath().includes(t)||this.setChatMobileControlsOpen(!1)},this.canvasLinkClickHandler=async e=>{var t,n;let r=(t=e.target)==null||(n=t.closest)==null?void 0:n.call(t,`a[data-canvas-url]`);if(!r)return;let i=r.getAttribute(`data-canvas-url`);if(!i)return;e.preventDefault(),e.stopPropagation(),await XY(iY());let a=this.workspaceBrowserState;ZY(a,i),a.panelOpen=!0,this.requestUpdate()},this.browserLinkClickHandler=async e=>{var t,n,r;let i=(t=e.target)==null||(n=t.closest)==null?void 0:n.call(t,`a[data-browser-url]`);if(!i)return;let a=i.getAttribute(`data-browser-url`);if(!a)return;e.preventDefault(),e.stopPropagation();let o=this.workspaceBrowserState,s=(r=i.getAttribute(`data-browser-tab-id`))==null?void 0:r.trim(),c=s?o.tabs.find(e=>e.webContentsTabId===s):void 0;if(c){var l,u;aX(o,c.localKey),(l=window.sealclawElectron)==null||(u=l.focusWorkspaceBrowserTab)==null||u.call(l,c.webContentsTabId,this.sessionKey,!0)}else await XY(iY()),ZY(o,a);o.panelOpen=!0,this.requestUpdate()},this.subagentCardClickHandler=e=>{var t,n;let r=(t=e.target)==null||(n=t.closest)==null?void 0:n.call(t,`[data-subagent-session-key]`);if(!r)return;let i=r.getAttribute(`data-subagent-session-key`);if(!i)return;e.preventDefault(),e.stopPropagation();let a=this.workspaceBrowserState;QY(a,i),a.panelOpen=!0,this.requestUpdate()},this.sealclawInitDone=!1,this.mcpPatchInFlight=null,this.mcpPatchQueued=!1,this.jwtStorageHandler=e=>{e.key===`jwt`&&(this.patchMcpServers(),XY(e.newValue),this.client&&R9(this.client,{force:!0}).catch(e=>{console.error(`[sealclaw] xicheng-bi.token.sync failed`,e)}))}}createRenderRoot(){return this}connectedCallback(){var e,t;super.connectedCallback(),this.chatQueue.length===0&&(this.chatQueue=lZ(this.sessionKey)),this.loadDesktopSystemSettings(),this.onSlashAction=async e=>{switch(e){case`new-session`:OQ(this);break;case`toggle-focus`:this.applySettings({...this.settings,chatFocusMode:!this.settings.chatFocusMode});break;case`export`:NU(this.chatMessages,this.assistantName);break;case`refresh-tools-effective`:await jg(this);break}},document.addEventListener(`keydown`,this.globalKeydownHandler),document.addEventListener(`keydown`,this.chatMobileControlsKeydownHandler),document.addEventListener(`pointerdown`,this.chatMobileControlsPointerdownHandler),document.addEventListener(`click`,this.canvasLinkClickHandler),document.addEventListener(`click`,this.browserLinkClickHandler,{capture:!0}),document.addEventListener(`click`,this.subagentCardClickHandler,{capture:!0}),nce(),this.navDrawerMediaQuery=window.matchMedia(d9),this.navDrawerMediaQuery.addEventListener(`change`,this.navDrawerMediaHandler),window.addEventListener(`storage`,this.jwtStorageHandler),XY(iY()),zX(this),this.initWebPushState(),this.loadApiKeys(),this.workspaceBrowserUnsubscribers=pX({addTab:(e,t,n,r,i)=>{let a=this.resolveWorkspaceBrowserBucket(t),o=e&&i!=null?tX(a,e,i):null,s=o??ZY(a,e,n,r,i);if(o){if(s.webContentsTabId){var c,l;(c=window.sealclawElectron)==null||(l=c.focusWorkspaceBrowserTab)==null||l.call(c,s.webContentsTabId,t??this.sessionKey,!0)}let e=s.pendingUrl;s.pendingUrl=void 0,q7(this,s.localKey,i??``,s.url,s.title)?s.loading=!1:(s.pendingUrl=e,this.requestUpdate(),this.updateComplete.then(()=>{q7(this,s.localKey,i??``,s.url,s.title)&&(s.pendingUrl=void 0,s.loading=!1,this.requestUpdate())}))}Q2(a,(o==null?void 0:o.webContentsTabId)??null),a.panelOpen=!0,this.requestUpdate()},removeTabByServerId:(e,t)=>{var n;let r=this.resolveWorkspaceBrowserBucket(t);rX(r,e);let i=((n=r.tabs.find(e=>e.active))==null?void 0:n.webContentsTabId)??null;i?Q2(r,i):$2(r),this.requestUpdate()},mergeTabsPush:e=>{let t=t=>{var n,r;let i=((n=t.tabs.find(e=>e.active))==null?void 0:n.webContentsTabId)??null;fX(t,e);let a=((r=t.tabs.find(e=>e.active))==null?void 0:r.webContentsTabId)??null;a!==i&&Q2(t,a)};t(this.workspaceBrowserState);for(let e of Object.values(this.workspaceBrowserStateBySession))t(e);this.requestUpdate()},onDownloadEvent:e=>{cX(this.workspaceBrowserGlobal,e),this.workspaceBrowserState.downloadsMenuOpen&&lX(this.workspaceBrowserGlobal),e.phase===`started`&&Y.info(`开始下载: ${e.filename}`),this.requestUpdate()},onAiActivity:e=>{this.resolveWorkspaceBrowserBucket(e).aiActive=!0,this.requestUpdate()}}),(e=window.sealclawElectron)==null||(t=e.getWorkspaceBrowserDownloads)==null||(t=t.call(e))==null||t.then(e=>{Array.isArray(e)&&e.length&&(uX(this.workspaceBrowserGlobal,e),this.requestUpdate())})}resolveWorkspaceBrowserBucket(e){var t;let n=e??this.sessionKey;return n===this.sessionKey?this.workspaceBrowserState:(t=this.workspaceBrowserStateBySession)[n]??(t[n]=qY(n))}firstUpdated(){BX(this)}disconnectedCallback(){var e,t;(e=window.__SEALCLAW_DESKTOP__)==null||(t=e.setTaskRunning)==null||t.call(e,!1).catch(()=>void 0),this.desktopTaskRunning=!1,Wu.close(),document.removeEventListener(`keydown`,this.globalKeydownHandler),document.removeEventListener(`keydown`,this.chatMobileControlsKeydownHandler),document.removeEventListener(`pointerdown`,this.chatMobileControlsPointerdownHandler),document.removeEventListener(`click`,this.canvasLinkClickHandler),document.removeEventListener(`click`,this.browserLinkClickHandler,{capture:!0}),document.removeEventListener(`click`,this.subagentCardClickHandler,{capture:!0}),window.removeEventListener(`storage`,this.jwtStorageHandler),this.navDrawerMediaQuery&&(this.navDrawerMediaQuery.removeEventListener(`change`,this.navDrawerMediaHandler),this.navDrawerMediaQuery=null),this.sessionSwitchNoticeTimer!==null&&(window.clearTimeout(this.sessionSwitchNoticeTimer),this.sessionSwitchNoticeTimer=null),this.sessionSwitchFlashTimer!==null&&(window.clearTimeout(this.sessionSwitchFlashTimer),this.sessionSwitchFlashTimer=null),this.chatMobileControlsTrigger=null;for(let e of this.workspaceBrowserUnsubscribers)e();this.workspaceBrowserUnsubscribers=[],J9(!1,!0),q9(),H9(!1),V9(),UX(this),super.disconnectedCallback()}updated(e){if((e.has(`tab`)&&this.tab!==`chat`||e.has(`connected`)&&!this.connected)&&Wu.close(),WX(this,e),this.tab===`settings`&&this.settingsActiveMenu===`general`&&this.connected&&this.client&&!this.outputRootSettings.loaded&&!this.outputRootSettings.loading&&this.loadOutputRootSettings(),this.tab===`settings`&&this.settingsActiveMenu===`identity`&&this.connected&&this.client&&!this.identitySettings.loaded&&!this.identitySettings.loading&&this.loadIdentitySettings(),this.syncDesktopTaskRunning(),cZ(this.sessionKey,this.chatQueue,this.chatQueueBySession),YY()){BY(this.sessionKey,this.workspaceBrowserState,this.workspaceBrowserStateBySession),zce(document.querySelector(`.workspace-browser-panel`));let e=l9(this);J9(e,this.workspaceBrowserState.panelOpen||Y7(this).length>0,this.workspaceBrowserState.expanded),Gce(e&&this.workspaceBrowserState.panelOpen&&!this.workspaceBrowserState.expanded,()=>p9(this,()=>this.requestUpdate()))}else q9();let t=f9(this),n=this.tab===`chat`&&(this.settings.chatFocusMode||this.onboarding),r=this.navDrawerOpen&&!n&&!this.onboarding;if(H9(t),Vce(t&&r,()=>{this.navDrawerOpen=!1}),this.pendingChatScrollMessageId&&!this.chatDeepLinkScrollInFlight&&this.tab===`chat`&&this.chatMessages.length>0){let e=this.pendingChatScrollMessageId;this.chatDeepLinkScrollInFlight=!0,Bv(this,e).then(t=>{this.chatDeepLinkScrollInFlight=!1,t?(this.chatHasAutoScrolled=!0,this.chatStreamAutoFollow=!1,this.pendingChatScrollMessageId=null):this.pendingChatScrollMessageId===e&&(this.pendingChatScrollMessageId=null)})}if(e.has(`connected`)&&this.connected&&(EJ(this),this.client&&R9(this.client).catch(e=>{console.error(`[sealclaw] xicheng-bi.token.sync failed`,e)}),this.sealclawInitDone?_D(this,{scheduleScroll:!1,force:!0}):(this.sealclawInitDone=!0,this.initCreateApiKey())),e.has(`tab`)&&this.tab!==`chat`&&this.chatMobileControlsOpen&&this.setChatMobileControlsOpen(!1),e.has(`tab`)&&e.get(`tab`)===`chat`&&this.tab!==`chat`){let e=!1;this.workspaceBrowserState.panelOpen&&(R7(this.workspaceBrowserState),B7(this.workspaceBrowserState),H7(this.workspaceBrowserState),this.workspaceBrowserState.panelOpen=!1,this.workspaceBrowserState.autoCollapsedPendingRestore=!0,e=!0),this.activePanelId!==null&&(this.activePanelId=null),e&&this.requestUpdate()}if((e.has(`tab`)||e.has(`sessionKey`))&&this.tab===`chat`&&this.workspaceBrowserState.autoCollapsedPendingRestore&&(this.workspaceBrowserState.autoCollapsedPendingRestore=!1,this.workspaceBrowserState.panelOpen=!0,this.requestUpdate()),!e.has(`sessionKey`)||this.agentsPanel!==`tools`)return;let i=Sg(this.sessionKey);if(this.agentsSelectedId&&this.agentsSelectedId===i){Og(this,{agentId:this.agentsSelectedId,sessionKey:this.sessionKey});return}this.toolsEffectiveResult=null,this.toolsEffectiveResultKey=null,this.toolsEffectiveError=null,this.toolsEffectiveLoading=!1,this.toolsEffectiveLoadingKey=null}connect(){jX(this)}handleChatScroll(e){Uv(this,e),this.chatNearTop&&this.chatHistoryHasMore&&!this.chatHistoryLoadingEarlier&&Wv(this,()=>Kw(this))}handleLogsScroll(e){Gv(this,e)}exportLogs(e,t){Jv(e,t)}resetToolStream(){my(this)}resetChatScroll(){Kv(this)}scrollChatToTop(){qv(this)}scrollToBottom(e){Kv(this),Lv(this,!0,!!(e!=null&&e.smooth))}async loadAssistantIdentity(){await PJ(this)}applySettings(e){Vq(this,e)}applyLocalUserIdentity(e){Hq(this,e)}setTab(e){e===`filespace`&&(this.fileSpaceData=null,this.fileSpaceError=null),Xq(this,e),e!==`chat`&&(Wu.close(),this.setChatMobileControlsOpen(!1),this.sidebarOpen&&this.handleCloseSidebar()),this.navDrawerOpen=!1}setChatMobileControlsOpen(e,t){if(e){this.chatMobileControlsTrigger=(t==null?void 0:t.trigger)??this.chatMobileControlsTrigger,this.chatMobileControlsOpen=!0;return}let n=t!=null&&t.restoreFocus?this.chatMobileControlsTrigger:null;this.chatMobileControlsOpen=!1,this.chatMobileControlsTrigger=null,!(!(n instanceof HTMLElement)||!n.isConnected)&&requestAnimationFrame(()=>{n.isConnected&&n.focus()})}setTheme(e,t){Qq(this,e,t),this.themeOrder=this.buildThemeOrder(e)}setThemeMode(e,t){$q(this,e,t)}async loadDesktopSystemSettings(){let e=window.__SEALCLAW_DESKTOP__;if(!(e!=null&&e.getSystemSettings)){this.systemSettingsLoading=!1;return}try{var t;let n=await e.getSystemSettings();this.systemAutoLaunch=n.autoLaunch,await((t=e.setPreventSleep)==null?void 0:t.call(e,this.settings.preventSleep))}catch(e){Y.error(`读取系统设置失败`,{description:e instanceof Error?e.message:String(e)})}finally{this.systemSettingsLoading=!1}}async setSystemAutoLaunch(e){var t;let n=(t=window.__SEALCLAW_DESKTOP__)==null?void 0:t.setAutoLaunch;if(!(!n||this.systemSettingsBusy)){this.systemSettingsBusy=!0;try{this.systemAutoLaunch=await n(e)}catch(e){Y.error(`设置开机自启动失败`,{description:e instanceof Error?e.message:String(e)})}finally{this.systemSettingsBusy=!1}}}async setPreventSleep(e){var t;let n=(t=window.__SEALCLAW_DESKTOP__)==null?void 0:t.setPreventSleep;if(!(!n||this.systemSettingsBusy)){this.systemSettingsBusy=!0;try{let t=await n(e);this.applySettings({...this.settings,preventSleep:t})}catch(e){Y.error(`设置任务运行时阻止休眠失败`,{description:e instanceof Error?e.message:String(e)})}finally{this.systemSettingsBusy=!1}}}async loadIdentitySettings(e=!1){let t=ooe(this,e);this.requestUpdate(),await t,this.requestUpdate()}async loadOutputRootSettings(e=!1){await uoe(this,e)}async selectOutputRootDirectory(){var e;let t=(e=window.__SEALCLAW_DESKTOP__)==null?void 0:e.selectDirectory;if(!t){Y.error(`目录选择不可用`,{description:`请在 SealSeek 桌面端中设置输出目录`});return}try{await doe(this,t)}catch(e){let t=e instanceof Error?e.message:String(e);Y.error(`选择目录失败`,{description:t})}}async saveOutputRootSettings(){try{await foe(this),Y.success(`已保存,新对话即可生效`)}catch(e){Y.error(`保存失败`,{description:e instanceof Error?e.message:String(e)})}}async saveIdentitySettings(){try{let e=soe(this);this.requestUpdate(),await e;let t=this.identitySettings.saved.model;if(`__draft__`in this.chatModelOverrides){let{[X_]:e,...t}=this.chatModelOverrides;this.chatModelOverrides=t}await L_(this,{includeGlobal:!0,includeUnknown:!0,showArchived:this.sessionsShowArchived}),t!==`auto`&&this.sessionsResult&&(this.sessionsResult={...this.sessionsResult,defaults:{...this.sessionsResult.defaults,model:t,modelProvider:null}}),Y.success(`已保存,新建对话即可生效`),this.loadAssistantIdentity()}catch(e){Y.error(`保存失败`,{description:e instanceof Error?e.message:String(e)})}finally{this.requestUpdate()}}syncDesktopTaskRunning(){var e,t;let n=(((e=this.sessionsResult)==null?void 0:e.sessions)??[]).filter(e=>e.hasActiveRun===!0||!!e.activeRunId||e.hasActiveSubagentRun===!0).map(e=>e.key),r=this.chatSending||!!this.chatRunId||this.chatStream!==null||n.length>0;if(r===this.desktopTaskRunning)return;this.desktopTaskRunning=r;let i=(t=window.__SEALCLAW_DESKTOP__)==null?void 0:t.setTaskRunning;if(!i)return;let a=()=>{this.desktopTaskRunning===r&&(this.desktopTaskRunning=null)};if(!r){i(!1).catch(a);return}i(!0,[this.chatSending&&`chatSending`,this.chatRunId&&`chatRunId=${this.chatRunId}`,this.chatStream!==null&&`chatStream`,n.length>0&&`sessions=${n.join(`,`)}`].filter(e=>!!e).join(`;`).slice(0,500)).catch(a)}setCustomThemeImportUrl(e){var t;this.customThemeImportUrl=e,((t=this.customThemeImportMessage)==null?void 0:t.kind)===`error`&&(this.customThemeImportMessage=null)}openCustomThemeImport(){this.customThemeImportExpanded=!0,this.customThemeImportFocusToken+=1,this.settings.customTheme||(this.customThemeImportSelectOnSuccess=!0)}async importCustomTheme(){if(!this.customThemeImportBusy){this.customThemeImportExpanded=!0,this.customThemeImportBusy=!0,this.customThemeImportMessage=null;try{let e=await ZF(this.customThemeImportUrl),t=this.theme===`custom`||!this.settings.customTheme||this.customThemeImportSelectOnSuccess;Vq(this,{...this.settings,theme:t?`custom`:this.settings.theme,customTheme:e}),this.themeOrder=this.buildThemeOrder(t?`custom`:this.theme),this.customThemeImportUrl=``,this.customThemeImportSelectOnSuccess=!1,this.customThemeImportMessage={kind:`success`,text:`Imported ${e.label}.`}}catch(e){this.customThemeImportMessage={kind:`error`,text:e instanceof Error?e.message:`Failed to import tweakcn theme.`}}finally{this.customThemeImportBusy=!1}}}clearCustomTheme(){let e=this.theme===`custom`?`claw`:this.theme;this.customThemeImportExpanded=!0,this.customThemeImportSelectOnSuccess=!1,Vq(this,{...this.settings,theme:e,customTheme:void 0}),this.themeOrder=this.buildThemeOrder(e),this.customThemeImportMessage={kind:`success`,text:`Cleared custom theme.`}}setBorderRadius(e){Vq(this,{...this.settings,borderRadius:e}),this.requestUpdate()}switchSessionFromHistory(e){jQ(this,e,{skipUrlSync:!0})}announceSessionSwitch(e,t){let n=++this.sessionSwitchNoticeSeq;this.sessionSwitchNoticeTimer!==null&&window.clearTimeout(this.sessionSwitchNoticeTimer),this.sessionSwitchFlashTimer!==null&&window.clearTimeout(this.sessionSwitchFlashTimer),this.sessionSwitchNotice={id:n,text:`已切换到 ${t}`},this.sessionSwitchFlashKey=e,this.sessionSwitchFlashTimer=window.setTimeout(()=>{var e;((e=this.sessionSwitchNotice)==null?void 0:e.id)===n&&(this.sessionSwitchFlashKey=null),this.sessionSwitchFlashTimer=null},200),this.sessionSwitchNoticeTimer=window.setTimeout(()=>{var e;((e=this.sessionSwitchNotice)==null?void 0:e.id)===n&&(this.sessionSwitchNotice=null),this.sessionSwitchNoticeTimer=null},2800)}buildThemeOrder(e){return[e,...[...tI].filter(t=>t!==e)]}async loadOverview(e){await yJ(this,e)}async loadCron(){await TJ(this)}async handleAbortChat(){await HE(this)}async stopWorkspaceBrowserAiOperation(){var e,t;let n=this.sessionKey;this.workspaceBrowserState.aiActive=!1,this.requestUpdate(),(e=window.sealclawElectron)==null||(t=e.cancelWorkspaceBrowserOperation)==null||t.call(e,n),await lT(this)}handleChatDraftChange(e){Jb(this,e)}handleChatInputHistoryKey(e){return Qb(this,e)}resetChatInputHistoryNavigation(){qb(this)}removeQueuedMessage(e){eD(this,e),this.editingQueueItemId===e&&(this.editingQueueItemId=null)}resumeChatQueue(){nD(this)}async retryQueuedMessage(e){await rD(this,e)}editQueuedMessage(e,t){iD(this,e,t),this.editingQueueItemId=null}reorderQueuedMessages(e,t){aD(this,e,t)}async handleSendChat(e,t){let n=(e??this.chatMessage).trim();if(!await AQ(this,n))return!1;if(this.client)try{await R9(this.client,{ensureGateway:!0})}catch(e){console.error(`[sealclaw] xicheng-bi.token.sync failed`,e)}return sD(this,e,t)}async regenerateLastChat(){await mD(this)}async viewFullChatMessage(e){await qw(this,e)}async toggleRealtimeTalk(){if(this.realtimeTalkSession)if(this.realtimeTalkStatus===`error`)this.realtimeTalkSession.stop(),this.realtimeTalkSession=null;else{this.realtimeTalkSession.stop(),this.realtimeTalkSession=null,this.realtimeTalkActive=!1,this.realtimeTalkStatus=`idle`,this.realtimeTalkDetail=null,this.realtimeTalkTranscript=null;return}if(!this.client||!this.connected){this.lastError=`Gateway not connected`;return}this.realtimeTalkActive=!0,this.realtimeTalkStatus=`connecting`,this.realtimeTalkDetail=null,this.realtimeTalkTranscript=null;let e=new wce(this.client,this.sessionKey,{onStatus:(e,t)=>{this.realtimeTalkStatus=e,this.realtimeTalkDetail=t??null,(e===`idle`||e===`error`)&&(this.realtimeTalkActive=e!==`idle`)},onTranscript:e=>{this.realtimeTalkTranscript=`${e.role===`user`?`你`:`万能玺虾`}: ${e.text}`}});this.realtimeTalkSession=e;try{await e.start()}catch(t){e.stop(),this.realtimeTalkSession===e&&(this.realtimeTalkSession=null),this.realtimeTalkActive=!1,this.realtimeTalkStatus=`error`,this.realtimeTalkDetail=t instanceof Error?t.message:String(t),this.lastError=this.realtimeTalkDetail}}async steerQueuedChatMessage(e){await QE(this,e)}async handleWhatsAppStart(e){await _ee(this,e)}async handleWhatsAppWait(){await vee(this)}async handleWhatsAppLogout(){await yee(this)}async handleChannelConfigSave(){await bee(this)}async handleChannelConfigReload(){await xee(this)}handleNostrProfileEdit(e,t){Fm(this,e,t)}handleNostrProfileCancel(){Im(this)}handleNostrProfileFieldChange(e,t){Lm(this,e,t)}async handleNostrProfileSave(){await zm(this)}async handleNostrProfileImport(){await Bm(this)}handleNostrProfileToggleAdvanced(){Rm(this)}async handleExecApprovalDecision(e,t){let n=UJ(this.execApprovalQueue,t);if(!(!n||!this.client||this.execApprovalBusy)){this.execApprovalBusy=!0,this.execApprovalError=null;try{let t=n.kind===`plugin`?`plugin.approval.resolve`:`exec.approval.resolve`;await this.client.request(t,{id:n.id,decision:e}),this.execApprovalQueue=this.execApprovalQueue.filter(e=>e.id!==n.id)}catch(e){this.execApprovalError=`Approval failed: ${String(e)}`}finally{this.execApprovalBusy=!1}}}handleInteractiveFormDraftChange(e,t){this.interactiveFormDrafts={...this.interactiveFormDrafts,[e]:t},this.interactiveFormError=null}async handleInteractiveFormResolve(e,t){let n=this.interactiveFormQueue.find(t=>t.id===e);if(!(!n||!this.client||this.interactiveFormBusyId)){this.interactiveFormBusyId=e,this.interactiveFormError=null;try{var r;await this.client.request(`chat.form.resolve`,{id:e,status:t,...t===`submitted`?{answers:((r=this.interactiveFormDrafts[e])==null?void 0:r.answers)??{}}:{}}),Nw(this,n.request.sessionKey),this.interactiveFormQueue=this.interactiveFormQueue.filter(t=>t.id!==e);let i={...this.interactiveFormDrafts};delete i[e],this.interactiveFormDrafts=i}catch(e){this.interactiveFormError=`Form submission failed: ${String(e)}`}finally{this.interactiveFormBusyId=null}}}handleGatewayUrlConfirm(){var e;let t=this.pendingGatewayUrl;if(!t)return;let n=((e=this.pendingGatewayToken)==null?void 0:e.trim())||``;this.pendingGatewayUrl=null,this.pendingGatewayToken=null,Vq(this,{...this.settings,gatewayUrl:t,token:n}),this.connect()}handleGatewayUrlCancel(){this.pendingGatewayUrl=null,this.pendingGatewayToken=null}handleOpenSidebar(e){this.sidebarCloseTimer!=null&&(window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=null),this.sidebarContent=e,this.sidebarError=null,this.sidebarOpen=!0}handleCloseSidebar(){this.sidebarOpen=!1,this.sidebarCloseTimer!=null&&window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=window.setTimeout(()=>{this.sidebarOpen||(this.sidebarContent=null,this.sidebarError=null,this.sidebarCloseTimer=null)},200)}handleSplitRatioChange(e){let t=Math.max(.4,Math.min(.7,e));this.splitRatio=t,this.applySettings({...this.settings,splitRatio:t})}handleFileTreeSplitRatioChange(e){let t=Math.max(.2,Math.min(.8,e));this.fileTreeSplitRatio=t,this.applySettings({...this.settings,fileTreeSplitRatio:t})}getUserUuidFromJwt(){let e=localStorage.getItem(`jwt`)??``;if(!e)return``;try{let t=e.split(`.`);if(t.length<2)return``;let n=t[1].replace(/-/g,`+`).replace(/_/g,`/`);for(;n.length%4;)n+=`=`;return JSON.parse(atob(n)).userUuid||``}catch{return``}}async initCreateApiKey(){try{var e,t;let n=this.getUserUuidFromJwt();this.configSnapshot||await sm(this);let r=await P({name:`default`});if(!((e=r.data)!=null&&e.key)){let e=(await ne()).data??[];for(let t of e)await re(t.id);r=await P({name:`default`})}let i=(t=r.data)==null?void 0:t.key,a=this.patchMcpServers();if(!i){await a;return}n&&localStorage.setItem(`sealclaw_user_uuid`,n),await this.loadSealclawModels(i),await a}catch(e){console.error(`[sealclaw] initCreateApiKey error:`,e)}}patchMcpServers(){if(this.mcpPatchQueued=!0,this.mcpPatchInFlight)return this.mcpPatchInFlight;let e=this.flushMcpServerPatches();return this.mcpPatchInFlight=e,e.then(()=>{this.mcpPatchInFlight===e&&(this.mcpPatchInFlight=null)}),e}async flushMcpServerPatches(){try{for(;this.mcpPatchQueued;){if(this.mcpPatchQueued=!1,!this.client||!this.configSnapshot)return;let e=this.client;await sY({request:(t,n)=>e.request(t,n),reload:()=>sm(this),getBaseHash:()=>{var e;return(e=this.configSnapshot)==null?void 0:e.hash},jwt:iY(),getConfig:()=>{var e;return(e=this.configSnapshot)==null?void 0:e.config}})&&await sm(this)}}catch(e){console.error(`[sealclaw] patchMcpServers failed`,e)}}async loadSealclawModels(e){try{let t=(await ie(e)).data??[];if(t.length===0){console.warn(`[sealclaw] /models returned empty; keeping existing catalog`);return}if(!this.client){console.warn(`[sealclaw] client not ready`);return}await this.client.request(`sealseek.models.sync`,{baseUrl:`https://gatewaytest.sealseek.cn/api/sealclaw/v1`,...e?{apiKey:e}:{},models:t}),this.chatModelCatalog=await bT(this.client),await _D(this,{scheduleScroll:!1,force:!0})}catch(e){console.error(`[sealclaw] sealseek.models.sync failed`,e)}}async loadApiKeys(){try{let e=await ne();e.data&&(this.apiKeys=e.data)}catch{}}async initWebPushState(){let e=`serviceWorker`in navigator&&`PushManager`in window&&`Notification`in window;if(this.webPushSupported=e,this.webPushPermission=e?Notification.permission:`unsupported`,e)try{let{getExistingSubscription:e}=await m4(async()=>{let{getExistingSubscription:e}=await import(`./push-subscription-Du7DZTU_.js`);return{getExistingSubscription:e}},[]),t=await e();this.webPushSubscribed=t!==null}catch{}}async reconcileWebPushState(){if(this.client)try{var e,t;let{getExistingSubscription:n}=await m4(async()=>{let{getExistingSubscription:e}=await import(`./push-subscription-Du7DZTU_.js`);return{getExistingSubscription:e}},[]),r=await n();if(!r)return;this.webPushSubscribed=!0;let i=r.toJSON();i.endpoint&&(e=i.keys)!=null&&e.p256dh&&(t=i.keys)!=null&&t.auth&&await this.client.request(`push.web.subscribe`,{endpoint:i.endpoint,keys:{p256dh:i.keys.p256dh,auth:i.keys.auth}})}catch{}}async handleWebPushSubscribe(){if(!(!this.client||this.webPushLoading)){this.webPushLoading=!0;try{let{subscribeToWebPush:e}=await m4(async()=>{let{subscribeToWebPush:e}=await import(`./push-subscription-Du7DZTU_.js`);return{subscribeToWebPush:e}},[]);await e(this.client),this.webPushSubscribed=!0,this.webPushPermission=Notification.permission}catch(e){this.lastError=String(e)}finally{this.webPushLoading=!1,`Notification`in window&&(this.webPushPermission=Notification.permission)}}}async handleWebPushUnsubscribe(){if(!(!this.client||this.webPushLoading)){this.webPushLoading=!0;try{let{unsubscribeFromWebPush:e}=await m4(async()=>{let{unsubscribeFromWebPush:e}=await import(`./push-subscription-Du7DZTU_.js`);return{unsubscribeFromWebPush:e}},[]);await e(this.client),this.webPushSubscribed=!1}catch(e){this.lastError=String(e)}finally{this.webPushLoading=!1}}}async handleWebPushTest(){if(this.client)try{let{sendTestWebPush:e}=await m4(async()=>{let{sendTestWebPush:e}=await import(`./push-subscription-Du7DZTU_.js`);return{sendTestWebPush:e}},[]);await e(this.client)}catch(e){this.lastError=String(e)}}render(){return Xse(this)}};Q([j()],$.prototype,`settings`,void 0),Q([j()],$.prototype,`password`,void 0),Q([j()],$.prototype,`loginShowGatewayToken`,void 0),Q([j()],$.prototype,`loginShowGatewayPassword`,void 0),Q([j()],$.prototype,`tab`,void 0),Q([j()],$.prototype,`onboarding`,void 0),Q([j()],$.prototype,`connected`,void 0),Q([j()],$.prototype,`backupOperation`,void 0),Q([j()],$.prototype,`theme`,void 0),Q([j()],$.prototype,`themeMode`,void 0),Q([j()],$.prototype,`themeResolved`,void 0),Q([j()],$.prototype,`systemAutoLaunch`,void 0),Q([j()],$.prototype,`systemSettingsLoading`,void 0),Q([j()],$.prototype,`systemSettingsBusy`,void 0),Q([j()],$.prototype,`themeOrder`,void 0),Q([j()],$.prototype,`customThemeImportUrl`,void 0),Q([j()],$.prototype,`customThemeImportBusy`,void 0),Q([j()],$.prototype,`customThemeImportMessage`,void 0),Q([j()],$.prototype,`customThemeImportExpanded`,void 0),Q([j()],$.prototype,`customThemeImportFocusToken`,void 0),Q([j()],$.prototype,`hello`,void 0),Q([j()],$.prototype,`lastError`,void 0),Q([j()],$.prototype,`lastErrorCode`,void 0),Q([j()],$.prototype,`eventLog`,void 0),Q([j()],$.prototype,`assistantName`,void 0),Q([j()],$.prototype,`assistantAvatar`,void 0),Q([j()],$.prototype,`assistantAvatarSource`,void 0),Q([j()],$.prototype,`assistantAvatarStatus`,void 0),Q([j()],$.prototype,`assistantAvatarReason`,void 0),Q([j()],$.prototype,`assistantAvatarUploadBusy`,void 0),Q([j()],$.prototype,`assistantAvatarUploadError`,void 0),Q([j()],$.prototype,`assistantAgentId`,void 0),Q([j()],$.prototype,`userName`,void 0),Q([j()],$.prototype,`userAvatar`,void 0),Q([j()],$.prototype,`localMediaPreviewRoots`,void 0),Q([j()],$.prototype,`embedSandboxMode`,void 0),Q([j()],$.prototype,`allowExternalEmbedUrls`,void 0),Q([j()],$.prototype,`chatMessageMaxWidth`,void 0),Q([j()],$.prototype,`serverVersion`,void 0),Q([j()],$.prototype,`sessionKey`,void 0),Q([j()],$.prototype,`chatLoading`,void 0),Q([j()],$.prototype,`chatSending`,void 0),Q([j()],$.prototype,`chatQueueActionInFlight`,void 0),Q([j()],$.prototype,`chatMessage`,void 0),Q([j()],$.prototype,`chatMessages`,void 0),Q([j()],$.prototype,`chatToolMessages`,void 0),Q([j()],$.prototype,`chatStreamSegments`,void 0),Q([j()],$.prototype,`chatStream`,void 0),Q([j()],$.prototype,`chatStreamStartedAt`,void 0),Q([j()],$.prototype,`chatStreamPausedAt`,void 0),Q([j()],$.prototype,`chatRunPhase`,void 0),Q([j()],$.prototype,`chatRunPhaseLastProgressAt`,void 0),Q([j()],$.prototype,`chatStreamTick`,void 0),Q([j()],$.prototype,`chatStreamLastDurationSec`,void 0),Q([j()],$.prototype,`chatStreamLastModel`,void 0),Q([j()],$.prototype,`chatStreamLastThinkingBlocks`,void 0),Q([j()],$.prototype,`chatStreamRevealLen`,void 0),Q([j()],$.prototype,`chatStreamRevealReasoningLen`,void 0),Q([j()],$.prototype,`chatRunId`,void 0),Q([j()],$.prototype,`chatHistoryHasMore`,void 0),Q([j()],$.prototype,`chatHistoryOldestCursor`,void 0),Q([j()],$.prototype,`chatHistoryLoadingEarlier`,void 0),Q([j()],$.prototype,`chatAbortingSessionKeys`,void 0),Q([j()],$.prototype,`chatSideResult`,void 0),Q([j()],$.prototype,`compactionStatus`,void 0),Q([j()],$.prototype,`compactionNotices`,void 0),Q([j()],$.prototype,`fallbackStatus`,void 0),Q([j()],$.prototype,`chatAvatarUrl`,void 0),Q([j()],$.prototype,`chatAvatarSource`,void 0),Q([j()],$.prototype,`chatAvatarStatus`,void 0),Q([j()],$.prototype,`chatAvatarReason`,void 0),Q([j()],$.prototype,`chatThinkingLevel`,void 0),Q([j()],$.prototype,`chatModelOverrides`,void 0),Q([j()],$.prototype,`chatModelsLoading`,void 0),Q([j()],$.prototype,`chatModelCatalog`,void 0),Q([j()],$.prototype,`sessionSwitchNotice`,void 0),Q([j()],$.prototype,`sessionSwitchFlashKey`,void 0),Q([j()],$.prototype,`chatQueue`,void 0),Q([j()],$.prototype,`chatQueueBySession`,void 0),Q([j()],$.prototype,`editingQueueItemId`,void 0),Q([j()],$.prototype,`chatComposerDraftsBySession`,void 0),Q([j()],$.prototype,`chatAttachments`,void 0),Q([j()],$.prototype,`chatKnowledgeRefs`,void 0),Q([j()],$.prototype,`chatBrowserRefs`,void 0),Q([j()],$.prototype,`realtimeTalkActive`,void 0),Q([j()],$.prototype,`realtimeTalkStatus`,void 0),Q([j()],$.prototype,`realtimeTalkDetail`,void 0),Q([j()],$.prototype,`realtimeTalkTranscript`,void 0),Q([j()],$.prototype,`skillStoreOpen`,void 0),Q([j()],$.prototype,`chatSkillStoreOpenBySession`,void 0),Q([j()],$.prototype,`storeSkills`,void 0),Q([j()],$.prototype,`storeSkillsLoading`,void 0),Q([j()],$.prototype,`storeItemLoading`,void 0),Q([j()],$.prototype,`storeItemError`,void 0),Q([j()],$.prototype,`chatManualRefreshInFlight`,void 0),Q([j()],$.prototype,`chatHeaderControlsHidden`,void 0),Q([j()],$.prototype,`chatMobileControlsOpen`,void 0),Q([j()],$.prototype,`navDrawerOpen`,void 0),Q([j()],$.prototype,`chatInputHistoryIndex`,void 0),Q([j()],$.prototype,`chatDraftMode`,void 0),Q([j()],$.prototype,`sidebarOpen`,void 0),Q([j()],$.prototype,`sidebarContent`,void 0),Q([j()],$.prototype,`sidebarError`,void 0),Q([j()],$.prototype,`sidebarEditingSessionKey`,void 0),Q([j()],$.prototype,`sidebarEditingSessionLabel`,void 0),Q([j()],$.prototype,`sidebarMoreMenuKey`,void 0),Q([j()],$.prototype,`sidebarMoreMenuPos`,void 0),Q([j()],$.prototype,`sidebarDeleteConfirmKey`,void 0),Q([j()],$.prototype,`sidebarDeleteLinkedJobs`,void 0),Q([j()],$.prototype,`sidebarDeleteLinkedJobsLoading`,void 0),Q([j()],$.prototype,`sidebarDeleteInFlight`,void 0),Q([j()],$.prototype,`sidebarDeleteError`,void 0),Q([j()],$.prototype,`sidebarCreatingGroup`,void 0),Q([j()],$.prototype,`sidebarEditingGroupId`,void 0),Q([j()],$.prototype,`sidebarEditingGroupLabel`,void 0),Q([j()],$.prototype,`sidebarGroupMoreMenuId`,void 0),Q([j()],$.prototype,`sidebarDeleteGroupConfirmId`,void 0),Q([j()],$.prototype,`sidebarMoveMenuKey`,void 0),Q([j()],$.prototype,`sidebarGroupVersion`,void 0),Q([j()],$.prototype,`splitRatio`,void 0),Q([j()],$.prototype,`nodesLoading`,void 0),Q([j()],$.prototype,`nodes`,void 0),Q([j()],$.prototype,`devicesLoading`,void 0),Q([j()],$.prototype,`devicesError`,void 0),Q([j()],$.prototype,`devicesList`,void 0),Q([j()],$.prototype,`execApprovalsLoading`,void 0),Q([j()],$.prototype,`execApprovalsSaving`,void 0),Q([j()],$.prototype,`execApprovalsDirty`,void 0),Q([j()],$.prototype,`execApprovalsSnapshot`,void 0),Q([j()],$.prototype,`execApprovalsForm`,void 0),Q([j()],$.prototype,`execApprovalsSelectedAgent`,void 0),Q([j()],$.prototype,`execApprovalsTarget`,void 0),Q([j()],$.prototype,`execApprovalsTargetNodeId`,void 0),Q([j()],$.prototype,`execApprovalQueue`,void 0),Q([j()],$.prototype,`execApprovalBusy`,void 0),Q([j()],$.prototype,`execApprovalError`,void 0),Q([j()],$.prototype,`interactiveFormQueue`,void 0),Q([j()],$.prototype,`interactiveFormDrafts`,void 0),Q([j()],$.prototype,`interactiveFormBusyId`,void 0),Q([j()],$.prototype,`interactiveFormError`,void 0),Q([j()],$.prototype,`pendingGatewayUrl`,void 0),Q([j()],$.prototype,`configLoading`,void 0),Q([j()],$.prototype,`configRaw`,void 0),Q([j()],$.prototype,`configRawOriginal`,void 0),Q([j()],$.prototype,`configValid`,void 0),Q([j()],$.prototype,`configIssues`,void 0),Q([j()],$.prototype,`configSaving`,void 0),Q([j()],$.prototype,`configApplying`,void 0),Q([j()],$.prototype,`updateRunning`,void 0),Q([j()],$.prototype,`applySessionKey`,void 0),Q([j()],$.prototype,`configSnapshot`,void 0),Q([j()],$.prototype,`configSchema`,void 0),Q([j()],$.prototype,`configSchemaVersion`,void 0),Q([j()],$.prototype,`configSchemaLoading`,void 0),Q([j()],$.prototype,`configUiHints`,void 0),Q([j()],$.prototype,`configForm`,void 0),Q([j()],$.prototype,`configFormOriginal`,void 0),Q([j()],$.prototype,`dreamingStatusLoading`,void 0),Q([j()],$.prototype,`dreamingStatusError`,void 0),Q([j()],$.prototype,`dreamingStatus`,void 0),Q([j()],$.prototype,`dreamingModeSaving`,void 0),Q([j()],$.prototype,`dreamingRestartConfirmOpen`,void 0),Q([j()],$.prototype,`dreamingRestartConfirmLoading`,void 0),Q([j()],$.prototype,`dreamingPendingEnabled`,void 0),Q([j()],$.prototype,`dreamDiaryLoading`,void 0),Q([j()],$.prototype,`dreamDiaryActionLoading`,void 0),Q([j()],$.prototype,`dreamDiaryActionMessage`,void 0),Q([j()],$.prototype,`dreamDiaryActionArchivePath`,void 0),Q([j()],$.prototype,`dreamDiaryError`,void 0),Q([j()],$.prototype,`dreamDiaryPath`,void 0),Q([j()],$.prototype,`dreamDiaryContent`,void 0),Q([j()],$.prototype,`wikiImportInsightsLoading`,void 0),Q([j()],$.prototype,`wikiImportInsightsError`,void 0),Q([j()],$.prototype,`wikiImportInsights`,void 0),Q([j()],$.prototype,`wikiMemoryPalaceLoading`,void 0),Q([j()],$.prototype,`wikiMemoryPalaceError`,void 0),Q([j()],$.prototype,`wikiMemoryPalace`,void 0),Q([j()],$.prototype,`configFormDirty`,void 0),Q([j()],$.prototype,`configSettingsMode`,void 0),Q([j()],$.prototype,`settingsActiveMenu`,void 0),Q([j()],$.prototype,`identitySettings`,void 0),Q([j()],$.prototype,`outputRootSettings`,void 0),Q([j()],$.prototype,`configFormMode`,void 0),Q([j()],$.prototype,`configSearchQuery`,void 0),Q([j()],$.prototype,`configActiveSection`,void 0),Q([j()],$.prototype,`configActiveSubsection`,void 0),Q([j()],$.prototype,`pendingUpdateExpectedVersion`,void 0),Q([j()],$.prototype,`updateStatusBanner`,void 0),Q([j()],$.prototype,`communicationsFormMode`,void 0),Q([j()],$.prototype,`communicationsSearchQuery`,void 0),Q([j()],$.prototype,`communicationsActiveSection`,void 0),Q([j()],$.prototype,`communicationsActiveSubsection`,void 0),Q([j()],$.prototype,`appearanceFormMode`,void 0),Q([j()],$.prototype,`appearanceSearchQuery`,void 0),Q([j()],$.prototype,`appearanceActiveSection`,void 0),Q([j()],$.prototype,`appearanceActiveSubsection`,void 0),Q([j()],$.prototype,`automationFormMode`,void 0),Q([j()],$.prototype,`automationSearchQuery`,void 0),Q([j()],$.prototype,`automationActiveSection`,void 0),Q([j()],$.prototype,`automationActiveSubsection`,void 0),Q([j()],$.prototype,`pluginsTab`,void 0),Q([j()],$.prototype,`pluginsSelectedChannel`,void 0),Q([j()],$.prototype,`officeCliModalOpen`,void 0),Q([j()],$.prototype,`officeCliStatusLoading`,void 0),Q([j()],$.prototype,`officeCliStatus`,void 0),Q([j()],$.prototype,`xichengBiModalOpen`,void 0),Q([j()],$.prototype,`xichengBiStatusLoading`,void 0),Q([j()],$.prototype,`xichengBiStatus`,void 0),Q([j()],$.prototype,`xichengBiShopsLoading`,void 0),Q([j()],$.prototype,`xichengBiShops`,void 0),Q([j()],$.prototype,`xichengBiShopsError`,void 0),Q([j()],$.prototype,`imChannelsSelectedChannel`,void 0),Q([j()],$.prototype,`infrastructureFormMode`,void 0),Q([j()],$.prototype,`infrastructureSearchQuery`,void 0),Q([j()],$.prototype,`infrastructureActiveSection`,void 0),Q([j()],$.prototype,`infrastructureActiveSubsection`,void 0),Q([j()],$.prototype,`aiAgentsFormMode`,void 0),Q([j()],$.prototype,`aiAgentsSearchQuery`,void 0),Q([j()],$.prototype,`aiAgentsActiveSection`,void 0),Q([j()],$.prototype,`aiAgentsActiveSubsection`,void 0),Q([j()],$.prototype,`channelsLoading`,void 0),Q([j()],$.prototype,`channelsSnapshot`,void 0),Q([j()],$.prototype,`channelsError`,void 0),Q([j()],$.prototype,`channelsLastSuccess`,void 0),Q([j()],$.prototype,`whatsappLoginMessage`,void 0),Q([j()],$.prototype,`whatsappLoginQrDataUrl`,void 0),Q([j()],$.prototype,`whatsappLoginConnected`,void 0),Q([j()],$.prototype,`whatsappBusy`,void 0),Q([j()],$.prototype,`nostrProfileFormState`,void 0),Q([j()],$.prototype,`nostrProfileAccountId`,void 0),Q([j()],$.prototype,`presenceLoading`,void 0),Q([j()],$.prototype,`presenceEntries`,void 0),Q([j()],$.prototype,`presenceError`,void 0),Q([j()],$.prototype,`presenceStatus`,void 0),Q([j()],$.prototype,`agentsLoading`,void 0),Q([j()],$.prototype,`agentsList`,void 0),Q([j()],$.prototype,`agentsError`,void 0),Q([j()],$.prototype,`agentsSelectedId`,void 0),Q([j()],$.prototype,`toolsCatalogLoading`,void 0),Q([j()],$.prototype,`toolsCatalogError`,void 0),Q([j()],$.prototype,`toolsCatalogResult`,void 0),Q([j()],$.prototype,`toolsEffectiveLoading`,void 0),Q([j()],$.prototype,`toolsEffectiveLoadingKey`,void 0),Q([j()],$.prototype,`toolsEffectiveResultKey`,void 0),Q([j()],$.prototype,`toolsEffectiveError`,void 0),Q([j()],$.prototype,`toolsEffectiveResult`,void 0),Q([j()],$.prototype,`agentsPanel`,void 0),Q([j()],$.prototype,`agentFilesLoading`,void 0),Q([j()],$.prototype,`agentFilesError`,void 0),Q([j()],$.prototype,`agentFilesList`,void 0),Q([j()],$.prototype,`agentFileContents`,void 0),Q([j()],$.prototype,`agentFileDrafts`,void 0),Q([j()],$.prototype,`agentFileActive`,void 0),Q([j()],$.prototype,`agentFileSaving`,void 0),Q([j()],$.prototype,`agentIdentityLoading`,void 0),Q([j()],$.prototype,`agentIdentityError`,void 0),Q([j()],$.prototype,`agentIdentityById`,void 0),Q([j()],$.prototype,`agentSkillsLoading`,void 0),Q([j()],$.prototype,`agentSkillsError`,void 0),Q([j()],$.prototype,`agentSkillsReport`,void 0),Q([j()],$.prototype,`agentSkillsAgentId`,void 0),Q([j()],$.prototype,`sessionsLoading`,void 0),Q([j()],$.prototype,`sessionsResult`,void 0),Q([j()],$.prototype,`sessionsError`,void 0),Q([j()],$.prototype,`contextWeight`,void 0),Q([j()],$.prototype,`contextWeightKey`,void 0),Q([j()],$.prototype,`contextWeightLoading`,void 0),Q([j()],$.prototype,`sessionsFilterActive`,void 0),Q([j()],$.prototype,`sessionsFilterLimit`,void 0),Q([j()],$.prototype,`sessionsIncludeGlobal`,void 0),Q([j()],$.prototype,`sessionsIncludeUnknown`,void 0),Q([j()],$.prototype,`sessionsShowArchived`,void 0),Q([j()],$.prototype,`sessionsFiltersCollapsed`,void 0),Q([j()],$.prototype,`sessionsHideCron`,void 0),Q([j()],$.prototype,`sessionsSearchQuery`,void 0),Q([j()],$.prototype,`sessionsSortColumn`,void 0),Q([j()],$.prototype,`sessionsSortDir`,void 0),Q([j()],$.prototype,`sessionsPage`,void 0),Q([j()],$.prototype,`sessionsPageSize`,void 0),Q([j()],$.prototype,`sessionsSelectedKeys`,void 0),Q([j()],$.prototype,`sessionsExpandedCheckpointKey`,void 0),Q([j()],$.prototype,`sessionsCheckpointItemsByKey`,void 0),Q([j()],$.prototype,`sessionsCheckpointLoadingKey`,void 0),Q([j()],$.prototype,`sessionsCheckpointBusyKey`,void 0),Q([j()],$.prototype,`sessionsCheckpointErrorByKey`,void 0),Q([j()],$.prototype,`usageLoading`,void 0),Q([j()],$.prototype,`usageResult`,void 0),Q([j()],$.prototype,`usageCostSummary`,void 0),Q([j()],$.prototype,`usageError`,void 0),Q([j()],$.prototype,`usageStartDate`,void 0),Q([j()],$.prototype,`usageEndDate`,void 0),Q([j()],$.prototype,`usageSelectedSessions`,void 0),Q([j()],$.prototype,`usageSelectedDays`,void 0),Q([j()],$.prototype,`usageSelectedHours`,void 0),Q([j()],$.prototype,`usageChartMode`,void 0),Q([j()],$.prototype,`usageDailyChartMode`,void 0),Q([j()],$.prototype,`usageTimeSeriesMode`,void 0),Q([j()],$.prototype,`usageTimeSeriesBreakdownMode`,void 0),Q([j()],$.prototype,`usageTimeSeries`,void 0),Q([j()],$.prototype,`usageTimeSeriesLoading`,void 0),Q([j()],$.prototype,`usageTimeSeriesCursorStart`,void 0),Q([j()],$.prototype,`usageTimeSeriesCursorEnd`,void 0),Q([j()],$.prototype,`usageSessionLogs`,void 0),Q([j()],$.prototype,`usageSessionLogsLoading`,void 0),Q([j()],$.prototype,`usageSessionLogsExpanded`,void 0),Q([j()],$.prototype,`usageQuery`,void 0),Q([j()],$.prototype,`usageQueryDraft`,void 0),Q([j()],$.prototype,`usageSessionSort`,void 0),Q([j()],$.prototype,`usageSessionSortDir`,void 0),Q([j()],$.prototype,`usageRecentSessions`,void 0),Q([j()],$.prototype,`usageTimeZone`,void 0),Q([j()],$.prototype,`usageContextExpanded`,void 0),Q([j()],$.prototype,`usageHeaderPinned`,void 0),Q([j()],$.prototype,`usageSessionsTab`,void 0),Q([j()],$.prototype,`usageVisibleColumns`,void 0),Q([j()],$.prototype,`usageLogFilterRoles`,void 0),Q([j()],$.prototype,`usageLogFilterTools`,void 0),Q([j()],$.prototype,`usageLogFilterHasTools`,void 0),Q([j()],$.prototype,`usageLogFilterQuery`,void 0),Q([j()],$.prototype,`activePanelId`,void 0),Q([j()],$.prototype,`sidebarStatusPopoverOpen`,void 0),Q([j()],$.prototype,`diagnosticsSnapshot`,void 0),Q([j()],$.prototype,`diagnosticsNetwork`,void 0),Q([j()],$.prototype,`diagnosticsRuntimes`,void 0),Q([j()],$.prototype,`diagnosticsRuntimeInstall`,void 0),Q([j()],$.prototype,`diagnosticsChecking`,void 0),Q([j()],$.prototype,`diagnosticsBusy`,void 0),Q([j()],$.prototype,`fileTreeLoading`,void 0),Q([j()],$.prototype,`fileTreeError`,void 0),Q([j()],$.prototype,`fileTreeResult`,void 0),Q([j()],$.prototype,`fileTreeSessionId`,void 0),Q([j()],$.prototype,`fileTreeExpandedDirs`,void 0),Q([j()],$.prototype,`fileTreeDirChildren`,void 0),Q([j()],$.prototype,`fileTreeDirLoading`,void 0),Q([j()],$.prototype,`fileTreeRefFiles`,void 0),Q([j()],$.prototype,`fileTreeRefLoading`,void 0),Q([j()],$.prototype,`fileTreeSplitRatio`,void 0),Q([j()],$.prototype,`fileTreeOutputCollapsed`,void 0),Q([j()],$.prototype,`fileTreeRefCollapsed`,void 0),Q([j()],$.prototype,`overviewOutputFilter`,void 0),Q([j()],$.prototype,`overviewRefFilter`,void 0),Q([j()],$.prototype,`cnChannelsLoading`,void 0),Q([j()],$.prototype,`cnChannelsData`,void 0),Q([j()],$.prototype,`cnChannelsError`,void 0),Q([j()],$.prototype,`cnConnecting`,void 0),Q([j()],$.prototype,`cnQrcodeChannel`,void 0),Q([j()],$.prototype,`cnQrcodeImg`,void 0),Q([j()],$.prototype,`cnQrcodeToken`,void 0),Q([j()],$.prototype,`cnQrcodeOpenUrl`,void 0),Q([j()],$.prototype,`cnQrcodeLoading`,void 0),Q([j()],$.prototype,`cnFeishuAuthorizing`,void 0),Q([j()],$.prototype,`cnFeishuQrCancelled`,void 0),Q([j()],$.prototype,`cnFeishuCliStatusLoading`,void 0),Q([j()],$.prototype,`cnFeishuCliStatus`,void 0),Q([j()],$.prototype,`cnDingtalkAuthorizing`,void 0),Q([j()],$.prototype,`cnDingtalkCliStatusLoading`,void 0),Q([j()],$.prototype,`cnDingtalkCliStatus`,void 0),Q([j()],$.prototype,`skillCenterTab`,void 0),Q([j()],$.prototype,`centerSegment`,void 0),Q([j()],$.prototype,`skillCenterCategory`,void 0),Q([j()],$.prototype,`skillCenterSearch`,void 0),Q([j()],$.prototype,`mySkillsSearch`,void 0),Q([j()],$.prototype,`mySkillsSortOrder`,void 0),Q([j()],$.prototype,`skillCenterCategories`,void 0),Q([j()],$.prototype,`skillCenterCategoriesLoading`,void 0),Q([j()],$.prototype,`skillCenterItemBusy`,void 0),Q([j()],$.prototype,`skillCenterItemError`,void 0),Q([j()],$.prototype,`enterpriseSkills`,void 0),Q([j()],$.prototype,`enterpriseSkillsLoading`,void 0),Q([j()],$.prototype,`enterpriseInstallLoading`,void 0),Q([j()],$.prototype,`enterpriseError`,void 0),Q([j()],$.prototype,`publishDialogOpen`,void 0),Q([j()],$.prototype,`publishTarget`,void 0),Q([j()],$.prototype,`publishingSkill`,void 0),Q([j()],$.prototype,`publishLoading`,void 0),Q([j()],$.prototype,`publishError`,void 0),Q([j()],$.prototype,`publishSuccess`,void 0),Q([j()],$.prototype,`mySharesForMatching`,void 0),Q([j()],$.prototype,`mySharesLoaded`,void 0),Q([j()],$.prototype,`syncVersionMap`,void 0),Q([j()],$.prototype,`syncVersionByIdMap`,void 0),Q([j()],$.prototype,`shareDialogSkill`,void 0),Q([j()],$.prototype,`shareDialogPhase`,void 0),Q([j()],$.prototype,`shareDialogVersion`,void 0),Q([j()],$.prototype,`shareDialogResult`,void 0),Q([j()],$.prototype,`shareDialogError`,void 0),Q([j()],$.prototype,`shareDialogExisting`,void 0),Q([j()],$.prototype,`importDialogOpen`,void 0),Q([j()],$.prototype,`importShareCode`,void 0),Q([j()],$.prototype,`importPreview`,void 0),Q([j()],$.prototype,`importPreviewLoading`,void 0),Q([j()],$.prototype,`importClaimLoading`,void 0),Q([j()],$.prototype,`importClaimResult`,void 0),Q([j()],$.prototype,`importError`,void 0),Q([j()],$.prototype,`skillPublishState`,void 0),Q([j()],$.prototype,`skillGroups`,void 0),Q([j()],$.prototype,`skillGroupMap`,void 0),Q([j()],$.prototype,`selectedSkillGroupId`,void 0),Q([j()],$.prototype,`creatingSkillGroup`,void 0),Q([j()],$.prototype,`renamingSkillGroupId`,void 0),Q([j()],$.prototype,`deleteSkillGroupTarget`,void 0),Q([j()],$.prototype,`fileSpaceLoading`,void 0),Q([j()],$.prototype,`fileSpaceError`,void 0),Q([j()],$.prototype,`fileSpaceData`,void 0),Q([j()],$.prototype,`fileSpaceSearch`,void 0),Q([j()],$.prototype,`fileSpaceCollapsed`,void 0),Q([j()],$.prototype,`workspaceBrowserState`,void 0),Q([j()],$.prototype,`workspaceBrowserStateBySession`,void 0),Q([j()],$.prototype,`workspaceBrowserGlobal`,void 0),Q([j()],$.prototype,`cronLoading`,void 0),Q([j()],$.prototype,`cronJobsLoaded`,void 0),Q([j()],$.prototype,`cronQuickCreateOpen`,void 0),Q([j()],$.prototype,`cronQuickCreateStep`,void 0),Q([j()],$.prototype,`cronQuickCreateDraft`,void 0),Q([j()],$.prototype,`cronJobsLoadingMore`,void 0),Q([j()],$.prototype,`cronJobs`,void 0),Q([j()],$.prototype,`cronResultSessionKeys`,void 0),Q([j()],$.prototype,`cronResultSessionJobs`,void 0),Q([j()],$.prototype,`cronJobsTotal`,void 0),Q([j()],$.prototype,`cronJobsHasMore`,void 0),Q([j()],$.prototype,`cronJobsNextOffset`,void 0),Q([j()],$.prototype,`cronJobsLimit`,void 0),Q([j()],$.prototype,`cronJobsQuery`,void 0),Q([j()],$.prototype,`cronJobsEnabledFilter`,void 0),Q([j()],$.prototype,`cronJobsScheduleKindFilter`,void 0),Q([j()],$.prototype,`cronJobsLastStatusFilter`,void 0),Q([j()],$.prototype,`cronJobsSortBy`,void 0),Q([j()],$.prototype,`cronJobsSortDir`,void 0),Q([j()],$.prototype,`cronStatus`,void 0),Q([j()],$.prototype,`cronError`,void 0),Q([j()],$.prototype,`cronForm`,void 0),Q([j()],$.prototype,`cronFormCollapsed`,void 0),Q([j()],$.prototype,`cronFieldErrors`,void 0),Q([j()],$.prototype,`cronEditingJobId`,void 0),Q([j()],$.prototype,`cronRunsJobId`,void 0),Q([j()],$.prototype,`cronRunsLoadingMore`,void 0),Q([j()],$.prototype,`cronRuns`,void 0),Q([j()],$.prototype,`cronRunsTotal`,void 0),Q([j()],$.prototype,`cronRunsHasMore`,void 0),Q([j()],$.prototype,`cronRunsNextOffset`,void 0),Q([j()],$.prototype,`cronRunsLimit`,void 0),Q([j()],$.prototype,`cronRunsScope`,void 0),Q([j()],$.prototype,`cronRunsStatuses`,void 0),Q([j()],$.prototype,`cronRunsDeliveryStatuses`,void 0),Q([j()],$.prototype,`cronRunsStatusFilter`,void 0),Q([j()],$.prototype,`cronRunsQuery`,void 0),Q([j()],$.prototype,`cronRunsSortDir`,void 0),Q([j()],$.prototype,`cronModelSuggestions`,void 0),Q([j()],$.prototype,`cronBusy`,void 0),Q([j()],$.prototype,`cronTasksView`,void 0),Q([j()],$.prototype,`cronTaskDialogOpen`,void 0),Q([j()],$.prototype,`cronTaskDialogMode`,void 0),Q([j()],$.prototype,`cronTaskMenuJobId`,void 0),Q([j()],$.prototype,`cronTaskDeleteConfirmJobId`,void 0),Q([j()],$.prototype,`cronTaskSessionQuery`,void 0),Q([j()],$.prototype,`skillDropdownOpen`,void 0),Q([j()],$.prototype,`cronTaskHistoryJobFilter`,void 0),Q([j()],$.prototype,`cronTaskHistoryDateFilter`,void 0),Q([j()],$.prototype,`updateAvailable`,void 0),Q([j()],$.prototype,`attentionItems`,void 0),Q([j()],$.prototype,`paletteOpen`,void 0),Q([j()],$.prototype,`sessionSwitcherOpen`,void 0),Q([j()],$.prototype,`paletteQuery`,void 0),Q([j()],$.prototype,`paletteActiveIndex`,void 0),Q([j()],$.prototype,`overviewShowGatewayToken`,void 0),Q([j()],$.prototype,`overviewShowGatewayPassword`,void 0),Q([j()],$.prototype,`overviewLogLines`,void 0),Q([j()],$.prototype,`overviewLogCursor`,void 0),Q([j()],$.prototype,`skillsLoading`,void 0),Q([j()],$.prototype,`skillsReport`,void 0),Q([j()],$.prototype,`skillsError`,void 0),Q([j()],$.prototype,`skillsFilter`,void 0),Q([j()],$.prototype,`skillsStatusFilter`,void 0),Q([j()],$.prototype,`skillEdits`,void 0),Q([j()],$.prototype,`skillsBusyKey`,void 0),Q([j()],$.prototype,`skillMessages`,void 0),Q([j()],$.prototype,`skillsDetailKey`,void 0),Q([j()],$.prototype,`healthLoading`,void 0),Q([j()],$.prototype,`healthResult`,void 0),Q([j()],$.prototype,`healthError`,void 0),Q([j()],$.prototype,`modelAuthStatusLoading`,void 0),Q([j()],$.prototype,`modelAuthStatusResult`,void 0),Q([j()],$.prototype,`modelAuthStatusError`,void 0),Q([j()],$.prototype,`debugLoading`,void 0),Q([j()],$.prototype,`debugStatus`,void 0),Q([j()],$.prototype,`debugHealth`,void 0),Q([j()],$.prototype,`debugModels`,void 0),Q([j()],$.prototype,`debugHeartbeat`,void 0),Q([j()],$.prototype,`debugCallMethod`,void 0),Q([j()],$.prototype,`debugCallParams`,void 0),Q([j()],$.prototype,`debugCallResult`,void 0),Q([j()],$.prototype,`debugCallError`,void 0),Q([j()],$.prototype,`apiKeys`,void 0),Q([j()],$.prototype,`webPushSupported`,void 0),Q([j()],$.prototype,`webPushPermission`,void 0),Q([j()],$.prototype,`webPushSubscribed`,void 0),Q([j()],$.prototype,`webPushLoading`,void 0),Q([j()],$.prototype,`logsLoading`,void 0),Q([j()],$.prototype,`logsError`,void 0),Q([j()],$.prototype,`logsFile`,void 0),Q([j()],$.prototype,`logsEntries`,void 0),Q([j()],$.prototype,`logsFilterText`,void 0),Q([j()],$.prototype,`logsLevelFilters`,void 0),Q([j()],$.prototype,`logsAutoFollow`,void 0),Q([j()],$.prototype,`logsTruncated`,void 0),Q([j()],$.prototype,`logsCursor`,void 0),Q([j()],$.prototype,`logsLastFetchAt`,void 0),Q([j()],$.prototype,`logsLimit`,void 0),Q([j()],$.prototype,`logsMaxBytes`,void 0),Q([j()],$.prototype,`logsAtBottom`,void 0),Q([j()],$.prototype,`chatNewMessagesBelow`,void 0),Q([j()],$.prototype,`chatTocActiveIndex`,void 0),Q([j()],$.prototype,`shellWidthPx`,void 0),customElements.get(`openclaw-app`)||customElements.define(`openclaw-app`,$);var Z9=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=typeof window<`u`?window.proxy||window:{};e.qiankunWindow=t,e.renderWithQiankun=function(e){t!=null&&t.__POWERED_BY_QIANKUN__&&(window.moudleQiankunAppLifeCycles||(window.moudleQiankunAppLifeCycles={}),t.qiankunName&&(window.moudleQiankunAppLifeCycles[t.qiankunName]=e))}}))(),Q9=`/sealclaw`;function Yce(){if(`serviceWorker`in navigator){{let e=new URL(`sw.js`,new URL(`/sealclaw/`,window.location.href));navigator.serviceWorker.register(e).catch(()=>{});return}navigator.serviceWorker.getRegistrations().then(e=>{for(let t of e)t.unregister()})}}var $9=null;(0,Z9.renderWithQiankun)({bootstrap(){return Promise.resolve()},mount(e){window.__OPENCLAW_CONTROL_UI_BASE_PATH__=Q9;let t=(e==null?void 0:e.container)??document.body,n=t.querySelector(`openclaw-app`);return $9=n??document.createElement(`openclaw-app`),n||t.appendChild($9),$9.basePath=Q9,Promise.resolve()},unmount(){return $9==null||$9.remove(),$9=null,Promise.resolve()},update(){return Promise.resolve()}}),Z9.qiankunWindow.__POWERED_BY_QIANKUN__||Yce();export{Id as $,bE as A,EE as B,aL as C,pE as D,yE as E,Bte as F,AS as G,sE as H,xE as I,kh as J,K_ as K,CE as L,Gte as M,cE as N,SE as O,TE as P,Lp as Q,DE as R,eK as S,XO as T,oE as U,Kte as V,WT as W,Ym as X,$m as Y,jm as Z,o$ as _,c5 as a,_l as at,bY as b,Oae as c,vc as ct,Eae as d,Cd as et,Dae as f,J0 as g,m4 as h,s5 as i,vl as it,Wte as j,Hte as k,a5 as l,K as lt,F6 as m,R9 as n,Ml as nt,Aae as o,gl as ot,Z6 as p,J as q,G5 as r,Ol as rt,kae as s,Cl as st,Pce as t,Ql as tt,i5 as u,ii as ut,SY as v,XI as w,VY as x,yY as y,wE as z};
|
|
10984
|
-
//# sourceMappingURL=index-
|
|
10983
|
+
`,this.configRawOriginal=``,this.configValid=null,this.configIssues=[],this.configSaving=!1,this.configApplying=!1,this.updateRunning=!1,this.applySessionKey=this.settings.lastActiveSessionKey,this.configSnapshot=null,this.configSchema=null,this.configSchemaVersion=null,this.configSchemaLoading=!1,this.configUiHints={},this.configForm=null,this.configFormOriginal=null,this.dreamingStatusLoading=!1,this.dreamingStatusError=null,this.dreamingStatus=null,this.dreamingModeSaving=!1,this.dreamingRestartConfirmOpen=!1,this.dreamingRestartConfirmLoading=!1,this.dreamingPendingEnabled=null,this.dreamDiaryLoading=!1,this.dreamDiaryActionLoading=!1,this.dreamDiaryActionMessage=null,this.dreamDiaryActionArchivePath=null,this.dreamDiaryError=null,this.dreamDiaryPath=null,this.dreamDiaryContent=null,this.wikiImportInsightsLoading=!1,this.wikiImportInsightsError=null,this.wikiImportInsights=null,this.wikiMemoryPalaceLoading=!1,this.wikiMemoryPalaceError=null,this.wikiMemoryPalace=null,this.configFormDirty=!1,this.configSettingsMode=`quick`,this.settingsActiveMenu=`general`,this.identitySettings=noe(),this.outputRootSettings=coe(),this.configFormMode=`form`,this.configSearchQuery=``,this.configActiveSection=null,this.configActiveSubsection=null,this.pendingUpdateExpectedVersion=null,this.updateStatusBanner=null,this.communicationsFormMode=`form`,this.communicationsSearchQuery=``,this.communicationsActiveSection=null,this.communicationsActiveSubsection=null,this.appearanceFormMode=`form`,this.appearanceSearchQuery=``,this.appearanceActiveSection=null,this.appearanceActiveSubsection=null,this.automationFormMode=`form`,this.automationSearchQuery=``,this.automationActiveSection=null,this.automationActiveSubsection=null,this.pluginsTab=`market`,this.pluginsSelectedChannel=null,this.officeCliModalOpen=!1,this.officeCliStatusLoading=!1,this.officeCliStatus=null,this.xichengBiModalOpen=!1,this.xichengBiStatusLoading=!1,this.xichengBiStatus=null,this.xichengBiShopsLoading=!1,this.xichengBiShops=null,this.xichengBiShopsError=null,this.imChannelsSelectedChannel=null,this.infrastructureFormMode=`form`,this.infrastructureSearchQuery=``,this.infrastructureActiveSection=null,this.infrastructureActiveSubsection=null,this.aiAgentsFormMode=`form`,this.aiAgentsSearchQuery=``,this.aiAgentsActiveSection=null,this.aiAgentsActiveSubsection=null,this.channelsLoading=!1,this.channelsSnapshot=null,this.channelsError=null,this.channelsLastSuccess=null,this.whatsappLoginMessage=null,this.whatsappLoginQrDataUrl=null,this.whatsappLoginConnected=null,this.whatsappBusy=!1,this.nostrProfileFormState=null,this.nostrProfileAccountId=null,this.presenceLoading=!1,this.presenceEntries=[],this.presenceError=null,this.presenceStatus=null,this.agentsLoading=!1,this.agentsList=null,this.agentsError=null,this.agentsSelectedId=null,this.toolsCatalogLoading=!1,this.toolsCatalogError=null,this.toolsCatalogResult=null,this.toolsEffectiveLoading=!1,this.toolsEffectiveLoadingKey=null,this.toolsEffectiveResultKey=null,this.toolsEffectiveError=null,this.toolsEffectiveResult=null,this.agentsPanel=`files`,this.agentFilesLoading=!1,this.agentFilesError=null,this.agentFilesList=null,this.agentFileContents={},this.agentFileDrafts={},this.agentFileActive=null,this.agentFileSaving=!1,this.agentIdentityLoading=!1,this.agentIdentityError=null,this.agentIdentityById={},this.agentSkillsLoading=!1,this.agentSkillsError=null,this.agentSkillsReport=null,this.agentSkillsAgentId=null,this.sessionsLoading=!1,this.sessionsResult=null,this.sessionsError=null,this.contextWeight=null,this.contextWeightKey=null,this.contextWeightLoading=!1,this.sessionsFilterActive=PD.activeMinutes,this.sessionsFilterLimit=PD.limit,this.sessionsIncludeGlobal=!0,this.sessionsIncludeUnknown=!1,this.sessionsShowArchived=!1,this.sessionsFiltersCollapsed=!1,this.sessionsHideCron=!0,this.sessionsSearchQuery=``,this.sessionsSortColumn=`updated`,this.sessionsSortDir=`desc`,this.sessionsPage=0,this.sessionsPageSize=25,this.sessionsSelectedKeys=new Set,this.sessionsExpandedCheckpointKey=null,this.sessionsCheckpointItemsByKey={},this.sessionsCheckpointLoadingKey=null,this.sessionsCheckpointBusyKey=null,this.sessionsCheckpointErrorByKey={},this.usageLoading=!1,this.usageResult=null,this.usageCostSummary=null,this.usageError=null,this.usageStartDate=(()=>{let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`})(),this.usageEndDate=(()=>{let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`})(),this.usageSelectedSessions=[],this.usageSelectedDays=[],this.usageSelectedHours=[],this.usageChartMode=`tokens`,this.usageDailyChartMode=`by-type`,this.usageTimeSeriesMode=`per-turn`,this.usageTimeSeriesBreakdownMode=`by-type`,this.usageTimeSeries=null,this.usageTimeSeriesLoading=!1,this.usageTimeSeriesCursorStart=null,this.usageTimeSeriesCursorEnd=null,this.usageSessionLogs=null,this.usageSessionLogsLoading=!1,this.usageSessionLogsExpanded=!1,this.usageQuery=``,this.usageQueryDraft=``,this.usageSessionSort=`recent`,this.usageSessionSortDir=`desc`,this.usageRecentSessions=[],this.usageTimeZone=`local`,this.usageContextExpanded=!1,this.usageHeaderPinned=!1,this.usageSessionsTab=`all`,this.usageVisibleColumns=[`channel`,`agent`,`provider`,`model`,`messages`,`tools`,`errors`,`duration`],this.usageLogFilterRoles=[],this.usageLogFilterTools=[],this.usageLogFilterHasTools=!1,this.usageLogFilterQuery=``,this.activePanelId=null,this.sidebarStatusPopoverOpen=!1,this.diagnosticsSnapshot=null,this.diagnosticsNetwork={latencyMs:null,downlinkMbps:null,effectiveType:null,measuredAt:null,checking:!1},this.diagnosticsRuntimes={},this.diagnosticsRuntimeInstall=null,this.diagnosticsChecking=!1,this.diagnosticsBusy={export:!1,upload:!1},this.fileTreeLoading=!1,this.fileTreeError=null,this.fileTreeResult=null,this.fileTreeSessionId=void 0,this.fileTreeExpandedDirs=[],this.fileTreeDirChildren={},this.fileTreeDirLoading=[],this.fileTreeRefFiles=null,this.fileTreeRefLoading=!1,this.fileTreeSplitRatio=this.settings.fileTreeSplitRatio,this.fileTreeOutputCollapsed=!1,this.fileTreeRefCollapsed=!1,this.overviewOutputFilter=`document`,this.overviewRefFilter=`all`,this.overviewContentVisible=!1,this.cnChannelsLoading=!1,this.cnChannelsData=null,this.cnChannelsError=null,this.cnConnecting=null,this.cnQrcodeChannel=null,this.cnQrcodeImg=null,this.cnQrcodeToken=null,this.cnQrcodeOpenUrl=null,this.cnQrcodeLoading=!1,this.cnQrcodePollTimer=null,this.cnFeishuAuthorizing=!1,this.cnFeishuQrCancelled=!1,this.cnFeishuCliStatusLoading=!1,this.cnFeishuCliStatus=null,this.cnDingtalkAuthorizing=!1,this.cnDingtalkCliStatusLoading=!1,this.cnDingtalkCliStatus=null,this.skillCenterTab=`center`,this.centerSegment=`store`,this.skillCenterCategory=null,this.skillCenterSearch=``,this.mySkillsSearch=``,this.mySkillsSortOrder=`desc`,this.skillCenterCategories=null,this.skillCenterCategoriesLoading=!1,this.skillCenterItemBusy=null,this.skillCenterItemError=null,this.enterpriseSkills=[],this.enterpriseSkillsLoaded=!1,this.enterpriseSkillsLoading=!1,this.enterpriseInstallLoading=null,this.enterpriseError=null,this.publishDialogOpen=!1,this.publishTarget=null,this.publishingSkill=null,this.publishLoading=!1,this.publishError=null,this.publishSuccess=null,this.mySharesForMatching=[],this.mySharesLoaded=!1,this.syncVersionMap=new Map,this.syncVersionByIdMap=new Map,this.syncVersionMapLoaded=!1,this.shareDialogSkill=null,this.shareDialogPhase=`confirm`,this.shareDialogVersion=`1.0.0`,this.shareDialogResult=null,this.shareDialogError=null,this.shareDialogExisting=null,this.importDialogOpen=!1,this.importShareCode=``,this.importPreview=null,this.importPreviewLoading=!1,this.importClaimLoading=!1,this.importClaimResult=null,this.importError=null,this.skillPublishState=null,this.skillGroups=xoe(),this.skillGroupMap=Soe(),this.selectedSkillGroupId=null,this.creatingSkillGroup=!1,this.renamingSkillGroupId=null,this.deleteSkillGroupTarget=null,this.fileSpaceLoading=!1,this.fileSpaceError=null,this.fileSpaceData=null,this.fileSpaceSearch=``,this.fileSpaceCollapsed=[],this.workspaceBrowserState=qY(this.sessionKey),this.workspaceBrowserStateBySession={},this.workspaceBrowserGlobal=KY(),this.usageQueryDebounceTimer=null,this.workspaceBrowserUnsubscribers=[],this.cronLoading=!1,this.cronJobsLoaded=!1,this.cronQuickCreateOpen=!1,this.cronQuickCreateStep=`what`,this.cronQuickCreateDraft=null,this.cronJobsLoadingMore=!1,this.cronJobs=[],this.cronResultSessionKeys=new Set,this.cronResultSessionJobs=new Map,this.cronJobsTotal=0,this.cronJobsHasMore=!1,this.cronJobsNextOffset=null,this.cronJobsLimit=50,this.cronJobsQuery=``,this.cronJobsEnabledFilter=`all`,this.cronJobsScheduleKindFilter=`all`,this.cronJobsLastStatusFilter=`all`,this.cronJobsSortBy=`nextRunAtMs`,this.cronJobsSortDir=`asc`,this.cronStatus=null,this.cronError=null,this.cronForm={...FD},this.cronFormCollapsed=!1,this.cronFieldErrors={},this.cronEditingJobId=null,this.cronRunsJobId=null,this.cronRunsLoadingMore=!1,this.cronRuns=[],this.cronRunsTotal=0,this.cronRunsHasMore=!1,this.cronRunsNextOffset=null,this.cronRunsLimit=50,this.cronRunsScope=`all`,this.cronRunsStatuses=[],this.cronRunsDeliveryStatuses=[],this.cronRunsStatusFilter=`all`,this.cronRunsQuery=``,this.cronRunsSortDir=`desc`,this.cronModelSuggestions=[],this.cronBusy=!1,this.cronTasksView=`list`,this.cronTaskDialogOpen=!1,this.cronTaskDialogMode=`create`,this.cronTaskMenuJobId=null,this.cronTaskDeleteConfirmJobId=null,this.cronTaskSessionQuery=``,this.skillDropdownOpen=!1,this.cronTaskHistoryJobFilter=``,this.cronTaskHistoryDateFilter=`7d`,this.updateAvailable=null,this.attentionItems=[],this.paletteOpen=!1,this.sessionSwitcherOpen=!1,this.paletteQuery=``,this.paletteActiveIndex=0,this.overviewShowGatewayToken=!1,this.overviewShowGatewayPassword=!1,this.overviewLogLines=[],this.overviewLogCursor=0,this.skillsLoading=!1,this.skillsReport=null,this.skillsError=null,this.skillsFilter=``,this.skillsStatusFilter=`all`,this.skillEdits={},this.skillsBusyKey=null,this.skillMessages={},this.skillsDetailKey=null,this.healthLoading=!1,this.healthResult=null,this.healthError=null,this.modelAuthStatusLoading=!1,this.modelAuthStatusResult=null,this.modelAuthStatusError=null,this.debugLoading=!1,this.debugStatus=null,this.debugHealth=null,this.debugModels=[],this.debugHeartbeat=null,this.debugCallMethod=``,this.debugCallParams=`{}`,this.debugCallResult=null,this.debugCallError=null,this.apiKeys=[],this.webPushSupported=!1,this.webPushPermission=`unsupported`,this.webPushSubscribed=!1,this.webPushLoading=!1,this.logsLoading=!1,this.logsError=null,this.logsFile=null,this.logsEntries=[],this.logsFilterText=``,this.logsLevelFilters={...ND},this.logsAutoFollow=!0,this.logsTruncated=!1,this.logsCursor=null,this.logsLastFetchAt=null,this.logsLimit=500,this.logsMaxBytes=25e4,this.logsAtBottom=!0,this.client=null,this.chatScrollFrame=null,this.chatScrollTimeout=null,this.chatLastScrollTop=0,this.chatHasAutoScrolled=!1,this.chatUserNearBottom=!0,this.chatStreamAutoFollow=!0,this.chatNearTop=!1,this.pendingChatScrollMessageId=null,this.chatDeepLinkScrollInFlight=!1,this.chatNewMessagesBelow=!1,this.chatTocActiveIndex=null,this.nodesPollInterval=null,this.logsPollInterval=null,this.debugPollInterval=null,this.logsScrollFrame=null,this.controlUiResponsivenessObserver=null,this.toolStreamById=new Map,this.toolStreamOrder=[],this.refreshSessionsAfterChat=new Set,this.chatSideResultTerminalRuns=new Set,this.basePath=``,this.popStateHandler=()=>uJ(this),this.topbarObserver=null,this.desktopTaskRunning=null,this.shellWidthPx=null,this.shellWidthObserver=null,this.globalKeydownHandler=e=>{(e.metaKey||e.ctrlKey)&&!e.shiftKey&&e.key===`k`&&(e.preventDefault(),this.paletteOpen=!this.paletteOpen,this.paletteOpen&&(this.paletteQuery=``,this.paletteActiveIndex=0))},this.navDrawerMediaQuery=null,this.navDrawerMediaHandler=e=>{!e.matches&&this.navDrawerOpen&&(this.navDrawerOpen=!1)},this.chatMobileControlsKeydownHandler=e=>{e.key!==`Escape`||!this.chatMobileControlsOpen||(e.preventDefault(),this.setChatMobileControlsOpen(!1,{restoreFocus:!0}))},this.chatMobileControlsPointerdownHandler=e=>{if(!this.chatMobileControlsOpen)return;let t=this.querySelector(`.chat-mobile-controls-wrapper`);t&&e.composedPath().includes(t)||this.setChatMobileControlsOpen(!1)},this.canvasLinkClickHandler=async e=>{var t,n;let r=(t=e.target)==null||(n=t.closest)==null?void 0:n.call(t,`a[data-canvas-url]`);if(!r)return;let i=r.getAttribute(`data-canvas-url`);if(!i)return;e.preventDefault(),e.stopPropagation(),await XY(iY());let a=this.workspaceBrowserState;ZY(a,i),a.panelOpen=!0,this.requestUpdate()},this.browserLinkClickHandler=async e=>{var t,n,r;let i=(t=e.target)==null||(n=t.closest)==null?void 0:n.call(t,`a[data-browser-url]`);if(!i)return;let a=i.getAttribute(`data-browser-url`);if(!a)return;e.preventDefault(),e.stopPropagation();let o=this.workspaceBrowserState,s=(r=i.getAttribute(`data-browser-tab-id`))==null?void 0:r.trim(),c=s?o.tabs.find(e=>e.webContentsTabId===s):void 0;if(c){var l,u;aX(o,c.localKey),(l=window.sealclawElectron)==null||(u=l.focusWorkspaceBrowserTab)==null||u.call(l,c.webContentsTabId,this.sessionKey,!0)}else await XY(iY()),ZY(o,a);o.panelOpen=!0,this.requestUpdate()},this.subagentCardClickHandler=e=>{var t,n;let r=(t=e.target)==null||(n=t.closest)==null?void 0:n.call(t,`[data-subagent-session-key]`);if(!r)return;let i=r.getAttribute(`data-subagent-session-key`);if(!i)return;e.preventDefault(),e.stopPropagation();let a=this.workspaceBrowserState;QY(a,i),a.panelOpen=!0,this.requestUpdate()},this.sealclawInitDone=!1,this.mcpPatchInFlight=null,this.mcpPatchQueued=!1,this.jwtStorageHandler=e=>{e.key===`jwt`&&(this.patchMcpServers(),XY(e.newValue),this.client&&R9(this.client,{force:!0}).catch(e=>{console.error(`[sealclaw] xicheng-bi.token.sync failed`,e)}))}}createRenderRoot(){return this}connectedCallback(){var e,t;super.connectedCallback(),this.chatQueue.length===0&&(this.chatQueue=lZ(this.sessionKey)),this.loadDesktopSystemSettings(),this.onSlashAction=async e=>{switch(e){case`new-session`:OQ(this);break;case`toggle-focus`:this.applySettings({...this.settings,chatFocusMode:!this.settings.chatFocusMode});break;case`export`:NU(this.chatMessages,this.assistantName);break;case`refresh-tools-effective`:await jg(this);break}},document.addEventListener(`keydown`,this.globalKeydownHandler),document.addEventListener(`keydown`,this.chatMobileControlsKeydownHandler),document.addEventListener(`pointerdown`,this.chatMobileControlsPointerdownHandler),document.addEventListener(`click`,this.canvasLinkClickHandler),document.addEventListener(`click`,this.browserLinkClickHandler,{capture:!0}),document.addEventListener(`click`,this.subagentCardClickHandler,{capture:!0}),nce(),this.navDrawerMediaQuery=window.matchMedia(d9),this.navDrawerMediaQuery.addEventListener(`change`,this.navDrawerMediaHandler),window.addEventListener(`storage`,this.jwtStorageHandler),XY(iY()),zX(this),this.initWebPushState(),this.loadApiKeys(),this.workspaceBrowserUnsubscribers=pX({addTab:(e,t,n,r,i)=>{let a=this.resolveWorkspaceBrowserBucket(t),o=e&&i!=null?tX(a,e,i):null,s=o??ZY(a,e,n,r,i);if(o){if(s.webContentsTabId){var c,l;(c=window.sealclawElectron)==null||(l=c.focusWorkspaceBrowserTab)==null||l.call(c,s.webContentsTabId,t??this.sessionKey,!0)}let e=s.pendingUrl;s.pendingUrl=void 0,q7(this,s.localKey,i??``,s.url,s.title)?s.loading=!1:(s.pendingUrl=e,this.requestUpdate(),this.updateComplete.then(()=>{q7(this,s.localKey,i??``,s.url,s.title)&&(s.pendingUrl=void 0,s.loading=!1,this.requestUpdate())}))}Q2(a,(o==null?void 0:o.webContentsTabId)??null),a.panelOpen=!0,this.requestUpdate()},removeTabByServerId:(e,t)=>{var n;let r=this.resolveWorkspaceBrowserBucket(t);rX(r,e);let i=((n=r.tabs.find(e=>e.active))==null?void 0:n.webContentsTabId)??null;i?Q2(r,i):$2(r),this.requestUpdate()},mergeTabsPush:e=>{let t=t=>{var n,r;let i=((n=t.tabs.find(e=>e.active))==null?void 0:n.webContentsTabId)??null;fX(t,e);let a=((r=t.tabs.find(e=>e.active))==null?void 0:r.webContentsTabId)??null;a!==i&&Q2(t,a)};t(this.workspaceBrowserState);for(let e of Object.values(this.workspaceBrowserStateBySession))t(e);this.requestUpdate()},onDownloadEvent:e=>{cX(this.workspaceBrowserGlobal,e),this.workspaceBrowserState.downloadsMenuOpen&&lX(this.workspaceBrowserGlobal),e.phase===`started`&&Y.info(`开始下载: ${e.filename}`),this.requestUpdate()},onAiActivity:e=>{this.resolveWorkspaceBrowserBucket(e).aiActive=!0,this.requestUpdate()}}),(e=window.sealclawElectron)==null||(t=e.getWorkspaceBrowserDownloads)==null||(t=t.call(e))==null||t.then(e=>{Array.isArray(e)&&e.length&&(uX(this.workspaceBrowserGlobal,e),this.requestUpdate())})}resolveWorkspaceBrowserBucket(e){var t;let n=e??this.sessionKey;return n===this.sessionKey?this.workspaceBrowserState:(t=this.workspaceBrowserStateBySession)[n]??(t[n]=qY(n))}firstUpdated(){BX(this)}disconnectedCallback(){var e,t;(e=window.__SEALCLAW_DESKTOP__)==null||(t=e.setTaskRunning)==null||t.call(e,!1).catch(()=>void 0),this.desktopTaskRunning=!1,Wu.close(),document.removeEventListener(`keydown`,this.globalKeydownHandler),document.removeEventListener(`keydown`,this.chatMobileControlsKeydownHandler),document.removeEventListener(`pointerdown`,this.chatMobileControlsPointerdownHandler),document.removeEventListener(`click`,this.canvasLinkClickHandler),document.removeEventListener(`click`,this.browserLinkClickHandler,{capture:!0}),document.removeEventListener(`click`,this.subagentCardClickHandler,{capture:!0}),window.removeEventListener(`storage`,this.jwtStorageHandler),this.navDrawerMediaQuery&&(this.navDrawerMediaQuery.removeEventListener(`change`,this.navDrawerMediaHandler),this.navDrawerMediaQuery=null),this.sessionSwitchNoticeTimer!==null&&(window.clearTimeout(this.sessionSwitchNoticeTimer),this.sessionSwitchNoticeTimer=null),this.sessionSwitchFlashTimer!==null&&(window.clearTimeout(this.sessionSwitchFlashTimer),this.sessionSwitchFlashTimer=null),this.chatMobileControlsTrigger=null;for(let e of this.workspaceBrowserUnsubscribers)e();this.workspaceBrowserUnsubscribers=[],J9(!1,!0),q9(),H9(!1),V9(),UX(this),super.disconnectedCallback()}updated(e){if((e.has(`tab`)&&this.tab!==`chat`||e.has(`connected`)&&!this.connected)&&Wu.close(),WX(this,e),this.tab===`settings`&&this.settingsActiveMenu===`general`&&this.connected&&this.client&&!this.outputRootSettings.loaded&&!this.outputRootSettings.loading&&this.loadOutputRootSettings(),this.tab===`settings`&&this.settingsActiveMenu===`identity`&&this.connected&&this.client&&!this.identitySettings.loaded&&!this.identitySettings.loading&&this.loadIdentitySettings(),this.syncDesktopTaskRunning(),cZ(this.sessionKey,this.chatQueue,this.chatQueueBySession),YY()){BY(this.sessionKey,this.workspaceBrowserState,this.workspaceBrowserStateBySession),zce(document.querySelector(`.workspace-browser-panel`));let e=l9(this);J9(e,this.workspaceBrowserState.panelOpen||Y7(this).length>0,this.workspaceBrowserState.expanded),Gce(e&&this.workspaceBrowserState.panelOpen&&!this.workspaceBrowserState.expanded,()=>p9(this,()=>this.requestUpdate()))}else q9();let t=f9(this),n=this.tab===`chat`&&(this.settings.chatFocusMode||this.onboarding),r=this.navDrawerOpen&&!n&&!this.onboarding;if(H9(t),Vce(t&&r,()=>{this.navDrawerOpen=!1}),this.pendingChatScrollMessageId&&!this.chatDeepLinkScrollInFlight&&this.tab===`chat`&&this.chatMessages.length>0){let e=this.pendingChatScrollMessageId;this.chatDeepLinkScrollInFlight=!0,Bv(this,e).then(t=>{this.chatDeepLinkScrollInFlight=!1,t?(this.chatHasAutoScrolled=!0,this.chatStreamAutoFollow=!1,this.pendingChatScrollMessageId=null):this.pendingChatScrollMessageId===e&&(this.pendingChatScrollMessageId=null)})}if(e.has(`connected`)&&this.connected&&(EJ(this),this.client&&R9(this.client).catch(e=>{console.error(`[sealclaw] xicheng-bi.token.sync failed`,e)}),this.sealclawInitDone?_D(this,{scheduleScroll:!1,force:!0}):(this.sealclawInitDone=!0,this.initCreateApiKey())),e.has(`tab`)&&this.tab!==`chat`&&this.chatMobileControlsOpen&&this.setChatMobileControlsOpen(!1),e.has(`tab`)&&e.get(`tab`)===`chat`&&this.tab!==`chat`){let e=!1;this.workspaceBrowserState.panelOpen&&(R7(this.workspaceBrowserState),B7(this.workspaceBrowserState),H7(this.workspaceBrowserState),this.workspaceBrowserState.panelOpen=!1,this.workspaceBrowserState.autoCollapsedPendingRestore=!0,e=!0),this.activePanelId!==null&&(this.activePanelId=null),e&&this.requestUpdate()}if((e.has(`tab`)||e.has(`sessionKey`))&&this.tab===`chat`&&this.workspaceBrowserState.autoCollapsedPendingRestore&&(this.workspaceBrowserState.autoCollapsedPendingRestore=!1,this.workspaceBrowserState.panelOpen=!0,this.requestUpdate()),!e.has(`sessionKey`)||this.agentsPanel!==`tools`)return;let i=Sg(this.sessionKey);if(this.agentsSelectedId&&this.agentsSelectedId===i){Og(this,{agentId:this.agentsSelectedId,sessionKey:this.sessionKey});return}this.toolsEffectiveResult=null,this.toolsEffectiveResultKey=null,this.toolsEffectiveError=null,this.toolsEffectiveLoading=!1,this.toolsEffectiveLoadingKey=null}connect(){jX(this)}handleChatScroll(e){Uv(this,e),this.chatNearTop&&this.chatHistoryHasMore&&!this.chatHistoryLoadingEarlier&&Wv(this,()=>Kw(this))}handleLogsScroll(e){Gv(this,e)}exportLogs(e,t){Jv(e,t)}resetToolStream(){my(this)}resetChatScroll(){Kv(this)}scrollChatToTop(){qv(this)}scrollToBottom(e){Kv(this),Lv(this,!0,!!(e!=null&&e.smooth))}async loadAssistantIdentity(){await PJ(this)}applySettings(e){Vq(this,e)}applyLocalUserIdentity(e){Hq(this,e)}setTab(e){e===`filespace`&&(this.fileSpaceData=null,this.fileSpaceError=null),Xq(this,e),e!==`chat`&&(Wu.close(),this.setChatMobileControlsOpen(!1),this.sidebarOpen&&this.handleCloseSidebar()),this.navDrawerOpen=!1}setChatMobileControlsOpen(e,t){if(e){this.chatMobileControlsTrigger=(t==null?void 0:t.trigger)??this.chatMobileControlsTrigger,this.chatMobileControlsOpen=!0;return}let n=t!=null&&t.restoreFocus?this.chatMobileControlsTrigger:null;this.chatMobileControlsOpen=!1,this.chatMobileControlsTrigger=null,!(!(n instanceof HTMLElement)||!n.isConnected)&&requestAnimationFrame(()=>{n.isConnected&&n.focus()})}setTheme(e,t){Qq(this,e,t),this.themeOrder=this.buildThemeOrder(e)}setThemeMode(e,t){$q(this,e,t)}async loadDesktopSystemSettings(){let e=window.__SEALCLAW_DESKTOP__;if(!(e!=null&&e.getSystemSettings)){this.systemSettingsLoading=!1;return}try{var t;let n=await e.getSystemSettings();this.systemAutoLaunch=n.autoLaunch,await((t=e.setPreventSleep)==null?void 0:t.call(e,this.settings.preventSleep))}catch(e){Y.error(`读取系统设置失败`,{description:e instanceof Error?e.message:String(e)})}finally{this.systemSettingsLoading=!1}}async setSystemAutoLaunch(e){var t;let n=(t=window.__SEALCLAW_DESKTOP__)==null?void 0:t.setAutoLaunch;if(!(!n||this.systemSettingsBusy)){this.systemSettingsBusy=!0;try{this.systemAutoLaunch=await n(e)}catch(e){Y.error(`设置开机自启动失败`,{description:e instanceof Error?e.message:String(e)})}finally{this.systemSettingsBusy=!1}}}async setPreventSleep(e){var t;let n=(t=window.__SEALCLAW_DESKTOP__)==null?void 0:t.setPreventSleep;if(!(!n||this.systemSettingsBusy)){this.systemSettingsBusy=!0;try{let t=await n(e);this.applySettings({...this.settings,preventSleep:t})}catch(e){Y.error(`设置任务运行时阻止休眠失败`,{description:e instanceof Error?e.message:String(e)})}finally{this.systemSettingsBusy=!1}}}async loadIdentitySettings(e=!1){let t=ooe(this,e);this.requestUpdate(),await t,this.requestUpdate()}async loadOutputRootSettings(e=!1){await uoe(this,e)}async selectOutputRootDirectory(){var e;let t=(e=window.__SEALCLAW_DESKTOP__)==null?void 0:e.selectDirectory;if(!t){Y.error(`目录选择不可用`,{description:`请在 SealSeek 桌面端中设置输出目录`});return}try{await doe(this,t)}catch(e){let t=e instanceof Error?e.message:String(e);Y.error(`选择目录失败`,{description:t})}}async saveOutputRootSettings(){try{await foe(this),Y.success(`已保存,新对话即可生效`)}catch(e){Y.error(`保存失败`,{description:e instanceof Error?e.message:String(e)})}}async saveIdentitySettings(){try{let e=soe(this);this.requestUpdate(),await e;let t=this.identitySettings.saved.model;if(`__draft__`in this.chatModelOverrides){let{[X_]:e,...t}=this.chatModelOverrides;this.chatModelOverrides=t}await L_(this,{includeGlobal:!0,includeUnknown:!0,showArchived:this.sessionsShowArchived}),t!==`auto`&&this.sessionsResult&&(this.sessionsResult={...this.sessionsResult,defaults:{...this.sessionsResult.defaults,model:t,modelProvider:null}}),Y.success(`已保存,新建对话即可生效`),this.loadAssistantIdentity()}catch(e){Y.error(`保存失败`,{description:e instanceof Error?e.message:String(e)})}finally{this.requestUpdate()}}syncDesktopTaskRunning(){var e,t;let n=(((e=this.sessionsResult)==null?void 0:e.sessions)??[]).filter(e=>e.hasActiveRun===!0||!!e.activeRunId||e.hasActiveSubagentRun===!0).map(e=>e.key),r=this.chatSending||!!this.chatRunId||this.chatStream!==null||n.length>0;if(r===this.desktopTaskRunning)return;this.desktopTaskRunning=r;let i=(t=window.__SEALCLAW_DESKTOP__)==null?void 0:t.setTaskRunning;if(!i)return;let a=()=>{this.desktopTaskRunning===r&&(this.desktopTaskRunning=null)};if(!r){i(!1).catch(a);return}i(!0,[this.chatSending&&`chatSending`,this.chatRunId&&`chatRunId=${this.chatRunId}`,this.chatStream!==null&&`chatStream`,n.length>0&&`sessions=${n.join(`,`)}`].filter(e=>!!e).join(`;`).slice(0,500)).catch(a)}setCustomThemeImportUrl(e){var t;this.customThemeImportUrl=e,((t=this.customThemeImportMessage)==null?void 0:t.kind)===`error`&&(this.customThemeImportMessage=null)}openCustomThemeImport(){this.customThemeImportExpanded=!0,this.customThemeImportFocusToken+=1,this.settings.customTheme||(this.customThemeImportSelectOnSuccess=!0)}async importCustomTheme(){if(!this.customThemeImportBusy){this.customThemeImportExpanded=!0,this.customThemeImportBusy=!0,this.customThemeImportMessage=null;try{let e=await ZF(this.customThemeImportUrl),t=this.theme===`custom`||!this.settings.customTheme||this.customThemeImportSelectOnSuccess;Vq(this,{...this.settings,theme:t?`custom`:this.settings.theme,customTheme:e}),this.themeOrder=this.buildThemeOrder(t?`custom`:this.theme),this.customThemeImportUrl=``,this.customThemeImportSelectOnSuccess=!1,this.customThemeImportMessage={kind:`success`,text:`Imported ${e.label}.`}}catch(e){this.customThemeImportMessage={kind:`error`,text:e instanceof Error?e.message:`Failed to import tweakcn theme.`}}finally{this.customThemeImportBusy=!1}}}clearCustomTheme(){let e=this.theme===`custom`?`claw`:this.theme;this.customThemeImportExpanded=!0,this.customThemeImportSelectOnSuccess=!1,Vq(this,{...this.settings,theme:e,customTheme:void 0}),this.themeOrder=this.buildThemeOrder(e),this.customThemeImportMessage={kind:`success`,text:`Cleared custom theme.`}}setBorderRadius(e){Vq(this,{...this.settings,borderRadius:e}),this.requestUpdate()}switchSessionFromHistory(e){jQ(this,e,{skipUrlSync:!0})}announceSessionSwitch(e,t){let n=++this.sessionSwitchNoticeSeq;this.sessionSwitchNoticeTimer!==null&&window.clearTimeout(this.sessionSwitchNoticeTimer),this.sessionSwitchFlashTimer!==null&&window.clearTimeout(this.sessionSwitchFlashTimer),this.sessionSwitchNotice={id:n,text:`已切换到 ${t}`},this.sessionSwitchFlashKey=e,this.sessionSwitchFlashTimer=window.setTimeout(()=>{var e;((e=this.sessionSwitchNotice)==null?void 0:e.id)===n&&(this.sessionSwitchFlashKey=null),this.sessionSwitchFlashTimer=null},200),this.sessionSwitchNoticeTimer=window.setTimeout(()=>{var e;((e=this.sessionSwitchNotice)==null?void 0:e.id)===n&&(this.sessionSwitchNotice=null),this.sessionSwitchNoticeTimer=null},2800)}buildThemeOrder(e){return[e,...[...tI].filter(t=>t!==e)]}async loadOverview(e){await yJ(this,e)}async loadCron(){await TJ(this)}async handleAbortChat(){await HE(this)}async stopWorkspaceBrowserAiOperation(){var e,t;let n=this.sessionKey;this.workspaceBrowserState.aiActive=!1,this.requestUpdate(),(e=window.sealclawElectron)==null||(t=e.cancelWorkspaceBrowserOperation)==null||t.call(e,n),await lT(this)}handleChatDraftChange(e){Jb(this,e)}handleChatInputHistoryKey(e){return Qb(this,e)}resetChatInputHistoryNavigation(){qb(this)}removeQueuedMessage(e){eD(this,e),this.editingQueueItemId===e&&(this.editingQueueItemId=null)}resumeChatQueue(){nD(this)}async retryQueuedMessage(e){await rD(this,e)}editQueuedMessage(e,t){iD(this,e,t),this.editingQueueItemId=null}reorderQueuedMessages(e,t){aD(this,e,t)}async handleSendChat(e,t){let n=(e??this.chatMessage).trim();if(!await AQ(this,n))return!1;if(this.client)try{await R9(this.client,{ensureGateway:!0})}catch(e){console.error(`[sealclaw] xicheng-bi.token.sync failed`,e)}return sD(this,e,t)}async regenerateLastChat(){await mD(this)}async viewFullChatMessage(e){await qw(this,e)}async toggleRealtimeTalk(){if(this.realtimeTalkSession)if(this.realtimeTalkStatus===`error`)this.realtimeTalkSession.stop(),this.realtimeTalkSession=null;else{this.realtimeTalkSession.stop(),this.realtimeTalkSession=null,this.realtimeTalkActive=!1,this.realtimeTalkStatus=`idle`,this.realtimeTalkDetail=null,this.realtimeTalkTranscript=null;return}if(!this.client||!this.connected){this.lastError=`Gateway not connected`;return}this.realtimeTalkActive=!0,this.realtimeTalkStatus=`connecting`,this.realtimeTalkDetail=null,this.realtimeTalkTranscript=null;let e=new wce(this.client,this.sessionKey,{onStatus:(e,t)=>{this.realtimeTalkStatus=e,this.realtimeTalkDetail=t??null,(e===`idle`||e===`error`)&&(this.realtimeTalkActive=e!==`idle`)},onTranscript:e=>{this.realtimeTalkTranscript=`${e.role===`user`?`你`:`万能玺虾`}: ${e.text}`}});this.realtimeTalkSession=e;try{await e.start()}catch(t){e.stop(),this.realtimeTalkSession===e&&(this.realtimeTalkSession=null),this.realtimeTalkActive=!1,this.realtimeTalkStatus=`error`,this.realtimeTalkDetail=t instanceof Error?t.message:String(t),this.lastError=this.realtimeTalkDetail}}async steerQueuedChatMessage(e){await QE(this,e)}async handleWhatsAppStart(e){await _ee(this,e)}async handleWhatsAppWait(){await vee(this)}async handleWhatsAppLogout(){await yee(this)}async handleChannelConfigSave(){await bee(this)}async handleChannelConfigReload(){await xee(this)}handleNostrProfileEdit(e,t){Fm(this,e,t)}handleNostrProfileCancel(){Im(this)}handleNostrProfileFieldChange(e,t){Lm(this,e,t)}async handleNostrProfileSave(){await zm(this)}async handleNostrProfileImport(){await Bm(this)}handleNostrProfileToggleAdvanced(){Rm(this)}async handleExecApprovalDecision(e,t){let n=UJ(this.execApprovalQueue,t);if(!(!n||!this.client||this.execApprovalBusy)){this.execApprovalBusy=!0,this.execApprovalError=null;try{let t=n.kind===`plugin`?`plugin.approval.resolve`:`exec.approval.resolve`;await this.client.request(t,{id:n.id,decision:e}),this.execApprovalQueue=this.execApprovalQueue.filter(e=>e.id!==n.id)}catch(e){this.execApprovalError=`Approval failed: ${String(e)}`}finally{this.execApprovalBusy=!1}}}handleInteractiveFormDraftChange(e,t){this.interactiveFormDrafts={...this.interactiveFormDrafts,[e]:t},this.interactiveFormError=null}async handleInteractiveFormResolve(e,t){let n=this.interactiveFormQueue.find(t=>t.id===e);if(!(!n||!this.client||this.interactiveFormBusyId)){this.interactiveFormBusyId=e,this.interactiveFormError=null;try{var r;await this.client.request(`chat.form.resolve`,{id:e,status:t,...t===`submitted`?{answers:((r=this.interactiveFormDrafts[e])==null?void 0:r.answers)??{}}:{}}),Nw(this,n.request.sessionKey),this.interactiveFormQueue=this.interactiveFormQueue.filter(t=>t.id!==e);let i={...this.interactiveFormDrafts};delete i[e],this.interactiveFormDrafts=i}catch(e){this.interactiveFormError=`Form submission failed: ${String(e)}`}finally{this.interactiveFormBusyId=null}}}handleGatewayUrlConfirm(){var e;let t=this.pendingGatewayUrl;if(!t)return;let n=((e=this.pendingGatewayToken)==null?void 0:e.trim())||``;this.pendingGatewayUrl=null,this.pendingGatewayToken=null,Vq(this,{...this.settings,gatewayUrl:t,token:n}),this.connect()}handleGatewayUrlCancel(){this.pendingGatewayUrl=null,this.pendingGatewayToken=null}handleOpenSidebar(e){this.sidebarCloseTimer!=null&&(window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=null),this.sidebarContent=e,this.sidebarError=null,this.sidebarOpen=!0}handleCloseSidebar(){this.sidebarOpen=!1,this.sidebarCloseTimer!=null&&window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=window.setTimeout(()=>{this.sidebarOpen||(this.sidebarContent=null,this.sidebarError=null,this.sidebarCloseTimer=null)},200)}handleSplitRatioChange(e){let t=Math.max(.4,Math.min(.7,e));this.splitRatio=t,this.applySettings({...this.settings,splitRatio:t})}handleFileTreeSplitRatioChange(e){let t=Math.max(.2,Math.min(.8,e));this.fileTreeSplitRatio=t,this.applySettings({...this.settings,fileTreeSplitRatio:t})}getUserUuidFromJwt(){let e=localStorage.getItem(`jwt`)??``;if(!e)return``;try{let t=e.split(`.`);if(t.length<2)return``;let n=t[1].replace(/-/g,`+`).replace(/_/g,`/`);for(;n.length%4;)n+=`=`;return JSON.parse(atob(n)).userUuid||``}catch{return``}}async initCreateApiKey(){try{var e,t;let n=this.getUserUuidFromJwt();this.configSnapshot||await sm(this);let r=await P({name:`default`});if(!((e=r.data)!=null&&e.key)){let e=(await ne()).data??[];for(let t of e)await re(t.id);r=await P({name:`default`})}let i=(t=r.data)==null?void 0:t.key,a=this.patchMcpServers();if(!i){await a;return}n&&localStorage.setItem(`sealclaw_user_uuid`,n),await this.loadSealclawModels(i),await a}catch(e){console.error(`[sealclaw] initCreateApiKey error:`,e)}}patchMcpServers(){if(this.mcpPatchQueued=!0,this.mcpPatchInFlight)return this.mcpPatchInFlight;let e=this.flushMcpServerPatches();return this.mcpPatchInFlight=e,e.then(()=>{this.mcpPatchInFlight===e&&(this.mcpPatchInFlight=null)}),e}async flushMcpServerPatches(){try{for(;this.mcpPatchQueued;){if(this.mcpPatchQueued=!1,!this.client||!this.configSnapshot)return;let e=this.client;await sY({request:(t,n)=>e.request(t,n),reload:()=>sm(this),getBaseHash:()=>{var e;return(e=this.configSnapshot)==null?void 0:e.hash},jwt:iY(),getConfig:()=>{var e;return(e=this.configSnapshot)==null?void 0:e.config}})&&await sm(this)}}catch(e){console.error(`[sealclaw] patchMcpServers failed`,e)}}async loadSealclawModels(e){try{let t=(await ie(e)).data??[];if(t.length===0){console.warn(`[sealclaw] /models returned empty; keeping existing catalog`);return}if(!this.client){console.warn(`[sealclaw] client not ready`);return}await this.client.request(`sealseek.models.sync`,{baseUrl:`https://gateway.sealseek.cn/api/sealclaw/v1`,...e?{apiKey:e}:{},models:t}),this.chatModelCatalog=await bT(this.client),await _D(this,{scheduleScroll:!1,force:!0})}catch(e){console.error(`[sealclaw] sealseek.models.sync failed`,e)}}async loadApiKeys(){try{let e=await ne();e.data&&(this.apiKeys=e.data)}catch{}}async initWebPushState(){let e=`serviceWorker`in navigator&&`PushManager`in window&&`Notification`in window;if(this.webPushSupported=e,this.webPushPermission=e?Notification.permission:`unsupported`,e)try{let{getExistingSubscription:e}=await m4(async()=>{let{getExistingSubscription:e}=await import(`./push-subscription-Du7DZTU_.js`);return{getExistingSubscription:e}},[]),t=await e();this.webPushSubscribed=t!==null}catch{}}async reconcileWebPushState(){if(this.client)try{var e,t;let{getExistingSubscription:n}=await m4(async()=>{let{getExistingSubscription:e}=await import(`./push-subscription-Du7DZTU_.js`);return{getExistingSubscription:e}},[]),r=await n();if(!r)return;this.webPushSubscribed=!0;let i=r.toJSON();i.endpoint&&(e=i.keys)!=null&&e.p256dh&&(t=i.keys)!=null&&t.auth&&await this.client.request(`push.web.subscribe`,{endpoint:i.endpoint,keys:{p256dh:i.keys.p256dh,auth:i.keys.auth}})}catch{}}async handleWebPushSubscribe(){if(!(!this.client||this.webPushLoading)){this.webPushLoading=!0;try{let{subscribeToWebPush:e}=await m4(async()=>{let{subscribeToWebPush:e}=await import(`./push-subscription-Du7DZTU_.js`);return{subscribeToWebPush:e}},[]);await e(this.client),this.webPushSubscribed=!0,this.webPushPermission=Notification.permission}catch(e){this.lastError=String(e)}finally{this.webPushLoading=!1,`Notification`in window&&(this.webPushPermission=Notification.permission)}}}async handleWebPushUnsubscribe(){if(!(!this.client||this.webPushLoading)){this.webPushLoading=!0;try{let{unsubscribeFromWebPush:e}=await m4(async()=>{let{unsubscribeFromWebPush:e}=await import(`./push-subscription-Du7DZTU_.js`);return{unsubscribeFromWebPush:e}},[]);await e(this.client),this.webPushSubscribed=!1}catch(e){this.lastError=String(e)}finally{this.webPushLoading=!1}}}async handleWebPushTest(){if(this.client)try{let{sendTestWebPush:e}=await m4(async()=>{let{sendTestWebPush:e}=await import(`./push-subscription-Du7DZTU_.js`);return{sendTestWebPush:e}},[]);await e(this.client)}catch(e){this.lastError=String(e)}}render(){return Xse(this)}};Q([j()],$.prototype,`settings`,void 0),Q([j()],$.prototype,`password`,void 0),Q([j()],$.prototype,`loginShowGatewayToken`,void 0),Q([j()],$.prototype,`loginShowGatewayPassword`,void 0),Q([j()],$.prototype,`tab`,void 0),Q([j()],$.prototype,`onboarding`,void 0),Q([j()],$.prototype,`connected`,void 0),Q([j()],$.prototype,`backupOperation`,void 0),Q([j()],$.prototype,`theme`,void 0),Q([j()],$.prototype,`themeMode`,void 0),Q([j()],$.prototype,`themeResolved`,void 0),Q([j()],$.prototype,`systemAutoLaunch`,void 0),Q([j()],$.prototype,`systemSettingsLoading`,void 0),Q([j()],$.prototype,`systemSettingsBusy`,void 0),Q([j()],$.prototype,`themeOrder`,void 0),Q([j()],$.prototype,`customThemeImportUrl`,void 0),Q([j()],$.prototype,`customThemeImportBusy`,void 0),Q([j()],$.prototype,`customThemeImportMessage`,void 0),Q([j()],$.prototype,`customThemeImportExpanded`,void 0),Q([j()],$.prototype,`customThemeImportFocusToken`,void 0),Q([j()],$.prototype,`hello`,void 0),Q([j()],$.prototype,`lastError`,void 0),Q([j()],$.prototype,`lastErrorCode`,void 0),Q([j()],$.prototype,`eventLog`,void 0),Q([j()],$.prototype,`assistantName`,void 0),Q([j()],$.prototype,`assistantAvatar`,void 0),Q([j()],$.prototype,`assistantAvatarSource`,void 0),Q([j()],$.prototype,`assistantAvatarStatus`,void 0),Q([j()],$.prototype,`assistantAvatarReason`,void 0),Q([j()],$.prototype,`assistantAvatarUploadBusy`,void 0),Q([j()],$.prototype,`assistantAvatarUploadError`,void 0),Q([j()],$.prototype,`assistantAgentId`,void 0),Q([j()],$.prototype,`userName`,void 0),Q([j()],$.prototype,`userAvatar`,void 0),Q([j()],$.prototype,`localMediaPreviewRoots`,void 0),Q([j()],$.prototype,`embedSandboxMode`,void 0),Q([j()],$.prototype,`allowExternalEmbedUrls`,void 0),Q([j()],$.prototype,`chatMessageMaxWidth`,void 0),Q([j()],$.prototype,`serverVersion`,void 0),Q([j()],$.prototype,`sessionKey`,void 0),Q([j()],$.prototype,`chatLoading`,void 0),Q([j()],$.prototype,`chatSending`,void 0),Q([j()],$.prototype,`chatQueueActionInFlight`,void 0),Q([j()],$.prototype,`chatMessage`,void 0),Q([j()],$.prototype,`chatMessages`,void 0),Q([j()],$.prototype,`chatToolMessages`,void 0),Q([j()],$.prototype,`chatStreamSegments`,void 0),Q([j()],$.prototype,`chatStream`,void 0),Q([j()],$.prototype,`chatStreamStartedAt`,void 0),Q([j()],$.prototype,`chatStreamPausedAt`,void 0),Q([j()],$.prototype,`chatRunPhase`,void 0),Q([j()],$.prototype,`chatRunPhaseLastProgressAt`,void 0),Q([j()],$.prototype,`chatStreamTick`,void 0),Q([j()],$.prototype,`chatStreamLastDurationSec`,void 0),Q([j()],$.prototype,`chatStreamLastModel`,void 0),Q([j()],$.prototype,`chatStreamLastThinkingBlocks`,void 0),Q([j()],$.prototype,`chatStreamRevealLen`,void 0),Q([j()],$.prototype,`chatStreamRevealReasoningLen`,void 0),Q([j()],$.prototype,`chatRunId`,void 0),Q([j()],$.prototype,`chatHistoryHasMore`,void 0),Q([j()],$.prototype,`chatHistoryOldestCursor`,void 0),Q([j()],$.prototype,`chatHistoryLoadingEarlier`,void 0),Q([j()],$.prototype,`chatAbortingSessionKeys`,void 0),Q([j()],$.prototype,`chatSideResult`,void 0),Q([j()],$.prototype,`compactionStatus`,void 0),Q([j()],$.prototype,`compactionNotices`,void 0),Q([j()],$.prototype,`fallbackStatus`,void 0),Q([j()],$.prototype,`chatAvatarUrl`,void 0),Q([j()],$.prototype,`chatAvatarSource`,void 0),Q([j()],$.prototype,`chatAvatarStatus`,void 0),Q([j()],$.prototype,`chatAvatarReason`,void 0),Q([j()],$.prototype,`chatThinkingLevel`,void 0),Q([j()],$.prototype,`chatModelOverrides`,void 0),Q([j()],$.prototype,`chatModelsLoading`,void 0),Q([j()],$.prototype,`chatModelCatalog`,void 0),Q([j()],$.prototype,`sessionSwitchNotice`,void 0),Q([j()],$.prototype,`sessionSwitchFlashKey`,void 0),Q([j()],$.prototype,`chatQueue`,void 0),Q([j()],$.prototype,`chatQueueBySession`,void 0),Q([j()],$.prototype,`editingQueueItemId`,void 0),Q([j()],$.prototype,`chatComposerDraftsBySession`,void 0),Q([j()],$.prototype,`chatAttachments`,void 0),Q([j()],$.prototype,`chatKnowledgeRefs`,void 0),Q([j()],$.prototype,`chatBrowserRefs`,void 0),Q([j()],$.prototype,`realtimeTalkActive`,void 0),Q([j()],$.prototype,`realtimeTalkStatus`,void 0),Q([j()],$.prototype,`realtimeTalkDetail`,void 0),Q([j()],$.prototype,`realtimeTalkTranscript`,void 0),Q([j()],$.prototype,`skillStoreOpen`,void 0),Q([j()],$.prototype,`chatSkillStoreOpenBySession`,void 0),Q([j()],$.prototype,`storeSkills`,void 0),Q([j()],$.prototype,`storeSkillsLoading`,void 0),Q([j()],$.prototype,`storeItemLoading`,void 0),Q([j()],$.prototype,`storeItemError`,void 0),Q([j()],$.prototype,`chatManualRefreshInFlight`,void 0),Q([j()],$.prototype,`chatHeaderControlsHidden`,void 0),Q([j()],$.prototype,`chatMobileControlsOpen`,void 0),Q([j()],$.prototype,`navDrawerOpen`,void 0),Q([j()],$.prototype,`chatInputHistoryIndex`,void 0),Q([j()],$.prototype,`chatDraftMode`,void 0),Q([j()],$.prototype,`sidebarOpen`,void 0),Q([j()],$.prototype,`sidebarContent`,void 0),Q([j()],$.prototype,`sidebarError`,void 0),Q([j()],$.prototype,`sidebarEditingSessionKey`,void 0),Q([j()],$.prototype,`sidebarEditingSessionLabel`,void 0),Q([j()],$.prototype,`sidebarMoreMenuKey`,void 0),Q([j()],$.prototype,`sidebarMoreMenuPos`,void 0),Q([j()],$.prototype,`sidebarDeleteConfirmKey`,void 0),Q([j()],$.prototype,`sidebarDeleteLinkedJobs`,void 0),Q([j()],$.prototype,`sidebarDeleteLinkedJobsLoading`,void 0),Q([j()],$.prototype,`sidebarDeleteInFlight`,void 0),Q([j()],$.prototype,`sidebarDeleteError`,void 0),Q([j()],$.prototype,`sidebarCreatingGroup`,void 0),Q([j()],$.prototype,`sidebarEditingGroupId`,void 0),Q([j()],$.prototype,`sidebarEditingGroupLabel`,void 0),Q([j()],$.prototype,`sidebarGroupMoreMenuId`,void 0),Q([j()],$.prototype,`sidebarDeleteGroupConfirmId`,void 0),Q([j()],$.prototype,`sidebarMoveMenuKey`,void 0),Q([j()],$.prototype,`sidebarGroupVersion`,void 0),Q([j()],$.prototype,`splitRatio`,void 0),Q([j()],$.prototype,`nodesLoading`,void 0),Q([j()],$.prototype,`nodes`,void 0),Q([j()],$.prototype,`devicesLoading`,void 0),Q([j()],$.prototype,`devicesError`,void 0),Q([j()],$.prototype,`devicesList`,void 0),Q([j()],$.prototype,`execApprovalsLoading`,void 0),Q([j()],$.prototype,`execApprovalsSaving`,void 0),Q([j()],$.prototype,`execApprovalsDirty`,void 0),Q([j()],$.prototype,`execApprovalsSnapshot`,void 0),Q([j()],$.prototype,`execApprovalsForm`,void 0),Q([j()],$.prototype,`execApprovalsSelectedAgent`,void 0),Q([j()],$.prototype,`execApprovalsTarget`,void 0),Q([j()],$.prototype,`execApprovalsTargetNodeId`,void 0),Q([j()],$.prototype,`execApprovalQueue`,void 0),Q([j()],$.prototype,`execApprovalBusy`,void 0),Q([j()],$.prototype,`execApprovalError`,void 0),Q([j()],$.prototype,`interactiveFormQueue`,void 0),Q([j()],$.prototype,`interactiveFormDrafts`,void 0),Q([j()],$.prototype,`interactiveFormBusyId`,void 0),Q([j()],$.prototype,`interactiveFormError`,void 0),Q([j()],$.prototype,`pendingGatewayUrl`,void 0),Q([j()],$.prototype,`configLoading`,void 0),Q([j()],$.prototype,`configRaw`,void 0),Q([j()],$.prototype,`configRawOriginal`,void 0),Q([j()],$.prototype,`configValid`,void 0),Q([j()],$.prototype,`configIssues`,void 0),Q([j()],$.prototype,`configSaving`,void 0),Q([j()],$.prototype,`configApplying`,void 0),Q([j()],$.prototype,`updateRunning`,void 0),Q([j()],$.prototype,`applySessionKey`,void 0),Q([j()],$.prototype,`configSnapshot`,void 0),Q([j()],$.prototype,`configSchema`,void 0),Q([j()],$.prototype,`configSchemaVersion`,void 0),Q([j()],$.prototype,`configSchemaLoading`,void 0),Q([j()],$.prototype,`configUiHints`,void 0),Q([j()],$.prototype,`configForm`,void 0),Q([j()],$.prototype,`configFormOriginal`,void 0),Q([j()],$.prototype,`dreamingStatusLoading`,void 0),Q([j()],$.prototype,`dreamingStatusError`,void 0),Q([j()],$.prototype,`dreamingStatus`,void 0),Q([j()],$.prototype,`dreamingModeSaving`,void 0),Q([j()],$.prototype,`dreamingRestartConfirmOpen`,void 0),Q([j()],$.prototype,`dreamingRestartConfirmLoading`,void 0),Q([j()],$.prototype,`dreamingPendingEnabled`,void 0),Q([j()],$.prototype,`dreamDiaryLoading`,void 0),Q([j()],$.prototype,`dreamDiaryActionLoading`,void 0),Q([j()],$.prototype,`dreamDiaryActionMessage`,void 0),Q([j()],$.prototype,`dreamDiaryActionArchivePath`,void 0),Q([j()],$.prototype,`dreamDiaryError`,void 0),Q([j()],$.prototype,`dreamDiaryPath`,void 0),Q([j()],$.prototype,`dreamDiaryContent`,void 0),Q([j()],$.prototype,`wikiImportInsightsLoading`,void 0),Q([j()],$.prototype,`wikiImportInsightsError`,void 0),Q([j()],$.prototype,`wikiImportInsights`,void 0),Q([j()],$.prototype,`wikiMemoryPalaceLoading`,void 0),Q([j()],$.prototype,`wikiMemoryPalaceError`,void 0),Q([j()],$.prototype,`wikiMemoryPalace`,void 0),Q([j()],$.prototype,`configFormDirty`,void 0),Q([j()],$.prototype,`configSettingsMode`,void 0),Q([j()],$.prototype,`settingsActiveMenu`,void 0),Q([j()],$.prototype,`identitySettings`,void 0),Q([j()],$.prototype,`outputRootSettings`,void 0),Q([j()],$.prototype,`configFormMode`,void 0),Q([j()],$.prototype,`configSearchQuery`,void 0),Q([j()],$.prototype,`configActiveSection`,void 0),Q([j()],$.prototype,`configActiveSubsection`,void 0),Q([j()],$.prototype,`pendingUpdateExpectedVersion`,void 0),Q([j()],$.prototype,`updateStatusBanner`,void 0),Q([j()],$.prototype,`communicationsFormMode`,void 0),Q([j()],$.prototype,`communicationsSearchQuery`,void 0),Q([j()],$.prototype,`communicationsActiveSection`,void 0),Q([j()],$.prototype,`communicationsActiveSubsection`,void 0),Q([j()],$.prototype,`appearanceFormMode`,void 0),Q([j()],$.prototype,`appearanceSearchQuery`,void 0),Q([j()],$.prototype,`appearanceActiveSection`,void 0),Q([j()],$.prototype,`appearanceActiveSubsection`,void 0),Q([j()],$.prototype,`automationFormMode`,void 0),Q([j()],$.prototype,`automationSearchQuery`,void 0),Q([j()],$.prototype,`automationActiveSection`,void 0),Q([j()],$.prototype,`automationActiveSubsection`,void 0),Q([j()],$.prototype,`pluginsTab`,void 0),Q([j()],$.prototype,`pluginsSelectedChannel`,void 0),Q([j()],$.prototype,`officeCliModalOpen`,void 0),Q([j()],$.prototype,`officeCliStatusLoading`,void 0),Q([j()],$.prototype,`officeCliStatus`,void 0),Q([j()],$.prototype,`xichengBiModalOpen`,void 0),Q([j()],$.prototype,`xichengBiStatusLoading`,void 0),Q([j()],$.prototype,`xichengBiStatus`,void 0),Q([j()],$.prototype,`xichengBiShopsLoading`,void 0),Q([j()],$.prototype,`xichengBiShops`,void 0),Q([j()],$.prototype,`xichengBiShopsError`,void 0),Q([j()],$.prototype,`imChannelsSelectedChannel`,void 0),Q([j()],$.prototype,`infrastructureFormMode`,void 0),Q([j()],$.prototype,`infrastructureSearchQuery`,void 0),Q([j()],$.prototype,`infrastructureActiveSection`,void 0),Q([j()],$.prototype,`infrastructureActiveSubsection`,void 0),Q([j()],$.prototype,`aiAgentsFormMode`,void 0),Q([j()],$.prototype,`aiAgentsSearchQuery`,void 0),Q([j()],$.prototype,`aiAgentsActiveSection`,void 0),Q([j()],$.prototype,`aiAgentsActiveSubsection`,void 0),Q([j()],$.prototype,`channelsLoading`,void 0),Q([j()],$.prototype,`channelsSnapshot`,void 0),Q([j()],$.prototype,`channelsError`,void 0),Q([j()],$.prototype,`channelsLastSuccess`,void 0),Q([j()],$.prototype,`whatsappLoginMessage`,void 0),Q([j()],$.prototype,`whatsappLoginQrDataUrl`,void 0),Q([j()],$.prototype,`whatsappLoginConnected`,void 0),Q([j()],$.prototype,`whatsappBusy`,void 0),Q([j()],$.prototype,`nostrProfileFormState`,void 0),Q([j()],$.prototype,`nostrProfileAccountId`,void 0),Q([j()],$.prototype,`presenceLoading`,void 0),Q([j()],$.prototype,`presenceEntries`,void 0),Q([j()],$.prototype,`presenceError`,void 0),Q([j()],$.prototype,`presenceStatus`,void 0),Q([j()],$.prototype,`agentsLoading`,void 0),Q([j()],$.prototype,`agentsList`,void 0),Q([j()],$.prototype,`agentsError`,void 0),Q([j()],$.prototype,`agentsSelectedId`,void 0),Q([j()],$.prototype,`toolsCatalogLoading`,void 0),Q([j()],$.prototype,`toolsCatalogError`,void 0),Q([j()],$.prototype,`toolsCatalogResult`,void 0),Q([j()],$.prototype,`toolsEffectiveLoading`,void 0),Q([j()],$.prototype,`toolsEffectiveLoadingKey`,void 0),Q([j()],$.prototype,`toolsEffectiveResultKey`,void 0),Q([j()],$.prototype,`toolsEffectiveError`,void 0),Q([j()],$.prototype,`toolsEffectiveResult`,void 0),Q([j()],$.prototype,`agentsPanel`,void 0),Q([j()],$.prototype,`agentFilesLoading`,void 0),Q([j()],$.prototype,`agentFilesError`,void 0),Q([j()],$.prototype,`agentFilesList`,void 0),Q([j()],$.prototype,`agentFileContents`,void 0),Q([j()],$.prototype,`agentFileDrafts`,void 0),Q([j()],$.prototype,`agentFileActive`,void 0),Q([j()],$.prototype,`agentFileSaving`,void 0),Q([j()],$.prototype,`agentIdentityLoading`,void 0),Q([j()],$.prototype,`agentIdentityError`,void 0),Q([j()],$.prototype,`agentIdentityById`,void 0),Q([j()],$.prototype,`agentSkillsLoading`,void 0),Q([j()],$.prototype,`agentSkillsError`,void 0),Q([j()],$.prototype,`agentSkillsReport`,void 0),Q([j()],$.prototype,`agentSkillsAgentId`,void 0),Q([j()],$.prototype,`sessionsLoading`,void 0),Q([j()],$.prototype,`sessionsResult`,void 0),Q([j()],$.prototype,`sessionsError`,void 0),Q([j()],$.prototype,`contextWeight`,void 0),Q([j()],$.prototype,`contextWeightKey`,void 0),Q([j()],$.prototype,`contextWeightLoading`,void 0),Q([j()],$.prototype,`sessionsFilterActive`,void 0),Q([j()],$.prototype,`sessionsFilterLimit`,void 0),Q([j()],$.prototype,`sessionsIncludeGlobal`,void 0),Q([j()],$.prototype,`sessionsIncludeUnknown`,void 0),Q([j()],$.prototype,`sessionsShowArchived`,void 0),Q([j()],$.prototype,`sessionsFiltersCollapsed`,void 0),Q([j()],$.prototype,`sessionsHideCron`,void 0),Q([j()],$.prototype,`sessionsSearchQuery`,void 0),Q([j()],$.prototype,`sessionsSortColumn`,void 0),Q([j()],$.prototype,`sessionsSortDir`,void 0),Q([j()],$.prototype,`sessionsPage`,void 0),Q([j()],$.prototype,`sessionsPageSize`,void 0),Q([j()],$.prototype,`sessionsSelectedKeys`,void 0),Q([j()],$.prototype,`sessionsExpandedCheckpointKey`,void 0),Q([j()],$.prototype,`sessionsCheckpointItemsByKey`,void 0),Q([j()],$.prototype,`sessionsCheckpointLoadingKey`,void 0),Q([j()],$.prototype,`sessionsCheckpointBusyKey`,void 0),Q([j()],$.prototype,`sessionsCheckpointErrorByKey`,void 0),Q([j()],$.prototype,`usageLoading`,void 0),Q([j()],$.prototype,`usageResult`,void 0),Q([j()],$.prototype,`usageCostSummary`,void 0),Q([j()],$.prototype,`usageError`,void 0),Q([j()],$.prototype,`usageStartDate`,void 0),Q([j()],$.prototype,`usageEndDate`,void 0),Q([j()],$.prototype,`usageSelectedSessions`,void 0),Q([j()],$.prototype,`usageSelectedDays`,void 0),Q([j()],$.prototype,`usageSelectedHours`,void 0),Q([j()],$.prototype,`usageChartMode`,void 0),Q([j()],$.prototype,`usageDailyChartMode`,void 0),Q([j()],$.prototype,`usageTimeSeriesMode`,void 0),Q([j()],$.prototype,`usageTimeSeriesBreakdownMode`,void 0),Q([j()],$.prototype,`usageTimeSeries`,void 0),Q([j()],$.prototype,`usageTimeSeriesLoading`,void 0),Q([j()],$.prototype,`usageTimeSeriesCursorStart`,void 0),Q([j()],$.prototype,`usageTimeSeriesCursorEnd`,void 0),Q([j()],$.prototype,`usageSessionLogs`,void 0),Q([j()],$.prototype,`usageSessionLogsLoading`,void 0),Q([j()],$.prototype,`usageSessionLogsExpanded`,void 0),Q([j()],$.prototype,`usageQuery`,void 0),Q([j()],$.prototype,`usageQueryDraft`,void 0),Q([j()],$.prototype,`usageSessionSort`,void 0),Q([j()],$.prototype,`usageSessionSortDir`,void 0),Q([j()],$.prototype,`usageRecentSessions`,void 0),Q([j()],$.prototype,`usageTimeZone`,void 0),Q([j()],$.prototype,`usageContextExpanded`,void 0),Q([j()],$.prototype,`usageHeaderPinned`,void 0),Q([j()],$.prototype,`usageSessionsTab`,void 0),Q([j()],$.prototype,`usageVisibleColumns`,void 0),Q([j()],$.prototype,`usageLogFilterRoles`,void 0),Q([j()],$.prototype,`usageLogFilterTools`,void 0),Q([j()],$.prototype,`usageLogFilterHasTools`,void 0),Q([j()],$.prototype,`usageLogFilterQuery`,void 0),Q([j()],$.prototype,`activePanelId`,void 0),Q([j()],$.prototype,`sidebarStatusPopoverOpen`,void 0),Q([j()],$.prototype,`diagnosticsSnapshot`,void 0),Q([j()],$.prototype,`diagnosticsNetwork`,void 0),Q([j()],$.prototype,`diagnosticsRuntimes`,void 0),Q([j()],$.prototype,`diagnosticsRuntimeInstall`,void 0),Q([j()],$.prototype,`diagnosticsChecking`,void 0),Q([j()],$.prototype,`diagnosticsBusy`,void 0),Q([j()],$.prototype,`fileTreeLoading`,void 0),Q([j()],$.prototype,`fileTreeError`,void 0),Q([j()],$.prototype,`fileTreeResult`,void 0),Q([j()],$.prototype,`fileTreeSessionId`,void 0),Q([j()],$.prototype,`fileTreeExpandedDirs`,void 0),Q([j()],$.prototype,`fileTreeDirChildren`,void 0),Q([j()],$.prototype,`fileTreeDirLoading`,void 0),Q([j()],$.prototype,`fileTreeRefFiles`,void 0),Q([j()],$.prototype,`fileTreeRefLoading`,void 0),Q([j()],$.prototype,`fileTreeSplitRatio`,void 0),Q([j()],$.prototype,`fileTreeOutputCollapsed`,void 0),Q([j()],$.prototype,`fileTreeRefCollapsed`,void 0),Q([j()],$.prototype,`overviewOutputFilter`,void 0),Q([j()],$.prototype,`overviewRefFilter`,void 0),Q([j()],$.prototype,`cnChannelsLoading`,void 0),Q([j()],$.prototype,`cnChannelsData`,void 0),Q([j()],$.prototype,`cnChannelsError`,void 0),Q([j()],$.prototype,`cnConnecting`,void 0),Q([j()],$.prototype,`cnQrcodeChannel`,void 0),Q([j()],$.prototype,`cnQrcodeImg`,void 0),Q([j()],$.prototype,`cnQrcodeToken`,void 0),Q([j()],$.prototype,`cnQrcodeOpenUrl`,void 0),Q([j()],$.prototype,`cnQrcodeLoading`,void 0),Q([j()],$.prototype,`cnFeishuAuthorizing`,void 0),Q([j()],$.prototype,`cnFeishuQrCancelled`,void 0),Q([j()],$.prototype,`cnFeishuCliStatusLoading`,void 0),Q([j()],$.prototype,`cnFeishuCliStatus`,void 0),Q([j()],$.prototype,`cnDingtalkAuthorizing`,void 0),Q([j()],$.prototype,`cnDingtalkCliStatusLoading`,void 0),Q([j()],$.prototype,`cnDingtalkCliStatus`,void 0),Q([j()],$.prototype,`skillCenterTab`,void 0),Q([j()],$.prototype,`centerSegment`,void 0),Q([j()],$.prototype,`skillCenterCategory`,void 0),Q([j()],$.prototype,`skillCenterSearch`,void 0),Q([j()],$.prototype,`mySkillsSearch`,void 0),Q([j()],$.prototype,`mySkillsSortOrder`,void 0),Q([j()],$.prototype,`skillCenterCategories`,void 0),Q([j()],$.prototype,`skillCenterCategoriesLoading`,void 0),Q([j()],$.prototype,`skillCenterItemBusy`,void 0),Q([j()],$.prototype,`skillCenterItemError`,void 0),Q([j()],$.prototype,`enterpriseSkills`,void 0),Q([j()],$.prototype,`enterpriseSkillsLoading`,void 0),Q([j()],$.prototype,`enterpriseInstallLoading`,void 0),Q([j()],$.prototype,`enterpriseError`,void 0),Q([j()],$.prototype,`publishDialogOpen`,void 0),Q([j()],$.prototype,`publishTarget`,void 0),Q([j()],$.prototype,`publishingSkill`,void 0),Q([j()],$.prototype,`publishLoading`,void 0),Q([j()],$.prototype,`publishError`,void 0),Q([j()],$.prototype,`publishSuccess`,void 0),Q([j()],$.prototype,`mySharesForMatching`,void 0),Q([j()],$.prototype,`mySharesLoaded`,void 0),Q([j()],$.prototype,`syncVersionMap`,void 0),Q([j()],$.prototype,`syncVersionByIdMap`,void 0),Q([j()],$.prototype,`shareDialogSkill`,void 0),Q([j()],$.prototype,`shareDialogPhase`,void 0),Q([j()],$.prototype,`shareDialogVersion`,void 0),Q([j()],$.prototype,`shareDialogResult`,void 0),Q([j()],$.prototype,`shareDialogError`,void 0),Q([j()],$.prototype,`shareDialogExisting`,void 0),Q([j()],$.prototype,`importDialogOpen`,void 0),Q([j()],$.prototype,`importShareCode`,void 0),Q([j()],$.prototype,`importPreview`,void 0),Q([j()],$.prototype,`importPreviewLoading`,void 0),Q([j()],$.prototype,`importClaimLoading`,void 0),Q([j()],$.prototype,`importClaimResult`,void 0),Q([j()],$.prototype,`importError`,void 0),Q([j()],$.prototype,`skillPublishState`,void 0),Q([j()],$.prototype,`skillGroups`,void 0),Q([j()],$.prototype,`skillGroupMap`,void 0),Q([j()],$.prototype,`selectedSkillGroupId`,void 0),Q([j()],$.prototype,`creatingSkillGroup`,void 0),Q([j()],$.prototype,`renamingSkillGroupId`,void 0),Q([j()],$.prototype,`deleteSkillGroupTarget`,void 0),Q([j()],$.prototype,`fileSpaceLoading`,void 0),Q([j()],$.prototype,`fileSpaceError`,void 0),Q([j()],$.prototype,`fileSpaceData`,void 0),Q([j()],$.prototype,`fileSpaceSearch`,void 0),Q([j()],$.prototype,`fileSpaceCollapsed`,void 0),Q([j()],$.prototype,`workspaceBrowserState`,void 0),Q([j()],$.prototype,`workspaceBrowserStateBySession`,void 0),Q([j()],$.prototype,`workspaceBrowserGlobal`,void 0),Q([j()],$.prototype,`cronLoading`,void 0),Q([j()],$.prototype,`cronJobsLoaded`,void 0),Q([j()],$.prototype,`cronQuickCreateOpen`,void 0),Q([j()],$.prototype,`cronQuickCreateStep`,void 0),Q([j()],$.prototype,`cronQuickCreateDraft`,void 0),Q([j()],$.prototype,`cronJobsLoadingMore`,void 0),Q([j()],$.prototype,`cronJobs`,void 0),Q([j()],$.prototype,`cronResultSessionKeys`,void 0),Q([j()],$.prototype,`cronResultSessionJobs`,void 0),Q([j()],$.prototype,`cronJobsTotal`,void 0),Q([j()],$.prototype,`cronJobsHasMore`,void 0),Q([j()],$.prototype,`cronJobsNextOffset`,void 0),Q([j()],$.prototype,`cronJobsLimit`,void 0),Q([j()],$.prototype,`cronJobsQuery`,void 0),Q([j()],$.prototype,`cronJobsEnabledFilter`,void 0),Q([j()],$.prototype,`cronJobsScheduleKindFilter`,void 0),Q([j()],$.prototype,`cronJobsLastStatusFilter`,void 0),Q([j()],$.prototype,`cronJobsSortBy`,void 0),Q([j()],$.prototype,`cronJobsSortDir`,void 0),Q([j()],$.prototype,`cronStatus`,void 0),Q([j()],$.prototype,`cronError`,void 0),Q([j()],$.prototype,`cronForm`,void 0),Q([j()],$.prototype,`cronFormCollapsed`,void 0),Q([j()],$.prototype,`cronFieldErrors`,void 0),Q([j()],$.prototype,`cronEditingJobId`,void 0),Q([j()],$.prototype,`cronRunsJobId`,void 0),Q([j()],$.prototype,`cronRunsLoadingMore`,void 0),Q([j()],$.prototype,`cronRuns`,void 0),Q([j()],$.prototype,`cronRunsTotal`,void 0),Q([j()],$.prototype,`cronRunsHasMore`,void 0),Q([j()],$.prototype,`cronRunsNextOffset`,void 0),Q([j()],$.prototype,`cronRunsLimit`,void 0),Q([j()],$.prototype,`cronRunsScope`,void 0),Q([j()],$.prototype,`cronRunsStatuses`,void 0),Q([j()],$.prototype,`cronRunsDeliveryStatuses`,void 0),Q([j()],$.prototype,`cronRunsStatusFilter`,void 0),Q([j()],$.prototype,`cronRunsQuery`,void 0),Q([j()],$.prototype,`cronRunsSortDir`,void 0),Q([j()],$.prototype,`cronModelSuggestions`,void 0),Q([j()],$.prototype,`cronBusy`,void 0),Q([j()],$.prototype,`cronTasksView`,void 0),Q([j()],$.prototype,`cronTaskDialogOpen`,void 0),Q([j()],$.prototype,`cronTaskDialogMode`,void 0),Q([j()],$.prototype,`cronTaskMenuJobId`,void 0),Q([j()],$.prototype,`cronTaskDeleteConfirmJobId`,void 0),Q([j()],$.prototype,`cronTaskSessionQuery`,void 0),Q([j()],$.prototype,`skillDropdownOpen`,void 0),Q([j()],$.prototype,`cronTaskHistoryJobFilter`,void 0),Q([j()],$.prototype,`cronTaskHistoryDateFilter`,void 0),Q([j()],$.prototype,`updateAvailable`,void 0),Q([j()],$.prototype,`attentionItems`,void 0),Q([j()],$.prototype,`paletteOpen`,void 0),Q([j()],$.prototype,`sessionSwitcherOpen`,void 0),Q([j()],$.prototype,`paletteQuery`,void 0),Q([j()],$.prototype,`paletteActiveIndex`,void 0),Q([j()],$.prototype,`overviewShowGatewayToken`,void 0),Q([j()],$.prototype,`overviewShowGatewayPassword`,void 0),Q([j()],$.prototype,`overviewLogLines`,void 0),Q([j()],$.prototype,`overviewLogCursor`,void 0),Q([j()],$.prototype,`skillsLoading`,void 0),Q([j()],$.prototype,`skillsReport`,void 0),Q([j()],$.prototype,`skillsError`,void 0),Q([j()],$.prototype,`skillsFilter`,void 0),Q([j()],$.prototype,`skillsStatusFilter`,void 0),Q([j()],$.prototype,`skillEdits`,void 0),Q([j()],$.prototype,`skillsBusyKey`,void 0),Q([j()],$.prototype,`skillMessages`,void 0),Q([j()],$.prototype,`skillsDetailKey`,void 0),Q([j()],$.prototype,`healthLoading`,void 0),Q([j()],$.prototype,`healthResult`,void 0),Q([j()],$.prototype,`healthError`,void 0),Q([j()],$.prototype,`modelAuthStatusLoading`,void 0),Q([j()],$.prototype,`modelAuthStatusResult`,void 0),Q([j()],$.prototype,`modelAuthStatusError`,void 0),Q([j()],$.prototype,`debugLoading`,void 0),Q([j()],$.prototype,`debugStatus`,void 0),Q([j()],$.prototype,`debugHealth`,void 0),Q([j()],$.prototype,`debugModels`,void 0),Q([j()],$.prototype,`debugHeartbeat`,void 0),Q([j()],$.prototype,`debugCallMethod`,void 0),Q([j()],$.prototype,`debugCallParams`,void 0),Q([j()],$.prototype,`debugCallResult`,void 0),Q([j()],$.prototype,`debugCallError`,void 0),Q([j()],$.prototype,`apiKeys`,void 0),Q([j()],$.prototype,`webPushSupported`,void 0),Q([j()],$.prototype,`webPushPermission`,void 0),Q([j()],$.prototype,`webPushSubscribed`,void 0),Q([j()],$.prototype,`webPushLoading`,void 0),Q([j()],$.prototype,`logsLoading`,void 0),Q([j()],$.prototype,`logsError`,void 0),Q([j()],$.prototype,`logsFile`,void 0),Q([j()],$.prototype,`logsEntries`,void 0),Q([j()],$.prototype,`logsFilterText`,void 0),Q([j()],$.prototype,`logsLevelFilters`,void 0),Q([j()],$.prototype,`logsAutoFollow`,void 0),Q([j()],$.prototype,`logsTruncated`,void 0),Q([j()],$.prototype,`logsCursor`,void 0),Q([j()],$.prototype,`logsLastFetchAt`,void 0),Q([j()],$.prototype,`logsLimit`,void 0),Q([j()],$.prototype,`logsMaxBytes`,void 0),Q([j()],$.prototype,`logsAtBottom`,void 0),Q([j()],$.prototype,`chatNewMessagesBelow`,void 0),Q([j()],$.prototype,`chatTocActiveIndex`,void 0),Q([j()],$.prototype,`shellWidthPx`,void 0),customElements.get(`openclaw-app`)||customElements.define(`openclaw-app`,$);var Z9=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=typeof window<`u`?window.proxy||window:{};e.qiankunWindow=t,e.renderWithQiankun=function(e){t!=null&&t.__POWERED_BY_QIANKUN__&&(window.moudleQiankunAppLifeCycles||(window.moudleQiankunAppLifeCycles={}),t.qiankunName&&(window.moudleQiankunAppLifeCycles[t.qiankunName]=e))}}))(),Q9=`/sealclaw`;function Yce(){if(`serviceWorker`in navigator){{let e=new URL(`sw.js`,new URL(`/sealclaw/`,window.location.href));navigator.serviceWorker.register(e).catch(()=>{});return}navigator.serviceWorker.getRegistrations().then(e=>{for(let t of e)t.unregister()})}}var $9=null;(0,Z9.renderWithQiankun)({bootstrap(){return Promise.resolve()},mount(e){window.__OPENCLAW_CONTROL_UI_BASE_PATH__=Q9;let t=(e==null?void 0:e.container)??document.body,n=t.querySelector(`openclaw-app`);return $9=n??document.createElement(`openclaw-app`),n||t.appendChild($9),$9.basePath=Q9,Promise.resolve()},unmount(){return $9==null||$9.remove(),$9=null,Promise.resolve()},update(){return Promise.resolve()}}),Z9.qiankunWindow.__POWERED_BY_QIANKUN__||Yce();export{Id as $,bE as A,EE as B,aL as C,pE as D,yE as E,Bte as F,AS as G,sE as H,xE as I,kh as J,K_ as K,CE as L,Gte as M,cE as N,SE as O,TE as P,Lp as Q,DE as R,eK as S,XO as T,oE as U,Kte as V,WT as W,Ym as X,$m as Y,jm as Z,o$ as _,c5 as a,_l as at,bY as b,Oae as c,vc as ct,Eae as d,Cd as et,Dae as f,J0 as g,m4 as h,s5 as i,vl as it,Wte as j,Hte as k,a5 as l,K as lt,F6 as m,R9 as n,Ml as nt,Aae as o,gl as ot,Z6 as p,J as q,G5 as r,Ol as rt,kae as s,Cl as st,Pce as t,Ql as tt,i5 as u,ii as ut,SY as v,XI as w,VY as x,yY as y,wE as z};
|
|
10984
|
+
//# sourceMappingURL=index-BTFXLjRb.js.map
|