@chrysb/alphaclaw 0.9.26 → 0.9.27

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.
@@ -1,5 +1,5 @@
1
1
  import"./chunks/chunk-72ZECFVW.js";var Zr,Re,Ih,Yr,Is,Ph,Eh,Dh,Oh,Sd,xd,vd,Nh,Ta={},Pa=[],Kk=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Xr=Array.isArray;function In(t,e){for(var n in e)t[n]=e[n];return t}function kd(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function M(t,e,n){var s,o,r,i={};for(r in e)r=="key"?s=e[r]:r=="ref"?o=e[r]:i[r]=e[r];if(arguments.length>2&&(i.children=arguments.length>3?Zr.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(r in t.defaultProps)i[r]===void 0&&(i[r]=t.defaultProps[r]);return Jr(t,i,s,o,null)}function Jr(t,e,n,s,o){var r={type:t,props:e,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++Ih,__i:-1,__u:0};return o==null&&Re.vnode!=null&&Re.vnode(r),r}function bn(t){return t.children}function wn(t,e){this.props=t,this.context=e}function Wo(t,e){if(e==null)return t.__?Wo(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?Wo(t):null}function Gk(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,s=[],o=[],r=In({},e);r.__v=e.__v+1,Re.vnode&&Re.vnode(r),Cd(t.__P,r,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,s,n??Wo(e),!!(32&e.__u),o),r.__v=e.__v,r.__.__k[r.__i]=r,Wh(s,r,o),e.__e=e.__=null,r.__e!=n&&Bh(r)}}function Bh(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),Bh(t)}function $d(t){(!t.__d&&(t.__d=!0)&&Is.push(t)&&!Ra.__r++||Ph!=Re.debounceRendering)&&((Ph=Re.debounceRendering)||Eh)(Ra)}function Ra(){try{for(var t,e=1;Is.length;)Is.length>e&&Is.sort(Dh),t=Is.shift(),e=Is.length,Gk(t)}finally{Is.length=Ra.__r=0}}function Fh(t,e,n,s,o,r,i,a,l,c,d){var u,p,f,g,m,h,b,y=s&&s.__k||Pa,v=e.length;for(l=qk(n,e,y,l,v),u=0;u<v;u++)(f=n.__k[u])!=null&&(p=f.__i!=-1&&y[f.__i]||Ta,f.__i=u,h=Cd(t,f,p,o,r,i,a,l,c,d),g=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&_d(p.ref,null,f),d.push(f.ref,f.__c||g,f)),m==null&&g!=null&&(m=g),(b=!!(4&f.__u))||p.__k===f.__k?l=Hh(f,l,t,b):typeof f.type=="function"&&h!==void 0?l=h:g&&(l=g.nextSibling),f.__u&=-7);return n.__e=m,l}function qk(t,e,n,s,o){var r,i,a,l,c,d=n.length,u=d,p=0;for(t.__k=new Array(o),r=0;r<o;r++)(i=e[r])!=null&&typeof i!="boolean"&&typeof i!="function"?(typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?i=t.__k[r]=Jr(null,i,null,null,null):Xr(i)?i=t.__k[r]=Jr(bn,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?i=t.__k[r]=Jr(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):t.__k[r]=i,l=r+p,i.__=t,i.__b=t.__b+1,a=null,(c=i.__i=Jk(i,n,l,u))!=-1&&(u--,(a=n[c])&&(a.__u|=2)),a==null||a.__v==null?(c==-1&&(o>d?p--:o<d&&p++),typeof i.type!="function"&&(i.__u|=4)):c!=l&&(c==l-1?p--:c==l+1?p++:(c>l?p--:p++,i.__u|=4))):t.__k[r]=null;if(u)for(r=0;r<d;r++)(a=n[r])!=null&&(2&a.__u)==0&&(a.__e==s&&(s=Wo(a)),jh(a,a));return s}function Hh(t,e,n,s){var o,r;if(typeof t.type=="function"){for(o=t.__k,r=0;o&&r<o.length;r++)o[r]&&(o[r].__=t,e=Hh(o[r],e,n,s));return e}t.__e!=e&&(s&&(e&&t.type&&!e.parentNode&&(e=Wo(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Qr(t,e){return e=e||[],t==null||typeof t=="boolean"||(Xr(t)?t.some(function(n){Qr(n,e)}):e.push(t)),e}function Jk(t,e,n,s){var o,r,i,a=t.key,l=t.type,c=e[n],d=c!=null&&(2&c.__u)==0;if(c===null&&a==null||d&&a==c.key&&l==c.type)return n;if(s>(d?1:0)){for(o=n-1,r=n+1;o>=0||r<e.length;)if((c=e[i=o>=0?o--:r++])!=null&&(2&c.__u)==0&&a==c.key&&l==c.type)return i}return-1}function Rh(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Kk.test(e)?n:n+"px"}function Ma(t,e,n,s,o){var r,i;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof s=="string"&&(t.style.cssText=s=""),s)for(e in s)n&&e in n||Rh(t.style,e,"");if(n)for(e in n)s&&n[e]==s[e]||Rh(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")r=e!=(e=e.replace(Oh,"$1")),i=e.toLowerCase(),e=i in t||e=="onFocusOut"||e=="onFocusIn"?i.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=n,n?s?n.u=s.u:(n.u=Sd,t.addEventListener(e,r?vd:xd,r)):t.removeEventListener(e,r?vd:xd,r);else{if(o=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function Lh(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=Sd++;else if(e.t<n.u)return;return n(Re.event?Re.event(e):e)}}}function Cd(t,e,n,s,o,r,i,a,l,c){var d,u,p,f,g,m,h,b,y,v,$,w,S,A,C,k=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),r=[a=e.__e=n.__e]),(d=Re.__b)&&d(e);e:if(typeof k=="function")try{if(b=e.props,y=k.prototype&&k.prototype.render,v=(d=k.contextType)&&s[d.__c],$=d?v?v.props.value:d.__:s,n.__c?h=(u=e.__c=n.__c).__=u.__E:(y?e.__c=u=new k(b,$):(e.__c=u=new wn(b,$),u.constructor=k,u.render=Yk),v&&v.sub(u),u.state||(u.state={}),u.__n=s,p=u.__d=!0,u.__h=[],u._sb=[]),y&&u.__s==null&&(u.__s=u.state),y&&k.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=In({},u.__s)),In(u.__s,k.getDerivedStateFromProps(b,u.__s))),f=u.props,g=u.state,u.__v=e,p)y&&k.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),y&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(y&&k.getDerivedStateFromProps==null&&b!==f&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(b,$),e.__v==n.__v||!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(b,u.__s,$)===!1){e.__v!=n.__v&&(u.props=b,u.state=u.__s,u.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(_){_&&(_.__=e)}),Pa.push.apply(u.__h,u._sb),u._sb=[],u.__h.length&&i.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(b,u.__s,$),y&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(f,g,m)})}if(u.context=$,u.props=b,u.__P=t,u.__e=!1,w=Re.__r,S=0,y)u.state=u.__s,u.__d=!1,w&&w(e),d=u.render(u.props,u.state,u.context),Pa.push.apply(u.__h,u._sb),u._sb=[];else do u.__d=!1,w&&w(e),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++S<25);u.state=u.__s,u.getChildContext!=null&&(s=In(In({},s),u.getChildContext())),y&&!p&&u.getSnapshotBeforeUpdate!=null&&(m=u.getSnapshotBeforeUpdate(f,g)),A=d!=null&&d.type===bn&&d.key==null?zh(d.props.children):d,a=Fh(t,Xr(A)?A:[A],e,n,s,o,r,i,a,l,c),u.base=e.__e,e.__u&=-161,u.__h.length&&i.push(u),h&&(u.__E=u.__=null)}catch(_){if(e.__v=null,l||r!=null)if(_.then){for(e.__u|=l?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;r[r.indexOf(a)]=null,e.__e=a}else{for(C=r.length;C--;)kd(r[C]);wd(e)}else e.__e=n.__e,e.__k=n.__k,_.then||wd(e);Re.__e(_,e,n)}else r==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):a=e.__e=Zk(n.__e,e,n,s,o,r,i,l,c);return(d=Re.diffed)&&d(e),128&e.__u?void 0:a}function wd(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(wd))}function Wh(t,e,n){for(var s=0;s<n.length;s++)_d(n[s],n[++s],n[++s]);Re.__c&&Re.__c(e,t),t.some(function(o){try{t=o.__h,o.__h=[],t.some(function(r){r.call(o)})}catch(r){Re.__e(r,o.__v)}})}function zh(t){return typeof t!="object"||t==null||t.__b>0?t:Xr(t)?t.map(zh):In({},t)}function Zk(t,e,n,s,o,r,i,a,l){var c,d,u,p,f,g,m,h=n.props||Ta,b=e.props,y=e.type;if(y=="svg"?o="http://www.w3.org/2000/svg":y=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),r!=null){for(c=0;c<r.length;c++)if((f=r[c])&&"setAttribute"in f==!!y&&(y?f.localName==y:f.nodeType==3)){t=f,r[c]=null;break}}if(t==null){if(y==null)return document.createTextNode(b);t=document.createElementNS(o,y,b.is&&b),a&&(Re.__m&&Re.__m(e,r),a=!1),r=null}if(y==null)h===b||a&&t.data==b||(t.data=b);else{if(r=r&&Zr.call(t.childNodes),!a&&r!=null)for(h={},c=0;c<t.attributes.length;c++)h[(f=t.attributes[c]).name]=f.value;for(c in h)f=h[c],c=="dangerouslySetInnerHTML"?u=f:c=="children"||c in b||c=="value"&&"defaultValue"in b||c=="checked"&&"defaultChecked"in b||Ma(t,c,null,f,o);for(c in b)f=b[c],c=="children"?p=f:c=="dangerouslySetInnerHTML"?d=f:c=="value"?g=f:c=="checked"?m=f:a&&typeof f!="function"||h[c]===f||Ma(t,c,f,h[c],o);if(d)a||u&&(d.__html==u.__html||d.__html==t.innerHTML)||(t.innerHTML=d.__html),e.__k=[];else if(u&&(t.innerHTML=""),Fh(e.type=="template"?t.content:t,Xr(p)?p:[p],e,n,s,y=="foreignObject"?"http://www.w3.org/1999/xhtml":o,r,i,r?r[0]:n.__k&&Wo(n,0),a,l),r!=null)for(c=r.length;c--;)kd(r[c]);a||(c="value",y=="progress"&&g==null?t.removeAttribute("value"):g!=null&&(g!==t[c]||y=="progress"&&!g||y=="option"&&g!=h[c])&&Ma(t,c,g,h[c],o),c="checked",m!=null&&m!=t[c]&&Ma(t,c,m,h[c],o))}return t}function _d(t,e,n){try{if(typeof t=="function"){var s=typeof t.__u=="function";s&&t.__u(),s&&e==null||(t.__u=t(e))}else t.current=e}catch(o){Re.__e(o,n)}}function jh(t,e,n){var s,o;if(Re.unmount&&Re.unmount(t),(s=t.ref)&&(s.current&&s.current!=t.__e||_d(s,null,e)),(s=t.__c)!=null){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(r){Re.__e(r,e)}s.base=s.__P=null}if(s=t.__k)for(o=0;o<s.length;o++)s[o]&&jh(s[o],e,n||typeof t.type!="function");n||kd(t.__e),t.__c=t.__=t.__e=void 0}function Yk(t,e,n){return this.constructor(t,n)}function zo(t,e,n){var s,o,r,i;e==document&&(e=document.documentElement),Re.__&&Re.__(t,e),o=(s=typeof n=="function")?null:n&&n.__k||e.__k,r=[],i=[],Cd(e,t=(!s&&n||e).__k=M(bn,null,[t]),o||Ta,Ta,e.namespaceURI,!s&&n?[n]:o?null:e.firstChild?Zr.call(e.childNodes):null,r,!s&&n?n:o?o.__e:e.firstChild,s,i),Wh(r,t,i)}function ei(t,e,n){var s,o,r,i,a=In({},t.props);for(r in t.type&&t.type.defaultProps&&(i=t.type.defaultProps),e)r=="key"?s=e[r]:r=="ref"?o=e[r]:a[r]=e[r]===void 0&&i!=null?i[r]:e[r];return arguments.length>2&&(a.children=arguments.length>3?Zr.call(arguments,2):n),Jr(t.type,a,s||t.key,o||t.ref,null)}function jo(t){function e(n){var s,o;return this.getChildContext||(s=new Set,(o={})[e.__c]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){s=null},this.shouldComponentUpdate=function(r){this.props.value!=r.value&&s.forEach(function(i){i.__e=!0,$d(i)})},this.sub=function(r){s.add(r);var i=r.componentWillUnmount;r.componentWillUnmount=function(){s&&s.delete(r),i&&i.call(r)}}),n.children}return e.__c="__cC"+Nh++,e.__=t,e.Provider=e.__l=(e.Consumer=function(n,s){return n.children(s)}).contextType=e,e}Zr=Pa.slice,Re={__e:function(t,e,n,s){for(var o,r,i;e=e.__;)if((o=e.__c)&&!o.__)try{if((r=o.constructor)&&r.getDerivedStateFromError!=null&&(o.setState(r.getDerivedStateFromError(t)),i=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(t,s||{}),i=o.__d),i)return o.__E=o}catch(a){t=a}throw t}},Ih=0,Yr=function(t){return t!=null&&t.constructor===void 0},wn.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=In({},this.state),typeof t=="function"&&(t=t(In({},n),this.props)),t&&In(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),$d(this))},wn.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),$d(this))},wn.prototype.render=bn,Is=[],Eh=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Dh=function(t,e){return t.__v.__b-e.__v.__b},Ra.__r=0,Oh=/(PointerCapture)$|Capture$/i,Sd=0,xd=Lh(!1),vd=Lh(!0),Nh=0;var lo,it,Ad,Vh,ti=0,Xh=[],gt=Re,Uh=gt.__b,Kh=gt.__r,Gh=gt.diffed,qh=gt.__c,Jh=gt.unmount,Zh=gt.__;function ni(t,e){gt.__h&&gt.__h(it,t,ti||e),ti=0;var n=it.__H||(it.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function x(t){return ti=1,Qh(em,t)}function Qh(t,e,n){var s=ni(lo++,2);if(s.t=t,!s.__c&&(s.__=[n?n(e):em(void 0,e),function(a){var l=s.__N?s.__N[0]:s.__[0],c=s.t(l,a);l!==c&&(s.__N=[c,s.__[1]],s.__c.setState({}))}],s.__c=it,!it.__f)){var o=function(a,l,c){if(!s.__c.__H)return!0;var d=s.__c.__H.__.filter(function(p){return p.__c});if(d.every(function(p){return!p.__N}))return!r||r.call(this,a,l,c);var u=s.__c.props!==a;return d.some(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(u=!0)}}),r&&r.call(this,a,l,c)||u};it.__f=!0;var r=it.shouldComponentUpdate,i=it.componentWillUpdate;it.componentWillUpdate=function(a,l,c){if(this.__e){var d=r;r=void 0,o(a,l,c),r=d}i&&i.call(this,a,l,c)},it.shouldComponentUpdate=o}return s.__N||s.__}function P(t,e){var n=ni(lo++,3);!gt.__s&&Td(n.__H,e)&&(n.__=t,n.u=e,it.__H.__h.push(n))}function os(t,e){var n=ni(lo++,4);!gt.__s&&Td(n.__H,e)&&(n.__=t,n.u=e,it.__h.push(n))}function le(t){return ti=5,B(function(){return{current:t}},[])}function B(t,e){var n=ni(lo++,7);return Td(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function q(t,e){return ti=8,B(function(){return t},e)}function si(t){var e=it.context[t.__c],n=ni(lo++,9);return n.c=t,e?(n.__==null&&(n.__=!0,e.sub(it)),e.props.value):t.__}function Xk(){for(var t;t=Xh.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(La),e.__h.some(Md),e.__h=[]}catch(n){e.__h=[],gt.__e(n,t.__v)}}}gt.__b=function(t){it=null,Uh&&Uh(t)},gt.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Zh&&Zh(t,e)},gt.__r=function(t){Kh&&Kh(t),lo=0;var e=(it=t.__c).__H;e&&(Ad===it?(e.__h=[],it.__h=[],e.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.some(La),e.__h.some(Md),e.__h=[],lo=0)),Ad=it},gt.diffed=function(t){Gh&&Gh(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Xh.push(e)!==1&&Vh===gt.requestAnimationFrame||((Vh=gt.requestAnimationFrame)||Qk)(Xk)),e.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Ad=it=null},gt.__c=function(t,e){e.some(function(n){try{n.__h.some(La),n.__h=n.__h.filter(function(s){return!s.__||Md(s)})}catch(s){e.some(function(o){o.__h&&(o.__h=[])}),e=[],gt.__e(s,n.__v)}}),qh&&qh(t,e)},gt.unmount=function(t){Jh&&Jh(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(s){try{La(s)}catch(o){e=o}}),n.__H=void 0,e&&gt.__e(e,n.__v))};var Yh=typeof requestAnimationFrame=="function";function Qk(t){var e,n=function(){clearTimeout(s),Yh&&cancelAnimationFrame(e),setTimeout(t)},s=setTimeout(n,35);Yh&&(e=requestAnimationFrame(n))}function La(t){var e=it,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),it=e}function Md(t){var e=it;t.__c=t.__(),it=e}function Td(t,e){return!t||t.length!==e.length||e.some(function(n,s){return n!==t[s]})}function em(t,e){return typeof e=="function"?e(t):e}var nm=function(t,e,n,s){var o;e[0]=0;for(var r=1;r<e.length;r++){var i=e[r++],a=e[r]?(e[0]|=i?1:2,n[e[r++]]):e[++r];i===3?s[0]=a:i===4?s[1]=Object.assign(s[1]||{},a):i===5?(s[1]=s[1]||{})[e[++r]]=a:i===6?s[1][e[++r]]+=a+"":i?(o=t.apply(a,nm(t,a,n,["",null])),s.push(o),a[0]?e[0]|=2:(e[r-2]=0,e[r]=o)):s.push(a)}return s},tm=new Map;function R(t){var e=tm.get(this);return e||(e=new Map,tm.set(this,e)),(e=nm(this,e.get(t)||(e.set(t,e=(function(n){for(var s,o,r=1,i="",a="",l=[0],c=function(p){r===1&&(p||(i=i.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?l.push(0,p,i):r===3&&(p||i)?(l.push(3,p,i),r=2):r===2&&i==="..."&&p?l.push(4,p,0):r===2&&i&&!p?l.push(5,0,!0,i):r>=5&&((i||!p&&r===5)&&(l.push(r,0,i,o),r=6),p&&(l.push(r,p,0,o),r=6)),i=""},d=0;d<n.length;d++){d&&(r===1&&c(),c(d));for(var u=0;u<n[d].length;u++)s=n[d][u],r===1?s==="<"?(c(),l=[l],r=3):i+=s:r===4?i==="--"&&s===">"?(r=1,i=""):i=s+i[0]:a?s===a?a="":i+=s:s==='"'||s==="'"?a=s:s===">"?(c(),r=1):r&&(s==="="?(r=5,o=i,i=""):s==="/"&&(r<5||n[d][u+1]===">")?(c(),r===3&&(l=l[0]),r=l,(l=l[0]).push(2,0,r),r=0):s===" "||s===" "||s===`
2
- `||s==="\r"?(c(),r=2):i+=s),r===3&&i==="!--"&&(r=4,l=l[0])}return c(),l})(t)),e),arguments,[])).length>1?e:e[0]}function sm(t,e){if(t instanceof RegExp)return{keys:!1,pattern:t};var n,s,o,r,i=[],a="",l=t.split("/");for(l[0]||l.shift();o=l.shift();)n=o[0],n==="*"?(i.push(n),a+=o[1]==="?"?"(?:/(.*))?":"/(.*)"):n===":"?(s=o.indexOf("?",1),r=o.indexOf(".",1),i.push(o.substring(1,~s?s:~r?r:o.length)),a+=~s&&!~r?"(?:/([^/]+?))?":"/([^/]+?)",~r&&(a+=(~s?"?":"")+"\\"+o.substring(r))):a+="/"+o;return{keys:i,pattern:new RegExp("^"+a+(e?"(?=$|/)":"/?$"),"i")}}var eC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Pd(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}function om(t,e,n){n&&!eC&&(e=n);let s=e(),[{_instance:o},r]=x({_instance:{_value:s,_getSnapshot:e}});return os(()=>{o._value=s,o._getSnapshot=e,Pd(o._value,e())||r({_instance:o})},[t,s,e]),P(()=>(Pd(o._value,o._getSnapshot())||r({_instance:o}),t(()=>{Pd(o._value,o._getSnapshot())||r({_instance:o})})),[t]),s}var Rd=t=>{let e=le([t,(...n)=>e[0](...n)]).current;return os(()=>{e[0]=t}),e[1]};var tC="popstate",Ld="pushState",Id="replaceState",nC="hashchange",rm=[tC,Ld,Id,nC],sC=t=>{for(let e of rm)addEventListener(e,t);return()=>{for(let e of rm)removeEventListener(e,t)}},cm=(t,e)=>om(sC,t,e),im=()=>location.search,dm=({ssrSearch:t}={})=>cm(im,t!=null?()=>t:im),am=()=>location.pathname,oC=({ssrPath:t}={})=>cm(am,t!=null?()=>t:am);var rC=(t,{replace:e=!1,state:n=null}={})=>history[e?Id:Ld](n,"",t),um=(t={})=>[oC(t),rC],lm=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[lm]>"u"){for(let t of[Ld,Id]){let e=history[t];history[t]=function(){let n=e.apply(this,arguments),s=new Event(t);return s.arguments=arguments,dispatchEvent(s),n}}Object.defineProperty(window,lm,{value:!0})}var iC=(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())?"~"+e:e.slice(t.length)||"/",fm=(t="")=>t==="/"?"":t,hm=(t,e)=>t[0]==="~"?t.slice(1):fm(e)+t,mm=(t="",e)=>iC(pm(fm(t)),pm(e));var pm=t=>{try{return decodeURI(t)}catch{return t}};var bm={hook:um,searchHook:dm,parser:sm,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:t=>t,aroundNav:(t,e,n)=>t(e,n)},ym=jo(bm),oi=()=>si(ym),xm={},vm=jo(xm),aC=()=>si(vm),Ia=t=>{let[e,n]=t.hook(t);return[mm(t.base,e),Rd((s,o)=>t.aroundNav(n,hm(s,t.base),o))]},Ea=()=>Ia(oi());var $m=(t,e,n,s)=>{let{pattern:o,keys:r}=e instanceof RegExp?{keys:!1,pattern:e}:t(e||"*",s),i=o.exec(n)||[],[a,...l]=i;return a!==void 0?[!0,(()=>{let c=r!==!1?Object.fromEntries(r.map((u,p)=>[u,l[p]])):i.groups,d={...l};return c&&Object.assign(d,c),d})(),...s?[a]:[]]:[!1,null]};var Da=({children:t,...e})=>{let n=oi(),s=e.hook?bm:n,o=s,[r,i=e.ssrSearch??""]=e.ssrPath?.split("?")??[];r&&(e.ssrSearch=i,e.ssrPath=r),e.hrefs=e.hrefs??e.hook?.hrefs,e.searchHook=e.searchHook??e.hook?.searchHook;let a=le({}),l=a.current,c=l;for(let d in s){let u=d==="base"?s[d]+(e[d]??""):e[d]??s[d];l===c&&u!==c[d]&&(a.current=c={...c}),c[d]=u,(u!==s[d]||u!==o[d])&&(o=c)}return M(ym.Provider,{value:o,children:t})},gm=({children:t,component:e},n)=>e?M(e,{params:n}):typeof t=="function"?t(n):t,lC=t=>{let e=le(xm),n=e.current;return e.current=Object.keys(t).length!==Object.keys(n).length||Object.entries(t).some(([s,o])=>o!==n[s])?t:n};var ct=({path:t,nest:e,match:n,...s})=>{let o=oi(),[r]=Ia(o),[i,a,l]=n??$m(o.parser,t,r,e),c=lC({...aC(),...a});if(!i)return null;let d=l?M(Da,{base:l},gm(s,c)):gm(s,c);return M(vm.Provider,{value:c,children:d})},rE=(t,e)=>{let n=oi(),[s,o]=Ia(n),{to:r="",href:i=r,onClick:a,asChild:l,children:c,className:d,replace:u,state:p,transition:f,...g}=t,m=Rd(b=>{b.ctrlKey||b.metaKey||b.altKey||b.shiftKey||b.button!==0||(a?.(b),b.defaultPrevented||(b.preventDefault(),o(i,t)))}),h=n.hrefs(i[0]==="~"?i.slice(1):n.base+i,n);return l&&Yr(c)?ei(c,{onClick:m,href:h}):M("a",{...g,onClick:m,href:h,className:d?.call?d(s===i):d,children:c,ref:e})},wm=t=>Array.isArray(t)?t.flatMap(e=>wm(e&&e.type===bn?e.props.children:e)):[t],Ed=({children:t,location:e})=>{let n=oi(),[s]=Ia(n);for(let o of wm(t)){let r=0;if(Yr(o)&&(r=$m(n.parser,o.props.path,e||s,o.props.nest))[0])return ei(o,{match:r})}return null};var Dd=t=>{if(typeof t!="string"||!t.trim())return{};try{return JSON.parse(t)}catch{return{}}},Sm=({url:t="",onMessage:e=()=>{},onError:n=()=>{}})=>{if(typeof window?.EventSource!="function")throw new Error("Server events are not supported in this browser");let s=new window.EventSource(String(t||""),{withCredentials:!0}),o=l=>{e({event:"phase",data:Dd(l?.data||"")})},r=l=>{e({event:"done",data:Dd(l?.data||"")})},i=l=>{e({event:"error",data:Dd(l?.data||"")})},a=l=>{n(l)};return s.addEventListener("phase",o),s.addEventListener("done",r),s.addEventListener("error",i),s.onerror=a,()=>{s.removeEventListener("phase",o),s.removeEventListener("done",r),s.removeEventListener("error",i),s.onerror=null,s.close()}};var km="x-client-timezone",cC=()=>{try{return Intl?.DateTimeFormat?.().resolvedOptions?.().timeZone||""}catch{return""}},de=async(t,e={})=>{let n={...e},s=new Headers(e?.headers||{});if(!s.has(km)){let r=cC();r&&s.set(km,r)}n.headers=s;let o=await fetch(t,n);if(o.status===401){try{window.localStorage?.clear?.()}catch{}throw window.location.href="/setup",new Error("Unauthorized")}return o},Cm=({onMessage:t=()=>{},onOpen:e=()=>{},onError:n=()=>{}}={})=>{if(typeof window?.EventSource!="function")throw new Error("Server events are not supported in this browser");let s=new window.EventSource("/api/events/status",{withCredentials:!0}),o=r=>{let i={};try{i=r?.data?JSON.parse(r.data):{}}catch{}t(i||{})};return s.addEventListener("status",o),s.onopen=()=>e(),s.onerror=r=>n(r),()=>{s.removeEventListener("status",o),s.onopen=null,s.onerror=null,s.close()}};async function Vo(){return(await de("/api/status")).json()}async function Uo(){return(await de("/api/pairings")).json()}async function Ko(t,e,n=""){return(await de(`/api/pairings/${t}/approve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channel:e,accountId:n})})).json()}async function Go(t,e,n=""){let s=await de(`/api/pairings/${t}/reject`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channel:e,accountId:n})});return xe(s,"Could not reject pairing")}async function _m(){return(await de("/api/google/accounts")).json()}async function Am({accountId:t="",client:e=""}={}){let n=new URLSearchParams;t&&n.set("accountId",String(t)),e&&n.set("client",String(e));let s=n.toString()?`?${n.toString()}`:"";return(await de(`/api/google/credentials${s}`)).json()}async function Mm(t=""){let e=new URLSearchParams;t&&e.set("accountId",String(t));let n=e.toString()?`?${e.toString()}`:"";return(await de(`/api/google/check${n}`)).json()}async function Tm({clientId:t,clientSecret:e,email:n,services:s=[],client:o="default",personal:r=!1,accountId:i=""}){return(await de("/api/google/credentials",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:t,clientSecret:e,email:n,services:s,client:o,personal:r,accountId:i})})).json()}async function Pm({email:t,services:e=[],client:n="default",personal:s=!1,accountId:o=""}){return(await de("/api/google/accounts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,services:e,client:n,personal:s,accountId:o})})).json()}async function Rm(t=""){return(await de("/api/google/disconnect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accountId:t})})).json()}var Lm=async()=>{let t=await de("/api/gmail/config");return xe(t,"Could not load Gmail watch config")},Im=async({client:t="default",topicPath:e="",projectId:n="",regeneratePushToken:s=!1}={})=>{let o=await de("/api/gmail/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client:t,topicPath:e,projectId:n,regeneratePushToken:s})});return xe(o,"Could not save Gmail watch config")},Em=async(t,{destination:e=null}={})=>{let n=await de("/api/gmail/watch/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accountId:String(t||""),...e?{destination:e}:{}})});return xe(n,"Could not start Gmail watch")},Dm=async t=>{let e=await de("/api/gmail/watch/stop",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accountId:String(t||"")})});return xe(e,"Could not stop Gmail watch")},Om=async({accountId:t="",force:e=!0}={})=>{let n=await de("/api/gmail/watch/renew",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accountId:String(t||""),force:!!e})});return xe(n,"Could not renew Gmail watch")},Nm=async()=>{let t=await de("/api/agent/sessions");return xe(t,"Could not load agent sessions")},Oa=async()=>{let t=await de("/api/doctor/status");return xe(t,"Could not load Doctor status")},Bm=async()=>{let t=await de("/api/doctor/run",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});return xe(t,"Could not start Doctor run")};var Fm=async(t=10)=>{let e=new URLSearchParams({limit:String(t)}),n=await de(`/api/doctor/runs?${e.toString()}`);return xe(n,"Could not load Doctor runs")},Hm=async({runId:t="all"}={})=>{let e=new URLSearchParams;String(t||"").trim()&&e.set("runId",String(t||""));let n=e.toString()?`?${e.toString()}`:"",s=await de(`/api/doctor/cards${n}`);return xe(s,"Could not load Doctor findings")};var Na=async({cardId:t,status:e})=>{let n=await de(`/api/doctor/cards/${encodeURIComponent(String(t||""))}/status`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:String(e||"")})});return xe(n,"Could not update Doctor card status")},Wm=async({cardId:t,sessionId:e="",replyChannel:n="",replyTo:s="",prompt:o=""}={})=>{let r=await de(`/api/doctor/findings/${encodeURIComponent(String(t||""))}/fix`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:String(e||""),replyChannel:String(n||""),replyTo:String(s||""),prompt:String(o||"")})});return xe(r,"Could not send Doctor fix request")},Ba=async({message:t="",sessionKey:e=""}={})=>{let n=await de("/api/agent/message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:String(t||""),sessionKey:String(e||"")})});return xe(n,"Could not send message to agent")};async function zm(){let t=await de("/api/gateway/restart",{method:"POST"});return xe(t,"Could not restart gateway")}async function Fa(){let t=await de("/api/restart-status");return xe(t,"Could not load restart status")}async function jm(){let t=await de("/api/restart-status/dismiss",{method:"POST"});return xe(t,"Could not dismiss restart status")}async function Vm(){let t=await de("/api/watchdog/status");return xe(t,"Could not load watchdog status")}async function Um(t=30){let e=new URLSearchParams({days:String(t)}),n=await de(`/api/usage/summary?${e.toString()}`);return xe(n,"Could not load usage summary")}async function Km(t=50){let e=new URLSearchParams({limit:String(t)}),n=await de(`/api/usage/sessions?${e.toString()}`);return xe(n,"Could not load usage sessions")}async function Gm(t){let e=await de(`/api/usage/sessions/${encodeURIComponent(String(t||""))}`);return xe(e,"Could not load usage session detail")}async function qm(t=20){let e=await de(`/api/watchdog/events?limit=${encodeURIComponent(String(t))}`);return xe(e,"Could not load watchdog events")}async function Jm(t=65536){let e=await de(`/api/watchdog/logs?tail=${encodeURIComponent(String(t))}`);if(!e.ok)throw new Error("Could not load watchdog logs");return e.text()}async function Od(t){let e=await de("/api/watchdog/terminal/close",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:String(t||"")})});return xe(e,"Could not close watchdog terminal")}async function Ha(){let t=await de("/api/watchdog/repair",{method:"POST"});return xe(t,"Could not trigger watchdog repair")}async function Zm(){let t=await de("/api/watchdog/resources");return xe(t,"Could not load system resources")}async function Ym(){let t=await de("/api/watchdog/settings");return xe(t,"Could not load watchdog settings")}async function Nd(t){let e=await de("/api/watchdog/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t||{})});return xe(e,"Could not update watchdog settings")}async function Xm(){let t=await de("/api/gateway/dashboard");return xe(t,"Could not load dashboard URL")}async function Qm(t=!1){return(await de(`/api/alphaclaw/version${t?"?refresh=1":""}`)).json()}async function eg(t=""){let e=String(t||"").trim(),n=e?`?${new URLSearchParams({tag:e}).toString()}`:"";try{let s=await de(`/api/alphaclaw/release-notes${n}`);return await xe(s,"Could not load release notes")}catch{let s=e?`https://api.github.com/repos/chrysb/alphaclaw/releases/tags/${encodeURIComponent(e)}`:"https://api.github.com/repos/chrysb/alphaclaw/releases/latest",o=await fetch(s,{headers:{Accept:"application/vnd.github+json"}}),r=await o.text(),i=null;try{i=r?JSON.parse(r):null}catch{throw new Error(r||"Could not load release notes")}if(!o.ok)throw new Error(i?.message||r||"Could not load release notes");return{ok:!0,tag:String(i?.tag_name||e||""),name:String(i?.name||""),body:String(i?.body||""),htmlUrl:String(i?.html_url||""),publishedAt:String(i?.published_at||"")}}}async function tg(){return(await de("/api/alphaclaw/update",{method:"POST"})).json()}async function ng(t){let e=await de("/api/sync-cron",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await e.text(),s;try{s=n?JSON.parse(n):{}}catch{throw new Error(n||"Could not parse sync cron response")}if(!e.ok)throw new Error(s.error||n||`HTTP ${e.status}`);return s}async function sg(t){let e=await de("/api/alphaclaw/config/features/openai-compat-api",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:t})}),n=await e.text(),s;try{s=n?JSON.parse(n):{}}catch{throw new Error(n||"Could not parse AlphaClaw config response")}if(!e.ok)throw new Error(s.error||n||`HTTP ${e.status}`);return s}async function og({sortBy:t="nextRunAtMs",sortDir:e="asc"}={}){let n=new URLSearchParams;t&&n.set("sortBy",String(t)),e&&n.set("sortDir",String(e));let s=n.toString()?`?${n.toString()}`:"",o=await de(`/api/cron/jobs${s}`);return xe(o,"Could not load cron jobs")}async function rg(){let t=await de("/api/cron/status");return xe(t,"Could not load cron status")}async function Bd(t,{limit:e=20,offset:n=0,status:s="all",deliveryStatus:o="all",sortDir:r="desc",query:i=""}={}){let a=new URLSearchParams({limit:String(e),offset:String(n),status:String(s||"all"),deliveryStatus:String(o||"all"),sortDir:String(r||"desc")});String(i||"").trim()&&a.set("query",String(i).trim());let l=encodeURIComponent(String(t||"")),c=await de(`/api/cron/jobs/${l}/runs?${a.toString()}`);return xe(c,"Could not load cron run history")}async function ig(t,{days:e=30}={}){let n=new URLSearchParams({days:String(e)}),s=encodeURIComponent(String(t||"")),o=await de(`/api/cron/jobs/${s}/usage?${n.toString()}`);return xe(o,"Could not load cron job usage")}async function ag(t,{range:e="7d"}={}){let n=new URLSearchParams({range:String(e||"7d")}),s=encodeURIComponent(String(t||"")),o=await de(`/api/cron/jobs/${s}/trends?${n.toString()}`);return xe(o,"Could not load cron job trends")}async function lg({days:t=30}={}){let e=new URLSearchParams({days:String(t)}),n=await de(`/api/cron/usage/bulk?${e.toString()}`);return xe(n,"Could not load cron usage overview")}async function cg({sinceMs:t=0,limitPerJob:e=20,status:n="all",deliveryStatus:s="all",sortDir:o="desc"}={}){let r=new URLSearchParams({sinceMs:String(t||0),limitPerJob:String(e||20),status:String(n||"all"),deliveryStatus:String(s||"all"),sortDir:String(o||"desc")}),i=await de(`/api/cron/runs/bulk?${r.toString()}`);return xe(i,"Could not load cron run outcomes")}async function dg(t){let e=encodeURIComponent(String(t||"")),n=await de(`/api/cron/jobs/${e}/run`,{method:"POST"});return xe(n,"Could not trigger cron job run")}async function ug(t,e){let n=encodeURIComponent(String(t||"")),o=await de(`/api/cron/jobs/${n}/${e?"enable":"disable"}`,{method:"POST"});return xe(o,"Could not update cron job state")}async function pg(t,e){let n=encodeURIComponent(String(t||"")),s=await de(`/api/cron/jobs/${n}/prompt`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:String(e||"")})});return xe(s,"Could not update cron prompt")}async function fg(t,{sessionTarget:e="",wakeMode:n="",deliveryMode:s="",deliveryChannel:o="",deliveryTo:r=""}={}){let i=encodeURIComponent(String(t||"")),a=await de(`/api/cron/jobs/${i}/routing`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionTarget:String(e||""),wakeMode:String(n||""),deliveryMode:String(s||""),deliveryChannel:String(o||""),deliveryTo:String(r||"")})});return xe(a,"Could not update cron routing")}async function Wa(){return(await de("/api/devices")).json()}async function za(t){let e=encodeURIComponent(String(t||"")),n=await de(`/api/devices/${e}/approve`,{method:"POST"});return xe(n,"Could not approve device")}async function ja(t){let e=encodeURIComponent(String(t||"")),n=await de(`/api/devices/${e}/reject`,{method:"POST"});return xe(n,"Could not reject device")}var hg=async()=>{let t=await de("/api/nodes");return xe(t,"Could not load nodes")};var mg=async t=>{let e=encodeURIComponent(String(t||"")),n=await de(`/api/nodes/${e}`,{method:"DELETE"});return xe(n,"Could not remove node")},gg=async t=>{let e=encodeURIComponent(String(t||"")),n=new AbortController,s=setTimeout(()=>n.abort(),2e4);try{let o=await de(`/api/nodes/${e}/route`,{method:"POST",signal:n.signal});return xe(o,"Could not route execution to node")}catch(o){throw String(o?.name||"")==="AbortError"?new Error("Routing timed out. Gateway may be restarting or unavailable."):o}finally{clearTimeout(s)}},Va=async()=>{let t=await de("/api/nodes/connect-info");return xe(t,"Could not load connect info")},bg=async(t,e="user")=>{let n=encodeURIComponent(String(t||"")),s=new URLSearchParams({profile:String(e||"user")}),o=await de(`/api/nodes/${n}/browser-status?${s.toString()}`);return xe(o,"Could not load node browser status")};var yg=async()=>(await de("/api/auth/status")).json(),xg=async()=>(await de("/api/auth/logout",{method:"POST"})).json();async function vg(){return(await de("/api/onboard/status")).json()}async function $g(t,e,{importMode:n=!1}={}){return(await de("/api/onboard",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({vars:t,modelKey:e,importMode:n})})).json()}async function Ua(t,e,n="new"){return(await de("/api/onboard/github/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo:t,token:e,mode:n})})).json()}async function wg(t){return(await de("/api/onboard/import/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tempDir:t})})).json()}async function Sg({tempDir:t,approvedSecrets:e=[],skipSecretExtraction:n=!1,githubRepo:s="",githubToken:o=""}){return(await de("/api/onboard/import/apply",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tempDir:t,approvedSecrets:e,skipSecretExtraction:n,githubRepo:s,githubToken:o})})).json()}var rs=async()=>(await de("/api/models")).json();var kg=async t=>{let e=String(t||"").trim(),n=new URLSearchParams({modelKey:e});return(await de(`/api/models/thinking-options?${n.toString()}`)).json()};var Cg=async({agentId:t}={})=>{let e=t?`?agentId=${encodeURIComponent(t)}`:"";return(await de(`/api/models/config${e}`)).json()},_g=async({primary:t,configuredModels:e,profiles:n,authOrder:s,agentId:o}={})=>{let r=o?`?agentId=${encodeURIComponent(o)}`:"";return(await de(`/api/models/config${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({primary:t,configuredModels:e,profiles:n,authOrder:s})})).json()};var qo=async()=>{let t=await de("/api/agents");return xe(t,"Could not load agents")},Jo=async()=>{let t=await de("/api/channels/accounts");return xe(t,"Could not load channel accounts")},Ag=async({provider:t="",accountId:e="default"}={})=>{let n=new URLSearchParams({provider:String(t||""),accountId:String(e||"default")}),s=await de(`/api/channels/accounts/token?${n.toString()}`);return xe(s,"Could not load channel token")},Mg=async t=>{let e=await de("/api/channels/accounts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t||{})});return xe(e,"Could not create channel account")},Tg=async t=>{let e=await de("/api/channels/accounts/jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t||{})});return xe(e,"Could not start channel account operation")},Pg=({operationId:t="",onMessage:e=()=>{},onError:n=()=>{}})=>Sm({url:`/api/operations/${encodeURIComponent(String(t||""))}/events`,onMessage:e,onError:n}),ri=async t=>{let e=await de("/api/channels/accounts",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t||{})});return xe(e,"Could not update channel account")},Ka=async t=>{let e=await de("/api/channels/accounts",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(t||{})});return xe(e,"Could not delete channel account")},Rg=async t=>{let e=await de("/api/channels/accounts/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t||{})});return xe(e,"Could not run channel login")},Lg=async({provider:t="",accountId:e="default"}={})=>{let n=new URLSearchParams({provider:String(t||""),accountId:String(e||"default")}),s=await de(`/api/channels/accounts/login-status?${n.toString()}`);return xe(s,"Could not load channel login status")};var Ig=async t=>{let e=await de(`/api/agents/${encodeURIComponent(String(t||""))}/workspace-size`);return xe(e,"Could not load workspace size")},Eg=async t=>{let e=await de(`/api/agents/${encodeURIComponent(String(t||""))}/bindings`);return xe(e,"Could not load agent bindings")},Dg=async t=>{let e=await de("/api/agents",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t||{})});return xe(e,"Could not create agent")},Og=async(t,e)=>{let n=await de(`/api/agents/${encodeURIComponent(String(t||""))}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e||{})});return xe(n,"Could not update agent")};var Ng=async(t,{keepWorkspace:e=!0}={})=>{let n=new URLSearchParams({keepWorkspace:e?"true":"false"}),s=await de(`/api/agents/${encodeURIComponent(String(t||""))}?${n.toString()}`,{method:"DELETE"});return xe(s,"Could not delete agent")},Bg=async t=>{let e=await de(`/api/agents/${encodeURIComponent(String(t||""))}/default`,{method:"POST"});return xe(e,"Could not set default agent")},Zo=async()=>(await de("/api/codex/status")).json(),ii=async()=>(await de("/api/codex/disconnect",{method:"POST"})).json(),ai=async t=>(await de("/api/codex/exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:t})})).json();async function li(){return(await de("/api/env")).json()}async function Fd(t){let e=await de("/api/env",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({vars:t})}),n=await e.text(),s;try{s=n?JSON.parse(n):{}}catch{throw new Error(n||"Could not parse env save response")}if(!e.ok)throw new Error(s.error||n||`HTTP ${e.status}`);return s}var xe=async(t,e)=>{let n=await t.text(),s;try{s=n?JSON.parse(n):{}}catch{throw new Error(n||e)}if(!t.ok||s?.ok===!1)throw new Error(s.error||n||`HTTP ${t.status}`);return s};async function Fg(){let t=await de("/api/webhooks");return xe(t,"Could not load webhooks")}async function Hg(t){let e=await de(`/api/webhooks/${encodeURIComponent(t)}`);return xe(e,"Could not load webhook detail")}async function Wg(t,{destination:e=null,oauthCallback:n=!1}={}){let s=await de("/api/webhooks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,...e?{destination:e}:{},oauthCallback:!!n})});return xe(s,"Could not create webhook")}async function zg(t,{deleteTransformDir:e=!1}={}){let n=await de(`/api/webhooks/${encodeURIComponent(t)}`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({deleteTransformDir:!!e})});return xe(n,"Could not delete webhook")}async function jg(t,{destination:e=null}={}){let n=await de(`/api/webhooks/${encodeURIComponent(t)}/destination`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({destination:e})});return xe(n,"Could not update webhook destination")}async function Vg(t){let e=await de(`/api/webhooks/${encodeURIComponent(t)}/oauth-callback/rotate`,{method:"POST"});return xe(e,"Could not rotate OAuth callback")}async function Ug(t,{limit:e=50,offset:n=0,status:s="all"}={}){let o=new URLSearchParams({limit:String(e),offset:String(n),status:String(s||"all")}),r=await de(`/api/webhooks/${encodeURIComponent(t)}/requests?${o.toString()}`);return xe(r,"Could not load webhook requests")}async function Kg(t,e){let n=await de(`/api/webhooks/${encodeURIComponent(t)}/requests/${encodeURIComponent(String(e))}`);return xe(n,"Could not load webhook request")}var Ga=async(t={})=>{let{depth:e=3,path:n=""}=typeof t=="number"?{depth:t,path:""}:t,s=new URLSearchParams({depth:String(e)});n&&s.set("path",String(n));let o=await de(`/api/browse/tree?${s.toString()}`);return xe(o,"Could not load file tree")},Hd=async t=>{let e=new URLSearchParams({path:String(t||"")}),n=await de(`/api/browse/read?${e.toString()}`);return xe(n,"Could not load file content")},Gg=async(t,e)=>{let n=String(t||""),s=typeof e=="string"?e:String(e??""),o=await de("/api/browse/write",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n,content:s})});return xe(o,"Could not save file")},qg=async t=>{let e=await de("/api/browse/create-file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:String(t||"")})});return xe(e,"Could not create file")},Jg=async t=>{let e=await de("/api/browse/create-folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:String(t||"")})});return xe(e,"Could not create folder")},Zg=async(t,e)=>{let n=await de("/api/browse/move",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:String(t||""),to:String(e||"")})});return xe(n,"Could not move path")},qa=async t=>{let e=await de("/api/browse/delete",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:String(t||"")})});return xe(e,"Could not delete file")},Yg=async t=>{let e=new URLSearchParams({path:String(t||"")}),n=await de(`/api/browse/download?${e.toString()}`);if(!n.ok){let a=await n.text();throw new Error(a||"Could not download file")}let s=await n.blob(),o=window?.URL||URL;if(!o?.createObjectURL||!o?.revokeObjectURL)throw new Error("Download is not supported in this browser");let r=o.createObjectURL(s),i=String(t||"").split("/").filter(Boolean).pop()||"download";try{let a=document.createElement("a");a.href=r,a.download=i,document.body?.appendChild(a),a.click(),a.remove()}finally{o.revokeObjectURL(r)}return{ok:!0}},Xg=async t=>{let e=await de("/api/browse/restore",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:String(t||"")})});return xe(e,"Could not restore file")},Wd=async()=>{let t=await de("/api/browse/git-summary");return xe(t,"Could not load git summary")},Qg=async t=>{let e=new URLSearchParams({path:String(t||"")}),n=await de(`/api/browse/git-diff?${e.toString()}`);return xe(n,"Could not load file diff")},eb=async({filePath:t,table:e,limit:n=50,offset:s=0})=>{let o=new URLSearchParams({path:String(t||""),table:String(e||""),limit:String(n),offset:String(s)}),r=await de(`/api/browse/sqlite-table?${o.toString()}`);return xe(r,"Could not load sqlite table data")},tb=async(t="")=>{let e=await de("/api/browse/git-sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:String(t||"")})});return xe(e,"Could not sync changes")};var is=t=>String(t||"").split("/")[0]||"",co=t=>{let e=String(t||"").trim();return e==="openai-codex"?"openai":e==="volcengine-plan"?"volcengine":e==="byteplus-plan"?"byteplus":e},dC=[{label:"Opus 4.8",preferredKeys:["anthropic/claude-opus-4-8"]},{label:"Opus 4.7",preferredKeys:["anthropic/claude-opus-4-7"]},{label:"Opus 4.6",preferredKeys:["anthropic/claude-opus-4-6"]},{label:"Sonnet 4.6",preferredKeys:["anthropic/claude-sonnet-4-6"]},{label:"Codex 5.3",preferredKeys:["openai/gpt-5.3-codex","openai-codex/gpt-5.3-codex"]},{label:"GPT-5.5",preferredKeys:["openai/gpt-5.5","openai-codex/gpt-5.5"]},{label:"Gemini 3.1 Pro",preferredKeys:["google/gemini-3.1-pro-preview"]}],uC=[{key:"openai/gpt-5.5",provider:"openai",label:"GPT-5.5"}],nb=(t=[])=>{let e=[...t],n=new Set(e.map(s=>s?.key));for(let s of uC)n.has(s.key)||e.push(s);return e},uo=t=>{let e=[],n=new Set;return dC.forEach(s=>{let o=s.preferredKeys.map(r=>t.find(i=>i.key===r)).find(Boolean);!o||n.has(o.key)||(e.push({...o,featuredLabel:s.label}),n.add(o.key))}),e},En={anthropic:[{key:"ANTHROPIC_API_KEY",label:"Anthropic API Key",url:"https://console.anthropic.com",linkText:"Get key",placeholder:"sk-ant-..."}],openai:[{key:"OPENAI_API_KEY",label:"OpenAI API Key",url:"https://platform.openai.com",linkText:"Get key",placeholder:"sk-..."}],google:[{key:"GEMINI_API_KEY",label:"Gemini API Key",url:"https://aistudio.google.com",linkText:"Get key",placeholder:"AI..."}],opencode:[{key:"OPENCODE_API_KEY",label:"OpenCode API Key",placeholder:"oc-..."}],openrouter:[{key:"OPENROUTER_API_KEY",label:"OpenRouter API Key",url:"https://openrouter.ai",linkText:"Get key",placeholder:"sk-or-..."}],zai:[{key:"ZAI_API_KEY",label:"Z.AI API Key",placeholder:"zai-..."}],"vercel-ai-gateway":[{key:"AI_GATEWAY_API_KEY",label:"AI Gateway API Key",placeholder:"aigw_..."}],kilocode:[{key:"KILOCODE_API_KEY",label:"KiloCode API Key",placeholder:"kilo_..."}],xai:[{key:"XAI_API_KEY",label:"xAI API Key",placeholder:"xai-..."}],mistral:[{key:"MISTRAL_API_KEY",label:"Mistral API Key",url:"https://console.mistral.ai",linkText:"Get key",placeholder:"sk-..."}],voyage:[{key:"VOYAGE_API_KEY",label:"Voyage API Key",url:"https://dash.voyageai.com",linkText:"Get key",placeholder:"pa-..."}],groq:[{key:"GROQ_API_KEY",label:"Groq API Key",url:"https://console.groq.com",linkText:"Get key",placeholder:"gsk_..."}],cerebras:[{key:"CEREBRAS_API_KEY",label:"Cerebras API Key",placeholder:"csk-..."}],moonshot:[{key:"MOONSHOT_API_KEY",label:"Moonshot API Key",placeholder:"sk-..."}],"kimi-coding":[{key:"KIMI_API_KEY",label:"Kimi API Key",placeholder:"sk-..."}],volcengine:[{key:"VOLCANO_ENGINE_API_KEY",label:"Volcano Engine API Key",placeholder:"ve-..."}],byteplus:[{key:"BYTEPLUS_API_KEY",label:"BytePlus API Key",placeholder:"bp-..."}],synthetic:[{key:"SYNTHETIC_API_KEY",label:"Synthetic API Key",placeholder:"syn-..."}],minimax:[{key:"MINIMAX_API_KEY",label:"MiniMax API Key",placeholder:"minimax-..."}],deepgram:[{key:"DEEPGRAM_API_KEY",label:"Deepgram API Key",url:"https://console.deepgram.com",linkText:"Get key",placeholder:"dg-..."}],vllm:[{key:"VLLM_API_KEY",label:"vLLM API Key",placeholder:"vllm-local"}]},po={anthropic:"Anthropic",openai:"OpenAI",google:"Gemini",opencode:"OpenCode Zen",openrouter:"OpenRouter",zai:"Z.AI","vercel-ai-gateway":"Vercel AI Gateway",kilocode:"Kilo Gateway",xai:"xAI",mistral:"Mistral",cerebras:"Cerebras",moonshot:"Moonshot","kimi-coding":"Kimi Coding",volcengine:"Volcano Engine",byteplus:"BytePlus",synthetic:"Synthetic",minimax:"MiniMax",voyage:"Voyage",groq:"Groq",deepgram:"Deepgram",vllm:"vLLM"},zd=["anthropic","openai","google","zai","xai","openrouter","opencode","kilocode","vercel-ai-gateway","minimax","moonshot","kimi-coding","volcengine","byteplus","synthetic","mistral","cerebras","voyage","groq","deepgram","vllm"];var sb=[{id:"embeddings",label:"Memory Embeddings",tag:"Embeddings",providers:["openai","google","voyage","mistral"]},{id:"audio",label:"Audio Transcription",tag:"Audio",hasDefault:!0,providers:["openai","groq","deepgram","google","mistral"]}],ob=t=>{if(t==="openai-codex")return new Set;let e=co(t),n=En[e]||[];return new Set(n.map(s=>s.key))},rb=Object.values(En).flat().filter((t,e,n)=>n.findIndex(s=>s.key===t.key)===e);var Yo=R.bind(M),jd="new",Vd="existing",Dn="fresh",Wt="import",On="create",as="existing-empty",Es=t=>!!String(t||"").trim(),pC=t=>String(t||"").trim().replace(/^git@github\.com:/,"").replace(/^https:\/\/github\.com\//,"").replace(/\.git$/,""),ci=t=>{let e=pC(t);if(!e)return!1;let n=e.split("/").filter(Boolean);return n.length===2&&!n.some(s=>/\s/.test(s))},fC=t=>{let e=t._GITHUB_FLOW||Dn;if(!Es(t.GITHUB_TOKEN))return"Enter a GitHub personal access token to continue.";if(!Es(t.GITHUB_WORKSPACE_REPO))return'Enter the target repo as "owner/repo".';if(!ci(t.GITHUB_WORKSPACE_REPO))return'Target repo must be in "owner/repo" format.';if(e===Wt){if(!Es(t._GITHUB_SOURCE_REPO))return'Enter the source repo as "owner/repo".';if(!ci(t._GITHUB_SOURCE_REPO))return'Source repo must be in "owner/repo" format.'}return""},hC=(t,e={})=>!Es(t.MODEL_KEY)||!String(t.MODEL_KEY).includes("/")?"Choose a model to continue.":e.selectedProvider==="openai-codex"&&e.codexLoading?"Checking Codex OAuth status. Try Next again in a moment.":e.hasAi?"":e.selectedProvider==="openai-codex"?"Connect Codex OAuth to continue.":"Add credentials for the selected model provider to continue.",mC=t=>{let e=Es(t.TELEGRAM_BOT_TOKEN),n=Es(t.DISCORD_BOT_TOKEN),s=Es(t.SLACK_BOT_TOKEN),o=Es(t.SLACK_APP_TOKEN);return s&&!o?"Add the Slack app token to continue with Slack.":!s&&o?"Add the Slack bot token to continue with Slack.":!e&&!n&&!(s&&o)?"Add at least one channel to continue.":""},fo=(t,e,n={})=>{switch(t){case"github":return fC(e);case"ai":return hC(e,n);case"channels":return mC(e);default:return""}},Kt=[{id:"github",title:"GitHub",description:"Auto-backup your config and workspace",fields:[{key:"_GITHUB_SOURCE_REPO",label:"Source Repo",placeholder:"username/existing-openclaw",isText:!0},{key:"GITHUB_WORKSPACE_REPO",label:"New Workspace Repo",placeholder:"username/my-agent",isText:!0},{key:"GITHUB_TOKEN",label:"Personal Access Token",hint:Yo`Create a${" "}<a
2
+ `||s==="\r"?(c(),r=2):i+=s),r===3&&i==="!--"&&(r=4,l=l[0])}return c(),l})(t)),e),arguments,[])).length>1?e:e[0]}function sm(t,e){if(t instanceof RegExp)return{keys:!1,pattern:t};var n,s,o,r,i=[],a="",l=t.split("/");for(l[0]||l.shift();o=l.shift();)n=o[0],n==="*"?(i.push(n),a+=o[1]==="?"?"(?:/(.*))?":"/(.*)"):n===":"?(s=o.indexOf("?",1),r=o.indexOf(".",1),i.push(o.substring(1,~s?s:~r?r:o.length)),a+=~s&&!~r?"(?:/([^/]+?))?":"/([^/]+?)",~r&&(a+=(~s?"?":"")+"\\"+o.substring(r))):a+="/"+o;return{keys:i,pattern:new RegExp("^"+a+(e?"(?=$|/)":"/?$"),"i")}}var eC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Pd(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}function om(t,e,n){n&&!eC&&(e=n);let s=e(),[{_instance:o},r]=x({_instance:{_value:s,_getSnapshot:e}});return os(()=>{o._value=s,o._getSnapshot=e,Pd(o._value,e())||r({_instance:o})},[t,s,e]),P(()=>(Pd(o._value,o._getSnapshot())||r({_instance:o}),t(()=>{Pd(o._value,o._getSnapshot())||r({_instance:o})})),[t]),s}var Rd=t=>{let e=le([t,(...n)=>e[0](...n)]).current;return os(()=>{e[0]=t}),e[1]};var tC="popstate",Ld="pushState",Id="replaceState",nC="hashchange",rm=[tC,Ld,Id,nC],sC=t=>{for(let e of rm)addEventListener(e,t);return()=>{for(let e of rm)removeEventListener(e,t)}},cm=(t,e)=>om(sC,t,e),im=()=>location.search,dm=({ssrSearch:t}={})=>cm(im,t!=null?()=>t:im),am=()=>location.pathname,oC=({ssrPath:t}={})=>cm(am,t!=null?()=>t:am);var rC=(t,{replace:e=!1,state:n=null}={})=>history[e?Id:Ld](n,"",t),um=(t={})=>[oC(t),rC],lm=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[lm]>"u"){for(let t of[Ld,Id]){let e=history[t];history[t]=function(){let n=e.apply(this,arguments),s=new Event(t);return s.arguments=arguments,dispatchEvent(s),n}}Object.defineProperty(window,lm,{value:!0})}var iC=(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())?"~"+e:e.slice(t.length)||"/",fm=(t="")=>t==="/"?"":t,hm=(t,e)=>t[0]==="~"?t.slice(1):fm(e)+t,mm=(t="",e)=>iC(pm(fm(t)),pm(e));var pm=t=>{try{return decodeURI(t)}catch{return t}};var bm={hook:um,searchHook:dm,parser:sm,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:t=>t,aroundNav:(t,e,n)=>t(e,n)},ym=jo(bm),oi=()=>si(ym),xm={},vm=jo(xm),aC=()=>si(vm),Ia=t=>{let[e,n]=t.hook(t);return[mm(t.base,e),Rd((s,o)=>t.aroundNav(n,hm(s,t.base),o))]},Ea=()=>Ia(oi());var $m=(t,e,n,s)=>{let{pattern:o,keys:r}=e instanceof RegExp?{keys:!1,pattern:e}:t(e||"*",s),i=o.exec(n)||[],[a,...l]=i;return a!==void 0?[!0,(()=>{let c=r!==!1?Object.fromEntries(r.map((u,p)=>[u,l[p]])):i.groups,d={...l};return c&&Object.assign(d,c),d})(),...s?[a]:[]]:[!1,null]};var Da=({children:t,...e})=>{let n=oi(),s=e.hook?bm:n,o=s,[r,i=e.ssrSearch??""]=e.ssrPath?.split("?")??[];r&&(e.ssrSearch=i,e.ssrPath=r),e.hrefs=e.hrefs??e.hook?.hrefs,e.searchHook=e.searchHook??e.hook?.searchHook;let a=le({}),l=a.current,c=l;for(let d in s){let u=d==="base"?s[d]+(e[d]??""):e[d]??s[d];l===c&&u!==c[d]&&(a.current=c={...c}),c[d]=u,(u!==s[d]||u!==o[d])&&(o=c)}return M(ym.Provider,{value:o,children:t})},gm=({children:t,component:e},n)=>e?M(e,{params:n}):typeof t=="function"?t(n):t,lC=t=>{let e=le(xm),n=e.current;return e.current=Object.keys(t).length!==Object.keys(n).length||Object.entries(t).some(([s,o])=>o!==n[s])?t:n};var ct=({path:t,nest:e,match:n,...s})=>{let o=oi(),[r]=Ia(o),[i,a,l]=n??$m(o.parser,t,r,e),c=lC({...aC(),...a});if(!i)return null;let d=l?M(Da,{base:l},gm(s,c)):gm(s,c);return M(vm.Provider,{value:c,children:d})},rE=(t,e)=>{let n=oi(),[s,o]=Ia(n),{to:r="",href:i=r,onClick:a,asChild:l,children:c,className:d,replace:u,state:p,transition:f,...g}=t,m=Rd(b=>{b.ctrlKey||b.metaKey||b.altKey||b.shiftKey||b.button!==0||(a?.(b),b.defaultPrevented||(b.preventDefault(),o(i,t)))}),h=n.hrefs(i[0]==="~"?i.slice(1):n.base+i,n);return l&&Yr(c)?ei(c,{onClick:m,href:h}):M("a",{...g,onClick:m,href:h,className:d?.call?d(s===i):d,children:c,ref:e})},wm=t=>Array.isArray(t)?t.flatMap(e=>wm(e&&e.type===bn?e.props.children:e)):[t],Ed=({children:t,location:e})=>{let n=oi(),[s]=Ia(n);for(let o of wm(t)){let r=0;if(Yr(o)&&(r=$m(n.parser,o.props.path,e||s,o.props.nest))[0])return ei(o,{match:r})}return null};var Dd=t=>{if(typeof t!="string"||!t.trim())return{};try{return JSON.parse(t)}catch{return{}}},Sm=({url:t="",onMessage:e=()=>{},onError:n=()=>{}})=>{if(typeof window?.EventSource!="function")throw new Error("Server events are not supported in this browser");let s=new window.EventSource(String(t||""),{withCredentials:!0}),o=l=>{e({event:"phase",data:Dd(l?.data||"")})},r=l=>{e({event:"done",data:Dd(l?.data||"")})},i=l=>{e({event:"error",data:Dd(l?.data||"")})},a=l=>{n(l)};return s.addEventListener("phase",o),s.addEventListener("done",r),s.addEventListener("error",i),s.onerror=a,()=>{s.removeEventListener("phase",o),s.removeEventListener("done",r),s.removeEventListener("error",i),s.onerror=null,s.close()}};var km="x-client-timezone",cC=()=>{try{return Intl?.DateTimeFormat?.().resolvedOptions?.().timeZone||""}catch{return""}},de=async(t,e={})=>{let n={...e},s=new Headers(e?.headers||{});if(!s.has(km)){let r=cC();r&&s.set(km,r)}n.headers=s;let o=await fetch(t,n);if(o.status===401){try{window.localStorage?.clear?.()}catch{}throw window.location.href="/setup",new Error("Unauthorized")}return o},Cm=({onMessage:t=()=>{},onOpen:e=()=>{},onError:n=()=>{}}={})=>{if(typeof window?.EventSource!="function")throw new Error("Server events are not supported in this browser");let s=new window.EventSource("/api/events/status",{withCredentials:!0}),o=r=>{let i={};try{i=r?.data?JSON.parse(r.data):{}}catch{}t(i||{})};return s.addEventListener("status",o),s.onopen=()=>e(),s.onerror=r=>n(r),()=>{s.removeEventListener("status",o),s.onopen=null,s.onerror=null,s.close()}};async function Vo(){return(await de("/api/status")).json()}async function Uo(){return(await de("/api/pairings")).json()}async function Ko(t,e,n=""){return(await de(`/api/pairings/${t}/approve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channel:e,accountId:n})})).json()}async function Go(t,e,n=""){let s=await de(`/api/pairings/${t}/reject`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channel:e,accountId:n})});return xe(s,"Could not reject pairing")}async function _m(){return(await de("/api/google/accounts")).json()}async function Am({accountId:t="",client:e=""}={}){let n=new URLSearchParams;t&&n.set("accountId",String(t)),e&&n.set("client",String(e));let s=n.toString()?`?${n.toString()}`:"";return(await de(`/api/google/credentials${s}`)).json()}async function Mm(t=""){let e=new URLSearchParams;t&&e.set("accountId",String(t));let n=e.toString()?`?${e.toString()}`:"";return(await de(`/api/google/check${n}`)).json()}async function Tm({clientId:t,clientSecret:e,email:n,services:s=[],client:o="default",personal:r=!1,accountId:i=""}){return(await de("/api/google/credentials",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:t,clientSecret:e,email:n,services:s,client:o,personal:r,accountId:i})})).json()}async function Pm({email:t,services:e=[],client:n="default",personal:s=!1,accountId:o=""}){return(await de("/api/google/accounts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,services:e,client:n,personal:s,accountId:o})})).json()}async function Rm(t=""){return(await de("/api/google/disconnect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accountId:t})})).json()}var Lm=async()=>{let t=await de("/api/gmail/config");return xe(t,"Could not load Gmail watch config")},Im=async({client:t="default",topicPath:e="",projectId:n="",regeneratePushToken:s=!1}={})=>{let o=await de("/api/gmail/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client:t,topicPath:e,projectId:n,regeneratePushToken:s})});return xe(o,"Could not save Gmail watch config")},Em=async(t,{destination:e=null}={})=>{let n=await de("/api/gmail/watch/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accountId:String(t||""),...e?{destination:e}:{}})});return xe(n,"Could not start Gmail watch")},Dm=async t=>{let e=await de("/api/gmail/watch/stop",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accountId:String(t||"")})});return xe(e,"Could not stop Gmail watch")},Om=async({accountId:t="",force:e=!0}={})=>{let n=await de("/api/gmail/watch/renew",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accountId:String(t||""),force:!!e})});return xe(n,"Could not renew Gmail watch")},Nm=async()=>{let t=await de("/api/agent/sessions");return xe(t,"Could not load agent sessions")},Oa=async()=>{let t=await de("/api/doctor/status");return xe(t,"Could not load Doctor status")},Bm=async()=>{let t=await de("/api/doctor/run",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});return xe(t,"Could not start Doctor run")};var Fm=async(t=10)=>{let e=new URLSearchParams({limit:String(t)}),n=await de(`/api/doctor/runs?${e.toString()}`);return xe(n,"Could not load Doctor runs")},Hm=async({runId:t="all"}={})=>{let e=new URLSearchParams;String(t||"").trim()&&e.set("runId",String(t||""));let n=e.toString()?`?${e.toString()}`:"",s=await de(`/api/doctor/cards${n}`);return xe(s,"Could not load Doctor findings")};var Na=async({cardId:t,status:e})=>{let n=await de(`/api/doctor/cards/${encodeURIComponent(String(t||""))}/status`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:String(e||"")})});return xe(n,"Could not update Doctor card status")},Wm=async({cardId:t,sessionId:e="",replyChannel:n="",replyTo:s="",prompt:o=""}={})=>{let r=await de(`/api/doctor/findings/${encodeURIComponent(String(t||""))}/fix`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:String(e||""),replyChannel:String(n||""),replyTo:String(s||""),prompt:String(o||"")})});return xe(r,"Could not send Doctor fix request")},Ba=async({message:t="",sessionKey:e=""}={})=>{let n=await de("/api/agent/message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:String(t||""),sessionKey:String(e||"")})});return xe(n,"Could not send message to agent")};async function zm(){let t=await de("/api/gateway/restart",{method:"POST"});return xe(t,"Could not restart gateway")}async function Fa(){let t=await de("/api/restart-status");return xe(t,"Could not load restart status")}async function jm(){let t=await de("/api/restart-status/dismiss",{method:"POST"});return xe(t,"Could not dismiss restart status")}async function Vm(){let t=await de("/api/watchdog/status");return xe(t,"Could not load watchdog status")}async function Um(t=30){let e=new URLSearchParams({days:String(t)}),n=await de(`/api/usage/summary?${e.toString()}`);return xe(n,"Could not load usage summary")}async function Km(t=50){let e=new URLSearchParams({limit:String(t)}),n=await de(`/api/usage/sessions?${e.toString()}`);return xe(n,"Could not load usage sessions")}async function Gm(t){let e=await de(`/api/usage/sessions/${encodeURIComponent(String(t||""))}`);return xe(e,"Could not load usage session detail")}async function qm(t=20){let e=await de(`/api/watchdog/events?limit=${encodeURIComponent(String(t))}`);return xe(e,"Could not load watchdog events")}async function Jm(t=65536){let e=await de(`/api/watchdog/logs?tail=${encodeURIComponent(String(t))}`);if(!e.ok)throw new Error("Could not load watchdog logs");return e.text()}async function Od(t){let e=await de("/api/watchdog/terminal/close",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:String(t||"")})});return xe(e,"Could not close watchdog terminal")}async function Ha(){let t=await de("/api/watchdog/repair",{method:"POST"});return xe(t,"Could not trigger watchdog repair")}async function Zm(){let t=await de("/api/watchdog/resources");return xe(t,"Could not load system resources")}async function Ym(){let t=await de("/api/watchdog/settings");return xe(t,"Could not load watchdog settings")}async function Nd(t){let e=await de("/api/watchdog/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t||{})});return xe(e,"Could not update watchdog settings")}async function Xm(){let t=await de("/api/gateway/dashboard");return xe(t,"Could not load dashboard URL")}async function Qm(t=!1){return(await de(`/api/alphaclaw/version${t?"?refresh=1":""}`)).json()}async function eg(t=""){let e=String(t||"").trim(),n=e?`?${new URLSearchParams({tag:e}).toString()}`:"";try{let s=await de(`/api/alphaclaw/release-notes${n}`);return await xe(s,"Could not load release notes")}catch{let s=e?`https://api.github.com/repos/chrysb/alphaclaw/releases/tags/${encodeURIComponent(e)}`:"https://api.github.com/repos/chrysb/alphaclaw/releases/latest",o=await fetch(s,{headers:{Accept:"application/vnd.github+json"}}),r=await o.text(),i=null;try{i=r?JSON.parse(r):null}catch{throw new Error(r||"Could not load release notes")}if(!o.ok)throw new Error(i?.message||r||"Could not load release notes");return{ok:!0,tag:String(i?.tag_name||e||""),name:String(i?.name||""),body:String(i?.body||""),htmlUrl:String(i?.html_url||""),publishedAt:String(i?.published_at||"")}}}async function tg(){return(await de("/api/alphaclaw/update",{method:"POST"})).json()}async function ng(t){let e=await de("/api/sync-cron",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await e.text(),s;try{s=n?JSON.parse(n):{}}catch{throw new Error(n||"Could not parse sync cron response")}if(!e.ok)throw new Error(s.error||n||`HTTP ${e.status}`);return s}async function sg(t){let e=await de("/api/alphaclaw/config/features/openai-compat-api",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:t})}),n=await e.text(),s;try{s=n?JSON.parse(n):{}}catch{throw new Error(n||"Could not parse AlphaClaw config response")}if(!e.ok)throw new Error(s.error||n||`HTTP ${e.status}`);return s}async function og({sortBy:t="nextRunAtMs",sortDir:e="asc"}={}){let n=new URLSearchParams;t&&n.set("sortBy",String(t)),e&&n.set("sortDir",String(e));let s=n.toString()?`?${n.toString()}`:"",o=await de(`/api/cron/jobs${s}`);return xe(o,"Could not load cron jobs")}async function rg(){let t=await de("/api/cron/status");return xe(t,"Could not load cron status")}async function Bd(t,{limit:e=20,offset:n=0,status:s="all",deliveryStatus:o="all",sortDir:r="desc",query:i=""}={}){let a=new URLSearchParams({limit:String(e),offset:String(n),status:String(s||"all"),deliveryStatus:String(o||"all"),sortDir:String(r||"desc")});String(i||"").trim()&&a.set("query",String(i).trim());let l=encodeURIComponent(String(t||"")),c=await de(`/api/cron/jobs/${l}/runs?${a.toString()}`);return xe(c,"Could not load cron run history")}async function ig(t,{days:e=30}={}){let n=new URLSearchParams({days:String(e)}),s=encodeURIComponent(String(t||"")),o=await de(`/api/cron/jobs/${s}/usage?${n.toString()}`);return xe(o,"Could not load cron job usage")}async function ag(t,{range:e="7d"}={}){let n=new URLSearchParams({range:String(e||"7d")}),s=encodeURIComponent(String(t||"")),o=await de(`/api/cron/jobs/${s}/trends?${n.toString()}`);return xe(o,"Could not load cron job trends")}async function lg({days:t=30}={}){let e=new URLSearchParams({days:String(t)}),n=await de(`/api/cron/usage/bulk?${e.toString()}`);return xe(n,"Could not load cron usage overview")}async function cg({sinceMs:t=0,limitPerJob:e=20,status:n="all",deliveryStatus:s="all",sortDir:o="desc"}={}){let r=new URLSearchParams({sinceMs:String(t||0),limitPerJob:String(e||20),status:String(n||"all"),deliveryStatus:String(s||"all"),sortDir:String(o||"desc")}),i=await de(`/api/cron/runs/bulk?${r.toString()}`);return xe(i,"Could not load cron run outcomes")}async function dg(t){let e=encodeURIComponent(String(t||"")),n=await de(`/api/cron/jobs/${e}/run`,{method:"POST"});return xe(n,"Could not trigger cron job run")}async function ug(t,e){let n=encodeURIComponent(String(t||"")),o=await de(`/api/cron/jobs/${n}/${e?"enable":"disable"}`,{method:"POST"});return xe(o,"Could not update cron job state")}async function pg(t,e){let n=encodeURIComponent(String(t||"")),s=await de(`/api/cron/jobs/${n}/prompt`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:String(e||"")})});return xe(s,"Could not update cron prompt")}async function fg(t,{sessionTarget:e="",wakeMode:n="",deliveryMode:s="",deliveryChannel:o="",deliveryTo:r=""}={}){let i=encodeURIComponent(String(t||"")),a=await de(`/api/cron/jobs/${i}/routing`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionTarget:String(e||""),wakeMode:String(n||""),deliveryMode:String(s||""),deliveryChannel:String(o||""),deliveryTo:String(r||"")})});return xe(a,"Could not update cron routing")}async function Wa(){return(await de("/api/devices")).json()}async function za(t){let e=encodeURIComponent(String(t||"")),n=await de(`/api/devices/${e}/approve`,{method:"POST"});return xe(n,"Could not approve device")}async function ja(t){let e=encodeURIComponent(String(t||"")),n=await de(`/api/devices/${e}/reject`,{method:"POST"});return xe(n,"Could not reject device")}var hg=async()=>{let t=await de("/api/nodes");return xe(t,"Could not load nodes")};var mg=async t=>{let e=encodeURIComponent(String(t||"")),n=await de(`/api/nodes/${e}`,{method:"DELETE"});return xe(n,"Could not remove node")},gg=async t=>{let e=encodeURIComponent(String(t||"")),n=new AbortController,s=setTimeout(()=>n.abort(),2e4);try{let o=await de(`/api/nodes/${e}/route`,{method:"POST",signal:n.signal});return xe(o,"Could not route execution to node")}catch(o){throw String(o?.name||"")==="AbortError"?new Error("Routing timed out. Gateway may be restarting or unavailable."):o}finally{clearTimeout(s)}},Va=async()=>{let t=await de("/api/nodes/connect-info");return xe(t,"Could not load connect info")},bg=async(t,e="user")=>{let n=encodeURIComponent(String(t||"")),s=new URLSearchParams({profile:String(e||"user")}),o=await de(`/api/nodes/${n}/browser-status?${s.toString()}`);return xe(o,"Could not load node browser status")};var yg=async()=>(await de("/api/auth/status")).json(),xg=async()=>(await de("/api/auth/logout",{method:"POST"})).json();async function vg(){return(await de("/api/onboard/status")).json()}async function $g(t,e,{importMode:n=!1}={}){return(await de("/api/onboard",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({vars:t,modelKey:e,importMode:n})})).json()}async function Ua(t,e,n="new"){return(await de("/api/onboard/github/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo:t,token:e,mode:n})})).json()}async function wg(t){return(await de("/api/onboard/import/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tempDir:t})})).json()}async function Sg({tempDir:t,approvedSecrets:e=[],skipSecretExtraction:n=!1,githubRepo:s="",githubToken:o=""}){return(await de("/api/onboard/import/apply",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tempDir:t,approvedSecrets:e,skipSecretExtraction:n,githubRepo:s,githubToken:o})})).json()}var rs=async()=>(await de("/api/models")).json();var kg=async t=>{let e=String(t||"").trim(),n=new URLSearchParams({modelKey:e});return(await de(`/api/models/thinking-options?${n.toString()}`)).json()};var Cg=async({agentId:t}={})=>{let e=t?`?agentId=${encodeURIComponent(t)}`:"";return(await de(`/api/models/config${e}`)).json()},_g=async({primary:t,configuredModels:e,profiles:n,authOrder:s,agentId:o}={})=>{let r=o?`?agentId=${encodeURIComponent(o)}`:"";return(await de(`/api/models/config${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({primary:t,configuredModels:e,profiles:n,authOrder:s})})).json()};var qo=async()=>{let t=await de("/api/agents");return xe(t,"Could not load agents")},Jo=async()=>{let t=await de("/api/channels/accounts");return xe(t,"Could not load channel accounts")},Ag=async({provider:t="",accountId:e="default"}={})=>{let n=new URLSearchParams({provider:String(t||""),accountId:String(e||"default")}),s=await de(`/api/channels/accounts/token?${n.toString()}`);return xe(s,"Could not load channel token")},Mg=async t=>{let e=await de("/api/channels/accounts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t||{})});return xe(e,"Could not create channel account")},Tg=async t=>{let e=await de("/api/channels/accounts/jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t||{})});return xe(e,"Could not start channel account operation")},Pg=({operationId:t="",onMessage:e=()=>{},onError:n=()=>{}})=>Sm({url:`/api/operations/${encodeURIComponent(String(t||""))}/events`,onMessage:e,onError:n}),ri=async t=>{let e=await de("/api/channels/accounts",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t||{})});return xe(e,"Could not update channel account")},Ka=async t=>{let e=await de("/api/channels/accounts",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(t||{})});return xe(e,"Could not delete channel account")},Rg=async t=>{let e=await de("/api/channels/accounts/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t||{})});return xe(e,"Could not run channel login")},Lg=async({provider:t="",accountId:e="default"}={})=>{let n=new URLSearchParams({provider:String(t||""),accountId:String(e||"default")}),s=await de(`/api/channels/accounts/login-status?${n.toString()}`);return xe(s,"Could not load channel login status")};var Ig=async t=>{let e=await de(`/api/agents/${encodeURIComponent(String(t||""))}/workspace-size`);return xe(e,"Could not load workspace size")},Eg=async t=>{let e=await de(`/api/agents/${encodeURIComponent(String(t||""))}/bindings`);return xe(e,"Could not load agent bindings")},Dg=async t=>{let e=await de("/api/agents",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t||{})});return xe(e,"Could not create agent")},Og=async(t,e)=>{let n=await de(`/api/agents/${encodeURIComponent(String(t||""))}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e||{})});return xe(n,"Could not update agent")};var Ng=async(t,{keepWorkspace:e=!0}={})=>{let n=new URLSearchParams({keepWorkspace:e?"true":"false"}),s=await de(`/api/agents/${encodeURIComponent(String(t||""))}?${n.toString()}`,{method:"DELETE"});return xe(s,"Could not delete agent")},Bg=async t=>{let e=await de(`/api/agents/${encodeURIComponent(String(t||""))}/default`,{method:"POST"});return xe(e,"Could not set default agent")},Zo=async()=>(await de("/api/codex/status")).json(),ii=async()=>(await de("/api/codex/disconnect",{method:"POST"})).json(),ai=async t=>(await de("/api/codex/exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:t})})).json();async function li(){return(await de("/api/env")).json()}async function Fd(t){let e=await de("/api/env",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({vars:t})}),n=await e.text(),s;try{s=n?JSON.parse(n):{}}catch{throw new Error(n||"Could not parse env save response")}if(!e.ok)throw new Error(s.error||n||`HTTP ${e.status}`);return s}var xe=async(t,e)=>{let n=await t.text(),s;try{s=n?JSON.parse(n):{}}catch{throw new Error(n||e)}if(!t.ok||s?.ok===!1)throw new Error(s.error||n||`HTTP ${t.status}`);return s};async function Fg(){let t=await de("/api/webhooks");return xe(t,"Could not load webhooks")}async function Hg(t){let e=await de(`/api/webhooks/${encodeURIComponent(t)}`);return xe(e,"Could not load webhook detail")}async function Wg(t,{destination:e=null,oauthCallback:n=!1}={}){let s=await de("/api/webhooks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,...e?{destination:e}:{},oauthCallback:!!n})});return xe(s,"Could not create webhook")}async function zg(t,{deleteTransformDir:e=!1}={}){let n=await de(`/api/webhooks/${encodeURIComponent(t)}`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({deleteTransformDir:!!e})});return xe(n,"Could not delete webhook")}async function jg(t,{destination:e=null}={}){let n=await de(`/api/webhooks/${encodeURIComponent(t)}/destination`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({destination:e})});return xe(n,"Could not update webhook destination")}async function Vg(t){let e=await de(`/api/webhooks/${encodeURIComponent(t)}/oauth-callback/rotate`,{method:"POST"});return xe(e,"Could not rotate OAuth callback")}async function Ug(t,{limit:e=50,offset:n=0,status:s="all"}={}){let o=new URLSearchParams({limit:String(e),offset:String(n),status:String(s||"all")}),r=await de(`/api/webhooks/${encodeURIComponent(t)}/requests?${o.toString()}`);return xe(r,"Could not load webhook requests")}async function Kg(t,e){let n=await de(`/api/webhooks/${encodeURIComponent(t)}/requests/${encodeURIComponent(String(e))}`);return xe(n,"Could not load webhook request")}var Ga=async(t={})=>{let{depth:e=3,path:n=""}=typeof t=="number"?{depth:t,path:""}:t,s=new URLSearchParams({depth:String(e)});n&&s.set("path",String(n));let o=await de(`/api/browse/tree?${s.toString()}`);return xe(o,"Could not load file tree")},Hd=async t=>{let e=new URLSearchParams({path:String(t||"")}),n=await de(`/api/browse/read?${e.toString()}`);return xe(n,"Could not load file content")},Gg=async(t,e)=>{let n=String(t||""),s=typeof e=="string"?e:String(e??""),o=await de("/api/browse/write",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n,content:s})});return xe(o,"Could not save file")},qg=async t=>{let e=await de("/api/browse/create-file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:String(t||"")})});return xe(e,"Could not create file")},Jg=async t=>{let e=await de("/api/browse/create-folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:String(t||"")})});return xe(e,"Could not create folder")},Zg=async(t,e)=>{let n=await de("/api/browse/move",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:String(t||""),to:String(e||"")})});return xe(n,"Could not move path")},qa=async t=>{let e=await de("/api/browse/delete",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:String(t||"")})});return xe(e,"Could not delete file")},Yg=async t=>{let e=new URLSearchParams({path:String(t||"")}),n=await de(`/api/browse/download?${e.toString()}`);if(!n.ok){let a=await n.text();throw new Error(a||"Could not download file")}let s=await n.blob(),o=window?.URL||URL;if(!o?.createObjectURL||!o?.revokeObjectURL)throw new Error("Download is not supported in this browser");let r=o.createObjectURL(s),i=String(t||"").split("/").filter(Boolean).pop()||"download";try{let a=document.createElement("a");a.href=r,a.download=i,document.body?.appendChild(a),a.click(),a.remove()}finally{o.revokeObjectURL(r)}return{ok:!0}},Xg=async t=>{let e=await de("/api/browse/restore",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:String(t||"")})});return xe(e,"Could not restore file")},Wd=async()=>{let t=await de("/api/browse/git-summary");return xe(t,"Could not load git summary")},Qg=async t=>{let e=new URLSearchParams({path:String(t||"")}),n=await de(`/api/browse/git-diff?${e.toString()}`);return xe(n,"Could not load file diff")},eb=async({filePath:t,table:e,limit:n=50,offset:s=0})=>{let o=new URLSearchParams({path:String(t||""),table:String(e||""),limit:String(n),offset:String(s)}),r=await de(`/api/browse/sqlite-table?${o.toString()}`);return xe(r,"Could not load sqlite table data")},tb=async(t="")=>{let e=await de("/api/browse/git-sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:String(t||"")})});return xe(e,"Could not sync changes")};var is=t=>String(t||"").split("/")[0]||"",co=t=>{let e=String(t||"").trim();return e==="openai-codex"?"openai":e==="volcengine-plan"?"volcengine":e==="byteplus-plan"?"byteplus":e},dC=[{label:"Opus 4.8",preferredKeys:["anthropic/claude-opus-4-8"]},{label:"Opus 4.7",preferredKeys:["anthropic/claude-opus-4-7"]},{label:"Opus 4.6",preferredKeys:["anthropic/claude-opus-4-6"]},{label:"Sonnet 4.6",preferredKeys:["anthropic/claude-sonnet-4-6"]},{label:"Codex 5.3",preferredKeys:["openai/gpt-5.3-codex","openai-codex/gpt-5.3-codex"]},{label:"GPT-5.5",preferredKeys:["openai/gpt-5.5","openai-codex/gpt-5.5"]},{label:"Gemini 3.1 Pro",preferredKeys:["google/gemini-3.1-pro-preview"]}],uC=[{key:"openai/gpt-5.4-mini",provider:"openai",label:"GPT-5.4 Mini",agentRuntime:{id:"codex"}},{key:"openai/gpt-5.5",provider:"openai",label:"GPT-5.5",agentRuntime:{id:"codex"}}],nb=(t=[])=>{let e=[...t],n=new Set(e.map(s=>s?.key));for(let s of uC)n.has(s.key)||e.push(s);return e},uo=t=>{let e=[],n=new Set;return dC.forEach(s=>{let o=s.preferredKeys.map(r=>t.find(i=>i.key===r)).find(Boolean);!o||n.has(o.key)||(e.push({...o,featuredLabel:s.label}),n.add(o.key))}),e},En={anthropic:[{key:"ANTHROPIC_API_KEY",label:"Anthropic API Key",url:"https://console.anthropic.com",linkText:"Get key",placeholder:"sk-ant-..."}],openai:[{key:"OPENAI_API_KEY",label:"OpenAI API Key",url:"https://platform.openai.com",linkText:"Get key",placeholder:"sk-..."}],google:[{key:"GEMINI_API_KEY",label:"Gemini API Key",url:"https://aistudio.google.com",linkText:"Get key",placeholder:"AI..."}],opencode:[{key:"OPENCODE_API_KEY",label:"OpenCode API Key",placeholder:"oc-..."}],openrouter:[{key:"OPENROUTER_API_KEY",label:"OpenRouter API Key",url:"https://openrouter.ai",linkText:"Get key",placeholder:"sk-or-..."}],zai:[{key:"ZAI_API_KEY",label:"Z.AI API Key",placeholder:"zai-..."}],"vercel-ai-gateway":[{key:"AI_GATEWAY_API_KEY",label:"AI Gateway API Key",placeholder:"aigw_..."}],kilocode:[{key:"KILOCODE_API_KEY",label:"KiloCode API Key",placeholder:"kilo_..."}],xai:[{key:"XAI_API_KEY",label:"xAI API Key",placeholder:"xai-..."}],mistral:[{key:"MISTRAL_API_KEY",label:"Mistral API Key",url:"https://console.mistral.ai",linkText:"Get key",placeholder:"sk-..."}],voyage:[{key:"VOYAGE_API_KEY",label:"Voyage API Key",url:"https://dash.voyageai.com",linkText:"Get key",placeholder:"pa-..."}],groq:[{key:"GROQ_API_KEY",label:"Groq API Key",url:"https://console.groq.com",linkText:"Get key",placeholder:"gsk_..."}],cerebras:[{key:"CEREBRAS_API_KEY",label:"Cerebras API Key",placeholder:"csk-..."}],moonshot:[{key:"MOONSHOT_API_KEY",label:"Moonshot API Key",placeholder:"sk-..."}],"kimi-coding":[{key:"KIMI_API_KEY",label:"Kimi API Key",placeholder:"sk-..."}],volcengine:[{key:"VOLCANO_ENGINE_API_KEY",label:"Volcano Engine API Key",placeholder:"ve-..."}],byteplus:[{key:"BYTEPLUS_API_KEY",label:"BytePlus API Key",placeholder:"bp-..."}],synthetic:[{key:"SYNTHETIC_API_KEY",label:"Synthetic API Key",placeholder:"syn-..."}],minimax:[{key:"MINIMAX_API_KEY",label:"MiniMax API Key",placeholder:"minimax-..."}],deepgram:[{key:"DEEPGRAM_API_KEY",label:"Deepgram API Key",url:"https://console.deepgram.com",linkText:"Get key",placeholder:"dg-..."}],vllm:[{key:"VLLM_API_KEY",label:"vLLM API Key",placeholder:"vllm-local"}]},po={anthropic:"Anthropic",openai:"OpenAI",google:"Gemini",opencode:"OpenCode Zen",openrouter:"OpenRouter",zai:"Z.AI","vercel-ai-gateway":"Vercel AI Gateway",kilocode:"Kilo Gateway",xai:"xAI",mistral:"Mistral",cerebras:"Cerebras",moonshot:"Moonshot","kimi-coding":"Kimi Coding",volcengine:"Volcano Engine",byteplus:"BytePlus",synthetic:"Synthetic",minimax:"MiniMax",voyage:"Voyage",groq:"Groq",deepgram:"Deepgram",vllm:"vLLM"},zd=["anthropic","openai","google","zai","xai","openrouter","opencode","kilocode","vercel-ai-gateway","minimax","moonshot","kimi-coding","volcengine","byteplus","synthetic","mistral","cerebras","voyage","groq","deepgram","vllm"];var sb=[{id:"embeddings",label:"Memory Embeddings",tag:"Embeddings",providers:["openai","google","voyage","mistral"]},{id:"audio",label:"Audio Transcription",tag:"Audio",hasDefault:!0,providers:["openai","groq","deepgram","google","mistral"]}],ob=t=>{if(t==="openai-codex")return new Set;let e=co(t),n=En[e]||[];return new Set(n.map(s=>s.key))},rb=Object.values(En).flat().filter((t,e,n)=>n.findIndex(s=>s.key===t.key)===e);var Yo=R.bind(M),jd="new",Vd="existing",Dn="fresh",Wt="import",On="create",as="existing-empty",Es=t=>!!String(t||"").trim(),pC=t=>String(t||"").trim().replace(/^git@github\.com:/,"").replace(/^https:\/\/github\.com\//,"").replace(/\.git$/,""),ci=t=>{let e=pC(t);if(!e)return!1;let n=e.split("/").filter(Boolean);return n.length===2&&!n.some(s=>/\s/.test(s))},fC=t=>{let e=t._GITHUB_FLOW||Dn;if(!Es(t.GITHUB_TOKEN))return"Enter a GitHub personal access token to continue.";if(!Es(t.GITHUB_WORKSPACE_REPO))return'Enter the target repo as "owner/repo".';if(!ci(t.GITHUB_WORKSPACE_REPO))return'Target repo must be in "owner/repo" format.';if(e===Wt){if(!Es(t._GITHUB_SOURCE_REPO))return'Enter the source repo as "owner/repo".';if(!ci(t._GITHUB_SOURCE_REPO))return'Source repo must be in "owner/repo" format.'}return""},hC=(t,e={})=>!Es(t.MODEL_KEY)||!String(t.MODEL_KEY).includes("/")?"Choose a model to continue.":e.selectedProvider==="openai-codex"&&e.codexLoading?"Checking Codex OAuth status. Try Next again in a moment.":e.hasAi?"":e.selectedProvider==="openai-codex"?"Connect Codex OAuth to continue.":"Add credentials for the selected model provider to continue.",mC=t=>{let e=Es(t.TELEGRAM_BOT_TOKEN),n=Es(t.DISCORD_BOT_TOKEN),s=Es(t.SLACK_BOT_TOKEN),o=Es(t.SLACK_APP_TOKEN);return s&&!o?"Add the Slack app token to continue with Slack.":!s&&o?"Add the Slack bot token to continue with Slack.":!e&&!n&&!(s&&o)?"Add at least one channel to continue.":""},fo=(t,e,n={})=>{switch(t){case"github":return fC(e);case"ai":return hC(e,n);case"channels":return mC(e);default:return""}},Kt=[{id:"github",title:"GitHub",description:"Auto-backup your config and workspace",fields:[{key:"_GITHUB_SOURCE_REPO",label:"Source Repo",placeholder:"username/existing-openclaw",isText:!0},{key:"GITHUB_WORKSPACE_REPO",label:"New Workspace Repo",placeholder:"username/my-agent",isText:!0},{key:"GITHUB_TOKEN",label:"Personal Access Token",hint:Yo`Create a${" "}<a
3
3
  href="https://github.com/settings/tokens"
4
4
  target="_blank"
5
5
  class="hover:underline"
@@ -43,10 +43,17 @@ export const kFeaturedModelDefs = [
43
43
  ];
44
44
 
45
45
  export const kAlwaysAvailableModelDefs = [
46
+ {
47
+ key: "openai/gpt-5.4-mini",
48
+ provider: "openai",
49
+ label: "GPT-5.4 Mini",
50
+ agentRuntime: { id: "codex" },
51
+ },
46
52
  {
47
53
  key: "openai/gpt-5.5",
48
54
  provider: "openai",
49
55
  label: "GPT-5.5",
56
+ agentRuntime: { id: "codex" },
50
57
  },
51
58
  ];
52
59
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrysb/alphaclaw",
3
- "version": "0.9.26",
3
+ "version": "0.9.27",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },