@farazirfan/costar-server-executor 1.7.74 → 1.7.76

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.
@@ -0,0 +1,1215 @@
1
+ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))i(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function s(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(a){if(a.ep)return;a.ep=!0;const o=s(a);fetch(a.href,o)}})();const U=globalThis,Y=U.ShadowRoot&&(U.ShadyCSS===void 0||U.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,yt=Symbol(),ot=new WeakMap;let Vt=class{constructor(e,s,i){if(this._$cssResult$=!0,i!==yt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=s}get styleSheet(){let e=this.o;const s=this.t;if(Y&&e===void 0){const i=s!==void 0&&s.length===1;i&&(e=ot.get(s)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&ot.set(s,e))}return e}toString(){return this.cssText}};const jt=t=>new Vt(typeof t=="string"?t:t+"",void 0,yt),zt=(t,e)=>{if(Y)t.adoptedStyleSheets=e.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of e){const i=document.createElement("style"),a=U.litNonce;a!==void 0&&i.setAttribute("nonce",a),i.textContent=s.cssText,t.appendChild(i)}},rt=Y?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let s="";for(const i of e.cssRules)s+=i.cssText;return jt(s)})(t):t;const{is:Jt,defineProperty:Kt,getOwnPropertyDescriptor:Wt,getOwnPropertyNames:qt,getOwnPropertySymbols:Zt,getPrototypeOf:Gt}=Object,z=globalThis,lt=z.trustedTypes,Yt=lt?lt.emptyScript:"",Xt=z.reactiveElementPolyfillSupport,T=(t,e)=>t,I={toAttribute(t,e){switch(e){case Boolean:t=t?Yt:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=t!==null;break;case Number:s=t===null?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch{s=null}}return s}},X=(t,e)=>!Jt(t,e),ct={attribute:!0,type:String,converter:I,reflect:!1,useDefault:!1,hasChanged:X};Symbol.metadata??=Symbol("metadata"),z.litPropertyMetadata??=new WeakMap;let A=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,s=ct){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(e,s),!s.noAccessor){const i=Symbol(),a=this.getPropertyDescriptor(e,i,s);a!==void 0&&Kt(this.prototype,e,a)}}static getPropertyDescriptor(e,s,i){const{get:a,set:o}=Wt(this.prototype,e)??{get(){return this[s]},set(r){this[s]=r}};return{get:a,set(r){const u=a?.call(this);o?.call(this,r),this.requestUpdate(e,u,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ct}static _$Ei(){if(this.hasOwnProperty(T("elementProperties")))return;const e=Gt(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(T("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(T("properties"))){const s=this.properties,i=[...qt(s),...Zt(s)];for(const a of i)this.createProperty(a,s[a])}const e=this[Symbol.metadata];if(e!==null){const s=litPropertyMetadata.get(e);if(s!==void 0)for(const[i,a]of s)this.elementProperties.set(i,a)}this._$Eh=new Map;for(const[s,i]of this.elementProperties){const a=this._$Eu(s,i);a!==void 0&&this._$Eh.set(a,s)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const s=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const a of i)s.unshift(rt(a))}else e!==void 0&&s.push(rt(e));return s}static _$Eu(e,s){const i=s.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return zt(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,s,i){this._$AK(e,i)}_$ET(e,s){const i=this.constructor.elementProperties.get(e),a=this.constructor._$Eu(e,i);if(a!==void 0&&i.reflect===!0){const o=(i.converter?.toAttribute!==void 0?i.converter:I).toAttribute(s,i.type);this._$Em=e,o==null?this.removeAttribute(a):this.setAttribute(a,o),this._$Em=null}}_$AK(e,s){const i=this.constructor,a=i._$Eh.get(e);if(a!==void 0&&this._$Em!==a){const o=i.getPropertyOptions(a),r=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:I;this._$Em=a;const u=r.fromAttribute(s,o.type);this[a]=u??this._$Ej?.get(a)??u,this._$Em=null}}requestUpdate(e,s,i,a=!1,o){if(e!==void 0){const r=this.constructor;if(a===!1&&(o=this[e]),i??=r.getPropertyOptions(e),!((i.hasChanged??X)(o,s)||i.useDefault&&i.reflect&&o===this._$Ej?.get(e)&&!this.hasAttribute(r._$Eu(e,i))))return;this.C(e,s,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,s,{useDefault:i,reflect:a,wrapped:o},r){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,r??s??this[e]),o!==!0||r!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(s=void 0),this._$AL.set(e,s)),a===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(s){Promise.reject(s)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[a,o]of this._$Ep)this[a]=o;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[a,o]of i){const{wrapped:r}=o,u=this[a];r!==!0||this._$AL.has(a)||u===void 0||this.C(a,void 0,o,u)}}let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(s)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}e&&this._$AE(s)}willUpdate(e){}_$AE(e){this._$EO?.forEach(s=>s.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(s=>this._$ET(s,this[s])),this._$EM()}updated(e){}firstUpdated(e){}};A.elementStyles=[],A.shadowRootOptions={mode:"open"},A[T("elementProperties")]=new Map,A[T("finalized")]=new Map,Xt?.({ReactiveElement:A}),(z.reactiveElementVersions??=[]).push("2.1.2");const Q=globalThis,dt=t=>t,V=Q.trustedTypes,ht=V?V.createPolicy("lit-html",{createHTML:t=>t}):void 0,$t="$lit$",w=`lit$${Math.random().toFixed(9).slice(2)}$`,bt="?"+w,Qt=`<${bt}>`,C=document,R=()=>C.createComment(""),F=t=>t===null||typeof t!="object"&&typeof t!="function",tt=Array.isArray,te=t=>tt(t)||typeof t?.[Symbol.iterator]=="function",q=`[
2
+ \f\r]`,L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,vt=/-->/g,pt=/>/g,S=RegExp(`>|${q}(?:([^\\s"'>=/]+)(${q}*=${q}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),ut=/'/g,gt=/"/g,wt=/^(?:script|style|textarea|title)$/i,ee=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),n=ee(1),E=Symbol.for("lit-noChange"),l=Symbol.for("lit-nothing"),ft=new WeakMap,k=C.createTreeWalker(C,129);function St(t,e){if(!tt(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return ht!==void 0?ht.createHTML(e):e}const se=(t,e)=>{const s=t.length-1,i=[];let a,o=e===2?"<svg>":e===3?"<math>":"",r=L;for(let u=0;u<s;u++){const v=t[u];let f,m,g=-1,y=0;for(;y<v.length&&(r.lastIndex=y,m=r.exec(v),m!==null);)y=r.lastIndex,r===L?m[1]==="!--"?r=vt:m[1]!==void 0?r=pt:m[2]!==void 0?(wt.test(m[2])&&(a=RegExp("</"+m[2],"g")),r=S):m[3]!==void 0&&(r=S):r===S?m[0]===">"?(r=a??L,g=-1):m[1]===void 0?g=-2:(g=r.lastIndex-m[2].length,f=m[1],r=m[3]===void 0?S:m[3]==='"'?gt:ut):r===gt||r===ut?r=S:r===vt||r===pt?r=L:(r=S,a=void 0);const $=r===S&&t[u+1].startsWith("/>")?" ":"";o+=r===L?v+Qt:g>=0?(i.push(f),v.slice(0,g)+$t+v.slice(g)+w+$):v+w+(g===-2?u:$)}return[St(t,o+(t[s]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class P{constructor({strings:e,_$litType$:s},i){let a;this.parts=[];let o=0,r=0;const u=e.length-1,v=this.parts,[f,m]=se(e,s);if(this.el=P.createElement(f,i),k.currentNode=this.el.content,s===2||s===3){const g=this.el.content.firstChild;g.replaceWith(...g.childNodes)}for(;(a=k.nextNode())!==null&&v.length<u;){if(a.nodeType===1){if(a.hasAttributes())for(const g of a.getAttributeNames())if(g.endsWith($t)){const y=m[r++],$=a.getAttribute(g).split(w),B=/([.?@])?(.*)/.exec(y);v.push({type:1,index:o,name:B[2],strings:$,ctor:B[1]==="."?ae:B[1]==="?"?ne:B[1]==="@"?oe:J}),a.removeAttribute(g)}else g.startsWith(w)&&(v.push({type:6,index:o}),a.removeAttribute(g));if(wt.test(a.tagName)){const g=a.textContent.split(w),y=g.length-1;if(y>0){a.textContent=V?V.emptyScript:"";for(let $=0;$<y;$++)a.append(g[$],R()),k.nextNode(),v.push({type:2,index:++o});a.append(g[y],R())}}}else if(a.nodeType===8)if(a.data===bt)v.push({type:2,index:o});else{let g=-1;for(;(g=a.data.indexOf(w,g+1))!==-1;)v.push({type:7,index:o}),g+=w.length-1}o++}}static createElement(e,s){const i=C.createElement("template");return i.innerHTML=e,i}}function M(t,e,s=t,i){if(e===E)return e;let a=i!==void 0?s._$Co?.[i]:s._$Cl;const o=F(e)?void 0:e._$litDirective$;return a?.constructor!==o&&(a?._$AO?.(!1),o===void 0?a=void 0:(a=new o(t),a._$AT(t,s,i)),i!==void 0?(s._$Co??=[])[i]=a:s._$Cl=a),a!==void 0&&(e=M(t,a._$AS(t,e.values),a,i)),e}class ie{constructor(e,s){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:s},parts:i}=this._$AD,a=(e?.creationScope??C).importNode(s,!0);k.currentNode=a;let o=k.nextNode(),r=0,u=0,v=i[0];for(;v!==void 0;){if(r===v.index){let f;v.type===2?f=new O(o,o.nextSibling,this,e):v.type===1?f=new v.ctor(o,v.name,v.strings,this,e):v.type===6&&(f=new re(o,this,e)),this._$AV.push(f),v=i[++u]}r!==v?.index&&(o=k.nextNode(),r++)}return k.currentNode=C,a}p(e){let s=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,s),s+=i.strings.length-2):i._$AI(e[s])),s++}}class O{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,s,i,a){this.type=2,this._$AH=l,this._$AN=void 0,this._$AA=e,this._$AB=s,this._$AM=i,this.options=a,this._$Cv=a?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const s=this._$AM;return s!==void 0&&e?.nodeType===11&&(e=s.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,s=this){e=M(this,e,s),F(e)?e===l||e==null||e===""?(this._$AH!==l&&this._$AR(),this._$AH=l):e!==this._$AH&&e!==E&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):te(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==l&&F(this._$AH)?this._$AA.nextSibling.data=e:this.T(C.createTextNode(e)),this._$AH=e}$(e){const{values:s,_$litType$:i}=e,a=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=P.createElement(St(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===a)this._$AH.p(s);else{const o=new ie(a,this),r=o.u(this.options);o.p(s),this.T(r),this._$AH=o}}_$AC(e){let s=ft.get(e.strings);return s===void 0&&ft.set(e.strings,s=new P(e)),s}k(e){tt(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let i,a=0;for(const o of e)a===s.length?s.push(i=new O(this.O(R()),this.O(R()),this,this.options)):i=s[a],i._$AI(o),a++;a<s.length&&(this._$AR(i&&i._$AB.nextSibling,a),s.length=a)}_$AR(e=this._$AA.nextSibling,s){for(this._$AP?.(!1,!0,s);e!==this._$AB;){const i=dt(e).nextSibling;dt(e).remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}}class J{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,s,i,a,o){this.type=1,this._$AH=l,this._$AN=void 0,this.element=e,this.name=s,this._$AM=a,this.options=o,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=l}_$AI(e,s=this,i,a){const o=this.strings;let r=!1;if(o===void 0)e=M(this,e,s,0),r=!F(e)||e!==this._$AH&&e!==E,r&&(this._$AH=e);else{const u=e;let v,f;for(e=o[0],v=0;v<o.length-1;v++)f=M(this,u[i+v],s,v),f===E&&(f=this._$AH[v]),r||=!F(f)||f!==this._$AH[v],f===l?e=l:e!==l&&(e+=(f??"")+o[v+1]),this._$AH[v]=f}r&&!a&&this.j(e)}j(e){e===l?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class ae extends J{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===l?void 0:e}}class ne extends J{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==l)}}class oe extends J{constructor(e,s,i,a,o){super(e,s,i,a,o),this.type=5}_$AI(e,s=this){if((e=M(this,e,s,0)??l)===E)return;const i=this._$AH,a=e===l&&i!==l||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==l&&(i===l||a);a&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class re{constructor(e,s,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=s,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){M(this,e)}}const le=Q.litHtmlPolyfillSupport;le?.(P,O),(Q.litHtmlVersions??=[]).push("3.3.2");const ce=(t,e,s)=>{const i=s?.renderBefore??e;let a=i._$litPart$;if(a===void 0){const o=s?.renderBefore??null;i._$litPart$=a=new O(e.insertBefore(R(),o),o,void 0,s??{})}return a._$AI(t),a};const et=globalThis;class D extends A{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ce(s,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return E}}D._$litElement$=!0,D.finalized=!0,et.litElementHydrateSupport?.({LitElement:D});const de=et.litElementPolyfillSupport;de?.({LitElement:D});(et.litElementVersions??=[]).push("4.2.2");const he=t=>(e,s)=>{s!==void 0?s.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)};const ve={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:X},pe=(t=ve,e,s)=>{const{kind:i,metadata:a}=s;let o=globalThis.litPropertyMetadata.get(a);if(o===void 0&&globalThis.litPropertyMetadata.set(a,o=new Map),i==="setter"&&((t=Object.create(t)).wrapped=!0),o.set(s.name,t),i==="accessor"){const{name:r}=s;return{set(u){const v=e.get.call(this);e.set.call(this,u),this.requestUpdate(r,v,t,!0,u)},init(u){return u!==void 0&&this.C(r,void 0,t,u),u}}}if(i==="setter"){const{name:r}=s;return function(u){const v=this[r];e.call(this,u),this.requestUpdate(r,v,t,!0,u)}}throw Error("Unsupported decorator location: "+i)};function ue(t){return(e,s)=>typeof s=="object"?pe(t,e,s):((i,a,o)=>{const r=a.hasOwnProperty(o);return a.constructor.createProperty(o,i),r?Object.getOwnPropertyDescriptor(a,o):void 0})(t,e,s)}function h(t){return ue({...t,state:!0,attribute:!1})}const xt={name:"",instruction:"",scheduleType:"every",every:"30m",cronExpression:"",at:""},kt="costar.dashboard.settings.v1",x={theme:"system",chatShowThinking:!0,splitRatio:.6,navCollapsed:!1,navGroupsCollapsed:{}};function ge(){try{const t=localStorage.getItem(kt);if(!t)return{...x};const e=JSON.parse(t);return{theme:e.theme==="light"||e.theme==="dark"||e.theme==="system"?e.theme:x.theme,chatShowThinking:typeof e.chatShowThinking=="boolean"?e.chatShowThinking:x.chatShowThinking,splitRatio:typeof e.splitRatio=="number"&&e.splitRatio>=.3&&e.splitRatio<=.8?e.splitRatio:x.splitRatio,navCollapsed:typeof e.navCollapsed=="boolean"?e.navCollapsed:x.navCollapsed,navGroupsCollapsed:typeof e.navGroupsCollapsed=="object"&&e.navGroupsCollapsed!==null?e.navGroupsCollapsed:x.navGroupsCollapsed}}catch{return{...x}}}function fe(t){try{localStorage.setItem(kt,JSON.stringify(t))}catch{}}const me=[{label:"main",tabs:["dashboard","chat"]},{label:"agent",tabs:["cron","activity","sessions"]},{label:"data",tabs:["assets","projects","workspace"]},{label:"system",tabs:["skills","logs","config"]}],Z={dashboard:"/",chat:"/chat",cron:"/cron",activity:"/activity",sessions:"/sessions",assets:"/assets",projects:"/projects",workspace:"/workspace",skills:"/skills",logs:"/logs",config:"/config"},ye={dashboard:"Dashboard",chat:"Chat",cron:"Cron Jobs",activity:"Activity",sessions:"Sessions",assets:"Assets",projects:"Projects",workspace:"Workspace",skills:"Skills",logs:"Logs",config:"Config"},$e={dashboard:"home",chat:"messageSquare",cron:"clock",activity:"activity",sessions:"fileText",assets:"package",projects:"folder",workspace:"edit",skills:"zap",logs:"terminal",config:"settings"},be={main:"Main",agent:"Agent",data:"Data",system:"System"};function we(t){return Z[t]}function Ct(t){for(const[s,i]of Object.entries(Z))if(t===i)return s;const e=t.replace(/\/$/,"")||"/";for(const[s,i]of Object.entries(Z))if(e===i)return s;return null}function Se(t){return $e[t]}function xe(t){return ye[t]}function ke(t){return be[t]||t}function Ce(){return typeof window>"u"||typeof window.matchMedia!="function"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function _t(t){return t==="system"?Ce():t}class _e{constructor(e=""){this._chatSessionId=null,this.baseUrl=e}url(e,s){const i=this.baseUrl||window.location.origin,a=new URL(e,i);if(s)for(const[o,r]of Object.entries(s))r!==void 0&&r!==""&&a.searchParams.set(o,r);return a.toString()}async get(e,s){const i=await fetch(this.url(e,s));if(!i.ok){const a=await i.json().catch(()=>({error:i.statusText}));throw new Error(a.error||i.statusText)}return i.json()}async getText(e,s){const i=await fetch(this.url(e,s));if(!i.ok)throw new Error(i.statusText);return i.text()}async post(e,s){const i=await fetch(this.url(e),{method:"POST",headers:{"Content-Type":"application/json"},body:s!==void 0?JSON.stringify(s):void 0});if(!i.ok){const a=await i.json().catch(()=>({error:i.statusText}));throw new Error(a.error||i.statusText)}return i.json()}async put(e,s){const i=await fetch(this.url(e),{method:"PUT",headers:{"Content-Type":"application/json"},body:s!==void 0?JSON.stringify(s):void 0});if(!i.ok){const a=await i.json().catch(()=>({error:i.statusText}));throw new Error(a.error||i.statusText)}return i.json()}async del(e){const s=await fetch(this.url(e),{method:"DELETE"});if(!s.ok){const i=await s.json().catch(()=>({error:s.statusText}));throw new Error(i.error||s.statusText)}return s.json()}streamChat(e,s){const i=new AbortController;return(async()=>{try{if(!this._chatSessionId){const v=await fetch(this.url("/api/sessions"),{method:"POST",headers:{"Content-Type":"application/json"},signal:i.signal});if(!v.ok){s.onError?.(`Failed to create session: ${v.statusText}`);return}const f=await v.json();this._chatSessionId=f.id}const a=await fetch(this.url(`/api/sessions/${this._chatSessionId}/messages/stream`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e}),signal:i.signal});if(!a.ok||!a.body){a.status===404?(this._chatSessionId=null,s.onError?.("Session expired. Please try again.")):s.onError?.(`HTTP ${a.status}: ${a.statusText}`);return}const o=a.body.getReader(),r=new TextDecoder;let u="";for(;;){const{done:v,value:f}=await o.read();if(v)break;u+=r.decode(f,{stream:!0});const m=u.split(`
4
+ `);u=m.pop()||"";let g="",y="";for(const $ of m)$.startsWith("event: ")?g=$.slice(7).trim():$.startsWith("data: ")?(y=$.slice(6),g&&y&&(this._handleSSEEvent(g,y,s),g="",y="")):$===""&&(g="",y="")}}catch(a){if(a.name==="AbortError")return;s.onError?.(a.message||"Stream error")}})(),{abort:()=>i.abort()}}_handleSSEEvent(e,s,i){let a;try{a=JSON.parse(s)}catch{return}switch(e){case"connected":break;case"text_delta":a.text&&i.onDelta(a.text);break;case"tool_start":i.onToolStart?.(a);break;case"tool_end":i.onToolEnd?.(a);break;case"compaction_start":i.onCompactionStart?.();break;case"compaction_end":i.onCompactionEnd?.(a);break;case"done":i.onDone?.(a);break;case"error":i.onError?.(a.message||"Unknown error");break}}streamLogs(e){const s=new EventSource(this.url("/api/logs/stream"));return s.onopen=()=>e.onConnect?.(),s.onmessage=i=>{try{e.onLog(JSON.parse(i.data))}catch{e.onLog({message:i.data})}},s.onerror=()=>e.onError?.("Log stream disconnected"),{close:()=>s.close()}}}const p=new _e;async function Ae(t){try{const[e,s]=await Promise.all([p.get("/api/status"),p.get("/api/version")]);t.statusResponse=e,t.versionInfo=s,t.serverStatus={online:!0,version:s.version,uptime:e.agent.uptime,userId:e.agent.userId,cronRunning:e.cron.isRunning,cronJobs:e.cron.trackedJobs,heartbeatEnabled:e.heartbeat.enabled,skills:e.skills}}catch{t.serverStatus={online:!1,version:"?",uptime:0,userId:"",cronRunning:!1,cronJobs:0,heartbeatEnabled:!1,skills:{total:0,eligible:0}}}}async function At(t){const[e,s,i,a,o,r]=await Promise.allSettled([p.get("/api/status"),p.get("/api/version"),p.get("/api/db/activity/stats"),p.get("/api/db/projects",{limit:"100"}),p.get("/api/db/activity",{limit:"5"}),p.get("/api/agent/session").catch(()=>null)]);e.status==="fulfilled"&&(t.statusResponse=e.value),s.status==="fulfilled"&&(t.versionInfo=s.value),e.status==="fulfilled"&&s.status==="fulfilled"?t.serverStatus={online:!0,version:s.value.version,uptime:e.value.agent.uptime,userId:e.value.agent.userId,cronRunning:e.value.cron.isRunning,cronJobs:e.value.cron.trackedJobs,heartbeatEnabled:e.value.heartbeat.enabled,skills:e.value.skills}:s.status==="fulfilled"&&(t.serverStatus={online:!0,version:s.value.version,uptime:s.value.uptime,userId:"",cronRunning:!1,cronJobs:0,heartbeatEnabled:!1,skills:{total:0,eligible:0}}),i.status==="fulfilled"&&(t.activityStats=i.value),a.status==="fulfilled"&&(t.projectCount=a.value.length,t.activeProject=a.value.find(u=>u.is_active)||null),o.status==="fulfilled"&&(t.recentActivity=o.value),r.status==="fulfilled"&&r.value&&(t.sessionInfo=r.value)}async function Ee(t){if(confirm("Compact the agent's conversation context? This will summarize older turns."))try{const e=await p.post("/api/agent/compact"),s=e.message||(e.tokensBefore?`Compacted: ${e.tokensBefore} → ${e.tokensAfter} tokens`:"Compaction complete");alert(s);try{t.sessionInfo=await p.get("/api/agent/session")}catch{}}catch(e){alert(`Error: ${e.message}`)}}async function Me(t){if(confirm("WARNING: This will reset the agent's entire conversation memory. Are you sure?")&&confirm("This is irreversible. The agent will lose all conversation context. Proceed?"))try{await p.post("/api/agent/reset-session"),alert("Session has been reset.");try{t.sessionInfo=await p.get("/api/agent/session")}catch{}}catch(e){alert(`Error: ${e.message}`)}}async function Le(t){try{await p.post("/api/update",{version:"latest"}),alert("Update triggered. The page will reload in 8 seconds..."),setTimeout(()=>window.location.reload(),8e3)}catch(e){alert(`Update failed: ${e.message}`)}}async function K(t){t.cronLoading=!0;try{t.cronJobs=await p.get("/api/cron/jobs")}catch{t.cronJobs=[]}t.cronLoading=!1}async function Te(t){t.cronLoading=!0;try{const e=t.cronForm;await p.post("/api/cron/jobs",{name:e.name||"Untitled",instruction:e.instruction,schedule_type:e.scheduleType,every:e.scheduleType==="every"?e.every:void 0,cron_expression:e.scheduleType==="cron"?e.cronExpression:void 0,at:e.scheduleType==="at"?e.at:void 0}),t.cronForm={...xt},await K(t)}catch(e){alert(`Failed to create job: ${e.message}`)}t.cronLoading=!1}async function De(t,e){try{await p.post(`/api/cron/jobs/${e}/run`)}catch(s){alert(`Failed to run job: ${s.message}`)}}async function Re(t,e){if(confirm("Delete this cron job?"))try{await p.del(`/api/cron/jobs/${e}`),await K(t)}catch(s){alert(`Failed to delete job: ${s.message}`)}}async function Fe(t,e,s){t.cronHistoryJob=s,t.cronHistoryOpen=!0;try{t.cronHistory=await p.get("/api/cron/history",{jobId:e,limit:"50"})}catch{t.cronHistory=[]}}async function st(t){t.activityLoading=!0,t.activityOffset=0;try{const e={limit:"50",offset:"0"};t.activityStatusFilter&&(e.status=t.activityStatusFilter);const[s,i]=await Promise.allSettled([p.get("/api/db/activity",e),p.get("/api/db/activity/stats")]);s.status==="fulfilled"&&(t.activityList=s.value,t.activityHasMore=s.value.length>=50),i.status==="fulfilled"&&(t.activityStats=i.value)}catch{t.activityList=[]}t.activityLoading=!1}async function Pe(t){t.activityOffset+=50;try{const e={limit:"50",offset:String(t.activityOffset)};t.activityStatusFilter&&(e.status=t.activityStatusFilter);const s=await p.get("/api/db/activity",e);t.activityList=[...t.activityList,...s],t.activityHasMore=s.length>=50}catch{t.activityHasMore=!1}}async function Oe(t){if(!t.activitySearch.trim()){await st(t);return}t.activityLoading=!0;try{t.activityList=await p.get("/api/db/activity/search",{q:t.activitySearch,limit:"50"}),t.activityHasMore=!1}catch{t.activityList=[]}t.activityLoading=!1}async function Et(t){t.assetsLoading=!0;try{t.assetsList=await p.get("/api/db/assets",{limit:"100"})}catch{t.assetsList=[]}t.assetsLoading=!1}async function Mt(t){t.projectsLoading=!0;try{t.projectsList=await p.get("/api/db/projects",{limit:"100"})}catch{t.projectsList=[]}t.projectsLoading=!1}async function Lt(t){t.sessionsLoading=!0;try{const e=await p.get("/api/sessions/files");t.sessionsList=(e.files||[]).map(s=>({name:s.filename||s.name,size:s.sizeBytes||s.size,modified:s.modifiedAt||s.modified,turns:s.turns}))}catch{t.sessionsList=[]}t.sessionsLoading=!1}async function Be(t,e){t.sessionDetailName=e,t.sessionViewMode="parsed",t.sessionRawContent="";try{const s=await p.get(`/api/sessions/files/${encodeURIComponent(e)}/parsed`);t.sessionDetail=s.turns||s}catch{t.sessionDetail=[]}Ne(t)}async function Tt(t){if(t.sessionDetailName)try{const i=(await p.getText(`/api/sessions/files/${encodeURIComponent(t.sessionDetailName)}`)).trim().split(`
5
+ `).map(a=>{try{return JSON.stringify(JSON.parse(a),null,2)}catch{return a}}).join(`
6
+ ---
7
+ `);t.sessionRawContent=i}catch{t.sessionRawContent="Error loading raw content"}}function He(t,e){t.sessionViewMode=e,e==="raw"&&!t.sessionRawContent&&Tt(t)}function Ue(t){it(t),t.sessionDetail=null,t.sessionDetailName="",t.sessionRawContent=""}function Ne(t){it(t),t._sessionPollTimer=setInterval(async()=>{if(t.sessionDetailName)try{if(t.sessionViewMode==="parsed"){const e=await p.get(`/api/sessions/files/${encodeURIComponent(t.sessionDetailName)}/parsed`);t.sessionDetail=e.turns||e}}catch{}},3e3)}function it(t){t._sessionPollTimer&&(clearInterval(t._sessionPollTimer),t._sessionPollTimer=null)}async function Dt(t){t.workspaceLoading=!0;try{const e=await p.get("/api/workspace/files");t.workspaceFiles=e.files||[]}catch{t.workspaceFiles=[]}t.workspaceLoading=!1}async function Ie(t,e){t.workspaceEditingFile=e;try{const s=await p.get(`/api/workspace/files/${encodeURIComponent(e)}`);t.workspaceEditContent=s.content||""}catch{t.workspaceEditContent="(Failed to load file)"}}async function Ve(t){t.workspaceSaving=!0;try{await p.put(`/api/workspace/files/${encodeURIComponent(t.workspaceEditingFile)}`,{content:t.workspaceEditContent})}catch(e){alert(`Failed to save: ${e.message}`)}t.workspaceSaving=!1}async function Rt(t){t.skillsLoading=!0;try{const e=await p.get("/api/skills");t.skillsList=Array.isArray(e)?e:e.skills||[]}catch{t.skillsList=[]}t.skillsLoading=!1}async function je(t,e){t.skillDetailOpen=!0,t.skillFileTab=0;try{const s=await p.get(`/api/skills/${encodeURIComponent(e)}`);t.skillDetail=s}catch{t.skillDetail=null}}function ze(t){t.skillDetailOpen=!1,t.skillDetail=null,t.skillFileTab=0}async function Ft(t){t.configLoading=!0;try{t.configData=await p.get("/api/config")}catch{t.configData={}}t.configLoading=!1}async function W(t){t.envLoading=!0;try{const e=await p.get("/api/env"),s=[];if(Array.isArray(e))for(const i of e)s.push({key:i.key,value:i.value||"",source:i.source||"user"});else if(e&&typeof e=="object")if(e.variables&&Array.isArray(e.variables))for(const i of e.variables)s.push({key:i.key,value:i.value||"",source:i.source||"user"});else for(const[i,a]of Object.entries(e))s.push({key:i,value:String(a||""),source:Ye(i)?"platform":"user"});t.envVars=s}catch{t.envVars=[]}t.envLoading=!1}async function Je(t,e){if(t.envRevealedKeys[e]){const s={...t.envRevealedKeys};delete s[e],t.envRevealedKeys=s;return}try{const s=await p.get(`/api/env/${encodeURIComponent(e)}`);t.envRevealedKeys={...t.envRevealedKeys,[e]:s.value||String(s)},setTimeout(()=>{const i={...t.envRevealedKeys};delete i[e],t.envRevealedKeys=i},1e4)}catch{}}function Ke(t){t.envModalOpen=!0,t.envModalKey="",t.envModalValue="",t.envModalEditing=!1}function We(t,e){const s=t.envVars.find(i=>i.key===e);t.envModalOpen=!0,t.envModalKey=e,t.envModalValue=s?.value||"",t.envModalEditing=!0}function Pt(t){t.envModalOpen=!1,t.envModalKey="",t.envModalValue="",t.envModalEditing=!1}async function qe(t){const e=t.envModalKey.trim().toUpperCase(),s=t.envModalValue;if(!e||!/^[A-Z0-9_]+$/.test(e)){alert("Key must be uppercase letters, numbers, and underscores only");return}try{t.envModalEditing?await p.put(`/api/env/${encodeURIComponent(e)}`,{value:s}):await p.post("/api/env",{key:e,value:s}),Pt(t),await W(t)}catch(i){alert(`Error: ${i.message}`)}}async function Ze(t,e){if(confirm(`Delete environment variable "${e}"?`))try{await p.del(`/api/env/${encodeURIComponent(e)}`),await W(t)}catch(s){alert(`Error: ${s.message}`)}}async function Ge(t){t.updating=!0,t.updateResult="";try{const e=await p.post("/api/update",{version:"latest"});t.updateResult=e.stdout||e.message||"Update triggered. The executor will restart."}catch(e){t.updateResult=`Error: ${e.message}`}t.updating=!1}function Ye(t){return["ANTHROPIC_API_KEY","SUPABASE_URL","SUPABASE_KEY","SUPABASE_SERVICE_ROLE_KEY","USER_ID","SANDBOX_ID","NODE_ENV","PORT","OPENAI_API_KEY","S3_BUCKET","S3_ACCESS_KEY","S3_SECRET_KEY","S3_ENDPOINT"].includes(t)}async function Ot(t){try{const e={limit:"200"};t.logComponentFilter&&(e.component=t.logComponentFilter),t.logFilter&&(e.level=t.logFilter);const s=await p.get("/api/logs",e);if(Array.isArray(s)){t.logEntries=s;const i=new Set;for(const a of s){const o=a?.component;o&&i.add(o)}t.logComponents=Array.from(i).sort()}}catch{}}function Bt(t){t.logStream&&(t.logStream.close(),t.logStream=null),t.logStreaming=!0,t.logStream=p.streamLogs({onLog:e=>{const s=e?.component;if(s&&!t.logComponents.includes(s)&&(t.logComponents=[...t.logComponents,s].sort()),!(t.logComponentFilter&&(e?.component||"")!==t.logComponentFilter)){if(t.logFilter){const i=(e?.level||"").toLowerCase();if(t.logFilter==="error"&&i!=="error"&&i!=="fatal"||t.logFilter==="warn"&&i!=="warn"&&i!=="error"&&i!=="fatal"||t.logFilter==="info"&&i!=="info"||t.logFilter==="debug"&&i!=="debug")return}t.logEntries=[e,...t.logEntries.slice(0,499)]}},onError:()=>{t.logStreaming=!1}})}function Ht(t){t.logStream?.close(),t.logStream=null,t.logStreaming=!1}function Xe(t,e){const s=t.tab;if(e===s)return;t.tab=e,s==="sessions"&&it(t),s==="logs"&&Ht(t);const i=we(e);history.pushState(null,"",i),at(t)}function Qe(t,e){t.theme=e,t.themeResolved=_t(e),Ut(t.themeResolved),t.settings={...t.settings,theme:e},fe(t.settings)}function ts(t){const e=Ct(window.location.pathname);e&&e!==t.tab&&(t.tab=e,at(t))}async function at(t){switch(t.tab){case"dashboard":await At(t);break;case"cron":await K(t);break;case"activity":await st(t);break;case"assets":await Et(t);break;case"projects":await Mt(t);break;case"sessions":await Lt(t);break;case"workspace":await Dt(t);break;case"skills":await Rt(t);break;case"config":await Ft(t),await W(t);break;case"logs":await Ot(t),Bt(t);break}}function es(t){t.theme=t.settings.theme,t.themeResolved=_t(t.theme),Ut(t.themeResolved);const e=Ct(window.location.pathname);e&&(t.tab=e),Ae(t),at(t)}function ss(t){t.logStream?.close(),t.logStream=null,t._sessionPollTimer&&(clearInterval(t._sessionPollTimer),t._sessionPollTimer=null),t.popStateHandler&&(window.removeEventListener("popstate",t.popStateHandler),t.popStateHandler=null)}function Ut(t){document.documentElement.setAttribute("data-theme",t)}function is(t){return t.chatSending||t.chatLoading}async function as(t,e){const s=e||t.chatMessage.trim();if(!s||is(t))return;t.chatMessages=[...t.chatMessages,{role:"user",content:s}],t.chatMessage="",t.chatSending=!0,t.chatStream="",t.chatStreamFlow=[{type:"text",content:""}],t.chatButtonLabel="Thinking...",t.chatCompacting=!1;let i=0;t.chatAbort=p.streamChat(s,{onDelta:a=>{t.chatStream=(t.chatStream||"")+a;const o=[...t.chatStreamFlow],r=o[o.length-1];r&&r.type==="text"?o[o.length-1]={type:"text",content:r.content+a}:o.push({type:"text",content:a}),t.chatStreamFlow=o},onToolStart:a=>{i++,t.chatButtonLabel=`Tool ${i}...`;const o={id:a.toolCallId||`tool-${i}`,name:a.name||"tool",args:a.args?JSON.stringify(a.args,null,2):void 0,status:"running"};t.chatStreamFlow=[...t.chatStreamFlow,{type:"tool",card:o},{type:"text",content:""}]},onToolEnd:a=>{const o=[...t.chatStreamFlow],r=o.find(u=>u.type==="tool"&&u.card.id===(a.toolCallId||`tool-${a.index}`));r&&(r.card={...r.card,status:a.isError?"error":"done",result:a.result,durationMs:a.durationMs}),t.chatStreamFlow=o},onCompactionStart:()=>{t.chatCompacting=!0},onCompactionEnd:()=>{t.chatCompacting=!1},onDone:a=>{const r={role:"assistant",content:t.chatStream||a.response||"",flow:t.chatStreamFlow.filter(u=>!(u.type==="text"&&!u.content)),meta:{toolCalls:a.toolCalls||i,inputTokens:a.inputTokens,outputTokens:a.outputTokens,compactionCount:a.compactionCount}};t.chatMessages=[...t.chatMessages,r],t.chatStream=null,t.chatStreamFlow=[],t.chatSending=!1,t.chatAbort=null,t.chatButtonLabel="",t.chatCompacting=!1},onError:a=>{t.chatMessages=[...t.chatMessages,{role:"assistant",content:`Error: ${a}`}],t.chatStream=null,t.chatStreamFlow=[],t.chatSending=!1,t.chatAbort=null,t.chatButtonLabel="",t.chatCompacting=!1}})}function ns(t){t.chatAbort?.abort(),t.chatStream=null,t.chatStreamFlow=[],t.chatSending=!1,t.chatAbort=null,t.chatButtonLabel="",t.chatCompacting=!1}async function os(t,e){await as(t,e)}function rs(t){ns(t)}const ls={messageSquare:n`
8
+ <svg viewBox="0 0 24 24">
9
+ <path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />
10
+ </svg>
11
+ `,barChart:n`
12
+ <svg viewBox="0 0 24 24">
13
+ <line x1="12" x2="12" y1="20" y2="10" />
14
+ <line x1="18" x2="18" y1="20" y2="4" />
15
+ <line x1="6" x2="6" y1="20" y2="16" />
16
+ </svg>
17
+ `,link:n`
18
+ <svg viewBox="0 0 24 24">
19
+ <path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" />
20
+ <path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" />
21
+ </svg>
22
+ `,radio:n`
23
+ <svg viewBox="0 0 24 24">
24
+ <circle cx="12" cy="12" r="2" />
25
+ <path
26
+ d="M16.24 7.76a6 6 0 0 1 0 8.49m-8.48-.01a6 6 0 0 1 0-8.49m11.31-2.82a10 10 0 0 1 0 14.14m-14.14 0a10 10 0 0 1 0-14.14"
27
+ />
28
+ </svg>
29
+ `,fileText:n`
30
+ <svg viewBox="0 0 24 24">
31
+ <path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" />
32
+ <polyline points="14 2 14 8 20 8" />
33
+ <line x1="16" x2="8" y1="13" y2="13" />
34
+ <line x1="16" x2="8" y1="17" y2="17" />
35
+ <line x1="10" x2="8" y1="9" y2="9" />
36
+ </svg>
37
+ `,zap:n`
38
+ <svg viewBox="0 0 24 24"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" /></svg>
39
+ `,monitor:n`
40
+ <svg viewBox="0 0 24 24">
41
+ <rect width="20" height="14" x="2" y="3" rx="2" />
42
+ <line x1="8" x2="16" y1="21" y2="21" />
43
+ <line x1="12" x2="12" y1="17" y2="21" />
44
+ </svg>
45
+ `,settings:n`
46
+ <svg viewBox="0 0 24 24">
47
+ <path
48
+ d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"
49
+ />
50
+ <circle cx="12" cy="12" r="3" />
51
+ </svg>
52
+ `,bug:n`
53
+ <svg viewBox="0 0 24 24">
54
+ <path d="m8 2 1.88 1.88" />
55
+ <path d="M14.12 3.88 16 2" />
56
+ <path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1" />
57
+ <path d="M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6" />
58
+ <path d="M12 20v-9" />
59
+ <path d="M6.53 9C4.6 8.8 3 7.1 3 5" />
60
+ <path d="M6 13H2" />
61
+ <path d="M3 21c0-2.1 1.7-3.9 3.8-4" />
62
+ <path d="M20.97 5c0 2.1-1.6 3.8-3.5 4" />
63
+ <path d="M22 13h-4" />
64
+ <path d="M17.2 17c2.1.1 3.8 1.9 3.8 4" />
65
+ </svg>
66
+ `,scrollText:n`
67
+ <svg viewBox="0 0 24 24">
68
+ <path d="M8 21h12a2 2 0 0 0 2-2v-2H10v2a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v3h4" />
69
+ <path d="M19 17V5a2 2 0 0 0-2-2H4" />
70
+ <path d="M15 8h-5" />
71
+ <path d="M15 12h-5" />
72
+ </svg>
73
+ `,folder:n`
74
+ <svg viewBox="0 0 24 24">
75
+ <path
76
+ d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"
77
+ />
78
+ </svg>
79
+ `,menu:n`
80
+ <svg viewBox="0 0 24 24">
81
+ <line x1="4" x2="20" y1="12" y2="12" />
82
+ <line x1="4" x2="20" y1="6" y2="6" />
83
+ <line x1="4" x2="20" y1="18" y2="18" />
84
+ </svg>
85
+ `,x:n`
86
+ <svg viewBox="0 0 24 24">
87
+ <path d="M18 6 6 18" />
88
+ <path d="m6 6 12 12" />
89
+ </svg>
90
+ `,check:n`
91
+ <svg viewBox="0 0 24 24"><path d="M20 6 9 17l-5-5" /></svg>
92
+ `,arrowDown:n`
93
+ <svg viewBox="0 0 24 24">
94
+ <path d="M12 5v14" />
95
+ <path d="m19 12-7 7-7-7" />
96
+ </svg>
97
+ `,copy:n`
98
+ <svg viewBox="0 0 24 24">
99
+ <rect width="14" height="14" x="8" y="8" rx="2" ry="2" />
100
+ <path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />
101
+ </svg>
102
+ `,search:n`
103
+ <svg viewBox="0 0 24 24">
104
+ <circle cx="11" cy="11" r="8" />
105
+ <path d="m21 21-4.3-4.3" />
106
+ </svg>
107
+ `,brain:n`
108
+ <svg viewBox="0 0 24 24">
109
+ <path d="M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z" />
110
+ <path d="M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z" />
111
+ <path d="M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4" />
112
+ <path d="M17.599 6.5a3 3 0 0 0 .399-1.375" />
113
+ <path d="M6.003 5.125A3 3 0 0 0 6.401 6.5" />
114
+ <path d="M3.477 10.896a4 4 0 0 1 .585-.396" />
115
+ <path d="M19.938 10.5a4 4 0 0 1 .585.396" />
116
+ <path d="M6 18a4 4 0 0 1-1.967-.516" />
117
+ <path d="M19.967 17.484A4 4 0 0 1 18 18" />
118
+ </svg>
119
+ `,book:n`
120
+ <svg viewBox="0 0 24 24">
121
+ <path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20" />
122
+ </svg>
123
+ `,loader:n`
124
+ <svg viewBox="0 0 24 24">
125
+ <path d="M12 2v4" />
126
+ <path d="m16.2 7.8 2.9-2.9" />
127
+ <path d="M18 12h4" />
128
+ <path d="m16.2 16.2 2.9 2.9" />
129
+ <path d="M12 18v4" />
130
+ <path d="m4.9 19.1 2.9-2.9" />
131
+ <path d="M2 12h4" />
132
+ <path d="m4.9 4.9 2.9 2.9" />
133
+ </svg>
134
+ `,wrench:n`
135
+ <svg viewBox="0 0 24 24">
136
+ <path
137
+ d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"
138
+ />
139
+ </svg>
140
+ `,fileCode:n`
141
+ <svg viewBox="0 0 24 24">
142
+ <path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" />
143
+ <polyline points="14 2 14 8 20 8" />
144
+ <path d="m10 13-2 2 2 2" />
145
+ <path d="m14 17 2-2-2-2" />
146
+ </svg>
147
+ `,edit:n`
148
+ <svg viewBox="0 0 24 24">
149
+ <path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" />
150
+ <path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" />
151
+ </svg>
152
+ `,penLine:n`
153
+ <svg viewBox="0 0 24 24">
154
+ <path d="M12 20h9" />
155
+ <path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z" />
156
+ </svg>
157
+ `,paperclip:n`
158
+ <svg viewBox="0 0 24 24">
159
+ <path
160
+ d="m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"
161
+ />
162
+ </svg>
163
+ `,globe:n`
164
+ <svg viewBox="0 0 24 24">
165
+ <circle cx="12" cy="12" r="10" />
166
+ <path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20" />
167
+ <path d="M2 12h20" />
168
+ </svg>
169
+ `,image:n`
170
+ <svg viewBox="0 0 24 24">
171
+ <rect width="18" height="18" x="3" y="3" rx="2" ry="2" />
172
+ <circle cx="9" cy="9" r="2" />
173
+ <path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" />
174
+ </svg>
175
+ `,smartphone:n`
176
+ <svg viewBox="0 0 24 24">
177
+ <rect width="14" height="20" x="5" y="2" rx="2" ry="2" />
178
+ <path d="M12 18h.01" />
179
+ </svg>
180
+ `,plug:n`
181
+ <svg viewBox="0 0 24 24">
182
+ <path d="M12 22v-5" />
183
+ <path d="M9 8V2" />
184
+ <path d="M15 8V2" />
185
+ <path d="M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z" />
186
+ </svg>
187
+ `,circle:n`
188
+ <svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" /></svg>
189
+ `,puzzle:n`
190
+ <svg viewBox="0 0 24 24">
191
+ <path
192
+ d="M19.439 7.85c-.049.322.059.648.289.878l1.568 1.568c.47.47.706 1.087.706 1.704s-.235 1.233-.706 1.704l-1.611 1.611a.98.98 0 0 1-.837.276c-.47-.07-.802-.48-.968-.925a2.501 2.501 0 1 0-3.214 3.214c.446.166.855.497.925.968a.979.979 0 0 1-.276.837l-1.61 1.61a2.404 2.404 0 0 1-1.705.707 2.402 2.402 0 0 1-1.704-.706l-1.568-1.568a1.026 1.026 0 0 0-.877-.29c-.493.074-.84.504-1.02.968a2.5 2.5 0 1 1-3.237-3.237c.464-.18.894-.527.967-1.02a1.026 1.026 0 0 0-.289-.877l-1.568-1.568A2.402 2.402 0 0 1 1.998 12c0-.617.236-1.234.706-1.704L4.23 8.77c.24-.24.581-.353.917-.303.515.076.874.54 1.02 1.02a2.5 2.5 0 1 0 3.237-3.237c-.48-.146-.944-.505-1.02-1.02a.98.98 0 0 1 .303-.917l1.526-1.526A2.402 2.402 0 0 1 11.998 2c.617 0 1.234.236 1.704.706l1.568 1.568c.23.23.556.338.877.29.493-.074.84-.504 1.02-.968a2.5 2.5 0 1 1 3.236 3.236c-.464.18-.894.527-.967 1.02Z"
193
+ />
194
+ </svg>
195
+ `,activity:n`
196
+ <svg viewBox="0 0 24 24">
197
+ <path d="M22 12h-4l-3 9L9 3l-3 9H2" />
198
+ </svg>
199
+ `,database:n`
200
+ <svg viewBox="0 0 24 24">
201
+ <ellipse cx="12" cy="5" rx="9" ry="3" />
202
+ <path d="M3 5V19A9 3 0 0 0 21 19V5" />
203
+ <path d="M3 12A9 3 0 0 0 21 12" />
204
+ </svg>
205
+ `,package:n`
206
+ <svg viewBox="0 0 24 24">
207
+ <path d="m7.5 4.27 9 5.15" />
208
+ <path d="M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z" />
209
+ <path d="m3.3 7 8.7 5 8.7-5" />
210
+ <path d="M12 22V12" />
211
+ </svg>
212
+ `,play:n`
213
+ <svg viewBox="0 0 24 24"><polygon points="5 3 19 12 5 21 5 3" /></svg>
214
+ `,trash:n`
215
+ <svg viewBox="0 0 24 24">
216
+ <path d="M3 6h18" />
217
+ <path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" />
218
+ <path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" />
219
+ </svg>
220
+ `,clock:n`
221
+ <svg viewBox="0 0 24 24">
222
+ <circle cx="12" cy="12" r="10" />
223
+ <polyline points="12 6 12 12 16 14" />
224
+ </svg>
225
+ `,send:n`
226
+ <svg viewBox="0 0 24 24">
227
+ <path d="m22 2-7 20-4-9-9-4Z" />
228
+ <path d="M22 2 11 13" />
229
+ </svg>
230
+ `,sun:n`
231
+ <svg viewBox="0 0 24 24">
232
+ <circle cx="12" cy="12" r="4" />
233
+ <path d="M12 2v2" /><path d="M12 20v2" />
234
+ <path d="m4.93 4.93 1.41 1.41" /><path d="m17.66 17.66 1.41 1.41" />
235
+ <path d="M2 12h2" /><path d="M20 12h2" />
236
+ <path d="m6.34 17.66-1.41 1.41" /><path d="m19.07 4.93-1.41 1.41" />
237
+ </svg>
238
+ `,moon:n`
239
+ <svg viewBox="0 0 24 24"><path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z" /></svg>
240
+ `,chevronDown:n`
241
+ <svg viewBox="0 0 24 24"><path d="m6 9 6 6 6-6" /></svg>
242
+ `,chevronRight:n`
243
+ <svg viewBox="0 0 24 24"><path d="m9 18 6-6-6-6" /></svg>
244
+ `,refresh:n`
245
+ <svg viewBox="0 0 24 24">
246
+ <path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" />
247
+ <path d="M21 3v5h-5" />
248
+ <path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" />
249
+ <path d="M8 16H3v5" />
250
+ </svg>
251
+ `,terminal:n`
252
+ <svg viewBox="0 0 24 24">
253
+ <polyline points="4 17 10 11 4 5" />
254
+ <line x1="12" x2="20" y1="19" y2="19" />
255
+ </svg>
256
+ `,home:n`
257
+ <svg viewBox="0 0 24 24">
258
+ <path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
259
+ <polyline points="9 22 9 12 15 12 15 22" />
260
+ </svg>
261
+ `,save:n`
262
+ <svg viewBox="0 0 24 24">
263
+ <path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z" />
264
+ <polyline points="17 21 17 13 7 13 7 21" />
265
+ <polyline points="7 3 7 8 15 8" />
266
+ </svg>
267
+ `,plus:n`
268
+ <svg viewBox="0 0 24 24">
269
+ <path d="M5 12h14" />
270
+ <path d="M12 5v14" />
271
+ </svg>
272
+ `,externalLink:n`
273
+ <svg viewBox="0 0 24 24">
274
+ <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" />
275
+ <polyline points="15 3 21 3 21 9" />
276
+ <line x1="10" x2="21" y1="14" y2="3" />
277
+ </svg>
278
+ `,stop:n`
279
+ <svg viewBox="0 0 24 24"><rect width="14" height="14" x="5" y="5" rx="2" /></svg>
280
+ `};function N(t,e="nav-item__icon"){return n`<span class=${e} aria-hidden="true">${ls[t]}</span>`}function cs(t){return n`
281
+ <header class="topbar">
282
+ <div class="topbar__left">
283
+ <span class="topbar__brand">CoStar</span>
284
+ ${t.serverStatus?.version?n`<span class="topbar__version">v${t.serverStatus.version}</span>`:l}
285
+ </div>
286
+ <div class="topbar__right">
287
+ ${vs(t)}
288
+ <span class="topbar__status ${t.serverStatus?.status==="running"?"status--ok":""}">
289
+ ${t.serverStatus?.status||"..."}
290
+ </span>
291
+ </div>
292
+ </header>
293
+ `}function ds(t){return n`
294
+ <nav class="nav">
295
+ ${me.map(e=>n`
296
+ <div class="nav-group">
297
+ <div class="nav-group__label">${ke(e.label)}</div>
298
+ ${e.tabs.map(s=>hs(t,s))}
299
+ </div>
300
+ `)}
301
+ </nav>
302
+ `}function hs(t,e){return n`
303
+ <button
304
+ class="nav-item ${t.tab===e?"active":""}"
305
+ @click=${()=>t.setTab(e)}
306
+ >
307
+ ${N(Se(e))}
308
+ <span>${xe(e)}</span>
309
+ </button>
310
+ `}function vs(t){return n`
311
+ <div class="theme-toggle" style="display: flex; gap: 4px; margin-right: 12px;">
312
+ <button
313
+ class="btn btn-sm ${t.theme==="light"?"btn-primary":""}"
314
+ @click=${()=>t.setTheme("light")}
315
+ title="Light theme"
316
+ >
317
+ ${N("sun","btn-icon")}
318
+ </button>
319
+ <button
320
+ class="btn btn-sm ${t.theme==="dark"?"btn-primary":""}"
321
+ @click=${()=>t.setTheme("dark")}
322
+ title="Dark theme"
323
+ >
324
+ ${N("moon","btn-icon")}
325
+ </button>
326
+ <button
327
+ class="btn btn-sm ${t.theme==="system"?"btn-primary":""}"
328
+ @click=${()=>t.setTheme("system")}
329
+ title="System theme"
330
+ >
331
+ ${N("monitor","btn-icon")}
332
+ </button>
333
+ </div>
334
+ `}function _(t){const e=typeof t=="number"?new Date(t):new Date(t),i=Date.now()-e.getTime();return i<0||i<6e4?"just now":i<36e5?`${Math.floor(i/6e4)}m ago`:i<864e5?`${Math.floor(i/36e5)}h ago`:i<6048e5?`${Math.floor(i/864e5)}d ago`:e.toLocaleDateString()}function j(t){if(t<1e3)return`${t}ms`;if(t<6e4)return`${(t/1e3).toFixed(1)}s`;if(t<36e5){const i=Math.floor(t/6e4),a=Math.round(t%6e4/1e3);return a>0?`${i}m ${a}s`:`${i}m`}const e=Math.floor(t/36e5),s=Math.round(t%36e5/6e4);return s>0?`${e}h ${s}m`:`${e}h`}function nt(t,e=120){return t.length<=e?t:`${t.slice(0,Math.max(0,e-1))}…`}function Nt(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function ps(t){const e=t.serverStatus,s=t.statusResponse,i=t.versionInfo;return n`
335
+ <div class="dashboard-grid" style="animation: dashboard-enter 0.4s var(--ease-out) both;">
336
+ <!-- Update Banner -->
337
+ ${i?n`
338
+ <div class="update-banner">
339
+ <span>v${i.version}</span>
340
+ <span style="color:var(--text-secondary);">&#8226;</span>
341
+ <span style="color:var(--text-secondary);">Auto-update: ${i.autoUpdateEnabled?"enabled":"disabled"}</span>
342
+ ${i.updateInProgress?n`<span class="tag tag-yellow" style="margin-left:8px;">Updating...</span>`:n`<button class="btn btn-sm" style="margin-left:8px;" @click=${()=>t.triggerManualUpdate()}>Update Now</button>`}
343
+ </div>
344
+ `:l}
345
+
346
+ <!-- Stat Cards (matching old HTML: Uptime, Cron, Skills, Memory) -->
347
+ <div class="stats-row">
348
+ ${H("Uptime",e?.uptime?j(e.uptime*1e3):"--",s?.agent?.platform?`${s.agent.platform} / ${s.agent.arch}`:"")}
349
+ ${H("Cron Jobs",e?String(e.cronJobs):"--",e?.cronRunning?"Scheduler running":"Scheduler stopped")}
350
+ ${H("Skills",e?.skills?`${e.skills.eligible} eligible`:"--",e?.skills?`${e.skills.total} total`:"")}
351
+ ${H("Memory",s?.agent?.memoryUsage?`${(s.agent.memoryUsage.heapUsed/1024/1024).toFixed(0)} MB`:"--",s?.agent?.memoryUsage?`${(s.agent.memoryUsage.heapTotal/1024/1024).toFixed(0)} MB total heap`:"")}
352
+ </div>
353
+
354
+ <!-- System Info -->
355
+ <div class="card">
356
+ <div class="card-header"><h3>System Info</h3></div>
357
+ <div class="config-list" style="padding:16px;">
358
+ ${b("Version",i?`v${i.version}`:"--")}
359
+ ${b("Auto-Update",i?i.autoUpdateEnabled?"Enabled":"Disabled":"--")}
360
+ ${b("User ID",e?.userId||"--")}
361
+ ${b("Workspace",s?.agent?.workspaceDir||"--")}
362
+ ${b("Node",s?.agent?.nodeVersion||i?.nodeVersion||"--")}
363
+ ${b("Platform",s?.agent?.platform?`${s.agent.platform} (${s.agent.arch})`:i?.platform||"--")}
364
+ ${b("Heartbeat",e?.heartbeatEnabled?"Enabled":"Disabled")}
365
+ ${b("Cron Status",e?.cronRunning?"Running":"Stopped")}
366
+ ${s?.cron?.lastCheckAt?b("Last Cron Check",new Date(s.cron.lastCheckAt).toLocaleString()):l}
367
+ </div>
368
+ </div>
369
+
370
+ <!-- Agent Session -->
371
+ <div class="card">
372
+ <div class="card-header">
373
+ <h3>Agent Session</h3>
374
+ </div>
375
+ <div class="config-list" style="padding:16px;">
376
+ ${t.sessionInfo?n`
377
+ ${b("Session",t.sessionInfo.exists?"Active":"No session")}
378
+ ${t.sessionInfo.size?b("Size",us(t.sessionInfo.size)):l}
379
+ ${t.sessionInfo.conversationLength!==void 0?b("Conversation Length",`${t.sessionInfo.conversationLength} turns`):l}
380
+ ${t.sessionInfo.isBusy!==void 0?b("Status",t.sessionInfo.isBusy?n`<span class="tag tag-yellow">Busy</span>`:n`<span class="tag tag-green">Idle</span>`):l}
381
+ `:n`
382
+ ${b("Session","Loading...")}
383
+ `}
384
+ </div>
385
+ <div style="padding:0 16px 16px;display:flex;gap:8px;">
386
+ <button class="btn btn-sm" @click=${()=>t.compactSession()}
387
+ ?disabled=${t.sessionInfo?.isBusy}>Compact Context</button>
388
+ <button class="btn btn-sm btn-danger" @click=${()=>t.resetSession()}
389
+ ?disabled=${t.sessionInfo?.isBusy}>Reset Session</button>
390
+ </div>
391
+ </div>
392
+
393
+ <!-- Recent Activity -->
394
+ ${t.recentActivity.length>0?n`
395
+ <div class="card">
396
+ <div class="card-header"><h3>Recent Activity</h3></div>
397
+ <div class="table-wrap">
398
+ <table>
399
+ <thead>
400
+ <tr><th>Time</th><th>Request</th><th>Status</th><th>Executor</th></tr>
401
+ </thead>
402
+ <tbody>
403
+ ${t.recentActivity.slice(0,5).map(a=>n`
404
+ <tr>
405
+ <td style="white-space:nowrap;">${_(a.created_at)}</td>
406
+ <td style="max-width:400px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">
407
+ ${(a.request||"").substring(0,80)}
408
+ </td>
409
+ <td>
410
+ <span class="tag ${a.status==="completed"?"tag-green":a.status==="failed"?"tag-red":"tag-yellow"}">
411
+ ${a.status}
412
+ </span>
413
+ </td>
414
+ <td>
415
+ <span class="tag ${a.executor==="client"?"tag-blue":"tag-muted"}">${a.executor}</span>
416
+ </td>
417
+ </tr>
418
+ `)}
419
+ </tbody>
420
+ </table>
421
+ </div>
422
+ </div>
423
+ `:l}
424
+ </div>
425
+ `}function H(t,e,s){return n`
426
+ <div class="stat-card">
427
+ <div class="stat-label">${t}</div>
428
+ <div class="stat-value">${e}</div>
429
+ ${s?n`<div class="stat-sub">${s}</div>`:l}
430
+ </div>
431
+ `}function b(t,e){return n`
432
+ <div class="config-row">
433
+ <span class="config-key">${t}</span>
434
+ <span class="config-value">${e}</span>
435
+ </div>
436
+ `}function us(t){return t?t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}KB`:`${(t/(1024*1024)).toFixed(1)}MB`:"--"}function gs(t){return n`
437
+ <div class="chat-container">
438
+ <div class="chat-messages" id="chat-messages">
439
+ ${t.chatMessages.length===0&&!t.chatSending?n`
440
+ <div class="empty-state">
441
+ <div class="empty-icon">&#128172;</div>
442
+ <p>Send a message to start chatting with your CoStar agent.</p>
443
+ </div>
444
+ `:l}
445
+
446
+ ${t.chatMessages.map(e=>ms(e))}
447
+
448
+ ${t.chatSending?fs(t):l}
449
+ </div>
450
+
451
+ ${t.chatCompacting?n`<div class="compaction-banner active">
452
+ <span class="compaction-icon">&#9881;</span>
453
+ <span class="compaction-text">Compacting conversation context...</span>
454
+ </div>`:l}
455
+
456
+ <div class="chat-input-wrap">
457
+ <input
458
+ type="text"
459
+ class="input"
460
+ style="flex:1;"
461
+ placeholder="Type a message..."
462
+ .value=${t.chatMessage}
463
+ @input=${e=>{t.chatMessage=e.target.value}}
464
+ @keydown=${e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),t.handleSendChat())}}
465
+ ?disabled=${t.chatSending}
466
+ />
467
+ ${t.chatSending?n`<button class="btn btn-danger" @click=${()=>t.abortChat()}>
468
+ ${t.chatButtonLabel||"Stop"}
469
+ </button>`:n`<button class="btn btn-primary" @click=${()=>t.handleSendChat()} ?disabled=${!t.chatMessage.trim()}>Send</button>`}
470
+ </div>
471
+ </div>
472
+ `}function fs(t){return n`
473
+ <div class="chat-msg assistant">
474
+ <div class="avatar">C</div>
475
+ <div class="msg-content">
476
+ <div class="msg-role">CoStar</div>
477
+ <div class="msg-flow">
478
+ ${t.chatStreamFlow.map(e=>e.type==="text"?n`<div class="msg-text-segment streaming-cursor" .innerHTML=${G(e.content)}></div>`:It(e.card))}
479
+ </div>
480
+ </div>
481
+ </div>
482
+ `}function ms(t){if(t.role==="user")return n`
483
+ <div class="chat-msg user">
484
+ <div class="avatar">U</div>
485
+ <div class="msg-content">
486
+ <div class="msg-role">You</div>
487
+ <div>${Nt(t.content)}</div>
488
+ </div>
489
+ </div>
490
+ `;const s=t.flow&&t.flow.length>0;return n`
491
+ <div class="chat-msg assistant">
492
+ <div class="avatar">C</div>
493
+ <div class="msg-content">
494
+ <div class="msg-role">CoStar</div>
495
+ ${s?n`<div class="msg-flow">
496
+ ${t.flow.map(i=>i.type==="text"?n`<div class="msg-text-segment" .innerHTML=${G(i.content)}></div>`:It(i.card))}
497
+ </div>`:n`<div .innerHTML=${G(t.content)}></div>`}
498
+ ${t.meta&&(t.meta.toolCalls||t.meta.inputTokens)?n`<div class="chat-meta">
499
+ ${t.meta.toolCalls?n`<span>&#128295; ${t.meta.toolCalls} tool${t.meta.toolCalls>1?"s":""}</span>`:l}
500
+ ${t.meta.inputTokens?n`<span>&#8594; ${t.meta.inputTokens.toLocaleString()} in</span>`:l}
501
+ ${t.meta.outputTokens?n`<span>&#8592; ${t.meta.outputTokens.toLocaleString()} out</span>`:l}
502
+ ${t.meta.compactionCount?n`<span>&#128230; ${t.meta.compactionCount} compaction${t.meta.compactionCount>1?"s":""}</span>`:l}
503
+ </div>`:l}
504
+ </div>
505
+ </div>
506
+ `}function It(t,e){const s=t.status==="running"?"&#9881;":t.status==="error"?"&#10060;":"&#9989;",i=t.status==="error"?"error":t.status==="done"?"success":"",a=t.durationMs?` (${ys(t.durationMs)})`:"",o=t.status==="running"?"running...":t.status==="error"?`error${a}`:`done${a}`;return n`
507
+ <div class="tool-card" @click=${r=>{r.currentTarget.classList.toggle("expanded")}}>
508
+ <div class="tool-card-header">
509
+ <span class="tool-icon ${t.status==="running"?"running":""}" .innerHTML=${s}></span>
510
+ <span class="tool-name">${t.name}</span>
511
+ <span class="tool-status ${i}">${o}</span>
512
+ <span class="tool-chevron">&#9654;</span>
513
+ </div>
514
+ <div class="tool-card-body">
515
+ ${t.args?n`<div class="tool-section">
516
+ <div class="tool-section-label">Arguments</div>
517
+ <pre>${t.args}</pre>
518
+ </div>`:l}
519
+ ${t.result?n`<div class="tool-section">
520
+ <div class="tool-section-label">Result</div>
521
+ <pre>${t.result}</pre>
522
+ </div>`:l}
523
+ </div>
524
+ </div>
525
+ `}function ys(t){return t<1e3?`${t}ms`:t<6e4?`${(t/1e3).toFixed(1)}s`:`${Math.floor(t/6e4)}m ${Math.floor(t%6e4/1e3)}s`}function G(t){if(!t)return"";let e=Nt(t);return e=e.replace(/```(\w*)\n([\s\S]*?)```/g,'<pre style="background:var(--bg-primary, var(--secondary));border:1px solid var(--border);border-radius:8px;padding:10px;margin:8px 0;overflow-x:auto;font-family:var(--mono);font-size:12px;">$2</pre>'),e=e.replace(/`([^`]+)`/g,'<code style="background:var(--bg-primary, var(--secondary));padding:2px 6px;border-radius:4px;font-family:var(--mono);font-size:12px;">$1</code>'),e=e.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),e=e.replace(/\n/g,"<br>"),e}function $s(t){return n`
526
+ <div class="page-content">
527
+ <!-- Create Form -->
528
+ <div class="card">
529
+ <div class="card-header">
530
+ <h3>Create Cron Job</h3>
531
+ </div>
532
+ <div class="card-body" style="padding: 16px;">
533
+ <div class="form-grid">
534
+ <div class="form-field">
535
+ <label>Name</label>
536
+ <input type="text" class="input" placeholder="Job name" .value=${t.cronForm.name}
537
+ @input=${e=>{t.cronForm={...t.cronForm,name:e.target.value}}} />
538
+ </div>
539
+ <div class="form-field">
540
+ <label>Schedule Type</label>
541
+ <select class="input" .value=${t.cronForm.scheduleType}
542
+ @change=${e=>{t.cronForm={...t.cronForm,scheduleType:e.target.value}}}>
543
+ <option value="every">Every (interval)</option>
544
+ <option value="cron">Cron expression</option>
545
+ <option value="at">At (one-time)</option>
546
+ </select>
547
+ </div>
548
+ ${t.cronForm.scheduleType==="every"?n`
549
+ <div class="form-field">
550
+ <label>Interval (e.g. 30m, 2h, 1d)</label>
551
+ <input type="text" class="input" placeholder="30m" .value=${t.cronForm.every}
552
+ @input=${e=>{t.cronForm={...t.cronForm,every:e.target.value}}} />
553
+ </div>
554
+ `:t.cronForm.scheduleType==="cron"?n`
555
+ <div class="form-field">
556
+ <label>Cron Expression</label>
557
+ <input type="text" class="input" placeholder="0 */6 * * *" .value=${t.cronForm.cronExpression}
558
+ @input=${e=>{t.cronForm={...t.cronForm,cronExpression:e.target.value}}} />
559
+ </div>
560
+ `:n`
561
+ <div class="form-field">
562
+ <label>Run At (ISO datetime)</label>
563
+ <input type="datetime-local" class="input" .value=${t.cronForm.at}
564
+ @input=${e=>{t.cronForm={...t.cronForm,at:e.target.value}}} />
565
+ </div>
566
+ `}
567
+ <div class="form-field" style="grid-column: 1 / -1;">
568
+ <label>Instruction</label>
569
+ <textarea class="input" rows="3" placeholder="What should the agent do?"
570
+ .value=${t.cronForm.instruction}
571
+ @input=${e=>{t.cronForm={...t.cronForm,instruction:e.target.value}}}></textarea>
572
+ </div>
573
+ <div>
574
+ <button class="btn btn-primary" @click=${()=>t.createCronJob()} ?disabled=${t.cronLoading}>
575
+ Create Job
576
+ </button>
577
+ </div>
578
+ </div>
579
+ </div>
580
+ </div>
581
+
582
+ <!-- Jobs List -->
583
+ <div class="card">
584
+ <div class="card-header">
585
+ <h3>Cron Jobs</h3>
586
+ <button class="btn btn-sm" @click=${()=>t.loadCronJobs()}>Refresh</button>
587
+ </div>
588
+ ${t.cronLoading?n`<div class="loading-center"><div class="spinner"></div></div>`:t.cronJobs.length===0?n`<div class="empty-state"><div class="empty-icon">⏰</div><p>No cron jobs configured</p></div>`:n`
589
+ <div class="table-wrap">
590
+ <table>
591
+ <thead>
592
+ <tr><th>Name</th><th>Schedule</th><th>Status</th><th>Next Run</th><th>Instruction</th><th>Actions</th></tr>
593
+ </thead>
594
+ <tbody>
595
+ ${t.cronJobs.map(e=>bs(t,e))}
596
+ </tbody>
597
+ </table>
598
+ </div>
599
+ `}
600
+ </div>
601
+ </div>
602
+ `}function bs(t,e){const s=ws(e),i=e.status==="active"||e.enabled?n`<span class="tag tag-green">Active</span>`:e.status==="completed"?n`<span class="tag tag-blue">Done</span>`:n`<span class="tag tag-muted">Paused</span>`;return n`
603
+ <tr>
604
+ <td><strong>${e.name}</strong></td>
605
+ <td><code>${s}</code></td>
606
+ <td>${i}</td>
607
+ <td>${e.next_run_at?_(e.next_run_at):"--"}</td>
608
+ <td style="max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
609
+ ${(e.instruction||"").substring(0,80)}
610
+ </td>
611
+ <td style="white-space: nowrap;">
612
+ <button class="btn btn-sm btn-primary" @click=${()=>t.runCronJob(e.id)}>Run</button>
613
+ <button class="btn btn-sm" @click=${()=>t.showCronHistory(e.id,e.name)}>History</button>
614
+ <button class="btn btn-sm btn-danger" @click=${()=>t.deleteCronJob(e.id)}>Delete</button>
615
+ </td>
616
+ </tr>
617
+ `}function ws(t){if(t.cron_expression)return t.cron_expression;if(t.schedule_type==="every"&&t.schedule_value){const e=Math.round(t.schedule_value/6e4);return e>=60?`every ${Math.round(e/60)}h`:`every ${e}m`}return t.schedule_at?`at ${new Date(t.schedule_at).toLocaleString()}`:"--"}function Ss(t){return n`
618
+ <div class="page-content">
619
+ <!-- Stats Bar -->
620
+ ${t.activityStats?n`
621
+ <div class="stats-row">
622
+ <div class="stat-card"><div class="stat-label">Total</div><div class="stat-value">${t.activityStats.total}</div></div>
623
+ <div class="stat-card"><div class="stat-label">Completed</div><div class="stat-value" style="color: var(--ok);">${t.activityStats.completed}</div></div>
624
+ <div class="stat-card"><div class="stat-label">Failed</div><div class="stat-value" style="color: var(--danger);">${t.activityStats.failed}</div></div>
625
+ <div class="stat-card"><div class="stat-label">Avg Duration</div><div class="stat-value">${j(t.activityStats.avgDuration||0)}</div></div>
626
+ </div>
627
+ `:l}
628
+
629
+ <!-- Toolbar -->
630
+ <div class="toolbar">
631
+ <input type="text" class="input" placeholder="Search activity..."
632
+ style="max-width: 300px;"
633
+ .value=${t.activitySearch}
634
+ @input=${e=>{t.activitySearch=e.target.value}}
635
+ @keydown=${e=>{e.key==="Enter"&&t.searchActivity()}} />
636
+ <select class="input" style="max-width: 150px;"
637
+ .value=${t.activityStatusFilter}
638
+ @change=${e=>{t.activityStatusFilter=e.target.value,t.loadActivity()}}>
639
+ <option value="">All Status</option>
640
+ <option value="completed">Completed</option>
641
+ <option value="pending">Pending</option>
642
+ <option value="failed">Failed</option>
643
+ </select>
644
+ <button class="btn btn-sm" @click=${()=>t.loadActivity()}>Refresh</button>
645
+ </div>
646
+
647
+ <!-- Table -->
648
+ <div class="card">
649
+ <div class="card-header">
650
+ <h3>Activity Log</h3>
651
+ </div>
652
+ ${t.activityLoading?n`<div class="loading-center"><div class="spinner"></div></div>`:t.activityList.length===0?n`<div class="empty-state"><div class="empty-icon">📊</div><p>No activity recorded yet</p></div>`:n`
653
+ <div class="table-wrap">
654
+ <table>
655
+ <thead>
656
+ <tr><th>Time</th><th>Request</th><th>Status</th><th>Executor</th><th>Duration</th></tr>
657
+ </thead>
658
+ <tbody>
659
+ ${t.activityList.map(e=>xs(t,e))}
660
+ </tbody>
661
+ </table>
662
+ </div>
663
+ ${t.activityHasMore?n`<div style="padding: 16px; text-align: center;"><button class="btn btn-sm" @click=${()=>t.loadMoreActivity()}>Load More</button></div>`:l}
664
+ `}
665
+ </div>
666
+ </div>
667
+
668
+ <!-- Detail Modal -->
669
+ ${t.activityDetail?n`
670
+ <div class="modal-overlay open" @click=${e=>{e.target===e.currentTarget&&(t.activityDetail=null)}}>
671
+ <div class="modal" style="max-width: 800px;">
672
+ <div class="modal-header">
673
+ <h3>Activity Detail</h3>
674
+ <button class="btn btn-sm" @click=${()=>{t.activityDetail=null}}>Close</button>
675
+ </div>
676
+ <div class="modal-body">
677
+ <div class="config-list">
678
+ <div class="config-row"><span class="config-key">ID</span><span class="config-value"><code>${t.activityDetail.id}</code></span></div>
679
+ <div class="config-row"><span class="config-key">Status</span><span class="config-value">${t.activityDetail.status}</span></div>
680
+ <div class="config-row"><span class="config-key">Executor</span><span class="config-value">${t.activityDetail.executor}</span></div>
681
+ <div class="config-row"><span class="config-key">Created</span><span class="config-value">${new Date(t.activityDetail.created_at).toLocaleString()}</span></div>
682
+ ${t.activityDetail.duration?n`<div class="config-row"><span class="config-key">Duration</span><span class="config-value">${j(t.activityDetail.duration)}</span></div>`:l}
683
+ ${t.activityDetail.keywords?n`<div class="config-row"><span class="config-key">Keywords</span><span class="config-value">${t.activityDetail.keywords}</span></div>`:l}
684
+ </div>
685
+ <h4 style="margin-top: 16px;">Request</h4>
686
+ <pre class="code-block">${t.activityDetail.request||"(empty)"}</pre>
687
+ ${t.activityDetail.response?n`<h4 style="margin-top: 16px;">Response</h4><pre class="code-block">${t.activityDetail.response}</pre>`:l}
688
+ ${t.activityDetail.error?n`<h4 style="margin-top: 16px; color: var(--danger);">Error</h4><pre class="code-block" style="color: var(--danger);">${t.activityDetail.error}</pre>`:l}
689
+ </div>
690
+ </div>
691
+ </div>
692
+ `:l}
693
+ `}function xs(t,e){return n`
694
+ <tr style="cursor: pointer;" @click=${()=>{t.activityDetail=e}}>
695
+ <td style="white-space: nowrap;">${_(e.created_at)}</td>
696
+ <td style="max-width: 400px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
697
+ ${nt(e.request||"",80)}
698
+ </td>
699
+ <td>
700
+ <span class="tag ${e.status==="completed"?"tag-green":e.status==="failed"?"tag-red":"tag-yellow"}">${e.status}</span>
701
+ </td>
702
+ <td>
703
+ <span class="tag ${e.executor==="client"?"tag-blue":"tag-muted"}">${e.executor}</span>
704
+ </td>
705
+ <td>${e.duration?j(e.duration):"--"}</td>
706
+ </tr>
707
+ `}function ks(t){const e=t.assetTypeFilter?t.assetsList.filter(s=>s.type===t.assetTypeFilter):t.assetsList;return n`
708
+ <div class="page-content">
709
+ <div class="toolbar">
710
+ <select class="input" style="max-width: 150px;"
711
+ .value=${t.assetTypeFilter}
712
+ @change=${s=>{t.assetTypeFilter=s.target.value}}>
713
+ <option value="">All Types</option>
714
+ <option value="image">Image</option>
715
+ <option value="document">Document</option>
716
+ <option value="audio">Audio</option>
717
+ <option value="video">Video</option>
718
+ <option value="code">Code</option>
719
+ <option value="other">Other</option>
720
+ </select>
721
+ <button class="btn btn-sm" @click=${()=>t.loadAssets()}>Refresh</button>
722
+ <span class="muted-text" style="margin-left: auto;">${e.length} assets</span>
723
+ </div>
724
+
725
+ <div class="card">
726
+ <div class="card-header"><h3>Assets</h3></div>
727
+ ${t.assetsLoading?n`<div class="loading-center"><div class="spinner"></div></div>`:e.length===0?n`<div class="empty-state"><div class="empty-icon">📦</div><p>No assets tracked yet</p></div>`:n`
728
+ <div class="table-wrap">
729
+ <table>
730
+ <thead><tr><th>Name</th><th>Type</th><th>Path / URL</th><th>Created</th></tr></thead>
731
+ <tbody>
732
+ ${e.map(s=>n`
733
+ <tr>
734
+ <td>
735
+ <strong>${s.name}</strong>
736
+ ${s.description?n`<br /><span class="muted-text">${nt(s.description,60)}</span>`:l}
737
+ </td>
738
+ <td><span class="tag tag-blue">${s.type||"unknown"}</span></td>
739
+ <td style="max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
740
+ ${s.remote_url||s.local_file_path||"--"}
741
+ </td>
742
+ <td style="white-space: nowrap;">${_(s.created_at)}</td>
743
+ </tr>
744
+ `)}
745
+ </tbody>
746
+ </table>
747
+ </div>
748
+ `}
749
+ </div>
750
+ </div>
751
+ `}function Cs(t){return n`
752
+ <div class="page-content">
753
+ <div class="card">
754
+ <div class="card-header">
755
+ <h3>Projects</h3>
756
+ <button class="btn btn-sm" @click=${()=>t.loadProjects()}>Refresh</button>
757
+ </div>
758
+ ${t.projectsLoading?n`<div class="loading-center"><div class="spinner"></div></div>`:t.projectsList.length===0?n`<div class="empty-state"><div class="empty-icon">📂</div><p>No projects yet</p></div>`:n`
759
+ <div class="table-wrap">
760
+ <table>
761
+ <thead><tr><th>Name</th><th>Description</th><th>Path</th><th>Status</th><th>Created</th></tr></thead>
762
+ <tbody>
763
+ ${t.projectsList.map(e=>n`
764
+ <tr style="${e.is_active?"border-left: 3px solid var(--ok);":""}">
765
+ <td><strong>${e.name}</strong></td>
766
+ <td style="max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
767
+ ${nt(e.description||"",80)}
768
+ </td>
769
+ <td><code>${e.project_path||"--"}</code></td>
770
+ <td>
771
+ ${e.is_active?n`<span class="tag tag-green">Active</span>`:n`<span class="tag tag-muted">Inactive</span>`}
772
+ </td>
773
+ <td style="white-space: nowrap;">${_(e.created_at)}</td>
774
+ </tr>
775
+ `)}
776
+ </tbody>
777
+ </table>
778
+ </div>
779
+ `}
780
+ </div>
781
+ </div>
782
+ `}function _s(t){return t.sessionDetail?As(t):n`
783
+ <div class="page-content">
784
+ <div class="card">
785
+ <div class="card-header">
786
+ <h3>Session Files</h3>
787
+ <button class="btn btn-sm" @click=${()=>t.loadSessions()}>Refresh</button>
788
+ </div>
789
+ ${t.sessionsLoading?n`<div class="loading-center"><div class="spinner"></div></div>`:t.sessionsList.length===0?n`<div class="empty-state"><div class="empty-icon">&#128221;</div><p>No session files found</p></div>`:n`
790
+ <div class="table-wrap">
791
+ <table>
792
+ <thead><tr><th>File</th><th>Size</th><th>Modified</th><th>Actions</th></tr></thead>
793
+ <tbody>
794
+ ${t.sessionsList.map(e=>n`
795
+ <tr>
796
+ <td><code>${e.name}</code></td>
797
+ <td>${Ds(e.size)}</td>
798
+ <td>${e.modified?_(e.modified):"--"}</td>
799
+ <td>
800
+ <button class="btn btn-sm" @click=${()=>t.viewSession(e.name)}>View</button>
801
+ </td>
802
+ </tr>
803
+ `)}
804
+ </tbody>
805
+ </table>
806
+ </div>
807
+ `}
808
+ </div>
809
+ </div>
810
+ `}function As(t){const e=t.sessionDetail||[],s=t.sessionViewMode==="parsed";return n`
811
+ <div class="page-content">
812
+ <div class="card">
813
+ <div class="card-header">
814
+ <div style="display:flex;align-items:center;gap:12px;">
815
+ <button class="btn btn-sm" @click=${()=>t.closeSession()}>&#8592; Back</button>
816
+ <h3 style="margin:0;">${t.sessionDetailName}</h3>
817
+ <span class="tag tag-muted" style="font-size:11px;">${e.length} entries</span>
818
+ </div>
819
+ <div style="display:flex;gap:8px;">
820
+ <button class="btn btn-sm ${s?"btn-primary":""}" @click=${()=>t.switchSessionView("parsed")}>Conversation</button>
821
+ <button class="btn btn-sm ${s?"":"btn-primary"}" @click=${()=>t.switchSessionView("raw")}>Raw JSON</button>
822
+ </div>
823
+ </div>
824
+ <div class="card-body" style="padding:0;">
825
+ ${s?Es(e):Ts(t)}
826
+ </div>
827
+ </div>
828
+ </div>
829
+ `}function Es(t){return!t||t.length===0?n`<div style="padding:20px;text-align:center;color:var(--text-secondary);">No conversation data</div>`:t.length>0&&t[0]?.turnNumber!==void 0?n`
830
+ <div class="session-parsed" style="max-height:600px;overflow-y:auto;padding:16px;">
831
+ ${t.map(s=>Ms(s))}
832
+ </div>
833
+ `:n`
834
+ <div class="session-parsed" style="max-height:600px;overflow-y:auto;padding:16px;">
835
+ ${t.map((s,i)=>Ls(s))}
836
+ </div>
837
+ `}function Ms(t){const e=t.isOld||t.outOfContext;return t.type==="compaction"||t.compaction?n`
838
+ <div class="session-compaction">
839
+ <div class="session-compaction-header">&#128230; Context Compaction</div>
840
+ ${t.timestamp?n`<div style="font-size:11px;color:var(--text-secondary);">${new Date(t.timestamp).toLocaleString()}</div>`:l}
841
+ ${t.tokensBefore?n`<div style="font-size:12px;">Tokens: ${t.tokensBefore} &#8594; ${t.tokensAfter||"?"}</div>`:l}
842
+ ${t.summary?n`<div style="font-size:12px;margin-top:4px;">${(t.summary||"").substring(0,500)}</div>`:l}
843
+ </div>
844
+ `:n`
845
+ <div class="session-turn ${e?"session-turn-old":""}">
846
+ <div class="session-turn-header">
847
+ <span class="session-turn-num">Turn ${t.turnNumber||"?"}</span>
848
+ ${t.timestamp?n`<span class="session-turn-time">${new Date(t.timestamp).toLocaleString()}</span>`:l}
849
+ ${t.isHeartbeat?n`<span class="tag tag-blue" style="font-size:10px;">HB</span>`:l}
850
+ ${e?n`<span class="tag tag-muted" style="font-size:10px;">OLD</span>`:l}
851
+ </div>
852
+ ${t.userMessage?n`
853
+ <div class="session-turn-user">
854
+ <strong>User:</strong> ${(t.userMessage||"").substring(0,120)}${(t.userMessage||"").length>120?"...":""}
855
+ </div>
856
+ `:l}
857
+ ${t.model?n`
858
+ <div class="session-turn-meta">
859
+ ${t.model?n`<span>${t.model}</span>`:l}
860
+ ${t.inputTokens?n`<span>${t.inputTokens.toLocaleString()} in</span>`:l}
861
+ ${t.outputTokens?n`<span>${t.outputTokens.toLocaleString()} out</span>`:l}
862
+ ${t.cost?n`<span>$${t.cost.toFixed(4)}</span>`:l}
863
+ </div>
864
+ `:l}
865
+ ${t.toolCalls?n`
866
+ <div class="session-turn-tools">&#128295; ${t.toolCalls} tool call${t.toolCalls>1?"s":""}</div>
867
+ `:l}
868
+ ${t.assistantMessages&&t.assistantMessages.length>0?n`
869
+ ${t.assistantMessages.map(i=>n`
870
+ <div class="session-turn-assistant">${(i||"").substring(0,300)}${(i||"").length>300?"...":""}</div>
871
+ `)}
872
+ `:t.assistantMessage?n`
873
+ <div class="session-turn-assistant">${(t.assistantMessage||"").substring(0,300)}${(t.assistantMessage||"").length>300?"...":""}</div>
874
+ `:l}
875
+ </div>
876
+ `}function Ls(t,e){const s=t.role||"unknown",i=s==="user",a=s==="assistant",o=typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2);return n`
877
+ <div class="session-msg session-msg-${s}">
878
+ <div class="session-msg-role">${i?"User":a?"Assistant":"System"}</div>
879
+ <div class="session-msg-content">${(o||"").substring(0,500)}${(o||"").length>500?"...":""}</div>
880
+ </div>
881
+ `}function Ts(t){return t.sessionRawContent?n`
882
+ <pre class="session-raw">${t.sessionRawContent}</pre>
883
+ `:n`<div class="loading-center" style="padding:20px;"><div class="spinner"></div></div>`}function Ds(t){return t?t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}KB`:`${(t/(1024*1024)).toFixed(1)}MB`:"--"}function Rs(t){return n`
884
+ <div class="page-content">
885
+ <div class="card">
886
+ <div class="card-header">
887
+ <h3>Workspace Files</h3>
888
+ <button class="btn btn-sm" @click=${()=>t.loadWorkspaceFiles()}>Refresh</button>
889
+ </div>
890
+ ${t.workspaceLoading?n`<div class="loading-center"><div class="spinner"></div></div>`:t.workspaceFiles.length===0?n`<div class="empty-state"><div class="empty-icon">📁</div><p>No workspace files</p></div>`:n`
891
+ <div class="table-wrap">
892
+ <table>
893
+ <thead><tr><th>File</th><th>Size</th><th>Modified</th><th>Actions</th></tr></thead>
894
+ <tbody>
895
+ ${t.workspaceFiles.map(e=>n`
896
+ <tr class="${t.workspaceEditingFile===e.name?"row-active":""}">
897
+ <td><code>${e.name}</code></td>
898
+ <td>${e.size}B</td>
899
+ <td>${e.modified?_(e.modified):"--"}</td>
900
+ <td>
901
+ <button class="btn btn-sm" @click=${()=>t.editWorkspaceFile(e.name)}>
902
+ ${t.workspaceEditingFile===e.name?"Refresh":"Edit"}
903
+ </button>
904
+ </td>
905
+ </tr>
906
+ `)}
907
+ </tbody>
908
+ </table>
909
+ </div>
910
+ `}
911
+ </div>
912
+
913
+ ${t.workspaceEditingFile?n`
914
+ <div class="card">
915
+ <div class="card-header">
916
+ <h3>${t.workspaceEditingFile}</h3>
917
+ <div style="display: flex; gap: 8px;">
918
+ <button class="btn btn-sm btn-primary" @click=${()=>t.saveWorkspaceFile()} ?disabled=${t.workspaceSaving}>
919
+ ${t.workspaceSaving?"Saving...":"Save"}
920
+ </button>
921
+ <button class="btn btn-sm" @click=${()=>{t.workspaceEditingFile="",t.workspaceEditContent=""}}>Close</button>
922
+ </div>
923
+ </div>
924
+ <div class="card-body" style="padding: 0;">
925
+ <textarea
926
+ class="workspace-editor"
927
+ style="width: 100%; min-height: 400px; padding: 16px; font-family: var(--mono); font-size: 13px; background: var(--bg); color: var(--text); border: none; resize: vertical;"
928
+ .value=${t.workspaceEditContent}
929
+ @input=${e=>{t.workspaceEditContent=e.target.value}}
930
+ ></textarea>
931
+ </div>
932
+ </div>
933
+ `:l}
934
+ </div>
935
+ `}function Fs(t){return n`
936
+ <div class="page-content">
937
+ <div class="toolbar">
938
+ <h3 style="margin:0;font-size:15px;font-weight:600;">Skills</h3>
939
+ <button class="btn btn-sm" style="margin-left:auto;" @click=${()=>t.loadSkills()}>Refresh</button>
940
+ </div>
941
+
942
+ ${t.skillsLoading?n`<div class="loading-center"><div class="spinner"></div></div>`:t.skillsList.length===0?n`<div class="empty-state"><div class="empty-icon">&#9889;</div><p>No skills loaded. Add skills to your workspace or managed directory.</p></div>`:n`
943
+ <div class="skill-grid">
944
+ ${t.skillsList.map(e=>n`
945
+ <div class="skill-card" @click=${()=>t.showSkillDetail(e.name)} style="cursor:pointer;">
946
+ <div class="skill-header">
947
+ <span class="skill-emoji">${e.emoji||"&#128230;"}</span>
948
+ <span class="skill-name">${e.name}</span>
949
+ </div>
950
+ <div class="skill-desc">${e.description||"No description"}</div>
951
+ <div class="skill-footer">
952
+ ${e.eligible!==void 0?e.eligible?n`<span class="tag tag-green">Eligible</span>`:n`<span class="tag tag-muted">Inactive</span>`:e.enabled?n`<span class="tag tag-green">Enabled</span>`:n`<span class="tag tag-muted">Disabled</span>`}
953
+ ${e.source?n`<span class="tag tag-blue">${e.source}</span>`:l}
954
+ </div>
955
+ </div>
956
+ `)}
957
+ </div>
958
+ `}
959
+ </div>
960
+
961
+ ${Ps(t)}
962
+ `}function Ps(t){if(!t.skillDetailOpen)return l;const e=t.skillDetail;if(!e)return n`
963
+ <div class="modal-overlay open" @click=${a=>{a.target===a.currentTarget&&t.closeSkillDetail()}}>
964
+ <div class="modal" style="max-width:800px;">
965
+ <div class="loading-center"><div class="spinner"></div></div>
966
+ </div>
967
+ </div>
968
+ `;const s=e.files||[],i=s.length>0;return n`
969
+ <div class="modal-overlay open" @click=${a=>{a.target===a.currentTarget&&t.closeSkillDetail()}}>
970
+ <div class="modal" style="max-width:800px;">
971
+ <div class="modal-header">
972
+ <h3>${e.emoji||"&#128230;"} ${e.name}</h3>
973
+ <button class="btn btn-sm" @click=${()=>t.closeSkillDetail()}>Close</button>
974
+ </div>
975
+ <div class="modal-body">
976
+ ${e.description?n`<p style="margin:0 0 16px;color:var(--text-secondary);">${e.description}</p>`:l}
977
+
978
+ <div class="config-list">
979
+ ${e.source?n`<div class="config-row"><span class="config-key">Source</span><span class="config-value">${e.source}</span></div>`:l}
980
+ <div class="config-row">
981
+ <span class="config-key">Eligible</span>
982
+ <span class="config-value">
983
+ ${e.eligible!==void 0?e.eligible?n`<span class="tag tag-green">Yes</span>`:n`<span class="tag tag-muted">No</span>`:e.enabled?n`<span class="tag tag-green">Yes</span>`:n`<span class="tag tag-muted">No</span>`}
984
+ </span>
985
+ </div>
986
+ ${e.baseDir?n`<div class="config-row"><span class="config-key">Base Directory</span><span class="config-value"><code>${e.baseDir}</code></span></div>`:l}
987
+ ${e.homepage?n`<div class="config-row"><span class="config-key">Homepage</span><span class="config-value"><a href="${e.homepage}" target="_blank" style="color:var(--accent);">${e.homepage}</a></span></div>`:l}
988
+ </div>
989
+
990
+ ${i?n`
991
+ <div style="margin-top:16px;">
992
+ <div class="file-tabs">
993
+ ${s.map((a,o)=>n`
994
+ <button class="file-tab ${o===t.skillFileTab?"active":""}"
995
+ @click=${()=>{t.skillFileTab=o}}>
996
+ ${a.name}
997
+ </button>
998
+ `)}
999
+ </div>
1000
+ ${s.map((a,o)=>n`
1001
+ <div class="file-content ${o===t.skillFileTab?"active":""}" style="${o===t.skillFileTab?"":"display:none;"}">
1002
+ <div style="padding:8px 12px;font-size:12px;color:var(--text-secondary);border-bottom:1px solid var(--border);">
1003
+ ${a.path||a.name} ${a.size?n`&#8226; ${(a.size/1024).toFixed(1)} KB`:l}
1004
+ </div>
1005
+ <pre style="max-height:400px;overflow:auto;padding:12px;margin:0;font-size:12px;font-family:var(--mono);white-space:pre-wrap;word-break:break-all;">${a.content}</pre>
1006
+ </div>
1007
+ `)}
1008
+ </div>
1009
+ `:e.content?n`
1010
+ <pre style="margin-top:16px;max-height:400px;overflow:auto;padding:12px;background:var(--bg-primary);border:1px solid var(--border);border-radius:8px;font-size:12px;font-family:var(--mono);white-space:pre-wrap;">${e.content}</pre>
1011
+ `:l}
1012
+ </div>
1013
+ </div>
1014
+ </div>
1015
+ `}function Os(t){const e=Bs(t);return n`
1016
+ <div class="page-content">
1017
+ <div class="log-toolbar">
1018
+ <select class="input" style="width:auto;min-width:130px;"
1019
+ .value=${t.logComponentFilter}
1020
+ @change=${s=>{t.logComponentFilter=s.target.value}}>
1021
+ <option value="">All Components</option>
1022
+ ${t.logComponents.map(s=>n`<option value="${s}">${s}</option>`)}
1023
+ </select>
1024
+ <select class="input" style="width:auto;min-width:130px;"
1025
+ .value=${t.logFilter}
1026
+ @change=${s=>{t.logFilter=s.target.value}}>
1027
+ <option value="">All Levels</option>
1028
+ <option value="info">Info</option>
1029
+ <option value="warn">Warn</option>
1030
+ <option value="error">Error</option>
1031
+ <option value="debug">Debug</option>
1032
+ </select>
1033
+ <button class="btn btn-sm" @click=${()=>t.startLogStream()}>Refresh</button>
1034
+ <label style="display:flex;align-items:center;gap:6px;margin-bottom:0;cursor:pointer;">
1035
+ <input type="checkbox" ?checked=${t.logStreaming}
1036
+ @change=${s=>{s.target.checked?t.startLogStream():t.stopLogStream()}} />
1037
+ <span style="font-size:13px;">Live</span>
1038
+ </label>
1039
+ <button class="btn btn-sm btn-danger" style="margin-left:auto;" @click=${()=>{t.logEntries=[]}}>Clear View</button>
1040
+ </div>
1041
+
1042
+ <div class="log-entries">
1043
+ ${e.length===0?n`<div style="padding:20px;color:var(--muted, var(--text-muted));text-align:center;">
1044
+ ${t.logStreaming?"Waiting for log entries...":"No log entries. Enable Live streaming to see logs."}
1045
+ </div>`:e.map(s=>Hs(s))}
1046
+ </div>
1047
+ </div>
1048
+ `}function Bs(t){let e=t.logEntries;return t.logComponentFilter&&(e=e.filter(s=>(s.component||"").toLowerCase()===t.logComponentFilter.toLowerCase())),t.logFilter&&(e=e.filter(s=>{const i=(s.level||"").toLowerCase();return t.logFilter==="error"?i==="error"||i==="fatal":t.logFilter==="warn"?i==="warn"||i==="error"||i==="fatal":t.logFilter==="info"?i==="info":t.logFilter==="debug"?i==="debug":!0})),e}function Hs(t){if(typeof t=="string")return n`<div class="log-line"><span class="log-msg">${t}</span></div>`;const e=t.timestamp?new Date(t.timestamp).toLocaleTimeString():"",s=(t.level||"info").toLowerCase(),i=t.component||"",a=t.message||JSON.stringify(t);return n`
1049
+ <div class="log-line">
1050
+ <span class="log-time">${e}</span>
1051
+ <span class="log-level ${s}">${s.toUpperCase()}</span>
1052
+ <span class="log-comp">${i}</span>
1053
+ <span class="log-msg">${a}</span>
1054
+ </div>
1055
+ `}function Us(t){const e=t.envVars.filter(i=>i.source==="platform"),s=t.envVars.filter(i=>i.source!=="platform");return n`
1056
+ <div class="page-content">
1057
+ <!-- Environment Variables -->
1058
+ <div class="card">
1059
+ <div class="card-header">
1060
+ <h3>Environment Variables</h3>
1061
+ <div style="display:flex;gap:8px;">
1062
+ <button class="btn btn-sm btn-primary" @click=${()=>t.openEnvModal()}>Add</button>
1063
+ <button class="btn btn-sm" @click=${()=>t.loadEnv()}>Refresh</button>
1064
+ </div>
1065
+ </div>
1066
+ ${t.envLoading?n`<div class="loading-center"><div class="spinner"></div></div>`:t.envVars.length===0?n`<div class="empty-state" style="padding:20px;"><p>No environment variables configured.</p></div>`:n`
1067
+ <div class="table-wrap">
1068
+ <table>
1069
+ <thead><tr><th>Key</th><th>Value</th><th>Actions</th></tr></thead>
1070
+ <tbody>
1071
+ ${e.length>0?n`
1072
+ <tr><td colspan="3" style="padding:8px 12px;font-size:12px;font-weight:600;color:var(--text-secondary);background:var(--bg-secondary,var(--bg-hover));">Platform Managed</td></tr>
1073
+ ${e.map(i=>mt(t,i,!0))}
1074
+ `:l}
1075
+ ${s.length>0?n`
1076
+ <tr><td colspan="3" style="padding:8px 12px;font-size:12px;font-weight:600;color:var(--text-secondary);background:var(--bg-secondary,var(--bg-hover));">User Configured</td></tr>
1077
+ ${s.map(i=>mt(t,i,!1))}
1078
+ `:l}
1079
+ </tbody>
1080
+ </table>
1081
+ </div>
1082
+ `}
1083
+ </div>
1084
+
1085
+ <!-- Server Configuration -->
1086
+ <div class="card">
1087
+ <div class="card-header">
1088
+ <h3>Configuration</h3>
1089
+ <button class="btn btn-sm" @click=${()=>t.loadConfig()}>Refresh</button>
1090
+ </div>
1091
+ ${t.configLoading?n`<div class="loading-center"><div class="spinner"></div></div>`:Object.keys(t.configData).length===0?n`<div class="empty-state" style="padding:20px;"><p>No configuration found. Run <code>costar setup</code> to configure.</p></div>`:n`
1092
+ <div class="config-list" style="padding:16px;">
1093
+ ${Object.entries(t.configData).map(([i,a])=>n`
1094
+ <div class="config-row">
1095
+ <span class="config-key">${i}</span>
1096
+ <span class="config-value">${String(a)}</span>
1097
+ </div>
1098
+ `)}
1099
+ </div>
1100
+ `}
1101
+ </div>
1102
+
1103
+ <!-- Paths -->
1104
+ <div class="card">
1105
+ <div class="card-header"><h3>Paths</h3></div>
1106
+ <div class="config-list" style="padding:16px;">
1107
+ <div class="config-row">
1108
+ <span class="config-key">Config Directory</span>
1109
+ <span class="config-value"><code>${t.configData.configDir||t.configData.workspaceDir||"~/.costar"}</code></span>
1110
+ </div>
1111
+ <div class="config-row">
1112
+ <span class="config-key">Logs Directory</span>
1113
+ <span class="config-value"><code>${t.configData.logsDir||"~/.costar/logs"}</code></span>
1114
+ </div>
1115
+ </div>
1116
+ </div>
1117
+ </div>
1118
+
1119
+ ${Ns(t)}
1120
+ `}function mt(t,e,s){const i=e.key.toLowerCase().match(/key|secret|token|password/),a=t.envRevealedKeys[e.key],o=a||(i?"••••••••":e.value);return n`
1121
+ <tr style="${s?"opacity:0.7;":""}">
1122
+ <td><code style="color:var(--accent);">${e.key}</code></td>
1123
+ <td style="font-family:var(--mono);font-size:12px;max-width:300px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">
1124
+ ${o}
1125
+ </td>
1126
+ <td style="white-space:nowrap;">
1127
+ ${i?n`
1128
+ <button class="btn btn-sm" @click=${()=>t.revealEnvValue(e.key)}>
1129
+ ${a?"Hide":"Reveal"}
1130
+ </button>
1131
+ `:l}
1132
+ ${s?l:n`
1133
+ <button class="btn btn-sm" @click=${()=>t.editEnvModal(e.key)}>Edit</button>
1134
+ <button class="btn btn-sm btn-danger" @click=${()=>t.deleteEnvVariable(e.key)}>Delete</button>
1135
+ `}
1136
+ </td>
1137
+ </tr>
1138
+ `}function Ns(t){return t.envModalOpen?n`
1139
+ <div class="modal-overlay open" @click=${e=>{e.target===e.currentTarget&&t.closeEnvModal()}}>
1140
+ <div class="modal">
1141
+ <div class="modal-header">
1142
+ <h3>${t.envModalEditing?"Edit":"Add"} Environment Variable</h3>
1143
+ <button class="btn btn-sm" @click=${()=>t.closeEnvModal()}>Close</button>
1144
+ </div>
1145
+ <div class="modal-body">
1146
+ <div class="form-group">
1147
+ <label>Key</label>
1148
+ <input class="input" type="text" placeholder="VARIABLE_NAME"
1149
+ .value=${t.envModalKey}
1150
+ ?disabled=${t.envModalEditing}
1151
+ @input=${e=>{t.envModalKey=e.target.value}}
1152
+ style="text-transform:uppercase;" />
1153
+ </div>
1154
+ <div class="form-group">
1155
+ <label>Value</label>
1156
+ <input class="input" type="text" placeholder="value"
1157
+ .value=${t.envModalValue}
1158
+ @input=${e=>{t.envModalValue=e.target.value}} />
1159
+ </div>
1160
+ <div class="modal-actions">
1161
+ <button class="btn" @click=${()=>t.closeEnvModal()}>Cancel</button>
1162
+ <button class="btn btn-primary" @click=${()=>t.saveEnvVariable()}>Save</button>
1163
+ </div>
1164
+ </div>
1165
+ </div>
1166
+ </div>
1167
+ `:l}function Is(t){return n`
1168
+ <div class="shell">
1169
+ ${cs(t)}
1170
+ ${ds(t)}
1171
+
1172
+ <main class="content">
1173
+ ${Vs(t)}
1174
+ </main>
1175
+ </div>
1176
+
1177
+ ${js(t)}
1178
+ `}function Vs(t){switch(t.tab){case"dashboard":return ps(t);case"chat":return gs(t);case"cron":return $s(t);case"activity":return Ss(t);case"assets":return ks(t);case"projects":return Cs(t);case"sessions":return _s(t);case"workspace":return Rs(t);case"skills":return Fs(t);case"logs":return Os(t);case"config":return Us(t);default:return n`<p>Unknown page</p>`}}function js(t){return t.cronHistoryOpen?n`
1179
+ <div class="modal-overlay open" @click=${e=>{e.target===e.currentTarget&&(t.cronHistoryOpen=!1)}}>
1180
+ <div class="modal" style="max-width: 700px;">
1181
+ <div class="modal-header">
1182
+ <h3>History: ${t.cronHistoryJob}</h3>
1183
+ <button class="btn btn-sm" @click=${()=>{t.cronHistoryOpen=!1}}>Close</button>
1184
+ </div>
1185
+ <div class="modal-body">
1186
+ ${t.cronHistory.length===0?n`<p class="muted-text">No run history</p>`:n`
1187
+ <div class="table-wrap">
1188
+ <table>
1189
+ <thead>
1190
+ <tr><th>Time</th><th>Status</th><th>Duration</th><th>Summary</th></tr>
1191
+ </thead>
1192
+ <tbody>
1193
+ ${t.cronHistory.map(e=>n`
1194
+ <tr>
1195
+ <td>${new Date(e.startedAt).toLocaleString()}</td>
1196
+ <td>
1197
+ <span class="tag ${e.status==="ok"?"tag-green":e.status==="error"?"tag-red":"tag-yellow"}">
1198
+ ${e.status}
1199
+ </span>
1200
+ </td>
1201
+ <td>${e.duration?`${(e.duration/1e3).toFixed(1)}s`:"--"}</td>
1202
+ <td style="max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
1203
+ ${e.summary||e.error||"--"}
1204
+ </td>
1205
+ </tr>
1206
+ `)}
1207
+ </tbody>
1208
+ </table>
1209
+ </div>
1210
+ `}
1211
+ </div>
1212
+ </div>
1213
+ </div>
1214
+ `:l}var zs=Object.defineProperty,Js=Object.getOwnPropertyDescriptor,d=(t,e,s,i)=>{for(var a=i>1?void 0:i?Js(e,s):e,o=t.length-1,r;o>=0;o--)(r=t[o])&&(a=(i?r(e,s,a):r(a))||a);return i&&a&&zs(e,s,a),a};let c=class extends D{constructor(){super(...arguments),this.settings=ge(),this.tab="dashboard",this.theme="system",this.themeResolved="dark",this.serverStatus=null,this.activityStats=null,this.activeProject=null,this.projectCount=null,this.recentActivity=[],this.sessionInfo=null,this.versionInfo=null,this.statusResponse=null,this.chatMessage="",this.chatMessages=[],this.chatLoading=!1,this.chatSending=!1,this.chatStream=null,this.chatStreamFlow=[],this.chatCompacting=!1,this.chatButtonLabel="",this.chatAbort=null,this.cronJobs=[],this.cronLoading=!1,this.cronForm={...xt},this.cronHistory=[],this.cronHistoryJob="",this.cronHistoryOpen=!1,this.activityList=[],this.activityLoading=!1,this.activitySearch="",this.activityStatusFilter="",this.activityOffset=0,this.activityHasMore=!1,this.activityDetail=null,this.assetsList=[],this.assetsLoading=!1,this.assetTypeFilter="",this.projectsList=[],this.projectsLoading=!1,this.sessionsList=[],this.sessionsLoading=!1,this.sessionDetail=null,this.sessionDetailName="",this.sessionViewMode="parsed",this.sessionRawContent="",this._sessionPollTimer=null,this.workspaceFiles=[],this.workspaceLoading=!1,this.workspaceEditingFile="",this.workspaceEditContent="",this.workspaceSaving=!1,this.skillsList=[],this.skillsLoading=!1,this.skillDetail=null,this.skillDetailOpen=!1,this.skillFileTab=0,this.logEntries=[],this.logStreaming=!1,this.logFilter="",this.logComponentFilter="",this.logComponents=[],this.logStream=null,this.configData={},this.configLoading=!1,this.envVars=[],this.envLoading=!1,this.envRevealedKeys={},this.envModalOpen=!1,this.envModalKey="",this.envModalValue="",this.envModalEditing=!1,this.updating=!1,this.updateResult="",this.popStateHandler=null}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.popStateHandler=()=>ts(this),window.addEventListener("popstate",this.popStateHandler),es(this)}disconnectedCallback(){ss(this),super.disconnectedCallback()}setTab(t){Xe(this,t)}setTheme(t){Qe(this,t)}async handleSendChat(t){await os(this,t)}abortChat(){rs(this)}async loadDashboard(){await At(this)}async compactSession(){await Ee(this)}async resetSession(){await Me(this)}async triggerManualUpdate(){await Le()}async loadCronJobs(){await K(this)}async createCronJob(){await Te(this)}async runCronJob(t){await De(this,t)}async deleteCronJob(t){await Re(this,t)}async showCronHistory(t,e){await Fe(this,t,e)}async loadActivity(){await st(this)}async loadMoreActivity(){await Pe(this)}async searchActivity(){await Oe(this)}async loadAssets(){await Et(this)}async loadProjects(){await Mt(this)}async loadSessions(){await Lt(this)}async viewSession(t){await Be(this,t)}closeSession(){Ue(this)}switchSessionView(t){He(this,t)}async loadRawSession(){await Tt(this)}async loadWorkspaceFiles(){await Dt(this)}async editWorkspaceFile(t){await Ie(this,t)}async saveWorkspaceFile(){await Ve(this)}async loadSkills(){await Rt(this)}async showSkillDetail(t){await je(this,t)}closeSkillDetail(){ze(this)}startLogStream(){Bt(this)}stopLogStream(){Ht(this)}async loadInitialLogs(){await Ot(this)}async loadConfig(){await Ft(this)}async loadEnv(){await W(this)}async selfUpdate(){await Ge(this)}openEnvModal(){Ke(this)}editEnvModal(t){We(this,t)}closeEnvModal(){Pt(this)}async saveEnvVariable(){await qe(this)}async deleteEnvVariable(t){await Ze(this,t)}async revealEnvValue(t){await Je(this,t)}render(){return Is(this)}};d([h()],c.prototype,"settings",2);d([h()],c.prototype,"tab",2);d([h()],c.prototype,"theme",2);d([h()],c.prototype,"themeResolved",2);d([h()],c.prototype,"serverStatus",2);d([h()],c.prototype,"activityStats",2);d([h()],c.prototype,"activeProject",2);d([h()],c.prototype,"projectCount",2);d([h()],c.prototype,"recentActivity",2);d([h()],c.prototype,"sessionInfo",2);d([h()],c.prototype,"versionInfo",2);d([h()],c.prototype,"statusResponse",2);d([h()],c.prototype,"chatMessage",2);d([h()],c.prototype,"chatMessages",2);d([h()],c.prototype,"chatLoading",2);d([h()],c.prototype,"chatSending",2);d([h()],c.prototype,"chatStream",2);d([h()],c.prototype,"chatStreamFlow",2);d([h()],c.prototype,"chatCompacting",2);d([h()],c.prototype,"chatButtonLabel",2);d([h()],c.prototype,"cronJobs",2);d([h()],c.prototype,"cronLoading",2);d([h()],c.prototype,"cronForm",2);d([h()],c.prototype,"cronHistory",2);d([h()],c.prototype,"cronHistoryJob",2);d([h()],c.prototype,"cronHistoryOpen",2);d([h()],c.prototype,"activityList",2);d([h()],c.prototype,"activityLoading",2);d([h()],c.prototype,"activitySearch",2);d([h()],c.prototype,"activityStatusFilter",2);d([h()],c.prototype,"activityOffset",2);d([h()],c.prototype,"activityHasMore",2);d([h()],c.prototype,"activityDetail",2);d([h()],c.prototype,"assetsList",2);d([h()],c.prototype,"assetsLoading",2);d([h()],c.prototype,"assetTypeFilter",2);d([h()],c.prototype,"projectsList",2);d([h()],c.prototype,"projectsLoading",2);d([h()],c.prototype,"sessionsList",2);d([h()],c.prototype,"sessionsLoading",2);d([h()],c.prototype,"sessionDetail",2);d([h()],c.prototype,"sessionDetailName",2);d([h()],c.prototype,"sessionViewMode",2);d([h()],c.prototype,"sessionRawContent",2);d([h()],c.prototype,"workspaceFiles",2);d([h()],c.prototype,"workspaceLoading",2);d([h()],c.prototype,"workspaceEditingFile",2);d([h()],c.prototype,"workspaceEditContent",2);d([h()],c.prototype,"workspaceSaving",2);d([h()],c.prototype,"skillsList",2);d([h()],c.prototype,"skillsLoading",2);d([h()],c.prototype,"skillDetail",2);d([h()],c.prototype,"skillDetailOpen",2);d([h()],c.prototype,"skillFileTab",2);d([h()],c.prototype,"logEntries",2);d([h()],c.prototype,"logStreaming",2);d([h()],c.prototype,"logFilter",2);d([h()],c.prototype,"logComponentFilter",2);d([h()],c.prototype,"logComponents",2);d([h()],c.prototype,"configData",2);d([h()],c.prototype,"configLoading",2);d([h()],c.prototype,"envVars",2);d([h()],c.prototype,"envLoading",2);d([h()],c.prototype,"envRevealedKeys",2);d([h()],c.prototype,"envModalOpen",2);d([h()],c.prototype,"envModalKey",2);d([h()],c.prototype,"envModalValue",2);d([h()],c.prototype,"envModalEditing",2);d([h()],c.prototype,"updating",2);d([h()],c.prototype,"updateResult",2);c=d([he("costar-app")],c);
1215
+ //# sourceMappingURL=index-Ca6N-CJM.js.map